@finqu/cool 1.2.29 → 1.3.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 (206) hide show
  1. package/README.md +680 -1
  2. package/dist/css/cool.css +23575 -16644
  3. package/dist/css/cool.css.map +1 -154
  4. package/dist/css/cool.min.css +89 -3
  5. package/dist/css/cool.min.css.map +1 -1
  6. package/dist/js/cool.bundle.js +15402 -3800
  7. package/dist/js/cool.bundle.js.map +1 -1
  8. package/dist/js/cool.bundle.min.js +20 -8
  9. package/dist/js/cool.bundle.min.js.map +1 -1
  10. package/dist/js/cool.esm.js +4269 -3360
  11. package/dist/js/cool.esm.js.map +1 -1
  12. package/dist/js/cool.esm.min.js +9 -8
  13. package/dist/js/cool.esm.min.js.map +1 -1
  14. package/dist/js/cool.js +4271 -3362
  15. package/dist/js/cool.js.map +1 -1
  16. package/dist/js/cool.min.js +9 -8
  17. package/dist/js/cool.min.js.map +1 -1
  18. package/package.json +94 -61
  19. package/.babelrc.js +0 -20
  20. package/.browserslistrc +0 -13
  21. package/build/.eslintrc.json +0 -10
  22. package/build/banner.js +0 -14
  23. package/build/build-plugins.js +0 -92
  24. package/build/rollup.config.js +0 -46
  25. package/dist/css/cool-grid.css +0 -4390
  26. package/dist/css/cool-grid.css.map +0 -30
  27. package/dist/css/cool-grid.min.css +0 -7
  28. package/dist/css/cool-grid.min.css.map +0 -1
  29. package/dist/css/cool-reboot.css +0 -286
  30. package/dist/css/cool-reboot.css.map +0 -62
  31. package/dist/css/cool-reboot.min.css +0 -7
  32. package/dist/css/cool-reboot.min.css.map +0 -1
  33. package/html/index.html +0 -2703
  34. package/js/dist/collapse.js +0 -5535
  35. package/js/dist/collapse.js.map +0 -1
  36. package/js/dist/common.js +0 -21996
  37. package/js/dist/common.js.map +0 -1
  38. package/js/dist/cooldropdown.js +0 -467
  39. package/js/dist/cooldropdown.js.map +0 -1
  40. package/js/dist/coolpopover.js +0 -391
  41. package/js/dist/coolpopover.js.map +0 -1
  42. package/js/dist/coolsectiontabs.js +0 -256
  43. package/js/dist/coolsectiontabs.js.map +0 -1
  44. package/js/dist/coolselect.js +0 -796
  45. package/js/dist/coolselect.js.map +0 -1
  46. package/js/dist/cooltooltip.js +0 -360
  47. package/js/dist/cooltooltip.js.map +0 -1
  48. package/js/dist/coolui.js +0 -73
  49. package/js/dist/coolui.js.map +0 -1
  50. package/js/dist/dropdown.js +0 -27421
  51. package/js/dist/dropdown.js.map +0 -1
  52. package/js/dist/popover.js +0 -9472
  53. package/js/dist/popover.js.map +0 -1
  54. package/js/dist/sectiontabs.js +0 -4483
  55. package/js/dist/sectiontabs.js.map +0 -1
  56. package/js/dist/select.js +0 -37080
  57. package/js/dist/select.js.map +0 -1
  58. package/js/dist/tooltip.js +0 -8786
  59. package/js/dist/tooltip.js.map +0 -1
  60. package/js/index.esm.js +0 -21
  61. package/js/index.umd.js +0 -21
  62. package/js/src/abstract-ui-component.js +0 -81
  63. package/js/src/collapse.js +0 -286
  64. package/js/src/common.js +0 -296
  65. package/js/src/dialog.js +0 -579
  66. package/js/src/dropdown.js +0 -525
  67. package/js/src/popover.js +0 -632
  68. package/js/src/section-tabs.js +0 -215
  69. package/js/src/select.js +0 -1342
  70. package/js/src/toast.js +0 -581
  71. package/js/src/tooltip.js +0 -591
  72. package/js/src/util/animate-css.js +0 -22
  73. package/js/src/util/index.js +0 -122
  74. package/js/src/util/perfect-scrollbar.js +0 -1316
  75. package/less/alert.less +0 -345
  76. package/less/badge.less +0 -38
  77. package/less/bootstrap-noconflict.less +0 -23
  78. package/less/bootstrap.less +0 -23
  79. package/less/button-group.less +0 -153
  80. package/less/buttons.less +0 -287
  81. package/less/dialog-noconflict.less +0 -174
  82. package/less/dialog.less +0 -203
  83. package/less/dropdown.less +0 -209
  84. package/less/forms.less +0 -770
  85. package/less/images.less +0 -242
  86. package/less/input-group.less +0 -163
  87. package/less/list-group.less +0 -73
  88. package/less/mixins/aspect-ratio.less +0 -23
  89. package/less/mixins/border-radius.less +0 -24
  90. package/less/mixins/box-shadow.less +0 -4
  91. package/less/mixins/buttons.less +0 -17
  92. package/less/mixins/caret.less +0 -51
  93. package/less/mixins/clearfix.less +0 -10
  94. package/less/mixins/gradients.less +0 -34
  95. package/less/mixins/nav-divider.less +0 -7
  96. package/less/mixins/object-fit.less +0 -13
  97. package/less/mixins/reset-text.less +0 -16
  98. package/less/mixins.less +0 -11
  99. package/less/package.json +0 -11
  100. package/less/pagination.less +0 -69
  101. package/less/popover.less +0 -143
  102. package/less/project.sublime-workspace +0 -774
  103. package/less/reboot.less +0 -235
  104. package/less/section.less +0 -793
  105. package/less/select.less +0 -150
  106. package/less/tables.less +0 -737
  107. package/less/tabs.less +0 -162
  108. package/less/tooltip.less +0 -87
  109. package/less/type.less +0 -71
  110. package/less/utilities/align.less +0 -27
  111. package/less/utilities/animate.less +0 -3512
  112. package/less/utilities/background.less +0 -70
  113. package/less/utilities/borders.less +0 -16
  114. package/less/utilities/color.less +0 -70
  115. package/less/utilities/cursor.less +0 -8
  116. package/less/utilities/display.less +0 -38
  117. package/less/utilities/embed.less +0 -61
  118. package/less/utilities/flex.less +0 -76
  119. package/less/utilities/jquery-ui.less +0 -116
  120. package/less/utilities/lazyload.less +0 -29
  121. package/less/utilities/overflow.less +0 -11
  122. package/less/utilities/pace.less +0 -25
  123. package/less/utilities/placeholder.less +0 -60
  124. package/less/utilities/position.less +0 -42
  125. package/less/utilities/scrollbar.less +0 -152
  126. package/less/utilities/spacing.less +0 -197
  127. package/less/utilities/text.less +0 -68
  128. package/less/utilities/transform.less +0 -7
  129. package/less/utilities.less +0 -21
  130. package/less/variables.less +0 -343
  131. package/scss/LISENCE +0 -15
  132. package/scss/_alert.scss +0 -102
  133. package/scss/_badge.scss +0 -102
  134. package/scss/_button-group.scss +0 -129
  135. package/scss/_buttons.scss +0 -248
  136. package/scss/_custom-forms.scss +0 -444
  137. package/scss/_dialog.scss +0 -160
  138. package/scss/_dropdown.scss +0 -233
  139. package/scss/_forms.scss +0 -258
  140. package/scss/_frame.scss +0 -627
  141. package/scss/_functions.scss +0 -124
  142. package/scss/_grid.scss +0 -35
  143. package/scss/_images.scss +0 -361
  144. package/scss/_input-group.scss +0 -285
  145. package/scss/_list-group.scss +0 -82
  146. package/scss/_mixins.scss +0 -34
  147. package/scss/_navbar.scss +0 -290
  148. package/scss/_notification.scss +0 -13
  149. package/scss/_pagination.scss +0 -88
  150. package/scss/_popover.scss +0 -167
  151. package/scss/_reboot.scss +0 -284
  152. package/scss/_root.scss +0 -15
  153. package/scss/_section.scss +0 -977
  154. package/scss/_select.scss +0 -187
  155. package/scss/_tables.scss +0 -735
  156. package/scss/_tabs.scss +0 -178
  157. package/scss/_toast.scss +0 -182
  158. package/scss/_tooltip.scss +0 -101
  159. package/scss/_type.scss +0 -129
  160. package/scss/_utilities.scss +0 -23
  161. package/scss/_variables.scss +0 -823
  162. package/scss/cool-grid.scss +0 -29
  163. package/scss/cool-reboot.scss +0 -11
  164. package/scss/cool.scss +0 -37
  165. package/scss/mixins/_alert-variant.scss +0 -20
  166. package/scss/mixins/_aspect-ratio.scss +0 -29
  167. package/scss/mixins/_background-variant.scss +0 -25
  168. package/scss/mixins/_badge-variant.scss +0 -36
  169. package/scss/mixins/_breakpoints.scss +0 -102
  170. package/scss/mixins/_buttons.scss +0 -104
  171. package/scss/mixins/_caret.scss +0 -80
  172. package/scss/mixins/_clearfix.scss +0 -10
  173. package/scss/mixins/_float.scss +0 -14
  174. package/scss/mixins/_forms.scss +0 -67
  175. package/scss/mixins/_gradients.scss +0 -40
  176. package/scss/mixins/_grid-framework.scss +0 -72
  177. package/scss/mixins/_grid.scss +0 -60
  178. package/scss/mixins/_nav-divider.scss +0 -9
  179. package/scss/mixins/_notification-variant.scss +0 -7
  180. package/scss/mixins/_object-fit.scss +0 -16
  181. package/scss/mixins/_reset-text.scss +0 -19
  182. package/scss/mixins/_text-emphasis.scss +0 -21
  183. package/scss/mixins/_text-hide.scss +0 -10
  184. package/scss/mixins/_text-truncate.scss +0 -81
  185. package/scss/mixins/_visibility.scss +0 -7
  186. package/scss/project.sublime-workspace +0 -491
  187. package/scss/utilities/_align.scss +0 -41
  188. package/scss/utilities/_animate.scss +0 -3512
  189. package/scss/utilities/_background.scss +0 -14
  190. package/scss/utilities/_borders.scss +0 -146
  191. package/scss/utilities/_clearfix.scss +0 -6
  192. package/scss/utilities/_collapse.scss +0 -33
  193. package/scss/utilities/_cursor.scss +0 -22
  194. package/scss/utilities/_display.scss +0 -16
  195. package/scss/utilities/_embed.scss +0 -78
  196. package/scss/utilities/_flex.scss +0 -52
  197. package/scss/utilities/_lazyload.scss +0 -31
  198. package/scss/utilities/_overflow.scss +0 -6
  199. package/scss/utilities/_perfect-scrollbar.scss +0 -141
  200. package/scss/utilities/_placeholder.scss +0 -77
  201. package/scss/utilities/_position.scss +0 -30
  202. package/scss/utilities/_sizing.scss +0 -32
  203. package/scss/utilities/_spacing.scss +0 -92
  204. package/scss/utilities/_text.scss +0 -99
  205. package/scss/utilities/_user-select.scss +0 -14
  206. package/scss/utilities/_visibility.scss +0 -10
