@rokkit/core 1.0.0-next.113 → 1.0.0-next.114

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 (162) hide show
  1. package/dist/packages/actions/src/delegate.svelte.d.ts +13 -0
  2. package/dist/packages/actions/src/dismissable.svelte.d.ts +7 -0
  3. package/dist/packages/actions/src/fillable.svelte.d.ts +8 -0
  4. package/dist/packages/actions/src/index.d.ts +11 -0
  5. package/dist/packages/actions/src/kbd.d.ts +44 -0
  6. package/dist/packages/actions/src/keyboard.svelte.d.ts +7 -0
  7. package/dist/packages/actions/src/lib/event-manager.d.ts +8 -0
  8. package/dist/packages/actions/src/lib/index.d.ts +2 -0
  9. package/dist/packages/actions/src/lib/internal.d.ts +19 -0
  10. package/dist/packages/actions/src/navigable.svelte.d.ts +8 -0
  11. package/dist/packages/actions/src/navigator.svelte.d.ts +20 -0
  12. package/dist/packages/actions/src/pannable.svelte.d.ts +6 -0
  13. package/dist/packages/actions/src/skinnable.svelte.d.ts +8 -0
  14. package/dist/packages/actions/src/swipeable.svelte.d.ts +14 -0
  15. package/dist/packages/actions/src/themable.svelte.d.ts +7 -0
  16. package/dist/packages/actions/src/types.d.ts +72 -0
  17. package/dist/packages/actions/src/utils.d.ts +18 -0
  18. package/dist/packages/bits-ui/src/index.d.ts +2 -0
  19. package/dist/packages/bits-ui/src/reference.d.ts +22 -0
  20. package/dist/packages/bits-ui/src/tree/constants.d.ts +13 -0
  21. package/dist/packages/bits-ui/src/tree/index.d.ts +7 -0
  22. package/dist/packages/bits-ui/src/tree/types.d.ts +71 -0
  23. package/dist/packages/core/src/calendar.d.ts +10 -0
  24. package/dist/packages/core/src/colors/index.d.ts +333 -0
  25. package/dist/packages/core/src/connector.d.ts +8 -0
  26. package/dist/packages/core/src/constants.d.ts +39 -0
  27. package/dist/packages/core/src/events.d.ts +12 -0
  28. package/dist/packages/core/src/field-mapper.d.ts +63 -0
  29. package/dist/packages/core/src/index.d.ts +13 -0
  30. package/dist/packages/core/src/key-event-map.d.ts +18 -0
  31. package/dist/packages/core/src/mapped-items.d.ts +14 -0
  32. package/dist/packages/core/src/mapping.d.ts +75 -0
  33. package/dist/packages/core/src/nested.d.ts +18 -0
  34. package/dist/packages/core/src/string.d.ts +59 -0
  35. package/dist/packages/core/src/theme.d.ts +52 -0
  36. package/dist/packages/core/src/ticks.d.ts +10 -0
  37. package/dist/packages/core/src/types.d.ts +245 -0
  38. package/dist/packages/core/src/utils.d.ts +70 -0
  39. package/dist/packages/data/src/aggregators.d.ts +2 -0
  40. package/dist/packages/data/src/constants.d.ts +46 -0
  41. package/dist/packages/data/src/convert.d.ts +10 -0
  42. package/dist/packages/data/src/dataset.d.ts +43 -0
  43. package/dist/packages/data/src/filter.d.ts +26 -0
  44. package/dist/packages/data/src/formatter.d.ts +10 -0
  45. package/dist/packages/data/src/hierarchy.d.ts +36 -0
  46. package/dist/packages/data/src/index.d.ts +7 -0
  47. package/dist/packages/data/src/infer.d.ts +80 -0
  48. package/dist/packages/data/src/join.d.ts +95 -0
  49. package/dist/packages/data/src/list.d.ts +121 -0
  50. package/dist/packages/data/src/metadata.d.ts +32 -0
  51. package/dist/packages/data/src/model.d.ts +29 -0
  52. package/dist/packages/data/src/parser.d.ts +31 -0
  53. package/dist/packages/data/src/renamer.d.ts +37 -0
  54. package/dist/packages/data/src/rollup.d.ts +51 -0
  55. package/dist/packages/data/src/types.d.ts +346 -0
  56. package/dist/packages/data/src/utils.d.ts +6 -0
  57. package/dist/packages/data/src/view.d.ts +35 -0
  58. package/dist/packages/helpers/src/components/index.d.ts +2 -0
  59. package/dist/packages/helpers/src/index.d.ts +1 -0
  60. package/dist/packages/helpers/src/matchers/action.d.ts +27 -0
  61. package/dist/packages/helpers/src/matchers/array.d.ts +10 -0
  62. package/dist/packages/helpers/src/matchers/dataset.d.ts +10 -0
  63. package/dist/packages/helpers/src/matchers/event.d.ts +10 -0
  64. package/dist/packages/helpers/src/matchers/index.d.ts +4 -0
  65. package/dist/packages/helpers/src/matchers/internal.d.ts +1 -0
  66. package/dist/packages/helpers/src/mocks/animate.d.ts +1 -0
  67. package/dist/packages/helpers/src/mocks/element.d.ts +60 -0
  68. package/dist/packages/helpers/src/mocks/index.d.ts +2 -0
  69. package/dist/packages/helpers/src/mocks/match-media.d.ts +30 -0
  70. package/dist/packages/helpers/src/mocks/resize-observer.d.ts +9 -0
  71. package/dist/packages/helpers/src/simulators/index.d.ts +1 -0
  72. package/dist/packages/helpers/src/simulators/touch.d.ts +40 -0
  73. package/dist/packages/icons/src/convert.d.ts +22 -0
  74. package/dist/packages/icons/src/index.d.ts +2 -0
  75. package/dist/packages/input/src/index.d.ts +18 -0
  76. package/dist/packages/states/src/constants.d.ts +27 -0
  77. package/dist/packages/states/src/derive.svelte.d.ts +22 -0
  78. package/dist/packages/states/src/hierarchy.d.ts +34 -0
  79. package/dist/packages/states/src/index.d.ts +5 -0
  80. package/dist/packages/states/src/list-controller.svelte.d.ts +70 -0
  81. package/dist/packages/states/src/nested-controller.svelte.d.ts +32 -0
  82. package/dist/packages/states/src/proxy.svelte.d.ts +43 -0
  83. package/dist/packages/states/src/tabular.svelte.d.ts +5 -0
  84. package/dist/packages/states/src/traversal.svelte.d.ts +69 -0
  85. package/dist/packages/states/src/vibe.svelte.d.ts +622 -0
  86. package/dist/packages/themes/src/constants.d.ts +6 -0
  87. package/dist/packages/themes/src/index.d.ts +2 -0
  88. package/dist/packages/tutorial/src/assimilate.d.ts +25 -0
  89. package/dist/packages/tutorial/src/collector.d.ts +46 -0
  90. package/dist/packages/tutorial/src/files.d.ts +8 -0
  91. package/dist/packages/tutorial/src/index.d.ts +2 -0
  92. package/dist/packages/tutorial/src/metadata/base.d.ts +19 -0
  93. package/dist/packages/tutorial/src/metadata/factory.d.ts +19 -0
  94. package/dist/packages/tutorial/src/metadata/index.d.ts +2 -0
  95. package/dist/packages/tutorial/src/metadata/javascript.d.ts +7 -0
  96. package/dist/packages/tutorial/src/metadata/json.d.ts +7 -0
  97. package/dist/packages/tutorial/src/metadata/markdown.d.ts +7 -0
  98. package/dist/packages/tutorial/src/metadata/registry.d.ts +26 -0
  99. package/dist/packages/tutorial/src/metamodel.d.ts +45 -0
  100. package/dist/packages/tutorial/src/tutorial.d.ts +21 -0
  101. package/dist/packages/tutorial/src/types.d.ts +172 -0
  102. package/dist/packages/tutorial/src/utils.d.ts +13 -0
  103. package/dist/packages/ui/src/constants.d.ts +2 -0
  104. package/dist/packages/ui/src/index.d.ts +42 -0
  105. package/dist/packages/ui/src/input/types.d.ts +9 -0
  106. package/dist/packages/ui/src/lib/fields.d.ts +16 -0
  107. package/dist/packages/ui/src/lib/form.d.ts +95 -0
  108. package/dist/packages/ui/src/lib/index.d.ts +6 -0
  109. package/dist/packages/ui/src/lib/layout.d.ts +7 -0
  110. package/dist/packages/ui/src/lib/nested.d.ts +48 -0
  111. package/dist/packages/ui/src/lib/schema.d.ts +7 -0
  112. package/dist/packages/ui/src/lib/select.d.ts +8 -0
  113. package/dist/packages/ui/src/lib/tree.d.ts +9 -0
  114. package/dist/packages/ui/src/types.d.ts +5 -0
  115. package/dist/packages/ui/src/wrappers/index.d.ts +3 -0
  116. package/dist/sites/learn/src/hooks.d.ts +1 -0
  117. package/dist/sites/learn/src/hooks.server.d.ts +2 -0
  118. package/dist/sites/learn/src/lib/index.d.ts +7 -0
  119. package/dist/sites/learn/src/lib/media.d.ts +13 -0
  120. package/dist/sites/learn/src/lib/paraglide/messages/en.d.ts +3 -0
  121. package/dist/sites/learn/src/lib/paraglide/messages/fr.d.ts +3 -0
  122. package/dist/sites/learn/src/lib/paraglide/messages/hi.d.ts +3 -0
  123. package/dist/sites/learn/src/lib/paraglide/messages.d.ts +5 -0
  124. package/dist/sites/learn/src/lib/paraglide/runtime.d.ts +52 -0
  125. package/dist/sites/learn/src/lib/stories/02-elements/01-list/03-mapping/src/data.d.ts +5 -0
  126. package/dist/sites/learn/src/lib/stories/02-elements/01-list/04-mixed/src/data.d.ts +13 -0
  127. package/dist/sites/learn/src/lib/stories/02-elements/02-tabs/04-fields/src/data.d.ts +5 -0
  128. package/dist/sites/learn/src/lib/stories/02-elements/02-tabs/05-using/src/data.d.ts +6 -0
  129. package/dist/sites/learn/src/lib/stories/02-elements/03-accordion/01-intro/src/data.d.ts +4 -0
  130. package/dist/sites/learn/src/lib/stories/02-elements/03-accordion/02-fields/src/data.d.ts +9 -0
  131. package/dist/sites/learn/src/lib/stories/02-elements/03-accordion/03-using/src/data.d.ts +19 -0
  132. package/dist/sites/learn/src/lib/stories/02-elements/03-accordion/04-mixed/src/data.d.ts +30 -0
  133. package/dist/sites/learn/src/lib/stories/02-elements/03-accordion/props.d.ts +15 -0
  134. package/dist/sites/learn/src/lib/stories/02-elements/04-tree/01-intro/src/data.d.ts +12 -0
  135. package/dist/sites/learn/src/lib/stories/02-elements/06-select/02-fields/src/data.d.ts +5 -0
  136. package/dist/sites/learn/src/lib/stories/02-elements/07-multi-select/02-fields/src/data.d.ts +5 -0
  137. package/dist/sites/learn/src/lib/stories/02-elements/08-drop-down/02-fields/src/data.d.ts +5 -0
  138. package/dist/sites/learn/src/lib/stories/05-templates/01-form/02-schema/src/schema.d.ts +22 -0
  139. package/dist/sites/learn/src/lib/stories/05-templates/01-form/03-layout/src/layout.d.ts +19 -0
  140. package/dist/sites/learn/src/lib/stories/05-templates/01-form/03-layout/src/schema.d.ts +36 -0
  141. package/dist/sites/learn/src/lib/stories/05-templates/01-form/05-validation/src/schema.d.ts +34 -0
  142. package/dist/sites/learn/src/lib/stories/05-templates/02-editor/01-introduction/src/data.d.ts +39 -0
  143. package/dist/sites/learn/src/lib/stories/05-templates/02-editor/01-introduction/src/schema.d.ts +187 -0
  144. package/dist/sites/learn/src/lib/stories/06-layout/03-stepper/01-intro/src/data.d.ts +37 -0
  145. package/dist/sites/learn/src/lib/stories/06-layout/03-stepper/02-play/src/data.d.ts +37 -0
  146. package/dist/sites/learn/src/lib/stories/index.d.ts +1 -0
  147. package/dist/sites/learn/src/lib/theme.svelte.d.ts +70 -0
  148. package/dist/sites/learn/src/routes/(learn)/+layout.d.ts +12 -0
  149. package/dist/sites/learn/src/routes/(learn)/[segment]/[...slug]/+page.d.ts +8 -0
  150. package/dist/sites/learn/src/routes/+layout.d.ts +18 -0
  151. package/dist/sites/quick-start/src/hooks.d.ts +1 -0
  152. package/dist/sites/quick-start/src/hooks.server.d.ts +2 -0
  153. package/dist/sites/quick-start/src/lib/index.d.ts +1 -0
  154. package/dist/sites/quick-start/src/lib/paraglide/messages/en.d.ts +3 -0
  155. package/dist/sites/quick-start/src/lib/paraglide/messages/fr.d.ts +3 -0
  156. package/dist/sites/quick-start/src/lib/paraglide/messages/hi.d.ts +3 -0
  157. package/dist/sites/quick-start/src/lib/paraglide/messages.d.ts +5 -0
  158. package/dist/sites/quick-start/src/lib/paraglide/runtime.d.ts +52 -0
  159. package/dist/sites/quick-start/src/routes/+layout.d.ts +9 -0
  160. package/package.json +2 -2
  161. package/src/constants.js +5 -4
  162. package/src/utils.js +2 -2
