@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.
- package/LICENSE +21 -0
- package/README.md +1 -0
- package/package.json +84 -0
- package/src/theme.css +536 -0
- package/trellis_ui/static/trellis_ui/css/styles.css +4382 -0
- package/trellis_ui/static/trellis_ui/js/esm/chunks/cally-TZl4LpyH.js +1134 -0
- package/trellis_ui/static/trellis_ui/js/esm/chunks/cally-TZl4LpyH.js.map +1 -0
- package/trellis_ui/static/trellis_ui/js/esm/chunks/dist-DMX3Q5Zu.js +551 -0
- package/trellis_ui/static/trellis_ui/js/esm/chunks/dist-DMX3Q5Zu.js.map +1 -0
- package/trellis_ui/static/trellis_ui/js/esm/index.js +14181 -0
- package/trellis_ui/static/trellis_ui/js/esm/index.js.map +1 -0
- package/trellis_ui/static/trellis_ui/js/index.js +10 -0
- package/types/bindings/disclosure.d.ts +3 -0
- package/types/bindings/index.d.ts +7 -0
- package/types/bindings/motion.d.ts +3 -0
- package/types/bindings/state.d.ts +3 -0
- package/types/bindings/types.d.ts +35 -0
- package/types/components/accordion/contract.d.ts +29 -0
- package/types/components/accordion/index.d.ts +44 -0
- package/types/components/action/contract.d.ts +14 -0
- package/types/components/action/index.d.ts +2 -0
- package/types/components/app/contract.d.ts +29 -0
- package/types/components/app/index.d.ts +2 -0
- package/types/components/badge/contract.d.ts +42 -0
- package/types/components/badge/index.d.ts +0 -0
- package/types/components/box/contract.d.ts +44 -0
- package/types/components/box/index.d.ts +2 -0
- package/types/components/brand/contract.d.ts +18 -0
- package/types/components/brand/index.d.ts +0 -0
- package/types/components/button/contract.d.ts +34 -0
- package/types/components/button/index.d.ts +3 -0
- package/types/components/card/contract.d.ts +56 -0
- package/types/components/card/index.d.ts +0 -0
- package/types/components/checkbox/contract.d.ts +85 -0
- package/types/components/checkbox/index.d.ts +34 -0
- package/types/components/combobox/contract.d.ts +57 -0
- package/types/components/combobox/index.d.ts +74 -0
- package/types/components/common.d.ts +61 -0
- package/types/components/date-picker/contract.d.ts +86 -0
- package/types/components/date-picker/index.d.ts +70 -0
- package/types/components/dropdown/contract.d.ts +18 -0
- package/types/components/dropdown/index.d.ts +53 -0
- package/types/components/field/contract.d.ts +67 -0
- package/types/components/field/index.d.ts +11 -0
- package/types/components/file-upload/contract.d.ts +60 -0
- package/types/components/file-upload/index.d.ts +35 -0
- package/types/components/frame/contract.d.ts +60 -0
- package/types/components/frame/index.d.ts +2 -0
- package/types/components/heading/contract.d.ts +8 -0
- package/types/components/heading/index.d.ts +0 -0
- package/types/components/image/contract.d.ts +19 -0
- package/types/components/image/index.d.ts +1 -0
- package/types/components/index.d.ts +1 -0
- package/types/components/input/contract.d.ts +49 -0
- package/types/components/input/index.d.ts +17 -0
- package/types/components/menu/contract.d.ts +34 -0
- package/types/components/menu/index.d.ts +0 -0
- package/types/components/modal/contract.d.ts +56 -0
- package/types/components/modal/index.d.ts +85 -0
- package/types/components/overlay/contract.d.ts +13 -0
- package/types/components/overlay/index.d.ts +0 -0
- package/types/components/radio/contract.d.ts +55 -0
- package/types/components/radio/index.d.ts +28 -0
- package/types/components/runtime.d.ts +35 -0
- package/types/components/scroll-area/contract.d.ts +23 -0
- package/types/components/scroll-area/index.d.ts +68 -0
- package/types/components/select/contract.d.ts +90 -0
- package/types/components/select/index.d.ts +92 -0
- package/types/components/separator/contract.d.ts +7 -0
- package/types/components/separator/index.d.ts +0 -0
- package/types/components/sidebar/contract.d.ts +66 -0
- package/types/components/sidebar/index.d.ts +106 -0
- package/types/components/slider/contract.d.ts +56 -0
- package/types/components/slider/index.d.ts +40 -0
- package/types/components/spacer/index.d.ts +0 -0
- package/types/components/stream/index.d.ts +0 -0
- package/types/components/switch/contract.d.ts +57 -0
- package/types/components/switch/index.d.ts +24 -0
- package/types/components/table/contract.d.ts +99 -0
- package/types/components/table/index.d.ts +2 -0
- package/types/components/tabs/contract.d.ts +25 -0
- package/types/components/tabs/index.d.ts +60 -0
- package/types/components/text/contract.d.ts +10 -0
- package/types/components/text/index.d.ts +0 -0
- package/types/components/textarea/contract.d.ts +22 -0
- package/types/components/textarea/index.d.ts +0 -0
- package/types/components/theme/contract.d.ts +6 -0
- package/types/components/theme/index.d.ts +0 -0
- package/types/components/toast/contract.d.ts +28 -0
- package/types/components/toast/index.d.ts +27 -0
- package/types/index.d.ts +46 -0
- package/types/motion/animate.d.ts +49 -0
- package/types/motion/index.d.ts +24 -0
- package/types/motion/presence.d.ts +34 -0
- package/types/motion/reduced-motion.d.ts +9 -0
- package/types/motion/stream.d.ts +18 -0
- package/types/motion/targets.d.ts +31 -0
- package/types/motion/view.d.ts +22 -0
- package/types/runtime/anchored-popover.d.ts +20 -0
- package/types/runtime/class-name.d.ts +9 -0
- package/types/runtime/codecs.d.ts +66 -0
- package/types/runtime/collection-navigation.d.ts +33 -0
- package/types/runtime/confirm.d.ts +18 -0
- package/types/runtime/create.d.ts +8 -0
- package/types/runtime/dismissable-layer.d.ts +8 -0
- package/types/runtime/dom.d.ts +39 -0
- package/types/runtime/form-control.d.ts +44 -0
- package/types/runtime/index.d.ts +85 -0
- package/types/runtime/manifest.d.ts +49 -0
- package/types/runtime/option-data.d.ts +5 -0
- package/types/runtime/props.d.ts +9 -0
- package/types/runtime/resizable.d.ts +36 -0
- package/types/runtime/scroll-lock.d.ts +3 -0
- package/types/runtime/stream.d.ts +47 -0
- package/types/runtime/styles.d.ts +28 -0
- package/types/runtime/theme.d.ts +17 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import type Alpine from 'alpinejs';
|
|
2
|
+
import { type AnchoredPopover, type BindingObject, type TrellisAlpineComponent } from '../../runtime';
|
|
3
|
+
import type { PresenceLifecycle } from '../../motion';
|
|
4
|
+
import { type SelectProps } from './contract';
|
|
5
|
+
type PopoverElement = HTMLElement & {
|
|
6
|
+
showPopover?: () => void;
|
|
7
|
+
hidePopover?: () => void;
|
|
8
|
+
};
|
|
9
|
+
type SelectOption = {
|
|
10
|
+
el: HTMLElement;
|
|
11
|
+
id: string;
|
|
12
|
+
value: string;
|
|
13
|
+
label: string;
|
|
14
|
+
selectedLabel: string;
|
|
15
|
+
disabled: boolean;
|
|
16
|
+
selected: boolean;
|
|
17
|
+
visible: boolean;
|
|
18
|
+
create: boolean;
|
|
19
|
+
};
|
|
20
|
+
type SelectData = {
|
|
21
|
+
isOpen: boolean;
|
|
22
|
+
search: string;
|
|
23
|
+
selectedValues: string[];
|
|
24
|
+
selectedLabels: string[];
|
|
25
|
+
activeValue: string;
|
|
26
|
+
inputSearching: boolean;
|
|
27
|
+
buttonId: string;
|
|
28
|
+
inputId: string;
|
|
29
|
+
listboxId: string;
|
|
30
|
+
props: SelectProps;
|
|
31
|
+
popover: AnchoredPopover | null;
|
|
32
|
+
popoverMotion: PresenceLifecycle | null;
|
|
33
|
+
listeners: Array<() => void>;
|
|
34
|
+
observer: MutationObserver | null;
|
|
35
|
+
renderedChipsKey: string;
|
|
36
|
+
renderedHiddenInputsKey: string;
|
|
37
|
+
root: BindingObject;
|
|
38
|
+
control(): HTMLElement;
|
|
39
|
+
trigger(): HTMLElement;
|
|
40
|
+
input(): HTMLInputElement | null;
|
|
41
|
+
searchInput(): HTMLInputElement | null;
|
|
42
|
+
popoverEl(): PopoverElement;
|
|
43
|
+
listbox(): HTMLElement;
|
|
44
|
+
chipsEl(): HTMLElement | null;
|
|
45
|
+
hiddenInputsEl(): HTMLElement | null;
|
|
46
|
+
options(): SelectOption[];
|
|
47
|
+
enabledVisibleOptions(): SelectOption[];
|
|
48
|
+
hasSelection(): boolean;
|
|
49
|
+
hasClearValue(): boolean;
|
|
50
|
+
isPillbox(): boolean;
|
|
51
|
+
controlLayoutMode(): SelectProps['mode'];
|
|
52
|
+
selectedSummary(): string;
|
|
53
|
+
openSelect(event?: Event): void;
|
|
54
|
+
closeSelect(event?: Event): void;
|
|
55
|
+
toggle(event?: Event): void;
|
|
56
|
+
clear(event?: Event): void;
|
|
57
|
+
select(valueOrOption: string | SelectOption, event?: Event): void;
|
|
58
|
+
deselect(value: string, event?: Event): void;
|
|
59
|
+
removeLastValue(event?: Event): void;
|
|
60
|
+
setSearch(value: string): void;
|
|
61
|
+
refreshOptions(): void;
|
|
62
|
+
selectOption(option: SelectOption, event?: Event): void;
|
|
63
|
+
setActive(option: SelectOption | null): void;
|
|
64
|
+
moveActive(delta: 1 | -1): void;
|
|
65
|
+
focusFirst(): void;
|
|
66
|
+
focusLast(): void;
|
|
67
|
+
handleSearchInput(event: Event): void;
|
|
68
|
+
handleInput(event: Event): void;
|
|
69
|
+
handleKeydown(event: KeyboardEvent): void;
|
|
70
|
+
handleFocusout(event: FocusEvent): void;
|
|
71
|
+
sync(): void;
|
|
72
|
+
syncRoot(): void;
|
|
73
|
+
syncControl(): void;
|
|
74
|
+
syncTrigger(): void;
|
|
75
|
+
syncInputs(): void;
|
|
76
|
+
syncListbox(): void;
|
|
77
|
+
syncOptions(): void;
|
|
78
|
+
syncChips(): void;
|
|
79
|
+
syncHiddenInputs(): void;
|
|
80
|
+
mount(): void;
|
|
81
|
+
unmount(): void;
|
|
82
|
+
setup(): void;
|
|
83
|
+
selectedOption(): SelectOption | null;
|
|
84
|
+
selectedContent(option: SelectOption): DocumentFragment;
|
|
85
|
+
resolveOptionLabel(el: HTMLElement): string;
|
|
86
|
+
resolveSelectedLabel(el: HTMLElement, label: string): string;
|
|
87
|
+
optionValue(el: HTMLElement, label: string): string;
|
|
88
|
+
};
|
|
89
|
+
declare const UiSelect: () => TrellisAlpineComponent<SelectData>;
|
|
90
|
+
declare const registerSelect: (AlpineInstance: Alpine.Alpine) => void;
|
|
91
|
+
export { registerSelect, UiSelect };
|
|
92
|
+
export type { SelectData, SelectOption };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type Orientation } from '../common';
|
|
2
|
+
declare const SEPARATOR_ORIENTATION_VALUES: readonly ["vertical", "horizontal"];
|
|
3
|
+
declare const SEPARATOR_VARIANTS: readonly ["default", "subtle"];
|
|
4
|
+
type SeparatorOrientation = Orientation;
|
|
5
|
+
type SeparatorVariant = typeof SEPARATOR_VARIANTS[number];
|
|
6
|
+
export { SEPARATOR_ORIENTATION_VALUES, SEPARATOR_VARIANTS };
|
|
7
|
+
export type { SeparatorOrientation, SeparatorVariant };
|
|
File without changes
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { type PropState } from '../../runtime';
|
|
2
|
+
declare const SIDEBAR_SIDES: readonly ["left", "right"];
|
|
3
|
+
declare const SIDEBAR_COLLAPSES: readonly ["none", "mobile", "desktop", "both"];
|
|
4
|
+
declare const SIDEBAR_TOGGLE_ACTIONS: readonly ["toggle", "open", "close", "stash", "expand"];
|
|
5
|
+
declare const SIDEBAR_ITEM_AS: readonly ["a", "button"];
|
|
6
|
+
declare const SIDEBAR_ITEM_VARIANTS: readonly ["ghost", "surface"];
|
|
7
|
+
declare const SIDEBAR_ITEM_COLORS: readonly ["neutral", "accent"];
|
|
8
|
+
declare const sidebarSchema: {
|
|
9
|
+
id: import("../../runtime/codecs").StringCodec;
|
|
10
|
+
side: import("../../runtime/codecs").OneOfCodec<"left" | "right">;
|
|
11
|
+
sticky: import("../../runtime/codecs").BoolCodec;
|
|
12
|
+
collapse: import("../../runtime/codecs").OneOfCodec<"none" | "mobile" | "both" | "desktop">;
|
|
13
|
+
open: import("../../runtime/codecs").BoolCodec;
|
|
14
|
+
stashed: import("../../runtime/codecs").BoolCodec;
|
|
15
|
+
persist: import("../../runtime/codecs").BoolCodec;
|
|
16
|
+
width: import("../../runtime/codecs").StringCodec;
|
|
17
|
+
minWidth: import("../../runtime/codecs").StringCodec;
|
|
18
|
+
maxWidth: import("../../runtime/codecs").StringCodec;
|
|
19
|
+
mobile: import("../../runtime/codecs").StringCodec;
|
|
20
|
+
breakpoint: import("../../runtime/codecs").StringCodec;
|
|
21
|
+
edgeReveal: import("../../runtime/codecs").BoolCodec;
|
|
22
|
+
resizable: import("../../runtime/codecs").BoolCodec;
|
|
23
|
+
class: import("../../runtime/codecs").StringCodec;
|
|
24
|
+
};
|
|
25
|
+
declare const sidebarItemSchema: {
|
|
26
|
+
as: import("../../runtime/codecs").OneOfCodec<"button" | "a">;
|
|
27
|
+
variant: import("../../runtime/codecs").OneOfCodec<"ghost" | "surface">;
|
|
28
|
+
color: import("../../runtime/codecs").OneOfCodec<"neutral" | "accent">;
|
|
29
|
+
href: import("../../runtime/codecs").StringCodec;
|
|
30
|
+
current: import("../../runtime/codecs").BoolCodec;
|
|
31
|
+
disabled: import("../../runtime/codecs").BoolCodec;
|
|
32
|
+
icon: import("../../runtime/codecs").StringCodec;
|
|
33
|
+
iconTrailing: import("../../runtime/codecs").StringCodec;
|
|
34
|
+
badge: import("../../runtime/codecs").StringCodec;
|
|
35
|
+
class: import("../../runtime/codecs").StringCodec;
|
|
36
|
+
};
|
|
37
|
+
declare const sidebarGroupSchema: {
|
|
38
|
+
heading: import("../../runtime/codecs").StringCodec;
|
|
39
|
+
expandable: import("../../runtime/codecs").BoolCodec;
|
|
40
|
+
expanded: import("../../runtime/codecs").BoolCodec;
|
|
41
|
+
icon: import("../../runtime/codecs").StringCodec;
|
|
42
|
+
class: import("../../runtime/codecs").StringCodec;
|
|
43
|
+
};
|
|
44
|
+
declare const sidebarToggleSchema: {
|
|
45
|
+
target: import("../../runtime/codecs").StringCodec;
|
|
46
|
+
icon: import("../../runtime/codecs").StringCodec;
|
|
47
|
+
label: import("../../runtime/codecs").StringCodec;
|
|
48
|
+
action: import("../../runtime/codecs").OneOfCodec<"close" | "toggle" | "open" | "stash" | "expand">;
|
|
49
|
+
class: import("../../runtime/codecs").StringCodec;
|
|
50
|
+
};
|
|
51
|
+
declare const sidebarPanelSchema: {
|
|
52
|
+
class: import("../../runtime/codecs").StringCodec;
|
|
53
|
+
};
|
|
54
|
+
declare const sidebarNavSchema: {
|
|
55
|
+
label: import("../../runtime/codecs").StringCodec;
|
|
56
|
+
labelled: import("../../runtime/codecs").StringCodec;
|
|
57
|
+
class: import("../../runtime/codecs").StringCodec;
|
|
58
|
+
};
|
|
59
|
+
type SidebarProps = PropState<typeof sidebarSchema>;
|
|
60
|
+
type SidebarToggleAction = typeof SIDEBAR_TOGGLE_ACTIONS[number];
|
|
61
|
+
type SidebarCollapse = typeof SIDEBAR_COLLAPSES[number];
|
|
62
|
+
type SidebarItemColor = typeof SIDEBAR_ITEM_COLORS[number];
|
|
63
|
+
type SidebarItemVariant = typeof SIDEBAR_ITEM_VARIANTS[number];
|
|
64
|
+
type SidebarSide = typeof SIDEBAR_SIDES[number];
|
|
65
|
+
export { SIDEBAR_COLLAPSES, SIDEBAR_ITEM_AS, SIDEBAR_ITEM_COLORS, SIDEBAR_ITEM_VARIANTS, SIDEBAR_SIDES, SIDEBAR_TOGGLE_ACTIONS, sidebarGroupSchema, sidebarItemSchema, sidebarNavSchema, sidebarPanelSchema, sidebarSchema, sidebarToggleSchema, };
|
|
66
|
+
export type { SidebarCollapse, SidebarItemColor, SidebarItemVariant, SidebarProps, SidebarSide, SidebarToggleAction };
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import type Alpine from 'alpinejs';
|
|
2
|
+
import { type BindingObject, type CleanupStack, type PropState, type TrellisAlpineComponent } from '../../runtime';
|
|
3
|
+
import type { PresenceLifecycle, PresencePhase } from '../../motion';
|
|
4
|
+
import { type SidebarProps, type SidebarToggleAction } from './contract';
|
|
5
|
+
type SidebarController = {
|
|
6
|
+
readonly id: string;
|
|
7
|
+
isExpanded(): boolean;
|
|
8
|
+
perform(action: SidebarToggleAction, trigger?: HTMLElement | null): void;
|
|
9
|
+
syncToggles(): void;
|
|
10
|
+
};
|
|
11
|
+
declare const togglePropsSchema: {
|
|
12
|
+
target: import("../../runtime/codecs").StringCodec;
|
|
13
|
+
action: import("../../runtime/codecs").OneOfCodec<"close" | "toggle" | "open" | "stash" | "expand">;
|
|
14
|
+
class: import("../../runtime/codecs").StringCodec;
|
|
15
|
+
};
|
|
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 SidebarData = SidebarController & {
|
|
24
|
+
props: SidebarProps;
|
|
25
|
+
mobileOpen: boolean;
|
|
26
|
+
desktopStashed: boolean;
|
|
27
|
+
desktopDrawerOpen: boolean;
|
|
28
|
+
drawerExiting: boolean;
|
|
29
|
+
sidebarExiting: boolean;
|
|
30
|
+
sidebarExitFreezeCleanup: (() => void) | null;
|
|
31
|
+
drawerMotionRun: number;
|
|
32
|
+
drawerMotionPhase: PresencePhase | null;
|
|
33
|
+
desktopMode: boolean;
|
|
34
|
+
renderedExpanded: boolean;
|
|
35
|
+
renderedDrawerOpen: boolean;
|
|
36
|
+
lastPointer: {
|
|
37
|
+
clientX: number;
|
|
38
|
+
clientY: number;
|
|
39
|
+
} | null;
|
|
40
|
+
activeTrigger: HTMLElement | null;
|
|
41
|
+
currentWidth: string;
|
|
42
|
+
cleanup: CleanupStack;
|
|
43
|
+
drawerMotion: PresenceLifecycle | null;
|
|
44
|
+
backdropMotion: PresenceLifecycle | null;
|
|
45
|
+
hasScrollLock: boolean;
|
|
46
|
+
mediaQuery: MediaQueryList | null;
|
|
47
|
+
root: BindingObject;
|
|
48
|
+
isDesktop(): boolean;
|
|
49
|
+
isMobileCollapsible(): boolean;
|
|
50
|
+
isDesktopCollapsible(): boolean;
|
|
51
|
+
hasOpenDrawer(): boolean;
|
|
52
|
+
isExpanded(): boolean;
|
|
53
|
+
perform(action: SidebarToggleAction, trigger?: HTMLElement | null): void;
|
|
54
|
+
open(trigger?: HTMLElement | null): void;
|
|
55
|
+
close(trigger?: HTMLElement | null): void;
|
|
56
|
+
closeTemporaryDrawer(trigger?: HTMLElement | null, event?: MouseEvent): void;
|
|
57
|
+
handleBreakpointChange(): void;
|
|
58
|
+
handlePointerMove(event: Event): void;
|
|
59
|
+
pointerWithinEdge(event: MouseEvent): boolean;
|
|
60
|
+
pointerWithinRevealArea(event: MouseEvent): boolean;
|
|
61
|
+
pointerWithinDrawer(pointer: {
|
|
62
|
+
clientX: number;
|
|
63
|
+
clientY: number;
|
|
64
|
+
}): boolean;
|
|
65
|
+
toggle(trigger?: HTMLElement | null): void;
|
|
66
|
+
syncAll(): void;
|
|
67
|
+
syncApp(): void;
|
|
68
|
+
syncRoot(): void;
|
|
69
|
+
syncBackdrop(): void;
|
|
70
|
+
syncEdge(): void;
|
|
71
|
+
syncToggles(): void;
|
|
72
|
+
syncStateIcons(): void;
|
|
73
|
+
animateDrawerEnter(): void;
|
|
74
|
+
animateDrawerExit(run: number): void;
|
|
75
|
+
animateSidebarEnter(run: number): void;
|
|
76
|
+
animateSidebarExit(run: number, freezeCleanup?: (() => void) | null, withBackdrop?: boolean): void;
|
|
77
|
+
finishSidebarExit(run: number, freezeCleanup?: (() => void) | null): void;
|
|
78
|
+
freezeSidebarForExit(): (() => void) | null;
|
|
79
|
+
clearSidebarExitFreeze(freezeCleanup?: (() => void) | null): void;
|
|
80
|
+
handleResize(event: Event): void;
|
|
81
|
+
setupGroups(): void;
|
|
82
|
+
appEl(): HTMLElement | null;
|
|
83
|
+
backdropEl(): HTMLElement | null;
|
|
84
|
+
edgeEls(): HTMLElement[];
|
|
85
|
+
focusRestoreTarget(trigger?: HTMLElement | null): HTMLElement | null;
|
|
86
|
+
moveFocusBeforeHide(target: HTMLElement | null): void;
|
|
87
|
+
storageKey(): string;
|
|
88
|
+
storedStashed(): boolean | null;
|
|
89
|
+
persistStashed(): void;
|
|
90
|
+
};
|
|
91
|
+
declare const UiSidebar: () => TrellisAlpineComponent<SidebarData>;
|
|
92
|
+
declare const UiSidebarToggle: () => TrellisAlpineComponent<{
|
|
93
|
+
props: SidebarToggleProps;
|
|
94
|
+
root: BindingObject;
|
|
95
|
+
targetId(): string;
|
|
96
|
+
trigger(event?: Event): void;
|
|
97
|
+
}>;
|
|
98
|
+
declare const UiSidebarEdge: () => TrellisAlpineComponent<{
|
|
99
|
+
props: SidebarEdgeProps;
|
|
100
|
+
root: BindingObject;
|
|
101
|
+
targetId(): string;
|
|
102
|
+
trigger(event?: Event): void;
|
|
103
|
+
}>;
|
|
104
|
+
declare const registerSidebar: (AlpineInstance: Alpine.Alpine) => void;
|
|
105
|
+
export { registerSidebar, UiSidebar, UiSidebarEdge, UiSidebarToggle, };
|
|
106
|
+
export type { SidebarController, SidebarData };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { type PropState } from '../../runtime';
|
|
2
|
+
import { type ControlSize, type DefaultVariant, type Orientation } from '../common';
|
|
3
|
+
declare const SLIDER_SIZES: readonly ["xs", "sm", "md", "lg", "xlg"];
|
|
4
|
+
declare const SLIDER_VARIANTS: readonly ["default"];
|
|
5
|
+
declare const SLIDER_ORIENTATIONS: readonly ["vertical", "horizontal"];
|
|
6
|
+
declare const SLIDER_FORMATS: readonly ["number", "percent"];
|
|
7
|
+
type SliderSize = ControlSize;
|
|
8
|
+
type SliderVariant = DefaultVariant;
|
|
9
|
+
type SliderOrientation = Orientation;
|
|
10
|
+
type SliderFormat = typeof SLIDER_FORMATS[number];
|
|
11
|
+
declare const sliderSchema: {
|
|
12
|
+
name: import("../../runtime/codecs").StringCodec;
|
|
13
|
+
value: import("../../runtime/codecs").StringCodec;
|
|
14
|
+
defaultValue: import("../../runtime/codecs").StringCodec;
|
|
15
|
+
min: import("../../runtime/codecs").NumberCodec;
|
|
16
|
+
max: import("../../runtime/codecs").NumberCodec;
|
|
17
|
+
step: import("../../runtime/codecs").NumberCodec;
|
|
18
|
+
bigStep: import("../../runtime/codecs").NumberCodec;
|
|
19
|
+
minStepsBetween: import("../../runtime/codecs").NumberCodec;
|
|
20
|
+
range: import("../../runtime/codecs").BoolCodec;
|
|
21
|
+
orientation: import("../../runtime/codecs").OneOfCodec<"vertical" | "horizontal">;
|
|
22
|
+
size: import("../../runtime/codecs").OneOfCodec<"xs" | "sm" | "md" | "lg" | "xlg">;
|
|
23
|
+
variant: import("../../runtime/codecs").OneOfCodec<"default">;
|
|
24
|
+
disabled: import("../../runtime/codecs").BoolCodec;
|
|
25
|
+
required: import("../../runtime/codecs").BoolCodec;
|
|
26
|
+
invalid: import("../../runtime/codecs").BoolCodec;
|
|
27
|
+
label: import("../../runtime/codecs").StringCodec;
|
|
28
|
+
description: import("../../runtime/codecs").StringCodec;
|
|
29
|
+
descriptionTrailing: import("../../runtime/codecs").StringCodec;
|
|
30
|
+
error: import("../../runtime/codecs").StringCodec;
|
|
31
|
+
errors: import("../../runtime/codecs").StringCodec;
|
|
32
|
+
badge: import("../../runtime/codecs").StringCodec;
|
|
33
|
+
valueText: import("../../runtime/codecs").StringCodec;
|
|
34
|
+
lowerLabel: import("../../runtime/codecs").StringCodec;
|
|
35
|
+
upperLabel: import("../../runtime/codecs").StringCodec;
|
|
36
|
+
lowerValueText: import("../../runtime/codecs").StringCodec;
|
|
37
|
+
upperValueText: import("../../runtime/codecs").StringCodec;
|
|
38
|
+
showValue: import("../../runtime/codecs").BoolCodec;
|
|
39
|
+
format: import("../../runtime/codecs").OneOfCodec<"number" | "percent">;
|
|
40
|
+
fieldClass: import("../../runtime/codecs").StringCodec;
|
|
41
|
+
rootClass: import("../../runtime/codecs").StringCodec;
|
|
42
|
+
trackClass: import("../../runtime/codecs").StringCodec;
|
|
43
|
+
rangeClass: import("../../runtime/codecs").StringCodec;
|
|
44
|
+
thumbClass: import("../../runtime/codecs").StringCodec;
|
|
45
|
+
tickClass: import("../../runtime/codecs").StringCodec;
|
|
46
|
+
class: import("../../runtime/codecs").StringCodec;
|
|
47
|
+
};
|
|
48
|
+
declare const sliderTickSchema: {
|
|
49
|
+
value: import("../../runtime/codecs").NumberCodec;
|
|
50
|
+
label: import("../../runtime/codecs").StringCodec;
|
|
51
|
+
class: import("../../runtime/codecs").StringCodec;
|
|
52
|
+
};
|
|
53
|
+
type SliderProps = PropState<typeof sliderSchema>;
|
|
54
|
+
type SliderTickProps = PropState<typeof sliderTickSchema>;
|
|
55
|
+
export { SLIDER_FORMATS, SLIDER_ORIENTATIONS, SLIDER_SIZES, SLIDER_VARIANTS, sliderSchema, sliderTickSchema, };
|
|
56
|
+
export type { SliderFormat, SliderOrientation, SliderProps, SliderSize, SliderTickProps, SliderVariant, };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type Alpine from 'alpinejs';
|
|
2
|
+
import { type CleanupStack, type TrellisAlpineComponent } from '../../runtime';
|
|
3
|
+
import { type SliderProps } from './contract';
|
|
4
|
+
type SliderThumbName = 'single' | 'lower' | 'upper';
|
|
5
|
+
type SliderElements = {
|
|
6
|
+
root: HTMLElement;
|
|
7
|
+
track: HTMLElement | null;
|
|
8
|
+
range: HTMLElement | null;
|
|
9
|
+
lowerInput: HTMLInputElement | null;
|
|
10
|
+
upperInput: HTMLInputElement | null;
|
|
11
|
+
singleInput: HTMLInputElement | null;
|
|
12
|
+
lowerThumb: HTMLElement | null;
|
|
13
|
+
upperThumb: HTMLElement | null;
|
|
14
|
+
singleThumb: HTMLElement | null;
|
|
15
|
+
value: HTMLElement | null;
|
|
16
|
+
hiddenInputs: HTMLElement | null;
|
|
17
|
+
ticks: HTMLElement[];
|
|
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
|
+
sync(): void;
|
|
30
|
+
syncFromInput(event: Event): void;
|
|
31
|
+
commitFromInput(event: Event): void;
|
|
32
|
+
handleKeydown(event: KeyboardEvent): void;
|
|
33
|
+
handlePointerDown(event: PointerEvent): void;
|
|
34
|
+
handlePointerMove(event: PointerEvent): void;
|
|
35
|
+
handlePointerUp(event: PointerEvent): void;
|
|
36
|
+
};
|
|
37
|
+
declare const UiSlider: () => TrellisAlpineComponent<SliderData>;
|
|
38
|
+
declare const registerSlider: (AlpineInstance: Alpine.Alpine) => void;
|
|
39
|
+
export { registerSlider, UiSlider };
|
|
40
|
+
export type { SliderData, SliderElements, SliderThumbName, SliderValues };
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { type PropState } from '../../runtime';
|
|
2
|
+
import { type ControlSize, type DefaultVariant } from '../common';
|
|
3
|
+
declare const SWITCH_PLACEMENTS: readonly ["trailing", "leading"];
|
|
4
|
+
declare const SWITCH_SIZES: readonly ["xs", "sm", "md", "lg", "xlg"];
|
|
5
|
+
declare const SWITCH_VARIANTS: readonly ["default"];
|
|
6
|
+
type SwitchPlacement = typeof SWITCH_PLACEMENTS[number];
|
|
7
|
+
type SwitchSize = ControlSize;
|
|
8
|
+
type SwitchVariant = DefaultVariant;
|
|
9
|
+
declare const switchControlSchema: {
|
|
10
|
+
value: import("../../runtime/codecs").StringCodec;
|
|
11
|
+
name: import("../../runtime/codecs").StringCodec;
|
|
12
|
+
label: import("../../runtime/codecs").StringCodec;
|
|
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;
|
|
18
|
+
placement: import("../../runtime/codecs").OneOfCodec<"leading" | "trailing">;
|
|
19
|
+
variant: import("../../runtime/codecs").OneOfCodec<"default">;
|
|
20
|
+
size: import("../../runtime/codecs").OneOfCodec<"xs" | "sm" | "md" | "lg" | "xlg">;
|
|
21
|
+
inputClass: import("../../runtime/codecs").StringCodec;
|
|
22
|
+
trackClass: import("../../runtime/codecs").StringCodec;
|
|
23
|
+
thumbClass: import("../../runtime/codecs").StringCodec;
|
|
24
|
+
contentClass: import("../../runtime/codecs").StringCodec;
|
|
25
|
+
labelClass: import("../../runtime/codecs").StringCodec;
|
|
26
|
+
descriptionClass: import("../../runtime/codecs").StringCodec;
|
|
27
|
+
class: import("../../runtime/codecs").StringCodec;
|
|
28
|
+
};
|
|
29
|
+
declare const switchSchema: {
|
|
30
|
+
label: import("../../runtime/codecs").StringCodec;
|
|
31
|
+
description: import("../../runtime/codecs").StringCodec;
|
|
32
|
+
descriptionTrailing: import("../../runtime/codecs").StringCodec;
|
|
33
|
+
error: import("../../runtime/codecs").StringCodec;
|
|
34
|
+
errors: import("../../runtime/codecs").StringCodec;
|
|
35
|
+
badge: import("../../runtime/codecs").StringCodec;
|
|
36
|
+
fieldClass: import("../../runtime/codecs").StringCodec;
|
|
37
|
+
value: import("../../runtime/codecs").StringCodec;
|
|
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;
|
|
43
|
+
placement: import("../../runtime/codecs").OneOfCodec<"leading" | "trailing">;
|
|
44
|
+
variant: import("../../runtime/codecs").OneOfCodec<"default">;
|
|
45
|
+
size: import("../../runtime/codecs").OneOfCodec<"xs" | "sm" | "md" | "lg" | "xlg">;
|
|
46
|
+
inputClass: import("../../runtime/codecs").StringCodec;
|
|
47
|
+
trackClass: import("../../runtime/codecs").StringCodec;
|
|
48
|
+
thumbClass: import("../../runtime/codecs").StringCodec;
|
|
49
|
+
contentClass: import("../../runtime/codecs").StringCodec;
|
|
50
|
+
labelClass: import("../../runtime/codecs").StringCodec;
|
|
51
|
+
descriptionClass: import("../../runtime/codecs").StringCodec;
|
|
52
|
+
class: import("../../runtime/codecs").StringCodec;
|
|
53
|
+
};
|
|
54
|
+
type SwitchControlProps = PropState<typeof switchControlSchema>;
|
|
55
|
+
type SwitchProps = PropState<typeof switchSchema>;
|
|
56
|
+
export { SWITCH_PLACEMENTS, SWITCH_SIZES, SWITCH_VARIANTS, switchControlSchema, switchSchema, };
|
|
57
|
+
export type { SwitchPlacement, SwitchControlProps, SwitchProps, SwitchSize, SwitchVariant, };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type Alpine from 'alpinejs';
|
|
2
|
+
import { type CleanupStack, type TrellisAlpineComponent } from '../../runtime';
|
|
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;
|
|
20
|
+
};
|
|
21
|
+
declare const UiSwitch: () => TrellisAlpineComponent<SwitchData>;
|
|
22
|
+
declare const registerSwitch: (AlpineInstance: Alpine.Alpine) => void;
|
|
23
|
+
export { registerSwitch, UiSwitch };
|
|
24
|
+
export type { SwitchData, SwitchItem };
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { type PropState } from '../../runtime';
|
|
2
|
+
declare const TABLE_LAYOUTS: readonly ["auto", "fixed"];
|
|
3
|
+
declare const TABLE_DENSITIES: readonly ["compact", "default", "comfortable"];
|
|
4
|
+
declare const TABLE_VARIANTS: readonly ["ghost", "surface"];
|
|
5
|
+
declare const TABLE_BORDERS: readonly ["none", "row", "grid"];
|
|
6
|
+
declare const TABLE_WIDTHS: readonly ["auto", "full"];
|
|
7
|
+
declare const TABLE_ALIGNS: readonly ["start", "center", "end"];
|
|
8
|
+
declare const TABLE_VALIGNS: readonly ["top", "middle", "bottom", "baseline"];
|
|
9
|
+
declare const TABLE_SORTS: readonly ["none", "ascending", "descending", "other"];
|
|
10
|
+
declare const TABLE_COLUMN_SCOPES: readonly ["col", "colgroup"];
|
|
11
|
+
declare const TABLE_ROW_HEADER_SCOPES: readonly ["row", "rowgroup"];
|
|
12
|
+
declare const TABLE_FILTER_AS_VALUES: readonly ["div", "form"];
|
|
13
|
+
declare const tableSchema: {
|
|
14
|
+
layout: import("../../runtime/codecs").OneOfCodec<"fixed" | "auto">;
|
|
15
|
+
density: import("../../runtime/codecs").OneOfCodec<"default" | "compact" | "comfortable">;
|
|
16
|
+
variant: import("../../runtime/codecs").OneOfCodec<"ghost" | "surface">;
|
|
17
|
+
border: import("../../runtime/codecs").OneOfCodec<"grid" | "none" | "row">;
|
|
18
|
+
zebra: import("../../runtime/codecs").BoolCodec;
|
|
19
|
+
hover: import("../../runtime/codecs").BoolCodec;
|
|
20
|
+
stickyHeader: import("../../runtime/codecs").BoolCodec;
|
|
21
|
+
nowrap: import("../../runtime/codecs").BoolCodec;
|
|
22
|
+
width: import("../../runtime/codecs").OneOfCodec<"auto" | "full">;
|
|
23
|
+
class: import("../../runtime/codecs").StringCodec;
|
|
24
|
+
tableClass: import("../../runtime/codecs").StringCodec;
|
|
25
|
+
};
|
|
26
|
+
declare const tableCaptionSchema: {
|
|
27
|
+
side: import("../../runtime/codecs").OneOfCodec<"bottom" | "top">;
|
|
28
|
+
class: import("../../runtime/codecs").StringCodec;
|
|
29
|
+
};
|
|
30
|
+
declare const tableSectionSchema: {
|
|
31
|
+
class: import("../../runtime/codecs").StringCodec;
|
|
32
|
+
};
|
|
33
|
+
declare const tableRowSchema: {
|
|
34
|
+
selected: import("../../runtime/codecs").BoolCodec;
|
|
35
|
+
current: import("../../runtime/codecs").BoolCodec;
|
|
36
|
+
disabled: import("../../runtime/codecs").BoolCodec;
|
|
37
|
+
interactive: import("../../runtime/codecs").BoolCodec;
|
|
38
|
+
class: import("../../runtime/codecs").StringCodec;
|
|
39
|
+
};
|
|
40
|
+
declare const tableColumnSchema: {
|
|
41
|
+
align: import("../../runtime/codecs").OneOfCodec<"end" | "center" | "start">;
|
|
42
|
+
valign: import("../../runtime/codecs").OneOfCodec<"bottom" | "top" | "middle" | "baseline">;
|
|
43
|
+
key: import("../../runtime/codecs").StringCodec;
|
|
44
|
+
target: import("../../runtime/codecs").StringCodec;
|
|
45
|
+
width: import("../../runtime/codecs").StringCodec;
|
|
46
|
+
resizable: import("../../runtime/codecs").BoolCodec;
|
|
47
|
+
minWidth: import("../../runtime/codecs").StringCodec;
|
|
48
|
+
maxWidth: import("../../runtime/codecs").StringCodec;
|
|
49
|
+
sortable: import("../../runtime/codecs").BoolCodec;
|
|
50
|
+
sort: import("../../runtime/codecs").OneOfCodec<"none" | "ascending" | "descending" | "other">;
|
|
51
|
+
abbr: import("../../runtime/codecs").StringCodec;
|
|
52
|
+
scope: import("../../runtime/codecs").OneOfCodec<"col" | "colgroup">;
|
|
53
|
+
class: import("../../runtime/codecs").StringCodec;
|
|
54
|
+
contentClass: import("../../runtime/codecs").StringCodec;
|
|
55
|
+
resizeHandleClass: import("../../runtime/codecs").StringCodec;
|
|
56
|
+
};
|
|
57
|
+
declare const tableColumnFilterSchema: {
|
|
58
|
+
as: import("../../runtime/codecs").OneOfCodec<"div" | "form">;
|
|
59
|
+
id: import("../../runtime/codecs").StringCodec;
|
|
60
|
+
class: import("../../runtime/codecs").StringCodec;
|
|
61
|
+
};
|
|
62
|
+
declare const tableRowHeaderSchema: {
|
|
63
|
+
align: import("../../runtime/codecs").OneOfCodec<"end" | "center" | "start">;
|
|
64
|
+
valign: import("../../runtime/codecs").OneOfCodec<"bottom" | "top" | "middle" | "baseline">;
|
|
65
|
+
scope: import("../../runtime/codecs").OneOfCodec<"row" | "rowgroup">;
|
|
66
|
+
class: import("../../runtime/codecs").StringCodec;
|
|
67
|
+
};
|
|
68
|
+
declare const tableCellSchema: {
|
|
69
|
+
align: import("../../runtime/codecs").OneOfCodec<"end" | "center" | "start">;
|
|
70
|
+
valign: import("../../runtime/codecs").OneOfCodec<"bottom" | "top" | "middle" | "baseline">;
|
|
71
|
+
class: import("../../runtime/codecs").StringCodec;
|
|
72
|
+
};
|
|
73
|
+
declare const tableEmptySchema: {
|
|
74
|
+
colspan: import("../../runtime/codecs").StringCodec;
|
|
75
|
+
class: import("../../runtime/codecs").StringCodec;
|
|
76
|
+
cellClass: import("../../runtime/codecs").StringCodec;
|
|
77
|
+
};
|
|
78
|
+
type TableLayout = typeof TABLE_LAYOUTS[number];
|
|
79
|
+
type TableDensity = typeof TABLE_DENSITIES[number];
|
|
80
|
+
type TableVariant = typeof TABLE_VARIANTS[number];
|
|
81
|
+
type TableBorder = typeof TABLE_BORDERS[number];
|
|
82
|
+
type TableWidth = typeof TABLE_WIDTHS[number];
|
|
83
|
+
type TableAlign = typeof TABLE_ALIGNS[number];
|
|
84
|
+
type TableValign = typeof TABLE_VALIGNS[number];
|
|
85
|
+
type TableSort = typeof TABLE_SORTS[number];
|
|
86
|
+
type TableColumnScope = typeof TABLE_COLUMN_SCOPES[number];
|
|
87
|
+
type TableRowHeaderScope = typeof TABLE_ROW_HEADER_SCOPES[number];
|
|
88
|
+
type TableFilterAs = typeof TABLE_FILTER_AS_VALUES[number];
|
|
89
|
+
type TableProps = PropState<typeof tableSchema>;
|
|
90
|
+
type TableCaptionProps = PropState<typeof tableCaptionSchema>;
|
|
91
|
+
type TableSectionProps = PropState<typeof tableSectionSchema>;
|
|
92
|
+
type TableRowProps = PropState<typeof tableRowSchema>;
|
|
93
|
+
type TableColumnProps = PropState<typeof tableColumnSchema>;
|
|
94
|
+
type TableColumnFilterProps = PropState<typeof tableColumnFilterSchema>;
|
|
95
|
+
type TableRowHeaderProps = PropState<typeof tableRowHeaderSchema>;
|
|
96
|
+
type TableCellProps = PropState<typeof tableCellSchema>;
|
|
97
|
+
type TableEmptyProps = PropState<typeof tableEmptySchema>;
|
|
98
|
+
export { TABLE_ALIGNS, TABLE_BORDERS, TABLE_COLUMN_SCOPES, TABLE_DENSITIES, TABLE_FILTER_AS_VALUES, TABLE_LAYOUTS, TABLE_ROW_HEADER_SCOPES, TABLE_SORTS, TABLE_VALIGNS, TABLE_VARIANTS, TABLE_WIDTHS, tableCaptionSchema, tableCellSchema, tableColumnFilterSchema, tableColumnSchema, tableEmptySchema, tableRowHeaderSchema, tableRowSchema, tableSchema, tableSectionSchema, };
|
|
99
|
+
export type { TableAlign, TableBorder, TableCaptionProps, TableCellProps, TableColumnFilterProps, TableColumnProps, TableColumnScope, TableDensity, TableEmptyProps, TableFilterAs, TableLayout, TableProps, TableRowHeaderProps, TableRowHeaderScope, TableRowProps, TableSectionProps, TableSort, TableValign, TableVariant, TableWidth, };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { TABLE_ALIGNS, TABLE_BORDERS, TABLE_COLUMN_SCOPES, TABLE_DENSITIES, TABLE_FILTER_AS_VALUES, TABLE_LAYOUTS, TABLE_ROW_HEADER_SCOPES, TABLE_SORTS, TABLE_VALIGNS, TABLE_VARIANTS, TABLE_WIDTHS, tableCaptionSchema, tableCellSchema, tableColumnFilterSchema, tableColumnSchema, tableEmptySchema, tableRowHeaderSchema, tableRowSchema, tableSchema, tableSectionSchema, } from './contract';
|
|
2
|
+
export type { TableAlign, TableBorder, TableCaptionProps, TableCellProps, TableColumnFilterProps, TableColumnProps, TableColumnScope, TableDensity, TableEmptyProps, TableFilterAs, TableLayout, TableProps, TableRowHeaderProps, TableRowHeaderScope, TableRowProps, TableSectionProps, TableSort, TableValign, TableVariant, TableWidth, } from './contract';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type PropState } from '../../runtime';
|
|
2
|
+
import { type Orientation } from '../common';
|
|
3
|
+
declare const TABS_ACTIVATIONS: readonly ["manual", "automatic"];
|
|
4
|
+
declare const TABS_ORIENTATIONS: readonly ["vertical", "horizontal"];
|
|
5
|
+
declare const TABS_LIST_ORIENTATIONS: readonly ["inherit", "vertical", "horizontal"];
|
|
6
|
+
declare const TABS_VARIANTS: readonly ["subtle", "line", "segmented", "pills"];
|
|
7
|
+
declare const TABS_SIZES: readonly ["sm", "md"];
|
|
8
|
+
declare const tabsSchema: {
|
|
9
|
+
id: import("../../runtime/codecs").StringCodec;
|
|
10
|
+
defaultValue: import("../../runtime/codecs").StringCodec;
|
|
11
|
+
value: import("../../runtime/codecs").StringCodec;
|
|
12
|
+
activation: import("../../runtime/codecs").OneOfCodec<"manual" | "automatic">;
|
|
13
|
+
orientation: import("../../runtime/codecs").OneOfCodec<"vertical" | "horizontal">;
|
|
14
|
+
loop: import("../../runtime/codecs").BoolCodec;
|
|
15
|
+
panels: import("../../runtime/codecs").StringCodec;
|
|
16
|
+
class: import("../../runtime/codecs").StringCodec;
|
|
17
|
+
};
|
|
18
|
+
type TabsActivation = typeof TABS_ACTIVATIONS[number];
|
|
19
|
+
type TabsOrientation = Orientation;
|
|
20
|
+
type TabsListOrientation = typeof TABS_LIST_ORIENTATIONS[number];
|
|
21
|
+
type TabsVariant = typeof TABS_VARIANTS[number];
|
|
22
|
+
type TabsSize = typeof TABS_SIZES[number];
|
|
23
|
+
type TabsProps = PropState<typeof tabsSchema>;
|
|
24
|
+
export { TABS_ACTIVATIONS, TABS_LIST_ORIENTATIONS, TABS_ORIENTATIONS, TABS_SIZES, TABS_VARIANTS, tabsSchema, };
|
|
25
|
+
export type { TabsActivation, TabsListOrientation, TabsOrientation, TabsProps, TabsSize, TabsVariant, };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type Alpine from 'alpinejs';
|
|
2
|
+
import { type BindingObject, type CollectionNavigation, type TrellisAlpineComponent } from '../../runtime';
|
|
3
|
+
import { type TabsOrientation, type TabsProps, type TabsVariant, type TabsSize } from './contract';
|
|
4
|
+
type TabsTabElement = HTMLButtonElement | HTMLAnchorElement;
|
|
5
|
+
type TabsItem = {
|
|
6
|
+
tab: TabsTabElement;
|
|
7
|
+
value: string;
|
|
8
|
+
isDisabled: boolean;
|
|
9
|
+
panel: HTMLElement | null;
|
|
10
|
+
};
|
|
11
|
+
type TabsChangeDetail = {
|
|
12
|
+
value: string;
|
|
13
|
+
};
|
|
14
|
+
type TabsActivateDetail = {
|
|
15
|
+
value: string;
|
|
16
|
+
panelId: string;
|
|
17
|
+
};
|
|
18
|
+
type TabsData = {
|
|
19
|
+
props: TabsProps;
|
|
20
|
+
activeValue: string;
|
|
21
|
+
collection: CollectionNavigation | null;
|
|
22
|
+
cleanup: Array<() => void>;
|
|
23
|
+
root: BindingObject;
|
|
24
|
+
owner(): string;
|
|
25
|
+
lists(): HTMLElement[];
|
|
26
|
+
primaryList(): HTMLElement | null;
|
|
27
|
+
listVariant(): TabsVariant;
|
|
28
|
+
listSize(): TabsSize;
|
|
29
|
+
listOrientation(list?: HTMLElement | null): TabsOrientation;
|
|
30
|
+
tabs(): TabsItem[];
|
|
31
|
+
panels(): HTMLElement[];
|
|
32
|
+
panelForValue(value: string): HTMLElement | null;
|
|
33
|
+
initialValue(): string;
|
|
34
|
+
fallbackValue(): string;
|
|
35
|
+
setActiveValue(value: string, tab?: TabsTabElement): void;
|
|
36
|
+
syncAll(): void;
|
|
37
|
+
syncRoot(): void;
|
|
38
|
+
syncList(list: HTMLElement): void;
|
|
39
|
+
syncTab(item: TabsItem): void;
|
|
40
|
+
syncPanel(panel: HTMLElement): void;
|
|
41
|
+
setupEvents(): void;
|
|
42
|
+
teardown(): void;
|
|
43
|
+
tabFromEvent(event: Event): TabsTabElement | null;
|
|
44
|
+
itemFromTab(tab: TabsTabElement): TabsItem | null;
|
|
45
|
+
collectionNav(): CollectionNavigation;
|
|
46
|
+
handleClick(event: Event): void;
|
|
47
|
+
handleFocus(event: Event): void;
|
|
48
|
+
handleKeydown(event: KeyboardEvent): void;
|
|
49
|
+
focusNext(): void;
|
|
50
|
+
focusPrevious(): void;
|
|
51
|
+
focusFirst(): void;
|
|
52
|
+
focusLast(): void;
|
|
53
|
+
activateFocused(): void;
|
|
54
|
+
dispatchChange(): void;
|
|
55
|
+
dispatchActivate(tab: TabsTabElement, panel: HTMLElement | null): void;
|
|
56
|
+
};
|
|
57
|
+
declare const UiTabs: () => TrellisAlpineComponent<TabsData>;
|
|
58
|
+
declare const registerTabs: (AlpineInstance: Alpine.Alpine) => void;
|
|
59
|
+
export { registerTabs, UiTabs, };
|
|
60
|
+
export type { TabsActivateDetail, TabsChangeDetail, TabsData, TabsItem };
|