@vireo-ai/trellis-ui 0.1.9 → 0.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (173) hide show
  1. package/package.json +8 -4
  2. package/packages/client/src/components/app/styles.css +1 -30
  3. package/packages/client/src/components/button/styles.css +1 -122
  4. package/packages/client/src/components/date-picker/styles.css +47 -77
  5. package/packages/client/src/components/field/styles.css +10 -0
  6. package/packages/client/src/components/file-upload/styles.css +0 -28
  7. package/packages/client/src/components/panels/styles.css +43 -0
  8. package/packages/client/src/components/radio/styles.css +26 -21
  9. package/packages/client/src/components/scroll-area/styles.css +0 -4
  10. package/packages/client/src/components/select/styles.css +0 -30
  11. package/packages/client/src/components/sidebar/styles.css +8 -0
  12. package/packages/client/src/components/toast/styles.css +14 -7
  13. package/packages/client/src/styles/components.css +1 -0
  14. package/packages/client/src/styles/generated/theme-fonts.css +5 -0
  15. package/packages/client/src/styles/generated/theme-palette.css +2656 -0
  16. package/packages/client/src/styles/generated/theme-runtime.css +2966 -0
  17. package/packages/client/src/styles/generated-sources.css +1 -1
  18. package/packages/client/src/styles/static.css +1 -0
  19. package/packages/client/src/styles/theme.css +777 -738
  20. package/packages/client/types/cdn.d.ts +1 -4
  21. package/packages/client/types/component-api.d.ts +21 -0
  22. package/packages/client/types/components/accordion/contract.d.ts +3 -2
  23. package/packages/client/types/components/accordion/index.d.ts +28 -42
  24. package/packages/client/types/components/accordion/machine.d.ts +131 -0
  25. package/packages/client/types/components/accordion/runtime-docs.d.ts +2 -0
  26. package/packages/client/types/components/action/contract.d.ts +3 -3
  27. package/packages/client/types/components/app/contract.d.ts +25 -12
  28. package/packages/client/types/components/app/index.d.ts +2 -2
  29. package/packages/client/types/components/badge/contract.d.ts +5 -5
  30. package/packages/client/types/components/box/contract.d.ts +25 -28
  31. package/packages/client/types/components/brand/contract.d.ts +2 -2
  32. package/packages/client/types/components/button/contract.d.ts +5 -5
  33. package/packages/client/types/components/card/contract.d.ts +28 -31
  34. package/packages/client/types/components/checkbox/contract.d.ts +17 -17
  35. package/packages/client/types/components/checkbox/index.d.ts +20 -26
  36. package/packages/client/types/components/checkbox/machine.d.ts +41 -0
  37. package/packages/client/types/components/checkbox/runtime-docs.d.ts +2 -0
  38. package/packages/client/types/components/common.d.ts +53 -235
  39. package/packages/client/types/components/container/contract.d.ts +11 -12
  40. package/packages/client/types/components/date-picker/contract.d.ts +21 -16
  41. package/packages/client/types/components/date-picker/index.d.ts +38 -60
  42. package/packages/client/types/components/date-picker/machine.d.ts +529 -0
  43. package/packages/client/types/components/date-picker/runtime-docs.d.ts +2 -0
  44. package/packages/client/types/components/date-picker/value.d.ts +28 -0
  45. package/packages/client/types/components/dropdown/contract.d.ts +4 -4
  46. package/packages/client/types/components/dropdown/index.d.ts +20 -45
  47. package/packages/client/types/components/dropdown/machine.d.ts +93 -0
  48. package/packages/client/types/components/dropdown/runtime-docs.d.ts +2 -0
  49. package/packages/client/types/components/field/contract.d.ts +10 -6
  50. package/packages/client/types/components/field/index.d.ts +6 -6
  51. package/packages/client/types/components/field/machine.d.ts +13 -0
  52. package/packages/client/types/components/field/runtime-docs.d.ts +2 -0
  53. package/packages/client/types/components/file-upload/contract.d.ts +7 -4
  54. package/packages/client/types/components/file-upload/index.d.ts +34 -31
  55. package/packages/client/types/components/file-upload/machine.d.ts +127 -0
  56. package/packages/client/types/components/file-upload/runtime-docs.d.ts +2 -0
  57. package/packages/client/types/components/flex/contract.d.ts +16 -17
  58. package/packages/client/types/components/frame/contract.d.ts +41 -47
  59. package/packages/client/types/components/frame/index.d.ts +2 -2
  60. package/packages/client/types/components/grid/contract.d.ts +20 -21
  61. package/packages/client/types/components/heading/contract.d.ts +1 -1
  62. package/packages/client/types/components/image/contract.d.ts +3 -3
  63. package/packages/client/types/components/input/contract.d.ts +2 -2
  64. package/packages/client/types/components/input/index.d.ts +15 -12
  65. package/packages/client/types/components/input/machine.d.ts +20 -0
  66. package/packages/client/types/components/layout.d.ts +44 -225
  67. package/packages/client/types/components/menu/contract.d.ts +14 -8
  68. package/packages/client/types/components/modal/contract.d.ts +12 -12
  69. package/packages/client/types/components/modal/index.d.ts +41 -75
  70. package/packages/client/types/components/modal/machine.d.ts +129 -0
  71. package/packages/client/types/components/modal/runtime-docs.d.ts +2 -0
  72. package/packages/client/types/components/overlay/contract.d.ts +3 -3
  73. package/packages/client/types/components/panels/contract.d.ts +39 -0
  74. package/packages/client/types/components/panels/index.d.ts +54 -0
  75. package/packages/client/types/components/panels/machine.d.ts +151 -0
  76. package/packages/client/types/components/panels/runtime-docs.d.ts +2 -0
  77. package/packages/client/types/components/radio/contract.d.ts +11 -11
  78. package/packages/client/types/components/radio/index.d.ts +19 -23
  79. package/packages/client/types/components/radio/machine.d.ts +40 -0
  80. package/packages/client/types/components/radio/runtime-docs.d.ts +2 -0
  81. package/packages/client/types/components/runtime-docs.d.ts +2 -0
  82. package/packages/client/types/components/runtime.d.ts +16 -19
  83. package/packages/client/types/components/scroll-area/contract.d.ts +4 -7
  84. package/packages/client/types/components/scroll-area/index.d.ts +23 -49
  85. package/packages/client/types/components/scroll-area/machine.d.ts +21 -0
  86. package/packages/client/types/components/scroll-area/runtime-docs.d.ts +2 -0
  87. package/packages/client/types/components/section/contract.d.ts +12 -13
  88. package/packages/client/types/components/select/contract.d.ts +19 -15
  89. package/packages/client/types/components/select/index.d.ts +42 -89
  90. package/packages/client/types/components/select/machine.d.ts +476 -0
  91. package/packages/client/types/components/select/runtime-docs.d.ts +2 -0
  92. package/packages/client/types/components/shared/controlled-open.d.ts +11 -0
  93. package/packages/client/types/components/sidebar/contract.d.ts +19 -12
  94. package/packages/client/types/components/sidebar/index.d.ts +51 -88
  95. package/packages/client/types/components/sidebar/machine.d.ts +100 -0
  96. package/packages/client/types/components/sidebar/runtime-docs.d.ts +2 -0
  97. package/packages/client/types/components/slider/contract.d.ts +3 -3
  98. package/packages/client/types/components/slider/index.d.ts +17 -21
  99. package/packages/client/types/components/slider/machine.d.ts +37 -0
  100. package/packages/client/types/components/slider/runtime-docs.d.ts +2 -0
  101. package/packages/client/types/components/stack/contract.d.ts +16 -17
  102. package/packages/client/types/components/surface-manifest.d.ts +9 -0
  103. package/packages/client/types/components/switch/contract.d.ts +11 -11
  104. package/packages/client/types/components/switch/index.d.ts +13 -18
  105. package/packages/client/types/components/switch/machine.d.ts +19 -0
  106. package/packages/client/types/components/switch/runtime-docs.d.ts +2 -0
  107. package/packages/client/types/components/table/contract.d.ts +18 -18
  108. package/packages/client/types/components/tabs/contract.d.ts +10 -5
  109. package/packages/client/types/components/tabs/index.d.ts +33 -51
  110. package/packages/client/types/components/tabs/machine.d.ts +84 -0
  111. package/packages/client/types/components/tabs/runtime-docs.d.ts +2 -0
  112. package/packages/client/types/components/text/contract.d.ts +1 -1
  113. package/packages/client/types/components/textarea/contract.d.ts +2 -2
  114. package/packages/client/types/components/toast/contract.d.ts +5 -4
  115. package/packages/client/types/components/toast/index.d.ts +38 -12
  116. package/packages/client/types/components/toast/machine.d.ts +115 -0
  117. package/packages/client/types/components/toast/runtime-docs.d.ts +2 -0
  118. package/packages/client/types/directives/index.d.ts +3 -1
  119. package/packages/client/types/directives/layout.d.ts +3 -0
  120. package/packages/client/types/directives/request.d.ts +1 -2
  121. package/packages/client/types/directives/transition.d.ts +3 -0
  122. package/packages/client/types/docs/transition-docs.d.ts +30 -0
  123. package/packages/client/types/index.d.ts +8 -40
  124. package/packages/client/types/motion/animate.d.ts +5 -44
  125. package/packages/client/types/motion/controller.d.ts +33 -0
  126. package/packages/client/types/motion/index.d.ts +43 -20
  127. package/packages/client/types/motion/owned.d.ts +5 -0
  128. package/packages/client/types/motion/plan.d.ts +46 -0
  129. package/packages/client/types/motion/recipe.d.ts +56 -0
  130. package/packages/client/types/motion/registry.d.ts +12 -0
  131. package/packages/client/types/motion/resize.d.ts +15 -0
  132. package/packages/client/types/motion/subject.d.ts +10 -0
  133. package/packages/client/types/motion/targets.d.ts +2 -5
  134. package/packages/client/types/motion/view.d.ts +7 -2
  135. package/packages/client/types/runtime/alpine-machine.d.ts +68 -0
  136. package/packages/client/types/runtime/anchored-popover.d.ts +10 -2
  137. package/packages/client/types/runtime/codecs.d.ts +16 -2
  138. package/packages/client/types/runtime/{resizable.d.ts → drag-and-drop/index.d.ts} +4 -2
  139. package/packages/client/types/runtime/engine/request.d.ts +2 -2
  140. package/packages/client/types/runtime/engine/stream.d.ts +11 -5
  141. package/packages/client/types/runtime/focus-scope.d.ts +7 -0
  142. package/packages/client/types/runtime/identity.d.ts +3 -0
  143. package/packages/client/types/runtime/index.d.ts +9 -75
  144. package/packages/client/types/runtime/merge-bindings.d.ts +1 -1
  145. package/packages/client/types/runtime/semantic-observer.d.ts +10 -0
  146. package/packages/client/types/runtime/state-machine/index.d.ts +4 -0
  147. package/packages/client/types/runtime/state-machine/machine.d.ts +83 -0
  148. package/packages/client/types/runtime/state-machine/props-change.d.ts +12 -0
  149. package/packages/client/types/runtime/transition-coordinator.d.ts +52 -0
  150. package/packages/client/types/runtime/ui.d.ts +15 -0
  151. package/packages/client/types/utils/index.d.ts +2 -1
  152. package/packages/client/types/utils/number.d.ts +2 -0
  153. package/packages/client/types/utils/object.d.ts +4 -1
  154. package/packages/server/trellis_ui/static/trellis_ui/assets/css/trellis.css +9097 -2595
  155. package/packages/server/trellis_ui/static/trellis_ui/assets/css/trellis.min.css +1 -1
  156. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/index.js +17363 -13332
  157. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/index.js.map +1 -1
  158. package/packages/server/trellis_ui/static/trellis_ui/assets/js/trellis.js +8 -13
  159. package/packages/server/trellis_ui/static/trellis_ui/assets/js/trellis.min.js +8 -13
  160. package/packages/client/types/bindings/disclosure.d.ts +0 -3
  161. package/packages/client/types/bindings/index.d.ts +0 -7
  162. package/packages/client/types/bindings/motion.d.ts +0 -3
  163. package/packages/client/types/bindings/state.d.ts +0 -3
  164. package/packages/client/types/bindings/types.d.ts +0 -33
  165. package/packages/client/types/components/combobox/contract.d.ts +0 -60
  166. package/packages/client/types/components/combobox/index.d.ts +0 -80
  167. package/packages/client/types/components/textarea/index.d.ts +0 -13
  168. package/packages/client/types/motion/presence.d.ts +0 -34
  169. package/packages/client/types/runtime/class-name.d.ts +0 -9
  170. package/packages/client/types/runtime/create.d.ts +0 -8
  171. package/packages/client/types/runtime/machine.d.ts +0 -55
  172. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/cally-TZl4LpyH.js +0 -1134
  173. package/packages/server/trellis_ui/static/trellis_ui/assets/js/esm/chunks/cally-TZl4LpyH.js.map +0 -1
