@db-ux/react-core-components 4.9.0 → 4.10.0

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 (166) hide show
  1. package/CHANGELOG.md +17 -1
  2. package/README.md +97 -35
  3. package/dist/components/accordion/accordion.js +102 -86
  4. package/dist/components/accordion/model.d.ts +2 -2
  5. package/dist/components/accordion/model.js +4 -2
  6. package/dist/components/accordion-item/accordion-item.d.ts +2 -1
  7. package/dist/components/accordion-item/accordion-item.js +89 -56
  8. package/dist/components/accordion-item/model.d.ts +5 -1
  9. package/dist/components/badge/badge.js +72 -32
  10. package/dist/components/badge/model.d.ts +1 -1
  11. package/dist/components/badge/model.js +12 -1
  12. package/dist/components/brand/brand.js +60 -13
  13. package/dist/components/brand/model.d.ts +1 -1
  14. package/dist/components/button/button.js +75 -21
  15. package/dist/components/button/model.d.ts +1 -1
  16. package/dist/components/button/model.js +13 -2
  17. package/dist/components/card/card.js +65 -15
  18. package/dist/components/card/model.d.ts +1 -1
  19. package/dist/components/card/model.js +8 -2
  20. package/dist/components/checkbox/checkbox.js +163 -157
  21. package/dist/components/checkbox/model.d.ts +1 -1
  22. package/dist/components/custom-button/custom-button.js +65 -10
  23. package/dist/components/custom-button/model.d.ts +2 -2
  24. package/dist/components/custom-select/custom-select.js +509 -727
  25. package/dist/components/custom-select/model.d.ts +4 -4
  26. package/dist/components/custom-select/model.js +8 -1
  27. package/dist/components/custom-select-dropdown/custom-select-dropdown.js +62 -11
  28. package/dist/components/custom-select-dropdown/model.d.ts +1 -1
  29. package/dist/components/custom-select-dropdown/model.js +8 -1
  30. package/dist/components/custom-select-form-field/custom-select-form-field.js +57 -10
  31. package/dist/components/custom-select-form-field/model.d.ts +1 -1
  32. package/dist/components/custom-select-list/custom-select-list.js +60 -11
  33. package/dist/components/custom-select-list/model.d.ts +1 -1
  34. package/dist/components/custom-select-list-item/custom-select-list-item.js +89 -32
  35. package/dist/components/custom-select-list-item/model.d.ts +1 -1
  36. package/dist/components/custom-select-list-item/model.js +4 -1
  37. package/dist/components/divider/divider.js +60 -10
  38. package/dist/components/divider/model.d.ts +1 -1
  39. package/dist/components/divider/model.js +4 -2
  40. package/dist/components/drawer/drawer.js +118 -97
  41. package/dist/components/drawer/model.d.ts +1 -1
  42. package/dist/components/drawer/model.js +14 -4
  43. package/dist/components/header/header.js +143 -65
  44. package/dist/components/header/model.d.ts +1 -1
  45. package/dist/components/icon/icon.js +61 -12
  46. package/dist/components/icon/model.d.ts +1 -1
  47. package/dist/components/icon/model.js +11 -1
  48. package/dist/components/infotext/infotext.js +62 -12
  49. package/dist/components/infotext/model.d.ts +1 -1
  50. package/dist/components/input/input.js +198 -167
  51. package/dist/components/input/model.d.ts +1 -1
  52. package/dist/components/input/model.js +21 -5
  53. package/dist/components/link/link.js +70 -12
  54. package/dist/components/link/model.d.ts +1 -1
  55. package/dist/components/link/model.js +8 -3
  56. package/dist/components/navigation/model.d.ts +1 -1
  57. package/dist/components/navigation/navigation.js +57 -11
  58. package/dist/components/navigation-item/model.d.ts +6 -2
  59. package/dist/components/navigation-item/navigation-item.js +117 -81
  60. package/dist/components/notification/model.d.ts +1 -1
  61. package/dist/components/notification/model.js +12 -3
  62. package/dist/components/notification/notification.js +100 -32
  63. package/dist/components/page/model.d.ts +1 -1
  64. package/dist/components/page/model.js +4 -2
  65. package/dist/components/page/page.js +74 -46
  66. package/dist/components/popover/model.d.ts +1 -1
  67. package/dist/components/popover/popover.js +126 -125
  68. package/dist/components/radio/model.d.ts +1 -1
  69. package/dist/components/radio/radio.js +124 -85
  70. package/dist/components/section/model.d.ts +1 -1
  71. package/dist/components/section/section.js +59 -10
  72. package/dist/components/select/model.d.ts +1 -1
  73. package/dist/components/select/select.js +188 -191
  74. package/dist/components/stack/model.d.ts +1 -1
  75. package/dist/components/stack/model.js +14 -4
  76. package/dist/components/stack/stack.js +63 -10
  77. package/dist/components/switch/model.d.ts +1 -1
  78. package/dist/components/switch/switch.js +182 -150
  79. package/dist/components/tab-item/model.d.ts +1 -1
  80. package/dist/components/tab-item/tab-item.js +105 -76
  81. package/dist/components/tab-list/model.d.ts +1 -1
  82. package/dist/components/tab-list/tab-list.js +60 -11
  83. package/dist/components/tab-panel/model.d.ts +1 -1
  84. package/dist/components/tab-panel/tab-panel.js +59 -13
  85. package/dist/components/tabs/model.d.ts +3 -3
  86. package/dist/components/tabs/model.js +4 -2
  87. package/dist/components/tabs/tabs.js +191 -178
  88. package/dist/components/tag/model.d.ts +1 -1
  89. package/dist/components/tag/model.js +4 -1
  90. package/dist/components/tag/tag.js +91 -32
  91. package/dist/components/textarea/model.d.ts +1 -1
  92. package/dist/components/textarea/model.js +13 -2
  93. package/dist/components/textarea/textarea.js +165 -150
  94. package/dist/components/tooltip/model.d.ts +1 -1
  95. package/dist/components/tooltip/model.js +4 -1
  96. package/dist/components/tooltip/tooltip.js +119 -115
  97. package/dist/index.js +64 -81
  98. package/dist/shared/constants.js +32 -94
  99. package/dist/shared/figma.d.ts +12 -6
  100. package/dist/shared/model.js +73 -22
  101. package/dist/utils/document-click-listener.js +26 -29
  102. package/dist/utils/document-scroll-listener.js +30 -38
  103. package/dist/utils/floating-components.js +107 -358
  104. package/dist/utils/form-components.js +34 -60
  105. package/dist/utils/index.js +49 -167
  106. package/dist/utils/navigation.js +68 -135
  107. package/dist/utils/react.js +10 -15
  108. package/package.json +11 -8
  109. package/dist/components/accordion/index.js +0 -1
  110. package/dist/components/accordion-item/index.js +0 -1
  111. package/dist/components/accordion-item/model.js +0 -1
  112. package/dist/components/badge/index.js +0 -1
  113. package/dist/components/brand/index.js +0 -1
  114. package/dist/components/brand/model.js +0 -1
  115. package/dist/components/button/index.js +0 -1
  116. package/dist/components/card/index.js +0 -1
  117. package/dist/components/checkbox/index.js +0 -1
  118. package/dist/components/checkbox/model.js +0 -1
  119. package/dist/components/custom-button/index.js +0 -1
  120. package/dist/components/custom-button/model.js +0 -1
  121. package/dist/components/custom-select/index.js +0 -1
  122. package/dist/components/custom-select-dropdown/index.js +0 -1
  123. package/dist/components/custom-select-form-field/index.js +0 -1
  124. package/dist/components/custom-select-form-field/model.js +0 -1
  125. package/dist/components/custom-select-list/index.js +0 -1
  126. package/dist/components/custom-select-list/model.js +0 -1
  127. package/dist/components/custom-select-list-item/index.js +0 -1
  128. package/dist/components/divider/index.js +0 -1
  129. package/dist/components/drawer/index.js +0 -1
  130. package/dist/components/header/index.js +0 -1
  131. package/dist/components/header/model.js +0 -1
  132. package/dist/components/icon/index.js +0 -1
  133. package/dist/components/infotext/index.js +0 -1
  134. package/dist/components/infotext/model.js +0 -1
  135. package/dist/components/input/index.js +0 -1
  136. package/dist/components/link/index.js +0 -1
  137. package/dist/components/navigation/index.js +0 -1
  138. package/dist/components/navigation/model.js +0 -1
  139. package/dist/components/navigation-item/index.js +0 -1
  140. package/dist/components/navigation-item/model.js +0 -1
  141. package/dist/components/notification/index.js +0 -1
  142. package/dist/components/page/index.js +0 -1
  143. package/dist/components/popover/index.js +0 -1
  144. package/dist/components/popover/model.js +0 -1
  145. package/dist/components/radio/index.js +0 -1
  146. package/dist/components/radio/model.js +0 -1
  147. package/dist/components/section/index.js +0 -1
  148. package/dist/components/section/model.js +0 -1
  149. package/dist/components/select/index.js +0 -1
  150. package/dist/components/select/model.js +0 -1
  151. package/dist/components/stack/index.js +0 -1
  152. package/dist/components/switch/index.js +0 -1
  153. package/dist/components/switch/model.js +0 -1
  154. package/dist/components/tab-item/index.js +0 -1
  155. package/dist/components/tab-item/model.js +0 -1
  156. package/dist/components/tab-list/index.js +0 -1
  157. package/dist/components/tab-list/model.js +0 -1
  158. package/dist/components/tab-panel/index.js +0 -1
  159. package/dist/components/tab-panel/model.js +0 -1
  160. package/dist/components/tabs/index.js +0 -1
  161. package/dist/components/tag/index.js +0 -1
  162. package/dist/components/textarea/index.js +0 -1
  163. package/dist/components/tooltip/index.js +0 -1
  164. package/dist/shared/examples/index.js +0 -4
  165. package/dist/shared/figma.js +0 -1
  166. package/dist/shared/showcase/show-code-link.js +0 -51
