@vireo-ai/trellis-ui 0.1.4 → 0.1.6

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 (40) hide show
  1. package/package.json +29 -19
  2. package/src/components/date-picker/styles.css +9 -0
  3. package/src/components/select/styles.css +9 -0
  4. package/src/styles/components.css +20 -0
  5. package/src/styles/generated-sources.css +3 -0
  6. package/src/styles/static.css +2 -0
  7. package/src/{theme.css → styles/theme.css} +38 -12
  8. package/trellis_ui/static/trellis_ui/{css/styles.css → assets/css/trellis.css} +206 -575
  9. package/trellis_ui/static/trellis_ui/assets/css/trellis.min.css +2 -0
  10. package/trellis_ui/static/trellis_ui/assets/js/esm/chunks/cally-TZl4LpyH.js.map +1 -0
  11. package/trellis_ui/static/trellis_ui/{js → assets/js}/esm/index.js +3120 -2277
  12. package/trellis_ui/static/trellis_ui/assets/js/esm/index.js.map +1 -0
  13. package/trellis_ui/static/trellis_ui/assets/js/trellis.js +10 -0
  14. package/trellis_ui/static/trellis_ui/assets/js/trellis.min.js +10 -0
  15. package/types/cdn.d.ts +5 -0
  16. package/types/components/accordion/contract.d.ts +2 -0
  17. package/types/components/accordion/index.d.ts +3 -1
  18. package/types/components/combobox/index.d.ts +5 -2
  19. package/types/components/date-picker/index.d.ts +3 -2
  20. package/types/components/dropdown/index.d.ts +4 -2
  21. package/types/components/input/index.d.ts +1 -0
  22. package/types/components/modal/index.d.ts +4 -2
  23. package/types/components/runtime.d.ts +2 -0
  24. package/types/components/select/index.d.ts +5 -2
  25. package/types/components/sidebar/index.d.ts +14 -7
  26. package/types/components/slider/index.d.ts +1 -0
  27. package/types/components/table/contract.d.ts +1 -0
  28. package/types/components/tabs/index.d.ts +1 -0
  29. package/types/components/textarea/index.d.ts +13 -0
  30. package/types/components/toast/index.d.ts +4 -0
  31. package/types/index.d.ts +6 -4
  32. package/types/runtime/codecs.d.ts +11 -2
  33. package/types/runtime/index.d.ts +3 -0
  34. package/types/runtime/machine.d.ts +55 -0
  35. package/types/runtime/manifest.d.ts +2 -0
  36. package/src/components.css +0 -20
  37. package/trellis_ui/static/trellis_ui/js/esm/chunks/cally-TZl4LpyH.js.map +0 -1
  38. package/trellis_ui/static/trellis_ui/js/esm/index.js.map +0 -1
  39. package/trellis_ui/static/trellis_ui/js/index.js +0 -10
  40. /package/trellis_ui/static/trellis_ui/{js → assets/js}/esm/chunks/cally-TZl4LpyH.js +0 -0
package/types/cdn.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ import trellisUi, { bool, className, create, createMachine, createResizable, createVisibilityMachine, cx, defineManifest, defineProps, defineStyles, json, mergeBindings, motion, number, oneOf, propsFromSchema, resolveStyle, string, ui } from './index';
2
+ export default trellisUi;
3
+ export { trellisUi, ui };
4
+ export { motion };
5
+ export { bool, className, create, createMachine, createResizable, createVisibilityMachine, cx, defineManifest, defineProps, defineStyles, json, mergeBindings, number, oneOf, propsFromSchema, resolveStyle, string, };
@@ -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;
@@ -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;
@@ -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>;
@@ -1,5 +1,5 @@
1
1
  import type Alpine from 'alpinejs';
2
- import { type BindingObject, type CleanupStack, type TrellisAlpineComponent } from '../../runtime';
2
+ import { type BindingObject, type CleanupStack, type Machine, type TrellisAlpineComponent } from '../../runtime';
3
3
  import type { PresenceLifecycle } from '../../motion';
