@lancar/lxui 1.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.
Files changed (94) hide show
  1. package/CHANGELOG.md +88 -0
  2. package/LICENSE +21 -0
  3. package/README.md +5072 -0
  4. package/css/base/reset.css +91 -0
  5. package/css/base/tokens-extended.css +119 -0
  6. package/css/base/tokens.css +105 -0
  7. package/css/base/typography.css +35 -0
  8. package/css/base/utils.css +26 -0
  9. package/css/components/accordion.css +25 -0
  10. package/css/components/alert.css +22 -0
  11. package/css/components/animations.css +26 -0
  12. package/css/components/avatar.css +38 -0
  13. package/css/components/back-top.css +32 -0
  14. package/css/components/badge.css +37 -0
  15. package/css/components/breadcrumb.css +13 -0
  16. package/css/components/button.css +103 -0
  17. package/css/components/callout.css +20 -0
  18. package/css/components/card.css +42 -0
  19. package/css/components/carousel.css +31 -0
  20. package/css/components/chip.css +52 -0
  21. package/css/components/code-block.css +22 -0
  22. package/css/components/collapse.css +6 -0
  23. package/css/components/compat.css +27 -0
  24. package/css/components/dark-mode.css +35 -0
  25. package/css/components/divider.css +36 -0
  26. package/css/components/dropdown.css +39 -0
  27. package/css/components/empty.css +34 -0
  28. package/css/components/fab.css +28 -0
  29. package/css/components/file-drop.css +47 -0
  30. package/css/components/forms.css +107 -0
  31. package/css/components/kbd.css +5 -0
  32. package/css/components/list-group.css +17 -0
  33. package/css/components/modal.css +50 -0
  34. package/css/components/nav.css +25 -0
  35. package/css/components/navbar.css +44 -0
  36. package/css/components/number-input.css +52 -0
  37. package/css/components/offcanvas.css +25 -0
  38. package/css/components/pagination.css +17 -0
  39. package/css/components/popover.css +12 -0
  40. package/css/components/progress.css +26 -0
  41. package/css/components/rating.css +28 -0
  42. package/css/components/section.css +18 -0
  43. package/css/components/skeleton.css +19 -0
  44. package/css/components/spinner.css +38 -0
  45. package/css/components/stat.css +58 -0
  46. package/css/components/steps.css +76 -0
  47. package/css/components/table.css +29 -0
  48. package/css/components/tag.css +29 -0
  49. package/css/components/timeline.css +11 -0
  50. package/css/components/toast.css +14 -0
  51. package/css/components/toggler.css +20 -0
  52. package/css/components/tooltip.css +10 -0
  53. package/css/index.css +59 -0
  54. package/css/layout/grid.css +71 -0
  55. package/css/layout/utilities.css +257 -0
  56. package/js/breakpoint.js +13 -0
  57. package/js/carousel.js +62 -0
  58. package/js/clipboard.js +28 -0
  59. package/js/collapse.js +36 -0
  60. package/js/counter.js +38 -0
  61. package/js/dropdown.js +27 -0
  62. package/js/index.js +19 -0
  63. package/js/init.js +89 -0
  64. package/js/modal.js +44 -0
  65. package/js/number-input.js +44 -0
  66. package/js/offcanvas.js +28 -0
  67. package/js/popover.js +39 -0
  68. package/js/rating.js +39 -0
  69. package/js/scrollspy.js +24 -0
  70. package/js/tab.js +18 -0
  71. package/js/theme.js +9 -0
  72. package/js/toast.js +73 -0
  73. package/js/tooltip.js +39 -0
  74. package/js/utils.js +20 -0
  75. package/lx-grid.min.css +2 -0
  76. package/lx-utilities.min.css +2 -0
  77. package/lxeditor.min.css +2 -0
  78. package/lxfonts.min.css +2 -0
  79. package/lxicons.min.css +2 -0
  80. package/lxmarked.js +276 -0
  81. package/lxthemes.min.css +2 -0
  82. package/lxui.bundle.js +540 -0
  83. package/lxui.bundle.min.js +13 -0
  84. package/lxui.css +2163 -0
  85. package/lxui.esm.js +669 -0
  86. package/lxui.esm.min.js +8 -0
  87. package/lxui.js +859 -0
  88. package/lxui.min.css +2 -0
  89. package/lxui.min.js +7 -0
  90. package/lxui.rtl.css +2466 -0
  91. package/lxui.rtl.min.css +2 -0
  92. package/marked.min.js +69 -0
  93. package/package.json +183 -0
  94. package/types/index.d.ts +284 -0
