@rippling/rippling-sdk 0.2.0-alpha.34 → 0.2.0-alpha.36

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 (270) hide show
  1. package/client.d.mts +6 -0
  2. package/client.d.mts.map +1 -1
  3. package/client.d.ts +6 -0
  4. package/client.d.ts.map +1 -1
  5. package/client.js +6 -0
  6. package/client.js.map +1 -1
  7. package/client.mjs +6 -0
  8. package/client.mjs.map +1 -1
  9. package/examples/.keep +4 -0
  10. package/examples/manifest/dental-practice-management/dental-practice-management.ts +651 -0
  11. package/examples/manifest/dental-practice-management/manifest.json +1870 -0
  12. package/examples/manifest/gym-membership-management/gym-membership-management.ts +757 -0
  13. package/examples/manifest/gym-membership-management/manifest.json +1975 -0
  14. package/examples/sdui/sdui-crud-todo/rippling-function.ts +367 -0
  15. package/examples/sdui/sdui-crud-todo/sdui-crud-todo.ts +282 -0
  16. package/examples/sdui/sdui-showcase/rippling-function.ts +381 -0
  17. package/examples/sdui/sdui-showcase/sdui-showcase.ts +351 -0
  18. package/examples/sdui/sdui-tab-multi-view/rippling-function.ts +1061 -0
  19. package/examples/sdui/sdui-tab-multi-view/sdui-tab-multi-view.ts +924 -0
  20. package/examples/sdui/vote/rippling-function.ts +330 -0
  21. package/examples/sdui/vote/vote.ts +298 -0
  22. package/lib/manifest/app.d.mts +81 -13
  23. package/lib/manifest/app.d.mts.map +1 -1
  24. package/lib/manifest/app.d.ts +81 -13
  25. package/lib/manifest/app.d.ts.map +1 -1
  26. package/lib/manifest/app.js +37 -16
  27. package/lib/manifest/app.js.map +1 -1
  28. package/lib/manifest/app.mjs +37 -16
  29. package/lib/manifest/app.mjs.map +1 -1
  30. package/lib/manifest/category.d.mts +63 -7
  31. package/lib/manifest/category.d.mts.map +1 -1
  32. package/lib/manifest/category.d.ts +63 -7
  33. package/lib/manifest/category.d.ts.map +1 -1
  34. package/lib/manifest/category.js +45 -10
  35. package/lib/manifest/category.js.map +1 -1
  36. package/lib/manifest/category.mjs +43 -8
  37. package/lib/manifest/category.mjs.map +1 -1
  38. package/lib/manifest/custom-object-field-section.d.mts +56 -6
  39. package/lib/manifest/custom-object-field-section.d.mts.map +1 -1
  40. package/lib/manifest/custom-object-field-section.d.ts +56 -6
  41. package/lib/manifest/custom-object-field-section.d.ts.map +1 -1
  42. package/lib/manifest/custom-object-field-section.js +41 -14
  43. package/lib/manifest/custom-object-field-section.js.map +1 -1
  44. package/lib/manifest/custom-object-field-section.mjs +39 -12
  45. package/lib/manifest/custom-object-field-section.mjs.map +1 -1
  46. package/lib/manifest/custom-object-page-layout.d.mts +201 -41
  47. package/lib/manifest/custom-object-page-layout.d.mts.map +1 -1
  48. package/lib/manifest/custom-object-page-layout.d.ts +201 -41
  49. package/lib/manifest/custom-object-page-layout.d.ts.map +1 -1
  50. package/lib/manifest/custom-object-page-layout.js +76 -30
  51. package/lib/manifest/custom-object-page-layout.js.map +1 -1
  52. package/lib/manifest/custom-object-page-layout.mjs +74 -28
  53. package/lib/manifest/custom-object-page-layout.mjs.map +1 -1
  54. package/lib/manifest/custom-object.d.mts +128 -15
  55. package/lib/manifest/custom-object.d.mts.map +1 -1
  56. package/lib/manifest/custom-object.d.ts +128 -15
  57. package/lib/manifest/custom-object.d.ts.map +1 -1
  58. package/lib/manifest/custom-object.js +61 -26
  59. package/lib/manifest/custom-object.js.map +1 -1
  60. package/lib/manifest/custom-object.mjs +61 -26
  61. package/lib/manifest/custom-object.mjs.map +1 -1
  62. package/lib/manifest/field.d.mts +265 -54
  63. package/lib/manifest/field.d.mts.map +1 -1
  64. package/lib/manifest/field.d.ts +265 -54
  65. package/lib/manifest/field.d.ts.map +1 -1
  66. package/lib/manifest/field.js +100 -57
  67. package/lib/manifest/field.js.map +1 -1
  68. package/lib/manifest/field.mjs +100 -57
  69. package/lib/manifest/field.mjs.map +1 -1
  70. package/lib/manifest/list-view.d.mts +105 -14
  71. package/lib/manifest/list-view.d.mts.map +1 -1
  72. package/lib/manifest/list-view.d.ts +105 -14
  73. package/lib/manifest/list-view.d.ts.map +1 -1
  74. package/lib/manifest/list-view.js +50 -14
  75. package/lib/manifest/list-view.js.map +1 -1
  76. package/lib/manifest/list-view.mjs +48 -12
  77. package/lib/manifest/list-view.mjs.map +1 -1
  78. package/lib/manifest/manifest-builder.d.mts +77 -11
  79. package/lib/manifest/manifest-builder.d.mts.map +1 -1
  80. package/lib/manifest/manifest-builder.d.ts +77 -11
  81. package/lib/manifest/manifest-builder.d.ts.map +1 -1
  82. package/lib/manifest/manifest-builder.js +46 -24
  83. package/lib/manifest/manifest-builder.js.map +1 -1
  84. package/lib/manifest/manifest-builder.mjs +44 -22
  85. package/lib/manifest/manifest-builder.mjs.map +1 -1
  86. package/lib/manifest/manifest-function.d.mts +92 -12
  87. package/lib/manifest/manifest-function.d.mts.map +1 -1
  88. package/lib/manifest/manifest-function.d.ts +92 -12
  89. package/lib/manifest/manifest-function.d.ts.map +1 -1
  90. package/lib/manifest/manifest-function.js +40 -11
  91. package/lib/manifest/manifest-function.js.map +1 -1
  92. package/lib/manifest/manifest-function.mjs +38 -9
  93. package/lib/manifest/manifest-function.mjs.map +1 -1
  94. package/lib/manifest/rule.d.mts +94 -16
  95. package/lib/manifest/rule.d.mts.map +1 -1
  96. package/lib/manifest/rule.d.ts +94 -16
  97. package/lib/manifest/rule.d.ts.map +1 -1
  98. package/lib/manifest/rule.js +36 -15
  99. package/lib/manifest/rule.js.map +1 -1
  100. package/lib/manifest/rule.mjs +36 -15
  101. package/lib/manifest/rule.mjs.map +1 -1
  102. package/lib/manifest/sdui-page.d.mts +67 -11
  103. package/lib/manifest/sdui-page.d.mts.map +1 -1
  104. package/lib/manifest/sdui-page.d.ts +67 -11
  105. package/lib/manifest/sdui-page.d.ts.map +1 -1
  106. package/lib/manifest/sdui-page.js +44 -13
  107. package/lib/manifest/sdui-page.js.map +1 -1
  108. package/lib/manifest/sdui-page.mjs +42 -11
  109. package/lib/manifest/sdui-page.mjs.map +1 -1
  110. package/lib/manifest/validation.d.mts +87 -12
  111. package/lib/manifest/validation.d.mts.map +1 -1
  112. package/lib/manifest/validation.d.ts +87 -12
  113. package/lib/manifest/validation.d.ts.map +1 -1
  114. package/lib/manifest/validation.js +41 -15
  115. package/lib/manifest/validation.js.map +1 -1
  116. package/lib/manifest/validation.mjs +39 -13
  117. package/lib/manifest/validation.mjs.map +1 -1
  118. package/lib/sdui/actions.d.mts +25 -0
  119. package/lib/sdui/actions.d.mts.map +1 -0
  120. package/lib/sdui/actions.d.ts +25 -0
  121. package/lib/sdui/actions.d.ts.map +1 -0
  122. package/lib/sdui/actions.js +53 -0
  123. package/lib/sdui/actions.js.map +1 -0
  124. package/lib/sdui/actions.mjs +42 -0
  125. package/lib/sdui/actions.mjs.map +1 -0
  126. package/lib/sdui/component.d.mts +41 -0
  127. package/lib/sdui/component.d.mts.map +1 -0
  128. package/lib/sdui/component.d.ts +41 -0
  129. package/lib/sdui/component.d.ts.map +1 -0
  130. package/lib/sdui/component.js +95 -0
  131. package/lib/sdui/component.js.map +1 -0
  132. package/lib/sdui/component.mjs +91 -0
  133. package/lib/sdui/component.mjs.map +1 -0
  134. package/lib/sdui/components.d.mts +149 -0
  135. package/lib/sdui/components.d.mts.map +1 -0
  136. package/lib/sdui/components.d.ts +149 -0
  137. package/lib/sdui/components.d.ts.map +1 -0
  138. package/lib/sdui/components.js +303 -0
  139. package/lib/sdui/components.js.map +1 -0
  140. package/lib/sdui/components.mjs +298 -0
  141. package/lib/sdui/components.mjs.map +1 -0
  142. package/lib/sdui/conditions.d.mts +25 -0
  143. package/lib/sdui/conditions.d.mts.map +1 -0
  144. package/lib/sdui/conditions.d.ts +25 -0
  145. package/lib/sdui/conditions.d.ts.map +1 -0
  146. package/lib/sdui/conditions.js +47 -0
  147. package/lib/sdui/conditions.js.map +1 -0
  148. package/lib/sdui/conditions.mjs +35 -0
  149. package/lib/sdui/conditions.mjs.map +1 -0
  150. package/lib/sdui/directives.d.mts +18 -0
  151. package/lib/sdui/directives.d.mts.map +1 -0
  152. package/lib/sdui/directives.d.ts +18 -0
  153. package/lib/sdui/directives.d.ts.map +1 -0
  154. package/lib/sdui/directives.js +28 -0
  155. package/lib/sdui/directives.js.map +1 -0
  156. package/lib/sdui/directives.mjs +21 -0
  157. package/lib/sdui/directives.mjs.map +1 -0
  158. package/lib/sdui/index.d.mts +362 -0
  159. package/lib/sdui/index.d.mts.map +1 -0
  160. package/lib/sdui/index.d.ts +362 -0
  161. package/lib/sdui/index.d.ts.map +1 -0
  162. package/lib/sdui/index.js +375 -0
  163. package/lib/sdui/index.js.map +1 -0
  164. package/lib/sdui/index.mjs +199 -0
  165. package/lib/sdui/index.mjs.map +1 -0
  166. package/lib/sdui/props.d.mts +12 -0
  167. package/lib/sdui/props.d.mts.map +1 -0
  168. package/lib/sdui/props.d.ts +12 -0
  169. package/lib/sdui/props.d.ts.map +1 -0
  170. package/lib/sdui/props.js +25 -0
  171. package/lib/sdui/props.js.map +1 -0
  172. package/lib/sdui/props.mjs +21 -0
  173. package/lib/sdui/props.mjs.map +1 -0
  174. package/lib/sdui/render.d.mts +23 -0
  175. package/lib/sdui/render.d.mts.map +1 -0
  176. package/lib/sdui/render.d.ts +23 -0
  177. package/lib/sdui/render.d.ts.map +1 -0
  178. package/lib/sdui/render.js +40 -0
  179. package/lib/sdui/render.js.map +1 -0
  180. package/lib/sdui/render.mjs +37 -0
  181. package/lib/sdui/render.mjs.map +1 -0
  182. package/lib/sdui/state.d.mts +22 -0
  183. package/lib/sdui/state.d.mts.map +1 -0
  184. package/lib/sdui/state.d.ts +22 -0
  185. package/lib/sdui/state.d.ts.map +1 -0
  186. package/lib/sdui/state.js +57 -0
  187. package/lib/sdui/state.js.map +1 -0
  188. package/lib/sdui/state.mjs +53 -0
  189. package/lib/sdui/state.mjs.map +1 -0
  190. package/package.json +11 -1
  191. package/resources/company-legal-entity-workers.d.mts +79 -0
  192. package/resources/company-legal-entity-workers.d.mts.map +1 -0
  193. package/resources/company-legal-entity-workers.d.ts +79 -0
  194. package/resources/company-legal-entity-workers.d.ts.map +1 -0
  195. package/resources/company-legal-entity-workers.js +30 -0
  196. package/resources/company-legal-entity-workers.js.map +1 -0
  197. package/resources/company-legal-entity-workers.mjs +26 -0
  198. package/resources/company-legal-entity-workers.mjs.map +1 -0
  199. package/resources/draft-hires.d.mts +4 -0
  200. package/resources/draft-hires.d.mts.map +1 -1
  201. package/resources/draft-hires.d.ts +4 -0
  202. package/resources/draft-hires.d.ts.map +1 -1
  203. package/resources/files.d.mts +16 -1
  204. package/resources/files.d.mts.map +1 -1
  205. package/resources/files.d.ts +16 -1
  206. package/resources/files.d.ts.map +1 -1
  207. package/resources/headcount-positions.d.mts +2 -2
  208. package/resources/headcount-positions.d.mts.map +1 -1
  209. package/resources/headcount-positions.d.ts +2 -2
  210. package/resources/headcount-positions.d.ts.map +1 -1
  211. package/resources/index.d.mts +1 -0
  212. package/resources/index.d.mts.map +1 -1
  213. package/resources/index.d.ts +1 -0
  214. package/resources/index.d.ts.map +1 -1
  215. package/resources/index.js +4 -2
  216. package/resources/index.js.map +1 -1
  217. package/resources/index.mjs +1 -0
  218. package/resources/index.mjs.map +1 -1
  219. package/resources/legal-entities.d.mts +1 -1
  220. package/resources/legal-entities.d.mts.map +1 -1
  221. package/resources/legal-entities.d.ts +1 -1
  222. package/resources/legal-entities.d.ts.map +1 -1
  223. package/resources/location-factors.d.mts +2 -2
  224. package/resources/location-factors.d.mts.map +1 -1
  225. package/resources/location-factors.d.ts +2 -2
  226. package/resources/location-factors.d.ts.map +1 -1
  227. package/resources/shared.d.mts +1 -1
  228. package/resources/shared.d.mts.map +1 -1
  229. package/resources/shared.d.ts +1 -1
  230. package/resources/shared.d.ts.map +1 -1
  231. package/resources/workers.d.mts +2 -2
  232. package/resources/workers.d.mts.map +1 -1
  233. package/resources/workers.d.ts +2 -2
  234. package/resources/workers.d.ts.map +1 -1
  235. package/src/client.ts +20 -0
  236. package/src/lib/manifest/app.ts +81 -26
  237. package/src/lib/manifest/category.ts +63 -14
  238. package/src/lib/manifest/custom-object-field-section.ts +56 -17
  239. package/src/lib/manifest/custom-object-page-layout.ts +201 -66
  240. package/src/lib/manifest/custom-object.ts +128 -37
  241. package/src/lib/manifest/field.ts +265 -75
  242. package/src/lib/manifest/list-view.ts +105 -25
  243. package/src/lib/manifest/manifest-builder.ts +75 -32
  244. package/src/lib/manifest/manifest-function.ts +92 -22
  245. package/src/lib/manifest/rule.ts +95 -29
  246. package/src/lib/manifest/sdui-page.ts +67 -21
  247. package/src/lib/manifest/validation.ts +87 -24
  248. package/src/lib/sdui/actions.ts +58 -0
  249. package/src/lib/sdui/component.ts +122 -0
  250. package/src/lib/sdui/components.ts +308 -0
  251. package/src/lib/sdui/conditions.ts +59 -0
  252. package/src/lib/sdui/directives.ts +42 -0
  253. package/src/lib/sdui/index.ts +365 -0
  254. package/src/lib/sdui/props.ts +32 -0
  255. package/src/lib/sdui/render.ts +58 -0
  256. package/src/lib/sdui/state.ts +60 -0
  257. package/src/resources/company-legal-entity-workers.ts +115 -0
  258. package/src/resources/draft-hires.ts +5 -0
  259. package/src/resources/files.ts +18 -1
  260. package/src/resources/headcount-positions.ts +2 -0
  261. package/src/resources/index.ts +7 -0
  262. package/src/resources/legal-entities.ts +1 -0
  263. package/src/resources/location-factors.ts +2 -0
  264. package/src/resources/shared.ts +1 -0
  265. package/src/resources/workers.ts +2 -0
  266. package/src/version.ts +1 -1
  267. package/version.d.mts +1 -1
  268. package/version.d.ts +1 -1
  269. package/version.js +1 -1
  270. package/version.mjs +1 -1
