arekui 1.0.0 → 2.0.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.
- package/CHANGELOG.md +49 -0
- package/LICENSE +21 -21
- package/README.md +26 -198
- package/arekui.css +5930 -3279
- package/arekui.d.ts +328 -328
- package/arekui.js +817 -450
- package/assets/img/grunge-wall-texture-freepick-kues1.webp +0 -0
- package/assets/img/logo.png +0 -0
- package/dist/css/arekui.base.min.css +1 -0
- package/dist/css/arekui.broadsheet.min.css +1 -0
- package/dist/css/arekui.brutalist.min.css +1 -0
- package/dist/css/arekui.default.min.css +1 -0
- package/dist/css/arekui.full.min.css +1 -0
- package/dist/css/arekui.min.css +1 -0
- package/dist/css/arekui.neo.min.css +1 -0
- package/dist/css/arekui.pixel.min.css +1 -0
- package/dist/js/arekui.min.js +2 -0
- package/package.json +64 -57
- package/scripts/build-css.js +95 -0
- package/scripts/build-custom.js +287 -318
- package/scripts/build-js.js +68 -0
- package/scripts/clean.js +13 -0
- package/scripts/dev.js +97 -0
- package/scripts/imports.js +18 -0
- package/scripts/split.js +256 -0
- package/src/arekui.base.css +63 -0
- package/src/arekui.broadsheet.css +6 -0
- package/src/arekui.brutalist.css +8 -0
- package/src/arekui.core.css +64 -0
- package/src/arekui.css +22 -5
- package/src/arekui.default.css +6 -0
- package/src/arekui.neo.css +8 -0
- package/src/arekui.pixel.css +8 -0
- package/src/base/brutalist-overrides.css +254 -0
- package/src/base/neo-overrides.css +330 -315
- package/src/base/pixel-overrides.css +336 -0
- package/src/base/reset.css +179 -65
- package/src/base/theme-brutalist.css +111 -0
- package/src/base/theme-default.css +184 -0
- package/src/base/theme-neo.css +108 -0
- package/src/base/theme-pixel.css +111 -0
- package/src/base/tokens.css +59 -302
- package/src/components/accordion.css +32 -33
- package/src/components/alert.css +24 -25
- package/src/components/badge.css +31 -32
- package/src/components/breadcrumb.css +31 -32
- package/src/components/broadsheet.css +264 -0
- package/src/components/button.css +102 -101
- package/src/components/card.css +22 -23
- package/src/components/carousel.css +49 -13
- package/src/components/chat.css +77 -76
- package/src/components/description-list.css +34 -0
- package/src/components/docs.css +252 -0
- package/src/components/empty.css +36 -0
- package/src/components/file-upload.css +49 -50
- package/src/components/footer.css +40 -25
- package/src/components/forms.css +67 -68
- package/src/components/heading.css +27 -0
- package/src/components/hero.css +20 -21
- package/src/components/join.css +12 -13
- package/src/components/kbd.css +15 -0
- package/src/components/link.css +22 -23
- package/src/components/loading.css +109 -0
- package/src/components/menu.css +104 -54
- package/src/components/misc.css +94 -55
- package/src/components/modal.css +30 -31
- package/src/components/navbar.css +166 -36
- package/src/components/pagination.css +50 -45
- package/src/components/popover.css +68 -69
- package/src/components/progress.css +17 -18
- package/src/components/prose.css +78 -78
- package/src/components/rating.css +35 -36
- package/src/components/scroll-top.css +34 -34
- package/src/components/segmented.css +44 -0
- package/src/components/sidebar.css +377 -0
- package/src/components/skeleton.css +52 -52
- package/src/components/spinner.css +36 -0
- package/src/components/swap.css +43 -43
- package/src/components/table.css +20 -21
- package/src/components/tabs.css +22 -23
- package/src/components/tag.css +99 -99
- package/src/components/textured.css +52 -32
- package/src/components/timeline.css +32 -33
- package/src/components/toast.css +132 -132
- package/src/components/tooltip.css +22 -23
- package/src/utilities/borders.css +150 -150
- package/src/utilities/brutalist-utilities.css +49 -0
- package/src/utilities/colors.css +79 -71
- package/src/utilities/hover.css +31 -31
- package/src/utilities/layout.css +98 -98
- package/src/utilities/neo-utilities.css +86 -93
- package/src/utilities/pixel-utilities.css +88 -0
- package/src/utilities/responsive.css +131 -126
- package/src/utilities/sizing.css +98 -89
- package/src/utilities/spacing.css +132 -129
- package/src/utilities/typography.css +95 -92
- package/dist/arekui.min.css +0 -1
- package/dist/arekui.min.js +0 -2
- package/src/components/drawer.css +0 -53
package/arekui.d.ts
CHANGED
|
@@ -1,328 +1,328 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* A standalone CSS framework by Andika Rekatias.
|
|
4
|
-
*
|
|
5
|
-
* @example
|
|
6
|
-
* ```html
|
|
7
|
-
* <link rel="stylesheet" href="
|
|
8
|
-
* <script src="
|
|
9
|
-
* ```
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* ```typescript
|
|
13
|
-
* // Set theme
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* // Show toast
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* // Get rating
|
|
20
|
-
* const rating =
|
|
21
|
-
* ```
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
/** Available theme names */
|
|
25
|
-
export type ThemeName = "light" | "dark" | "neo";
|
|
26
|
-
|
|
27
|
-
/** Toast notification type */
|
|
28
|
-
export type ToastType = "info" | "success" | "warning" | "error";
|
|
29
|
-
|
|
30
|
-
/** Toast position on screen */
|
|
31
|
-
export type ToastPosition =
|
|
32
|
-
| "top-left"
|
|
33
|
-
| "top-center"
|
|
34
|
-
| "top-right"
|
|
35
|
-
| "bottom-left"
|
|
36
|
-
| "bottom-center"
|
|
37
|
-
| "bottom-right";
|
|
38
|
-
|
|
39
|
-
/** Options for toast notifications */
|
|
40
|
-
export interface ToastOptions {
|
|
41
|
-
/** Toast type for styling */
|
|
42
|
-
type?: ToastType;
|
|
43
|
-
|
|
44
|
-
/** Auto-dismiss duration in milliseconds (0 = no auto-dismiss, default: 4000) */
|
|
45
|
-
duration?: number;
|
|
46
|
-
|
|
47
|
-
/** Toast position on screen (default: "top-right") */
|
|
48
|
-
position?: ToastPosition;
|
|
49
|
-
|
|
50
|
-
/** Show close button (default: true) */
|
|
51
|
-
closable?: boolean;
|
|
52
|
-
|
|
53
|
-
/** HTML icon content (displayed before message) */
|
|
54
|
-
icon?: string;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/** Options for creating custom events */
|
|
58
|
-
export interface CustomEventOptions<T = unknown> {
|
|
59
|
-
/** Event detail payload */
|
|
60
|
-
detail: T;
|
|
61
|
-
|
|
62
|
-
/** Whether the event bubbles up the DOM (default: true) */
|
|
63
|
-
bubbles?: boolean;
|
|
64
|
-
|
|
65
|
-
/** Whether the event can be canceled (default: false) */
|
|
66
|
-
cancelable?: boolean;
|
|
67
|
-
|
|
68
|
-
/** Whether the event crosses shadow DOM boundaries (default: false) */
|
|
69
|
-
composed?: boolean;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/** Detail payload for ar-rating-change event */
|
|
73
|
-
export interface RatingChangeDetail {
|
|
74
|
-
/** The selected rating value (0-5) */
|
|
75
|
-
value: number;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
/** Detail payload for ar-file-change event */
|
|
79
|
-
export interface FileChangeDetail {
|
|
80
|
-
/** The selected files */
|
|
81
|
-
files: FileList;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* Custom event dispatched when rating changes
|
|
86
|
-
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent | CustomEvent}
|
|
87
|
-
*/
|
|
88
|
-
export interface RatingChangeEvent extends CustomEvent<RatingChangeDetail> {
|
|
89
|
-
type: "ar-rating-change";
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Custom event dispatched when files are selected
|
|
94
|
-
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent | CustomEvent}
|
|
95
|
-
*/
|
|
96
|
-
export interface FileChangeEvent extends CustomEvent<FileChangeDetail> {
|
|
97
|
-
type: "ar-file-change";
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
* @description Provides theme management, toast notifications,
|
|
104
|
-
* rating controls, popover management, and initialization.
|
|
105
|
-
*
|
|
106
|
-
* @example
|
|
107
|
-
* ```html
|
|
108
|
-
* <script>
|
|
109
|
-
* // Theme management
|
|
110
|
-
*
|
|
111
|
-
* console.log(
|
|
112
|
-
*
|
|
113
|
-
* // Toast notifications
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
* // Rating
|
|
117
|
-
* const container = document.querySelector("[data-ar-rating]");
|
|
118
|
-
*
|
|
119
|
-
* console.log(
|
|
120
|
-
*
|
|
121
|
-
* // Popover
|
|
122
|
-
*
|
|
123
|
-
* </script>
|
|
124
|
-
* ```
|
|
125
|
-
*/
|
|
126
|
-
export interface
|
|
127
|
-
/**
|
|
128
|
-
* Set the active theme
|
|
129
|
-
*
|
|
130
|
-
* @param theme - The theme to activate
|
|
131
|
-
*
|
|
132
|
-
* @example
|
|
133
|
-
* ```typescript
|
|
134
|
-
*
|
|
135
|
-
*
|
|
136
|
-
* ```
|
|
137
|
-
*/
|
|
138
|
-
setTheme(theme: ThemeName): void;
|
|
139
|
-
|
|
140
|
-
/**
|
|
141
|
-
* Get the currently active theme
|
|
142
|
-
*
|
|
143
|
-
* @returns The current theme name, or null if no theme is set
|
|
144
|
-
*
|
|
145
|
-
* @example
|
|
146
|
-
* ```typescript
|
|
147
|
-
* const current =
|
|
148
|
-
* if (current === "dark") {
|
|
149
|
-
* // Dark theme is active
|
|
150
|
-
* }
|
|
151
|
-
* ```
|
|
152
|
-
*/
|
|
153
|
-
getTheme(): ThemeName | null;
|
|
154
|
-
|
|
155
|
-
/**
|
|
156
|
-
* Initialize theme from localStorage or system preference
|
|
157
|
-
*
|
|
158
|
-
* @description Checks localStorage for a saved theme, falls back to
|
|
159
|
-
* prefers-color-scheme media query, defaults to "light"
|
|
160
|
-
*
|
|
161
|
-
* @example
|
|
162
|
-
* ```typescript
|
|
163
|
-
* // Usually called automatically, but can be called manually
|
|
164
|
-
*
|
|
165
|
-
* ```
|
|
166
|
-
*/
|
|
167
|
-
initTheme(): void;
|
|
168
|
-
|
|
169
|
-
/**
|
|
170
|
-
* Initialize all
|
|
171
|
-
*
|
|
172
|
-
* @description Sets up event listeners for theme toggle, modals,
|
|
173
|
-
* tabs, dropdowns, accordion, ratings, popovers, file uploads, and scroll-to-top
|
|
174
|
-
*
|
|
175
|
-
* @example
|
|
176
|
-
* ```typescript
|
|
177
|
-
* // Called automatically on DOMContentLoaded
|
|
178
|
-
* // Call manually if adding elements dynamically
|
|
179
|
-
*
|
|
180
|
-
* ```
|
|
181
|
-
*/
|
|
182
|
-
init(): void;
|
|
183
|
-
|
|
184
|
-
/**
|
|
185
|
-
* Show a toast notification
|
|
186
|
-
*
|
|
187
|
-
* @param message - Toast message text
|
|
188
|
-
* @param options - Toast configuration options
|
|
189
|
-
* @returns The toast DOM element (can be used with dismissToast)
|
|
190
|
-
*
|
|
191
|
-
* @example
|
|
192
|
-
* ```typescript
|
|
193
|
-
* // Basic toast
|
|
194
|
-
*
|
|
195
|
-
*
|
|
196
|
-
* // Success toast with custom duration
|
|
197
|
-
*
|
|
198
|
-
* type: "success",
|
|
199
|
-
* duration: 5000
|
|
200
|
-
* });
|
|
201
|
-
*
|
|
202
|
-
* // Persistent toast (no auto-dismiss)
|
|
203
|
-
* const loading =
|
|
204
|
-
*
|
|
205
|
-
* // Dismiss programmatically
|
|
206
|
-
*
|
|
207
|
-
* ```
|
|
208
|
-
*/
|
|
209
|
-
toast(message: string, options?: ToastOptions): HTMLElement;
|
|
210
|
-
|
|
211
|
-
/**
|
|
212
|
-
* Dismiss a toast element
|
|
213
|
-
*
|
|
214
|
-
* @param el - The toast element to dismiss
|
|
215
|
-
*
|
|
216
|
-
* @example
|
|
217
|
-
* ```typescript
|
|
218
|
-
* const toast =
|
|
219
|
-
* // ... later
|
|
220
|
-
*
|
|
221
|
-
* ```
|
|
222
|
-
*/
|
|
223
|
-
dismissToast(el: HTMLElement): void;
|
|
224
|
-
|
|
225
|
-
/**
|
|
226
|
-
* Get the current rating value from a rating container
|
|
227
|
-
*
|
|
228
|
-
* @param container - The rating container element (with data-ar-rating attribute)
|
|
229
|
-
* @returns The selected rating value (0-5), or 0 if nothing is selected
|
|
230
|
-
*
|
|
231
|
-
* @example
|
|
232
|
-
* ```typescript
|
|
233
|
-
* const container = document.querySelector("[data-ar-rating]");
|
|
234
|
-
* const rating =
|
|
235
|
-
* console.log(`Selected rating: ${rating}`);
|
|
236
|
-
* ```
|
|
237
|
-
*/
|
|
238
|
-
getRating(container: HTMLElement): number;
|
|
239
|
-
|
|
240
|
-
/**
|
|
241
|
-
* Set rating programmatically
|
|
242
|
-
*
|
|
243
|
-
* @param container - The rating container element (with data-ar-rating attribute)
|
|
244
|
-
* @param value - Rating value (0-5)
|
|
245
|
-
*
|
|
246
|
-
* @example
|
|
247
|
-
* ```typescript
|
|
248
|
-
* const container = document.querySelector("[data-ar-rating]");
|
|
249
|
-
*
|
|
250
|
-
* ```
|
|
251
|
-
*/
|
|
252
|
-
setRating(container: HTMLElement, value: number): void;
|
|
253
|
-
|
|
254
|
-
/**
|
|
255
|
-
* Open a popover by ID
|
|
256
|
-
*
|
|
257
|
-
* @param id - The popover content element ID
|
|
258
|
-
*
|
|
259
|
-
* @example
|
|
260
|
-
* ```html
|
|
261
|
-
* <div class="ar-popover">
|
|
262
|
-
* <button>Click me</button>
|
|
263
|
-
* <div class="ar-popover-content" id="my-popover">
|
|
264
|
-
* Popover content
|
|
265
|
-
* </div>
|
|
266
|
-
* </div>
|
|
267
|
-
* ```
|
|
268
|
-
*
|
|
269
|
-
* ```typescript
|
|
270
|
-
*
|
|
271
|
-
* ```
|
|
272
|
-
*/
|
|
273
|
-
openPopover(id: string): void;
|
|
274
|
-
|
|
275
|
-
/**
|
|
276
|
-
* Close a popover by ID
|
|
277
|
-
*
|
|
278
|
-
* @param id - The popover content element ID
|
|
279
|
-
*
|
|
280
|
-
* @example
|
|
281
|
-
* ```typescript
|
|
282
|
-
*
|
|
283
|
-
* ```
|
|
284
|
-
*/
|
|
285
|
-
closePopover(id: string): void;
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
/**
|
|
289
|
-
*
|
|
290
|
-
*
|
|
291
|
-
* @description Provides access to all
|
|
292
|
-
* when using the script tag approach (no module system)
|
|
293
|
-
*
|
|
294
|
-
* @see {@link
|
|
295
|
-
*/
|
|
296
|
-
declare global {
|
|
297
|
-
interface Window {
|
|
298
|
-
/**
|
|
299
|
-
*
|
|
300
|
-
*
|
|
301
|
-
* @example
|
|
302
|
-
* ```html
|
|
303
|
-
* <script src="
|
|
304
|
-
* <script>
|
|
305
|
-
*
|
|
306
|
-
*
|
|
307
|
-
* </script>
|
|
308
|
-
* ```
|
|
309
|
-
*/
|
|
310
|
-
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
/**
|
|
315
|
-
*
|
|
316
|
-
*
|
|
317
|
-
* @example
|
|
318
|
-
* ```typescript
|
|
319
|
-
* // ES Module import
|
|
320
|
-
* import
|
|
321
|
-
*
|
|
322
|
-
*
|
|
323
|
-
* ```
|
|
324
|
-
*/
|
|
325
|
-
declare const
|
|
326
|
-
|
|
327
|
-
export default
|
|
328
|
-
export {
|
|
1
|
+
/**
|
|
2
|
+
* ArekUI v2.0.0
|
|
3
|
+
* A standalone CSS framework by Andika Rekatias.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```html
|
|
7
|
+
* <link rel="stylesheet" href="arekui.css">
|
|
8
|
+
* <script src="arekui.js"></script>
|
|
9
|
+
* ```
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* // Set theme
|
|
14
|
+
* ArekUI.setTheme("dark");
|
|
15
|
+
*
|
|
16
|
+
* // Show toast
|
|
17
|
+
* ArekUI.toast("Saved!", { type: "success", duration: 4000 });
|
|
18
|
+
*
|
|
19
|
+
* // Get rating
|
|
20
|
+
* const rating = ArekUI.getRating(document.querySelector("[data-ar-rating]"));
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
/** Available theme names */
|
|
25
|
+
export type ThemeName = "light" | "dark" | "neo" | "pixel" | "brutalist";
|
|
26
|
+
|
|
27
|
+
/** Toast notification type */
|
|
28
|
+
export type ToastType = "info" | "success" | "warning" | "error";
|
|
29
|
+
|
|
30
|
+
/** Toast position on screen */
|
|
31
|
+
export type ToastPosition =
|
|
32
|
+
| "top-left"
|
|
33
|
+
| "top-center"
|
|
34
|
+
| "top-right"
|
|
35
|
+
| "bottom-left"
|
|
36
|
+
| "bottom-center"
|
|
37
|
+
| "bottom-right";
|
|
38
|
+
|
|
39
|
+
/** Options for toast notifications */
|
|
40
|
+
export interface ToastOptions {
|
|
41
|
+
/** Toast type for styling (default: "info") */
|
|
42
|
+
type?: ToastType;
|
|
43
|
+
|
|
44
|
+
/** Auto-dismiss duration in milliseconds (0 = no auto-dismiss, default: 4000) */
|
|
45
|
+
duration?: number;
|
|
46
|
+
|
|
47
|
+
/** Toast position on screen (default: "top-right") */
|
|
48
|
+
position?: ToastPosition;
|
|
49
|
+
|
|
50
|
+
/** Show close button (default: true) */
|
|
51
|
+
closable?: boolean;
|
|
52
|
+
|
|
53
|
+
/** HTML icon content (displayed before message) */
|
|
54
|
+
icon?: string;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** Options for creating custom events */
|
|
58
|
+
export interface CustomEventOptions<T = unknown> {
|
|
59
|
+
/** Event detail payload */
|
|
60
|
+
detail: T;
|
|
61
|
+
|
|
62
|
+
/** Whether the event bubbles up the DOM (default: true) */
|
|
63
|
+
bubbles?: boolean;
|
|
64
|
+
|
|
65
|
+
/** Whether the event can be canceled (default: false) */
|
|
66
|
+
cancelable?: boolean;
|
|
67
|
+
|
|
68
|
+
/** Whether the event crosses shadow DOM boundaries (default: false) */
|
|
69
|
+
composed?: boolean;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/** Detail payload for ar-rating-change event */
|
|
73
|
+
export interface RatingChangeDetail {
|
|
74
|
+
/** The selected rating value (0-5) */
|
|
75
|
+
value: number;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/** Detail payload for ar-file-change event */
|
|
79
|
+
export interface FileChangeDetail {
|
|
80
|
+
/** The selected files */
|
|
81
|
+
files: FileList;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Custom event dispatched when rating changes
|
|
86
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent | CustomEvent}
|
|
87
|
+
*/
|
|
88
|
+
export interface RatingChangeEvent extends CustomEvent<RatingChangeDetail> {
|
|
89
|
+
type: "ar-rating-change";
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Custom event dispatched when files are selected
|
|
94
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent | CustomEvent}
|
|
95
|
+
*/
|
|
96
|
+
export interface FileChangeEvent extends CustomEvent<FileChangeDetail> {
|
|
97
|
+
type: "ar-file-change";
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* ArekUI public API
|
|
102
|
+
*
|
|
103
|
+
* @description Provides theme management, toast notifications,
|
|
104
|
+
* rating controls, popover management, and initialization.
|
|
105
|
+
*
|
|
106
|
+
* @example
|
|
107
|
+
* ```html
|
|
108
|
+
* <script>
|
|
109
|
+
* // Theme management
|
|
110
|
+
* ArekUI.setTheme("neo");
|
|
111
|
+
* console.log(ArekUI.getTheme()); // "neo"
|
|
112
|
+
*
|
|
113
|
+
* // Toast notifications
|
|
114
|
+
* ArekUI.toast("Item saved!", { type: "success" });
|
|
115
|
+
*
|
|
116
|
+
* // Rating
|
|
117
|
+
* const container = document.querySelector("[data-ar-rating]");
|
|
118
|
+
* ArekUI.setRating(container, 4);
|
|
119
|
+
* console.log(ArekUI.getRating(container)); // 4
|
|
120
|
+
*
|
|
121
|
+
* // Popover
|
|
122
|
+
* ArekUI.openPopover("my-popover");
|
|
123
|
+
* </script>
|
|
124
|
+
* ```
|
|
125
|
+
*/
|
|
126
|
+
export interface ArekUIStatic {
|
|
127
|
+
/**
|
|
128
|
+
* Set the active theme
|
|
129
|
+
*
|
|
130
|
+
* @param theme - The theme to activate
|
|
131
|
+
*
|
|
132
|
+
* @example
|
|
133
|
+
* ```typescript
|
|
134
|
+
* ArekUI.setTheme("dark");
|
|
135
|
+
* ArekUI.setTheme("neo");
|
|
136
|
+
* ```
|
|
137
|
+
*/
|
|
138
|
+
setTheme(theme: ThemeName): void;
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Get the currently active theme
|
|
142
|
+
*
|
|
143
|
+
* @returns The current theme name, or null if no theme is set
|
|
144
|
+
*
|
|
145
|
+
* @example
|
|
146
|
+
* ```typescript
|
|
147
|
+
* const current = ArekUI.getTheme();
|
|
148
|
+
* if (current === "dark") {
|
|
149
|
+
* // Dark theme is active
|
|
150
|
+
* }
|
|
151
|
+
* ```
|
|
152
|
+
*/
|
|
153
|
+
getTheme(): ThemeName | null;
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Initialize theme from localStorage or system preference
|
|
157
|
+
*
|
|
158
|
+
* @description Checks localStorage for a saved theme, falls back to
|
|
159
|
+
* prefers-color-scheme media query, defaults to "light"
|
|
160
|
+
*
|
|
161
|
+
* @example
|
|
162
|
+
* ```typescript
|
|
163
|
+
* // Usually called automatically, but can be called manually
|
|
164
|
+
* ArekUI.initTheme();
|
|
165
|
+
* ```
|
|
166
|
+
*/
|
|
167
|
+
initTheme(): void;
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Initialize all ArekUI behaviors
|
|
171
|
+
*
|
|
172
|
+
* @description Sets up event listeners for theme toggle, modals, sidebars,
|
|
173
|
+
* tabs, dropdowns, accordion, ratings, popovers, file uploads, and scroll-to-top
|
|
174
|
+
*
|
|
175
|
+
* @example
|
|
176
|
+
* ```typescript
|
|
177
|
+
* // Called automatically on DOMContentLoaded
|
|
178
|
+
* // Call manually if adding elements dynamically
|
|
179
|
+
* ArekUI.init();
|
|
180
|
+
* ```
|
|
181
|
+
*/
|
|
182
|
+
init(): void;
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Show a toast notification
|
|
186
|
+
*
|
|
187
|
+
* @param message - Toast message text
|
|
188
|
+
* @param options - Toast configuration options
|
|
189
|
+
* @returns The toast DOM element (can be used with dismissToast)
|
|
190
|
+
*
|
|
191
|
+
* @example
|
|
192
|
+
* ```typescript
|
|
193
|
+
* // Basic toast
|
|
194
|
+
* ArekUI.toast("Hello world!");
|
|
195
|
+
*
|
|
196
|
+
* // Success toast with custom duration
|
|
197
|
+
* ArekUI.toast("Saved successfully!", {
|
|
198
|
+
* type: "success",
|
|
199
|
+
* duration: 5000
|
|
200
|
+
* });
|
|
201
|
+
*
|
|
202
|
+
* // Persistent toast (no auto-dismiss)
|
|
203
|
+
* const loading = ArekUI.toast("Loading...", { duration: 0 });
|
|
204
|
+
*
|
|
205
|
+
* // Dismiss programmatically
|
|
206
|
+
* ArekUI.dismissToast(loading);
|
|
207
|
+
* ```
|
|
208
|
+
*/
|
|
209
|
+
toast(message: string, options?: ToastOptions): HTMLElement;
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Dismiss a toast element
|
|
213
|
+
*
|
|
214
|
+
* @param el - The toast element to dismiss
|
|
215
|
+
*
|
|
216
|
+
* @example
|
|
217
|
+
* ```typescript
|
|
218
|
+
* const toast = ArekUI.toast("Processing...");
|
|
219
|
+
* // ... later
|
|
220
|
+
* ArekUI.dismissToast(toast);
|
|
221
|
+
* ```
|
|
222
|
+
*/
|
|
223
|
+
dismissToast(el: HTMLElement): void;
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* Get the current rating value from a rating container
|
|
227
|
+
*
|
|
228
|
+
* @param container - The rating container element (with data-ar-rating attribute)
|
|
229
|
+
* @returns The selected rating value (0-5), or 0 if nothing is selected
|
|
230
|
+
*
|
|
231
|
+
* @example
|
|
232
|
+
* ```typescript
|
|
233
|
+
* const container = document.querySelector("[data-ar-rating]");
|
|
234
|
+
* const rating = ArekUI.getRating(container);
|
|
235
|
+
* console.log(`Selected rating: ${rating}`);
|
|
236
|
+
* ```
|
|
237
|
+
*/
|
|
238
|
+
getRating(container: HTMLElement): number;
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* Set rating programmatically
|
|
242
|
+
*
|
|
243
|
+
* @param container - The rating container element (with data-ar-rating attribute)
|
|
244
|
+
* @param value - Rating value (0-5)
|
|
245
|
+
*
|
|
246
|
+
* @example
|
|
247
|
+
* ```typescript
|
|
248
|
+
* const container = document.querySelector("[data-ar-rating]");
|
|
249
|
+
* ArekUI.setRating(container, 4); // Select 4 stars
|
|
250
|
+
* ```
|
|
251
|
+
*/
|
|
252
|
+
setRating(container: HTMLElement, value: number): void;
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* Open a popover by ID
|
|
256
|
+
*
|
|
257
|
+
* @param id - The popover content element ID
|
|
258
|
+
*
|
|
259
|
+
* @example
|
|
260
|
+
* ```html
|
|
261
|
+
* <div class="ar-popover">
|
|
262
|
+
* <button>Click me</button>
|
|
263
|
+
* <div class="ar-popover-content" id="my-popover">
|
|
264
|
+
* Popover content
|
|
265
|
+
* </div>
|
|
266
|
+
* </div>
|
|
267
|
+
* ```
|
|
268
|
+
*
|
|
269
|
+
* ```typescript
|
|
270
|
+
* ArekUI.openPopover("my-popover");
|
|
271
|
+
* ```
|
|
272
|
+
*/
|
|
273
|
+
openPopover(id: string): void;
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* Close a popover by ID
|
|
277
|
+
*
|
|
278
|
+
* @param id - The popover content element ID
|
|
279
|
+
*
|
|
280
|
+
* @example
|
|
281
|
+
* ```typescript
|
|
282
|
+
* ArekUI.closePopover("my-popover");
|
|
283
|
+
* ```
|
|
284
|
+
*/
|
|
285
|
+
closePopover(id: string): void;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* ArekUI global namespace
|
|
290
|
+
*
|
|
291
|
+
* @description Provides access to all ArekUI public methods
|
|
292
|
+
* when using the script tag approach (no module system)
|
|
293
|
+
*
|
|
294
|
+
* @see {@link ArekUIStatic} for method signatures and examples
|
|
295
|
+
*/
|
|
296
|
+
declare global {
|
|
297
|
+
interface Window {
|
|
298
|
+
/**
|
|
299
|
+
* ArekUI global API
|
|
300
|
+
*
|
|
301
|
+
* @example
|
|
302
|
+
* ```html
|
|
303
|
+
* <script src="arekui.js"></script>
|
|
304
|
+
* <script>
|
|
305
|
+
* ArekUI.setTheme("dark");
|
|
306
|
+
* ArekUI.toast("Hello!");
|
|
307
|
+
* </script>
|
|
308
|
+
* ```
|
|
309
|
+
*/
|
|
310
|
+
ArekUI: ArekUIStatic;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* ArekUI module export
|
|
316
|
+
*
|
|
317
|
+
* @example
|
|
318
|
+
* ```typescript
|
|
319
|
+
* // ES Module import
|
|
320
|
+
* import ArekUI from "arekui";
|
|
321
|
+
*
|
|
322
|
+
* ArekUI.setTheme("neo");
|
|
323
|
+
* ```
|
|
324
|
+
*/
|
|
325
|
+
declare const ArekUI: ArekUIStatic;
|
|
326
|
+
|
|
327
|
+
export default ArekUI;
|
|
328
|
+
export { ArekUI, ArekUIStatic };
|