@odigos/ui-kit 0.0.17 → 0.0.19

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 (37) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/lib/components/index.d.ts +1 -0
  3. package/lib/components/scroll-x/index.d.ts +10 -0
  4. package/lib/components.js +13 -44
  5. package/lib/constants.js +5 -9
  6. package/lib/containers/data-flow/nodes/scroll-node.d.ts +3 -14
  7. package/lib/containers.js +42 -94
  8. package/lib/functions.js +9 -15
  9. package/lib/hooks.js +10 -10
  10. package/lib/icons.js +3 -4
  11. package/lib/{index-Hz7AAE0t.js → index-7-KCQK-x.js} +1 -1
  12. package/lib/{index-G4WmxXds.js → index-BFRz3l_w.js} +21 -4
  13. package/lib/index-BazfJyRh.js +687 -0
  14. package/lib/{index-C3nz3TIx.js → index-CD_BQJCD.js} +5 -3
  15. package/lib/{index-BiNX-Cge.js → index-CvuVOtkr.js} +154 -119
  16. package/lib/{index-CIXQeSHu.js → index-DGel4E-Z.js} +8 -1
  17. package/lib/{index-BQW5EUgp.js → index-DSzybApb.js} +6 -4
  18. package/lib/{index-BxQTUOME.js → index-WSle42rz.js} +5 -3
  19. package/lib/store.js +3 -6
  20. package/lib/theme.js +3 -86
  21. package/lib/types.js +215 -6
  22. package/lib/useSourceSelectionFormData-_2PggiXn.js +563 -0
  23. package/lib/{useTimeAgo-weEj7br6.js → useTransition-bXMKBfST.js} +113 -544
  24. package/package.json +1 -2
  25. package/lib/index-B72aw6tI.js +0 -23
  26. package/lib/index-BQs4sULy.js +0 -32
  27. package/lib/index-BVVVevuY.js +0 -100
  28. package/lib/index-BWqrekK4.js +0 -11
  29. package/lib/index-C1PCuZgw.js +0 -18
  30. package/lib/index-CIgHU72d.js +0 -52
  31. package/lib/index-DbfrGXPH.js +0 -8
  32. package/lib/index-RBS1MqCQ.js +0 -37
  33. package/lib/react-CjImwkhV.js +0 -44
  34. package/lib/useDarkMode-DxhIuVNi.js +0 -201
  35. package/lib/useSelectedStore-93bIo1kE.js +0 -97
  36. package/lib/useSetupStore-CoYx1UQw.js +0 -211
  37. package/lib/useTransition-D0wUpPGk.js +0 -128