package/README.md CHANGED
@@ -1 +1,680 @@
1
- ### Finqu UI
1
+ # Cool UI
2
+
3
+ Build beautiful, responsive web interfaces. Fast, flexible, and effortlessly customizable.
4
+
5
+ Cool UI is a CSS + JavaScript UI toolkit built by [Finqu](https://finqu.com). It provides a comprehensive set of layout primitives, components, and utility classes — all customizable at runtime through CSS custom properties.
6
+
7
+ The JavaScript layer is written in **native ECMAScript** (ES classes, `document.querySelector`, `ResizeObserver`, etc.). A thin jQuery compatibility wrapper is included for legacy support, but **jQuery is not required to use the public API**.
8
+
9
+ ---
10
+
11
+ ## What's in the package
12
+
13
+ When you install `@finqu/cool`, you get the `dist/` folder:
14
+
15
+ ### CSS
16
+
17
+ | File | Description |
18
+ |------|-------------|
19
+ | `dist/css/cool.css` | Full framework — all components, layout, and utilities |
20
+ | `dist/css/cool.min.css` | Minified production build |
21
+ | `dist/css/cool.css.map` | Source map |
22
+ | `dist/css/cool.min.css.map` | Minified source map |
23
+
24
+ ### JavaScript
25
+
26
+ | File | Description |
27
+ |------|-------------|
28
+ | `dist/js/cool.bundle.js` | UMD bundle with all dependencies (jQuery, PerfectScrollbar) included |
29
+ | `dist/js/cool.bundle.min.js` | Minified UMD bundle |
30
+ | `dist/js/cool.esm.js` | ES module build (external jQuery) |
31
+ | `dist/js/cool.esm.min.js` | Minified ES module build |
32
+ | `dist/js/cool.js` | UMD standalone build (external jQuery) |
33
+ | `dist/js/cool.min.js` | Minified UMD standalone |
34
+
35
+ **Bundle vs Standalone:** The `.bundle.js` files include jQuery and PerfectScrollbar for legacy compatibility. The standalone `.js` and `.esm.js` files keep these as external dependencies.
36
+
37
+ ---
38
+
39
+ ## Installation
40
+
41
+ ```bash
42
+ npm install @finqu/cool
43
+ ```
44
+
45
+ ```bash
46
+ yarn add @finqu/cool
47
+ ```
48
+
49
+ ```bash
50
+ pnpm add @finqu/cool
51
+ ```
52
+
53
+ ---
54
+
55
+ ## Quick start
56
+
57
+ ### With a bundler (Webpack, Vite, Rollup, etc.)
58
+
59
+ ```js
60
+ // Import CSS (side-effect import)
61
+ import '@finqu/cool/dist/css/cool.css';
62
+
63
+ // Import JS (ES module)
64
+ import Cool from '@finqu/cool/dist/js/cool.esm.js';
65
+
66
+ // Initialize when DOM is ready
67
+ document.addEventListener('DOMContentLoaded', () => {
68
+ Cool.initialize();
69
+ });
70
+ ```
71
+
72
+ > The ESM build expects jQuery and PerfectScrollbar as external dependencies. The bundle build (`cool.bundle.js`) includes them automatically.
73
+
74
+ ### Without a bundler (script tags)
75
+
76
+ Use the self-contained bundle that includes all dependencies:
77
+
78
+ ```html
79
+ <!DOCTYPE html>
80
+ <html lang="en">
81
+ <head>
82
+ <meta charset="UTF-8">
83
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
84
+ <link rel="stylesheet" href="node_modules/@finqu/cool/dist/css/cool.min.css">
85
+ </head>
86
+ <body>
87
+ <!-- Your markup -->
88
+
89
+ <script src="node_modules/@finqu/cool/dist/js/cool.bundle.min.js"></script>
90
+ <script>
91
+ Cool.initialize();
92
+ </script>
93
+ </body>
94
+ </html>
95
+ ```
96
+
97
+ The UMD bundle exposes a global `Cool` object.
98
+
99
+ ---
100
+
101
+ ## Usage
102
+
103
+ Cool UI uses a flat class naming convention (no BEM nesting in class names). All CSS properties are scoped under the `--cool-*` namespace.
104
+
105
+ ### Grid
106
+
107
+ A 12-column flexbox grid system with responsive breakpoints.
108
+
109
+ ```html
110
+ <div class="container">
111
+ <div class="row">
112
+ <div class="col-6">Half width</div>
113
+ <div class="col-6">Half width</div>
114
+ </div>
115
+ </div>
116
+ ```
117
+
118
+ **Containers:** `.container` (responsive max-width), `.container-fluid` (full width), `.container-content` (content-constrained width).
119
+
120
+ **Responsive columns:** `.col-sm-*`, `.col-md-*`, `.col-lg-*`, `.col-xl-*`
121
+
122
+ **Gutters:** `.g-0` through `.g-6`, `.gx-*` (horizontal), `.gy-*` (vertical). Responsive: `.g-md-3`, etc.
123
+
124
+ **Offsets:** `.offset-1` through `.offset-11`, with responsive variants.
125
+
126
+ ### Buttons
127
+
128
+ ```html
129
+ <button class="btn btn-primary">Primary</button>
130
+ <button class="btn btn-secondary">Secondary</button>
131
+ <button class="btn btn-brand">Brand</button>
132
+ <button class="btn btn-action">Action</button>
133
+ <button class="btn btn-outline-primary">Outline Primary</button>
134
+ <button class="btn btn-outline-secondary">Outline Secondary</button>
135
+ <button class="btn btn-remove">Remove</button>
136
+ <button class="btn btn-link">Link style</button>
137
+ ```
138
+
139
+ **Sizes:** `.btn-xs`, `.btn-sm`, `.btn-lg`
140
+
141
+ **Full width:** `.btn-block`
142
+
143
+ **Icon button** (square, equal width/height):
144
+
145
+ ```html
146
+ <button class="btn btn-icon btn-primary">
147
+ <span class="icon">✕</span>
148
+ </button>
149
+ ```
150
+
151
+ ### Forms
152
+
153
+ ```html
154
+ <div class="form-group">
155
+ <label>Email</label>
156
+ <input type="email" class="form-control" placeholder="you@example.com">
157
+ </div>
158
+ ```
159
+
160
+ **Sizes:** `.form-control-sm`, `.form-control-lg`
161
+
162
+ **Floating labels:**
163
+
164
+ ```html
165
+ <div class="form-label-group label-on-top">
166
+ <input type="text" class="form-control" id="name" placeholder="Name">
167
+ <label for="name">Name</label>
168
+ </div>
169
+ ```
170
+
171
+ **Checkbox:**
172
+
173
+ ```html
174
+ <div class="form-check">
175
+ <input type="checkbox" id="check1">
176
+ <label for="check1">
177
+ <span class="form-check-icon">
178
+ <svg viewBox="0 0 12 10"><polyline points="1.5 6 4.5 9 10.5 1"></polyline></svg>
179
+ </span>
180
+ <span class="form-check-label">Check me</span>
181
+ </label>
182
+ </div>
183
+ ```
184
+
185
+ **Switch:**
186
+
187
+ ```html
188
+ <div class="form-switch">
189
+ <input type="checkbox" class="form-switch-input" id="switch1">
190
+ <label class="form-switch-label" for="switch1"></label>
191
+ </div>
192
+ ```
193
+
194
+ **Validation:** Add `.is-valid` or `.is-invalid` to `.form-control` or `.input-group`. Pair with `.valid-feedback` / `.invalid-feedback`.
195
+
196
+ ### Dropdown (requires JS)
197
+
198
+ ```html
199
+ <div class="dropdown">
200
+ <button data-toggle="dropdown" class="btn btn-secondary">
201
+ Menu
202
+ </button>
203
+ <div class="dropdown-menu">
204
+ <a class="dropdown-item" href="#">Action</a>
205
+ <a class="dropdown-item" href="#">Another action</a>
206
+ <div class="dropdown-divider"></div>
207
+ <a class="dropdown-item" href="#">Separated link</a>
208
+ </div>
209
+ </div>
210
+ ```
211
+
212
+ ### Dialog (requires JS)
213
+
214
+ Dialogs are created programmatically. `Cool.initialize()` creates a Dialog singleton on `document.body`.
215
+
216
+ **Native:**
217
+
218
+ ```js
219
+ const dialog = Cool.Dialog.instances[0];
220
+
221
+ dialog.init({
222
+ title: 'Confirm action',
223
+ body: '<p>Are you sure?</p>',
224
+ size: 'sm', // '', 'sm', 'md', 'lg', 'xl', 'full'
225
+ centered: true,
226
+ callbacks: {
227
+ confirm: function(done) {
228
+ // Perform action, then close
229
+ done();
230
+ },
231
+ close: function(done) {
232
+ done();
233
+ }
234
+ },
235
+ actions: {
236
+ confirm: { content: 'Yes, confirm' },
237
+ close: { content: 'Cancel' }
238
+ }
239
+ });
240
+ ```
241
+
242
+ **Legacy jQuery wrapper:**
243
+
244
+ ```js
245
+ const dialog = $('body').data('plugin_coolDialog');
246
+ dialog.init({ title: 'Confirm', body: '<p>Are you sure?</p>' });
247
+ ```
248
+
249
+ ### Toast (requires JS)
250
+
251
+ Toasts are created programmatically. `Cool.initialize()` creates a Toast singleton on `document.body`.
252
+
253
+ **Native:**
254
+
255
+ ```js
256
+ const toast = Cool.Toast.instances[0];
257
+
258
+ toast.init({
259
+ content: 'Settings saved successfully',
260
+ theme: 'dark', // 'dark' or 'light'
261
+ placement: 'bottom-center',
262
+ dismiss: 3 // auto-dismiss in seconds
263
+ });
264
+ ```
265
+
266
+ **Legacy jQuery wrapper:**
267
+
268
+ ```js
269
+ const toast = $('body').data('plugin_coolToast');
270
+ toast.init({ content: 'Settings saved successfully' });
271
+ ```
272
+
273
+ ### Tooltip (requires JS)
274
+
275
+ ```html
276
+ <button data-toggle="tooltip" data-content="Helpful tip" data-placement="top">
277
+ Hover me
278
+ </button>
279
+ ```
280
+
281
+ Tooltips are auto-initialized by `Cool.initialize()`.
282
+
283
+ ### Popover (requires JS)
284
+
285
+ ```html
286
+ <button data-toggle="popover"
287
+ data-title="Popover title"
288
+ data-content="Popover body content"
289
+ data-placement="bottom"
290
+ data-trigger="click">
291
+ Click me
292
+ </button>
293
+ ```
294
+
295
+ ### Collapse (requires JS)
296
+
297
+ ```html
298
+ <button data-toggle="collapse" data-target="#collapseContent" aria-expanded="false">
299
+ Toggle content
300
+ </button>
301
+ <div id="collapseContent" class="collapse">
302
+ <p>Collapsible content here.</p>
303
+ </div>
304
+ ```
305
+
306
+ ### Select (requires JS)
307
+
308
+ The custom select component replaces native selects with a searchable, styled dropdown:
309
+
310
+ ```html
311
+ <div class="select-container" data-toggle="select" data-name="category" data-type="radio">
312
+ <div class="select">
313
+ <div class="select-header">
314
+ <span class="select-title">Choose…</span>
315
+ <span class="select-icon">▾</span>
316
+ </div>
317
+ <!-- Items are rendered by JS -->
318
+ </div>
319
+ </div>
320
+ ```
321
+
322
+ ### Tables
323
+
324
+ ```html
325
+ <table class="table">
326
+ <thead>
327
+ <tr>
328
+ <th>Name</th>
329
+ <th>Status</th>
330
+ </tr>
331
+ </thead>
332
+ <tbody>
333
+ <tr>
334
+ <td>Item one</td>
335
+ <td><span class="badge badge-success badge-sm">Active</span></td>
336
+ </tr>
337
+ </tbody>
338
+ </table>
339
+ ```
340
+
341
+ **Variants:** `.table-sm`, `.table-borderless`, `.table-hover`, `.table-striped`
342
+
343
+ ### Badges
344
+
345
+ ```html
346
+ <span class="badge badge-primary">Default</span>
347
+ <span class="badge badge-success badge-sm">Active</span>
348
+ <span class="badge badge-outline-danger badge-xs">Urgent</span>
349
+ ```
350
+
351
+ **Themes:** `.badge-primary`, `.badge-secondary`, `.badge-success`, `.badge-info`, `.badge-warning`, `.badge-danger`, `.badge-light`, `.badge-medium`, `.badge-dark`, `.badge-brand`
352
+
353
+ **Outline:** `.badge-outline-primary`, `.badge-outline-danger`, etc.
354
+
355
+ **Sizes:** `.badge-xs`, `.badge-sm`
356
+
357
+ ### Alerts & Notifications
358
+
359
+ ```html
360
+ <div class="alert alert-info">
361
+ <div class="alert-icon">
362
+ <span class="icon">ℹ</span>
363
+ </div>
364
+ <div class="alert-content-container">
365
+ <div class="alert-content">This is an informational alert.</div>
366
+ </div>
367
+ </div>
368
+ ```
369
+
370
+ **Themes:** `.alert-primary`, `.alert-secondary`, `.alert-success`, `.alert-info`, `.alert-warning`, `.alert-danger`, etc.
371
+
372
+ ### List Group
373
+
374
+ ```html
375
+ <div class="list-group list-group-bordered list-group-hover">
376
+ <div class="list-group-item">Item one</div>
377
+ <div class="list-group-item">Item two</div>
378
+ <div class="list-group-item">Item three</div>
379
+ </div>
380
+ ```
381
+
382
+ ### Pagination
383
+
384
+ ```html
385
+ <ul class="pagination">
386
+ <li class="page-item disabled"><a class="page-link" href="#">‹</a></li>
387
+ <li class="page-item active"><a class="page-link" href="#">1</a></li>
388
+ <li class="page-item"><a class="page-link" href="#">2</a></li>
389
+ <li class="page-item"><a class="page-link" href="#">3</a></li>
390
+ <li class="page-item"><a class="page-link" href="#">›</a></li>
391
+ </ul>
392
+ ```
393
+
394
+ ### Sections
395
+
396
+ Sections are card-like content containers:
397
+
398
+ ```html
399
+ <div class="section">
400
+ <div class="section-title">
401
+ <div class="title"><p>Section title</p></div>
402
+ </div>
403
+ <div class="section-content">
404
+ <p>Section body content.</p>
405
+ </div>
406
+ </div>
407
+ ```
408
+
409
+ ---
410
+
411
+ ## JavaScript initialization
412
+
413
+ Cool UI's JavaScript is written in native ECMAScript. A jQuery compatibility wrapper is included for legacy support. All public APIs are available through the global `Cool` object.
414
+
415
+ ### Full initialization
416
+
417
+ ```js
418
+ Cool.initialize({
419
+ // Optional per-component settings
420
+ popover: { /* Popover defaults */ },
421
+ dropdown: { /* Dropdown defaults */ },
422
+ tooltip: { /* Tooltip defaults */ },
423
+ select: { /* Select defaults */ },
424
+ collapse: { /* Collapse defaults */ },
425
+ sidebar: { /* Sidebar defaults */ },
426
+ toast: { /* Toast defaults */ },
427
+ dialog: { /* Dialog defaults */ }
428
+ });
429
+ ```
430
+
431
+ `Cool.initialize()` scans the DOM for `data-toggle` attributes and instantiates the matching component:
432
+
433
+ | `data-toggle` value | Component |
434
+ |---------------------|-----------|
435
+ | `popover` | Popover |
436
+ | `dropdown` | Dropdown |
437
+ | `tooltip` | Tooltip |
438
+ | `select` | Select |
439
+ | `collapse` | Collapse |
440
+ | `section-tabs` | SectionTabs |
441
+
442
+ **Dialog** and **Toast** are initialized on `document.body` and used programmatically.
443
+
444
+ ### Initializing dynamically added content
445
+
446
+ After adding HTML to the DOM, initialize new `data-toggle` elements:
447
+
448
+ ```js
449
+ Cool.initComponent('#my-new-container');
450
+ // or
451
+ Cool.initComponent(document.getElementById('my-new-container'));
452
+ ```
453
+
454
+ ### Re-initializing after DOM changes
455
+
456
+ ```js
457
+ Cool.refresh();
458
+ ```
459
+
460
+ ### Global API
461
+
462
+ All methods are available directly on the `Cool` global:
463
+
464
+ ```js
465
+ Cool.initialize(opts) // Initialize all components
466
+ Cool.refresh() // Re-scan DOM for new data-toggle elements
467
+ Cool.initComponent(selector) // Initialize components within a container
468
+ Cool.destroy() // Tear down all components
469
+ Cool.getSidebar() // Returns the Sidebar instance
470
+ Cool.getSection() // Returns the Section instance
471
+ Cool.observeResize(el, cb) // Watch element for size changes
472
+ Cool.unobserveResize(el) // Stop watching
473
+ Cool.addScrollListener(id, cb) // Register a scroll handler
474
+ Cool.removeScrollListener(id) // Unregister a scroll handler
475
+ ```
476
+
477
+ ### Accessing component instances
478
+
479
+ Every component class has a static `instances` array. Singletons like Dialog and Toast
480
+ have one entry; per-element components (Dropdown, Tooltip, etc.) have one entry per element.
481
+
482
+ **Native:**
483
+
484
+ ```js
485
+ // Singletons (one instance on document.body)
486
+ const dialog = Cool.Dialog.instances[0];
487
+ const toast = Cool.Toast.instances[0];
488
+
489
+ // Per-element components
490
+ const dropdowns = Cool.Dropdown.instances; // all Dropdown instances
491
+ const tooltips = Cool.Tooltip.instances; // all Tooltip instances
492
+
493
+ // Sidebar & Section (dedicated getters)
494
+ const sidebar = Cool.getSidebar();
495
+ const section = Cool.getSection();
496
+ ```
497
+
498
+ **Legacy jQuery wrapper:**
499
+
500
+ ```js
501
+ // Per-element
502
+ const dropdown = $(element).data('plugin_coolDropdown');
503
+ dropdown.show();
504
+ dropdown.close();
505
+ dropdown.destroy();
506
+
507
+ const tooltip = $(element).data('plugin_coolTooltip');
508
+ tooltip.show();
509
+ tooltip.close();
510
+
511
+ // Singletons
512
+ const toast = $('body').data('plugin_coolToast');
513
+ const dialog = $('body').data('plugin_coolDialog');
514
+ ```
515
+
516
+ ### Component lifecycle callbacks
517
+
518
+ All components support lifecycle callbacks:
519
+
520
+ ```js
521
+ Cool.initialize({
522
+ dropdown: {
523
+ onInit: function() { /* Fired when initialized */ },
524
+ onShow: function() { /* Fired when shown */ },
525
+ onClose: function() { /* Fired when closed */ },
526
+ onDestroy: function() { /* Fired when destroyed */ }
527
+ }
528
+ });
529
+ ```
530
+
531
+ ### Utility helpers
532
+
533
+ ```js
534
+ // Observe element resize
535
+ Cool.observeResize(element, (entry) => { /* ... */ });
536
+ Cool.unobserveResize(element);
537
+
538
+ // Scroll listeners
539
+ Cool.addScrollListener('my-id', () => { /* ... */ });
540
+ Cool.removeScrollListener('my-id');
541
+ ```
542
+
543
+ ---
544
+
545
+ ## Customization
546
+
547
+ Cool UI exposes **hundreds of CSS custom properties** on `:root`, all prefixed with `--cool-*`. Since consumers use the compiled CSS output, customization is done by overriding these properties — **not** by modifying Sass variables.
548
+
549
+ ### Overriding CSS custom properties
550
+
551
+ ```css
552
+ :root {
553
+ /* Theme colors */
554
+ --cool-theme-color-primary: #1a56db;
555
+ --cool-theme-foreground-color-primary: #ffffff;
556
+ --cool-theme-color-brand: #ff6600;
557
+
558
+ /* Typography */
559
+ --cool-font-family-base: 'Inter', sans-serif;
560
+ --cool-font-size-base: 15px;
561
+
562
+ /* Spacing */
563
+ --cool-spacer: 1rem;
564
+
565
+ /* Border radius */
566
+ --cool-border-radius: 8px;
567
+ --cool-section-border-radius: 12px;
568
+
569
+ /* Buttons */
570
+ --cool-btn-border-radius: 6px;
571
+ --cool-btn-font-weight: 600;
572
+
573
+ /* Inputs */
574
+ --cool-input-border-radius: 6px;
575
+ --cool-input-border-color: #d0d5dd;
576
+
577
+ /* Shadows */
578
+ --cool-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
579
+ }
580
+ ```
581
+
582
+ ### Key customization categories
583
+
584
+ | Category | Example properties |
585
+ |----------|-------------------|
586
+ | **Colors** | `--cool-theme-color-primary`, `--cool-theme-color-secondary`, `--cool-theme-color-success`, `--cool-theme-color-danger`, `--cool-theme-color-brand` |
587
+ | **Grey scale** | `--cool-color-grey-50` through `--cool-color-grey-950` |
588
+ | **Typography** | `--cool-font-family-base`, `--cool-font-size-base`, `--cool-font-weight-base`, `--cool-line-height-base` |
589
+ | **Headings** | `--cool-h1-font-size` through `--cool-h6-font-size`, `--cool-headings-font-family`, `--cool-headings-font-weight` |
590
+ | **Body** | `--cool-body-bg`, `--cool-body-color` |
591
+ | **Links** | `--cool-link-color`, `--cool-link-hover-color` |
592
+ | **Buttons** | `--cool-btn-padding-y`, `--cool-btn-padding-x`, `--cool-btn-font-size`, `--cool-btn-border-radius` |
593
+ | **Forms** | `--cool-input-height`, `--cool-input-bg`, `--cool-input-border-color`, `--cool-input-border-radius` |
594
+ | **Grid** | `--cool-grid-columns`, `--cool-grid-gutter-x`, `--cool-grid-gutter-y` |
595
+ | **Sections** | `--cool-section-border-radius`, `--cool-section-bg`, `--cool-section-border-color` |
596
+ | **Navbar** | `--cool-navbar-bg`, `--cool-navbar-height`, `--cool-navbar-color` |
597
+ | **Dialog** | `--cool-dialog-bg`, `--cool-dialog-width`, `--cool-dialog-padding-x` |
598
+ | **Dropdown** | `--cool-dropdown-bg`, `--cool-dropdown-border-radius`, `--cool-dropdown-box-shadow` |
599
+ | **Toast** | `--cool-toast-bg-dark`, `--cool-toast-bg-light`, `--cool-toast-border-radius` |
600
+ | **Tooltip** | `--cool-tooltip-bg`, `--cool-tooltip-color`, `--cool-tooltip-border-radius` |
601
+ | **Badge** | `--cool-badge-font-size`, `--cool-badge-border-radius`, `--cool-badge-padding-y` |
602
+ | **Shadows** | `--cool-box-shadow-sm`, `--cool-box-shadow`, `--cool-box-shadow-lg` |
603
+ | **Z-index** | `--cool-zindex-dropdown`, `--cool-zindex-dialog`, `--cool-zindex-toast`, `--cool-zindex-tooltip` |
604
+
605
+ ### Scoped overrides
606
+
607
+ Override properties on a specific element for component-level customization:
608
+
609
+ ```html
610
+ <button class="btn btn-primary" style="--cool-btn-border-radius: 999px;">
611
+ Pill button
612
+ </button>
613
+ ```
614
+
615
+ ### Utility classes
616
+
617
+ Cool UI ships a full set of utility classes:
618
+
619
+ - **Display:** `.d-none`, `.d-flex`, `.d-block`, `.d-inline`, `.d-grid`, plus responsive variants (`.d-md-flex`)
620
+ - **Flexbox:** `.flex-row`, `.flex-column`, `.flex-wrap`, `.justify-content-*`, `.align-items-*`, `.flex-grow-*`, `.flex-shrink-*`
621
+ - **Spacing:** `.m-0` through `.m-6`, `.p-0` through `.p-6`, with directional variants (`.mt-*`, `.px-*`, `.mb-auto`) and responsive variants
622
+ - **Text:** `.text-left`, `.text-center`, `.text-right`, `.text-truncate`, `.text-uppercase`, `.text-lowercase`, `.text-nowrap`, `.font-weight-bold`, `.font-weight-normal`
623
+ - **Background:** `.bg-primary`, `.bg-secondary`, `.bg-success`, `.bg-danger`, etc.
624
+ - **Borders:** `.border`, `.border-0`, `.rounded`, `.rounded-circle`
625
+ - **Sizing:** `.w-100`, `.w-50`, `.h-100`, `.mw-100`
626
+ - **Position:** `.position-relative`, `.position-absolute`, `.position-fixed`, `.position-sticky`
627
+ - **Overflow:** `.overflow-hidden`, `.overflow-auto`, `.overflow-visible`
628
+ - **Visibility:** `.visible`, `.invisible`
629
+ - **Opacity:** `.opacity-0`, `.opacity-25`, `.opacity-50`, `.opacity-75`, `.opacity-100`
630
+ - **Shadows:** `.shadow-sm`, `.shadow`, `.shadow-lg`, `.shadow-none`
631
+ - **Z-index:** `.z-0`, `.z-1`, `.z-2`, `.z-3`
632
+ - **Cursor:** `.cursor-pointer`, `.cursor-default`, `.cursor-grab`
633
+ - **Pointer events:** `.pe-none`, `.pe-auto`
634
+ - **User select:** `.user-select-none`, `.user-select-all`, `.user-select-auto`
635
+ - **Screen readers:** `.sr-only`
636
+
637
+ ---
638
+
639
+ ## CSS layers
640
+
641
+ Cool UI uses CSS `@layer` for cascade management:
642
+
643
+ ```
644
+ reset, base, layout, vendor, icons, components, utilities, app
645
+ ```
646
+
647
+ The `app` layer is reserved for your application styles and has the highest priority by default.
648
+
649
+ ---
650
+
651
+ ## Browser support
652
+
653
+ Defined in `.browserslistrc`:
654
+
655
+ - Chrome ≥ 60
656
+ - Firefox ≥ 60
657
+ - Edge ≥ 79
658
+ - Safari ≥ 12
659
+ - iOS ≥ 12
660
+ - Android ≥ 6
661
+
662
+ ---
663
+
664
+ ## Dependencies
665
+
666
+ Cool UI's JavaScript is written in native ECMAScript. jQuery is used only as a
667
+ legacy compatibility layer for the plugin wrapper pattern.
668
+
669
+ | Dependency | Purpose | Included in bundle | Required for standalone/ESM |
670
+ |------------|---------|-------------------|-----------------------------|
671
+ | [jQuery](https://jquery.com/) ^3.7.1 | Legacy plugin wrapper | ✅ `cool.bundle.js` | Must be provided externally |
672
+ | [PerfectScrollbar](https://github.com/mdbootstrap/perfect-scrollbar) ^1.5.6 | Custom scrollbars | ✅ `cool.bundle.js` | Must be provided externally |
673
+
674
+ ---
675
+
676
+ ## License
677
+
678
+ ISC — see [LICENSE](https://opensource.org/licenses/ISC) for details.
679
+
680
+ Copyright © 2026 [Finqu Oy](https://finqu.com).