package/dist/index.js CHANGED
@@ -1,81 +1,64 @@
1
- export * from './components/accordion';
2
- export * from './components/accordion-item';
3
- export * from './components/accordion-item/model';
4
- export * from './components/accordion/model';
5
- export * from './components/badge';
6
- export * from './components/badge/model';
7
- export * from './components/brand';
8
- export * from './components/brand/model';
9
- export * from './components/button';
10
- export * from './components/button/model';
11
- export * from './components/card';
12
- export * from './components/card/model';
13
- export * from './components/checkbox';
14
- export * from './components/checkbox/model';
15
- export * from './components/custom-button';
16
- export * from './components/custom-button/model';
17
- export * from './components/custom-select';
18
- export * from './components/custom-select-dropdown';
19
- export * from './components/custom-select-dropdown/model';
20
- export * from './components/custom-select-form-field';
21
- export * from './components/custom-select-form-field/model';
22
- export * from './components/custom-select-list';
23
- export * from './components/custom-select-list-item';
24
- export * from './components/custom-select-list-item/model';
25
- export * from './components/custom-select-list/model';
26
- export * from './components/custom-select/model';
27
- export * from './components/divider';
28
- export * from './components/divider/model';
29
- export * from './components/drawer';
30
- export * from './components/drawer/model';
31
- export * from './components/header';
32
- export * from './components/header/model';
33
- export * from './components/icon';
34
- export * from './components/icon/model';
35
- export * from './components/infotext';
36
- export * from './components/infotext/model';
37
- export * from './components/input';
38
- export * from './components/input/model';
39
- export * from './components/link';
40
- export * from './components/link/model';
41
- export * from './components/navigation';
42
- export * from './components/navigation-item';
43
- export * from './components/navigation-item/model';
44
- export * from './components/navigation/model';
45
- export * from './components/notification';
46
- export * from './components/notification/model';
47
- export * from './components/page';
48
- export * from './components/page/model';
49
- export * from './components/popover';
50
- export * from './components/popover/model';
51
- export * from './components/radio';
52
- export * from './components/radio/model';
53
- export * from './components/section';
54
- export * from './components/section/model';
55
- export * from './components/select';
56
- export * from './components/select/model';
57
- export * from './components/stack';
58
- export * from './components/stack/model';
59
- export * from './components/switch';
60
- export * from './components/switch/model';
61
- export * from './components/tab-item';
62
- export * from './components/tab-item/model';
63
- export * from './components/tab-list';
64
- export * from './components/tab-list/model';
65
- export * from './components/tab-panel';
66
- export * from './components/tab-panel/model';
67
- export * from './components/tabs';
68
- export * from './components/tabs/model';
69
- export * from './components/tag';
70
- export * from './components/tag/model';
71
- export * from './components/textarea';
72
- export * from './components/textarea/model';
73
- export * from './components/tooltip';
74
- export * from './components/tooltip/model';
75
- export * from './shared/constants';
76
- export * from './shared/model';
77
- export * from './utils/document-click-listener';
78
- export * from './utils/document-scroll-listener';
79
- export * from './utils/floating-components';
80
- export * from './utils/index';
81
- export * from './utils/navigation';
1
+ import { addAttributeToChildren as e, cls as t, delay as n, getBoolean as r, getBooleanAsString as i, getHideProp as a, getInputValue as o, getNotificationRole as s, getNumber as c, getOptionKey as l, getSearchInput as u, getStep as d, hasVoiceOver as f, isArrayOfStrings as p, isIOSSafari as m, isKeyboardEvent as h, stringPropVisible as g, uuid as _ } from "./utils/index.js";
2
+ import v from "./components/accordion-item/accordion-item.js";
3
+ import y from "./components/accordion/accordion.js";
4
+ import { AccordionBehaviorList as b, AccordionVariantList as x } from "./components/accordion/model.js";
5
+ import { COLOR as S, COLORS as C, COLORS_SIMPLE as w, COLOR_CONST as T, COLOR_SIMPLE as E, DB_UX_LOCAL_STORAGE_FRAMEWORK as D, DB_UX_LOCAL_STORAGE_MODE as O, DEFAULT_BACK as k, DEFAULT_BURGER_MENU as A, DEFAULT_CLOSE_BUTTON as j, DEFAULT_DATALIST_ID_SUFFIX as M, DEFAULT_ICON as N, DEFAULT_ID as P, DEFAULT_INVALID_MESSAGE as F, DEFAULT_INVALID_MESSAGE_ID_SUFFIX as I, DEFAULT_LABEL as L, DEFAULT_LABEL_ID_SUFFIX as R, DEFAULT_MESSAGE as z, DEFAULT_MESSAGE_ID_SUFFIX as B, DEFAULT_PLACEHOLDER as V, DEFAULT_PLACEHOLDER_ID_SUFFIX as H, DEFAULT_REMOVE as U, DEFAULT_ROWS as W, DEFAULT_SELECTED as G, DEFAULT_SELECT_ID_SUFFIX as K, DEFAULT_VALID_MESSAGE as q, DEFAULT_VALID_MESSAGE_ID_SUFFIX as J, DEFAULT_VIEWPORT as Y, DENSITIES as X, DENSITY as Z, DENSITY_CONST as Q, DESKTOP_VIEWPORT as $, SEMANTIC as ee, SEMANTICS as te, TESTING_VIEWPORTS as ne } from "./shared/constants.js";
6
+ import re from "./components/badge/badge.js";
7
+ import { BadgePlacementList as ie } from "./components/badge/model.js";
8
+ import ae from "./components/brand/brand.js";
9
+ import oe from "./components/button/button.js";
10
+ import { ButtonTypeList as se, ButtonVariantList as ce } from "./components/button/model.js";
11
+ import le from "./components/card/card.js";
12
+ import { CardBehaviorList as ue, CardElevationLevelList as de } from "./components/card/model.js";
13
+ import fe from "./components/infotext/infotext.js";
14
+ import pe from "./components/checkbox/checkbox.js";
15
+ import me from "./components/custom-button/custom-button.js";
16
+ import { DocumentClickListener as he } from "./utils/document-click-listener.js";
17
+ import { DocumentScrollListener as ge } from "./utils/document-scroll-listener.js";
18
+ import { getFloatingProps as _e, handleDataOutside as ve, handleFixedDropdown as ye, handleFixedPopover as be } from "./utils/floating-components.js";
19
+ import xe from "./components/custom-select-dropdown/custom-select-dropdown.js";
20
+ import Se from "./components/custom-select-list-item/custom-select-list-item.js";
21
+ import Ce from "./components/custom-select-list/custom-select-list.js";
22
+ import we from "./components/input/input.js";
23
+ import Te from "./components/tooltip/tooltip.js";
24
+ import Ee from "./components/tag/tag.js";
25
+ import De from "./components/custom-select/custom-select.js";
26
+ import { CustomSelectDropdownWidthList as Oe } from "./components/custom-select-dropdown/model.js";
27
+ import ke from "./components/custom-select-form-field/custom-select-form-field.js";
28
+ import { CustomSelectListItemTypeList as Ae } from "./components/custom-select-list-item/model.js";
29
+ import { SelectedTypeList as je } from "./components/custom-select/model.js";
30
+ import Me from "./components/divider/divider.js";
31
+ import { DividerMarginList as Ne, DividerVariantList as Pe } from "./components/divider/model.js";
32
+ import Fe from "./components/drawer/drawer.js";
33
+ import { DrawerBackdropList as Ie, DrawerDirectionList as Le, DrawerPositionList as Re, DrawerVariantList as ze } from "./components/drawer/model.js";
34
+ import { NavigationItemSafeTriangle as Be, isEventTargetNavigationItem as Ve } from "./utils/navigation.js";
35
+ import He from "./components/header/header.js";
36
+ import Ue from "./components/icon/icon.js";
37
+ import { IconWeightList as We } from "./components/icon/model.js";
38
+ import { InputTypeList as Ge } from "./components/input/model.js";
39
+ import Ke from "./components/link/link.js";
40
+ import { LinkContentList as qe, LinkSizeList as Je, LinkVariantList as Ye } from "./components/link/model.js";
41
+ import Xe from "./components/navigation/navigation.js";
42
+ import Ze from "./components/navigation-item/navigation-item.js";
43
+ import Qe from "./components/notification/notification.js";
44
+ import { NotificationAriaLiveList as $e, NotificationLinkVariantList as et, NotificationVariantList as tt } from "./components/notification/model.js";
45
+ import nt from "./components/page/page.js";
46
+ import { PageDocumentOverflowList as rt, PageVariantList as it } from "./components/page/model.js";
47
+ import at from "./components/popover/popover.js";
48
+ import ot from "./components/radio/radio.js";
49
+ import st from "./components/section/section.js";
50
+ import ct from "./components/select/select.js";
51
+ import lt from "./components/stack/stack.js";
52
+ import { StackAlignmentList as ut, StackDirectionList as dt, StackJustifyContentList as ft, StackVariantList as pt } from "./components/stack/model.js";
53
+ import mt from "./components/switch/switch.js";
54
+ import ht from "./components/tab-item/tab-item.js";
55
+ import gt from "./components/tab-list/tab-list.js";
56
+ import _t from "./components/tab-panel/tab-panel.js";
57
+ import vt from "./components/tabs/tabs.js";
58
+ import { TabsBehaviorList as yt, TabsInitialSelectedModeList as bt } from "./components/tabs/model.js";
59
+ import { TagBehaviorList as xt } from "./components/tag/model.js";
60
+ import St from "./components/textarea/textarea.js";
61
+ import { TextareaResizeList as Ct, TextareaWrapList as wt } from "./components/textarea/model.js";
62
+ import { TooltipVariantList as Tt } from "./components/tooltip/model.js";
63
+ import { AlignmentList as Et, AutoCompleteList as Dt, EmphasisList as Ot, FieldSizingList as kt, GapSpacingList as At, LabelVariantHorizontalList as jt, LabelVariantList as Mt, LinkReferrerPolicyList as Nt, LinkTargetList as Pt, MarginList as Ft, MaxWidthList as It, OrientationList as Lt, PlacementHorizontalList as Rt, PlacementList as zt, PlacementVerticalList as Bt, PopoverDelayList as Vt, PopoverWidthList as Ht, SemanticList as Ut, SizeList as Wt, SpacingList as Gt, ValidationList as Kt, WidthList as qt } from "./shared/model.js";
64
+ export { b as AccordionBehaviorList, x as AccordionVariantList, Et as AlignmentList, Dt as AutoCompleteList, ie as BadgePlacementList, se as ButtonTypeList, ce as ButtonVariantList, S as COLOR, C as COLORS, w as COLORS_SIMPLE, T as COLOR_CONST, E as COLOR_SIMPLE, ue as CardBehaviorList, de as CardElevationLevelList, Oe as CustomSelectDropdownWidthList, Ae as CustomSelectListItemTypeList, y as DBAccordion, v as DBAccordionItem, re as DBBadge, ae as DBBrand, oe as DBButton, le as DBCard, pe as DBCheckbox, me as DBCustomButton, De as DBCustomSelect, xe as DBCustomSelectDropdown, ke as DBCustomSelectFormField, Ce as DBCustomSelectList, Se as DBCustomSelectListItem, Me as DBDivider, Fe as DBDrawer, He as DBHeader, Ue as DBIcon, fe as DBInfotext, we as DBInput, Ke as DBLink, Xe as DBNavigation, Ze as DBNavigationItem, Qe as DBNotification, nt as DBPage, at as DBPopover, ot as DBRadio, st as DBSection, ct as DBSelect, lt as DBStack, mt as DBSwitch, ht as DBTabItem, gt as DBTabList, _t as DBTabPanel, vt as DBTabs, Ee as DBTag, St as DBTextarea, Te as DBTooltip, D as DB_UX_LOCAL_STORAGE_FRAMEWORK, O as DB_UX_LOCAL_STORAGE_MODE, k as DEFAULT_BACK, A as DEFAULT_BURGER_MENU, j as DEFAULT_CLOSE_BUTTON, M as DEFAULT_DATALIST_ID_SUFFIX, N as DEFAULT_ICON, P as DEFAULT_ID, F as DEFAULT_INVALID_MESSAGE, I as DEFAULT_INVALID_MESSAGE_ID_SUFFIX, L as DEFAULT_LABEL, R as DEFAULT_LABEL_ID_SUFFIX, z as DEFAULT_MESSAGE, B as DEFAULT_MESSAGE_ID_SUFFIX, V as DEFAULT_PLACEHOLDER, H as DEFAULT_PLACEHOLDER_ID_SUFFIX, U as DEFAULT_REMOVE, W as DEFAULT_ROWS, G as DEFAULT_SELECTED, K as DEFAULT_SELECT_ID_SUFFIX, q as DEFAULT_VALID_MESSAGE, J as DEFAULT_VALID_MESSAGE_ID_SUFFIX, Y as DEFAULT_VIEWPORT, X as DENSITIES, Z as DENSITY, Q as DENSITY_CONST, $ as DESKTOP_VIEWPORT, Ne as DividerMarginList, Pe as DividerVariantList, he as DocumentClickListener, ge as DocumentScrollListener, Ie as DrawerBackdropList, Le as DrawerDirectionList, Re as DrawerPositionList, ze as DrawerVariantList, Ot as EmphasisList, kt as FieldSizingList, At as GapSpacingList, We as IconWeightList, Ge as InputTypeList, jt as LabelVariantHorizontalList, Mt as LabelVariantList, qe as LinkContentList, Nt as LinkReferrerPolicyList, Je as LinkSizeList, Pt as LinkTargetList, Ye as LinkVariantList, Ft as MarginList, It as MaxWidthList, Be as NavigationItemSafeTriangle, $e as NotificationAriaLiveList, et as NotificationLinkVariantList, tt as NotificationVariantList, Lt as OrientationList, rt as PageDocumentOverflowList, it as PageVariantList, Rt as PlacementHorizontalList, zt as PlacementList, Bt as PlacementVerticalList, Vt as PopoverDelayList, Ht as PopoverWidthList, ee as SEMANTIC, te as SEMANTICS, je as SelectedTypeList, Ut as SemanticList, Wt as SizeList, Gt as SpacingList, ut as StackAlignmentList, dt as StackDirectionList, ft as StackJustifyContentList, pt as StackVariantList, ne as TESTING_VIEWPORTS, yt as TabsBehaviorList, bt as TabsInitialSelectedModeList, xt as TagBehaviorList, Ct as TextareaResizeList, wt as TextareaWrapList, Tt as TooltipVariantList, Kt as ValidationList, qt as WidthList, e as addAttributeToChildren, t as cls, n as delay, r as getBoolean, i as getBooleanAsString, _e as getFloatingProps, a as getHideProp, o as getInputValue, s as getNotificationRole, c as getNumber, l as getOptionKey, u as getSearchInput, d as getStep, ve as handleDataOutside, ye as handleFixedDropdown, be as handleFixedPopover, f as hasVoiceOver, p as isArrayOfStrings, Ve as isEventTargetNavigationItem, m as isIOSSafari, h as isKeyboardEvent, g as stringPropVisible, _ as uuid };
@@ -1,94 +1,32 @@
1
- export const DEFAULT_ID = 'OVERWRITE_DEFAULT_ID';
2
- export const DEFAULT_LABEL = 'LABEL SHOULD BE SET';
3
- export const DEFAULT_PLACEHOLDER = ' ';
4
- export const DEFAULT_MESSAGE = 'MESSAGE SHOULD BE SET';
5
- export const DEFAULT_LABEL_ID_SUFFIX = '-label';
6
- export const DEFAULT_SELECT_ID_SUFFIX = '-select';
7
- export const DEFAULT_MESSAGE_ID_SUFFIX = '-message';
8
- export const DEFAULT_VALID_MESSAGE_ID_SUFFIX = '-valid-message';
9
- export const DEFAULT_INVALID_MESSAGE_ID_SUFFIX = '-invalid-message';
10
- export const DEFAULT_PLACEHOLDER_ID_SUFFIX = '-placeholder';
11
- export const DEFAULT_DATALIST_ID_SUFFIX = '-datalist';
12
- export const DEFAULT_VALID_MESSAGE = 'TODO: Add a validMessage';
13
- export const DEFAULT_INVALID_MESSAGE = 'TODO: Add an invalidMessage';
14
- export const DEFAULT_REMOVE = 'Remove';
15
- export const DEFAULT_BACK = 'Back';
16
- export const DEFAULT_SELECTED = 'Selected';
17
- export const DEFAULT_BURGER_MENU = 'BurgerMenu';
18
- export const DEFAULT_ICON = 'brand';
19
- export const DEFAULT_ROWS = 4;
20
- export const DEFAULT_CLOSE_BUTTON = 'Close';
21
- export const DENSITY_CONST = 'density';
22
- export const COLOR_CONST = 'color';
23
- export var DENSITY;
24
- (function (DENSITY) {
25
- DENSITY["FUNCTIONAL"] = "functional";
26
- DENSITY["REGULAR"] = "regular";
27
- DENSITY["EXPRESSIVE"] = "expressive";
28
- })(DENSITY || (DENSITY = {}));
29
- export const DENSITIES = Object.entries(DENSITY).map(([, value]) => value);
30
- export var COLOR_SIMPLE;
31
- (function (COLOR_SIMPLE) {
32
- COLOR_SIMPLE["PRIMARY"] = "primary";
33
- })(COLOR_SIMPLE || (COLOR_SIMPLE = {}));
34
- export var COLOR;
35
- (function (COLOR) {
36
- COLOR["NEUTRAL_BG_LEVEL_1"] = "neutral-bg-basic-level-1";
37
- COLOR["NEUTRAL_BG_LEVEL_2"] = "neutral-bg-basic-level-2";
38
- COLOR["NEUTRAL_BG_LEVEL_3"] = "neutral-bg-basic-level-3";
39
- COLOR["NEUTRAL_BG_TRANSPARENT_SEMI"] = "neutral-bg-basic-transparent-semi";
40
- COLOR["NEUTRAL_BG_TRANSPARENT_FULL"] = "neutral-bg-basic-transparent-full";
41
- COLOR["BRAND_BG_LEVEL_1"] = "brand-bg-basic-level-1";
42
- COLOR["BRAND_BG_LEVEL_2"] = "brand-bg-basic-level-2";
43
- COLOR["BRAND_BG_LEVEL_3"] = "brand-bg-basic-level-3";
44
- COLOR["BRAND_BG_TRANSPARENT_SEMI"] = "brand-bg-basic-transparent-semi";
45
- COLOR["BRAND_BG_TRANSPARENT_FULL"] = "brand-bg-basic-transparent-full";
46
- COLOR["SUCCESSFUL_BG_LEVEL_1"] = "successful-bg-basic-level-1";
47
- COLOR["SUCCESSFUL_BG_LEVEL_2"] = "successful-bg-basic-level-2";
48
- COLOR["SUCCESSFUL_BG_LEVEL_3"] = "successful-bg-basic-level-3";
49
- COLOR["SUCCESSFUL_BG_TRANSPARENT_SEMI"] = "successful-bg-basic-transparent-semi";
50
- COLOR["SUCCESSFUL_BG_TRANSPARENT_FULL"] = "successful-bg-basic-transparent-full";
51
- COLOR["CRITICAL_BG_LEVEL_1"] = "critical-bg-basic-level-1";
52
- COLOR["CRITICAL_BG_LEVEL_2"] = "critical-bg-basic-level-2";
53
- COLOR["CRITICAL_BG_LEVEL_3"] = "critical-bg-basic-level-3";
54
- COLOR["CRITICAL_BG_TRANSPARENT_SEMI"] = "critical-bg-basic-transparent-semi";
55
- COLOR["CRITICAL_BG_TRANSPARENT_Full"] = "critical-bg-basic-transparent-full";
56
- COLOR["WARNING_BG_LEVEL_1"] = "warning-bg-basic-level-1";
57
- COLOR["WARNING_BG_LEVEL_2"] = "warning-bg-basic-level-2";
58
- COLOR["WARNING_BG_LEVEL_3"] = "warning-bg-basic-level-3";
59
- COLOR["WARNING_BG_TRANSPARENT_SEMI"] = "warning-bg-basic-transparent-semi";
60
- COLOR["WARNING_BG_TRANSPARENT_FULL"] = "warning-bg-basic-transparent-full";
61
- COLOR["INFORMATIONAL_BG_LEVEL_1"] = "informational-bg-basic-level-1";
62
- COLOR["INFORMATIONAL_BG_LEVEL_2"] = "informational-bg-basic-level-2";
63
- COLOR["INFORMATIONAL_BG_LEVEL_3"] = "informational-bg-basic-level-3";
64
- COLOR["INFORMATIONAL_BG_TRANSPARENT_SEMI"] = "informational-bg-basic-transparent-semi";
65
- COLOR["INFORMATIONAL_BG_TRANSPARENT_FULL"] = "informational-bg-basic-transparent-full";
66
- })(COLOR || (COLOR = {}));
67
- export const COLORS = Object.entries(COLOR).map(([, value]) => value);
68
- export const COLORS_SIMPLE = Object.entries(COLOR_SIMPLE).map(([, value]) => value);
69
- export var SEMANTIC;
70
- (function (SEMANTIC) {
71
- SEMANTIC["CRITICAL"] = "critical";
72
- SEMANTIC["INFORMATIONAL"] = "informational";
73
- SEMANTIC["WARNING"] = "warning";
74
- SEMANTIC["SUCCESSFUL"] = "successful";
75
- })(SEMANTIC || (SEMANTIC = {}));
76
- export const SEMANTICS = Object.entries(SEMANTIC).map(([, value]) => value);
77
- export const DEFAULT_VIEWPORT = {
78
- width: 390,
79
- height: 884
80
- };
81
- export const DESKTOP_VIEWPORT = {
82
- width: 1920,
83
- height: 1280
84
- };
85
- /**
86
- * Use those viewports if your component has a css media-query otherwise use the DEFAULT_VIEWPORT
87
- */
88
- export const TESTING_VIEWPORTS = [Object.assign({ name: 'desktop' }, DESKTOP_VIEWPORT), {
89
- name: 'tablet',
90
- width: 768,
91
- height: 1024
92
- }, Object.assign({ name: 'mobile' }, DEFAULT_VIEWPORT)];
93
- export const DB_UX_LOCAL_STORAGE_FRAMEWORK = 'db-ux-framework';
94
- export const DB_UX_LOCAL_STORAGE_MODE = 'db-ux-mode';
1
+ //#region src/shared/constants.ts
2
+ var e = "OVERWRITE_DEFAULT_ID", t = "LABEL SHOULD BE SET", n = " ", r = "MESSAGE SHOULD BE SET", i = "-label", a = "-select", o = "-message", s = "-valid-message", c = "-invalid-message", l = "-placeholder", u = "-datalist", d = "TODO: Add a validMessage", f = "TODO: Add an invalidMessage", p = "Remove", m = "Back", h = "Selected", g = "BurgerMenu", _ = "brand", v = 4, y = "Close", b = "density", x = "color", S = /* @__PURE__ */ function(e) {
3
+ return e.FUNCTIONAL = "functional", e.REGULAR = "regular", e.EXPRESSIVE = "expressive", e;
4
+ }({}), C = Object.entries(S).map(([, e]) => e), w = /* @__PURE__ */ function(e) {
5
+ return e.PRIMARY = "primary", e;
6
+ }({}), T = /* @__PURE__ */ function(e) {
7
+ return e.NEUTRAL_BG_LEVEL_1 = "neutral-bg-basic-level-1", e.NEUTRAL_BG_LEVEL_2 = "neutral-bg-basic-level-2", e.NEUTRAL_BG_LEVEL_3 = "neutral-bg-basic-level-3", e.NEUTRAL_BG_TRANSPARENT_SEMI = "neutral-bg-basic-transparent-semi", e.NEUTRAL_BG_TRANSPARENT_FULL = "neutral-bg-basic-transparent-full", e.BRAND_BG_LEVEL_1 = "brand-bg-basic-level-1", e.BRAND_BG_LEVEL_2 = "brand-bg-basic-level-2", e.BRAND_BG_LEVEL_3 = "brand-bg-basic-level-3", e.BRAND_BG_TRANSPARENT_SEMI = "brand-bg-basic-transparent-semi", e.BRAND_BG_TRANSPARENT_FULL = "brand-bg-basic-transparent-full", e.SUCCESSFUL_BG_LEVEL_1 = "successful-bg-basic-level-1", e.SUCCESSFUL_BG_LEVEL_2 = "successful-bg-basic-level-2", e.SUCCESSFUL_BG_LEVEL_3 = "successful-bg-basic-level-3", e.SUCCESSFUL_BG_TRANSPARENT_SEMI = "successful-bg-basic-transparent-semi", e.SUCCESSFUL_BG_TRANSPARENT_FULL = "successful-bg-basic-transparent-full", e.CRITICAL_BG_LEVEL_1 = "critical-bg-basic-level-1", e.CRITICAL_BG_LEVEL_2 = "critical-bg-basic-level-2", e.CRITICAL_BG_LEVEL_3 = "critical-bg-basic-level-3", e.CRITICAL_BG_TRANSPARENT_SEMI = "critical-bg-basic-transparent-semi", e.CRITICAL_BG_TRANSPARENT_Full = "critical-bg-basic-transparent-full", e.WARNING_BG_LEVEL_1 = "warning-bg-basic-level-1", e.WARNING_BG_LEVEL_2 = "warning-bg-basic-level-2", e.WARNING_BG_LEVEL_3 = "warning-bg-basic-level-3", e.WARNING_BG_TRANSPARENT_SEMI = "warning-bg-basic-transparent-semi", e.WARNING_BG_TRANSPARENT_FULL = "warning-bg-basic-transparent-full", e.INFORMATIONAL_BG_LEVEL_1 = "informational-bg-basic-level-1", e.INFORMATIONAL_BG_LEVEL_2 = "informational-bg-basic-level-2", e.INFORMATIONAL_BG_LEVEL_3 = "informational-bg-basic-level-3", e.INFORMATIONAL_BG_TRANSPARENT_SEMI = "informational-bg-basic-transparent-semi", e.INFORMATIONAL_BG_TRANSPARENT_FULL = "informational-bg-basic-transparent-full", e;
8
+ }({}), E = Object.entries(T).map(([, e]) => e), D = Object.entries(w).map(([, e]) => e), O = /* @__PURE__ */ function(e) {
9
+ return e.CRITICAL = "critical", e.INFORMATIONAL = "informational", e.WARNING = "warning", e.SUCCESSFUL = "successful", e;
10
+ }({}), k = Object.entries(O).map(([, e]) => e), A = {
11
+ width: 390,
12
+ height: 884
13
+ }, j = {
14
+ width: 1920,
15
+ height: 1280
16
+ }, M = [
17
+ {
18
+ name: "desktop",
19
+ ...j
20
+ },
21
+ {
22
+ name: "tablet",
23
+ width: 768,
24
+ height: 1024
25
+ },
26
+ {
27
+ name: "mobile",
28
+ ...A
29
+ }
30
+ ], N = "db-ux-framework", P = "db-ux-mode";
31
+ //#endregion
32
+ export { T as COLOR, E as COLORS, D as COLORS_SIMPLE, x as COLOR_CONST, w as COLOR_SIMPLE, N as DB_UX_LOCAL_STORAGE_FRAMEWORK, P as DB_UX_LOCAL_STORAGE_MODE, m as DEFAULT_BACK, g as DEFAULT_BURGER_MENU, y as DEFAULT_CLOSE_BUTTON, u as DEFAULT_DATALIST_ID_SUFFIX, _ as DEFAULT_ICON, e as DEFAULT_ID, f as DEFAULT_INVALID_MESSAGE, c as DEFAULT_INVALID_MESSAGE_ID_SUFFIX, t as DEFAULT_LABEL, i as DEFAULT_LABEL_ID_SUFFIX, r as DEFAULT_MESSAGE, o as DEFAULT_MESSAGE_ID_SUFFIX, n as DEFAULT_PLACEHOLDER, l as DEFAULT_PLACEHOLDER_ID_SUFFIX, p as DEFAULT_REMOVE, v as DEFAULT_ROWS, h as DEFAULT_SELECTED, a as DEFAULT_SELECT_ID_SUFFIX, d as DEFAULT_VALID_MESSAGE, s as DEFAULT_VALID_MESSAGE_ID_SUFFIX, A as DEFAULT_VIEWPORT, C as DENSITIES, S as DENSITY, b as DENSITY_CONST, j as DESKTOP_VIEWPORT, O as SEMANTIC, k as SEMANTICS, M as TESTING_VIEWPORTS };
@@ -12,6 +12,12 @@ export type FigmaEnumProp = {
12
12
  key: string;
13
13
  /** Map of Figma variant value → code value. Values can be strings, booleans, numbers, or instance swaps. */
14
14
  value: Record<string, string | boolean | number | FigmaInstanceProp>;
15
+ /**
16
+ * Optional Figma boolean property key that guards this prop.
17
+ * When set, the resolved value is only emitted if getPropertyValue(guardKey) === 'True'.
18
+ * Useful for icon swaps that are only present when a show-flag is enabled.
19
+ */
20
+ guardKey?: string;
15
21
  };
