kenikool-ui 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.
- package/README.md +144 -0
- package/dist/cdn-auto-register.js +188 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/dist/types/components/advanced/datepicker.d.ts +86 -0
- package/dist/types/components/advanced/datepicker.d.ts.map +1 -0
- package/dist/types/components/advanced/datepicker.stories.d.ts +48 -0
- package/dist/types/components/advanced/datepicker.stories.d.ts.map +1 -0
- package/dist/types/components/advanced/fileupload.d.ts +75 -0
- package/dist/types/components/advanced/fileupload.d.ts.map +1 -0
- package/dist/types/components/advanced/fileupload.stories.d.ts +46 -0
- package/dist/types/components/advanced/fileupload.stories.d.ts.map +1 -0
- package/dist/types/components/advanced/index.d.ts +4 -0
- package/dist/types/components/advanced/index.d.ts.map +1 -0
- package/dist/types/components/data/avatar.d.ts +94 -0
- package/dist/types/components/data/avatar.d.ts.map +1 -0
- package/dist/types/components/data/avatar.stories.d.ts +51 -0
- package/dist/types/components/data/avatar.stories.d.ts.map +1 -0
- package/dist/types/components/data/badge.d.ts +69 -0
- package/dist/types/components/data/badge.d.ts.map +1 -0
- package/dist/types/components/data/badge.stories.d.ts +48 -0
- package/dist/types/components/data/badge.stories.d.ts.map +1 -0
- package/dist/types/components/data/index.d.ts +5 -0
- package/dist/types/components/data/index.d.ts.map +1 -0
- package/dist/types/components/data/list.d.ts +66 -0
- package/dist/types/components/data/list.d.ts.map +1 -0
- package/dist/types/components/data/list.stories.d.ts +38 -0
- package/dist/types/components/data/list.stories.d.ts.map +1 -0
- package/dist/types/components/data/table.d.ts +70 -0
- package/dist/types/components/data/table.d.ts.map +1 -0
- package/dist/types/components/data/table.stories.d.ts +42 -0
- package/dist/types/components/data/table.stories.d.ts.map +1 -0
- package/dist/types/components/feedback/alert.d.ts +78 -0
- package/dist/types/components/feedback/alert.d.ts.map +1 -0
- package/dist/types/components/feedback/alert.stories.d.ts +35 -0
- package/dist/types/components/feedback/alert.stories.d.ts.map +1 -0
- package/dist/types/components/feedback/index.d.ts +5 -0
- package/dist/types/components/feedback/index.d.ts.map +1 -0
- package/dist/types/components/feedback/loading.d.ts +87 -0
- package/dist/types/components/feedback/loading.d.ts.map +1 -0
- package/dist/types/components/feedback/loading.stories.d.ts +48 -0
- package/dist/types/components/feedback/loading.stories.d.ts.map +1 -0
- package/dist/types/components/feedback/modal.d.ts +93 -0
- package/dist/types/components/feedback/modal.d.ts.map +1 -0
- package/dist/types/components/feedback/modal.stories.d.ts +37 -0
- package/dist/types/components/feedback/modal.stories.d.ts.map +1 -0
- package/dist/types/components/feedback/toast.d.ts +102 -0
- package/dist/types/components/feedback/toast.d.ts.map +1 -0
- package/dist/types/components/feedback/toast.stories.d.ts +51 -0
- package/dist/types/components/feedback/toast.stories.d.ts.map +1 -0
- package/dist/types/components/forms/button.d.ts +64 -0
- package/dist/types/components/forms/button.d.ts.map +1 -0
- package/dist/types/components/forms/button.stories.d.ts +52 -0
- package/dist/types/components/forms/button.stories.d.ts.map +1 -0
- package/dist/types/components/forms/checkbox.d.ts +51 -0
- package/dist/types/components/forms/checkbox.d.ts.map +1 -0
- package/dist/types/components/forms/checkbox.stories.d.ts +31 -0
- package/dist/types/components/forms/checkbox.stories.d.ts.map +1 -0
- package/dist/types/components/forms/index.d.ts +6 -0
- package/dist/types/components/forms/index.d.ts.map +1 -0
- package/dist/types/components/forms/input.d.ts +66 -0
- package/dist/types/components/forms/input.d.ts.map +1 -0
- package/dist/types/components/forms/input.stories.d.ts +49 -0
- package/dist/types/components/forms/input.stories.d.ts.map +1 -0
- package/dist/types/components/forms/radio.d.ts +51 -0
- package/dist/types/components/forms/radio.d.ts.map +1 -0
- package/dist/types/components/forms/radio.stories.d.ts +41 -0
- package/dist/types/components/forms/radio.stories.d.ts.map +1 -0
- package/dist/types/components/forms/select.d.ts +67 -0
- package/dist/types/components/forms/select.d.ts.map +1 -0
- package/dist/types/components/forms/select.stories.d.ts +42 -0
- package/dist/types/components/forms/select.stories.d.ts.map +1 -0
- package/dist/types/components/layout/card.d.ts +66 -0
- package/dist/types/components/layout/card.d.ts.map +1 -0
- package/dist/types/components/layout/card.example.d.ts +5 -0
- package/dist/types/components/layout/card.example.d.ts.map +1 -0
- package/dist/types/components/layout/card.stories.d.ts +40 -0
- package/dist/types/components/layout/card.stories.d.ts.map +1 -0
- package/dist/types/components/layout/container.d.ts +84 -0
- package/dist/types/components/layout/container.d.ts.map +1 -0
- package/dist/types/components/layout/container.stories.d.ts +40 -0
- package/dist/types/components/layout/container.stories.d.ts.map +1 -0
- package/dist/types/components/layout/grid.d.ts +76 -0
- package/dist/types/components/layout/grid.d.ts.map +1 -0
- package/dist/types/components/layout/grid.example.d.ts +11 -0
- package/dist/types/components/layout/grid.example.d.ts.map +1 -0
- package/dist/types/components/layout/grid.stories.d.ts +38 -0
- package/dist/types/components/layout/grid.stories.d.ts.map +1 -0
- package/dist/types/components/layout/index.d.ts +5 -0
- package/dist/types/components/layout/index.d.ts.map +1 -0
- package/dist/types/components/layout/stack.d.ts +82 -0
- package/dist/types/components/layout/stack.d.ts.map +1 -0
- package/dist/types/components/layout/stack.stories.d.ts +44 -0
- package/dist/types/components/layout/stack.stories.d.ts.map +1 -0
- package/dist/types/components/navigation/breadcrumbs.d.ts +62 -0
- package/dist/types/components/navigation/breadcrumbs.d.ts.map +1 -0
- package/dist/types/components/navigation/breadcrumbs.stories.d.ts +32 -0
- package/dist/types/components/navigation/breadcrumbs.stories.d.ts.map +1 -0
- package/dist/types/components/navigation/index.d.ts +4 -0
- package/dist/types/components/navigation/index.d.ts.map +1 -0
- package/dist/types/components/navigation/navbar.d.ts +66 -0
- package/dist/types/components/navigation/navbar.d.ts.map +1 -0
- package/dist/types/components/navigation/navbar.stories.d.ts +37 -0
- package/dist/types/components/navigation/navbar.stories.d.ts.map +1 -0
- package/dist/types/components/navigation/sidebar.d.ts +72 -0
- package/dist/types/components/navigation/sidebar.d.ts.map +1 -0
- package/dist/types/components/navigation/sidebar.stories.d.ts +43 -0
- package/dist/types/components/navigation/sidebar.stories.d.ts.map +1 -0
- package/dist/types/components/typography/index.d.ts +3 -0
- package/dist/types/components/typography/index.d.ts.map +1 -0
- package/dist/types/components/typography/text.d.ts +111 -0
- package/dist/types/components/typography/text.d.ts.map +1 -0
- package/dist/types/components/typography/text.stories.d.ts +48 -0
- package/dist/types/components/typography/text.stories.d.ts.map +1 -0
- package/dist/types/core/base-component.d.ts +178 -0
- package/dist/types/core/base-component.d.ts.map +1 -0
- package/dist/types/core/base-component.example.d.ts +24 -0
- package/dist/types/core/base-component.example.d.ts.map +1 -0
- package/dist/types/core/registry.d.ts +88 -0
- package/dist/types/core/registry.d.ts.map +1 -0
- package/dist/types/core/registry.example.d.ts +42 -0
- package/dist/types/core/registry.example.d.ts.map +1 -0
- package/dist/types/core/smart-defaults.d.ts +45 -0
- package/dist/types/core/smart-defaults.d.ts.map +1 -0
- package/dist/types/core/smart-defaults.example.d.ts +20 -0
- package/dist/types/core/smart-defaults.example.d.ts.map +1 -0
- package/dist/types/core/styles-parser.d.ts +107 -0
- package/dist/types/core/styles-parser.d.ts.map +1 -0
- package/dist/types/core/styles-parser.example.d.ts +10 -0
- package/dist/types/core/styles-parser.example.d.ts.map +1 -0
- package/dist/types/core/theme-system.d.ts +91 -0
- package/dist/types/core/theme-system.d.ts.map +1 -0
- package/dist/types/index.d.ts +24 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/themes/built-in-themes.d.ts +32 -0
- package/dist/types/themes/built-in-themes.d.ts.map +1 -0
- package/dist/types/themes/index.d.ts +5 -0
- package/dist/types/themes/index.d.ts.map +1 -0
- package/dist/types/types/components.d.ts +549 -0
- package/dist/types/types/components.d.ts.map +1 -0
- package/dist/types/types/index.d.ts +379 -0
- package/dist/types/types/index.d.ts.map +1 -0
- package/dist/types/types/theme-config.d.ts +674 -0
- package/dist/types/types/theme-config.d.ts.map +1 -0
- package/dist/types/types/themes.d.ts +325 -0
- package/dist/types/types/themes.d.ts.map +1 -0
- package/dist/types/types/utils.d.ts +293 -0
- package/dist/types/types/utils.d.ts.map +1 -0
- package/dist/types/types/wrappers.d.ts +335 -0
- package/dist/types/types/wrappers.d.ts.map +1 -0
- package/dist/types/utils/accessibility.d.ts +345 -0
- package/dist/types/utils/accessibility.d.ts.map +1 -0
- package/dist/types/utils/accessibility.example.d.ts +50 -0
- package/dist/types/utils/accessibility.example.d.ts.map +1 -0
- package/dist/types/utils/css-variables.d.ts +278 -0
- package/dist/types/utils/css-variables.d.ts.map +1 -0
- package/dist/types/utils/icon-system.d.ts +79 -0
- package/dist/types/utils/icon-system.d.ts.map +1 -0
- package/dist/types/utils/index.d.ts +9 -0
- package/dist/types/utils/index.d.ts.map +1 -0
- package/dist/types/utils/performance.d.ts +141 -0
- package/dist/types/utils/performance.d.ts.map +1 -0
- package/dist/types/utils/security.d.ts +109 -0
- package/dist/types/utils/security.d.ts.map +1 -0
- package/dist/types/utils/validation.d.ts +84 -0
- package/dist/types/utils/validation.d.ts.map +1 -0
- package/dist/types/wrappers/angular/components.d.ts +2 -0
- package/dist/types/wrappers/angular/components.d.ts.map +1 -0
- package/dist/types/wrappers/angular/index.d.ts +6 -0
- package/dist/types/wrappers/angular/index.d.ts.map +1 -0
- package/dist/types/wrappers/angular/module.d.ts +2 -0
- package/dist/types/wrappers/angular/module.d.ts.map +1 -0
- package/dist/types/wrappers/angular/services.d.ts +2 -0
- package/dist/types/wrappers/angular/services.d.ts.map +1 -0
- package/dist/types/wrappers/angular/types.d.ts +44 -0
- package/dist/types/wrappers/angular/types.d.ts.map +1 -0
- package/dist/types/wrappers/react/components.d.ts +2 -0
- package/dist/types/wrappers/react/components.d.ts.map +1 -0
- package/dist/types/wrappers/react/hooks.d.ts +2 -0
- package/dist/types/wrappers/react/hooks.d.ts.map +1 -0
- package/dist/types/wrappers/react/index.d.ts +6 -0
- package/dist/types/wrappers/react/index.d.ts.map +1 -0
- package/dist/types/wrappers/react/provider.d.ts +2 -0
- package/dist/types/wrappers/react/provider.d.ts.map +1 -0
- package/dist/types/wrappers/react/types.d.ts +31 -0
- package/dist/types/wrappers/react/types.d.ts.map +1 -0
- package/dist/types/wrappers/vue/components.d.ts +2 -0
- package/dist/types/wrappers/vue/components.d.ts.map +1 -0
- package/dist/types/wrappers/vue/composables.d.ts +2 -0
- package/dist/types/wrappers/vue/composables.d.ts.map +1 -0
- package/dist/types/wrappers/vue/index.d.ts +6 -0
- package/dist/types/wrappers/vue/index.d.ts.map +1 -0
- package/dist/types/wrappers/vue/plugin.d.ts +2 -0
- package/dist/types/wrappers/vue/plugin.d.ts.map +1 -0
- package/dist/types/wrappers/vue/types.d.ts +38 -0
- package/dist/types/wrappers/vue/types.d.ts.map +1 -0
- package/package.json +138 -0
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Accessibility utilities for ARIA attributes, keyboard navigation, and screen reader support
|
|
3
|
+
*
|
|
4
|
+
* Provides comprehensive accessibility features including:
|
|
5
|
+
* - ARIA attribute management
|
|
6
|
+
* - Focus management and focus trapping
|
|
7
|
+
* - Keyboard navigation helpers
|
|
8
|
+
* - Screen reader announcements
|
|
9
|
+
* - Live region management
|
|
10
|
+
*/
|
|
11
|
+
import type { AccessibilityConfig, KeyboardConfig, FocusTrap } from '../types/index.js';
|
|
12
|
+
export declare class AriaManager {
|
|
13
|
+
/**
|
|
14
|
+
* Apply ARIA attributes to an element based on configuration
|
|
15
|
+
*/
|
|
16
|
+
static applyAriaAttributes(element: HTMLElement, config: AccessibilityConfig): void;
|
|
17
|
+
/**
|
|
18
|
+
* Update ARIA expanded state
|
|
19
|
+
*/
|
|
20
|
+
static setExpanded(element: HTMLElement, expanded: boolean): void;
|
|
21
|
+
/**
|
|
22
|
+
* Update ARIA selected state
|
|
23
|
+
*/
|
|
24
|
+
static setSelected(element: HTMLElement, selected: boolean): void;
|
|
25
|
+
/**
|
|
26
|
+
* Update ARIA pressed state for toggle buttons
|
|
27
|
+
*/
|
|
28
|
+
static setPressed(element: HTMLElement, pressed: boolean): void;
|
|
29
|
+
/**
|
|
30
|
+
* Update ARIA checked state for checkboxes and radio buttons
|
|
31
|
+
*/
|
|
32
|
+
static setChecked(element: HTMLElement, checked: boolean | 'mixed'): void;
|
|
33
|
+
/**
|
|
34
|
+
* Update ARIA disabled state
|
|
35
|
+
*/
|
|
36
|
+
static setDisabled(element: HTMLElement, disabled: boolean): void;
|
|
37
|
+
/**
|
|
38
|
+
* Set ARIA describedby relationship
|
|
39
|
+
*/
|
|
40
|
+
static setDescribedBy(element: HTMLElement, describedByIds: string | string[]): void;
|
|
41
|
+
/**
|
|
42
|
+
* Set ARIA labelledby relationship
|
|
43
|
+
*/
|
|
44
|
+
static setLabelledBy(element: HTMLElement, labelledByIds: string | string[]): void;
|
|
45
|
+
/**
|
|
46
|
+
* Set ARIA controls relationship
|
|
47
|
+
*/
|
|
48
|
+
static setControls(element: HTMLElement, controlsIds: string | string[]): void;
|
|
49
|
+
/**
|
|
50
|
+
* Set ARIA owns relationship
|
|
51
|
+
*/
|
|
52
|
+
static setOwns(element: HTMLElement, ownsIds: string | string[]): void;
|
|
53
|
+
}
|
|
54
|
+
export declare class FocusManager {
|
|
55
|
+
private static focusableSelectors;
|
|
56
|
+
private static focusableCache;
|
|
57
|
+
private static cacheTimeout;
|
|
58
|
+
private static domObserver;
|
|
59
|
+
/**
|
|
60
|
+
* Get all focusable elements within a container
|
|
61
|
+
* Results are cached for 5 seconds to improve performance
|
|
62
|
+
*/
|
|
63
|
+
static getFocusableElements(container: Element): HTMLElement[];
|
|
64
|
+
/**
|
|
65
|
+
* Set up mutation observer to invalidate cache on DOM changes
|
|
66
|
+
*/
|
|
67
|
+
private static setupCacheInvalidation;
|
|
68
|
+
/**
|
|
69
|
+
* Manually invalidate the cache
|
|
70
|
+
*/
|
|
71
|
+
static invalidateCache(): void;
|
|
72
|
+
/**
|
|
73
|
+
* Disconnect the cache invalidation observer
|
|
74
|
+
*/
|
|
75
|
+
static disconnectCacheObserver(): void;
|
|
76
|
+
/**
|
|
77
|
+
* Get the first focusable element in a container
|
|
78
|
+
*/
|
|
79
|
+
static getFirstFocusable(container: Element): HTMLElement | null;
|
|
80
|
+
/**
|
|
81
|
+
* Get the last focusable element in a container
|
|
82
|
+
*/
|
|
83
|
+
static getLastFocusable(container: Element): HTMLElement | null;
|
|
84
|
+
/**
|
|
85
|
+
* Focus the first focusable element in a container
|
|
86
|
+
*/
|
|
87
|
+
static focusFirst(container: Element): boolean;
|
|
88
|
+
/**
|
|
89
|
+
* Focus the last focusable element in a container
|
|
90
|
+
*/
|
|
91
|
+
static focusLast(container: Element): boolean;
|
|
92
|
+
/**
|
|
93
|
+
* Move focus to the next focusable element
|
|
94
|
+
*/
|
|
95
|
+
static focusNext(container: Element, currentElement?: Element): boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Move focus to the previous focusable element
|
|
98
|
+
*/
|
|
99
|
+
static focusPrevious(container: Element, currentElement?: Element): boolean;
|
|
100
|
+
/**
|
|
101
|
+
* Check if an element is focusable
|
|
102
|
+
*/
|
|
103
|
+
static isFocusable(element: Element): boolean;
|
|
104
|
+
/**
|
|
105
|
+
* Save the currently focused element
|
|
106
|
+
*/
|
|
107
|
+
static saveFocus(): Element | null;
|
|
108
|
+
/**
|
|
109
|
+
* Restore focus to a previously saved element
|
|
110
|
+
*/
|
|
111
|
+
static restoreFocus(element: Element | null): boolean;
|
|
112
|
+
}
|
|
113
|
+
export declare class FocusTrapImpl implements FocusTrap {
|
|
114
|
+
private container;
|
|
115
|
+
private previouslyFocused;
|
|
116
|
+
private isActive;
|
|
117
|
+
private isPaused;
|
|
118
|
+
private keydownHandler;
|
|
119
|
+
constructor(container: Element);
|
|
120
|
+
activate(): void;
|
|
121
|
+
deactivate(): void;
|
|
122
|
+
pause(): void;
|
|
123
|
+
unpause(): void;
|
|
124
|
+
private handleKeydown;
|
|
125
|
+
}
|
|
126
|
+
export declare class KeyboardNavigation {
|
|
127
|
+
/**
|
|
128
|
+
* Standard keyboard navigation keys
|
|
129
|
+
*/
|
|
130
|
+
static readonly Keys: {
|
|
131
|
+
readonly ENTER: "Enter";
|
|
132
|
+
readonly SPACE: " ";
|
|
133
|
+
readonly TAB: "Tab";
|
|
134
|
+
readonly ESCAPE: "Escape";
|
|
135
|
+
readonly ARROW_UP: "ArrowUp";
|
|
136
|
+
readonly ARROW_DOWN: "ArrowDown";
|
|
137
|
+
readonly ARROW_LEFT: "ArrowLeft";
|
|
138
|
+
readonly ARROW_RIGHT: "ArrowRight";
|
|
139
|
+
readonly HOME: "Home";
|
|
140
|
+
readonly END: "End";
|
|
141
|
+
readonly PAGE_UP: "PageUp";
|
|
142
|
+
readonly PAGE_DOWN: "PageDown";
|
|
143
|
+
};
|
|
144
|
+
/**
|
|
145
|
+
* Create a keyboard event handler for common navigation patterns
|
|
146
|
+
*/
|
|
147
|
+
static createHandler(config: {
|
|
148
|
+
onEnter?: (event: KeyboardEvent) => void;
|
|
149
|
+
onSpace?: (event: KeyboardEvent) => void;
|
|
150
|
+
onEscape?: (event: KeyboardEvent) => void;
|
|
151
|
+
onArrowUp?: (event: KeyboardEvent) => void;
|
|
152
|
+
onArrowDown?: (event: KeyboardEvent) => void;
|
|
153
|
+
onArrowLeft?: (event: KeyboardEvent) => void;
|
|
154
|
+
onArrowRight?: (event: KeyboardEvent) => void;
|
|
155
|
+
onHome?: (event: KeyboardEvent) => void;
|
|
156
|
+
onEnd?: (event: KeyboardEvent) => void;
|
|
157
|
+
preventDefault?: string[];
|
|
158
|
+
stopPropagation?: string[];
|
|
159
|
+
}): (event: KeyboardEvent) => void;
|
|
160
|
+
/**
|
|
161
|
+
* Handle arrow key navigation in a list or menu
|
|
162
|
+
*/
|
|
163
|
+
static handleListNavigation(event: KeyboardEvent, container: Element, options?: {
|
|
164
|
+
orientation?: 'vertical' | 'horizontal' | 'both';
|
|
165
|
+
wrap?: boolean;
|
|
166
|
+
activateOnFocus?: boolean;
|
|
167
|
+
}): boolean;
|
|
168
|
+
}
|
|
169
|
+
export declare class ScreenReaderAnnouncer {
|
|
170
|
+
private static liveRegion;
|
|
171
|
+
private static politeRegion;
|
|
172
|
+
private static assertiveRegion;
|
|
173
|
+
/**
|
|
174
|
+
* Initialize live regions for screen reader announcements
|
|
175
|
+
*/
|
|
176
|
+
static initialize(): void;
|
|
177
|
+
/**
|
|
178
|
+
* Announce a message to screen readers (polite)
|
|
179
|
+
*/
|
|
180
|
+
static announce(message: string, priority?: 'polite' | 'assertive'): void;
|
|
181
|
+
/**
|
|
182
|
+
* Announce an urgent message to screen readers (assertive)
|
|
183
|
+
*/
|
|
184
|
+
static announceUrgent(message: string): void;
|
|
185
|
+
/**
|
|
186
|
+
* Announce status changes (e.g., loading, success, error)
|
|
187
|
+
*/
|
|
188
|
+
static announceStatus(status: string, message?: string): void;
|
|
189
|
+
/**
|
|
190
|
+
* Announce navigation changes
|
|
191
|
+
*/
|
|
192
|
+
static announceNavigation(location: string): void;
|
|
193
|
+
/**
|
|
194
|
+
* Announce form validation errors
|
|
195
|
+
*/
|
|
196
|
+
static announceError(error: string): void;
|
|
197
|
+
/**
|
|
198
|
+
* Announce successful actions
|
|
199
|
+
*/
|
|
200
|
+
static announceSuccess(message: string): void;
|
|
201
|
+
/**
|
|
202
|
+
* Clear all live regions
|
|
203
|
+
*/
|
|
204
|
+
static clear(): void;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* AccessibilityUtils provides comprehensive accessibility features for Web Components
|
|
208
|
+
*
|
|
209
|
+
* Features:
|
|
210
|
+
* - ARIA attribute management
|
|
211
|
+
* - Keyboard navigation support
|
|
212
|
+
* - Focus management and focus traps
|
|
213
|
+
* - Screen reader announcements
|
|
214
|
+
* - Accessibility feature initialization
|
|
215
|
+
*
|
|
216
|
+
* @example
|
|
217
|
+
* // Apply accessibility features to a component
|
|
218
|
+
* AccessibilityUtils.applyAccessibilityFeatures(element, {
|
|
219
|
+
* role: 'button',
|
|
220
|
+
* ariaLabel: 'Submit form',
|
|
221
|
+
* focusable: true,
|
|
222
|
+
* keyboardSupport: {
|
|
223
|
+
* keys: ['Enter', ' '],
|
|
224
|
+
* handler: (event, component) => {
|
|
225
|
+
* component.click();
|
|
226
|
+
* }
|
|
227
|
+
* }
|
|
228
|
+
* });
|
|
229
|
+
*
|
|
230
|
+
* @example
|
|
231
|
+
* // Create a focus trap for a modal
|
|
232
|
+
* const focusTrap = AccessibilityUtils.createFocusTrap(modalElement);
|
|
233
|
+
* focusTrap.activate();
|
|
234
|
+
* // ... modal is open
|
|
235
|
+
* focusTrap.deactivate();
|
|
236
|
+
*/
|
|
237
|
+
export declare class AccessibilityUtils {
|
|
238
|
+
/**
|
|
239
|
+
* Apply comprehensive accessibility features to a component
|
|
240
|
+
*
|
|
241
|
+
* @param element - The HTML element to apply accessibility features to
|
|
242
|
+
* @param config - Accessibility configuration object
|
|
243
|
+
*
|
|
244
|
+
* @example
|
|
245
|
+
* AccessibilityUtils.applyAccessibilityFeatures(button, {
|
|
246
|
+
* role: 'button',
|
|
247
|
+
* ariaLabel: 'Click me',
|
|
248
|
+
* focusable: true
|
|
249
|
+
* });
|
|
250
|
+
*/
|
|
251
|
+
/**
|
|
252
|
+
* Apply comprehensive accessibility features to a component
|
|
253
|
+
*/
|
|
254
|
+
static applyAccessibilityFeatures(element: HTMLElement, config: AccessibilityConfig): void;
|
|
255
|
+
/**
|
|
256
|
+
* Add keyboard event handling to an element
|
|
257
|
+
*
|
|
258
|
+
* @param element - The HTML element to add keyboard support to
|
|
259
|
+
* @param config - Keyboard configuration with keys to listen for and handler function
|
|
260
|
+
*
|
|
261
|
+
* @example
|
|
262
|
+
* AccessibilityUtils.addKeyboardSupport(button, {
|
|
263
|
+
* keys: ['Enter', ' '],
|
|
264
|
+
* handler: (event, element) => {
|
|
265
|
+
* element.click();
|
|
266
|
+
* },
|
|
267
|
+
* preventDefault: true
|
|
268
|
+
* });
|
|
269
|
+
*/
|
|
270
|
+
static addKeyboardSupport(element: HTMLElement, config: KeyboardConfig): void;
|
|
271
|
+
/**
|
|
272
|
+
* Create a focus trap for modal dialogs and dropdowns
|
|
273
|
+
*
|
|
274
|
+
* A focus trap ensures that keyboard focus stays within a container,
|
|
275
|
+
* preventing users from tabbing outside of modals or dropdowns.
|
|
276
|
+
*
|
|
277
|
+
* @param container - The container element to trap focus within
|
|
278
|
+
* @returns A FocusTrap object with activate/deactivate methods
|
|
279
|
+
*
|
|
280
|
+
* @example
|
|
281
|
+
* const focusTrap = AccessibilityUtils.createFocusTrap(modalElement);
|
|
282
|
+
* focusTrap.activate();
|
|
283
|
+
* // User can only tab within the modal
|
|
284
|
+
* focusTrap.deactivate();
|
|
285
|
+
*/
|
|
286
|
+
static createFocusTrap(container: Element): FocusTrap;
|
|
287
|
+
/**
|
|
288
|
+
* Generate a unique ID for accessibility relationships
|
|
289
|
+
*
|
|
290
|
+
* Used for aria-labelledby, aria-describedby, and other ARIA relationships
|
|
291
|
+
*
|
|
292
|
+
* @param prefix - Optional prefix for the ID (default: 'kn')
|
|
293
|
+
* @returns A unique ID string
|
|
294
|
+
*
|
|
295
|
+
* @example
|
|
296
|
+
* const id = AccessibilityUtils.generateId('label');
|
|
297
|
+
* // Returns something like 'label-a1b2c3d4e'
|
|
298
|
+
*/
|
|
299
|
+
static generateId(prefix?: string): string;
|
|
300
|
+
/**
|
|
301
|
+
* Check if reduced motion is preferred
|
|
302
|
+
*
|
|
303
|
+
* Respects the user's prefers-reduced-motion media query preference
|
|
304
|
+
*
|
|
305
|
+
* @returns true if the user prefers reduced motion, false otherwise
|
|
306
|
+
*
|
|
307
|
+
* @example
|
|
308
|
+
* if (AccessibilityUtils.prefersReducedMotion()) {
|
|
309
|
+
* // Skip animations
|
|
310
|
+
* }
|
|
311
|
+
*/
|
|
312
|
+
static prefersReducedMotion(): boolean;
|
|
313
|
+
/**
|
|
314
|
+
* Check if high contrast is preferred
|
|
315
|
+
*/
|
|
316
|
+
static prefersHighContrast(): boolean;
|
|
317
|
+
/**
|
|
318
|
+
* Initialize accessibility features globally
|
|
319
|
+
*
|
|
320
|
+
* Sets up:
|
|
321
|
+
* - Screen reader announcements
|
|
322
|
+
* - Global keyboard event handling (Escape key for modals/dropdowns)
|
|
323
|
+
* - Accessibility utilities
|
|
324
|
+
*
|
|
325
|
+
* Should be called once when the application starts
|
|
326
|
+
*
|
|
327
|
+
* @example
|
|
328
|
+
* // In your app initialization
|
|
329
|
+
* AccessibilityUtils.initialize();
|
|
330
|
+
*/
|
|
331
|
+
static initialize(): void;
|
|
332
|
+
/**
|
|
333
|
+
* Clean up accessibility resources
|
|
334
|
+
*
|
|
335
|
+
* Disconnects observers and clears screen reader announcements.
|
|
336
|
+
* Should be called when the application is shutting down or when
|
|
337
|
+
* accessibility features are no longer needed.
|
|
338
|
+
*
|
|
339
|
+
* @example
|
|
340
|
+
* // In your app cleanup
|
|
341
|
+
* AccessibilityUtils.cleanup();
|
|
342
|
+
*/
|
|
343
|
+
static cleanup(): void;
|
|
344
|
+
}
|
|
345
|
+
//# sourceMappingURL=accessibility.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accessibility.d.ts","sourceRoot":"","sources":["../../../src/utils/accessibility.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EACV,mBAAmB,EACnB,cAAc,EACd,SAAS,EACV,MAAM,mBAAmB,CAAC;AAM3B,qBAAa,WAAW;IACtB;;OAEG;IACH,MAAM,CAAC,mBAAmB,CACxB,OAAO,EAAE,WAAW,EACpB,MAAM,EAAE,mBAAmB,GAC1B,IAAI;IAgCP;;OAEG;IACH,MAAM,CAAC,WAAW,CAAC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO,GAAG,IAAI;IAIjE;;OAEG;IACH,MAAM,CAAC,WAAW,CAAC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO,GAAG,IAAI;IAIjE;;OAEG;IACH,MAAM,CAAC,UAAU,CAAC,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-0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Examples demonstrating how to use the accessibility utilities
|
|
3
|
+
* These examples show common patterns for implementing accessible components
|
|
4
|
+
*/
|
|
5
|
+
import { BaseComponent } from '../core/base-component.js';
|
|
6
|
+
import type { AccessibilityConfig } from '../types/index.js';
|
|
7
|
+
declare class ExampleButton extends BaseComponent {
|
|
8
|
+
static get observedAttributes(): string[];
|
|
9
|
+
render(): void;
|
|
10
|
+
getDefaultStyles(): CSSStyleSheet;
|
|
11
|
+
getAccessibilityConfig(): AccessibilityConfig;
|
|
12
|
+
}
|
|
13
|
+
declare class ExampleModal extends BaseComponent {
|
|
14
|
+
private focusTrap;
|
|
15
|
+
private previouslyFocused;
|
|
16
|
+
static get observedAttributes(): string[];
|
|
17
|
+
render(): void;
|
|
18
|
+
private openModal;
|
|
19
|
+
private closeModal;
|
|
20
|
+
close(): void;
|
|
21
|
+
getDefaultStyles(): CSSStyleSheet;
|
|
22
|
+
getAccessibilityConfig(): AccessibilityConfig;
|
|
23
|
+
}
|
|
24
|
+
declare class ExampleDropdown extends BaseComponent {
|
|
25
|
+
private isOpen;
|
|
26
|
+
private selectedIndex;
|
|
27
|
+
private options;
|
|
28
|
+
static get observedAttributes(): string[];
|
|
29
|
+
connectedCallback(): void;
|
|
30
|
+
private parseOptions;
|
|
31
|
+
render(): void;
|
|
32
|
+
private setupEventListeners;
|
|
33
|
+
private toggle;
|
|
34
|
+
private open;
|
|
35
|
+
private close;
|
|
36
|
+
private selectOption;
|
|
37
|
+
getDefaultStyles(): CSSStyleSheet;
|
|
38
|
+
getAccessibilityConfig(): AccessibilityConfig;
|
|
39
|
+
}
|
|
40
|
+
declare class ExampleForm extends BaseComponent {
|
|
41
|
+
private validationMessages;
|
|
42
|
+
render(): void;
|
|
43
|
+
private setupFormValidation;
|
|
44
|
+
private validateEmail;
|
|
45
|
+
private validatePassword;
|
|
46
|
+
getDefaultStyles(): CSSStyleSheet;
|
|
47
|
+
getAccessibilityConfig(): AccessibilityConfig;
|
|
48
|
+
}
|
|
49
|
+
export { ExampleButton, ExampleModal, ExampleDropdown, ExampleForm };
|
|
50
|
+
//# sourceMappingURL=accessibility.example.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accessibility.example.d.ts","sourceRoot":"","sources":["../../../src/utils/accessibility.example.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAQ1D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAM7D,cAAM,aAAc,SAAQ,aAAa;IACvC,MAAM,KAAK,kBAAkB,aAE5B;IAED,MAAM,IAAI,IAAI;IA8Dd,gBAAgB,IAAI,aAAa;IAIjC,sBAAsB,IAAI,mBAAmB;CAe9C;AAMD,cAAM,YAAa,SAAQ,aAAa;IACtC,OAAO,CAAC,SAAS,CAAa;IAC9B,OAAO,CAAC,iBAAiB,CAAwB;IAEjD,MAAM,KAAK,kBAAkB,aAE5B;IAED,MAAM,IAAI,IAAI;IAyEd,OAAO,CAAC,SAAS;IAuBjB,OAAO,CAAC,UAAU;IAkBlB,KAAK,IAAI,IAAI;IAKb,gBAAgB,IAAI,aAAa;IAIjC,sBAAsB,IAAI,mBAAmB;CAY9C;AAMD,cAAM,eAAgB,SAAQ,aAAa;IACzC,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,aAAa,CAAM;IAC3B,OAAO,CAAC,OAAO,CAAgB;IAE/B,MAAM,KAAK,kBAAkB,aAE5B;IAED,iBAAiB,IAAI,IAAI;IAOzB,OAAO,CAAC,YAAY;IAQpB,MAAM,IAAI,IAAI;IAwGd,OAAO,CAAC,mBAAmB;IAmC3B,OAAO,CAAC,MAAM;IAQd,OAAO,CAAC,IAAI;IAeZ,OAAO,CAAC,KAAK;IAYb,OAAO,CAAC,YAAY;IAuBpB,gBAAgB,IAAI,aAAa;IAIjC,sBAAsB,IAAI,mBAAmB;CA8B9C;AAMD,cAAM,WAAY,SAAQ,aAAa;IACrC,OAAO,CAAC,kBAAkB,CAA6B;IAEvD,MAAM,IAAI,IAAI;IAyFd,OAAO,CAAC,mBAAmB;IA8B3B,OAAO,CAAC,aAAa;IA6BrB,OAAO,CAAC,gBAAgB;IA6BxB,gBAAgB,IAAI,aAAa;IAIjC,sBAAsB,IAAI,mBAAmB;CAM9C;AAUD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,eAAe,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CSS Variable Naming Utilities for Kenikool UI
|
|
3
|
+
*
|
|
4
|
+
* This module provides utilities for generating and managing CSS variables
|
|
5
|
+
* according to Kenikool UI naming conventions.
|
|
6
|
+
*
|
|
7
|
+
* All CSS variables use the --kn- prefix for namespacing.
|
|
8
|
+
*
|
|
9
|
+
* Requirements: 3.3
|
|
10
|
+
*/
|
|
11
|
+
import type { ThemeConfiguration, ColorPalette, CSSVariableName, CSSVariableMap } from '../types/theme-config';
|
|
12
|
+
/**
|
|
13
|
+
* Generates a CSS variable name with the Kenikool UI namespace
|
|
14
|
+
*/
|
|
15
|
+
export declare function createCSSVariable<T extends string>(name: T): CSSVariableName<T>;
|
|
16
|
+
/**
|
|
17
|
+
* Generates CSS variable names for a color palette
|
|
18
|
+
*/
|
|
19
|
+
export declare function createColorPaletteVariables(paletteName: string): CSSVariableMap<ColorPalette>;
|
|
20
|
+
/**
|
|
21
|
+
* Standard CSS variable names for color palettes
|
|
22
|
+
*/
|
|
23
|
+
export declare const COLOR_PALETTE_VARIABLES: {
|
|
24
|
+
readonly primary: CSSVariableMap<ColorPalette>;
|
|
25
|
+
readonly secondary: CSSVariableMap<ColorPalette>;
|
|
26
|
+
readonly success: CSSVariableMap<ColorPalette>;
|
|
27
|
+
readonly warning: CSSVariableMap<ColorPalette>;
|
|
28
|
+
readonly error: CSSVariableMap<ColorPalette>;
|
|
29
|
+
readonly info: CSSVariableMap<ColorPalette>;
|
|
30
|
+
readonly neutral: CSSVariableMap<ColorPalette>;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Surface color CSS variable names
|
|
34
|
+
*/
|
|
35
|
+
export declare const SURFACE_COLOR_VARIABLES: {
|
|
36
|
+
readonly background: "--kn-surface-background";
|
|
37
|
+
readonly surface: "--kn-surface-surface";
|
|
38
|
+
readonly surfaceVariant: "--kn-surface-variant";
|
|
39
|
+
readonly surfaceElevated: "--kn-surface-elevated";
|
|
40
|
+
readonly surfaceHover: "--kn-surface-hover";
|
|
41
|
+
readonly surfaceActive: "--kn-surface-active";
|
|
42
|
+
readonly surfaceDisabled: "--kn-surface-disabled";
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Text color CSS variable names
|
|
46
|
+
*/
|
|
47
|
+
export declare const TEXT_COLOR_VARIABLES: {
|
|
48
|
+
readonly primary: "--kn-text-primary";
|
|
49
|
+
readonly secondary: "--kn-text-secondary";
|
|
50
|
+
readonly muted: "--kn-text-muted";
|
|
51
|
+
readonly inverse: "--kn-text-inverse";
|
|
52
|
+
readonly onPrimary: "--kn-text-on-primary";
|
|
53
|
+
readonly onSecondary: "--kn-text-on-secondary";
|
|
54
|
+
readonly onSurface: "--kn-text-on-surface";
|
|
55
|
+
readonly onBackground: "--kn-text-on-background";
|
|
56
|
+
readonly disabled: "--kn-text-disabled";
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Border color CSS variable names
|
|
60
|
+
*/
|
|
61
|
+
export declare const BORDER_COLOR_VARIABLES: {
|
|
62
|
+
readonly default: "--kn-border-default";
|
|
63
|
+
readonly subtle: "--kn-border-subtle";
|
|
64
|
+
readonly muted: "--kn-border-muted";
|
|
65
|
+
readonly hover: "--kn-border-hover";
|
|
66
|
+
readonly focus: "--kn-border-focus";
|
|
67
|
+
readonly active: "--kn-border-active";
|
|
68
|
+
readonly error: "--kn-border-error";
|
|
69
|
+
readonly success: "--kn-border-success";
|
|
70
|
+
readonly warning: "--kn-border-warning";
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* State color CSS variable names
|
|
74
|
+
*/
|
|
75
|
+
export declare const STATE_COLOR_VARIABLES: {
|
|
76
|
+
readonly hover: "--kn-state-hover";
|
|
77
|
+
readonly focus: "--kn-state-focus";
|
|
78
|
+
readonly active: "--kn-state-active";
|
|
79
|
+
readonly disabled: "--kn-state-disabled";
|
|
80
|
+
readonly selected: "--kn-state-selected";
|
|
81
|
+
readonly pressed: "--kn-state-pressed";
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* Overlay color CSS variable names
|
|
85
|
+
*/
|
|
86
|
+
export declare const OVERLAY_COLOR_VARIABLES: {
|
|
87
|
+
readonly backdrop: "--kn-overlay-backdrop";
|
|
88
|
+
readonly dropdown: "--kn-overlay-dropdown";
|
|
89
|
+
readonly tooltip: "--kn-overlay-tooltip";
|
|
90
|
+
readonly popover: "--kn-overlay-popover";
|
|
91
|
+
readonly loading: "--kn-overlay-loading";
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* Typography CSS variable names
|
|
95
|
+
*/
|
|
96
|
+
export declare const TYPOGRAPHY_VARIABLES: {
|
|
97
|
+
readonly fontFamily: {
|
|
98
|
+
readonly sans: "--kn-font-sans";
|
|
99
|
+
readonly serif: "--kn-font-serif";
|
|
100
|
+
readonly mono: "--kn-font-mono";
|
|
101
|
+
readonly display: "--kn-font-display";
|
|
102
|
+
};
|
|
103
|
+
readonly fontSize: {
|
|
104
|
+
readonly xs: "--kn-text-xs";
|
|
105
|
+
readonly sm: "--kn-text-sm";
|
|
106
|
+
readonly base: "--kn-text-base";
|
|
107
|
+
readonly lg: "--kn-text-lg";
|
|
108
|
+
readonly xl: "--kn-text-xl";
|
|
109
|
+
readonly '2xl': "--kn-text-2xl";
|
|
110
|
+
readonly '3xl': "--kn-text-3xl";
|
|
111
|
+
readonly '4xl': "--kn-text-4xl";
|
|
112
|
+
readonly '5xl': "--kn-text-5xl";
|
|
113
|
+
readonly '6xl': "--kn-text-6xl";
|
|
114
|
+
readonly '7xl': "--kn-text-7xl";
|
|
115
|
+
readonly '8xl': "--kn-text-8xl";
|
|
116
|
+
readonly '9xl': "--kn-text-9xl";
|
|
117
|
+
};
|
|
118
|
+
readonly fontWeight: {
|
|
119
|
+
readonly thin: "--kn-font-thin";
|
|
120
|
+
readonly extralight: "--kn-font-extralight";
|
|
121
|
+
readonly light: "--kn-font-light";
|
|
122
|
+
readonly normal: "--kn-font-normal";
|
|
123
|
+
readonly medium: "--kn-font-medium";
|
|
124
|
+
readonly semibold: "--kn-font-semibold";
|
|
125
|
+
readonly bold: "--kn-font-bold";
|
|
126
|
+
readonly extrabold: "--kn-font-extrabold";
|
|
127
|
+
readonly black: "--kn-font-black";
|
|
128
|
+
};
|
|
129
|
+
readonly lineHeight: {
|
|
130
|
+
readonly none: "--kn-leading-none";
|
|
131
|
+
readonly tight: "--kn-leading-tight";
|
|
132
|
+
readonly snug: "--kn-leading-snug";
|
|
133
|
+
readonly normal: "--kn-leading-normal";
|
|
134
|
+
readonly relaxed: "--kn-leading-relaxed";
|
|
135
|
+
readonly loose: "--kn-leading-loose";
|
|
136
|
+
};
|
|
137
|
+
readonly letterSpacing: {
|
|
138
|
+
readonly tighter: "--kn-tracking-tighter";
|
|
139
|
+
readonly tight: "--kn-tracking-tight";
|
|
140
|
+
readonly normal: "--kn-tracking-normal";
|
|
141
|
+
readonly wide: "--kn-tracking-wide";
|
|
142
|
+
readonly wider: "--kn-tracking-wider";
|
|
143
|
+
readonly widest: "--kn-tracking-widest";
|
|
144
|
+
};
|
|
145
|
+
};
|
|
146
|
+
/**
|
|
147
|
+
* Spacing CSS variable names
|
|
148
|
+
*/
|
|
149
|
+
export declare const SPACING_VARIABLES: {
|
|
150
|
+
readonly 0: "--kn-space-0";
|
|
151
|
+
readonly px: "--kn-space-px";
|
|
152
|
+
readonly 0.5: "--kn-space-0.5";
|
|
153
|
+
readonly 1: "--kn-space-1";
|
|
154
|
+
readonly 1.5: "--kn-space-1.5";
|
|
155
|
+
readonly 2: "--kn-space-2";
|
|
156
|
+
readonly 2.5: "--kn-space-2.5";
|
|
157
|
+
readonly 3: "--kn-space-3";
|
|
158
|
+
readonly 3.5: "--kn-space-3.5";
|
|
159
|
+
readonly 4: "--kn-space-4";
|
|
160
|
+
readonly 5: "--kn-space-5";
|
|
161
|
+
readonly 6: "--kn-space-6";
|
|
162
|
+
readonly 7: "--kn-space-7";
|
|
163
|
+
readonly 8: "--kn-space-8";
|
|
164
|
+
readonly 9: "--kn-space-9";
|
|
165
|
+
readonly 10: "--kn-space-10";
|
|
166
|
+
readonly 11: "--kn-space-11";
|
|
167
|
+
readonly 12: "--kn-space-12";
|
|
168
|
+
readonly 14: "--kn-space-14";
|
|
169
|
+
readonly 16: "--kn-space-16";
|
|
170
|
+
readonly 20: "--kn-space-20";
|
|
171
|
+
readonly 24: "--kn-space-24";
|
|
172
|
+
readonly 28: "--kn-space-28";
|
|
173
|
+
readonly 32: "--kn-space-32";
|
|
174
|
+
readonly 36: "--kn-space-36";
|
|
175
|
+
readonly 40: "--kn-space-40";
|
|
176
|
+
readonly 44: "--kn-space-44";
|
|
177
|
+
readonly 48: "--kn-space-48";
|
|
178
|
+
readonly 52: "--kn-space-52";
|
|
179
|
+
readonly 56: "--kn-space-56";
|
|
180
|
+
readonly 60: "--kn-space-60";
|
|
181
|
+
readonly 64: "--kn-space-64";
|
|
182
|
+
readonly 72: "--kn-space-72";
|
|
183
|
+
readonly 80: "--kn-space-80";
|
|
184
|
+
readonly 96: "--kn-space-96";
|
|
185
|
+
};
|
|
186
|
+
/**
|
|
187
|
+
* Border radius CSS variable names
|
|
188
|
+
*/
|
|
189
|
+
export declare const BORDER_RADIUS_VARIABLES: {
|
|
190
|
+
readonly none: "--kn-radius-none";
|
|
191
|
+
readonly sm: "--kn-radius-sm";
|
|
192
|
+
readonly base: "--kn-radius-base";
|
|
193
|
+
readonly md: "--kn-radius-md";
|
|
194
|
+
readonly lg: "--kn-radius-lg";
|
|
195
|
+
readonly xl: "--kn-radius-xl";
|
|
196
|
+
readonly '2xl': "--kn-radius-2xl";
|
|
197
|
+
readonly '3xl': "--kn-radius-3xl";
|
|
198
|
+
readonly full: "--kn-radius-full";
|
|
199
|
+
};
|
|
200
|
+
/**
|
|
201
|
+
* Shadow CSS variable names
|
|
202
|
+
*/
|
|
203
|
+
export declare const SHADOW_VARIABLES: {
|
|
204
|
+
readonly none: "--kn-shadow-none";
|
|
205
|
+
readonly sm: "--kn-shadow-sm";
|
|
206
|
+
readonly base: "--kn-shadow-base";
|
|
207
|
+
readonly md: "--kn-shadow-md";
|
|
208
|
+
readonly lg: "--kn-shadow-lg";
|
|
209
|
+
readonly xl: "--kn-shadow-xl";
|
|
210
|
+
readonly '2xl': "--kn-shadow-2xl";
|
|
211
|
+
readonly inner: "--kn-shadow-inner";
|
|
212
|
+
};
|
|
213
|
+
/**
|
|
214
|
+
* Transition CSS variable names
|
|
215
|
+
*/
|
|
216
|
+
export declare const TRANSITION_VARIABLES: {
|
|
217
|
+
readonly none: "--kn-transition-none";
|
|
218
|
+
readonly all: "--kn-transition-all";
|
|
219
|
+
readonly fast: "--kn-transition-fast";
|
|
220
|
+
readonly normal: "--kn-transition-normal";
|
|
221
|
+
readonly slow: "--kn-transition-slow";
|
|
222
|
+
readonly colors: "--kn-transition-colors";
|
|
223
|
+
readonly opacity: "--kn-transition-opacity";
|
|
224
|
+
readonly shadow: "--kn-transition-shadow";
|
|
225
|
+
readonly transform: "--kn-transition-transform";
|
|
226
|
+
};
|
|
227
|
+
/**
|
|
228
|
+
* Breakpoint CSS variable names
|
|
229
|
+
*/
|
|
230
|
+
export declare const BREAKPOINT_VARIABLES: {
|
|
231
|
+
readonly xs: "--kn-screen-xs";
|
|
232
|
+
readonly sm: "--kn-screen-sm";
|
|
233
|
+
readonly md: "--kn-screen-md";
|
|
234
|
+
readonly lg: "--kn-screen-lg";
|
|
235
|
+
readonly xl: "--kn-screen-xl";
|
|
236
|
+
readonly '2xl': "--kn-screen-2xl";
|
|
237
|
+
};
|
|
238
|
+
/**
|
|
239
|
+
* Generates CSS variables from a theme configuration
|
|
240
|
+
*/
|
|
241
|
+
export declare function generateCSSVariables(theme: ThemeConfiguration): Record<string, string>;
|
|
242
|
+
/**
|
|
243
|
+
* Generates CSS string from CSS variables
|
|
244
|
+
*/
|
|
245
|
+
export declare function generateCSSString(variables: Record<string, string>, selector?: string): string;
|
|
246
|
+
/**
|
|
247
|
+
* Generates theme-specific CSS string
|
|
248
|
+
*/
|
|
249
|
+
export declare function generateThemeCSS(theme: ThemeConfiguration): string;
|
|
250
|
+
/**
|
|
251
|
+
* Gets a CSS variable value from the document
|
|
252
|
+
*/
|
|
253
|
+
export declare function getCSSVariableValue(variableName: string, element?: Element): string;
|
|
254
|
+
/**
|
|
255
|
+
* Sets a CSS variable value on an element
|
|
256
|
+
*/
|
|
257
|
+
export declare function setCSSVariableValue(variableName: string, value: string, element?: Element): void;
|
|
258
|
+
/**
|
|
259
|
+
* Removes a CSS variable from an element
|
|
260
|
+
*/
|
|
261
|
+
export declare function removeCSSVariable(variableName: string, element?: Element): void;
|
|
262
|
+
/**
|
|
263
|
+
* Checks if a CSS variable is defined
|
|
264
|
+
*/
|
|
265
|
+
export declare function isCSSVariableDefined(variableName: string, element?: Element): boolean;
|
|
266
|
+
/**
|
|
267
|
+
* Gets all CSS variables with a specific prefix
|
|
268
|
+
*/
|
|
269
|
+
export declare function getCSSVariablesWithPrefix(prefix: string, element?: Element): Record<string, string>;
|
|
270
|
+
/**
|
|
271
|
+
* Validates CSS variable name format
|
|
272
|
+
*/
|
|
273
|
+
export declare function isValidCSSVariableName(name: string): boolean;
|
|
274
|
+
/**
|
|
275
|
+
* Normalizes CSS variable name to Kenikool UI format
|
|
276
|
+
*/
|
|
277
|
+
export declare function normalizeCSSVariableName(name: string): string;
|
|
278
|
+
//# sourceMappingURL=css-variables.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