@diniz/webcomponents 1.1.9 → 1.2.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/dist/app.d.ts +3 -0
- package/dist/core/base-component.d.ts +34 -0
- package/dist/core/dom-helpers.d.ts +104 -0
- package/dist/core/guards.d.ts +2 -0
- package/dist/core/http.d.ts +89 -0
- package/dist/core/navigation.d.ts +2 -0
- package/dist/core/router.d.ts +14 -0
- package/dist/core/store.d.ts +12 -0
- package/dist/features/button-demo/button-demo.css.d.ts +1 -0
- package/dist/features/button-demo/button-demo.d.ts +8 -0
- package/dist/features/card-demo/card-demo.d.ts +1 -0
- package/dist/features/checkbox-demo/checkbox-demo-page.css.d.ts +1 -0
- package/dist/features/checkbox-demo/checkbox-demo-page.d.ts +3 -0
- package/dist/features/checkbox-demo/checkbox-demo-page.html.d.ts +1 -0
- package/dist/features/dashboard/dashboard-page.d.ts +3 -0
- package/dist/features/date-picker-demo/date-picker-demo.d.ts +10 -0
- package/dist/features/form-demo/form-demo-page.css.d.ts +1 -0
- package/dist/features/form-demo/form-demo-page.d.ts +7 -0
- package/dist/features/home/home-page.css.d.ts +1 -0
- package/dist/features/home/home-page.d.ts +9 -0
- package/dist/features/input-demo/input-demo.d.ts +12 -0
- package/dist/features/layout-demo/layout-demo.css.d.ts +1 -0
- package/dist/features/layout-demo/layout-demo.d.ts +9 -0
- package/dist/features/modal-demo/modal-demo-page.css.d.ts +1 -0
- package/dist/features/modal-demo/modal-demo-page.d.ts +3 -0
- package/dist/features/modal-demo/modal-demo-page.html.d.ts +1 -0
- package/dist/features/select-demo/select-demo-page.css.d.ts +1 -0
- package/dist/features/select-demo/select-demo-page.d.ts +3 -0
- package/dist/features/select-demo/select-demo-page.html.d.ts +1 -0
- package/dist/features/stepper-demo/stepper-demo-page.css.d.ts +1 -0
- package/dist/features/stepper-demo/stepper-demo-page.d.ts +3 -0
- package/dist/features/stepper-demo/stepper-demo-page.html.d.ts +1 -0
- package/dist/features/table-demo/table-demo.d.ts +18 -0
- package/dist/features/tabs-demo/tabs-demo.d.ts +7 -0
- package/dist/features/toast-demo/toast-demo-page.d.ts +3 -0
- package/dist/layouts/app-layout.d.ts +16 -0
- package/dist/lib/index.d.ts +29 -0
- package/dist/shared/components/button.d.ts +17 -0
- package/dist/shared/components/card.d.ts +13 -0
- package/dist/shared/components/checkbox.d.ts +13 -0
- package/dist/shared/components/date-picker.d.ts +47 -0
- package/dist/shared/components/input.d.ts +59 -0
- package/dist/shared/components/layout.d.ts +57 -0
- package/dist/shared/components/login.d.ts +0 -0
- package/dist/shared/components/modal.d.ts +13 -0
- package/dist/shared/components/pagination.d.ts +21 -0
- package/dist/shared/components/select.d.ts +25 -0
- package/dist/shared/components/sidebar.d.ts +30 -0
- package/dist/shared/components/stepper.d.ts +31 -0
- package/dist/shared/components/table.d.ts +33 -0
- package/dist/shared/components/tabs.d.ts +22 -0
- package/dist/shared/components/toast.d.ts +44 -0
- package/dist/shared/components/top-bar.d.ts +11 -0
- package/dist/shared/components/upload.d.ts +22 -0
- package/package.json +2 -2
package/dist/app.d.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export type Signal<T> = {
|
|
2
|
+
get: () => T;
|
|
3
|
+
set: (value: T) => void;
|
|
4
|
+
subscribe: (listener: (value: T) => void) => () => void;
|
|
5
|
+
};
|
|
6
|
+
export declare function createSignal<T>(initial: T): Signal<T>;
|
|
7
|
+
export declare class BaseComponent<TState extends Record<string, unknown> = Record<string, unknown>> extends HTMLElement {
|
|
8
|
+
state: TState;
|
|
9
|
+
private signalUnsubs;
|
|
10
|
+
constructor();
|
|
11
|
+
useSignal<T>(initial: T): Signal<T>;
|
|
12
|
+
/**
|
|
13
|
+
* Create a signal bound to a specific HTML element
|
|
14
|
+
* Automatically updates the element's textContent when the signal value changes
|
|
15
|
+
* @param elementId - The ID of the HTML element to bind to
|
|
16
|
+
* @param initial - The initial value
|
|
17
|
+
* @returns A signal that auto-updates the element
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```typescript
|
|
21
|
+
* private count = this.useSignalHtml('countValue', 0);
|
|
22
|
+
*
|
|
23
|
+
* private increment() {
|
|
24
|
+
* this.count.set(this.count.get() + 1);
|
|
25
|
+
* // Element with id="countValue" automatically updates
|
|
26
|
+
* }
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
useSignalHtml<T>(elementId: string, initial: T): Signal<T>;
|
|
30
|
+
setState(partial: Partial<TState>): void;
|
|
31
|
+
connectedCallback(): void;
|
|
32
|
+
disconnectedCallback(): void;
|
|
33
|
+
render(): void;
|
|
34
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DOM Helper utilities for working with custom elements
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Query and cast a custom element with specific properties
|
|
6
|
+
* @param root - The root element to query from (Document, ShadowRoot, or Element)
|
|
7
|
+
* @param selector - CSS selector for the element
|
|
8
|
+
* @returns The element cast to the specified type, or null if not found
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* import { queryElement } from './core/dom-helpers';
|
|
13
|
+
*
|
|
14
|
+
* // Query a table element
|
|
15
|
+
* const table = queryElement<{ data: { columns: TableColumn[]; rows: TableRow[] } }>(
|
|
16
|
+
* this.shadowRoot,
|
|
17
|
+
* '#demo-table'
|
|
18
|
+
* );
|
|
19
|
+
*
|
|
20
|
+
* if (table) {
|
|
21
|
+
* table.data = { columns, rows };
|
|
22
|
+
* }
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export declare function queryElement<T extends Record<string, any>>(root: Document | ShadowRoot | Element | null, selector: string): (HTMLElement & T) | null;
|
|
26
|
+
/**
|
|
27
|
+
* Query and cast multiple custom elements with specific properties
|
|
28
|
+
* @param root - The root element to query from (Document, ShadowRoot, or Element)
|
|
29
|
+
* @param selector - CSS selector for the elements
|
|
30
|
+
* @returns NodeList of elements cast to the specified type
|
|
31
|
+
*/
|
|
32
|
+
export declare function queryElements<T extends Record<string, any>>(root: Document | ShadowRoot | Element | null, selector: string): NodeListOf<HTMLElement & T>;
|
|
33
|
+
/**
|
|
34
|
+
* Get an element by id
|
|
35
|
+
* @param root - The root element to query from (Document, ShadowRoot, or Element)
|
|
36
|
+
* @param id - Element id without '#'
|
|
37
|
+
* @returns The element if found, otherwise null
|
|
38
|
+
*/
|
|
39
|
+
export declare function getElementById(root: Document | ShadowRoot | Element | null, id: string): HTMLElement | null;
|
|
40
|
+
/**
|
|
41
|
+
* Add an event listener by element id
|
|
42
|
+
* @param root - The root element to query from (Document, ShadowRoot, or Element)
|
|
43
|
+
* @param id - Element id without '#'
|
|
44
|
+
* @param eventName - DOM event name (e.g., 'click')
|
|
45
|
+
* @param handler - Event handler function
|
|
46
|
+
* @param options - Optional listener options
|
|
47
|
+
* @returns The element if found, otherwise null
|
|
48
|
+
*/
|
|
49
|
+
export declare function addEventListenerById(root: Document | ShadowRoot | Element | null, id: string, eventName: string, handler: EventListenerOrEventListenerObject, options?: AddEventListenerOptions | boolean): HTMLElement | null;
|
|
50
|
+
/**
|
|
51
|
+
* Type-safe helper specifically for ui-table elements
|
|
52
|
+
*/
|
|
53
|
+
export type UITableElement = HTMLElement & {
|
|
54
|
+
data: {
|
|
55
|
+
columns: Array<any>;
|
|
56
|
+
rows: Array<any>;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Type-safe helper specifically for ui-pagination elements
|
|
61
|
+
*/
|
|
62
|
+
export type UIPaginationElement = HTMLElement & {
|
|
63
|
+
total: number;
|
|
64
|
+
currentPage: number;
|
|
65
|
+
pageSize: number;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Type-safe helper specifically for ui-modal elements
|
|
69
|
+
*/
|
|
70
|
+
export type UIModalElement = HTMLElement & {
|
|
71
|
+
open(): void;
|
|
72
|
+
close(): void;
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* Query a ui-table element
|
|
76
|
+
*/
|
|
77
|
+
export declare function queryTable(root: Document | ShadowRoot | Element | null, selector: string): UITableElement | null;
|
|
78
|
+
/**
|
|
79
|
+
* Query a ui-pagination element
|
|
80
|
+
*/
|
|
81
|
+
export declare function queryPagination(root: Document | ShadowRoot | Element | null, selector: string): UIPaginationElement | null;
|
|
82
|
+
/**
|
|
83
|
+
* Query a ui-modal element
|
|
84
|
+
*/
|
|
85
|
+
export declare function queryModal(root: Document | ShadowRoot | Element | null, selector: string): UIModalElement | null;
|
|
86
|
+
export type FormValue = string | string[] | boolean | File[];
|
|
87
|
+
export type ValidationResult = {
|
|
88
|
+
isValid: boolean;
|
|
89
|
+
errors: Record<string, string>;
|
|
90
|
+
};
|
|
91
|
+
export type GetFormValuesOptions = {
|
|
92
|
+
includeDisabled?: boolean;
|
|
93
|
+
includeEmpty?: boolean;
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* Collect values for all inputs inside a form.
|
|
97
|
+
* Supports native inputs plus ui-input, ui-select, and ui-date-picker.
|
|
98
|
+
*/
|
|
99
|
+
export declare function getFormValues(form: HTMLFormElement, options?: GetFormValuesOptions): Record<string, FormValue>;
|
|
100
|
+
/**
|
|
101
|
+
* Validate a form and return validation errors
|
|
102
|
+
* Supports native inputs plus ui-input, ui-select, and ui-checkbox
|
|
103
|
+
*/
|
|
104
|
+
export declare function validateForm(form: HTMLFormElement): ValidationResult;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Simple HTTP Client with Interceptor Support
|
|
3
|
+
* Lightweight fetch wrapper for common HTTP operations
|
|
4
|
+
*/
|
|
5
|
+
export interface RequestConfig {
|
|
6
|
+
method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
7
|
+
headers?: Record<string, string>;
|
|
8
|
+
body?: string | FormData | null;
|
|
9
|
+
timeout?: number;
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
}
|
|
12
|
+
export interface ResponseConfig {
|
|
13
|
+
status: number;
|
|
14
|
+
statusText: string;
|
|
15
|
+
headers: Headers;
|
|
16
|
+
data: any;
|
|
17
|
+
[key: string]: any;
|
|
18
|
+
}
|
|
19
|
+
export type RequestInterceptor = (config: RequestConfig) => RequestConfig | Promise<RequestConfig>;
|
|
20
|
+
export type ResponseInterceptor = (response: ResponseConfig) => ResponseConfig | Promise<ResponseConfig>;
|
|
21
|
+
export type ErrorInterceptor = (error: any) => any | Promise<any>;
|
|
22
|
+
interface InterceptorHandlers {
|
|
23
|
+
request: {
|
|
24
|
+
handlers: Array<{
|
|
25
|
+
onFulfilled: RequestInterceptor;
|
|
26
|
+
onRejected?: ErrorInterceptor;
|
|
27
|
+
}>;
|
|
28
|
+
use: (onFulfilled: RequestInterceptor, onRejected?: ErrorInterceptor) => void;
|
|
29
|
+
};
|
|
30
|
+
response: {
|
|
31
|
+
handlers: Array<{
|
|
32
|
+
onFulfilled: ResponseInterceptor;
|
|
33
|
+
onRejected?: ErrorInterceptor;
|
|
34
|
+
}>;
|
|
35
|
+
use: (onFulfilled: ResponseInterceptor, onRejected?: ErrorInterceptor) => void;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
declare class HTTPClient {
|
|
39
|
+
private baseURL;
|
|
40
|
+
private defaultHeaders;
|
|
41
|
+
private defaultTimeout;
|
|
42
|
+
interceptors: InterceptorHandlers;
|
|
43
|
+
/**
|
|
44
|
+
* Set base URL for all requests
|
|
45
|
+
*/
|
|
46
|
+
setBaseURL(url: string): void;
|
|
47
|
+
/**
|
|
48
|
+
* Get currently set base URL
|
|
49
|
+
*/
|
|
50
|
+
getBaseURL(): string;
|
|
51
|
+
/**
|
|
52
|
+
* Set default headers for all requests
|
|
53
|
+
*/
|
|
54
|
+
setDefaultHeaders(headers: Record<string, string>): void;
|
|
55
|
+
/**
|
|
56
|
+
* Set default timeout for all requests (in ms)
|
|
57
|
+
*/
|
|
58
|
+
setDefaultTimeout(timeout: number): void;
|
|
59
|
+
/**
|
|
60
|
+
* Execute request with interceptors
|
|
61
|
+
*/
|
|
62
|
+
private executeRequest;
|
|
63
|
+
/**
|
|
64
|
+
* GET request
|
|
65
|
+
*/
|
|
66
|
+
get<T = any>(url: string, config?: RequestConfig): Promise<T>;
|
|
67
|
+
/**
|
|
68
|
+
* POST request
|
|
69
|
+
*/
|
|
70
|
+
post<T = any>(url: string, data?: any, config?: RequestConfig): Promise<T>;
|
|
71
|
+
/**
|
|
72
|
+
* PUT request
|
|
73
|
+
*/
|
|
74
|
+
put<T = any>(url: string, data?: any, config?: RequestConfig): Promise<T>;
|
|
75
|
+
/**
|
|
76
|
+
* PATCH request
|
|
77
|
+
*/
|
|
78
|
+
patch<T = any>(url: string, data?: any, config?: RequestConfig): Promise<T>;
|
|
79
|
+
/**
|
|
80
|
+
* DELETE request
|
|
81
|
+
*/
|
|
82
|
+
delete<T = any>(url: string, config?: RequestConfig): Promise<T>;
|
|
83
|
+
/**
|
|
84
|
+
* HEAD request
|
|
85
|
+
*/
|
|
86
|
+
head<T = any>(url: string, config?: RequestConfig): Promise<T>;
|
|
87
|
+
}
|
|
88
|
+
export declare const http: HTTPClient;
|
|
89
|
+
export { HTTPClient };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type Route = {
|
|
2
|
+
path: string;
|
|
3
|
+
load: () => Promise<unknown>;
|
|
4
|
+
component: string;
|
|
5
|
+
guard?: () => boolean | Promise<boolean>;
|
|
6
|
+
};
|
|
7
|
+
export declare function createRouter(routes: Route[], appSelector?: string): () => Promise<void>;
|
|
8
|
+
export type RouteOld = {
|
|
9
|
+
path: string;
|
|
10
|
+
layout: string;
|
|
11
|
+
load: () => Promise<unknown>;
|
|
12
|
+
component: string;
|
|
13
|
+
guard?: () => boolean | Promise<boolean>;
|
|
14
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type Theme = 'light' | 'shadcn';
|
|
2
|
+
type AppState = {
|
|
3
|
+
user: unknown | null;
|
|
4
|
+
theme: Theme;
|
|
5
|
+
};
|
|
6
|
+
type Listener = (state: AppState) => void;
|
|
7
|
+
export declare const store: {
|
|
8
|
+
getState: () => AppState;
|
|
9
|
+
setState(partial: Partial<AppState>): void;
|
|
10
|
+
subscribe(listener: Listener): () => void;
|
|
11
|
+
};
|
|
12
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const buttonDemoCSS = "\n :host {\n display: block;\n color: var(--color-ink);\n }\n\n h1 {\n font-size: 2.2rem;\n margin-bottom: 0.5rem;\n font-weight: 700;\n }\n\n h2 {\n font-size: 1.4rem;\n margin: 2rem 0 1.5rem;\n font-weight: 600;\n border-bottom: 2px solid var(--color-primary);\n padding-bottom: 0.5rem;\n }\n\n p {\n line-height: 1.6;\n color: rgba(15, 23, 42, 0.75);\n margin: 0 0 1rem;\n }\n\n .demo-intro {\n background: linear-gradient(135deg, rgba(36, 236, 113, 0.08) 0%, rgba(52, 168, 235, 0.05) 100%);\n padding: 1.5rem;\n border-radius: 12px;\n border-left: 4px solid var(--color-primary);\n margin-bottom: 2rem;\n }\n\n .demo-section {\n margin-bottom: 3rem;\n }\n\n .button-group {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));\n gap: 1.5rem;\n margin-top: 1rem;\n }\n\n .button-item {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 0.75rem;\n padding: 1.5rem;\n background: var(--color-surface);\n border: 1px solid var(--color-border);\n border-radius: 12px;\n text-align: center;\n transition: all 0.2s ease;\n }\n\n .button-item:hover {\n box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);\n border-color: var(--color-border-strong);\n }\n\n .label {\n font-size: 0.8rem;\n color: rgba(15, 23, 42, 0.6);\n font-weight: 500;\n text-transform: uppercase;\n letter-spacing: 0.05em;\n }\n\n @media (max-width: 768px) {\n .button-group {\n grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));\n gap: 1rem;\n }\n\n .button-item {\n padding: 1rem;\n }\n\n h1 {\n font-size: 1.8rem;\n }\n\n h2 {\n font-size: 1.2rem;\n }\n }\n";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '../../shared/components/card';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const checkboxDemoCSS = "\n\t.demo-container {\n\t\tpadding: 2rem;\n\t\tmax-width: 1200px;\n\t\tmargin: 0 auto;\n\t}\n\n\t.demo-container h1 {\n\t\tfont-size: 2rem;\n\t\tmargin-bottom: 0.5rem;\n\t\tcolor: var(--color-ink);\n\t}\n\n\t.demo-container > p {\n\t\tcolor: var(--color-text-muted);\n\t\tmargin-bottom: 2rem;\n\t}\n\n\t.demo-section {\n\t\tmargin-bottom: 3rem;\n\t\tpadding-bottom: 2rem;\n\t\tborder-bottom: 1px solid var(--color-border);\n\t}\n\n\t.demo-section:last-child {\n\t\tborder-bottom: none;\n\t}\n\n\t.demo-section h2 {\n\t\tfont-size: 1.5rem;\n\t\tmargin-bottom: 1rem;\n\t\tcolor: var(--color-ink);\n\t}\n\n\t.checkbox-group {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: 1rem;\n\t}\n\n\t.result-display {\n\t\tpadding: 1rem;\n\t\tbackground: var(--color-muted);\n\t\tborder-radius: var(--radius-md);\n\t\tborder-left: 4px solid var(--color-primary);\n\t}\n\n\tfieldset {\n\t\tmargin: 0;\n\t}\n\n\tlegend {\n\t\tcolor: var(--color-ink);\n\t}\n";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const checkboxDemoHTML = "\n\t<div class=\"demo-container\">\n\t\t<h1>Checkbox Component Demo</h1>\n\t\t<p>Flexible checkbox with sizes, states, and indeterminate support.</p>\n\n\t\t<div class=\"demo-section\">\n\t\t\t<h2>Basic Checkboxes</h2>\n\t\t\t<div class=\"checkbox-group\">\n\t\t\t\t<ui-checkbox id=\"basic1\" label=\"Accept terms and conditions\"></ui-checkbox>\n\t\t\t\t<ui-checkbox id=\"basic2\" label=\"Subscribe to newsletter\" checked></ui-checkbox>\n\t\t\t\t<ui-checkbox id=\"basic3\" label=\"Disabled checkbox\" disabled></ui-checkbox>\n\t\t\t\t<ui-checkbox id=\"basic4\" label=\"Disabled & checked\" disabled checked></ui-checkbox>\n\t\t\t</div>\n\t\t</div>\n\n\t\t<div class=\"demo-section\">\n\t\t\t<h2>Checkbox Sizes</h2>\n\t\t\t<div class=\"checkbox-group\">\n\t\t\t\t<ui-checkbox id=\"size1\" label=\"Small checkbox\" size=\"sm\"></ui-checkbox>\n\t\t\t\t<ui-checkbox id=\"size2\" label=\"Medium checkbox (default)\" size=\"md\"></ui-checkbox>\n\t\t\t\t<ui-checkbox id=\"size3\" label=\"Large checkbox\" size=\"lg\"></ui-checkbox>\n\t\t\t</div>\n\t\t</div>\n\n\t\t<div class=\"demo-section\">\n\t\t\t<h2>Indeterminate State</h2>\n\t\t\t<p style=\"color: var(--color-text-muted); font-size: 0.875rem; margin-bottom: 1rem;\">\n\t\t\t\tUseful for \"select all\" scenarios where some items are selected.\n\t\t\t</p>\n\t\t\t<div style=\"background: white; padding: 1.5rem; border-radius: var(--radius-lg); border: 1px solid var(--color-border);\">\n\t\t\t\t<ui-checkbox id=\"selectAll\" label=\"Select All\" size=\"md\"></ui-checkbox>\n\t\t\t\t<div style=\"margin-left: 2rem; margin-top: 1rem;\" class=\"checkbox-group\">\n\t\t\t\t\t<ui-checkbox class=\"item-checkbox\" label=\"Item 1\" size=\"sm\"></ui-checkbox>\n\t\t\t\t\t<ui-checkbox class=\"item-checkbox\" label=\"Item 2\" size=\"sm\"></ui-checkbox>\n\t\t\t\t\t<ui-checkbox class=\"item-checkbox\" label=\"Item 3\" size=\"sm\"></ui-checkbox>\n\t\t\t\t\t<ui-checkbox class=\"item-checkbox\" label=\"Item 4\" size=\"sm\"></ui-checkbox>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\n\t\t<div class=\"demo-section\">\n\t\t\t<h2>Checkbox Group (Form)</h2>\n\t\t\t<form id=\"preferencesForm\" style=\"max-width: 600px;\">\n\t\t\t\t<fieldset style=\"border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 1.5rem;\">\n\t\t\t\t\t<legend style=\"font-weight: 600; padding: 0 0.5rem;\">Notification Preferences</legend>\n\t\t\t\t\t<div class=\"checkbox-group\">\n\t\t\t\t\t\t<ui-checkbox id=\"emailNotif\" label=\"Email notifications\" checked></ui-checkbox>\n\t\t\t\t\t\t<ui-checkbox id=\"smsNotif\" label=\"SMS notifications\"></ui-checkbox>\n\t\t\t\t\t\t<ui-checkbox id=\"pushNotif\" label=\"Push notifications\" checked></ui-checkbox>\n\t\t\t\t\t\t<ui-checkbox id=\"weeklyDigest\" label=\"Weekly digest\"></ui-checkbox>\n\t\t\t\t\t</div>\n\t\t\t\t</fieldset>\n\n\t\t\t\t<div style=\"margin-top: 1.5rem; display: flex; gap: 1rem;\">\n\t\t\t\t\t<ui-button type=\"submit\" variant=\"primary\" icon=\"save\">Save Preferences</ui-button>\n\t\t\t\t\t<ui-button type=\"button\" id=\"resetPreferences\" variant=\"ghost\">Reset</ui-button>\n\t\t\t\t</div>\n\t\t\t</form>\n\t\t\t<div id=\"formResult\" class=\"result-display\" style=\"display: none; margin-top: 1rem;\">\n\t\t\t\t<strong>Saved Preferences:</strong><br>\n\t\t\t\t<span id=\"formValue\"></span>\n\t\t\t</div>\n\t\t</div>\n\n\t\t<div class=\"demo-section\">\n\t\t\t<h2>Event Handling</h2>\n\t\t\t<div style=\"background: white; padding: 1.5rem; border-radius: var(--radius-lg); border: 1px solid var(--color-border);\">\n\t\t\t\t<ui-checkbox id=\"eventCheckbox\" label=\"Click me to trigger event\"></ui-checkbox>\n\t\t\t</div>\n\t\t\t<div id=\"eventResult\" class=\"result-display\" style=\"display: none; margin-top: 1rem;\">\n\t\t\t\t<strong>Event Log:</strong><br>\n\t\t\t\t<div id=\"eventLog\" style=\"font-family: monospace; font-size: 0.875rem; margin-top: 0.5rem;\"></div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BaseComponent } from '../../core/base-component';
|
|
2
|
+
import '../../layouts/app-layout';
|
|
3
|
+
import '../../shared/components/date-picker';
|
|
4
|
+
import '../../shared/components/button';
|
|
5
|
+
declare class DatePickerDemo extends BaseComponent {
|
|
6
|
+
connectedCallback(): void;
|
|
7
|
+
private attachEventListeners;
|
|
8
|
+
render(): void;
|
|
9
|
+
}
|
|
10
|
+
export { DatePickerDemo };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const formDemoCSS = "\n\t:host {\n\t\tdisplay: block;\n\t\tcolor: var(--color-ink);\n\t}\n\n\t.form-hero {\n\t\tdisplay: flex;\n\t\tjustify-content: space-between;\n\t\talign-items: center;\n\t\tgap: 1.5rem;\n\t\tpadding: 2rem;\n\t\tborder-radius: 20px;\n\t\tbackground: radial-gradient(circle at top left, rgba(36, 236, 113, 0.2), transparent 45%),\n\t\t\tlinear-gradient(135deg, rgba(52, 168, 235, 0.12), rgba(255, 255, 255, 0.95));\n\t\tborder: 1px solid rgba(52, 168, 235, 0.2);\n\t\tmargin-bottom: 2rem;\n\t\tflex-wrap: wrap;\n\t}\n\n\t.eyebrow {\n\t\ttext-transform: uppercase;\n\t\tletter-spacing: 0.2em;\n\t\tfont-size: 0.7rem;\n\t\tcolor: rgba(15, 23, 42, 0.55);\n\t\tmargin: 0 0 0.75rem;\n\t\tfont-weight: 700;\n\t}\n\n\th1 {\n\t\tfont-size: 2.4rem;\n\t\tmargin: 0 0 0.5rem;\n\t}\n\n\t.hero-subtitle {\n\t\tmax-width: 520px;\n\t\tmargin: 0;\n\t\tcolor: rgba(15, 23, 42, 0.65);\n\t\tfont-size: 1rem;\n\t\tline-height: 1.6;\n\t}\n\n\t.hero-chip {\n\t\tpadding: 0.4rem 0.9rem;\n\t\tborder-radius: 999px;\n\t\tfont-size: 0.75rem;\n\t\tfont-weight: 700;\n\t\ttext-transform: uppercase;\n\t\tletter-spacing: 0.14em;\n\t\tbackground: #0f172a;\n\t\tcolor: #ffffff;\n\t\tbox-shadow: 0 12px 24px rgba(15, 23, 42, 0.15);\n\t}\n\n\t.form-shell {\n\t\tdisplay: grid;\n\t\tgrid-template-columns: minmax(0, 1fr) 320px;\n\t\tgap: 2rem;\n\t}\n\n\t.form-grid {\n\t\tdisplay: grid;\n\t\tgrid-template-columns: repeat(2, minmax(0, 1fr));\n\t\tgap: 1.5rem;\n\t\talign-items: start;\n\t}\n\n\t.form-panel {\n\t\tpadding: 1.5rem;\n\t\tborder-radius: 16px;\n\t\tborder: 1px solid rgba(148, 163, 184, 0.3);\n\t\tbackground: #ffffff;\n\t\tbox-shadow: 0 18px 35px rgba(15, 23, 42, 0.08);\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: 1rem;\n\t}\n\n\t.form-panel h2 {\n\t\tmargin: 0;\n\t\tfont-size: 1.35rem;\n\t}\n\n\t.form-panel p {\n\t\tmargin: 0;\n\t\tcolor: rgba(15, 23, 42, 0.6);\n\t\tfont-size: 0.95rem;\n\t}\n\n\t.split {\n\t\tdisplay: grid;\n\t\tgrid-template-columns: repeat(2, minmax(0, 1fr));\n\t\tgap: 1rem;\n\t}\n\n\ttextarea {\n\t\tmin-height: 120px;\n\t\tpadding: 0.75rem 0.85rem;\n\t\tfont-size: 0.95rem;\n\t\tfont-family: inherit;\n\t\tborder: 1.5px solid var(--color-border);\n\t\tborder-radius: 8px;\n\t\tbackground: #ffffff;\n\t\tcolor: var(--color-ink);\n\t\ttransition: border-color 0.2s ease, box-shadow 0.2s ease;\n\t}\n\n\ttextarea:focus {\n\t\toutline: none;\n\t\tborder-color: var(--color-primary);\n\t\tbox-shadow: 0 0 0 3px rgba(36, 236, 113, 0.15);\n\t}\n\n\t.native-group {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: 0.4rem;\n\t\tfont-size: 0.9rem;\n\t\tcolor: var(--color-ink);\n\t}\n\n\t.native-group select {\n\t\tpadding: 0.65rem 0.85rem;\n\t\tborder: 1.5px solid var(--color-border);\n\t\tborder-radius: 8px;\n\t\tfont-size: 0.95rem;\n\t\tfont-family: inherit;\n\t\tbackground: #ffffff;\n\t\tcolor: var(--color-ink);\n\t}\n\n\t.checkbox-stack {\n\t\tdisplay: grid;\n\t\tgap: 0.75rem;\n\t}\n\n\t.checkbox-inline {\n\t\tdisplay: grid;\n\t\tgap: 0.5rem;\n\t\tfont-size: 0.9rem;\n\t\tcolor: var(--color-ink);\n\t}\n\n\t.inline-options {\n\t\tdisplay: flex;\n\t\tgap: 1rem;\n\t\tflex-wrap: wrap;\n\t}\n\n\t.inline-options label {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 0.4rem;\n\t}\n\n\t.form-actions {\n\t\tgrid-column: 1 / -1;\n\t\tdisplay: flex;\n\t\tgap: 0.75rem;\n\t\talign-items: center;\n\t}\n\n\t.form-output {\n\t\tbackground: #0f172a;\n\t\tcolor: #f8fafc;\n\t\tborder-radius: 16px;\n\t\tpadding: 1.5rem;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: 1rem;\n\t\tbox-shadow: 0 16px 30px rgba(15, 23, 42, 0.2);\n\t\theight: fit-content;\n\t\tposition: sticky;\n\t\ttop: 1.5rem;\n\t}\n\n\t.output-head {\n\t\tdisplay: flex;\n\t\tjustify-content: space-between;\n\t\talign-items: center;\n\t\tfont-size: 0.85rem;\n\t\ttext-transform: uppercase;\n\t\tletter-spacing: 0.14em;\n\t\tcolor: rgba(248, 250, 252, 0.7);\n\t}\n\n\t.output-head h3 {\n\t\tmargin: 0;\n\t\tfont-size: 0.95rem;\n\t\tcolor: #ffffff;\n\t}\n\n\tpre {\n\t\tmargin: 0;\n\t\twhite-space: pre-wrap;\n\t\tfont-family: \"Cascadia Mono\", \"Fira Code\", monospace;\n\t\tfont-size: 0.82rem;\n\t\tline-height: 1.5;\n\t\tbackground: rgba(15, 23, 42, 0.45);\n\t\tpadding: 1rem;\n\t\tborder-radius: 12px;\n\t\tborder: 1px solid rgba(255, 255, 255, 0.1);\n\t}\n\n\t@media (max-width: 1024px) {\n\t\t.form-shell {\n\t\t\tgrid-template-columns: 1fr;\n\t\t}\n\n\t\t.form-output {\n\t\t\tposition: static;\n\t\t}\n\t}\n\n\t@media (max-width: 720px) {\n\t\t.form-grid {\n\t\t\tgrid-template-columns: 1fr;\n\t\t}\n\n\t\t.split {\n\t\t\tgrid-template-columns: 1fr;\n\t\t}\n\n\t\th1 {\n\t\t\tfont-size: 2rem;\n\t\t}\n\t}\n";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import '../../shared/components/button';
|
|
2
|
+
import '../../shared/components/input';
|
|
3
|
+
import '../../shared/components/select';
|
|
4
|
+
import '../../shared/components/checkbox';
|
|
5
|
+
import '../../shared/components/date-picker';
|
|
6
|
+
import '../../shared/components/upload';
|
|
7
|
+
import '../../layouts/app-layout';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const homePageCSS = "\n :host {\n display: block;\n color: var(--color-ink);\n }\n\n h1, h2, h3 {\n margin: 0;\n }\n\n h2 {\n font-size: 2rem;\n font-weight: 700;\n margin-bottom: 2rem;\n position: relative;\n display: inline-block;\n }\n\n h2::after {\n content: '';\n position: absolute;\n bottom: -8px;\n left: 0;\n width: 60px;\n height: 4px;\n background: var(--color-primary);\n border-radius: 2px;\n }\n\n p {\n line-height: 1.6;\n color: rgba(15, 23, 42, 0.75);\n }\n\n /* Hero Section */\n .hero {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 4rem;\n align-items: center;\n margin-bottom: 6rem;\n padding: 3rem 0;\n }\n\n .hero-content {\n display: flex;\n flex-direction: column;\n gap: 1.5rem;\n }\n\n .hero-title {\n font-size: 3.5rem;\n font-weight: 800;\n line-height: 1.1;\n background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-ink) 100%);\n -webkit-background-clip: text;\n -webkit-text-fill-color: transparent;\n background-clip: text;\n }\n\n .hero-subtitle {\n font-size: 1.25rem;\n line-height: 1.7;\n color: rgba(15, 23, 42, 0.7);\n }\n\n .hero-actions {\n display: flex;\n gap: 1rem;\n margin-top: 0.5rem;\n }\n\n .hero-visual {\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .feature-icons {\n display: grid;\n grid-template-columns: repeat(2, 1fr);\n gap: 2rem;\n }\n\n .icon-item {\n font-size: 4rem;\n animation: float 3s ease-in-out infinite;\n }\n\n .icon-item:nth-child(2) { animation-delay: 0.3s; }\n .icon-item:nth-child(3) { animation-delay: 0.6s; }\n .icon-item:nth-child(4) { animation-delay: 0.9s; }\n\n @keyframes float {\n 0%, 100% { transform: translateY(0px); }\n 50% { transform: translateY(-10px); }\n }\n\n /* Features Section */\n .features {\n margin-bottom: 6rem;\n }\n\n .features-grid {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));\n gap: 2rem;\n margin-top: 2rem;\n }\n\n .feature-card {\n padding: 2rem;\n background: var(--color-surface);\n border: 1px solid var(--color-border);\n border-radius: 16px;\n transition: all 0.3s ease;\n display: flex;\n flex-direction: column;\n gap: 1rem;\n }\n\n .feature-card:hover {\n transform: translateY(-4px);\n box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);\n border-color: var(--color-primary);\n }\n\n .feature-icon {\n font-size: 2.5rem;\n line-height: 1;\n }\n\n .feature-card h3 {\n font-size: 1.2rem;\n font-weight: 600;\n }\n\n .feature-card p {\n font-size: 0.95rem;\n margin: 0;\n }\n\n /* Components Section */\n .components {\n margin-bottom: 6rem;\n }\n\n .components-grid {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));\n gap: 1rem;\n margin-top: 2rem;\n }\n\n .component-item {\n padding: 1.5rem;\n background: var(--color-surface);\n border: 1px solid var(--color-border);\n border-radius: 12px;\n transition: all 0.2s ease;\n cursor: pointer;\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n }\n\n .component-item:hover {\n border-color: var(--color-primary);\n background: linear-gradient(135deg, rgba(36, 236, 113, 0.05), transparent);\n transform: translateX(4px);\n }\n\n .component-name {\n font-weight: 600;\n color: var(--color-primary);\n font-family: \"Cascadia Mono\", \"Fira Code\", monospace;\n font-size: 0.9rem;\n }\n\n .component-desc {\n font-size: 0.85rem;\n color: rgba(15, 23, 42, 0.6);\n }\n\n /* Quick Start Section */\n .quick-start {\n margin-bottom: 6rem;\n }\n\n .code-blocks {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));\n gap: 2rem;\n margin-top: 2rem;\n }\n\n .code-block {\n background: #0f172a;\n padding: 2rem;\n border-radius: 12px;\n border: 1px solid rgba(255, 255, 255, 0.1);\n }\n\n .code-block h3 {\n color: #f8fafc;\n font-size: 1.1rem;\n margin-bottom: 1rem;\n font-weight: 600;\n }\n\n .code-block pre {\n margin: 0;\n overflow-x: auto;\n }\n\n .code-block code {\n font-family: \"Cascadia Mono\", \"Fira Code\", monospace;\n font-size: 0.9rem;\n color: #e0e7ff;\n line-height: 1.5;\n }\n\n /* CTA Section */\n .cta {\n text-align: center;\n padding: 4rem 2rem;\n background: linear-gradient(135deg, rgba(36, 236, 113, 0.1) 0%, rgba(52, 168, 235, 0.05) 100%);\n border-radius: 16px;\n border: 1px solid var(--color-border);\n margin-bottom: 2rem;\n }\n\n .cta h2 {\n margin-bottom: 1rem;\n font-size: 2rem;\n }\n\n .cta h2::after {\n display: none;\n }\n\n .cta p {\n font-size: 1.1rem;\n margin-bottom: 2rem;\n }\n\n /* Responsive */\n @media (max-width: 768px) {\n .hero {\n grid-template-columns: 1fr;\n gap: 2rem;\n margin-bottom: 4rem;\n }\n\n .hero-title {\n font-size: 2.5rem;\n }\n\n .hero-subtitle {\n font-size: 1rem;\n }\n\n .hero-actions {\n flex-wrap: wrap;\n }\n\n .feature-icons {\n grid-template-columns: 1fr;\n gap: 1rem;\n }\n\n .icon-item {\n font-size: 3rem;\n }\n\n h2 {\n font-size: 1.5rem;\n }\n\n .features-grid,\n .components-grid {\n grid-template-columns: 1fr;\n }\n\n .code-blocks {\n grid-template-columns: 1fr;\n }\n\n .cta {\n padding: 2rem 1.5rem;\n }\n\n .cta h2 {\n font-size: 1.5rem;\n }\n }\n";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BaseComponent } from '../../core/base-component';
|
|
2
|
+
import '../../shared/components/button';
|
|
3
|
+
import '../../layouts/app-layout';
|
|
4
|
+
declare class HomePage extends BaseComponent {
|
|
5
|
+
connectedCallback(): void;
|
|
6
|
+
private attachEventListeners;
|
|
7
|
+
render(): void;
|
|
8
|
+
}
|
|
9
|
+
export { HomePage };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BaseComponent } from '../../core/base-component';
|
|
2
|
+
import '../../shared/components/input';
|
|
3
|
+
import '../../shared/components/button';
|
|
4
|
+
import '../../layouts/app-layout';
|
|
5
|
+
declare class InputDemo extends BaseComponent {
|
|
6
|
+
private formResult;
|
|
7
|
+
private statusSpan;
|
|
8
|
+
render(): void;
|
|
9
|
+
private handleSubmit;
|
|
10
|
+
private handleReset;
|
|
11
|
+
}
|
|
12
|
+
export { InputDemo };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const layoutDemoCSS = "\n :host {\n display: block;\n color: var(--color-ink);\n }\n\n h1 {\n font-size: 2.2rem;\n margin-bottom: 0.5rem;\n font-weight: 700;\n }\n\n h2 {\n font-size: 1.4rem;\n margin: 2rem 0 1rem;\n font-weight: 600;\n border-bottom: 2px solid var(--color-primary);\n padding-bottom: 0.5rem;\n }\n\n h3 {\n font-size: 1.2rem;\n margin: 0 0 0.75rem;\n font-weight: 600;\n }\n\n p {\n line-height: 1.6;\n color: rgba(15, 23, 42, 0.75);\n margin: 0 0 1rem;\n }\n\n code {\n background: var(--color-muted);\n padding: 0.2rem 0.5rem;\n border-radius: 4px;\n font-family: \"Cascadia Mono\", \"Fira Code\", monospace;\n font-size: 0.9rem;\n color: var(--color-primary);\n }\n\n .demo-intro {\n background: linear-gradient(135deg, rgba(36, 236, 113, 0.08) 0%, rgba(52, 168, 235, 0.05) 100%);\n padding: 1.5rem;\n border-radius: 12px;\n border-left: 4px solid var(--color-primary);\n margin-bottom: 2rem;\n }\n\n .demo-section {\n margin-bottom: 3rem;\n }\n\n .layout-example {\n background: var(--color-surface);\n border: 1px solid var(--color-border);\n border-radius: 12px;\n overflow: hidden;\n height: 400px;\n box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);\n margin-top: 1rem;\n }\n\n .layout-example.full-height {\n height: 550px;\n }\n\n .content-placeholder {\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n justify-content: center;\n background: var(--color-bg);\n font-size: 1.1rem;\n font-weight: 500;\n color: rgba(15, 23, 42, 0.5);\n }\n\n .sidebar-label {\n font-size: 0.75rem;\n font-weight: 700;\n text-transform: uppercase;\n letter-spacing: 0.1em;\n color: rgba(15, 23, 42, 0.5);\n padding: 0.75rem 1rem 0.5rem;\n margin-top: 0.5rem;\n }\n\n .sidebar-item {\n padding: 0.75rem 1rem;\n cursor: pointer;\n transition: all 0.2s ease;\n font-size: 0.95rem;\n color: var(--color-ink);\n user-select: none;\n }\n\n .sidebar-item:hover {\n background: var(--color-muted);\n color: var(--color-primary);\n }\n\n .sidebar-section {\n padding: 0.5rem 0;\n }\n\n .demo-info {\n background: var(--color-muted);\n padding: 1.5rem;\n border-radius: 8px;\n margin-bottom: 1rem;\n }\n\n .event-output {\n background: #0f172a;\n color: #f8fafc;\n padding: 1rem;\n border-radius: 6px;\n font-family: \"Cascadia Mono\", \"Fira Code\", monospace;\n font-size: 0.85rem;\n margin-top: 0.5rem;\n line-height: 1.5;\n max-height: 150px;\n overflow-y: auto;\n }\n\n .event-output.empty {\n opacity: 0.6;\n }\n\n /* Custom scrollbar */\n .event-output::-webkit-scrollbar {\n width: 6px;\n }\n\n .event-output::-webkit-scrollbar-track {\n background: rgba(248, 250, 252, 0.1);\n border-radius: 3px;\n }\n\n .event-output::-webkit-scrollbar-thumb {\n background: rgba(248, 250, 252, 0.3);\n border-radius: 3px;\n }\n\n .event-output::-webkit-scrollbar-thumb:hover {\n background: rgba(248, 250, 252, 0.5);\n }\n";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BaseComponent } from '../../core/base-component';
|
|
2
|
+
import '../../shared/components/layout';
|
|
3
|
+
import '../../layouts/app-layout';
|
|
4
|
+
declare class LayoutDemo extends BaseComponent {
|
|
5
|
+
connectedCallback(): Promise<void>;
|
|
6
|
+
private setupEventListeners;
|
|
7
|
+
render(): void;
|
|
8
|
+
}
|
|
9
|
+
export { LayoutDemo };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const modalDemoCSS = "\n\t.demo-container {\n\t\tpadding: 2rem;\n\t\tmax-width: 1200px;\n\t\tmargin: 0 auto;\n\t}\n\n\t.demo-container h1 {\n\t\tfont-size: 2rem;\n\t\tmargin-bottom: 0.5rem;\n\t\tcolor: var(--color-ink);\n\t}\n\n\t.demo-container > p {\n\t\tcolor: var(--color-text-muted);\n\t\tmargin-bottom: 2rem;\n\t}\n\n\t.demo-section {\n\t\tmargin-bottom: 3rem;\n\t\tpadding-bottom: 2rem;\n\t\tborder-bottom: 1px solid var(--color-border);\n\t}\n\n\t.demo-section:last-child {\n\t\tborder-bottom: none;\n\t}\n\n\t.demo-section h2 {\n\t\tfont-size: 1.5rem;\n\t\tmargin-bottom: 1rem;\n\t\tcolor: var(--color-ink);\n\t}\n\n\t.demo-controls {\n\t\tdisplay: flex;\n\t\tgap: 1rem;\n\t\tflex-wrap: wrap;\n\t\tmargin-top: 1rem;\n\t}\n\n\t.result-display {\n\t\tmargin-top: 1rem;\n\t\tpadding: 1rem;\n\t\tbackground: var(--color-muted);\n\t\tborder-radius: var(--radius-md);\n\t\tborder-left: 4px solid var(--color-primary);\n\t}\n\n\tul {\n\t\tmargin: 1rem 0;\n\t\tpadding-left: 1.5rem;\n\t}\n\n\tli {\n\t\tmargin: 0.5rem 0;\n\t}\n";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const modalDemoHTML: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const selectDemoCSS = "\n\t.demo-container {\n\t\tpadding: 2rem;\n\t\tmax-width: 1200px;\n\t\tmargin: 0 auto;\n\t}\n\n\t.demo-container h1 {\n\t\tfont-size: 2rem;\n\t\tmargin-bottom: 0.5rem;\n\t\tcolor: var(--color-ink);\n\t}\n\n\t.demo-container > p {\n\t\tcolor: var(--color-text-muted);\n\t\tmargin-bottom: 2rem;\n\t}\n\n\t.demo-section {\n\t\tmargin-bottom: 3rem;\n\t\tpadding-bottom: 2rem;\n\t\tborder-bottom: 1px solid var(--color-border);\n\t}\n\n\t.demo-section:last-child {\n\t\tborder-bottom: none;\n\t}\n\n\t.demo-section h2 {\n\t\tfont-size: 1.5rem;\n\t\tmargin-bottom: 1rem;\n\t\tcolor: var(--color-ink);\n\t}\n\n\t.demo-grid {\n\t\tdisplay: grid;\n\t\tgrid-template-columns: repeat(auto-fit, minmax(280px, 1fr));\n\t\tgap: 1.5rem;\n\t\tmargin-top: 1rem;\n\t}\n\n\t.demo-grid > * {\n\t\tmin-width: 0;\n\t}\n\n\t.result-display {\n\t\tmargin-top: 1rem;\n\t\tpadding: 1rem;\n\t\tbackground: var(--color-muted);\n\t\tborder-radius: var(--radius-md);\n\t\tborder-left: 4px solid var(--color-primary);\n\t}\n\n\tform {\n\t\tbackground: white;\n\t\tpadding: 1.5rem;\n\t\tborder-radius: var(--radius-lg);\n\t\tborder: 1px solid var(--color-border);\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: 1rem;\n\t}\n";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const selectDemoHTML = "\n\t<div class=\"demo-container\">\n\t\t<h1>Select Component Demo</h1>\n\t\t<p>Customizable dropdown select with search and multi-configuration options.</p>\n\n\t\t<div class=\"demo-section\">\n\t\t\t<h2>Basic Select</h2>\n\t\t\t<div class=\"demo-grid\">\n\t\t\t\t<ui-select \n\t\t\t\t\tid=\"basicSelect\"\n\t\t\t\t\tlabel=\"Choose a Fruit\"\n\t\t\t\t\tplaceholder=\"Select a fruit...\"\n\t\t\t\t></ui-select>\n\t\t\t\t\n\t\t\t\t<ui-select \n\t\t\t\t\tid=\"disabledSelect\"\n\t\t\t\t\tlabel=\"Disabled Select\"\n\t\t\t\t\tplaceholder=\"Not available\"\n\t\t\t\t\tdisabled\n\t\t\t\t></ui-select>\n\t\t\t</div>\n\t\t\t<div id=\"basicResult\" class=\"result-display\" style=\"display: none;\">\n\t\t\t\t<strong>Selected:</strong> <span id=\"basicValue\"></span>\n\t\t\t</div>\n\t\t</div>\n\n\t\t<div class=\"demo-section\">\n\t\t\t<h2>Searchable Select</h2>\n\t\t\t<div class=\"demo-grid\">\n\t\t\t\t<ui-select \n\t\t\t\t\tid=\"searchableSelect\"\n\t\t\t\t\tlabel=\"Choose a Country\"\n\t\t\t\t\tplaceholder=\"Search countries...\"\n\t\t\t\t\tsearchable\n\t\t\t\t></ui-select>\n\t\t\t</div>\n\t\t\t<div id=\"searchResult\" class=\"result-display\" style=\"display: none;\">\n\t\t\t\t<strong>Selected Country:</strong> <span id=\"searchValue\"></span>\n\t\t\t</div>\n\t\t</div>\n\n\t\t<div class=\"demo-section\">\n\t\t\t<h2>Select Sizes & Preselected</h2>\n\t\t\t<div class=\"demo-grid\">\n\t\t\t\t<ui-select \n\t\t\t\t\tid=\"preselectedSelect\"\n\t\t\t\t\tlabel=\"Choose a Programming Language\"\n\t\t\t\t\tplaceholder=\"Select language...\"\n\t\t\t\t\tvalue=\"javascript\"\n\t\t\t\t></ui-select>\n\t\t\t</div>\n\t\t\t<div id=\"preselectedResult\" class=\"result-display\" style=\"display: none;\">\n\t\t\t\t<strong>Selected:</strong> <span id=\"preselectedValue\"></span>\n\t\t\t</div>\n\t\t</div>\n\n\t\t<div class=\"demo-section\">\n\t\t\t<h2>Form Example</h2>\n\t\t\t<form id=\"userForm\" style=\"max-width: 600px;\">\n\t\t\t\t<ui-select \n\t\t\t\t\tid=\"roleSelect\"\n\t\t\t\t\tlabel=\"User Role\"\n\t\t\t\t\tplaceholder=\"Select role...\"\n\t\t\t\t></ui-select>\n\n\t\t\t\t<ui-select \n\t\t\t\t\tid=\"departmentSelect\"\n\t\t\t\t\tlabel=\"Department\"\n\t\t\t\t\tplaceholder=\"Select department...\"\n\t\t\t\t></ui-select>\n\n\t\t\t\t<div style=\"margin-top: 0.5rem; display: flex; gap: 1rem;\">\n\t\t\t\t\t<ui-button type=\"submit\" variant=\"primary\" icon=\"check\">Submit</ui-button>\n\t\t\t\t\t<ui-button type=\"button\" id=\"resetForm\" variant=\"ghost\">Reset</ui-button>\n\t\t\t\t</div>\n\t\t\t</form>\n\t\t\t<div id=\"formResult\" class=\"result-display\" style=\"display: none; margin-top: 1rem;\">\n\t\t\t\t<strong>Form Data:</strong><br>\n\t\t\t\t<span id=\"formValue\"></span>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const stepperDemoCSS = "\n\t:host {\n\t\tdisplay: block;\n\t\tcolor: var(--color-ink);\n\t}\n\n\t.stepper-hero {\n\t\tdisplay: flex;\n\t\tjustify-content: space-between;\n\t\talign-items: center;\n\t\tpadding: 2rem;\n\t\tborder-radius: 20px;\n\t\tbackground: radial-gradient(circle at top left, rgba(36, 236, 113, 0.2), transparent 45%),\n\t\t\tlinear-gradient(135deg, rgba(52, 168, 235, 0.12), rgba(255, 255, 255, 0.9));\n\t\tborder: 1px solid rgba(52, 168, 235, 0.2);\n\t\tmargin-bottom: 2rem;\n\t\tgap: 1.5rem;\n\t\tflex-wrap: wrap;\n\t}\n\n\t.eyebrow {\n\t\ttext-transform: uppercase;\n\t\tletter-spacing: 0.2em;\n\t\tfont-size: 0.7rem;\n\t\tcolor: rgba(15, 23, 42, 0.55);\n\t\tmargin: 0 0 0.75rem;\n\t\tfont-weight: 700;\n\t}\n\n\th1 {\n\t\tfont-size: 2.4rem;\n\t\tmargin: 0 0 0.5rem;\n\t}\n\n\t.hero-subtitle {\n\t\tmax-width: 520px;\n\t\tmargin: 0;\n\t\tcolor: rgba(15, 23, 42, 0.65);\n\t\tfont-size: 1rem;\n\t\tline-height: 1.6;\n\t}\n\n\t.hero-badge {\n\t\tpadding: 0.4rem 0.9rem;\n\t\tborder-radius: 999px;\n\t\tfont-size: 0.75rem;\n\t\tfont-weight: 700;\n\t\ttext-transform: uppercase;\n\t\tletter-spacing: 0.14em;\n\t\tbackground: #0f172a;\n\t\tcolor: #ffffff;\n\t\tbox-shadow: 0 12px 24px rgba(15, 23, 42, 0.15);\n\t}\n\n\t.stepper-section {\n\t\tmargin-bottom: 2rem;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: 1.5rem;\n\t}\n\n\t.stepper-section.grid {\n\t\tdisplay: grid;\n\t\tgrid-template-columns: repeat(auto-fit, minmax(280px, 1fr));\n\t\tgap: 1.5rem;\n\t}\n\n\t.section-head h2 {\n\t\tmargin: 0 0 0.35rem;\n\t\tfont-size: 1.4rem;\n\t}\n\n\t.section-head p {\n\t\tmargin: 0;\n\t\tcolor: rgba(15, 23, 42, 0.6);\n\t\tfont-size: 0.95rem;\n\t}\n\n\t.stepper-card {\n\t\tpadding: 1.5rem;\n\t\tborder-radius: 16px;\n\t\tborder: 1px solid rgba(148, 163, 184, 0.3);\n\t\tbackground: #ffffff;\n\t\tbox-shadow: 0 16px 32px rgba(15, 23, 42, 0.08);\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: 1.5rem;\n\t}\n\n\t.stepper-controls {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: space-between;\n\t\tgap: 1rem;\n\t\tflex-wrap: wrap;\n\t}\n\n\t.stepper-preview {\n\t\tborder-radius: 14px;\n\t\tpadding: 1.25rem;\n\t\tbackground: linear-gradient(135deg, rgba(36, 236, 113, 0.12), rgba(255, 255, 255, 0.9));\n\t\tborder: 1px solid rgba(36, 236, 113, 0.25);\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: 0.65rem;\n\t\tmin-height: 140px;\n\t\tanimation: fadeSlide 0.25s ease;\n\t}\n\n\t.stepper-preview h3 {\n\t\tmargin: 0;\n\t\tfont-size: 1.1rem;\n\t}\n\n\t.stepper-preview p {\n\t\tmargin: 0;\n\t\tcolor: rgba(15, 23, 42, 0.65);\n\t\tfont-size: 0.95rem;\n\t\tline-height: 1.5;\n\t}\n\n\t.stepper-preview ul {\n\t\tmargin: 0;\n\t\tpadding-left: 1.2rem;\n\t\tcolor: rgba(15, 23, 42, 0.65);\n\t\tfont-size: 0.9rem;\n\t\tdisplay: grid;\n\t\tgap: 0.35rem;\n\t}\n\n\t.actions {\n\t\tdisplay: flex;\n\t\tgap: 0.75rem;\n\t\talign-items: center;\n\t}\n\n\t.status-pill {\n\t\tpadding: 0.35rem 0.9rem;\n\t\tbackground: rgba(36, 236, 113, 0.15);\n\t\tborder-radius: 999px;\n\t\tfont-size: 0.85rem;\n\t\tfont-weight: 600;\n\t\tcolor: #166534;\n\t}\n\n\t@keyframes fadeSlide {\n\t\tfrom {\n\t\t\topacity: 0;\n\t\t\ttransform: translateY(6px);\n\t\t}\n\t\tto {\n\t\t\topacity: 1;\n\t\t\ttransform: translateY(0);\n\t\t}\n\t}\n\n\t@media (max-width: 720px) {\n\t\t.stepper-hero {\n\t\t\tpadding: 1.5rem;\n\t\t}\n\n\t\th1 {\n\t\t\tfont-size: 2rem;\n\t\t}\n\t}\n";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const stepperDemoHTML = "\n\t<section class=\"stepper-hero\">\n\t\t<div>\n\t\t\t<p class=\"eyebrow\">Flow control</p>\n\t\t\t<h1>Stepper</h1>\n\t\t\t<p class=\"hero-subtitle\">\n\t\t\t\tGuide users across multi-step journeys with clear progress, states, and actions.\n\t\t\t</p>\n\t\t</div>\t\t\n\t</section>\n\n\t<section class=\"stepper-section\">\n\t\t<div class=\"section-head\">\n\t\t\t<h2>Interactive progress</h2>\n\t\t\t<p>Move between steps to preview states and content density.</p>\n\t\t</div>\n\t\t<div class=\"stepper-card\">\n\t\t\t<ui-stepper id=\"interactiveStepper\" size=\"md\"></ui-stepper>\n\t\t\t<div class=\"stepper-preview\" id=\"interactiveContent\"></div>\n\t\t\t<div class=\"stepper-controls\">\n\t\t\t\t<div class=\"status-pill\" id=\"interactiveStatus\">Step 2 of 5</div>\n\t\t\t\t<div class=\"actions\">\n\t\t\t\t\t<ui-button id=\"prevStep\" variant=\"secondary\" size=\"sm\">Previous</ui-button>\n\t\t\t\t\t<ui-button id=\"nextStep\" variant=\"primary\" size=\"sm\">Next</ui-button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</section>\n\n\t<section class=\"stepper-section grid\">\n\t\t<div class=\"stepper-card\">\n\t\t\t<div class=\"section-head\">\n\t\t\t\t<h2>Compact workflow</h2>\n\t\t\t\t<p>Small size for tight layouts or onboarding drawers.</p>\n\t\t\t</div>\n\t\t\t<ui-stepper id=\"compactStepper\" size=\"sm\"></ui-stepper>\n\t\t</div>\n\t\t<div class=\"stepper-card\">\n\t\t\t<div class=\"section-head\">\n\t\t\t\t<h2>Vertical journey</h2>\n\t\t\t\t<p>Perfect for forms, checklists, and long content.</p>\n\t\t\t</div>\n\t\t\t<ui-stepper id=\"verticalStepper\" orientation=\"vertical\" size=\"lg\"></ui-stepper>\n\t\t</div>\n\t</section>\n\n\t<section class=\"stepper-section\">\n\t\t<div class=\"section-head\">\n\t\t\t<h2>Status flavors</h2>\n\t\t\t<p>Explicit states like warning and error bring clarity to complex flows.</p>\n\t\t</div>\n\t\t<div class=\"stepper-card\">\n\t\t\t<ui-stepper id=\"statusStepper\" size=\"md\"></ui-stepper>\n\t\t</div>\n\t</section>\n";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { BaseComponent } from '../../core/base-component';
|
|
2
|
+
import '../../shared/components/table';
|
|
3
|
+
import '../../shared/components/pagination';
|
|
4
|
+
import '../../layouts/app-layout';
|
|
5
|
+
import '../../shared/components/modal';
|
|
6
|
+
declare class TableDemo extends BaseComponent {
|
|
7
|
+
private hasLoaded;
|
|
8
|
+
private loading;
|
|
9
|
+
private error;
|
|
10
|
+
private data;
|
|
11
|
+
private currentPage;
|
|
12
|
+
private pageSize;
|
|
13
|
+
connectedCallback(): void;
|
|
14
|
+
private loadData;
|
|
15
|
+
private showActionMessage;
|
|
16
|
+
render(): void;
|
|
17
|
+
}
|
|
18
|
+
export { TableDemo };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BaseComponent } from '../core/base-component';
|
|
2
|
+
import '../shared/components/sidebar';
|
|
3
|
+
import '../shared/components/top-bar';
|
|
4
|
+
import '../shared/components/button';
|
|
5
|
+
import type { RouteOld } from '../core/router';
|
|
6
|
+
export declare const routes: RouteOld[];
|
|
7
|
+
declare class AppLayout extends BaseComponent {
|
|
8
|
+
private pageTitle;
|
|
9
|
+
private pageSubtitle;
|
|
10
|
+
private navItems;
|
|
11
|
+
private footerItems;
|
|
12
|
+
connectedCallback(): void;
|
|
13
|
+
private updateTitle;
|
|
14
|
+
render(): void;
|
|
15
|
+
}
|
|
16
|
+
export { AppLayout };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export { UIButton } from '../shared/components/button';
|
|
2
|
+
export { UIInput } from '../shared/components/input';
|
|
3
|
+
export { UITable } from '../shared/components/table';
|
|
4
|
+
export { UIDatePicker } from '../shared/components/date-picker';
|
|
5
|
+
export { UIPagination } from '../shared/components/pagination';
|
|
6
|
+
export { UIModal } from '../shared/components/modal';
|
|
7
|
+
export { UISelect } from '../shared/components/select';
|
|
8
|
+
export { UICheckbox } from '../shared/components/checkbox';
|
|
9
|
+
export { UITabs } from '../shared/components/tabs';
|
|
10
|
+
export { UICard } from '../shared/components/card';
|
|
11
|
+
export { UIToast } from '../shared/components/toast';
|
|
12
|
+
export { UIStepper } from '../shared/components/stepper';
|
|
13
|
+
export { UIUpload } from '../shared/components/upload';
|
|
14
|
+
export { UILayout, UILayoutHeader, UILayoutFooter, UILayoutContent, UILayoutSidebar } from '../shared/components/layout';
|
|
15
|
+
export { BaseComponent } from '../core/base-component';
|
|
16
|
+
export type { Signal } from '../core/base-component';
|
|
17
|
+
export type { ButtonVariant, ButtonSize } from '../shared/components/button';
|
|
18
|
+
export type { InputType, ValidationResult, CustomValidator, ValidationRule } from '../shared/components/input';
|
|
19
|
+
export type { TableColumn, TableRow } from '../shared/components/table';
|
|
20
|
+
export type { SelectOption } from '../shared/components/select';
|
|
21
|
+
export type { TabChangeDetail } from '../shared/components/tabs';
|
|
22
|
+
export type { ToastType, ToastPosition, ToastConfig } from '../shared/components/toast';
|
|
23
|
+
export type { StepperOrientation, StepperSize, StepperStep, StepChangeDetail, StepState } from '../shared/components/stepper';
|
|
24
|
+
export { http, HTTPClient } from '../core/http';
|
|
25
|
+
export type { RequestConfig, ResponseConfig, RequestInterceptor, ResponseInterceptor, ErrorInterceptor } from '../core/http';
|
|
26
|
+
export { queryElement, queryElements, queryTable, queryPagination, queryModal, addEventListenerById, getElementById, getFormValues } from '../core/dom-helpers';
|
|
27
|
+
export type { UITableElement, UIPaginationElement, UIModalElement, FormValue, GetFormValuesOptions } from '../core/dom-helpers';
|
|
28
|
+
export { createRouter } from '../core/router';
|
|
29
|
+
export type { Route } from '../core/router';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { BaseComponent } from '../../core/base-component';
|
|
2
|
+
type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'danger';
|
|
3
|
+
type ButtonSize = 'sm' | 'md' | 'lg';
|
|
4
|
+
declare class UIButton extends BaseComponent {
|
|
5
|
+
connectedCallback(): void;
|
|
6
|
+
static get observedAttributes(): string[];
|
|
7
|
+
attributeChangedCallback(): void;
|
|
8
|
+
private attachClickHandler;
|
|
9
|
+
private getVariant;
|
|
10
|
+
private getSize;
|
|
11
|
+
private getType;
|
|
12
|
+
private getIcon;
|
|
13
|
+
private getIconPosition;
|
|
14
|
+
render(): void;
|
|
15
|
+
}
|
|
16
|
+
export { UIButton };
|
|
17
|
+
export type { ButtonVariant, ButtonSize };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BaseComponent } from '../../core/base-component';
|
|
2
|
+
declare class UICard extends BaseComponent {
|
|
3
|
+
connectedCallback(): void;
|
|
4
|
+
static get observedAttributes(): string[];
|
|
5
|
+
attributeChangedCallback(): void;
|
|
6
|
+
private getShadow;
|
|
7
|
+
private getShadowColor;
|
|
8
|
+
private getRounded;
|
|
9
|
+
private getVariant;
|
|
10
|
+
private getElevation;
|
|
11
|
+
render(): void;
|
|
12
|
+
}
|
|
13
|
+
export { UICard };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BaseComponent } from '../../core/base-component';
|
|
2
|
+
declare class UICheckbox extends BaseComponent {
|
|
3
|
+
private checked;
|
|
4
|
+
private indeterminate;
|
|
5
|
+
connectedCallback(): void;
|
|
6
|
+
static get observedAttributes(): string[];
|
|
7
|
+
attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
|
|
8
|
+
private handleChange;
|
|
9
|
+
setChecked(checked: boolean): void;
|
|
10
|
+
setIndeterminate(indeterminate: boolean): void;
|
|
11
|
+
render(): void;
|
|
12
|
+
}
|
|
13
|
+
export { UICheckbox };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { BaseComponent } from '../../core/base-component';
|
|
2
|
+
declare class UIDatePicker extends BaseComponent {
|
|
3
|
+
private inputElement;
|
|
4
|
+
private isComponentConnected;
|
|
5
|
+
private isInternalUpdate;
|
|
6
|
+
private hasRendered;
|
|
7
|
+
connectedCallback(): void;
|
|
8
|
+
static get observedAttributes(): string[];
|
|
9
|
+
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
10
|
+
private updateInputValues;
|
|
11
|
+
private getFormat;
|
|
12
|
+
private getValue;
|
|
13
|
+
private getMin;
|
|
14
|
+
private getMax;
|
|
15
|
+
private getPlaceholder;
|
|
16
|
+
private getLabel;
|
|
17
|
+
private isDisabled;
|
|
18
|
+
/**
|
|
19
|
+
* Convert date from ISO format (YYYY-MM-DD) to specified format
|
|
20
|
+
*/
|
|
21
|
+
private formatDate;
|
|
22
|
+
/**
|
|
23
|
+
* Convert date from specified format to ISO format (YYYY-MM-DD)
|
|
24
|
+
*/
|
|
25
|
+
private parseDate;
|
|
26
|
+
private attachEventListeners;
|
|
27
|
+
private isValidDate;
|
|
28
|
+
private dispatchDateChange;
|
|
29
|
+
/**
|
|
30
|
+
* Get the current value in ISO format (YYYY-MM-DD)
|
|
31
|
+
*/
|
|
32
|
+
getISOValue(): string;
|
|
33
|
+
/**
|
|
34
|
+
* Get the current value in the specified format
|
|
35
|
+
*/
|
|
36
|
+
getFormattedValue(): string;
|
|
37
|
+
/**
|
|
38
|
+
* Set the date value (accepts ISO format)
|
|
39
|
+
*/
|
|
40
|
+
setValue(isoDate: string): void;
|
|
41
|
+
/**
|
|
42
|
+
* Clear the date value
|
|
43
|
+
*/
|
|
44
|
+
clear(): void;
|
|
45
|
+
render(): void;
|
|
46
|
+
}
|
|
47
|
+
export { UIDatePicker };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { BaseComponent } from '../../core/base-component';
|
|
2
|
+
type InputType = 'text' | 'email' | 'password' | 'number' | 'tel' | 'url';
|
|
3
|
+
interface ValidationResult {
|
|
4
|
+
valid: boolean;
|
|
5
|
+
message?: string;
|
|
6
|
+
}
|
|
7
|
+
type CustomValidator = (value: string, input: HTMLInputElement) => ValidationResult;
|
|
8
|
+
type ValidationRule = {
|
|
9
|
+
type: 'emailDomain';
|
|
10
|
+
domain: string;
|
|
11
|
+
} | {
|
|
12
|
+
type: 'match';
|
|
13
|
+
selector: string;
|
|
14
|
+
} | {
|
|
15
|
+
type: 'minLength';
|
|
16
|
+
length: number;
|
|
17
|
+
} | {
|
|
18
|
+
type: 'maxLength';
|
|
19
|
+
length: number;
|
|
20
|
+
} | {
|
|
21
|
+
type: 'regex';
|
|
22
|
+
pattern: string;
|
|
23
|
+
};
|
|
24
|
+
declare class UIInput extends BaseComponent<{
|
|
25
|
+
value: string;
|
|
26
|
+
valid: boolean;
|
|
27
|
+
touched: boolean;
|
|
28
|
+
error: string;
|
|
29
|
+
}> {
|
|
30
|
+
private inputEl;
|
|
31
|
+
private customValidator;
|
|
32
|
+
private validationRule;
|
|
33
|
+
static get observedAttributes(): string[];
|
|
34
|
+
constructor();
|
|
35
|
+
connectedCallback(): void;
|
|
36
|
+
attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
|
|
37
|
+
setCustomValidator(validator: CustomValidator): void;
|
|
38
|
+
get value(): string;
|
|
39
|
+
set value(val: string);
|
|
40
|
+
get isValid(): boolean;
|
|
41
|
+
checkValidity(): boolean;
|
|
42
|
+
reportValidity(): boolean;
|
|
43
|
+
private getType;
|
|
44
|
+
private getLabel;
|
|
45
|
+
private getPlaceholder;
|
|
46
|
+
private getName;
|
|
47
|
+
private getErrorMessage;
|
|
48
|
+
private getCustomError;
|
|
49
|
+
private parseValidationRule;
|
|
50
|
+
private applyValidationRule;
|
|
51
|
+
private validate;
|
|
52
|
+
private handleInput;
|
|
53
|
+
private handleBlur;
|
|
54
|
+
private updateErrorDisplay;
|
|
55
|
+
private needsRender;
|
|
56
|
+
render(): void;
|
|
57
|
+
}
|
|
58
|
+
export { UIInput };
|
|
59
|
+
export type { InputType, ValidationResult, CustomValidator, ValidationRule };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { BaseComponent } from '../../core/base-component';
|
|
2
|
+
/**
|
|
3
|
+
* ui-layout: Main layout container that manages flex direction
|
|
4
|
+
* Supports: horizontal (header-footer with content), vertical, auto (detects based on children)
|
|
5
|
+
*/
|
|
6
|
+
declare class UILayout extends BaseComponent {
|
|
7
|
+
connectedCallback(): void;
|
|
8
|
+
static get observedAttributes(): string[];
|
|
9
|
+
attributeChangedCallback(): void;
|
|
10
|
+
private getDirection;
|
|
11
|
+
private detectDirection;
|
|
12
|
+
render(): void;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* ui-layout-header: Header section with optional height
|
|
16
|
+
*/
|
|
17
|
+
declare class UILayoutHeader extends BaseComponent {
|
|
18
|
+
connectedCallback(): void;
|
|
19
|
+
static get observedAttributes(): string[];
|
|
20
|
+
attributeChangedCallback(): void;
|
|
21
|
+
private getHeight;
|
|
22
|
+
render(): void;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* ui-layout-footer: Footer section with optional height
|
|
26
|
+
*/
|
|
27
|
+
declare class UILayoutFooter extends BaseComponent {
|
|
28
|
+
connectedCallback(): void;
|
|
29
|
+
static get observedAttributes(): string[];
|
|
30
|
+
attributeChangedCallback(): void;
|
|
31
|
+
private getHeight;
|
|
32
|
+
render(): void;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* ui-layout-content: Main content area (grows to fill available space)
|
|
36
|
+
*/
|
|
37
|
+
declare class UILayoutContent extends BaseComponent {
|
|
38
|
+
connectedCallback(): void;
|
|
39
|
+
render(): void;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* ui-layout-sidebar: Sidebar with collapse functionality
|
|
43
|
+
*/
|
|
44
|
+
declare class UILayoutSidebar extends BaseComponent {
|
|
45
|
+
private isCollapsed;
|
|
46
|
+
private animating;
|
|
47
|
+
connectedCallback(): void;
|
|
48
|
+
static get observedAttributes(): string[];
|
|
49
|
+
attributeChangedCallback(name: string): void;
|
|
50
|
+
private getWidth;
|
|
51
|
+
private getCollapsedWidth;
|
|
52
|
+
private isCollapsible;
|
|
53
|
+
private attachEventListeners;
|
|
54
|
+
private toggleCollapse;
|
|
55
|
+
render(): void;
|
|
56
|
+
}
|
|
57
|
+
export { UILayout, UILayoutHeader, UILayoutFooter, UILayoutContent, UILayoutSidebar };
|
|
File without changes
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BaseComponent } from '../../core/base-component';
|
|
2
|
+
declare class UIModal extends BaseComponent {
|
|
3
|
+
private isOpen;
|
|
4
|
+
connectedCallback(): void;
|
|
5
|
+
static get observedAttributes(): string[];
|
|
6
|
+
attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
|
|
7
|
+
private setupEventListeners;
|
|
8
|
+
open(): void;
|
|
9
|
+
close(): void;
|
|
10
|
+
private handleBackdropClick;
|
|
11
|
+
render(): void;
|
|
12
|
+
}
|
|
13
|
+
export { UIModal };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { BaseComponent } from '../../core/base-component';
|
|
2
|
+
declare class UIPagination extends BaseComponent {
|
|
3
|
+
private _total;
|
|
4
|
+
private _currentPage;
|
|
5
|
+
private _pageSize;
|
|
6
|
+
connectedCallback(): void;
|
|
7
|
+
static get observedAttributes(): string[];
|
|
8
|
+
attributeChangedCallback(name: string, _oldValue: string, newValue: string): void;
|
|
9
|
+
get total(): number;
|
|
10
|
+
set total(value: number);
|
|
11
|
+
get currentPage(): number;
|
|
12
|
+
set currentPage(value: number);
|
|
13
|
+
get pageSize(): number;
|
|
14
|
+
set pageSize(value: number);
|
|
15
|
+
get totalPages(): number;
|
|
16
|
+
private handlePageChange;
|
|
17
|
+
private getPageNumbers;
|
|
18
|
+
render(): void;
|
|
19
|
+
private attachEventListeners;
|
|
20
|
+
}
|
|
21
|
+
export { UIPagination };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { BaseComponent } from '../../core/base-component';
|
|
2
|
+
interface SelectOption {
|
|
3
|
+
value: string;
|
|
4
|
+
label: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
}
|
|
7
|
+
declare class UISelect extends BaseComponent {
|
|
8
|
+
private isOpen;
|
|
9
|
+
private selectedValue;
|
|
10
|
+
private searchTerm;
|
|
11
|
+
private options;
|
|
12
|
+
connectedCallback(): void;
|
|
13
|
+
static get observedAttributes(): string[];
|
|
14
|
+
attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
|
|
15
|
+
private parseOptions;
|
|
16
|
+
private setupClickOutside;
|
|
17
|
+
private toggleDropdown;
|
|
18
|
+
private selectOption;
|
|
19
|
+
private handleSearch;
|
|
20
|
+
private getFilteredOptions;
|
|
21
|
+
private getSelectedLabel;
|
|
22
|
+
render(): void;
|
|
23
|
+
}
|
|
24
|
+
export { UISelect };
|
|
25
|
+
export type { SelectOption };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { BaseComponent } from '../../core/base-component';
|
|
2
|
+
declare class AppSidebar extends BaseComponent {
|
|
3
|
+
private navItems;
|
|
4
|
+
private footerItems;
|
|
5
|
+
connectedCallback(): void;
|
|
6
|
+
set items(items: Array<{
|
|
7
|
+
icon: string;
|
|
8
|
+
label: string;
|
|
9
|
+
href: string;
|
|
10
|
+
}>);
|
|
11
|
+
get items(): Array<{
|
|
12
|
+
icon: string;
|
|
13
|
+
label: string;
|
|
14
|
+
href: string;
|
|
15
|
+
}>;
|
|
16
|
+
set footer(items: Array<{
|
|
17
|
+
icon: string;
|
|
18
|
+
label: string;
|
|
19
|
+
href: string;
|
|
20
|
+
}>);
|
|
21
|
+
get footer(): Array<{
|
|
22
|
+
icon: string;
|
|
23
|
+
label: string;
|
|
24
|
+
href: string;
|
|
25
|
+
}>;
|
|
26
|
+
private updateActiveState;
|
|
27
|
+
private renderIcon;
|
|
28
|
+
render(): void;
|
|
29
|
+
}
|
|
30
|
+
export { AppSidebar };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { BaseComponent } from '../../core/base-component';
|
|
2
|
+
type StepperOrientation = 'horizontal' | 'vertical';
|
|
3
|
+
type StepperSize = 'sm' | 'md' | 'lg';
|
|
4
|
+
type StepState = 'complete' | 'active' | 'upcoming' | 'error' | 'warning';
|
|
5
|
+
type StepperStep = {
|
|
6
|
+
title: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
state?: StepState;
|
|
10
|
+
};
|
|
11
|
+
type StepChangeDetail = {
|
|
12
|
+
index: number;
|
|
13
|
+
step: StepperStep;
|
|
14
|
+
state: StepState;
|
|
15
|
+
};
|
|
16
|
+
declare class UIStepper extends BaseComponent {
|
|
17
|
+
private steps;
|
|
18
|
+
connectedCallback(): void;
|
|
19
|
+
static get observedAttributes(): string[];
|
|
20
|
+
attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
|
|
21
|
+
private parseSteps;
|
|
22
|
+
private getOrientation;
|
|
23
|
+
private getSize;
|
|
24
|
+
private getActiveIndex;
|
|
25
|
+
private resolveState;
|
|
26
|
+
private setActive;
|
|
27
|
+
private escapeHtml;
|
|
28
|
+
render(): void;
|
|
29
|
+
}
|
|
30
|
+
export { UIStepper };
|
|
31
|
+
export type { StepperOrientation, StepperSize, StepperStep, StepChangeDetail, StepState };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { BaseComponent } from '../../core/base-component';
|
|
2
|
+
import './button';
|
|
3
|
+
export type TableColumn = {
|
|
4
|
+
key: string;
|
|
5
|
+
label: string;
|
|
6
|
+
align?: 'left' | 'center' | 'right';
|
|
7
|
+
visible?: boolean;
|
|
8
|
+
actions?: {
|
|
9
|
+
edit?: boolean;
|
|
10
|
+
delete?: boolean;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export type TableRow = Record<string, unknown>;
|
|
14
|
+
type ActionEventDetail = {
|
|
15
|
+
row: TableRow;
|
|
16
|
+
rowIndex: number;
|
|
17
|
+
};
|
|
18
|
+
declare class UITable extends BaseComponent {
|
|
19
|
+
connectedCallback(): void;
|
|
20
|
+
private columns;
|
|
21
|
+
private rows;
|
|
22
|
+
set data(value: {
|
|
23
|
+
columns: TableColumn[];
|
|
24
|
+
rows: TableRow[];
|
|
25
|
+
});
|
|
26
|
+
get data(): {
|
|
27
|
+
columns: TableColumn[];
|
|
28
|
+
rows: TableRow[];
|
|
29
|
+
};
|
|
30
|
+
render(): void;
|
|
31
|
+
}
|
|
32
|
+
export { UITable };
|
|
33
|
+
export type { ActionEventDetail };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BaseComponent } from '../../core/base-component';
|
|
2
|
+
type TabChangeDetail = {
|
|
3
|
+
id: string;
|
|
4
|
+
};
|
|
5
|
+
declare class UITabs extends BaseComponent {
|
|
6
|
+
private activeId;
|
|
7
|
+
private indicator;
|
|
8
|
+
static get observedAttributes(): string[];
|
|
9
|
+
connectedCallback(): void;
|
|
10
|
+
disconnectedCallback(): void;
|
|
11
|
+
attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
|
|
12
|
+
private handleTabClick;
|
|
13
|
+
private setActive;
|
|
14
|
+
private getTabs;
|
|
15
|
+
private getPanels;
|
|
16
|
+
private getActiveId;
|
|
17
|
+
private syncTabs;
|
|
18
|
+
private updateIndicator;
|
|
19
|
+
render(): void;
|
|
20
|
+
}
|
|
21
|
+
export { UITabs };
|
|
22
|
+
export type { TabChangeDetail };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { BaseComponent } from '../../core/base-component';
|
|
2
|
+
type ToastType = 'success' | 'error' | 'warning' | 'info';
|
|
3
|
+
type ToastPosition = 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left' | 'top-center' | 'bottom-center';
|
|
4
|
+
interface ToastConfig {
|
|
5
|
+
title: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
type?: ToastType;
|
|
8
|
+
duration?: number;
|
|
9
|
+
closable?: boolean;
|
|
10
|
+
}
|
|
11
|
+
declare class UIToast extends BaseComponent {
|
|
12
|
+
private toasts;
|
|
13
|
+
private toastCounter;
|
|
14
|
+
connectedCallback(): void;
|
|
15
|
+
static get observedAttributes(): string[];
|
|
16
|
+
attributeChangedCallback(): void;
|
|
17
|
+
private getPosition;
|
|
18
|
+
private getIcon;
|
|
19
|
+
/**
|
|
20
|
+
* Show a toast notification
|
|
21
|
+
* @param config Toast configuration
|
|
22
|
+
* @returns Toast ID for manual dismissal
|
|
23
|
+
*/
|
|
24
|
+
show(config: ToastConfig): string;
|
|
25
|
+
/**
|
|
26
|
+
* Dismiss a specific toast
|
|
27
|
+
*/
|
|
28
|
+
dismiss(toastId: string): void;
|
|
29
|
+
/**
|
|
30
|
+
* Dismiss all toasts
|
|
31
|
+
*/
|
|
32
|
+
dismissAll(): void;
|
|
33
|
+
/**
|
|
34
|
+
* Convenience methods for different toast types
|
|
35
|
+
*/
|
|
36
|
+
success(title: string, description?: string, duration?: number): string;
|
|
37
|
+
error(title: string, description?: string, duration?: number): string;
|
|
38
|
+
warning(title: string, description?: string, duration?: number): string;
|
|
39
|
+
info(title: string, description?: string, duration?: number): string;
|
|
40
|
+
private escapeHtml;
|
|
41
|
+
render(): void;
|
|
42
|
+
}
|
|
43
|
+
export { UIToast };
|
|
44
|
+
export type { ToastType, ToastPosition, ToastConfig };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BaseComponent } from '../../core/base-component';
|
|
2
|
+
declare class UITopBar extends BaseComponent {
|
|
3
|
+
connectedCallback(): void;
|
|
4
|
+
static get observedAttributes(): string[];
|
|
5
|
+
attributeChangedCallback(): void;
|
|
6
|
+
private getTitle;
|
|
7
|
+
private getSubtitle;
|
|
8
|
+
private getBgColor;
|
|
9
|
+
render(): void;
|
|
10
|
+
}
|
|
11
|
+
export { UITopBar };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BaseComponent } from '../../core/base-component';
|
|
2
|
+
declare class UIUpload extends BaseComponent {
|
|
3
|
+
private files;
|
|
4
|
+
private isDragging;
|
|
5
|
+
connectedCallback(): void;
|
|
6
|
+
static get observedAttributes(): string[];
|
|
7
|
+
attributeChangedCallback(): void;
|
|
8
|
+
get value(): string;
|
|
9
|
+
get filesValue(): File[];
|
|
10
|
+
set filesValue(files: File[]);
|
|
11
|
+
clear(): void;
|
|
12
|
+
private isDisabled;
|
|
13
|
+
private isMultiple;
|
|
14
|
+
private getAccept;
|
|
15
|
+
private getLabel;
|
|
16
|
+
private getHelper;
|
|
17
|
+
private setFiles;
|
|
18
|
+
private formatSize;
|
|
19
|
+
private syncInputFiles;
|
|
20
|
+
render(): void;
|
|
21
|
+
}
|
|
22
|
+
export { UIUpload };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@diniz/webcomponents",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Lightweight web components library",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/webcomponents.umd.js",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"dev": "vite",
|
|
22
22
|
"build": "vite build",
|
|
23
23
|
"build:prod": "vite build --mode production",
|
|
24
|
-
"build:lib": "
|
|
24
|
+
"build:lib": "vite build --config vite.lib.config.ts && tsc -p tsconfig.build.json && node scripts/copy-lib-assets.mjs",
|
|
25
25
|
"preview": "vite preview",
|
|
26
26
|
"preview:prod": "vite preview --port 4173"
|
|
27
27
|
},
|