@@ -0,0 +1,284 @@
1
+ /*!
2
+ * LxUI v1.0.0 — TypeScript Declarations
3
+ * https://ui.lancar.id
4
+ * Copyright (c) 2025 lancar.id — MIT License
5
+ */
6
+
7
+ // ────────────────────────────────────────────────────────────────
8
+ // Option interfaces
9
+ // ────────────────────────────────────────────────────────────────
10
+
11
+ export interface ModalOptions {
12
+ /** Whether clicking the backdrop closes the modal. Default: true */
13
+ backdrop?: boolean;
14
+ /** Whether pressing Escape closes the modal. Default: true */
15
+ keyboard?: boolean;
16
+ /** Whether to trap focus inside the modal. Default: true */
17
+ focus?: boolean;
18
+ }
19
+
20
+ export interface TooltipDelay {
21
+ show?: number;
22
+ hide?: number;
23
+ }
24
+
25
+ export interface TooltipOptions {
26
+ /** Placement of the tooltip. Default: 'top' */
27
+ placement?: 'top' | 'bottom' | 'left' | 'right';
28
+ /** Trigger event(s). Default: 'hover' */
29
+ trigger?: string;
30
+ html?: boolean;
31
+ delay?: TooltipDelay;
32
+ }
33
+
34
+ export interface CarouselOptions {
35
+ /** Auto-slide interval in ms. Default: 5000. Set to 0 to disable. */
36
+ interval?: number;
37
+ /** Pause on hover. Default: 'hover' */
38
+ pause?: 'hover' | false;
39
+ /** Wrap around at ends. Default: true */
40
+ wrap?: boolean;
41
+ /** Enable touch swipe. Default: true */
42
+ touch?: boolean;
43
+ }
44
+
45
+ export interface ToastOptions {
46
+ message?: string;
47
+ title?: string;
48
+ type?: 'default' | 'success' | 'warning' | 'danger' | 'info';
49
+ duration?: number;
50
+ position?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left' | 'top-center' | 'bottom-center';
51
+ }
52
+
53
+ export interface CounterOptions {
54
+ start?: number;
55
+ end?: number;
56
+ duration?: number;
57
+ prefix?: string;
58
+ suffix?: string;
59
+ decimals?: number;
60
+ easing?: boolean;
61
+ }
62
+
63
+ export interface NumberInputOptions {
64
+ step?: number;
65
+ min?: number;
66
+ max?: number;
67
+ }
68
+
69
+ export interface RatingOptions {
70
+ stars?: number;
71
+ value?: number;
72
+ readonly?: boolean;
73
+ }
74
+
75
+ export interface ScrollspyOptions {
76
+ offset?: number;
77
+ }
78
+
79
+ export interface ThemeState {
80
+ theme: string | undefined;
81
+ mode: string | undefined;
82
+ }
83
+
84
+ export interface Breakpoints {
85
+ xs: 0;
86
+ sm: 640;
87
+ md: 768;
88
+ lg: 1024;
89
+ xl: 1280;
90
+ '2xl': 1536;
91
+ }
92
+
93
+ // ────────────────────────────────────────────────────────────────
94
+ // Classes
95
+ // ────────────────────────────────────────────────────────────────
96
+
97
+ /** Modal dialog — show/hide/toggle with backdrop & focus trap */
98
+ export declare class Modal {
99
+ el: Element | null;
100
+ opts: Required<ModalOptions>;
101
+ constructor(sel: string | Element, opts?: ModalOptions);
102
+ show(): void;
103
+ hide(): void;
104
+ toggle(): void;
105
+ }
106
+
107
+ /** Collapse / accordion panel with CSS height animation */
108
+ export declare class Collapse {
109
+ el: Element | null;
110
+ constructor(sel: string | Element);
111
+ show(): void;
112
+ hide(): void;
113
+ toggle(): void;
114
+ }
115
+
116
+ /** Dropdown menu */
117
+ export declare class Dropdown {
118
+ trigger: Element | null;
119
+ menu: Element | null;
120
+ constructor(trigger: string | Element);
121
+ show(): void;
122
+ hide(): void;
123
+ toggle(): void;
124
+ }
125
+
126
+ /** Offcanvas / drawer panel */
127
+ export declare class Offcanvas {
128
+ el: Element | null;
129
+ constructor(sel: string | Element);
130
+ show(): void;
131
+ hide(): void;
132
+ toggle(): void;
133
+ }
134
+
135
+ /** Tooltip — positioned floating label */
136
+ export declare class Tooltip {
137
+ el: Element | null;
138
+ opts: TooltipOptions;
139
+ constructor(el: string | Element, opts?: TooltipOptions);
140
+ }
141
+
142
+ /** Popover — floating panel with title + content */
143
+ export declare class Popover {
144
+ el: Element | null;
145
+ constructor(el: string | Element, opts?: { placement?: string; trigger?: string });
146
+ }
147
+
148
+ /** Tab panel switcher */
149
+ export declare class Tab {
150
+ trigger: Element | null;
151
+ constructor(trigger: string | Element);
152
+ show(): void;
153
+ }
154
+
155
+ /** Scrollspy — highlight nav links based on scroll position */
156
+ export declare class Scrollspy {
157
+ el: Element | null;
158
+ constructor(el: string | Element, opts?: ScrollspyOptions);
159
+ }
160
+
161
+ /** Image/content carousel with touch & keyboard support */
162
+ export declare class Carousel {
163
+ el: Element | null;
164
+ current: number;
165
+ items: Element[];
166
+ opts: Required<CarouselOptions>;
167
+ constructor(sel: string | Element, opts?: CarouselOptions);
168
+ next(): void;
169
+ prev(): void;
170
+ to(index: number): void;
171
+ cycle(): void;
172
+ pause(): void;
173
+ }
174
+
175
+ /** Animated number counter with IntersectionObserver support */
176
+ export declare class Counter {
177
+ el: Element | null;
178
+ opts: CounterOptions;
179
+ constructor(el: string | Element, opts?: CounterOptions);
180
+ start(): void;
181
+ /** Observe all matching elements and start when they enter the viewport */
182
+ static observeAll(sel: string, opts?: CounterOptions): void;
183
+ }
184
+
185
+ /** +/− number input control */
186
+ export declare class NumberInput {
187
+ wrap: Element | null;
188
+ input: HTMLInputElement | null;
189
+ opts: Required<NumberInputOptions>;
190
+ constructor(el: string | Element, opts?: NumberInputOptions);
191
+ }
192
+
193
+ /** Interactive star rating */
194
+ export declare class Rating {
195
+ el: Element | null;
196
+ value: number;
197
+ opts: RatingOptions;
198
+ constructor(el: string | Element, opts?: RatingOptions);
199
+ setValue(value: number): void;
200
+ getValue(): number;
201
+ }
202
+
203
+ // ────────────────────────────────────────────────────────────────
204
+ // Singletons / namespaces
205
+ // ────────────────────────────────────────────────────────────────
206
+
207
+ /** Programmatic toast notifications */
208
+ export declare const Toast: {
209
+ show(opts: ToastOptions): void;
210
+ success(message: string, opts?: Omit<ToastOptions, 'type'>): void;
211
+ error(message: string, opts?: Omit<ToastOptions, 'type'>): void;
212
+ warning(message: string, opts?: Omit<ToastOptions, 'type'>): void;
213
+ info(message: string, opts?: Omit<ToastOptions, 'type'>): void;
214
+ };
215
+
216
+ /** Clipboard copy utility with execCommand fallback */
217
+ export declare const Clipboard: {
218
+ copy(text: string): Promise<void>;
219
+ bind(sel: string, getText?: (btn: Element) => string): void;
220
+ };
221
+
222
+ /** Responsive breakpoint utilities */
223
+ export declare const breakpoint: {
224
+ _bp: Breakpoints;
225
+ /** Returns current active breakpoint name */
226
+ current(): keyof Breakpoints;
227
+ /** Calls fn immediately if bp matches, and on every future match */
228
+ on(bp: keyof Breakpoints, fn: () => void): void;
229
+ };
230
+
231
+ /** Theme & dark mode manager */
232
+ export declare const theme: {
233
+ /** Set theme name and optional mode */
234
+ set(theme: string, mode?: 'light' | 'dark'): void;
235
+ /** Set only the color mode */
236
+ setMode(mode: 'light' | 'dark'): void;
237
+ /** Toggle between light and dark mode */
238
+ toggle(): void;
239
+ /** Returns current { theme, mode } */
240
+ current(): ThemeState;
241
+ /** Persist theme to localStorage */
242
+ save(theme: string, mode?: 'light' | 'dark'): void;
243
+ /** Restore theme from localStorage */
244
+ restore(): void;
245
+ };
246
+
247
+ /** Alias for Toast (backwards compat) */
248
+ export declare const LxToast: typeof Toast;
249
+
250
+ // ────────────────────────────────────────────────────────────────
251
+ // Functions
252
+ // ────────────────────────────────────────────────────────────────
253
+
254
+ /** Initialize all LxUI components via data-attributes */
255
+ export declare function init(): void;
256
+
257
+ // ────────────────────────────────────────────────────────────────
258
+ // Default export
259
+ // ────────────────────────────────────────────────────────────────
260
+
261
+ declare const LxUI: {
262
+ version: string;
263
+ homepage: string;
264
+ init: typeof init;
265
+ Modal: typeof Modal;
266
+ Toast: typeof Toast;
267
+ Collapse: typeof Collapse;
268
+ Dropdown: typeof Dropdown;
269
+ Offcanvas: typeof Offcanvas;
270
+ Tooltip: typeof Tooltip;
271
+ Popover: typeof Popover;
272
+ Tab: typeof Tab;
273
+ Carousel: typeof Carousel;
274
+ Scrollspy: typeof Scrollspy;
275
+ Clipboard: typeof Clipboard;
276
+ Counter: typeof Counter;
277
+ NumberInput: typeof NumberInput;
278
+ Rating: typeof Rating;
279
+ breakpoint: typeof breakpoint;
280
+ theme: typeof theme;
281
+ LxToast: typeof Toast;
282
+ };
283
+
284
+ export default LxUI;