@rippling/rippling-sdk 0.2.0-alpha.59 → 0.2.0-alpha.60

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