4
4
  import { type ModalProps, type ModalTriggerProps } from './contract';
5
5
  type CancelReason = 'escape' | 'outside';
@@ -21,7 +21,8 @@ type ModalTriggerController = {
21
21
  };
22
22
  type ModalData = ModalController & {
23
23
  props: ModalProps;
24
- isOpen: boolean;
24
+ readonly isOpen: boolean;
25
+ machine: Machine<Record<string, never>>;
25
26
  dialogId: string;
26
27
  activeTrigger: HTMLElement | null;
27
28
  cleanup: CleanupStack;
@@ -53,6 +54,7 @@ type ModalData = ModalController & {
53
54
  openFrom(trigger: HTMLElement): void;
54
55
  close(event?: Event): void;
55
56
  cancel(reason: CancelReason, event?: Event): void;
57
+ applyProps(changedKeys?: string[]): void;
56
58
  syncExternalTrigger(trigger: HTMLElement, disabled: boolean): void;
57
59
  syncAll(): void;
58
60
  syncDialog(): void;
@@ -31,5 +31,7 @@ export { registerSwitch, UiSwitch } from './switch';
31
31
  export type { SwitchData, SwitchItem } from './switch';
32
32
  export { registerTabs, UiTabs } from './tabs';
33
33
  export type { TabsActivateDetail, TabsChangeDetail, TabsData, TabsItem } from './tabs';
34
+ export { registerTextarea, UiTextarea } from './textarea';
35
+ export type { TextareaData } from './textarea';
34
36
  export { registerToast, UiToast, UiToastOutlet, } from './toast';
35
37
  export type { ToastData, ToastDetail, ToastOutletData } from './toast';
@@ -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 SelectProps } from './contract';
5
5
  type PopoverElement = HTMLElement & {
@@ -18,7 +18,7 @@ type SelectOption = {
18
18
  create: boolean;
19
19
  };
20
20
  type SelectData = {
21
- isOpen: boolean;
21
+ readonly isOpen: boolean;
22
22
  search: string;
23
23
  selectedValues: string[];
24
24
  selectedLabels: string[];
@@ -28,6 +28,7 @@ type SelectData = {
28
28
  inputId: string;
29
29
  listboxId: string;
30
30
  props: SelectProps;
31
+ machine: Machine<Record<string, never>>;
31
32
  popover: AnchoredPopover | null;
32
33
  popoverMotion: PresenceLifecycle | null;
33
34
  listeners: Array<() => void>;
@@ -49,6 +50,8 @@ type SelectData = {
49
50
  hasClearValue(): boolean;
50
51
  isPillbox(): boolean;
51
52
  controlLayoutMode(): SelectProps['mode'];
53
+ valuesFromProps(): string[];
54
+ applyProps(changedKeys?: string[]): void;
52
55
  selectedSummary(): string;
53
56
  openSelect(event?: Event): void;
54
57
  closeSelect(event?: Event): void;
@@ -1,5 +1,5 @@
1
1
  import type Alpine from 'alpinejs';
2
- import { type BindingObject, type CleanupStack, type PropState, type TrellisAlpineComponent } from '../../runtime';
2
+ import { type BindingObject, type CleanupStack, type Machine, type PropState, type TrellisAlpineComponent } from '../../runtime';
3
3
  import type { PresenceLifecycle, PresencePhase } from '../../motion';
4
4
  import { type SidebarProps, type SidebarToggleAction } from './contract';
5
5
  type SidebarController = {
@@ -20,16 +20,20 @@ declare const edgePropsSchema: {
20
20
  class: import("../../runtime/codecs").StringCodec;
21
21
  };
22
22
  type SidebarEdgeProps = PropState<typeof edgePropsSchema>;
23
+ type SidebarMachineContext = {
24
+ desktopStashed: boolean;
25
+ };
23
26
  type SidebarData = SidebarController & {
24
27
  props: SidebarProps;
25
- mobileOpen: boolean;
26
- desktopStashed: boolean;
27
- desktopDrawerOpen: boolean;
28
- drawerExiting: boolean;
29
- sidebarExiting: boolean;
28
+ machine: Machine<SidebarMachineContext>;
29
+ readonly mobileOpen: boolean;
30
+ readonly desktopStashed: boolean;
31
+ readonly desktopDrawerOpen: boolean;
32
+ readonly drawerExiting: boolean;
33
+ readonly sidebarExiting: boolean;
30
34
  sidebarExitFreezeCleanup: (() => void) | null;
31
35
  drawerMotionRun: number;
32
- drawerMotionPhase: PresencePhase | null;
36
+ readonly drawerMotionPhase: PresencePhase | null;
33
37
  desktopMode: boolean;
34
38
  renderedExpanded: boolean;
35
39
  renderedDrawerOpen: boolean;
@@ -44,7 +48,10 @@ type SidebarData = SidebarController & {
44
48
  backdropMotion: PresenceLifecycle | null;
45
49
  hasScrollLock: boolean;
46
50
  mediaQuery: MediaQueryList | null;
51
+ mediaQueryCleanup: (() => void) | null;
47
52
  root: BindingObject;
53
+ setupMediaQuery(): void;
54
+ applyProps(changedKeys?: string[]): void;
48
55
  isDesktop(): boolean;
49
56
  isMobileCollapsible(): boolean;
50
57
  isDesktopCollapsible(): boolean;
@@ -26,6 +26,7 @@ type SliderData = {
26
26
  hiddenInputsKey: string;
27
27
  draggingThumb: SliderThumbName | null;
28
28
  elements(): SliderElements;
29
+ applyProps(changedKeys?: string[]): void;
29
30
  sync(): void;
30
31
  syncFromInput(event: Event): void;
31
32
  commitFromInput(event: Event): void;
@@ -15,6 +15,7 @@ declare const tableSchema: {
15
15
  density: import("../../runtime/codecs").OneOfCodec<"default" | "compact" | "comfortable">;
16
16
  variant: import("../../runtime/codecs").OneOfCodec<"ghost" | "surface">;
17
17
  border: import("../../runtime/codecs").OneOfCodec<"grid" | "none" | "row">;
18
+ flush: import("../../runtime/codecs").BoolCodec;
18
19
  zebra: import("../../runtime/codecs").BoolCodec;
19
20
  hover: import("../../runtime/codecs").BoolCodec;
20
21
  stickyHeader: import("../../runtime/codecs").BoolCodec;
@@ -33,6 +33,7 @@ type TabsData = {
33
33
  panelForValue(value: string): HTMLElement | null;
34
34
  initialValue(): string;
35
35
  fallbackValue(): string;
36
+ applyProps(changedKeys?: string[]): void;
36
37
  setActiveValue(value: string, tab?: TabsTabElement): void;
37
38
  syncAll(): void;
38
39
  syncRoot(): void;
@@ -0,0 +1,13 @@
1
+ import type Alpine from 'alpinejs';
2
+ import { type TrellisAlpineComponent } from '../../runtime';
3
+ import { type TextareaProps } from './contract';
4
+ type TextareaData = {
5
+ props: TextareaProps;
6
+ control(): HTMLElement;
7
+ textarea(): HTMLTextAreaElement;
8
+ sync(): void;
9
+ };
10
+ declare const UiTextarea: () => TrellisAlpineComponent<TextareaData>;
11
+ declare const registerTextarea: (AlpineInstance: Alpine.Alpine) => void;
12
+ export { registerTextarea, UiTextarea };
13
+ export type { TextareaData };
@@ -14,11 +14,15 @@ type ToastData = {
14
14
  props: ToastProps;
15
15
  cleanup: CleanupStack;
16
16
  timer: number | null;
17
+ applyProps(changedKeys?: string[]): void;
18
+ sync(): void;
19
+ resetTimer(): void;
17
20
  dismiss(): void;
18
21
  };
19
22
  type ToastOutletData = {
20
23
  props: ToastOutletProps;
21
24
  cleanup: CleanupStack;
25
+ sync(): void;
22
26
  add(detail: ToastDetail): void;
23
27
  };
24
28
  declare const UiToast: () => TrellisAlpineComponent<ToastData>;
package/types/index.d.ts CHANGED
@@ -1,15 +1,17 @@
1
1
  import type { Alpine as AlpineType } from 'alpinejs';
2
2
  import { motion } from './motion';
3
- import { bool, className, create, createResizable, cx, defineManifest, defineProps, defineStyles, json, mergeBindings, number, oneOf, propsFromSchema, resolveStyle, string } from './runtime';
3
+ import { bool, className, create, createMachine, createVisibilityMachine, createResizable, cx, defineManifest, defineProps, defineStyles, json, mergeBindings, number, oneOf, propsFromSchema, resolveStyle, string } from './runtime';
4
4
  type TrellisUIPlugin = (AlpineInstance: AlpineType) => void;
5
5
  declare const ui: {
6
6
  readonly bool: import("./runtime/codecs").BoolCodec;
7
7
  readonly className: ({ values }: import("./runtime").ClassNameOptions) => string;
8
8
  readonly create: <const T extends Record<string, import("./runtime").StyleTree>>({ definition }: import("./runtime").CreateOptions<T>) => Readonly<T>;
9
+ readonly createMachine: <TContext>(config: import("./runtime").MachineConfig<TContext>, options: import("./runtime").MachineOptions<TContext>) => import("./runtime").Machine<TContext>;
10
+ readonly createVisibilityMachine: <TContext>({ enter, exit, }?: import("./runtime").VisibilityMachineConfig) => import("./runtime").MachineConfig<TContext>;
9
11
  readonly createResizable: ({ element, handle, axis, min, max, step, mode, hitArea, coarseHitArea, disabled, onStart, onResize, onEnd, }: import("./runtime").ResizableOptions) => (() => void);
10
12
  readonly cx: ({ values }: import("./runtime").ClassNameOptions) => string;
11
13
  readonly defineManifest: <const T extends import("./runtime").ComponentManifest>({ manifest }: import("./runtime").DefineManifestOptions<T>) => Readonly<T>;
12
- readonly defineProps: <T extends Record<string, import("./runtime").CodecFn<unknown>>>({ el, schema, }: import("./runtime/codecs").DefinePropsOptions<T>) => import("./runtime").PropState<T>;
14
+ readonly defineProps: <T extends Record<string, import("./runtime").CodecFn<unknown>>>({ el, schema, onChange, }: import("./runtime/codecs").DefinePropsOptions<T>) => import("./runtime").PropState<T>;
13
15
  readonly defineStyles: <const T extends import("./runtime").StyleDefinition>({ definition }: import("./runtime").DefineStylesOptions<T>) => Readonly<T>;
14
16
  readonly json: import("./runtime/codecs").JsonCodecFactory;
15
17
  readonly mergeBindings: ({ inputs }: import("./runtime").MergeBindingsOptions) => import("./runtime").BindingObject;
@@ -41,6 +43,6 @@ export { trellisUi, ui };
41
43
  export default trellisUi;
42
44
  export type { TrellisUIPlugin };
43
45
  export { motion };
44
- export { bool, className, create, createResizable, cx, defineManifest, defineProps, defineStyles, json, mergeBindings, number, oneOf, propsFromSchema, resolveStyle, string, };
45
- export type { ClassArray, ClassDictionary, ClassNameOptions, ClassValue, CodecFn, ComponentManifest, CreateOptions, DefineManifestOptions, DefineStylesOptions, ManifestPart, ManifestProp, ManifestPropDetails, ManifestToken, BindingInput, PropState, PropsFromSchemaOptions, MergeBindingsOptions, ResizableOptions, ResizeAxis, ResizeEvent, ResizeMode, ResizePhase, ResolveStyleOptions, SchemaPropDetails, SchemaToProps, StyleDefinition, StylePart, StyleProps, StyleTree, TrellisAlpineComponent, } from './runtime';
46
+ export { bool, className, create, createMachine, createVisibilityMachine, createResizable, cx, defineManifest, defineProps, defineStyles, json, mergeBindings, number, oneOf, propsFromSchema, resolveStyle, string, };
47
+ export type { ClassArray, ClassDictionary, ClassNameOptions, ClassValue, CodecFn, ComponentManifest, CreateOptions, Machine, MachineAction, MachineActionList, MachineActionRef, MachineConfig, MachineEffect, MachineEvent, MachineEventObject, MachineGuard, MachineOptions, MachineScope, MachineStateConfig, MachineTransition, VisibilityMachineConfig, DefineManifestOptions, DefineStylesOptions, ManifestPart, ManifestProp, ManifestPropDetails, ManifestToken, BindingInput, PropState, PropsFromSchemaOptions, MergeBindingsOptions, ResizableOptions, ResizeAxis, ResizeEvent, ResizeMode, ResizePhase, ResolveStyleOptions, SchemaPropDetails, SchemaToProps, StyleDefinition, StylePart, StyleProps, StyleTree, TrellisAlpineComponent, } from './runtime';
46
48
  export type { AnimateStreamPatchOptions, AnimateViewOptions, Animator, MotionHandle, MotionPreference, MotionTarget, PresenceDefinition, PresenceLifecycle, PresenceLifecycleCallbacks, PresenceLifecycleOptions, PresenceOptions, PresencePhase, PresencePreset, ResolvedViewTarget, TransformComposer, TransformContext, ViewPreset, ViewScope, } from './motion';
@@ -12,12 +12,21 @@ interface CodecFn<T> {
12
12
  type SchemaToProps<T extends Record<string, CodecFn<unknown>>> = {
13
13
  [K in keyof T]: ReturnType<T[K]>;
14
14
  };
15
+ type SchemaPropKey<T extends Record<string, CodecFn<unknown>>> = Extract<keyof SchemaToProps<T>, string>;
15
16
  type PropState<T extends Record<string, CodecFn<unknown>>> = SchemaToProps<T> & {
16
17
  readonly disconnect: () => void;
17
18
  };
19
+ type PropChangeSource = 'attribute' | 'property';
20
+ type PropChange<T extends Record<string, CodecFn<unknown>>> = {
21
+ key: SchemaPropKey<T>;
22
+ previous: SchemaToProps<T>[keyof SchemaToProps<T>];
23
+ value: SchemaToProps<T>[keyof SchemaToProps<T>];
24
+ source: PropChangeSource;
25
+ };
18
26
  type DefinePropsOptions<T extends Record<string, CodecFn<unknown>>> = {
19
27
  el: HTMLElement;
20
28
  schema: T;
29
+ onChange?: (state: PropState<T>, changes: Array<PropChange<T>>) => void;
21
30
  };
22
31
  type ReactiveFn = <T>(value: T) => T;
23
32
  interface StringCodec extends CodecFn<string> {
@@ -56,11 +65,11 @@ interface JsonCodecFactory {
56
65
  array<T>(fallback: T[]): JsonCodec<T[]>;
57
66
  }
58
67
  declare const setPropReactivity: (nextReactive: ReactiveFn) => void;
59
- declare const defineProps: <T extends Record<string, CodecFn<unknown>>>({ el, schema, }: DefinePropsOptions<T>) => PropState<T>;
68
+ declare const defineProps: <T extends Record<string, CodecFn<unknown>>>({ el, schema, onChange, }: DefinePropsOptions<T>) => PropState<T>;
60
69
  declare const string: StringCodec;
61
70
  declare const number: NumberCodec;
62
71
  declare const bool: BoolCodec;
63
72
  declare const json: JsonCodecFactory;
64
73
  declare const oneOf: <T extends string>(allowed: readonly T[], fallback: T) => OneOfCodec<T>;
65
74
  export { defineProps, setPropReactivity, string, number, bool, json, oneOf };
66
- export type { BoolCodec, CodecFn, CodecKind, CodecMeta, DefinePropsOptions, JsonCodec, JsonCodecFactory, NumberCodec, OneOfCodec, PropState, ReactiveFn, SchemaToProps, StringCodec, };
75
+ export type { BoolCodec, CodecFn, CodecKind, CodecMeta, DefinePropsOptions, JsonCodec, JsonCodecFactory, NumberCodec, OneOfCodec, PropChange, PropChangeSource, PropState, ReactiveFn, SchemaToProps, StringCodec, };
@@ -6,6 +6,7 @@ export { registerConfirm, unregisterConfirm, type ConfirmEventDetail, type Confi
6
6
  export { create, type CreateOptions, type StyleTree } from './create';
7
7
  export { mergeBindings, type BindingInput, type BindingObject, type MergeBindingsOptions } from './merge-bindings';
8
8
  export { defineProps, string, number, bool, json, oneOf, type CodecFn, type PropState, type SchemaToProps } from './codecs';
9
+ export { createMachine, createVisibilityMachine, type Machine, type MachineAction, type MachineActionList, type MachineActionRef, type MachineConfig, type MachineEffect, type MachineEvent, type MachineEventObject, type MachineGuard, type MachineOptions, type MachineScope, type MachineStateConfig, type MachineTransition, type VisibilityMachineConfig, } from './machine';
9
10
  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
11
  export { addDismissableLayer, type DismissableLayerOptions } from './dismissable-layer';
11
12
  export { dispatchNativeControlChange, syncControlPresence, syncNativeControl, syncRepeatedHiddenInputs, type ControlState, type DispatchNativeControlChangeOptions, type HiddenInputState, type NativeControlState, type SyncControlPresenceOptions, type SyncNativeControlOptions, type SyncRepeatedHiddenInputsOptions, } from './form-control';
@@ -43,6 +44,8 @@ declare const ui: {
43
44
  readonly splitControlValues: (value: string) => string[];
44
45
  readonly createResizable: ({ element, handle, axis, min, max, step, mode, hitArea, coarseHitArea, disabled, onStart, onResize, onEnd, }: import("./resizable").ResizableOptions) => (() => void);
45
46
  readonly mergeBindings: ({ inputs }: import("./merge-bindings").MergeBindingsOptions) => import("./merge-bindings").BindingObject;
47
+ readonly createMachine: <TContext>(config: import("./machine").MachineConfig<TContext>, options: import("./machine").MachineOptions<TContext>) => import("./machine").Machine<TContext>;
48
+ readonly createVisibilityMachine: <TContext>({ enter, exit, }?: import("./machine").VisibilityMachineConfig) => import("./machine").MachineConfig<TContext>;
46
49
  readonly propsFromSchema: <const T extends Record<string, import("./codecs").CodecFn<unknown>>>({ schema, details, }: import("./manifest").PropsFromSchemaOptions<T>) => Record<string, import("./manifest").ManifestProp>;
47
50
  readonly resolveStyle: ({ part, props, className: override, }: import("./styles").ResolveStyleOptions) => string;
48
51
  readonly className: ({ values }: import("./class-name").ClassNameOptions) => string;
@@ -0,0 +1,55 @@
1
+ type MachineEventObject = {
2
+ type: string;
3
+ [key: string]: unknown;
4
+ };
5
+ type MachineEvent = string | MachineEventObject;
6
+ type MachineActionRef = string | MachineAction | MachineEffect;
7
+ type MachineActionList = MachineActionRef | MachineActionRef[];
8
+ type MachineTransition<TContext> = string | {
9
+ target?: string;
10
+ guard?: string | MachineGuard<TContext>;
11
+ actions?: MachineActionList;
12
+ };
13
+ type MachineStateConfig<TContext> = {
14
+ id?: string;
15
+ initial?: string;
16
+ tags?: string[];
17
+ entry?: MachineActionList;
18
+ exit?: MachineActionList;
19
+ on?: Record<string, MachineTransition<TContext> | Array<MachineTransition<TContext>>>;
20
+ states?: Record<string, MachineStateConfig<TContext>>;
21
+ };
22
+ type MachineConfig<TContext> = {
23
+ initial: string;
24
+ states: Record<string, MachineStateConfig<TContext>>;
25
+ };
26
+ type MachineScope<TContext> = {
27
+ context: TContext;
28
+ event: MachineEventObject;
29
+ state: string;
30
+ };
31
+ type MachineAction<TContext = unknown> = (scope: MachineScope<TContext>) => void;
32
+ type MachineEffect<TContext = unknown> = (scope: MachineScope<TContext>) => void | (() => void);
33
+ type MachineGuard<TContext = unknown> = (scope: MachineScope<TContext>) => boolean;
34
+ type MachineOptions<TContext> = {
35
+ context: TContext;
36
+ actions?: Record<string, MachineAction<TContext>>;
37
+ guards?: Record<string, MachineGuard<TContext>>;
38
+ effects?: Record<string, MachineEffect<TContext>>;
39
+ };
40
+ type VisibilityMachineConfig = {
41
+ enter?: MachineActionList;
42
+ exit?: MachineActionList;
43
+ };
44
+ type Machine<TContext> = {
45
+ state: string;
46
+ context: TContext;
47
+ send(event: MachineEvent): void;
48
+ matches(state: string): boolean;
49
+ hasTag(tag: string): boolean;
50
+ stop(): void;
51
+ };
52
+ declare const createVisibilityMachine: <TContext>({ enter, exit, }?: VisibilityMachineConfig) => MachineConfig<TContext>;
53
+ declare const createMachine: <TContext>(config: MachineConfig<TContext>, options: MachineOptions<TContext>) => Machine<TContext>;
54
+ export { createMachine, createVisibilityMachine };
55
+ export type { Machine, MachineAction, MachineActionList, MachineActionRef, MachineConfig, MachineEffect, MachineEvent, MachineEventObject, MachineGuard, MachineOptions, MachineScope, MachineStateConfig, MachineTransition, VisibilityMachineConfig, };
@@ -5,6 +5,7 @@ type ManifestProp = {
5
5
  default?: unknown;
6
6
  values?: readonly string[];
7
7
  description?: string;
8
+ initialOnly?: boolean;
8
9
  };
9
10
  type ManifestPart = {
10
11
  selector: string;
@@ -36,6 +37,7 @@ type ComponentManifest = {
36
37
  };
37
38
  type ManifestPropDetails = Pick<ManifestProp, 'description'> & {
38
39
  name?: string;
40
+ initialOnly?: boolean;
39
41
  };
40
42
  type SchemaPropDetails<T extends Record<string, CodecFn<unknown>>> = {
41
43
  [K in keyof T]?: ManifestPropDetails;
@@ -1,20 +0,0 @@
1
- /*
2
- Component CSS import point.
3
-
4
- Add files here only when a component needs selectors or browser features that
5
- TypeScript style recipes cannot express cleanly, such as pseudo-elements,
6
- ::part(...), :has(...), native quirks, or child-order selectors.
7
- */
8
-
9
- @import "./components/brand/styles.css";
10
- @import "./components/scroll-area/styles.css";
11
- @import "./components/select/styles.css";
12
- @import "./components/field/styles.css";
13
- @import "./components/radio/styles.css";
14
- @import "./components/date-picker/styles.css";
15
- @import "./components/file-upload/styles.css";
16
- @import "./components/button/styles.css";
17
- @import "./components/accordion/styles.css";
18
- @import "./components/toast/styles.css";
19
- @import "./components/input/styles.css";
20
- @import "./components/sidebar/styles.css";