@vireo-ai/trellis-ui 0.1.2 → 0.1.5

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 (42) hide show
  1. package/package.json +2 -5
  2. package/src/components/date-picker/styles.css +9 -0
  3. package/src/components/select/styles.css +9 -0
  4. package/src/theme.css +36 -4
  5. package/trellis_ui/static/trellis_ui/css/styles.css +307 -12
  6. package/trellis_ui/static/trellis_ui/js/esm/index.js +3605 -2210
  7. package/trellis_ui/static/trellis_ui/js/esm/index.js.map +1 -1
  8. package/trellis_ui/static/trellis_ui/js/index.js +6 -6
  9. package/types/components/accordion/contract.d.ts +2 -0
  10. package/types/components/accordion/index.d.ts +3 -1
  11. package/types/components/combobox/index.d.ts +8 -2
  12. package/types/components/container/contract.d.ts +30 -0
  13. package/types/components/container/index.d.ts +1 -0
  14. package/types/components/date-picker/index.d.ts +3 -2
  15. package/types/components/dropdown/index.d.ts +4 -2
  16. package/types/components/flex/contract.d.ts +35 -0
  17. package/types/components/flex/index.d.ts +1 -0
  18. package/types/components/grid/contract.d.ts +40 -0
  19. package/types/components/grid/index.d.ts +1 -0
  20. package/types/components/input/index.d.ts +1 -0
  21. package/types/components/layout.d.ts +408 -0
  22. package/types/components/modal/index.d.ts +4 -2
  23. package/types/components/runtime.d.ts +2 -0
  24. package/types/components/section/contract.d.ts +27 -0
  25. package/types/components/section/index.d.ts +1 -0
  26. package/types/components/select/index.d.ts +8 -2
  27. package/types/components/sidebar/index.d.ts +14 -7
  28. package/types/components/slider/index.d.ts +1 -0
  29. package/types/components/stack/contract.d.ts +29 -0
  30. package/types/components/stack/index.d.ts +1 -0
  31. package/types/components/table/contract.d.ts +4 -3
  32. package/types/components/tabs/index.d.ts +1 -0
  33. package/types/components/textarea/index.d.ts +13 -0
  34. package/types/components/toast/index.d.ts +4 -0
  35. package/types/index.d.ts +6 -4
  36. package/types/runtime/codecs.d.ts +11 -2
  37. package/types/runtime/index.d.ts +5 -2
  38. package/types/runtime/machine.d.ts +55 -0
  39. package/types/runtime/manifest.d.ts +2 -0
  40. package/types/runtime/stream.d.ts +1 -1
  41. package/trellis_ui/static/trellis_ui/js/esm/chunks/dist-DMX3Q5Zu.js +0 -551
  42. package/trellis_ui/static/trellis_ui/js/esm/chunks/dist-DMX3Q5Zu.js.map +0 -1