16
22
  /** A simple scalar prop. */
17
23
  export type FigmaSimpleProp = {
@@ -86,19 +92,19 @@ export type FigmaConnectedInstancesProp = {
86
92
  */
87
93
  export type FigmaNestedConnectedInstancesProp = {
88
94
  type: 'nestedConnectedInstances';
89
- /** Import string to filter by (e.g. 'DBAccordionItem'). Only instances whose template nestedImports contain this string are included. */
90
- filter: string;
95
+ /** Import string to filter by (e.g. 'DBAccordionItem'). Only instances whose template nestedImports contain this string are included. When omitted, all connected instances are included. */
96
+ filter?: string;
91
97
  };
92
98
  /**
93
- * Wraps an iconSwap prop so it is only rendered when a boolean guard prop is true.
94
- * Generates: let icon = ''; if (showIconLeading) { icon = `\n\t\ticon="${iconLeading}"` }
99
+ * Wraps an iconSwap prop so it is only rendered when a boolean Figma property is enabled.
100
+ * Generates: let icon = ''; if (getPropertyValue(guardKey) === true || getPropertyValue(guardKey) === 'True') { icon = `\n\t\ticon="${iconLeading}"` }
95
101
  */
96
102
  export type FigmaConditionalProp = {
97
103
  type: 'conditionalProp';
98
104
  /** The Figma property key of the icon instance swap. */
99
105
  key: string;
100
- /** The prop name of the boolean guard (e.g. 'showIconLeading'). */
101
- guardProp: string;
106
+ /** The Figma boolean property key that guards this prop (e.g. 'Show Icon Leading'). */
107
+ guardKey: string;
102
108
  /** The attribute name to render (e.g. 'icon'). */
103
109
  attrName: string;
104
110
  };
@@ -1,22 +1,73 @@
1
- export const SemanticList = ['adaptive', 'neutral', 'critical', 'informational', 'warning', 'successful'];
2
- export const SpacingList = ['medium', 'small', 'large', 'none'];
3
- export const MarginList = ['medium', 'small', 'large', 'none'];
4
- export const PlacementHorizontalList = ['left', 'right', 'left-start', 'left-end', 'right-start', 'right-end'];
5
- export const PlacementVerticalList = ['top', 'bottom', 'top-start', 'top-end', 'bottom-start', 'bottom-end'];
6
- export const PlacementList = [...PlacementHorizontalList, ...PlacementVerticalList];
7
- export const GapSpacingList = ['none', '3x-large', '2x-large', 'x-large', 'large', 'medium', 'small', 'x-small', '2x-small', '3x-small'];
8
- export const OrientationList = ['horizontal', 'vertical'];
9
- export const WidthList = ['full', 'auto'];
10
- export const MaxWidthList = ['full', 'medium', 'large', 'small'];
11
- export const PopoverDelayList = ['none', 'slow', 'fast'];
12
- export const PopoverWidthList = ['auto', 'fixed'];
13
- export const SizeList = ['small', 'medium'];
14
- export const EmphasisList = ['weak', 'strong'];
15
- export const ValidationList = ['invalid', 'valid', 'no-validation'];
16
- export const FieldSizingList = ['fixed', 'content'];
17
- export const LabelVariantList = ['above', 'floating'];
18
- export const LabelVariantHorizontalList = ['leading', 'trailing'];
19
- export const AutoCompleteList = ['off', 'on', 'name', 'honorific-prefix', 'given-name', 'additional-name', 'family-name', 'honorific-suffix', 'nickname', 'email', 'username', 'new-password', 'current-password', 'one-time-code', 'organization-title', 'organization', 'street-address', 'shipping', 'billing', 'address-line1', 'address-line2', 'address-line3', 'address-level4', 'address-level3', 'address-level2', 'address-level1', 'country', 'country-name', 'postal-code', 'cc-name', 'cc-given-name', 'cc-additional-name', 'cc-family-name', 'cc-number', 'cc-exp', 'cc-exp-month', 'cc-exp-year', 'cc-csc', 'cc-type', 'transaction-currency', 'transaction-amount', 'language', 'bday', 'bday-day', 'bday-month', 'bday-year', 'sex', 'tel', 'tel-country-code', 'tel-national', 'tel-area-code', 'tel-local', 'tel-extension', 'impp', 'url', 'photo', 'webauthn'];
20
- export const LinkTargetList = ['_self', '_blank', '_parent', '_top'];
21
- export const LinkReferrerPolicyList = ['no-referrer', 'no-referrer-when-downgrade', 'origin', 'origin-when-cross-origin', 'same-origin', 'strict-origin', 'strict-origin-when-cross-origin', 'unsafe-url'];
22
- export const AlignmentList = ['start', 'center'];
1
+ //#region src/shared/model.ts
2
+ var e = [
3
+ "adaptive",
4
+ "neutral",
5
+ "critical",
6
+ "informational",
7
+ "warning",
8
+ "successful"
9
+ ], t = [
10
+ "medium",
11
+ "small",
12
+ "large",
13
+ "none"
14
+ ], n = [
15
+ "medium",
16
+ "small",
17
+ "large",
18
+ "none"
19
+ ], r = [
20
+ "left",
21
+ "right",
22
+ "left-start",
23
+ "left-end",
24
+ "right-start",
25
+ "right-end"
26
+ ], i = [
27
+ "top",
28
+ "bottom",
29
+ "top-start",
30
+ "top-end",
31
+ "bottom-start",
32
+ "bottom-end"
33
+ ], a = [...r, ...i], o = [
34
+ "none",
35
+ "3x-large",
36
+ "2x-large",
37
+ "x-large",
38
+ "large",
39
+ "medium",
40
+ "small",
41
+ "x-small",
42
+ "2x-small",
43
+ "3x-small"
44
+ ], s = ["horizontal", "vertical"], c = ["full", "auto"], l = [
45
+ "full",
46
+ "medium",
47
+ "large",
48
+ "small"
49
+ ], u = [
50
+ "none",
51
+ "slow",
52
+ "fast"
53
+ ], d = ["auto", "fixed"], f = ["small", "medium"], p = ["weak", "strong"], m = [
54
+ "invalid",
55
+ "valid",
56
+ "no-validation"
57
+ ], h = ["fixed", "content"], g = ["above", "floating"], _ = ["leading", "trailing"], v = /* @__PURE__ */ "off.on.name.honorific-prefix.given-name.additional-name.family-name.honorific-suffix.nickname.email.username.new-password.current-password.one-time-code.organization-title.organization.street-address.shipping.billing.address-line1.address-line2.address-line3.address-level4.address-level3.address-level2.address-level1.country.country-name.postal-code.cc-name.cc-given-name.cc-additional-name.cc-family-name.cc-number.cc-exp.cc-exp-month.cc-exp-year.cc-csc.cc-type.transaction-currency.transaction-amount.language.bday.bday-day.bday-month.bday-year.sex.tel.tel-country-code.tel-national.tel-area-code.tel-local.tel-extension.impp.url.photo.webauthn".split("."), y = [
58
+ "_self",
59
+ "_blank",
60
+ "_parent",
61
+ "_top"
62
+ ], b = [
63
+ "no-referrer",
64
+ "no-referrer-when-downgrade",
65
+ "origin",
66
+ "origin-when-cross-origin",
67
+ "same-origin",
68
+ "strict-origin",
69
+ "strict-origin-when-cross-origin",
70
+ "unsafe-url"
71
+ ], x = ["start", "center"];
72
+ //#endregion
73
+ export { x as AlignmentList, v as AutoCompleteList, p as EmphasisList, h as FieldSizingList, o as GapSpacingList, _ as LabelVariantHorizontalList, g as LabelVariantList, b as LinkReferrerPolicyList, y as LinkTargetList, n as MarginList, l as MaxWidthList, s as OrientationList, r as PlacementHorizontalList, a as PlacementList, i as PlacementVerticalList, u as PopoverDelayList, d as PopoverWidthList, e as SemanticList, f as SizeList, t as SpacingList, m as ValidationList, c as WidthList };
@@ -1,29 +1,26 @@
1
- import { uuid } from './index';
2
- export class DocumentClickListener {
3
- static runCallbacks(event) {
4
- for (const callback of Object.values(DocumentClickListener.callbacks)) {
5
- if (typeof callback === 'function') {
6
- callback(event);
7
- }
8
- }
9
- }
10
- constructor() {
11
- if (DocumentClickListener._instance) {
12
- return DocumentClickListener._instance;
13
- }
14
- DocumentClickListener._instance = this;
15
- if (self.document) {
16
- self.document.addEventListener('click', event => DocumentClickListener.runCallbacks(event));
17
- }
18
- }
19
- addCallback(callback) {
20
- const callbackID = uuid();
21
- DocumentClickListener.callbacks[callbackID] = callback;
22
- return callbackID;
23
- }
24
- removeCallback(id) {
25
- delete DocumentClickListener.callbacks[id];
26
- }
27
- }
28
- DocumentClickListener.callbacks = {};
29
- DocumentClickListener._instance = null;
1
+ import { uuid as e } from "./index.js";
2
+ //#region src/utils/document-click-listener.ts
3
+ var t = class t {
4
+ static {
5
+ this.callbacks = {};
6
+ }
7
+ static {
8
+ this._instance = null;
9
+ }
10
+ static runCallbacks(e) {
11
+ for (let n of Object.values(t.callbacks)) typeof n == "function" && n(e);
12
+ }
13
+ constructor() {
14
+ if (t._instance) return t._instance;
15
+ t._instance = this, self.document && self.document.addEventListener("click", (e) => t.runCallbacks(e));
16
+ }
17
+ addCallback(n) {
18
+ let r = e();
19
+ return t.callbacks[r] = n, r;
20
+ }
21
+ removeCallback(e) {
22
+ delete t.callbacks[e];
23
+ }
24
+ };
25
+ //#endregion
26
+ export { t as DocumentClickListener };
@@ -1,38 +1,30 @@
1
- import { uuid } from './index';
2
- export class DocumentScrollListener {
3
- static runCallbacks(event) {
4
- for (const callback of Object.values(DocumentScrollListener.callbacks)) {
5
- if (typeof callback === 'function') {
6
- callback(event);
7
- }
8
- }
9
- }
10
- constructor() {
11
- this.ticking = false;
12
- if (DocumentScrollListener._instance) {
13
- return DocumentScrollListener._instance;
14
- }
15
- DocumentScrollListener._instance = this;
16
- if (self.document) {
17
- self.document.addEventListener('scroll', event => {
18
- if (!this.ticking) {
19
- window.requestAnimationFrame(() => {
20
- DocumentScrollListener.runCallbacks(event);
21
- this.ticking = false;
22
- });
23
- this.ticking = true;
24
- }
25
- }, true);
26
- }
27
- }
28
- addCallback(callback) {
29
- const callbackID = uuid();
30
- DocumentScrollListener.callbacks[callbackID] = callback;
31
- return callbackID;
32
- }
33
- removeCallback(id) {
34
- delete DocumentScrollListener.callbacks[id];
35
- }
36
- }
37
- DocumentScrollListener.callbacks = {};
38
- DocumentScrollListener._instance = null;
1
+ import { uuid as e } from "./index.js";
2
+ //#region src/utils/document-scroll-listener.ts
3
+ var t = class t {
4
+ static {
5
+ this.callbacks = {};
6
+ }
7
+ static {
8
+ this._instance = null;
9
+ }
10
+ static runCallbacks(e) {
11
+ for (let n of Object.values(t.callbacks)) typeof n == "function" && n(e);
12
+ }
13
+ constructor() {
14
+ if (this.ticking = !1, t._instance) return t._instance;
15
+ t._instance = this, self.document && self.document.addEventListener("scroll", (e) => {
16
+ this.ticking ||= (window.requestAnimationFrame(() => {
17
+ t.runCallbacks(e), this.ticking = !1;
18
+ }), !0);
19
+ }, !0);
20
+ }
21
+ addCallback(n) {
22
+ let r = e();
23
+ return t.callbacks[r] = n, r;
24
+ }
25
+ removeCallback(e) {
26
+ delete t.callbacks[e];
27
+ }
28
+ };
29
+ //#endregion
30
+ export { t as DocumentScrollListener };