@@ -1,16 +1,7 @@
1
1
  import type Alpine from 'alpinejs';
2
- import { type BindingObject, type CleanupStack, type TrellisAlpineComponent } from '../../runtime';
2
+ import { type AlpineMachine, type BindingObject, type TrellisAlpineComponent } from '../../runtime';
3
3
  import { type ScrollAreaProps } from './contract';
4
- type ScrollAxis = 'x' | 'y';
5
- type DragState = {
6
- axis: ScrollAxis;
7
- pointerId: number;
8
- startPointer: number;
9
- startScroll: number;
10
- trackLength: number;
11
- thumbLength: number;
12
- maxScroll: number;
13
- };
4
+ import { type ScrollAreaContext, scrollAreaHooks } from './machine';
14
5
  type ScrollAreaElements = {
15
6
  root: HTMLElement;
16
7
  viewport: HTMLElement;
@@ -21,48 +12,31 @@ type ScrollAreaElements = {
21
12
  horizontalThumb: HTMLElement | null;
22
13
  corner: HTMLElement | null;
23
14
  };
24
- type AxisGeometry = {
25
- trackLength: number;
26
- thumbLength: number;
27
- maxOffset: number;
28
- maxScroll: number;
29
- };
30
- type ScrollAreaData = {
31
- props: ScrollAreaProps;
32
- listeners: CleanupStack;
33
- resizeObserver: ResizeObserver | null;
34
- mutationObserver: MutationObserver | null;
35
- frame: number;
36
- positionFrame: number;
37
- fadeTimer: number;
38
- isHovered: boolean;
39
- isFocused: boolean;
40
- isScrolling: boolean;
41
- dragging: DragState | null;
42
- overflowX: boolean;
43
- overflowY: boolean;
44
- verticalGeometry: AxisGeometry | null;
45
- horizontalGeometry: AxisGeometry | null;
46
- root: BindingObject;
15
+ /**
16
+ * Public Alpine API for `ui.scroll-area`.
17
+ *
18
+ * @public
19
+ */
20
+ interface UiScrollAreaApi {
21
+ /** Whether content currently overflows the horizontal axis. */
22
+ readonly overflowX: boolean;
23
+ /** Whether content currently overflows the vertical axis. */
24
+ readonly overflowY: boolean;
25
+ /** Whether the native viewport is in an active scroll session. */
26
+ readonly isScrolling: boolean;
27
+ /** Whether a custom scrollbar thumb is being dragged. */
28
+ readonly isDragging: boolean;
29
+ }
30
+ type ScrollAreaData = AlpineMachine<ScrollAreaContext, ScrollAreaProps, typeof scrollAreaHooks> & UiScrollAreaApi & {
31
+ readonly root: BindingObject;
32
+ init(): void;
33
+ destroy(): void;
47
34
  viewport(el: HTMLElement): BindingObject;
48
35
  scrollbar(el: HTMLElement): BindingObject;
49
36
  thumb(el: HTMLElement): BindingObject;
50
37
  corner(el: HTMLElement): BindingObject;
51
- elements(): ScrollAreaElements;
52
- scheduleSync(): void;
53
- schedulePositionSync(): void;
54
- sync(): void;
55
- updateGeometry(elements: ScrollAreaElements): void;
56
- updateThumbPositions(elements: ScrollAreaElements): void;
57
- updateVisibility(elements: ScrollAreaElements): void;
58
- startFadeTimer(): void;
59
- clearFadeTimer(): void;
60
- onScroll(): void;
61
- onPointerDown(event: PointerEvent, axis: ScrollAxis): void;
62
- onPointerMove(event: PointerEvent): void;
63
- onPointerUp(event: PointerEvent): void;
64
38
  };
65
39
  declare const UiScrollArea: () => TrellisAlpineComponent<ScrollAreaData>;
66
40
  declare const registerScrollArea: (AlpineInstance: Alpine.Alpine) => void;
67
- export { registerScrollArea, UiScrollArea, };
68
- export type { ScrollAreaData, ScrollAreaElements };
41
+ export { registerScrollArea, UiScrollArea };
42
+ export type { ScrollAreaData, ScrollAreaElements, UiScrollAreaApi };
@@ -0,0 +1,21 @@
1
+ import { type Machine, type MachineScope } from '../../runtime/state-machine';
2
+ import type { ScrollAreaProps } from './contract';
3
+ type ScrollAxis = 'x' | 'y';
4
+ type ScrollAreaContext = {
5
+ overflow: {
6
+ x: boolean;
7
+ y: boolean;
8
+ };
9
+ };
10
+ type ScrollAreaMachineEffects = {
11
+ sync(scope: MachineScope<ScrollAreaContext, ScrollAreaProps>): void;
12
+ };
13
+ type CreateScrollAreaMachineOptions = {
14
+ props: ScrollAreaProps;
15
+ context: ScrollAreaContext;
16
+ effects: ScrollAreaMachineEffects;
17
+ };
18
+ declare const scrollAreaHooks: readonly [];
19
+ declare const createScrollAreaMachine: ({ props, context, effects, }: CreateScrollAreaMachineOptions) => Machine<ScrollAreaContext, ScrollAreaProps>;
20
+ export { createScrollAreaMachine, scrollAreaHooks };
21
+ export type { CreateScrollAreaMachineOptions, ScrollAreaContext, ScrollAreaMachineEffects, ScrollAxis, };
@@ -0,0 +1,2 @@
1
+ declare const scrollAreaRuntimeDocs: import("../../docs/transition-docs").ComponentTransitionDocs;
2
+ export { scrollAreaRuntimeDocs };
@@ -1,27 +1,26 @@
1
- import { type PropState } from '../../runtime';
1
+ import { type SchemaToProps } from '../../runtime';
2
2
  import { type LayoutAs } from '../layout';
3
3
  declare const SECTION_DISPLAYS: readonly ["block", "none"];
4
- declare const SECTION_SIZES: readonly ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"];
4
+ declare const SECTION_SIZES: readonly ["0", "0.5", "1", "1.5", "2", "2.5", "3", "3.5", "4", "4.5", "5", "5.5", "6", "6.5", "7", "7.5", "8", "8.5", "9", "9.5", "10", "10.5", "11", "11.5", "12"];
5
5
  declare const sectionSchema: {
6
- padding: import("../../runtime/codecs").OneOfCodec<"0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9">;
7
- paddingX: import("../../runtime/codecs").OneOfCodec<"0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9">;
8
- paddingY: import("../../runtime/codecs").OneOfCodec<"0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9">;
9
- margin: import("../../runtime/codecs").OneOfCodec<"0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9">;
10
- marginX: import("../../runtime/codecs").OneOfCodec<"0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9">;
11
- marginY: import("../../runtime/codecs").OneOfCodec<"0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9">;
12
- surface: import("../../runtime/codecs").OneOfCodec<"none" | "subtle" | "accent" | "app" | "chrome" | "panel" | "raised" | "overlay" | "inverse">;
13
- tone: import("../../runtime/codecs").OneOfCodec<"solid" | "alpha">;
6
+ padding: import("../../runtime/codecs").OneOfCodec<"1" | "0" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "0.5" | "1.5" | "2.5" | "3.5" | "4.5" | "5.5" | "6.5" | "7.5" | "8.5" | "9.5" | "10.5" | "11.5">;
7
+ paddingX: import("../../runtime/codecs").OneOfCodec<"1" | "0" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "0.5" | "1.5" | "2.5" | "3.5" | "4.5" | "5.5" | "6.5" | "7.5" | "8.5" | "9.5" | "10.5" | "11.5">;
8
+ paddingY: import("../../runtime/codecs").OneOfCodec<"1" | "0" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "0.5" | "1.5" | "2.5" | "3.5" | "4.5" | "5.5" | "6.5" | "7.5" | "8.5" | "9.5" | "10.5" | "11.5">;
9
+ margin: import("../../runtime/codecs").OneOfCodec<"1" | "0" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "0.5" | "1.5" | "2.5" | "3.5" | "4.5" | "5.5" | "6.5" | "7.5" | "8.5" | "9.5" | "10.5" | "11.5">;
10
+ marginX: import("../../runtime/codecs").OneOfCodec<"1" | "0" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "0.5" | "1.5" | "2.5" | "3.5" | "4.5" | "5.5" | "6.5" | "7.5" | "8.5" | "9.5" | "10.5" | "11.5">;
11
+ marginY: import("../../runtime/codecs").OneOfCodec<"1" | "0" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "0.5" | "1.5" | "2.5" | "3.5" | "4.5" | "5.5" | "6.5" | "7.5" | "8.5" | "9.5" | "10.5" | "11.5">;
12
+ surface: import("../../runtime/codecs").OneOfCodec<"1" | "0" | "2" | "inherit" | "3" | "4" | "5" | "6" | "7" | "8" | "+1" | "+2" | "+3" | "+4" | "+5" | "+6" | "+7" | "+8">;
14
13
  radius: import("../../runtime/codecs").OneOfCodec<"none" | "xs" | "sm" | "md" | "lg" | "full">;
15
- elevation: import("../../runtime/codecs").OneOfCodec<"1" | "none" | "2" | "3" | "4" | "5" | "6">;
14
+ elevation: import("../../runtime/codecs").OneOfCodec<"1" | "match" | "2" | "none" | "3" | "4" | "5" | "6" | "7" | "8">;
16
15
  width: import("../../runtime/codecs").OneOfCodec<"xs" | "sm" | "md" | "lg" | "full" | "auto" | "xl" | "prose">;
17
16
  height: import("../../runtime/codecs").OneOfCodec<"xs" | "sm" | "md" | "lg" | "full" | "auto" | "xl">;
18
17
  class: import("../../runtime/codecs").StringCodec;
19
18
  as: import("../../runtime/codecs").OneOfCodec<"article" | "aside" | "div" | "footer" | "form" | "header" | "li" | "main" | "nav" | "ol" | "section" | "span" | "ul">;
20
19
  display: import("../../runtime/codecs").OneOfCodec<"none" | "block">;
21
- size: import("../../runtime/codecs").OneOfCodec<"0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9">;
20
+ size: import("../../runtime/codecs").OneOfCodec<"1" | "0" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "0.5" | "1.5" | "2.5" | "3.5" | "4.5" | "5.5" | "6.5" | "7.5" | "8.5" | "9.5" | "10.5" | "11.5">;
22
21
  };
23
22
  type SectionDisplay = typeof SECTION_DISPLAYS[number];
24
23
  type SectionSize = typeof SECTION_SIZES[number];
25
- type SectionProps = PropState<typeof sectionSchema>;
24
+ type SectionProps = SchemaToProps<typeof sectionSchema>;
26
25
  export { SECTION_DISPLAYS, SECTION_SIZES, sectionSchema, };
27
26
  export type { LayoutAs as SectionAs, SectionDisplay, SectionProps, SectionSize, };
@@ -1,5 +1,5 @@
1
- import { type PropState } from '../../runtime';
2
- import { type Alignment, type ComponentRadius, type ControlSize, type ControlVariant, type IconVariant, type Position } from '../common';
1
+ import { type SchemaToProps } from '../../runtime';
2
+ import { type Alignment, type ComponentRadius, type ControlSize, type ControlVariant, type ElevationReference, type IconVariant, type Position, type SurfaceReference } from '../common';
3
3
  import { BADGE_COLORS, BADGE_VARIANTS, type BadgeColor, type BadgeVariant } from '../badge/contract';
4
4
  declare const SELECT_MODES: readonly ["listbox", "combobox", "pillbox", "native"];
5
5
  declare const SELECT_VARIANTS: readonly ["outline", "filled"];
@@ -10,6 +10,8 @@ declare const SELECT_ALIGNS: readonly ["start", "center", "end"];
10
10
  declare const SELECT_ICON_VARIANTS: readonly ["outline", "solid", "mini", "micro"];
11
11
  declare const SELECT_CLEARS: readonly ["stay", "close"];
12
12
  declare const SELECT_MARKS: readonly ["check", "checkbox", "none"];
13
+ declare const SELECT_SURFACES: readonly ["inherit", "0", "1", "2", "3", "4", "5", "6", "7", "8", "+1", "+2", "+3", "+4", "+5", "+6", "+7", "+8"];
14
+ declare const SELECT_ELEVATIONS: readonly ["none", "match", "1", "2", "3", "4", "5", "6", "7", "8"];
13
15
  type SelectMode = typeof SELECT_MODES[number];
14
16
  type SelectVariant = ControlVariant;
15
17
  type SelectSize = ControlSize;
@@ -19,21 +21,24 @@ type SelectAlign = Alignment;
19
21
  type SelectIconVariant = IconVariant;
20
22
  type SelectClear = typeof SELECT_CLEARS[number];
21
23
  type SelectMark = typeof SELECT_MARKS[number];
24
+ type SelectSurface = SurfaceReference;
25
+ type SelectElevation = ElevationReference;
22
26
  type SelectChipVariant = BadgeVariant;
23
27
  type SelectChipColor = BadgeColor;
24
28
  declare const selectSchema: {
25
29
  name: import("../../runtime/codecs").StringCodec;
26
30
  value: import("../../runtime/codecs").StringCodec;
27
- values: import("../../runtime/codecs").StringCodec;
31
+ values: import("../../runtime/codecs").JsonCodec<string[]>;
28
32
  placeholder: import("../../runtime/codecs").StringCodec;
29
- mode: import("../../runtime/codecs").OneOfCodec<"listbox" | "combobox" | "native" | "pillbox">;
33
+ mode: import("../../runtime/codecs").OneOfCodec<"native" | "listbox" | "combobox" | "pillbox">;
30
34
  multiple: import("../../runtime/codecs").BoolCodec;
31
35
  searchable: import("../../runtime/codecs").BoolCodec;
36
+ creatable: import("../../runtime/codecs").BoolCodec;
32
37
  filter: import("../../runtime/codecs").BoolCodec;
33
38
  clearable: import("../../runtime/codecs").BoolCodec;
34
39
  clear: import("../../runtime/codecs").OneOfCodec<"close" | "stay">;
35
40
  suffix: import("../../runtime/codecs").StringCodec;
36
- mark: import("../../runtime/codecs").OneOfCodec<"none" | "checkbox" | "check">;
41
+ mark: import("../../runtime/codecs").OneOfCodec<"none" | "check" | "checkbox">;
37
42
  open: import("../../runtime/codecs").BoolCodec;
38
43
  disabled: import("../../runtime/codecs").BoolCodec;
39
44
  readonly: import("../../runtime/codecs").BoolCodec;
@@ -45,19 +50,18 @@ declare const selectSchema: {
45
50
  size: import("../../runtime/codecs").OneOfCodec<"xs" | "sm" | "md" | "lg" | "xlg">;
46
51
  variant: import("../../runtime/codecs").OneOfCodec<"outline" | "filled">;
47
52
  radius: import("../../runtime/codecs").OneOfCodec<"none" | "xs" | "sm" | "md" | "lg" | "full">;
48
- side: import("../../runtime/codecs").OneOfCodec<"bottom" | "left" | "right" | "top">;
49
- align: import("../../runtime/codecs").OneOfCodec<"end" | "center" | "start">;
53
+ surface: import("../../runtime/codecs").OneOfCodec<"1" | "0" | "2" | "inherit" | "3" | "4" | "5" | "6" | "7" | "8" | "+1" | "+2" | "+3" | "+4" | "+5" | "+6" | "+7" | "+8">;
54
+ elevation: import("../../runtime/codecs").OneOfCodec<"1" | "match" | "2" | "none" | "3" | "4" | "5" | "6" | "7" | "8">;
55
+ side: import("../../runtime/codecs").OneOfCodec<"top" | "bottom" | "left" | "right">;
56
+ align: import("../../runtime/codecs").OneOfCodec<"start" | "center" | "end">;
50
57
  offset: import("../../runtime/codecs").NumberCodec;
51
58
  gap: import("../../runtime/codecs").NumberCodec;
52
59
  empty: import("../../runtime/codecs").StringCodec;
53
- searchPlaceholder: import("../../runtime/codecs").StringCodec;
54
- searchIcon: import("../../runtime/codecs").StringCodec;
55
60
  icon: import("../../runtime/codecs").StringCodec;
56
61
  iconTrailing: import("../../runtime/codecs").StringCodec;
57
62
  iconVariant: import("../../runtime/codecs").OneOfCodec<"outline" | "solid" | "mini" | "micro">;
58
63
  buttonClass: import("../../runtime/codecs").StringCodec;
59
64
  inputClass: import("../../runtime/codecs").StringCodec;
60
- searchClass: import("../../runtime/codecs").StringCodec;
61
65
  listboxClass: import("../../runtime/codecs").StringCodec;
62
66
  optionClass: import("../../runtime/codecs").StringCodec;
63
67
  chipVariant: import("../../runtime/codecs").OneOfCodec<"outline" | "solid" | "soft" | "surface">;
@@ -86,8 +90,8 @@ declare const selectCreateOptionSchema: {
86
90
  value: import("../../runtime/codecs").StringCodec;
87
91
  class: import("../../runtime/codecs").StringCodec;
88
92
  };
89
- type SelectProps = PropState<typeof selectSchema>;
90
- type SelectOptionProps = PropState<typeof selectOptionSchema>;
91
- type SelectCreateOptionProps = PropState<typeof selectCreateOptionSchema>;
92
- export { SELECT_ALIGNS, SELECT_CLEARS, BADGE_COLORS as SELECT_CHIP_COLORS, BADGE_VARIANTS as SELECT_CHIP_VARIANTS, SELECT_ICON_VARIANTS, SELECT_MARKS, SELECT_MODES, SELECT_RADII, SELECT_SIDES, SELECT_SIZES, SELECT_VARIANTS, selectCreateOptionSchema, selectOptionSchema, selectSchema, };
93
- export type { SelectAlign, SelectClear, SelectChipColor, SelectChipVariant, SelectCreateOptionProps, SelectIconVariant, SelectMark, SelectOptionProps, SelectSide, SelectProps, SelectRadius, SelectSize, SelectMode, SelectVariant, };
93
+ type SelectProps = SchemaToProps<typeof selectSchema>;
94
+ type SelectOptionProps = SchemaToProps<typeof selectOptionSchema>;
95
+ type SelectCreateOptionProps = SchemaToProps<typeof selectCreateOptionSchema>;
96
+ export { SELECT_ALIGNS, SELECT_CLEARS, SELECT_ELEVATIONS, BADGE_COLORS as SELECT_CHIP_COLORS, BADGE_VARIANTS as SELECT_CHIP_VARIANTS, SELECT_ICON_VARIANTS, SELECT_MARKS, SELECT_MODES, SELECT_RADII, SELECT_SIDES, SELECT_SIZES, SELECT_SURFACES, SELECT_VARIANTS, selectCreateOptionSchema, selectOptionSchema, selectSchema, };
97
+ export type { SelectAlign, SelectClear, SelectChipColor, SelectChipVariant, SelectCreateOptionProps, SelectElevation, SelectIconVariant, SelectMark, SelectOptionProps, SelectSide, SelectProps, SelectRadius, SelectSize, SelectSurface, SelectMode, SelectVariant, };
@@ -1,98 +1,51 @@
1
1
  import type Alpine from 'alpinejs';
2
- import { type AnchoredPopover, type BindingObject, type Machine, type TrellisAlpineComponent } from '../../runtime';
3
- import type { PresenceLifecycle } from '../../motion';
2
+ import { type AlpineMachine, type TrellisAlpineComponent } from '../../runtime';
3
+ import { type BindingObject } from '../../runtime/merge-bindings';
4
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 = {
5
+ import { type SelectContext, selectHooks } from './machine';
6
+ /**
7
+ * Public Alpine API for `ui.select`.
8
+ *
9
+ * @public
10
+ */
11
+ interface UiSelectApi {
12
+ /** Whether the select is opening or fully open. */
21
13
  readonly 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
- machine: Machine<Record<string, never>>;
32
- popover: AnchoredPopover | null;
33
- popoverMotion: PresenceLifecycle | null;
34
- listeners: Array<() => void>;
35
- observer: MutationObserver | null;
36
- renderedChipsKey: string;
37
- renderedHiddenInputsKey: string;
38
- root: BindingObject;
39
- control(): HTMLElement;
40
- trigger(): HTMLElement;
41
- input(): HTMLInputElement | null;
42
- searchInput(): HTMLInputElement | null;
43
- popoverEl(): PopoverElement;
44
- listbox(): HTMLElement;
45
- chipsEl(): HTMLElement | null;
46
- hiddenInputsEl(): HTMLElement | null;
47
- options(): SelectOption[];
48
- enabledVisibleOptions(): SelectOption[];
49
- hasSelection(): boolean;
50
- hasClearValue(): boolean;
51
- isPillbox(): boolean;
52
- controlLayoutMode(): SelectProps['mode'];
53
- valuesFromProps(): string[];
54
- applyProps(changedKeys?: string[]): void;
55
- selectedSummary(): string;
56
- openSelect(event?: Event): void;
57
- closeSelect(event?: Event): void;
14
+ /** Whether a searching transition hook is pending. */
15
+ readonly isSearching: boolean;
16
+ /** First selected value, or an empty string. */
17
+ readonly value: string;
18
+ /** Selected values in committed order. */
19
+ readonly values: readonly string[];
20
+ /** Display labels corresponding to the selected values. */
21
+ readonly selectedLabels: readonly string[];
22
+ /** Current search query. */
23
+ readonly search: string;
24
+ /** Value of the currently highlighted option. */
25
+ readonly activeValue: string;
26
+ /** Opens the listbox unless the select is disabled or readonly. */
27
+ open(event?: Event): void;
28
+ /** Closes the listbox. Keyboard dismissal restores focus to the trigger. */
29
+ close(event?: Event): void;
30
+ /** Reverses the current disclosure lifecycle. */
58
31
  toggle(event?: Event): void;
59
- clear(event?: Event): void;
60
- select(valueOrOption: string | SelectOption, event?: Event): void;
32
+ /** Selects the rendered option with this value. */
33
+ select(value: string, event?: Event): void;
34
+ /** Removes a selected value. */
61
35
  deselect(value: string, event?: Event): void;
62
- removeLastValue(event?: Event): void;
63
- setSearch(value: string): void;
64
- refreshOptions(): void;
65
- selectOption(option: SelectOption, event?: Event): void;
66
- setActive(option: SelectOption | null): void;
67
- moveActive(delta: 1 | -1): void;
68
- focusFirst(): void;
69
- focusLast(): void;
70
- handleSearchInput(event: Event): void;
71
- handleInput(event: Event): void;
72
- handleKeydown(event: KeyboardEvent): void;
73
- handleFocusout(event: FocusEvent): void;
74
- sync(): void;
75
- syncRoot(): void;
76
- syncControl(): void;
77
- syncTrigger(): void;
78
- syncInputs(): void;
79
- syncListbox(): void;
80
- syncClosedState(): void;
81
- syncOptions(): void;
82
- syncChips(): void;
83
- syncHiddenInputs(): void;
84
- mount(): void;
85
- unmount(): void;
86
- exitPopover(): void;
87
- finishClose(): void;
88
- setup(): void;
89
- selectedOption(): SelectOption | null;
90
- selectedContent(option: SelectOption): DocumentFragment;
91
- resolveOptionLabel(el: HTMLElement): string;
92
- resolveSelectedLabel(el: HTMLElement, label: string): string;
93
- optionValue(el: HTMLElement, label: string): string;
36
+ /** Selects every rendered, visible, enabled option in multiple mode. */
37
+ selectAll(event?: Event): void;
38
+ /** Clears search, selection, highlight, and submitted values. */
39
+ clear(event?: Event): void;
40
+ /** Sets the query and enters the searching feature state. */
41
+ setSearch(query: string): void;
42
+ }
43
+ type SelectData = AlpineMachine<SelectContext, SelectProps, typeof selectHooks> & UiSelectApi & {
44
+ readonly root: BindingObject;
45
+ init(): void;
46
+ destroy(): void;
94
47
  };
95
48
  declare const UiSelect: () => TrellisAlpineComponent<SelectData>;
96
49
  declare const registerSelect: (AlpineInstance: Alpine.Alpine) => void;
97
50
  export { registerSelect, UiSelect };
98
- export type { SelectData, SelectOption };
51
+ export type { SelectData, UiSelectApi };