@@ -13,6 +13,8 @@ declare const accordionSchema: {
13
13
  orientation: import("../../runtime/codecs").OneOfCodec<"vertical" | "horizontal">;
14
14
  defaultValue: import("../../runtime/codecs").StringCodec;
15
15
  defaultValues: import("../../runtime/codecs").StringCodec;
16
+ value: import("../../runtime/codecs").StringCodec;
17
+ values: import("../../runtime/codecs").StringCodec;
16
18
  loop: import("../../runtime/codecs").BoolCodec;
17
19
  iconPosition: import("../../runtime/codecs").OneOfCodec<"leading" | "trailing">;
18
20
  headingAs: import("../../runtime/codecs").OneOfCodec<"h1" | "h2" | "h3" | "h4" | "h5" | "h6">;
@@ -18,12 +18,14 @@ type AccordionData = {
18
18
  items(): AccordionItem[];
19
19
  itemFromTrigger(trigger: HTMLElement): AccordionItem | null;
20
20
  initialValues(): string[];
21
+ propValues(): string[];
21
22
  normalizeValues(values: string[]): string[];
23
+ applyProps(changedKeys?: string[]): void;
22
24
  isItemOpen(item: AccordionItem): boolean;
23
25
  isItemDisabled(item: AccordionItem): boolean;
24
26
  canCollapseOpenItem(item: AccordionItem): boolean;
25
27
  toggleItem(item: AccordionItem, event?: Event): void;
26
- setOpenValues(values: string[]): void;
28
+ setOpenValues(values: string[], dispatch?: boolean): void;
27
29
  syncAll(): void;
28
30
  syncRoot(): void;
29
31
  syncItem(item: AccordionItem): void;
@@ -1,5 +1,5 @@
1
1
  import type Alpine from 'alpinejs';
2
- import { type AnchoredPopover, type BindingObject, type TrellisAlpineComponent } from '../../runtime';
2
+ import { type AnchoredPopover, type BindingObject, type Machine, type TrellisAlpineComponent } from '../../runtime';
3
3
  import type { PresenceLifecycle } from '../../motion';
4
4
  import { type ComboboxProps } from './contract';
5
5
  type PopoverElement = HTMLElement & {
@@ -16,7 +16,7 @@ type ComboboxOption = {
16
16
  visible: boolean;
17
17
  };
18
18
  type ComboboxData = {
19
- isOpen: boolean;
19
+ readonly isOpen: boolean;
20
20
  query: string;
21
21
  selectedValues: string[];
22
22
  selectedLabels: string[];
@@ -24,6 +24,7 @@ type ComboboxData = {
24
24
  inputId: string;
25
25
  listboxId: string;
26
26
  props: ComboboxProps;
27
+ machine: Machine<Record<string, never>>;
27
28
  popover: AnchoredPopover | null;
28
29
  listboxMotion: PresenceLifecycle | null;
29
30
  listeners: Array<() => void>;
@@ -40,6 +41,8 @@ type ComboboxData = {
40
41
  enabledVisibleOptions(): ComboboxOption[];
41
42
  hasSelection(): boolean;
42
43
  hasClearValue(): boolean;
44
+ valuesFromProps(): string[];
45
+ applyProps(changedKeys?: string[]): void;
43
46
  open(event?: Event): void;
44
47
  close(event?: Event): void;
45
48
  toggle(event?: Event): void;
@@ -59,11 +62,14 @@ type ComboboxData = {
59
62
  syncInput(): void;
60
63
  syncControl(): void;
61
64
  syncListbox(): void;
65
+ syncClosedState(): void;
62
66
  syncHiddenInputs(): void;
63
67
  syncChips(): void;
64
68
  syncPosition(): void;
65
69
  mount(): void;
66
70
  unmount(): void;
71
+ exitListbox(): void;
72
+ finishClose(): void;
67
73
  setup(): void;
68
74
  resolveOptionLabel(el: HTMLElement): string;
69
75
  optionValue(el: HTMLElement, label: string): string;
@@ -0,0 +1,30 @@
1
+ import { type PropState } from '../../runtime';
2
+ import { type LayoutAs } from '../layout';
3
+ declare const CONTAINER_DISPLAYS: readonly ["block", "inline-block", "none"];
4
+ declare const CONTAINER_SIZES: readonly ["none", "xs", "sm", "md", "lg", "xl", "2xl", "3xl", "4xl", "5xl", "6xl", "7xl", "prose"];
5
+ declare const CONTAINER_ALIGNS: readonly ["left", "center", "right"];
6
+ declare const containerSchema: {
7
+ padding: import("../../runtime/codecs").OneOfCodec<"0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9">;
8
+ paddingX: import("../../runtime/codecs").OneOfCodec<"0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9">;
9
+ paddingY: import("../../runtime/codecs").OneOfCodec<"0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9">;
10
+ margin: import("../../runtime/codecs").OneOfCodec<"0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9">;
11
+ marginX: import("../../runtime/codecs").OneOfCodec<"0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9">;
12
+ marginY: import("../../runtime/codecs").OneOfCodec<"0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9">;
13
+ surface: import("../../runtime/codecs").OneOfCodec<"none" | "subtle" | "accent" | "app" | "chrome" | "panel" | "raised" | "overlay" | "inverse">;
14
+ tone: import("../../runtime/codecs").OneOfCodec<"solid" | "alpha">;
15
+ radius: import("../../runtime/codecs").OneOfCodec<"none" | "xs" | "sm" | "md" | "lg" | "full">;
16
+ elevation: import("../../runtime/codecs").OneOfCodec<"1" | "none" | "2" | "3" | "4" | "5" | "6">;
17
+ width: import("../../runtime/codecs").OneOfCodec<"xs" | "sm" | "md" | "lg" | "full" | "auto" | "xl" | "prose">;
18
+ height: import("../../runtime/codecs").OneOfCodec<"xs" | "sm" | "md" | "lg" | "full" | "auto" | "xl">;
19
+ class: import("../../runtime/codecs").StringCodec;
20
+ as: import("../../runtime/codecs").OneOfCodec<"article" | "aside" | "div" | "footer" | "form" | "header" | "li" | "main" | "nav" | "ol" | "section" | "span" | "ul">;
21
+ display: import("../../runtime/codecs").OneOfCodec<"none" | "block" | "inline-block">;
22
+ size: import("../../runtime/codecs").OneOfCodec<"none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "prose" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl">;
23
+ align: import("../../runtime/codecs").OneOfCodec<"left" | "right" | "center">;
24
+ };
25
+ type ContainerDisplay = typeof CONTAINER_DISPLAYS[number];
26
+ type ContainerSize = typeof CONTAINER_SIZES[number];
27
+ type ContainerAlign = typeof CONTAINER_ALIGNS[number];
28
+ type ContainerProps = PropState<typeof containerSchema>;
29
+ export { CONTAINER_ALIGNS, CONTAINER_DISPLAYS, CONTAINER_SIZES, containerSchema, };
30
+ export type { ContainerAlign, ContainerDisplay, ContainerProps, ContainerSize, LayoutAs as ContainerAs, };
@@ -0,0 +1 @@
1
+ export {};
@@ -1,5 +1,5 @@
1
1
  import type Alpine from 'alpinejs';
2
- import { type AnchoredPopover, type BindingObject, type TrellisAlpineComponent } from '../../runtime';
2
+ import { type AnchoredPopover, type BindingObject, type Machine, type TrellisAlpineComponent } from '../../runtime';
3
3
  import type { PresenceLifecycle } from '../../motion';
4
4
  import { type DatePickerPreset, type DatePickerProps } from './contract';
5
5
  type CalendarElement = HTMLElement & {
@@ -13,7 +13,7 @@ type PopoverElement = HTMLElement & {
13
13
  hidePopover?: () => void;
14
14
  };
15
15
  type DatePickerData = {
16
- isOpen: boolean;
16
+ readonly isOpen: boolean;
17
17
  value: string;
18
18
  pendingValue: string;
19
19
  presetValue: string;
@@ -21,6 +21,7 @@ type DatePickerData = {
21
21
  popoverId: string;
22
22
  liveMessage: string;
23
23
  props: DatePickerProps;
24
+ machine: Machine<Record<string, never>>;
24
25
  popover: AnchoredPopover | null;
25
26
  popoverMotion: PresenceLifecycle | null;
26
27
  listeners: Array<() => void>;
@@ -1,5 +1,5 @@
1
1
  import type Alpine from 'alpinejs';
2
- import { type AnchoredPopover, type BindingObject, type CollectionNavigation, type TrellisAlpineComponent } from '../../runtime';
2
+ import { type AnchoredPopover, type BindingObject, type CollectionNavigation, type Machine, type TrellisAlpineComponent } from '../../runtime';
3
3
  import type { PresenceLifecycle } from '../../motion';
4
4
  import { type DropdownProps } from './contract';
5
5
  type PopoverElement = HTMLElement & {
@@ -7,7 +7,8 @@ type PopoverElement = HTMLElement & {
7
7
  hidePopover(): void;
8
8
  };
9
9
  type DropdownData = {
10
- isOpen: boolean;
10
+ readonly isOpen: boolean;
11
+ machine: Machine<Record<string, never>>;
11
12
  menuMotion: PresenceLifecycle | null;
12
13
  triggerId: string;
13
14
  menuId: string;
@@ -34,6 +35,7 @@ type DropdownData = {
34
35
  itemEls(): HTMLElement[];
35
36
  mount(): void;
36
37
  unmount(): void;
38
+ applyProps(changedKeys?: string[]): void;
37
39
  syncFromPopover(event: ToggleEvent): void;
38
40
  syncPosition(): void;
39
41
  syncMenuAttributes(): void;
@@ -0,0 +1,35 @@
1
+ import { type PropState } from '../../runtime';
2
+ import { type LayoutAlign, type LayoutAs, type LayoutJustify, type LayoutSpace } from '../layout';
3
+ declare const FLEX_DISPLAYS: readonly ["flex", "inline-flex", "none"];
4
+ declare const FLEX_DIRECTIONS: readonly ["row", "column", "row-reverse", "column-reverse"];
5
+ declare const FLEX_WRAPS: readonly ["nowrap", "wrap", "wrap-reverse"];
6
+ declare const flexSchema: {
7
+ padding: import("../../runtime/codecs").OneOfCodec<"0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9">;
8
+ paddingX: import("../../runtime/codecs").OneOfCodec<"0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9">;
9
+ paddingY: import("../../runtime/codecs").OneOfCodec<"0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9">;
10
+ margin: import("../../runtime/codecs").OneOfCodec<"0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9">;
11
+ marginX: import("../../runtime/codecs").OneOfCodec<"0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9">;
12
+ marginY: import("../../runtime/codecs").OneOfCodec<"0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9">;
13
+ surface: import("../../runtime/codecs").OneOfCodec<"none" | "subtle" | "accent" | "app" | "chrome" | "panel" | "raised" | "overlay" | "inverse">;
14
+ tone: import("../../runtime/codecs").OneOfCodec<"solid" | "alpha">;
15
+ radius: import("../../runtime/codecs").OneOfCodec<"none" | "xs" | "sm" | "md" | "lg" | "full">;
16
+ elevation: import("../../runtime/codecs").OneOfCodec<"1" | "none" | "2" | "3" | "4" | "5" | "6">;
17
+ width: import("../../runtime/codecs").OneOfCodec<"xs" | "sm" | "md" | "lg" | "full" | "auto" | "xl" | "prose">;
18
+ height: import("../../runtime/codecs").OneOfCodec<"xs" | "sm" | "md" | "lg" | "full" | "auto" | "xl">;
19
+ class: import("../../runtime/codecs").StringCodec;
20
+ align: import("../../runtime/codecs").OneOfCodec<"end" | "center" | "start" | "stretch" | "baseline">;
21
+ justify: import("../../runtime/codecs").OneOfCodec<"end" | "center" | "start" | "between">;
22
+ gap: import("../../runtime/codecs").OneOfCodec<"0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9">;
23
+ gapX: import("../../runtime/codecs").OneOfCodec<"0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9">;
24
+ gapY: import("../../runtime/codecs").OneOfCodec<"0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9">;
25
+ as: import("../../runtime/codecs").OneOfCodec<"article" | "aside" | "div" | "footer" | "form" | "header" | "li" | "main" | "nav" | "ol" | "section" | "span" | "ul">;
26
+ display: import("../../runtime/codecs").OneOfCodec<"flex" | "none" | "inline-flex">;
27
+ direction: import("../../runtime/codecs").OneOfCodec<"row" | "column" | "row-reverse" | "column-reverse">;
28
+ wrap: import("../../runtime/codecs").OneOfCodec<"nowrap" | "wrap" | "wrap-reverse">;
29
+ };
30
+ type FlexDisplay = typeof FLEX_DISPLAYS[number];
31
+ type FlexDirection = typeof FLEX_DIRECTIONS[number];
32
+ type FlexWrap = typeof FLEX_WRAPS[number];
33
+ type FlexProps = PropState<typeof flexSchema>;
34
+ export { FLEX_DIRECTIONS, FLEX_DISPLAYS, FLEX_WRAPS, flexSchema, };
35
+ export type { FlexDirection, FlexDisplay, FlexProps, FlexWrap, LayoutAlign as FlexAlign, LayoutAs as FlexAs, LayoutJustify as FlexJustify, LayoutSpace as FlexSpace, };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,40 @@
1
+ import { type PropState } from '../../runtime';
2
+ import { type LayoutAlign, type LayoutAs, type LayoutColumns, type LayoutJustify, type LayoutRows, type LayoutSpace } from '../layout';
3
+ declare const GRID_DISPLAYS: readonly ["grid", "inline-grid", "none"];
4
+ declare const GRID_FLOWS: readonly ["row", "column", "dense", "row-dense", "column-dense"];
5
+ declare const GRID_CONTENT_ALIGNS: readonly ["start", "center", "end", "between", "stretch"];
6
+ declare const GRID_ITEM_JUSTIFIES: readonly ["start", "center", "end", "stretch"];
7
+ declare const gridSchema: {
8
+ padding: import("../../runtime/codecs").OneOfCodec<"0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9">;
9
+ paddingX: import("../../runtime/codecs").OneOfCodec<"0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9">;
10
+ paddingY: import("../../runtime/codecs").OneOfCodec<"0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9">;
11
+ margin: import("../../runtime/codecs").OneOfCodec<"0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9">;
12
+ marginX: import("../../runtime/codecs").OneOfCodec<"0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9">;
13
+ marginY: import("../../runtime/codecs").OneOfCodec<"0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9">;
14
+ surface: import("../../runtime/codecs").OneOfCodec<"none" | "subtle" | "accent" | "app" | "chrome" | "panel" | "raised" | "overlay" | "inverse">;
15
+ tone: import("../../runtime/codecs").OneOfCodec<"solid" | "alpha">;
16
+ radius: import("../../runtime/codecs").OneOfCodec<"none" | "xs" | "sm" | "md" | "lg" | "full">;
17
+ elevation: import("../../runtime/codecs").OneOfCodec<"1" | "none" | "2" | "3" | "4" | "5" | "6">;
18
+ width: import("../../runtime/codecs").OneOfCodec<"xs" | "sm" | "md" | "lg" | "full" | "auto" | "xl" | "prose">;
19
+ height: import("../../runtime/codecs").OneOfCodec<"xs" | "sm" | "md" | "lg" | "full" | "auto" | "xl">;
20
+ class: import("../../runtime/codecs").StringCodec;
21
+ align: import("../../runtime/codecs").OneOfCodec<"end" | "center" | "start" | "stretch" | "baseline">;
22
+ justify: import("../../runtime/codecs").OneOfCodec<"end" | "center" | "start" | "between">;
23
+ gap: import("../../runtime/codecs").OneOfCodec<"0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9">;
24
+ gapX: import("../../runtime/codecs").OneOfCodec<"0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9">;
25
+ gapY: import("../../runtime/codecs").OneOfCodec<"0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9">;
26
+ as: import("../../runtime/codecs").OneOfCodec<"article" | "aside" | "div" | "footer" | "form" | "header" | "li" | "main" | "nav" | "ol" | "section" | "span" | "ul">;
27
+ display: import("../../runtime/codecs").OneOfCodec<"grid" | "none" | "inline-grid">;
28
+ columns: import("../../runtime/codecs").OneOfCodec<"1" | "none" | "2" | "3" | "4" | "5" | "6">;
29
+ rows: import("../../runtime/codecs").OneOfCodec<"1" | "none" | "2" | "3" | "4" | "5" | "6">;
30
+ flow: import("../../runtime/codecs").OneOfCodec<"row" | "column" | "dense" | "row-dense" | "column-dense">;
31
+ alignContent: import("../../runtime/codecs").OneOfCodec<"end" | "center" | "start" | "stretch" | "between">;
32
+ justifyItems: import("../../runtime/codecs").OneOfCodec<"end" | "center" | "start" | "stretch">;
33
+ };
34
+ type GridDisplay = typeof GRID_DISPLAYS[number];
35
+ type GridFlow = typeof GRID_FLOWS[number];
36
+ type GridContentAlign = typeof GRID_CONTENT_ALIGNS[number];
37
+ type GridJustifyItems = typeof GRID_ITEM_JUSTIFIES[number];
38
+ type GridProps = PropState<typeof gridSchema>;
39
+ export { GRID_CONTENT_ALIGNS, GRID_DISPLAYS, GRID_FLOWS, GRID_ITEM_JUSTIFIES, gridSchema, };
40
+ export type { GridContentAlign, GridDisplay, GridFlow, GridJustifyItems, GridProps, LayoutAlign as GridAlign, LayoutAs as GridAs, LayoutColumns as GridColumns, LayoutJustify as GridJustify, LayoutRows as GridRows, LayoutSpace as GridSpace, };
@@ -0,0 +1 @@
1
+ export {};
@@ -7,6 +7,7 @@ type InputData = {
7
7
  copiedTimer: number | null;
8
8
  input(): HTMLInputElement;
9
9
  root(): HTMLElement;
10
+ syncControlState(): void;
10
11
  sync(): void;
11
12
  clear(event?: Event): void;
12
13
  copy(event?: Event): Promise<void>;