@@ -0,0 +1,333 @@
1
+ export const shades: number[];
2
+ export const defaultPalette: string[];
3
+ export const syntaxColors: {
4
+ "one-dark": {
5
+ dark: {
6
+ "--tab-size": string;
7
+ "--code-fill": string;
8
+ "--code-normal": string;
9
+ "--code-string": string;
10
+ "--code-number": string;
11
+ "--code-atrule": string;
12
+ "--code-keyword": string;
13
+ "--code-comment": string;
14
+ "--code-property": string;
15
+ "--code-selector": string;
16
+ "--code-operator": string;
17
+ "--code-function": string;
18
+ "--code-gutter-marker": string;
19
+ "--code-gutter-subtle": string;
20
+ "--code-cursor": string;
21
+ "--code-cursor-block": string;
22
+ "--code-linenumbers": string;
23
+ };
24
+ light: {
25
+ "--tab-size": string;
26
+ "--code-fill": string;
27
+ "--code-normal": string;
28
+ "--code-string": string;
29
+ "--code-number": string;
30
+ "--code-atrule": string;
31
+ "--code-keyword": string;
32
+ "--code-comment": string;
33
+ "--code-property": string;
34
+ "--code-selector": string;
35
+ "--code-operator": string;
36
+ "--code-function": string;
37
+ "--code-gutter-marker": string;
38
+ "--code-gutter-subtle": string;
39
+ "--code-cursor": string;
40
+ "--code-cursor-block": string;
41
+ "--code-linenumbers": string;
42
+ };
43
+ };
44
+ };
45
+ export const defaultColors: {
46
+ amber: {
47
+ "50": string;
48
+ "100": string;
49
+ "200": string;
50
+ "300": string;
51
+ "400": string;
52
+ "500": string;
53
+ "600": string;
54
+ "700": string;
55
+ "800": string;
56
+ "900": string;
57
+ "950": string;
58
+ };
59
+ blue: {
60
+ "50": string;
61
+ "100": string;
62
+ "200": string;
63
+ "300": string;
64
+ "400": string;
65
+ "500": string;
66
+ "600": string;
67
+ "700": string;
68
+ "800": string;
69
+ "900": string;
70
+ "950": string;
71
+ };
72
+ cyan: {
73
+ "50": string;
74
+ "100": string;
75
+ "200": string;
76
+ "300": string;
77
+ "400": string;
78
+ "500": string;
79
+ "600": string;
80
+ "700": string;
81
+ "800": string;
82
+ "900": string;
83
+ "950": string;
84
+ };
85
+ emerald: {
86
+ "50": string;
87
+ "100": string;
88
+ "200": string;
89
+ "300": string;
90
+ "400": string;
91
+ "500": string;
92
+ "600": string;
93
+ "700": string;
94
+ "800": string;
95
+ "900": string;
96
+ "950": string;
97
+ };
98
+ fuscia: {
99
+ "50": string;
100
+ "100": string;
101
+ "200": string;
102
+ "300": string;
103
+ "400": string;
104
+ "500": string;
105
+ "600": string;
106
+ "700": string;
107
+ "800": string;
108
+ "900": string;
109
+ "950": string;
110
+ };
111
+ gray: {
112
+ "50": string;
113
+ "100": string;
114
+ "200": string;
115
+ "300": string;
116
+ "400": string;
117
+ "500": string;
118
+ "600": string;
119
+ "700": string;
120
+ "800": string;
121
+ "900": string;
122
+ "950": string;
123
+ };
124
+ green: {
125
+ "50": string;
126
+ "100": string;
127
+ "200": string;
128
+ "300": string;
129
+ "400": string;
130
+ "500": string;
131
+ "600": string;
132
+ "700": string;
133
+ "800": string;
134
+ "900": string;
135
+ "950": string;
136
+ };
137
+ indigo: {
138
+ "50": string;
139
+ "100": string;
140
+ "200": string;
141
+ "300": string;
142
+ "400": string;
143
+ "500": string;
144
+ "600": string;
145
+ "700": string;
146
+ "800": string;
147
+ "900": string;
148
+ "950": string;
149
+ };
150
+ lime: {
151
+ "50": string;
152
+ "100": string;
153
+ "200": string;
154
+ "300": string;
155
+ "400": string;
156
+ "500": string;
157
+ "600": string;
158
+ "700": string;
159
+ "800": string;
160
+ "900": string;
161
+ "950": string;
162
+ };
163
+ orange: {
164
+ "50": string;
165
+ "100": string;
166
+ "200": string;
167
+ "300": string;
168
+ "400": string;
169
+ "500": string;
170
+ "600": string;
171
+ "700": string;
172
+ "800": string;
173
+ "900": string;
174
+ "950": string;
175
+ };
176
+ pink: {
177
+ "50": string;
178
+ "100": string;
179
+ "200": string;
180
+ "300": string;
181
+ "400": string;
182
+ "500": string;
183
+ "600": string;
184
+ "700": string;
185
+ "800": string;
186
+ "900": string;
187
+ "950": string;
188
+ };
189
+ purple: {
190
+ "50": string;
191
+ "100": string;
192
+ "200": string;
193
+ "300": string;
194
+ "400": string;
195
+ "500": string;
196
+ "600": string;
197
+ "700": string;
198
+ "800": string;
199
+ "900": string;
200
+ "950": string;
201
+ };
202
+ red: {
203
+ "50": string;
204
+ "100": string;
205
+ "200": string;
206
+ "300": string;
207
+ "400": string;
208
+ "500": string;
209
+ "600": string;
210
+ "700": string;
211
+ "800": string;
212
+ "900": string;
213
+ "950": string;
214
+ };
215
+ rose: {
216
+ "50": string;
217
+ "100": string;
218
+ "200": string;
219
+ "300": string;
220
+ "400": string;
221
+ "500": string;
222
+ "600": string;
223
+ "700": string;
224
+ "800": string;
225
+ "900": string;
226
+ "950": string;
227
+ };
228
+ sky: {
229
+ "50": string;
230
+ "100": string;
231
+ "200": string;
232
+ "300": string;
233
+ "400": string;
234
+ "500": string;
235
+ "600": string;
236
+ "700": string;
237
+ "800": string;
238
+ "900": string;
239
+ "950": string;
240
+ };
241
+ slate: {
242
+ "50": string;
243
+ "100": string;
244
+ "200": string;
245
+ "300": string;
246
+ "400": string;
247
+ "500": string;
248
+ "600": string;
249
+ "700": string;
250
+ "800": string;
251
+ "900": string;
252
+ "950": string;
253
+ };
254
+ stone: {
255
+ "50": string;
256
+ "100": string;
257
+ "200": string;
258
+ "300": string;
259
+ "400": string;
260
+ "500": string;
261
+ "600": string;
262
+ "700": string;
263
+ "800": string;
264
+ "900": string;
265
+ "950": string;
266
+ };
267
+ teal: {
268
+ "50": string;
269
+ "100": string;
270
+ "200": string;
271
+ "300": string;
272
+ "400": string;
273
+ "500": string;
274
+ "600": string;
275
+ "700": string;
276
+ "800": string;
277
+ "900": string;
278
+ "950": string;
279
+ };
280
+ violet: {
281
+ "50": string;
282
+ "100": string;
283
+ "200": string;
284
+ "300": string;
285
+ "400": string;
286
+ "500": string;
287
+ "600": string;
288
+ "700": string;
289
+ "800": string;
290
+ "900": string;
291
+ "950": string;
292
+ };
293
+ yellow: {
294
+ "50": string;
295
+ "100": string;
296
+ "200": string;
297
+ "300": string;
298
+ "400": string;
299
+ "500": string;
300
+ "600": string;
301
+ "700": string;
302
+ "800": string;
303
+ "900": string;
304
+ "950": string;
305
+ };
306
+ zinc: {
307
+ "50": string;
308
+ "100": string;
309
+ "200": string;
310
+ "300": string;
311
+ "400": string;
312
+ "500": string;
313
+ "600": string;
314
+ "700": string;
315
+ "800": string;
316
+ "900": string;
317
+ "950": string;
318
+ };
319
+ shark: {
320
+ DEFAULT: string;
321
+ "50": string;
322
+ "100": string;
323
+ "200": string;
324
+ "300": string;
325
+ "400": string;
326
+ "500": string;
327
+ "600": string;
328
+ "700": string;
329
+ "800": string;
330
+ "900": string;
331
+ "950": string;
332
+ };
333
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Constructs an array of line types for tree visualization
3
+ * @param {boolean} hasChildren - Whether the node has children
4
+ * @param {import('./types').LineType[]} parentTypes - Types from parent nodes
5
+ * @param {import('./types').LineType} position - Current position type
6
+ * @returns {import('./types').LineType[]} Array of line types
7
+ */
8
+ export function getLineTypes(hasChildren?: boolean, parentTypes?: import("./types").LineType[], position?: import("./types").LineType): import("./types").LineType[];
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Generate a state icon mapping from a list of icon names
3
+ *
4
+ * @param {string[]} icons
5
+ * @returns {import('./types').StateIcons}
6
+ */
7
+ export function stateIconsFromNames(icons: string[]): import("./types").StateIcons;
8
+ /**
9
+ * @type {import('./types).FieldMapping} Fields
10
+ */
11
+ export const defaultFields: any;
12
+ export const defaultIcons: string[];
13
+ export namespace defaultOptions {
14
+ let id: string;
15
+ let label: string;
16
+ let value: string;
17
+ let checked: string;
18
+ }
19
+ export namespace defaultKeyMap {
20
+ let ArrowRight: string;
21
+ let ArrowLeft: string;
22
+ let ArrowDown: string;
23
+ let ArrowUp: string;
24
+ let Enter: string;
25
+ let Escape: string;
26
+ }
27
+ export namespace defaultThemeMapping {
28
+ let neutral: string;
29
+ let primary: string;
30
+ let secondary: string;
31
+ let accent: string;
32
+ let success: string;
33
+ let warning: string;
34
+ let danger: string;
35
+ let error: string;
36
+ let info: string;
37
+ }
38
+ export const defaultStateIcons: any;
39
+ export { defaultColors, syntaxColors, shades, defaultPalette } from "./colors/index.js";
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Creates an emitter object from the given properties.
3
+ *
4
+ * - Filters attributes that start with 'on' and are functions,
5
+ * - Returns an object with keys that are the event names (without the 'on' prefix)
6
+ * - If a default event is not present in the props, it will be set to a no-op function.
7
+ *
8
+ * @param {Object} props - The properties object to filter.
9
+ * @param {Array<string>} defaults - An array of default events.
10
+ * @returns {import('./types.js').EventHandlers} The emitter object.
11
+ */
12
+ export function createEmitter(props: Object, defaults?: Array<string>): import("./types.js").EventHandlers;
@@ -0,0 +1,63 @@
1
+ export class FieldMapper {
2
+ constructor(fields?: any);
3
+ hasIcon: ((obj: unknown) => obj is {
4
+ [x: string]: unknown;
5
+ }) | undefined;
6
+ hasImage: ((obj: unknown) => obj is {
7
+ [x: string]: unknown;
8
+ }) | undefined;
9
+ hasText: ((obj: unknown) => obj is {
10
+ [x: string]: unknown;
11
+ }) | undefined;
12
+ hasValue: ((obj: unknown) => obj is {
13
+ [x: string]: unknown;
14
+ }) | undefined;
15
+ hasLabel: ((obj: unknown) => obj is {
16
+ [x: string]: unknown;
17
+ }) | undefined;
18
+ hasComponent: ((obj: unknown) => obj is {
19
+ [x: string]: unknown;
20
+ }) | undefined;
21
+ hasCurrency: ((obj: unknown) => obj is {
22
+ [x: string]: unknown;
23
+ }) | undefined;
24
+ withPrefix: ((x: any) => string) | undefined;
25
+ excludeFlags: (<U extends Partial<Record<any, any>>>(obj: any extends keyof U ? U : never) => any extends keyof U ? Omit<U, any> : never) | undefined;
26
+ getChildMapper(): null;
27
+ /**
28
+ * @private
29
+ */
30
+ private prop;
31
+ /**
32
+ * Gets a mapped attribute from the original item
33
+ *
34
+ * @param {string} fieldName - Name of the field to get
35
+ * @returns {any|null} - The attribute value or null if not found
36
+ */
37
+ get(fieldName: string, value: any, defaultValue?: null): any | null;
38
+ set fields(fields: any);
39
+ get fields(): any;
40
+ getIcon(value: any): string | null;
41
+ getValue(value: any): any;
42
+ getFormattedText(value: any, formatter: any): any;
43
+ hasChildren(item: any): item is never;
44
+ isNested(items: any): boolean;
45
+ getChildren(item: any): never[];
46
+ /**
47
+ * Finds children by an index path
48
+ *
49
+ * @param {Array<Object>} items
50
+ * @param {Array<number>} path
51
+ * @returns {Array<Object>}
52
+ */
53
+ getChildrenByPath(items: Array<Object>, path?: Array<number>): Array<Object>;
54
+ /**
55
+ * Finds an item by an index path
56
+ *
57
+ * @param {Array<Object>} items
58
+ * @param {Array<number>} path
59
+ * @returns {Object|null}
60
+ */
61
+ getItemByPath(items: Array<Object>, path?: Array<number>): Object | null;
62
+ #private;
63
+ }
@@ -0,0 +1,13 @@
1
+ export * from "./types.js";
2
+ export * from "./constants.js";
3
+ export * from "./utils.js";
4
+ export * from "./nested.js";
5
+ export * from "./string.js";
6
+ export * from "./theme.js";
7
+ export { FieldMapper } from "./field-mapper.js";
8
+ export { createEmitter } from "./events.js";
9
+ export { getLineTypes } from "./connector.js";
10
+ export { generateTicks } from "./ticks.js";
11
+ export { getItemAtIndex, getIndexForItem } from "./mapped-items.js";
12
+ export { weekdays, getCalendarDays } from "./calendar.js";
13
+ export { getValue, getNestedFields, hasChildren, isExpanded } from "./mapping.js";
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Class to manage key event mappings.
3
+ */
4
+ export class KeyEventMap {
5
+ mapping: {};
6
+ /**
7
+ * Add a new key mapping.
8
+ * @param {string} eventName - The event name.
9
+ * @param {Array<string>|RegExp} keys - The keys to match.
10
+ */
11
+ add(eventName: string, keys: Array<string> | RegExp): void;
12
+ /**
13
+ * Get the event name for a given key.
14
+ * @param {string} key - The key to match.
15
+ * @returns {string|null} - The event name or null if no match is found.
16
+ */
17
+ getEventForKey(key: string): string | null;
18
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Get an item at a specific index
3
+ * @param {Array<any>} items
4
+ * @param {any} index
5
+ * @returns
6
+ */
7
+ export function getItemAtIndex(items: Array<any>, index: any): any;
8
+ /**
9
+ * Get the index for an item in an array
10
+ * @param {Array<any} items
11
+ * @param {any} item
12
+ * @returns
13
+ */
14
+ export function getIndexForItem(items: Array<any>, item: any): number;
@@ -0,0 +1,75 @@
1
+ /**
2
+ * Get the component to be used to render the item.
3
+ * If the component is null or undefined, it will return the default component.
4
+ *
5
+ * @param {object|string} value
6
+ * @param {import('./types.js').FieldMapping} fields
7
+ * @param {import('./types.js').ComponentMap} using
8
+ */
9
+ export function getComponent(value: object | string, fields: import("./types.js").FieldMapping, using: import("./types.js").ComponentMap): import("svelte").SvelteComponent<Record<string, any>, any, any>;
10
+ /**
11
+ * Get the icon for the item. If the icon is an object, it will use the state to determine which icon to use.
12
+ *
13
+ * @param {object|string} value
14
+ * @param {import('./types.js').FieldMapping} fields
15
+ * @returns {string}
16
+ */
17
+ export function getIcon(value: object | string, fields?: import("./types.js").FieldMapping): string;
18
+ /**
19
+ * Get the value for the item. If the value is an object,
20
+ * it will use the field mapping to determine which attribute to get.
21
+ *
22
+ * @param {*} node
23
+ * @param {import('./types').FieldMapping} fields
24
+ * @returns {*}
25
+ */
26
+ export function getValue(node: any, fields?: import("./types").FieldMapping): any;
27
+ /**
28
+ * Get the text for the item. If the text is an object,
29
+ * it will use the field mapping to determine which attribute to get.
30
+ *
31
+ * @param {*} node
32
+ * @param {import('./types').FieldMapping} fields
33
+ * @returns {string}
34
+ */
35
+ export function getText(node: any, fields?: import("./types").FieldMapping): string;
36
+ /**
37
+ * Gets the attribute from the node
38
+ * @param {*} node
39
+ * @param {string} attr
40
+ * @returns {*}
41
+ */
42
+ export function getAttribute(node: any, attr: string): any;
43
+ /**
44
+ * Get the formatted text for the item. If the text is an object, use the field mapping to determine
45
+ * which attribute to get currency. Use the formatter or identity function to format the text.
46
+ *
47
+ * @param {*} node
48
+ * @param {import('./types').FieldMapping} fields
49
+ * @param {Function} formatter
50
+ * @returns {Function}
51
+ */
52
+ export function getFormattedText(node: any, fields?: import("./types").FieldMapping, formatter?: Function): Function;
53
+ /**
54
+ * Check if the current item is a parent
55
+ *
56
+ * @param {*} item
57
+ * @param {import('./types').FieldMapping} fields
58
+ * @returns {boolean}
59
+ */
60
+ export function hasChildren(item: any, fields: import("./types").FieldMapping): boolean;
61
+ /**
62
+ * Check if the current item is a parent and is expanded
63
+ *
64
+ * @param {*} item
65
+ * @param {import('./types').FieldMapping} fields
66
+ * @returns {boolean}
67
+ */
68
+ export function isExpanded(item: any, fields: import("./types").FieldMapping): boolean;
69
+ /**
70
+ * Fetches the fieldmapping for a child node
71
+ *
72
+ * @param {import('./types').FieldMapping} fields
73
+ * @returns {import('./types').FieldMapping}
74
+ */
75
+ export function getNestedFields(fields: import("./types").FieldMapping): import("./types").FieldMapping;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Flattens a nested list of items
3
+ *
4
+ * @param {Array} items
5
+ * @param {import('./types).FieldMapping} fields
6
+ * @param {number} level
7
+ * @returns {Array}
8
+ */
9
+ export function flattenNestedList(items: any[], fields?: any, level?: number): any[];
10
+ /**
11
+ * Matches a path slug to a value in the menu
12
+ *
13
+ * @param {string} slug
14
+ * @param {Array} data
15
+ * @param {import('./types').FieldMapping} fields
16
+ * @returns {any}
17
+ */
18
+ export function findValueFromPath(slug: string, data: any[], fields: import("./types").FieldMapping): any;
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Capitalizes the first letter of input string
3
+ *
4
+ * @param {String} str
5
+ * @returns {String}
6
+ */
7
+ export function toInitCapCase(text: any): string;
8
+ /**
9
+ * Convert a hyphen separated string to PascalCase
10
+ *
11
+ * @param {String} text
12
+ * @returns
13
+ */
14
+ export function toPascalCase(text: string): string;
15
+ /**
16
+ * Convert a PascalCase string to snake case with separator as hyphen
17
+ *
18
+ * @param {string} text
19
+ * @returns {string}
20
+ */
21
+ export function toHyphenCase(text: string): string;
22
+ /**
23
+ * Simple comparison for two strings
24
+ *
25
+ * @param {String} a
26
+ * @param {String} b
27
+ * @returns
28
+ */
29
+ export function compareStrings(a: string, b: string): 1 | 0 | -1;
30
+ /**
31
+ * Sort by splitting hyphen separated strings while keeping strings with same number of parts together
32
+ *
33
+ * @param {String} a hyphen separates string
34
+ * @param {String} b hyphen separates string
35
+ * @param {string} separator - separator to split the string
36
+ * @returns {Number} -1, 0, 1 based on comparison
37
+ */
38
+ export function sortByParts(a: string, b: string, separator?: string): number;
39
+ /**
40
+ * Generates a unique id from current timestamp
41
+ *
42
+ * @returns {String} timestamp based unique id
43
+ */
44
+ export function uniqueId(prefix?: string, separator?: string): string;
45
+ /**
46
+ * Removes undefined and null values from the input object.
47
+ *
48
+ * @param {Object} obj
49
+ * @returns {Object}
50
+ */
51
+ export function compact(obj: Object): Object;
52
+ /**
53
+ * Converts an input number into it's hexadecimal representation, with optional left padded zeroes based on the `size`
54
+ *
55
+ * @param {number} value
56
+ * @param {number} size
57
+ * @returns
58
+ */
59
+ export function toHexString(value: number, size?: number): string;