@@ -0,0 +1,687 @@
1
+ import { EntityTypes } from './types.js';
2
+ import React from 'react';
3
+ import { keyframes } from 'styled-components';
4
+
5
+ const createStoreImpl = (createState) => {
6
+ let state;
7
+ const listeners = /* @__PURE__ */ new Set();
8
+ const setState = (partial, replace) => {
9
+ const nextState = typeof partial === "function" ? partial(state) : partial;
10
+ if (!Object.is(nextState, state)) {
11
+ const previousState = state;
12
+ state = (replace != null ? replace : typeof nextState !== "object" || nextState === null) ? nextState : Object.assign({}, state, nextState);
13
+ listeners.forEach((listener) => listener(state, previousState));
14
+ }
15
+ };
16
+ const getState = () => state;
17
+ const getInitialState = () => initialState;
18
+ const subscribe = (listener) => {
19
+ listeners.add(listener);
20
+ return () => listeners.delete(listener);
21
+ };
22
+ const api = { setState, getState, getInitialState, subscribe };
23
+ const initialState = state = createState(setState, getState, api);
24
+ return api;
25
+ };
26
+ const createStore = (createState) => createState ? createStoreImpl(createState) : createStoreImpl;
27
+
28
+ const identity = (arg) => arg;
29
+ function useStore(api, selector = identity) {
30
+ const slice = React.useSyncExternalStore(
31
+ api.subscribe,
32
+ () => selector(api.getState()),
33
+ () => selector(api.getInitialState())
34
+ );
35
+ React.useDebugValue(slice);
36
+ return slice;
37
+ }
38
+ const createImpl = (createState) => {
39
+ const api = createStore(createState);
40
+ const useBoundStore = (selector) => useStore(api, selector);
41
+ Object.assign(useBoundStore, api);
42
+ return useBoundStore;
43
+ };
44
+ const create = (createState) => createState ? createImpl(createState) : createImpl;
45
+
46
+ function createJSONStorage(getStorage, options) {
47
+ let storage;
48
+ try {
49
+ storage = getStorage();
50
+ } catch (e) {
51
+ return;
52
+ }
53
+ const persistStorage = {
54
+ getItem: (name) => {
55
+ var _a;
56
+ const parse = (str2) => {
57
+ if (str2 === null) {
58
+ return null;
59
+ }
60
+ return JSON.parse(str2, undefined );
61
+ };
62
+ const str = (_a = storage.getItem(name)) != null ? _a : null;
63
+ if (str instanceof Promise) {
64
+ return str.then(parse);
65
+ }
66
+ return parse(str);
67
+ },
68
+ setItem: (name, newValue) => storage.setItem(
69
+ name,
70
+ JSON.stringify(newValue, undefined )
71
+ ),
72
+ removeItem: (name) => storage.removeItem(name)
73
+ };
74
+ return persistStorage;
75
+ }
76
+ const toThenable = (fn) => (input) => {
77
+ try {
78
+ const result = fn(input);
79
+ if (result instanceof Promise) {
80
+ return result;
81
+ }
82
+ return {
83
+ then(onFulfilled) {
84
+ return toThenable(onFulfilled)(result);
85
+ },
86
+ catch(_onRejected) {
87
+ return this;
88
+ }
89
+ };
90
+ } catch (e) {
91
+ return {
92
+ then(_onFulfilled) {
93
+ return this;
94
+ },
95
+ catch(onRejected) {
96
+ return toThenable(onRejected)(e);
97
+ }
98
+ };
99
+ }
100
+ };
101
+ const persistImpl = (config, baseOptions) => (set, get, api) => {
102
+ let options = {
103
+ storage: createJSONStorage(() => localStorage),
104
+ partialize: (state) => state,
105
+ version: 0,
106
+ merge: (persistedState, currentState) => ({
107
+ ...currentState,
108
+ ...persistedState
109
+ }),
110
+ ...baseOptions
111
+ };
112
+ let hasHydrated = false;
113
+ const hydrationListeners = /* @__PURE__ */ new Set();
114
+ const finishHydrationListeners = /* @__PURE__ */ new Set();
115
+ let storage = options.storage;
116
+ if (!storage) {
117
+ return config(
118
+ (...args) => {
119
+ console.warn(
120
+ `[zustand persist middleware] Unable to update item '${options.name}', the given storage is currently unavailable.`
121
+ );
122
+ set(...args);
123
+ },
124
+ get,
125
+ api
126
+ );
127
+ }
128
+ const setItem = () => {
129
+ const state = options.partialize({ ...get() });
130
+ return storage.setItem(options.name, {
131
+ state,
132
+ version: options.version
133
+ });
134
+ };
135
+ const savedSetState = api.setState;
136
+ api.setState = (state, replace) => {
137
+ savedSetState(state, replace);
138
+ void setItem();
139
+ };
140
+ const configResult = config(
141
+ (...args) => {
142
+ set(...args);
143
+ void setItem();
144
+ },
145
+ get,
146
+ api
147
+ );
148
+ api.getInitialState = () => configResult;
149
+ let stateFromStorage;
150
+ const hydrate = () => {
151
+ var _a, _b;
152
+ if (!storage) return;
153
+ hasHydrated = false;
154
+ hydrationListeners.forEach((cb) => {
155
+ var _a2;
156
+ return cb((_a2 = get()) != null ? _a2 : configResult);
157
+ });
158
+ const postRehydrationCallback = ((_b = options.onRehydrateStorage) == null ? undefined : _b.call(options, (_a = get()) != null ? _a : configResult)) || undefined;
159
+ return toThenable(storage.getItem.bind(storage))(options.name).then((deserializedStorageValue) => {
160
+ if (deserializedStorageValue) {
161
+ if (typeof deserializedStorageValue.version === "number" && deserializedStorageValue.version !== options.version) {
162
+ if (options.migrate) {
163
+ const migration = options.migrate(
164
+ deserializedStorageValue.state,
165
+ deserializedStorageValue.version
166
+ );
167
+ if (migration instanceof Promise) {
168
+ return migration.then((result) => [true, result]);
169
+ }
170
+ return [true, migration];
171
+ }
172
+ console.error(
173
+ `State loaded from storage couldn't be migrated since no migrate function was provided`
174
+ );
175
+ } else {
176
+ return [false, deserializedStorageValue.state];
177
+ }
178
+ }
179
+ return [false, undefined];
180
+ }).then((migrationResult) => {
181
+ var _a2;
182
+ const [migrated, migratedState] = migrationResult;
183
+ stateFromStorage = options.merge(
184
+ migratedState,
185
+ (_a2 = get()) != null ? _a2 : configResult
186
+ );
187
+ set(stateFromStorage, true);
188
+ if (migrated) {
189
+ return setItem();
190
+ }
191
+ }).then(() => {
192
+ postRehydrationCallback == null ? undefined : postRehydrationCallback(stateFromStorage, undefined);
193
+ stateFromStorage = get();
194
+ hasHydrated = true;
195
+ finishHydrationListeners.forEach((cb) => cb(stateFromStorage));
196
+ }).catch((e) => {
197
+ postRehydrationCallback == null ? undefined : postRehydrationCallback(undefined, e);
198
+ });
199
+ };
200
+ api.persist = {
201
+ setOptions: (newOptions) => {
202
+ options = {
203
+ ...options,
204
+ ...newOptions
205
+ };
206
+ if (newOptions.storage) {
207
+ storage = newOptions.storage;
208
+ }
209
+ },
210
+ clearStorage: () => {
211
+ storage == null ? undefined : storage.removeItem(options.name);
212
+ },
213
+ getOptions: () => options,
214
+ rehydrate: () => hydrate(),
215
+ hasHydrated: () => hasHydrated,
216
+ onHydrate: (cb) => {
217
+ hydrationListeners.add(cb);
218
+ return () => {
219
+ hydrationListeners.delete(cb);
220
+ };
221
+ },
222
+ onFinishHydration: (cb) => {
223
+ finishHydrationListeners.add(cb);
224
+ return () => {
225
+ finishHydrationListeners.delete(cb);
226
+ };
227
+ }
228
+ };
229
+ if (!options.skipHydration) {
230
+ hydrate();
231
+ }
232
+ return stateFromStorage || configResult;
233
+ };
234
+ const persist = persistImpl;
235
+
236
+ const useDarkMode = create()(persist((set) => ({
237
+ darkMode: true,
238
+ setDarkMode: (bool) => set({ darkMode: bool }),
239
+ }), {
240
+ name: 'odigos-dark-mode',
241
+ storage: typeof window !== 'undefined' ? createJSONStorage(() => localStorage) : undefined,
242
+ }));
243
+
244
+ const useDrawerStore = create((set) => ({
245
+ drawerType: null,
246
+ drawerEntityId: null,
247
+ setDrawerType: (value) => set({ drawerType: value }),
248
+ setDrawerEntityId: (value) => set({ drawerEntityId: value }),
249
+ }));
250
+
251
+ const getEntityId = (item) => {
252
+ if ('ruleId' in item && !!item.ruleId) {
253
+ // Instrumentation Rule
254
+ return item.ruleId;
255
+ }
256
+ else if ('id' in item && !!item.id) {
257
+ // Destination or Action
258
+ return item.id;
259
+ }
260
+ else if ('namespace' in item && !!item.namespace && 'kind' in item && !!item.kind && 'name' in item && !!item.name) {
261
+ // Source
262
+ return {
263
+ namespace: item.namespace,
264
+ name: item.name,
265
+ kind: item.kind,
266
+ };
267
+ }
268
+ else if ('name' in item && !!item.name) {
269
+ // Namespace
270
+ return item.name;
271
+ }
272
+ console.warn('getEntityId() - cannot get ID of entity:', item);
273
+ return undefined;
274
+ };
275
+
276
+ const isTimeElapsed = (originDate, difference = 0) => {
277
+ const now = new Date().getTime();
278
+ const compareWith = new Date(originDate).getTime();
279
+ return now - compareWith >= difference;
280
+ };
281
+
282
+ const useEntityStore = create((set) => ({
283
+ namespacesLoading: false,
284
+ namespaces: [],
285
+ sourcesLoading: false,
286
+ sources: [],
287
+ destinationsLoading: false,
288
+ destinations: [],
289
+ actionsLoading: false,
290
+ actions: [],
291
+ instrumentationRulesLoading: false,
292
+ instrumentationRules: [],
293
+ setEntitiesLoading: (entityType, bool) => {
294
+ const KEY = entityType === EntityTypes.Namespace
295
+ ? 'namespacesLoading'
296
+ : entityType === EntityTypes.Source
297
+ ? 'sourcesLoading'
298
+ : entityType === EntityTypes.Destination
299
+ ? 'destinationsLoading'
300
+ : entityType === EntityTypes.Action
301
+ ? 'actionsLoading'
302
+ : entityType === EntityTypes.InstrumentationRule
303
+ ? 'instrumentationRulesLoading'
304
+ : 'NONE';
305
+ if (KEY === 'NONE')
306
+ return;
307
+ set({ [KEY]: bool });
308
+ },
309
+ setEntities: (entityType, payload) => {
310
+ const KEY = entityType === EntityTypes.Namespace
311
+ ? 'namespaces'
312
+ : entityType === EntityTypes.Source
313
+ ? 'sources'
314
+ : entityType === EntityTypes.Destination
315
+ ? 'destinations'
316
+ : entityType === EntityTypes.Action
317
+ ? 'actions'
318
+ : entityType === EntityTypes.InstrumentationRule
319
+ ? 'instrumentationRules'
320
+ : 'NONE';
321
+ if (KEY === 'NONE')
322
+ return;
323
+ set({ [KEY]: payload });
324
+ },
325
+ addEntities: (entityType, entities) => {
326
+ const KEY = entityType === EntityTypes.Namespace
327
+ ? 'namespaces'
328
+ : entityType === EntityTypes.Source
329
+ ? 'sources'
330
+ : entityType === EntityTypes.Destination
331
+ ? 'destinations'
332
+ : entityType === EntityTypes.Action
333
+ ? 'actions'
334
+ : entityType === EntityTypes.InstrumentationRule
335
+ ? 'instrumentationRules'
336
+ : 'NONE';
337
+ if (KEY === 'NONE')
338
+ return;
339
+ set((state) => {
340
+ const prev = [...state[KEY]];
341
+ entities.forEach((newItem) => {
342
+ const foundIdx = prev.findIndex((oldItem) => JSON.stringify(getEntityId(oldItem)) === JSON.stringify(getEntityId(newItem)));
343
+ if (foundIdx !== -1) {
344
+ prev[foundIdx] = { ...prev[foundIdx], ...newItem };
345
+ }
346
+ else {
347
+ prev.push(newItem);
348
+ }
349
+ });
350
+ return { [KEY]: prev };
351
+ });
352
+ },
353
+ removeEntities: (entityType, entityIds) => {
354
+ const KEY = entityType === EntityTypes.Namespace
355
+ ? 'namespaces'
356
+ : entityType === EntityTypes.Source
357
+ ? 'sources'
358
+ : entityType === EntityTypes.Destination
359
+ ? 'destinations'
360
+ : entityType === EntityTypes.Action
361
+ ? 'actions'
362
+ : entityType === EntityTypes.InstrumentationRule
363
+ ? 'instrumentationRules'
364
+ : 'NONE';
365
+ if (KEY === 'NONE')
366
+ return;
367
+ set((state) => {
368
+ const prev = [...state[KEY]];
369
+ entityIds.forEach((id) => {
370
+ const foundIdx = prev.findIndex((entity) => entityType === EntityTypes.Source ? JSON.stringify(getEntityId(entity)) === JSON.stringify(getEntityId(id)) : getEntityId(entity) === id);
371
+ if (foundIdx !== -1) {
372
+ prev.splice(foundIdx, 1);
373
+ }
374
+ });
375
+ return { [KEY]: prev };
376
+ });
377
+ },
378
+ resetEntityStore: () => {
379
+ set({
380
+ namespacesLoading: false,
381
+ namespaces: [],
382
+ sourcesLoading: false,
383
+ sources: [],
384
+ destinationsLoading: false,
385
+ destinations: [],
386
+ actionsLoading: false,
387
+ actions: [],
388
+ instrumentationRulesLoading: false,
389
+ instrumentationRules: [],
390
+ });
391
+ },
392
+ }));
393
+
394
+ const getEmptyState = () => ({
395
+ searchText: '',
396
+ statuses: [],
397
+ platformTypes: [],
398
+ namespaces: [],
399
+ kinds: [],
400
+ monitors: [],
401
+ languages: [],
402
+ errors: [],
403
+ onlyErrors: false,
404
+ });
405
+ const useFilterStore = create((set) => ({
406
+ searchText: '',
407
+ setSearchText: (searchText) => set({ searchText }),
408
+ statuses: [],
409
+ setStatuses: (statuses) => set({ statuses }),
410
+ platformTypes: [],
411
+ setPlatformTypes: (platformTypes) => set({ platformTypes }),
412
+ namespaces: [],
413
+ setNamespaces: (namespaces) => set({ namespaces }),
414
+ kinds: [],
415
+ setKinds: (kinds) => set({ kinds }),
416
+ monitors: [],
417
+ setMonitors: (monitors) => set({ monitors }),
418
+ languages: [],
419
+ setLanguages: (languages) => set({ languages }),
420
+ errors: [],
421
+ setErrors: (errors) => set({ errors }),
422
+ onlyErrors: false,
423
+ setOnlyErrors: (onlyErrors) => set({ onlyErrors }),
424
+ setAll: (params) => set(params),
425
+ clearAll: () => set(getEmptyState()),
426
+ getEmptyState,
427
+ }));
428
+
429
+ const useInstrumentStore = create((set) => ({
430
+ isAwaitingInstrumentation: false,
431
+ sourcesToCreate: 0,
432
+ sourcesCreated: 0,
433
+ sourcesToDelete: 0,
434
+ sourcesDeleted: 0,
435
+ setInstrumentAwait: (v) => set({ isAwaitingInstrumentation: v }),
436
+ setInstrumentCount: (k, v) => set({ [k]: v }),
437
+ }));
438
+
439
+ const useModalStore = create((set) => ({
440
+ currentModal: '',
441
+ setCurrentModal: (str) => set({ currentModal: str }),
442
+ }));
443
+
444
+ const useNotificationStore = create((set, get) => ({
445
+ notifications: [],
446
+ addNotification: (notif) => {
447
+ const date = new Date();
448
+ const id = `${date.getTime().toString()}${!!notif.target ? `#${notif.target}` : ''}`;
449
+ // This is to prevent duplicate notifications within a 10 second time-frame.
450
+ // This is useful for notifications that are triggered multiple times in a short period, like failed API queries...
451
+ const foundThisNotif = !!get().notifications.find((n) => n.type === notif.type && n.title === notif.title && n.message === notif.message && !isTimeElapsed(n.time, 3000)); // 3 seconds
452
+ if (!foundThisNotif) {
453
+ set((state) => ({
454
+ notifications: [
455
+ {
456
+ ...notif,
457
+ id,
458
+ time: date.toISOString(),
459
+ dismissed: false,
460
+ seen: false,
461
+ },
462
+ ...state.notifications,
463
+ ],
464
+ }));
465
+ }
466
+ },
467
+ markAsDismissed: (id) => {
468
+ set((state) => {
469
+ const foundIdx = state.notifications.findIndex((notif) => notif.id === id);
470
+ if (foundIdx !== -1) {
471
+ state.notifications[foundIdx].dismissed = true;
472
+ }
473
+ return {
474
+ notifications: state.notifications,
475
+ };
476
+ });
477
+ },
478
+ markAsSeen: (id) => {
479
+ set((state) => {
480
+ const foundIdx = state.notifications.findIndex((notif) => notif.id === id);
481
+ if (foundIdx !== -1) {
482
+ state.notifications[foundIdx].seen = true;
483
+ }
484
+ return {
485
+ notifications: state.notifications,
486
+ };
487
+ });
488
+ },
489
+ removeNotification: (id) => {
490
+ set((state) => {
491
+ const foundIdx = state.notifications.findIndex((notif) => notif.id === id);
492
+ if (foundIdx !== -1) {
493
+ state.notifications.splice(foundIdx, 1);
494
+ }
495
+ return {
496
+ notifications: state.notifications,
497
+ };
498
+ });
499
+ },
500
+ removeNotifications: (target) => {
501
+ if (!target)
502
+ return;
503
+ set((state) => {
504
+ const filtered = state.notifications.filter((notif) => notif.id.split('#')[1] !== target);
505
+ return {
506
+ notifications: filtered,
507
+ };
508
+ });
509
+ },
510
+ }));
511
+
512
+ const itemsAreEqual = (item1, item2) => {
513
+ const entityTypesEqual = item1.entityType === item2.entityType;
514
+ const idsEqual = typeof item1.entityId === 'string' && typeof item2.entityId === 'string'
515
+ ? item1.entityId === item2.entityId
516
+ : typeof item1.entityId === 'object' && typeof item2.entityId === 'object'
517
+ ? item1.entityId.namespace === item2.entityId.namespace && item1.entityId.name === item2.entityId.name && item1.entityId.kind === item2.entityId.kind
518
+ : !item1.entityId && !item2.entityId;
519
+ return entityTypesEqual && idsEqual;
520
+ };
521
+ const usePendingStore = create((set, get) => ({
522
+ pendingItems: [],
523
+ setPendingItems: (arr) => set({ pendingItems: arr }),
524
+ addPendingItems: (arr) => set((state) => ({
525
+ pendingItems: state.pendingItems.concat(arr.filter((addItem) => !state.pendingItems.some((existingItem) => itemsAreEqual(existingItem, addItem)))),
526
+ })),
527
+ removePendingItems: (arr) => set((state) => ({
528
+ pendingItems: state.pendingItems.filter((existingItem) => !arr.find((removeItem) => itemsAreEqual(existingItem, removeItem))),
529
+ })),
530
+ // Pass an item to check if it's in the pending items array.
531
+ // This is used to show loading spinners, toasts etc.
532
+ isThisPending: (item) => {
533
+ const { pendingItems } = get();
534
+ let bool = false;
535
+ for (let i = 0; i < pendingItems.length; i++) {
536
+ const pendingItem = pendingItems[i];
537
+ if (pendingItem.entityType === item.entityType &&
538
+ (!item.entityId ||
539
+ (pendingItem.entityType === EntityTypes.Source
540
+ ? !!pendingItem.entityId &&
541
+ !!item.entityId &&
542
+ pendingItem.entityId.namespace === item.entityId.namespace &&
543
+ pendingItem.entityId.name === item.entityId.name &&
544
+ pendingItem.entityId.kind === item.entityId.kind
545
+ : pendingItem.entityId === item.entityId))) {
546
+ bool = true;
547
+ break;
548
+ }
549
+ }
550
+ return bool;
551
+ },
552
+ }));
553
+
554
+ const useSelectedStore = create((set) => ({
555
+ selectedSources: {},
556
+ setSelectedSources: (payload) => set({ selectedSources: payload }),
557
+ resetSelectedState: () => set(() => ({ selectedSources: {} })),
558
+ }));
559
+
560
+ const useSetupStore = create((set) => ({
561
+ availableSources: {},
562
+ configuredSources: {},
563
+ configuredFutureApps: {},
564
+ configuredDestinations: [],
565
+ setAvailableSources: (payload) => set({ availableSources: payload }),
566
+ setConfiguredSources: (payload) => set({ configuredSources: payload }),
567
+ setConfiguredFutureApps: (payload) => set({ configuredFutureApps: payload }),
568
+ setConfiguredDestinations: (payload) => set({ configuredDestinations: payload }),
569
+ addConfiguredDestination: (payload) => set((state) => ({ configuredDestinations: [...state.configuredDestinations, payload] })),
570
+ removeConfiguredDestination: (payload) => set((state) => ({ configuredDestinations: state.configuredDestinations.filter(({ stored }) => stored.type !== payload.type) })),
571
+ resetState: () => set(() => ({ availableSources: {}, configuredSources: {}, configuredFutureApps: {}, configuredDestinations: [] })),
572
+ }));
573
+
574
+ function styleInject(css, ref) {
575
+ if ( ref === void 0 ) ref = {};
576
+ var insertAt = ref.insertAt;
577
+
578
+ if (!css || typeof document === 'undefined') { return; }
579
+
580
+ var head = document.head || document.getElementsByTagName('head')[0];
581
+ var style = document.createElement('style');
582
+ style.type = 'text/css';
583
+
584
+ if (insertAt === 'top') {
585
+ if (head.firstChild) {
586
+ head.insertBefore(style, head.firstChild);
587
+ } else {
588
+ head.appendChild(style);
589
+ }
590
+ } else {
591
+ head.appendChild(style);
592
+ }
593
+
594
+ if (style.styleSheet) {
595
+ style.styleSheet.cssText = css;
596
+ } else {
597
+ style.appendChild(document.createTextNode(css));
598
+ }
599
+ }
600
+
601
+ var css_248z = "/* Preload key fonts in your global CSS */\n@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap');\n@import url('https://fonts.googleapis.com/css2?family=Kode+Mono:wght@100;200;300;400;500;600;700&display=swap');\n@import url('https://fonts.googleapis.com/css2?family=Inter+Tight:wght@400;700&display=swap');\n@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700&display=swap');\n\n* {\n -ms-overflow-style: none; /* IE, Edge */\n scrollbar-width: none; /* Firefox */\n}\n*::-webkit-scrollbar {\n display: none; /* Chrome, Safari, Opera */\n}\n\nsvg {\n transition: all 0.3s;\n}\n\n/*\n The input styles below are to override the browser \":-webkit-autofill\" default style declarations.\n The issue is when someone autocompletes an input field, the browser will apply its own styles (and the browser applies \"!important\" preventing direct overrides).\n With the following, we're able to delay the browser styles to be applied for 50000s (13.8 hours), so the user will not see the browser styles applied.\n*/\n\ninput {\n all: unset;\n}\n\ninput:-webkit-autofill,\ninput:-webkit-autofill:hover,\ninput:-webkit-autofill:focus,\ninput:-webkit-autofill:active {\n -webkit-transition: all 50000s ease-in-out 0s;\n transition: all 50000s ease-in-out 0s;\n}\n";
602
+ styleInject(css_248z);
603
+
604
+ const slide = {
605
+ in: {
606
+ left: keyframes `
607
+ from { transform: translateX(-100%); }
608
+ to { transform: translateX(0); }
609
+ `,
610
+ right: keyframes `
611
+ from { transform: translateX(100%); }
612
+ to { transform: translateX(0); }
613
+ `,
614
+ top: keyframes `
615
+ from { transform: translateY(-100%); }
616
+ to { transform: translateY(0); }
617
+ `,
618
+ bottom: keyframes `
619
+ from { transform: translateY(100%); }
620
+ to { transform: translateY(0); }
621
+ `,
622
+ center: keyframes `
623
+ from { transform: translate(-50%, 100%); }
624
+ to { transform: translate(-50%, -50%); }
625
+ `,
626
+ },
627
+ out: {
628
+ left: keyframes `
629
+ from { transform: translateX(0); }
630
+ to { transform: translateX(-100%); }
631
+ `,
632
+ right: keyframes `
633
+ from { transform: translateX(0); }
634
+ to { transform: translateX(100%); }
635
+ `,
636
+ top: keyframes `
637
+ from { transform: translateY(0); }
638
+ to { transform: translateY(-100%); }
639
+ `,
640
+ bottom: keyframes `
641
+ from { transform: translateY(0); }
642
+ to { transform: translateY(100%); }
643
+ `,
644
+ center: keyframes `
645
+ from { transform: translate(-50%, -50%); }
646
+ to { transform: translate(-50%, 100%); }
647
+ `,
648
+ },
649
+ };
650
+ const progress = {
651
+ in: keyframes `
652
+ from { width: 0%; }
653
+ to { width: 100%; }
654
+ `,
655
+ out: keyframes `
656
+ from { width: 100%; }
657
+ to { width: 0%; }
658
+ `,
659
+ };
660
+ const ping = keyframes `
661
+ 0% {
662
+ transform: scale(1);
663
+ opacity: 1;
664
+ }
665
+ 75%, 100% {
666
+ transform: scale(2);
667
+ opacity: 0;
668
+ }
669
+ `;
670
+ const shimmer = keyframes `
671
+ 0% {
672
+ background-position: -500px 0;
673
+ }
674
+ 100% {
675
+ background-position: 500px 0;
676
+ }
677
+ `;
678
+
679
+ var animations = /*#__PURE__*/Object.freeze({
680
+ __proto__: null,
681
+ ping: ping,
682
+ progress: progress,
683
+ shimmer: shimmer,
684
+ slide: slide
685
+ });
686
+
687
+ export { useDrawerStore as a, useEntityStore as b, useFilterStore as c, useInstrumentStore as d, useModalStore as e, useNotificationStore as f, usePendingStore as g, useSelectedStore as h, useSetupStore as i, getEntityId as j, isTimeElapsed as k, animations as l, styleInject as s, useDarkMode as u };
@@ -1,6 +1,8 @@
1
- import { S as SamplerIcon, P as PiiMaskingIcon, R as RenameAttributeIcon, D as DeleteAttributeIcon, A as AddClusterInfoIcon, K as K8sLogo, C as CodeAttributesIcon, a as PayloadCollectionIcon } from './index-CIXQeSHu.js';
2
- import { A as ActionType, I as InstrumentationRuleType } from './index-RBS1MqCQ.js';
3
- import { I as ImageErrorIcon } from './index-BWqrekK4.js';
1
+ import { ActionType, InstrumentationRuleType } from './types.js';
2
+ import { S as SamplerIcon, P as PiiMaskingIcon, R as RenameAttributeIcon, D as DeleteAttributeIcon, A as AddClusterInfoIcon, K as K8sLogo, I as ImageErrorIcon, C as CodeAttributesIcon, a as PayloadCollectionIcon } from './index-DGel4E-Z.js';
3
+ import 'react';
4
+ import './index-BazfJyRh.js';
5
+ import 'styled-components';
4
6
 
5
7
  const getActionIcon = (type) => {
6
8
  const typeLowerCased = type?.toLowerCase();