@@ -0,0 +1,381 @@
1
+ /**
2
+ * ----------------------------------------------------------------------------
3
+ * PASTE INTO THE RIPPLING FUNCTION EDITOR TO PREVIEW. DEPENDS ON
4
+ * @rippling/rippling-sdk AND @rippling/sdui-builder.
5
+ * ----------------------------------------------------------------------------
6
+ * Pair: sdui-showcase.ts uses ../../../src/lib/sdui for local runs.
7
+ */
8
+
9
+ /*
10
+ import SDUI from '@rippling/sdui-builder';
11
+ import { FunctionContext, FunctionEvent, FunctionResponse } from '@rippling/rippling-sdk';
12
+
13
+ const CAROUSEL_SLIDES = [
14
+ { heading: 'One', img: 'https://picsum.photos/seed/ex1/880/360', alt: '' },
15
+ { heading: 'Two', img: 'https://picsum.photos/seed/ex2/880/360', alt: '' },
16
+ { heading: 'Three', img: 'https://picsum.photos/seed/ex3/880/360', alt: '' },
17
+ ];
18
+
19
+ const TREE_ROWS = [
20
+ { label: 'A', value: 'a' },
21
+ { label: 'B', value: 'b', parent: 'a' },
22
+ { label: 'C', value: 'c', parent: 'a' },
23
+ ];
24
+
25
+ const DRAG_ROWS = [
26
+ { id: '1', label: 'First' },
27
+ { id: '2', label: 'Second' },
28
+ { id: '3', label: 'Third' },
29
+ ];
30
+
31
+ function renderSpec(_functionId: string) {
32
+ const s = SDUI.createState({
33
+ eventDate: '2026-06-01',
34
+ phoneVal: '+15555550123',
35
+ budget: 500,
36
+ consent: false,
37
+ alertsOn: true,
38
+ drawerOpen: false,
39
+ toastOpen: false,
40
+ treeValue: '',
41
+ menuPick: 'a',
42
+ breadcrumbActive: 'here',
43
+ });
44
+
45
+ const page = SDUI.components.Layout({
46
+ width: '100%',
47
+ maxWidth: '800px',
48
+ margin: { left: 'auto', right: 'auto' },
49
+ padding: { top: 32, bottom: 48, left: 24, right: 24 },
50
+ children: [
51
+ SDUI.components.VStack({
52
+ gap: 'space500',
53
+ align: 'stretch',
54
+ children: [
55
+ SDUI.components.VStack({
56
+ gap: 'space150',
57
+ align: 'flex-start',
58
+ children: [
59
+ SDUI.components.Heading({
60
+ level: '1',
61
+ text: 'Extra components',
62
+ }),
63
+ SDUI.components.Text({
64
+ typestyle: 'bodyMd',
65
+ color: 'secondary',
66
+ text: 'Date, phone, currency, checkbox, switch, file drop, breadcrumbs, dropdown, menu list, pagination, drawer, carousel, video, tree, stepper, draggable list, loaders, snackbar.',
67
+ }),
68
+ ],
69
+ }),
70
+
71
+ SDUI.components.Card({
72
+ title: 'Fields',
73
+ padding: '24',
74
+ children: [
75
+ SDUI.components.VStack({
76
+ gap: 'space350',
77
+ align: 'stretch',
78
+ children: [
79
+ SDUI.components.Date({
80
+ name: 'd',
81
+ label: 'Date',
82
+ value: s.eventDate.$bind,
83
+ format: 'yyyy-MM-dd',
84
+ }),
85
+ SDUI.components.Phone({
86
+ name: 'p',
87
+ label: 'Phone',
88
+ value: s.phoneVal.$bind,
89
+ }),
90
+ SDUI.components.Currency({
91
+ name: 'c',
92
+ label: 'Amount',
93
+ value: s.budget.$bind,
94
+ prefix: '$',
95
+ }),
96
+ SDUI.components.HStack({
97
+ gap: 'space400',
98
+ wrap: false,
99
+ align: 'stretch',
100
+ children: [
101
+ SDUI.components.Layout({
102
+ flex: '1 1 0',
103
+ minWidth: '0',
104
+ minHeight: 48,
105
+ direction: 'column',
106
+ justify: 'center',
107
+ children: [
108
+ SDUI.components.Checkbox({
109
+ name: 'ok',
110
+ label: 'Opt in',
111
+ value: s.consent.$bind,
112
+ }),
113
+ ],
114
+ }),
115
+ SDUI.components.Layout({
116
+ flex: '1 1 0',
117
+ minWidth: '0',
118
+ minHeight: 48,
119
+ direction: 'column',
120
+ justify: 'center',
121
+ children: [
122
+ SDUI.components.Switch({
123
+ name: 'sw',
124
+ label: 'Alerts',
125
+ value: s.alertsOn.$bind,
126
+ compact: true,
127
+ }),
128
+ ],
129
+ }),
130
+ ],
131
+ }),
132
+ SDUI.components.FileDrop({
133
+ name: 'f',
134
+ label: 'Files',
135
+ value: [],
136
+ placeholder: 'Drop files',
137
+ multiple: true,
138
+ }),
139
+ ],
140
+ }),
141
+ ],
142
+ }),
143
+
144
+ SDUI.components.Card({
145
+ title: 'Navigation',
146
+ padding: '24',
147
+ children: [
148
+ SDUI.components.VStack({
149
+ gap: 'space400',
150
+ align: 'stretch',
151
+ children: [
152
+ SDUI.components.Breadcrumb({
153
+ items: [
154
+ { title: 'Start', value: 'start', href: '#' },
155
+ { title: 'Here', value: 'here', href: '#' },
156
+ ],
157
+ active: s.breadcrumbActive.$bind,
158
+ }),
159
+ SDUI.components.HStack({
160
+ gap: 'space300',
161
+ wrap: true,
162
+ align: 'center',
163
+ children: [
164
+ SDUI.components.Dropdown({
165
+ triggerLabel: 'Choose',
166
+ list: [
167
+ { label: 'Alpha', value: 'a' },
168
+ { label: 'Beta', value: 'b' },
169
+ ],
170
+ value: s.menuPick.$bind,
171
+ width: 200,
172
+ }),
173
+ SDUI.components.Button({
174
+ label: 'Drawer',
175
+ appearance: 'OUTLINE',
176
+ size: 'S',
177
+ onPress: SDUI.actions.set(s.drawerOpen, true),
178
+ }),
179
+ SDUI.components.Button({
180
+ label: 'Toast',
181
+ appearance: 'GHOST',
182
+ size: 'S',
183
+ onPress: SDUI.actions.set(s.toastOpen, true),
184
+ }),
185
+ ],
186
+ }),
187
+ SDUI.components.MenuList({
188
+ list: [
189
+ { label: 'One', value: '1' },
190
+ { label: 'Two', value: '2' },
191
+ ],
192
+ width: '100%',
193
+ maxHeight: 160,
194
+ }),
195
+ SDUI.components.Layout({
196
+ width: '100%',
197
+ padding: { top: 8 },
198
+ children: [
199
+ SDUI.components.Paginate({
200
+ pageCount: 5,
201
+ initialPage: 2,
202
+ alignment: 'CENTER',
203
+ }),
204
+ ],
205
+ }),
206
+ ],
207
+ }),
208
+ ],
209
+ }),
210
+
211
+ SDUI.components.Card({
212
+ title: 'Media',
213
+ padding: '24',
214
+ children: [
215
+ SDUI.components.VStack({
216
+ gap: 'space400',
217
+ align: 'stretch',
218
+ children: [
219
+ SDUI.components.Carousel({ slides: CAROUSEL_SLIDES }),
220
+ SDUI.components.Video({
221
+ src: 'https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.mp4',
222
+ width: '100%',
223
+ loading: 'lazy',
224
+ name: 'v',
225
+ }),
226
+ ],
227
+ }),
228
+ ],
229
+ }),
230
+
231
+ SDUI.components.Card({
232
+ title: 'Lists',
233
+ padding: '24',
234
+ children: [
235
+ SDUI.components.VStack({
236
+ gap: 'space450',
237
+ align: 'stretch',
238
+ children: [
239
+ SDUI.components.Tree({
240
+ name: 't',
241
+ label: 'Tree',
242
+ list: TREE_ROWS,
243
+ value: s.treeValue.$bind,
244
+ maxHeight: 180,
245
+ }),
246
+ SDUI.components.Stepper({
247
+ steps: [
248
+ { title: 'Done', status: 'COMPLETE' },
249
+ { title: 'Active', status: 'TODO' },
250
+ { title: 'Next', status: 'TODO' },
251
+ ],
252
+ activeStepIndex: 1,
253
+ }),
254
+ SDUI.components.DraggableList({
255
+ list: DRAG_ROWS,
256
+ labelKey: 'label',
257
+ groupName: 'g',
258
+ width: '100%',
259
+ showDragIcon: true,
260
+ }),
261
+ ],
262
+ }),
263
+ ],
264
+ }),
265
+
266
+ SDUI.components.Card({
267
+ title: 'Loading',
268
+ padding: '24',
269
+ children: [
270
+ SDUI.components.VStack({
271
+ gap: 'space400',
272
+ align: 'stretch',
273
+ children: [
274
+ SDUI.components.HStack({
275
+ gap: 'space300',
276
+ align: 'center',
277
+ children: [
278
+ SDUI.components.Spinner({
279
+ size: 'M',
280
+ appearance: 'PRIMARY',
281
+ alignment: 'LEFT',
282
+ }),
283
+ SDUI.components.Text({
284
+ typestyle: 'bodySm',
285
+ color: 'secondary',
286
+ text: 'Working…',
287
+ }),
288
+ ],
289
+ }),
290
+ SDUI.components.Skeleton({
291
+ variant: 'TEXT',
292
+ lines: 2,
293
+ width: '100%',
294
+ }),
295
+ SDUI.components.HStack({
296
+ gap: 'space300',
297
+ align: 'center',
298
+ children: [
299
+ SDUI.components.Skeleton({ variant: 'CIRCLE', size: 40 }),
300
+ SDUI.components.Skeleton({ variant: 'BOX', width: 160, height: 48, borderRadius: 6 }),
301
+ ],
302
+ }),
303
+ SDUI.components.ContentLoader({ width: '100%', height: 40, speed: 1 }),
304
+ SDUI.components.SnackBar({
305
+ text: 'Done.',
306
+ appearance: 'SUCCESS',
307
+ canDismiss: true,
308
+ isVisible: s.toastOpen.$bind,
309
+ onDismiss: SDUI.actions.set(s.toastOpen, false),
310
+ }),
311
+ ],
312
+ }),
313
+ ],
314
+ }),
315
+ ],
316
+ }),
317
+ ],
318
+ });
319
+
320
+ const root = SDUI.components.VStack({
321
+ gap: 'space0',
322
+ align: 'stretch',
323
+ children: [
324
+ page,
325
+ SDUI.components.Drawer({
326
+ isVisible: s.drawerOpen.$bind,
327
+ title: 'Drawer',
328
+ width: 360,
329
+ theme: 'GRAY',
330
+ onClose: SDUI.actions.set(s.drawerOpen, false),
331
+ children: [
332
+ SDUI.components.VStack({
333
+ gap: 'space300',
334
+ children: [
335
+ SDUI.components.Text({
336
+ text: 'Side content.',
337
+ typestyle: 'bodyMd',
338
+ }),
339
+ SDUI.components.Button({
340
+ label: 'Close',
341
+ appearance: 'PRIMARY',
342
+ size: 'S',
343
+ onPress: SDUI.actions.set(s.drawerOpen, false),
344
+ }),
345
+ ],
346
+ }),
347
+ ],
348
+ }),
349
+ ],
350
+ });
351
+
352
+ return SDUI.render(s, root);
353
+ }
354
+
355
+
356
+ export async function onRipplingEvent(
357
+ event: FunctionEvent,
358
+ context: FunctionContext,
359
+ ): Promise<FunctionResponse> {
360
+ const params = event['parameters'] as Record<string, string | undefined> | undefined;
361
+ const action = params?.['action'];
362
+
363
+ if (!action || action === 'init') {
364
+ const spec = renderSpec(context.function?.function_id ?? 'demo-fn');
365
+ return new FunctionResponse({
366
+ body: { spec: JSON.stringify(spec) },
367
+ statusCode: 200,
368
+ headers: {},
369
+ message: '',
370
+ });
371
+ }
372
+
373
+ return new FunctionResponse({
374
+ body: {},
375
+ statusCode: 200,
376
+ headers: {},
377
+ message: '',
378
+ });
379
+ }
380
+
381
+ */