vanduo-framework 1.1.8

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 (196) hide show
  1. package/LICENSE +35 -0
  2. package/README.md +205 -0
  3. package/css/components/alerts.css +224 -0
  4. package/css/components/avatar.css +275 -0
  5. package/css/components/badges.css +230 -0
  6. package/css/components/breadcrumbs.css +146 -0
  7. package/css/components/button-group.css +82 -0
  8. package/css/components/buttons.css +530 -0
  9. package/css/components/cards.css +304 -0
  10. package/css/components/chips.css +259 -0
  11. package/css/components/code-snippet.css +555 -0
  12. package/css/components/collapsible.css +267 -0
  13. package/css/components/collections.css +253 -0
  14. package/css/components/doc-search.css +464 -0
  15. package/css/components/doc-tabs.css +38 -0
  16. package/css/components/draggable.css +317 -0
  17. package/css/components/dropdown.css +266 -0
  18. package/css/components/footer.css +375 -0
  19. package/css/components/forms.css +1774 -0
  20. package/css/components/image-box.css +279 -0
  21. package/css/components/modals.css +285 -0
  22. package/css/components/navbar.css +530 -0
  23. package/css/components/pagination.css +186 -0
  24. package/css/components/preloader.css +340 -0
  25. package/css/components/progress.css +107 -0
  26. package/css/components/sidenav.css +301 -0
  27. package/css/components/skeleton.css +241 -0
  28. package/css/components/spinner.css +144 -0
  29. package/css/components/tabs.css +327 -0
  30. package/css/components/theme-customizer.css +835 -0
  31. package/css/components/toast.css +357 -0
  32. package/css/components/tooltips.css +270 -0
  33. package/css/core/colors.css +1017 -0
  34. package/css/core/fonts.css +266 -0
  35. package/css/core/grid.css +1699 -0
  36. package/css/core/helpers.css +2202 -0
  37. package/css/core/reset.css +128 -0
  38. package/css/core/tokens.css +213 -0
  39. package/css/core/typography.css +405 -0
  40. package/css/core/vd-aliases.css +47 -0
  41. package/css/effects/parallax.css +113 -0
  42. package/css/icons/icons-all.css +23 -0
  43. package/css/icons/icons.css +25 -0
  44. package/css/utilities/media.css +167 -0
  45. package/css/utilities/print.css +111 -0
  46. package/css/utilities/shadow.css +243 -0
  47. package/css/utilities/table.css +381 -0
  48. package/css/utilities/transforms.css +71 -0
  49. package/css/utilities/transitions.css +87 -0
  50. package/css/vanduo.css +80 -0
  51. package/dist/build-info.json +6 -0
  52. package/dist/fonts/fira-sans/fira-sans-bold.woff2 +0 -0
  53. package/dist/fonts/fira-sans/fira-sans-medium.woff2 +0 -0
  54. package/dist/fonts/fira-sans/fira-sans-regular.woff2 +0 -0
  55. package/dist/fonts/ibm-plex/ibm-plex-sans-bold.woff2 +0 -0
  56. package/dist/fonts/ibm-plex/ibm-plex-sans-medium.woff2 +0 -0
  57. package/dist/fonts/ibm-plex/ibm-plex-sans-regular.woff2 +0 -0
  58. package/dist/fonts/inter/inter-bold.woff2 +0 -0
  59. package/dist/fonts/inter/inter-medium.woff2 +0 -0
  60. package/dist/fonts/inter/inter-regular.woff2 +0 -0
  61. package/dist/fonts/inter/inter-semibold.woff2 +0 -0
  62. package/dist/fonts/jetbrains-mono/jetbrains-mono-bold.woff2 +0 -0
  63. package/dist/fonts/jetbrains-mono/jetbrains-mono-regular.woff2 +0 -0
  64. package/dist/fonts/open-sans/open-sans-bold.woff2 +0 -0
  65. package/dist/fonts/open-sans/open-sans-medium.woff2 +0 -0
  66. package/dist/fonts/open-sans/open-sans-regular.woff2 +0 -0
  67. package/dist/fonts/rubik/rubik-bold.woff2 +0 -0
  68. package/dist/fonts/rubik/rubik-medium.woff2 +0 -0
  69. package/dist/fonts/rubik/rubik-regular.woff2 +0 -0
  70. package/dist/fonts/source-sans/source-sans-bold.woff2 +0 -0
  71. package/dist/fonts/source-sans/source-sans-regular.woff2 +0 -0
  72. package/dist/fonts/source-sans/source-sans-semibold.woff2 +0 -0
  73. package/dist/fonts/titillium-web/titillium-web-bold.woff2 +0 -0
  74. package/dist/fonts/titillium-web/titillium-web-regular.woff2 +0 -0
  75. package/dist/fonts/titillium-web/titillium-web-semibold.woff2 +0 -0
  76. package/dist/fonts/ubuntu/ubuntu-bold.woff2 +0 -0
  77. package/dist/fonts/ubuntu/ubuntu-medium.woff2 +0 -0
  78. package/dist/fonts/ubuntu/ubuntu-regular.woff2 +0 -0
  79. package/dist/icons/phosphor/LICENSE +21 -0
  80. package/dist/icons/phosphor/bold/Phosphor-Bold.ttf +0 -0
  81. package/dist/icons/phosphor/bold/Phosphor-Bold.woff +0 -0
  82. package/dist/icons/phosphor/bold/Phosphor-Bold.woff2 +0 -0
  83. package/dist/icons/phosphor/bold/style.css +4627 -0
  84. package/dist/icons/phosphor/duotone/Phosphor-Duotone.ttf +0 -0
  85. package/dist/icons/phosphor/duotone/Phosphor-Duotone.woff +0 -0
  86. package/dist/icons/phosphor/duotone/Phosphor-Duotone.woff2 +0 -0
  87. package/dist/icons/phosphor/duotone/style.css +12115 -0
  88. package/dist/icons/phosphor/fill/Phosphor-Fill.ttf +0 -0
  89. package/dist/icons/phosphor/fill/Phosphor-Fill.woff +0 -0
  90. package/dist/icons/phosphor/fill/Phosphor-Fill.woff2 +0 -0
  91. package/dist/icons/phosphor/fill/style.css +4627 -0
  92. package/dist/icons/phosphor/light/Phosphor-Light.ttf +0 -0
  93. package/dist/icons/phosphor/light/Phosphor-Light.woff +0 -0
  94. package/dist/icons/phosphor/light/Phosphor-Light.woff2 +0 -0
  95. package/dist/icons/phosphor/light/style.css +4627 -0
  96. package/dist/icons/phosphor/regular/Phosphor.ttf +0 -0
  97. package/dist/icons/phosphor/regular/Phosphor.woff +0 -0
  98. package/dist/icons/phosphor/regular/Phosphor.woff2 +0 -0
  99. package/dist/icons/phosphor/regular/style.css +4627 -0
  100. package/dist/icons/phosphor/thin/Phosphor-Thin.ttf +0 -0
  101. package/dist/icons/phosphor/thin/Phosphor-Thin.woff +0 -0
  102. package/dist/icons/phosphor/thin/Phosphor-Thin.woff2 +0 -0
  103. package/dist/icons/phosphor/thin/style.css +4627 -0
  104. package/dist/vanduo.cjs.js +5569 -0
  105. package/dist/vanduo.cjs.js.map +7 -0
  106. package/dist/vanduo.cjs.min.js +48 -0
  107. package/dist/vanduo.cjs.min.js.map +7 -0
  108. package/dist/vanduo.css +60666 -0
  109. package/dist/vanduo.css.map +1 -0
  110. package/dist/vanduo.esm.js +5548 -0
  111. package/dist/vanduo.esm.js.map +7 -0
  112. package/dist/vanduo.esm.min.js +48 -0
  113. package/dist/vanduo.esm.min.js.map +7 -0
  114. package/dist/vanduo.js +5545 -0
  115. package/dist/vanduo.js.map +7 -0
  116. package/dist/vanduo.min.css +2 -0
  117. package/dist/vanduo.min.css.map +1 -0
  118. package/dist/vanduo.min.js +48 -0
  119. package/dist/vanduo.min.js.map +7 -0
  120. package/fonts/fira-sans/fira-sans-bold.woff2 +0 -0
  121. package/fonts/fira-sans/fira-sans-medium.woff2 +0 -0
  122. package/fonts/fira-sans/fira-sans-regular.woff2 +0 -0
  123. package/fonts/ibm-plex/ibm-plex-sans-bold.woff2 +0 -0
  124. package/fonts/ibm-plex/ibm-plex-sans-medium.woff2 +0 -0
  125. package/fonts/ibm-plex/ibm-plex-sans-regular.woff2 +0 -0
  126. package/fonts/inter/inter-bold.woff2 +0 -0
  127. package/fonts/inter/inter-medium.woff2 +0 -0
  128. package/fonts/inter/inter-regular.woff2 +0 -0
  129. package/fonts/inter/inter-semibold.woff2 +0 -0
  130. package/fonts/jetbrains-mono/jetbrains-mono-bold.woff2 +0 -0
  131. package/fonts/jetbrains-mono/jetbrains-mono-regular.woff2 +0 -0
  132. package/fonts/open-sans/open-sans-bold.woff2 +0 -0
  133. package/fonts/open-sans/open-sans-medium.woff2 +0 -0
  134. package/fonts/open-sans/open-sans-regular.woff2 +0 -0
  135. package/fonts/rubik/rubik-bold.woff2 +0 -0
  136. package/fonts/rubik/rubik-medium.woff2 +0 -0
  137. package/fonts/rubik/rubik-regular.woff2 +0 -0
  138. package/fonts/source-sans/source-sans-bold.woff2 +0 -0
  139. package/fonts/source-sans/source-sans-regular.woff2 +0 -0
  140. package/fonts/source-sans/source-sans-semibold.woff2 +0 -0
  141. package/fonts/titillium-web/titillium-web-bold.woff2 +0 -0
  142. package/fonts/titillium-web/titillium-web-regular.woff2 +0 -0
  143. package/fonts/titillium-web/titillium-web-semibold.woff2 +0 -0
  144. package/fonts/ubuntu/ubuntu-bold.woff2 +0 -0
  145. package/fonts/ubuntu/ubuntu-medium.woff2 +0 -0
  146. package/fonts/ubuntu/ubuntu-regular.woff2 +0 -0
  147. package/icons/phosphor/LICENSE +21 -0
  148. package/icons/phosphor/bold/Phosphor-Bold.ttf +0 -0
  149. package/icons/phosphor/bold/Phosphor-Bold.woff +0 -0
  150. package/icons/phosphor/bold/Phosphor-Bold.woff2 +0 -0
  151. package/icons/phosphor/bold/style.css +4627 -0
  152. package/icons/phosphor/duotone/Phosphor-Duotone.ttf +0 -0
  153. package/icons/phosphor/duotone/Phosphor-Duotone.woff +0 -0
  154. package/icons/phosphor/duotone/Phosphor-Duotone.woff2 +0 -0
  155. package/icons/phosphor/duotone/style.css +12115 -0
  156. package/icons/phosphor/fill/Phosphor-Fill.ttf +0 -0
  157. package/icons/phosphor/fill/Phosphor-Fill.woff +0 -0
  158. package/icons/phosphor/fill/Phosphor-Fill.woff2 +0 -0
  159. package/icons/phosphor/fill/style.css +4627 -0
  160. package/icons/phosphor/light/Phosphor-Light.ttf +0 -0
  161. package/icons/phosphor/light/Phosphor-Light.woff +0 -0
  162. package/icons/phosphor/light/Phosphor-Light.woff2 +0 -0
  163. package/icons/phosphor/light/style.css +4627 -0
  164. package/icons/phosphor/regular/Phosphor.ttf +0 -0
  165. package/icons/phosphor/regular/Phosphor.woff +0 -0
  166. package/icons/phosphor/regular/Phosphor.woff2 +0 -0
  167. package/icons/phosphor/regular/style.css +4627 -0
  168. package/icons/phosphor/thin/Phosphor-Thin.ttf +0 -0
  169. package/icons/phosphor/thin/Phosphor-Thin.woff +0 -0
  170. package/icons/phosphor/thin/Phosphor-Thin.woff2 +0 -0
  171. package/icons/phosphor/thin/style.css +4627 -0
  172. package/js/components/code-snippet.js +639 -0
  173. package/js/components/collapsible.js +226 -0
  174. package/js/components/doc-search.js +936 -0
  175. package/js/components/draggable.js +725 -0
  176. package/js/components/dropdown.js +362 -0
  177. package/js/components/font-switcher.js +253 -0
  178. package/js/components/grid.js +279 -0
  179. package/js/components/image-box.js +372 -0
  180. package/js/components/modals.js +367 -0
  181. package/js/components/navbar.js +264 -0
  182. package/js/components/pagination.js +286 -0
  183. package/js/components/parallax.js +216 -0
  184. package/js/components/preloader.js +183 -0
  185. package/js/components/select.js +444 -0
  186. package/js/components/sidenav.js +303 -0
  187. package/js/components/tabs.js +303 -0
  188. package/js/components/theme-customizer.js +784 -0
  189. package/js/components/theme-switcher.js +183 -0
  190. package/js/components/toast.js +343 -0
  191. package/js/components/tooltips.js +306 -0
  192. package/js/index.js +52 -0
  193. package/js/utils/helpers.js +306 -0
  194. package/js/utils/lifecycle.js +135 -0
  195. package/js/vanduo.js +120 -0
  196. package/package.json +78 -0
@@ -0,0 +1,226 @@
1
+ /**
2
+ * Vanduo Framework - Collapsible Component
3
+ * JavaScript functionality for collapsible/accordion components
4
+ */
5
+
6
+ (function() {
7
+ 'use strict';
8
+
9
+ /**
10
+ * Collapsible Component
11
+ */
12
+ const Collapsible = {
13
+ // Store initialized containers and their cleanup functions
14
+ instances: new Map(),
15
+
16
+ /**
17
+ * Initialize collapsible components
18
+ */
19
+ init: function() {
20
+ const collapsibles = document.querySelectorAll('.vd-collapsible, .accordion');
21
+
22
+ collapsibles.forEach(container => {
23
+ if (this.instances.has(container)) {
24
+ return;
25
+ }
26
+ this.initCollapsible(container);
27
+ });
28
+ },
29
+
30
+ /**
31
+ * Initialize a collapsible container
32
+ * @param {HTMLElement} container - Collapsible container
33
+ */
34
+ initCollapsible: function(container) {
35
+ const isAccordion = container.classList.contains('accordion');
36
+ const items = container.querySelectorAll('.vd-collapsible-item, .accordion-item');
37
+ const cleanupFunctions = [];
38
+
39
+ items.forEach(item => {
40
+ const header = item.querySelector('.vd-collapsible-header, .accordion-header');
41
+ const body = item.querySelector('.vd-collapsible-body, .accordion-body');
42
+ const trigger = item.querySelector('.vd-collapsible-trigger, .accordion-trigger') || header;
43
+
44
+ if (!header || !body) {
45
+ return;
46
+ }
47
+
48
+ // Set initial state
49
+ if (item.classList.contains('is-open')) {
50
+ this.openItem(item, body, false);
51
+ } else {
52
+ this.closeItem(item, body, false);
53
+ }
54
+
55
+ // Add click handler
56
+ const clickHandler = (e) => {
57
+ e.preventDefault();
58
+ this.toggleItem(item, body, container, isAccordion);
59
+ };
60
+ trigger.addEventListener('click', clickHandler);
61
+ cleanupFunctions.push(() => trigger.removeEventListener('click', clickHandler));
62
+ });
63
+
64
+ this.instances.set(container, { cleanup: cleanupFunctions });
65
+ },
66
+
67
+ /**
68
+ * Toggle collapsible item
69
+ * @param {HTMLElement} item - Collapsible item
70
+ * @param {HTMLElement} body - Collapsible body
71
+ * @param {HTMLElement} container - Collapsible container
72
+ * @param {boolean} isAccordion - Whether in accordion mode
73
+ */
74
+ toggleItem: function(item, body, container, isAccordion) {
75
+ const isOpen = item.classList.contains('is-open');
76
+
77
+ if (isOpen) {
78
+ this.closeItem(item, body);
79
+ } else {
80
+ // If accordion mode, close other open items
81
+ if (isAccordion) {
82
+ const otherOpenItems = container.querySelectorAll('.vd-collapsible-item.is-open, .accordion-item.is-open');
83
+ otherOpenItems.forEach(otherItem => {
84
+ if (otherItem !== item) {
85
+ const otherBody = otherItem.querySelector('.vd-collapsible-body, .accordion-body');
86
+ this.closeItem(otherItem, otherBody);
87
+ }
88
+ });
89
+ }
90
+
91
+ this.openItem(item, body);
92
+ }
93
+ },
94
+
95
+ /**
96
+ * Open collapsible item
97
+ * @param {HTMLElement} item - Collapsible item
98
+ * @param {HTMLElement} body - Collapsible body
99
+ * @param {boolean} animate - Whether to animate
100
+ */
101
+ openItem: function(item, body, animate = true) {
102
+ if (!animate) {
103
+ body.style.transition = 'none';
104
+ }
105
+
106
+ item.classList.add('is-open');
107
+ item.setAttribute('aria-expanded', 'true');
108
+
109
+ // Set max-height to actual height
110
+ const height = body.scrollHeight;
111
+ body.style.maxHeight = `${height}px`;
112
+
113
+ // Reset transition after a brief delay
114
+ if (!animate) {
115
+ setTimeout(() => {
116
+ body.style.transition = '';
117
+ }, 0);
118
+ }
119
+
120
+ // Dispatch event
121
+ item.dispatchEvent(new CustomEvent('collapsible:open', { bubbles: true }));
122
+ },
123
+
124
+ /**
125
+ * Close collapsible item
126
+ * @param {HTMLElement} item - Collapsible item
127
+ * @param {HTMLElement} body - Collapsible body
128
+ * @param {boolean} animate - Whether to animate
129
+ */
130
+ closeItem: function(item, body, animate = true) {
131
+ if (!animate) {
132
+ body.style.transition = 'none';
133
+ }
134
+
135
+ item.classList.remove('is-open');
136
+ item.setAttribute('aria-expanded', 'false');
137
+ body.style.maxHeight = '0';
138
+
139
+ // Reset transition after a brief delay
140
+ if (!animate) {
141
+ setTimeout(() => {
142
+ body.style.transition = '';
143
+ }, 0);
144
+ }
145
+
146
+ // Dispatch event
147
+ item.dispatchEvent(new CustomEvent('collapsible:close', { bubbles: true }));
148
+ },
149
+
150
+ /**
151
+ * Open item programmatically
152
+ * @param {HTMLElement|string} item - Collapsible item or selector
153
+ */
154
+ open: function(item) {
155
+ const el = typeof item === 'string' ? document.querySelector(item) : item;
156
+ if (el) {
157
+ const body = el.querySelector('.vd-collapsible-body, .accordion-body');
158
+ if (body) {
159
+ this.openItem(el, body);
160
+ }
161
+ }
162
+ },
163
+
164
+ /**
165
+ * Close item programmatically
166
+ * @param {HTMLElement|string} item - Collapsible item or selector
167
+ */
168
+ close: function(item) {
169
+ const el = typeof item === 'string' ? document.querySelector(item) : item;
170
+ if (el) {
171
+ const body = el.querySelector('.vd-collapsible-body, .accordion-body');
172
+ if (body) {
173
+ this.closeItem(el, body);
174
+ }
175
+ }
176
+ },
177
+
178
+ /**
179
+ * Toggle item programmatically
180
+ * @param {HTMLElement|string} item - Collapsible item or selector
181
+ */
182
+ toggle: function(item) {
183
+ const el = typeof item === 'string' ? document.querySelector(item) : item;
184
+ if (el) {
185
+ const body = el.querySelector('.vd-collapsible-body, .accordion-body');
186
+ const container = el.closest('.vd-collapsible, .accordion');
187
+ const isAccordion = container && container.classList.contains('accordion');
188
+
189
+ if (body) {
190
+ this.toggleItem(el, body, container, isAccordion);
191
+ }
192
+ }
193
+ },
194
+
195
+ /**
196
+ * Destroy a collapsible instance and clean up event listeners
197
+ * @param {HTMLElement} container - Collapsible container
198
+ */
199
+ destroy: function(container) {
200
+ const instance = this.instances.get(container);
201
+ if (!instance) return;
202
+
203
+ instance.cleanup.forEach(fn => fn());
204
+ this.instances.delete(container);
205
+ },
206
+
207
+ /**
208
+ * Destroy all collapsible instances
209
+ */
210
+ destroyAll: function() {
211
+ this.instances.forEach((instance, container) => {
212
+ this.destroy(container);
213
+ });
214
+ }
215
+ };
216
+
217
+ // Register with Vanduo framework if available
218
+ if (typeof window.Vanduo !== 'undefined') {
219
+ window.Vanduo.register('collapsible', Collapsible);
220
+ }
221
+
222
+ // Expose globally
223
+ window.VanduoCollapsible = Collapsible;
224
+
225
+ })();
226
+