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,37 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/web-components';
|
|
2
|
+
import './navbar';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: string;
|
|
6
|
+
parameters: {
|
|
7
|
+
docs: {
|
|
8
|
+
description: {
|
|
9
|
+
component: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
argTypes: {
|
|
14
|
+
brand: {
|
|
15
|
+
control: string;
|
|
16
|
+
description: string;
|
|
17
|
+
};
|
|
18
|
+
sticky: {
|
|
19
|
+
control: string;
|
|
20
|
+
description: string;
|
|
21
|
+
};
|
|
22
|
+
dark: {
|
|
23
|
+
control: string;
|
|
24
|
+
description: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
export default meta;
|
|
29
|
+
type Story = StoryObj<typeof meta>;
|
|
30
|
+
export declare const Default: Story;
|
|
31
|
+
export declare const WithBrand: Story;
|
|
32
|
+
export declare const Dark: Story;
|
|
33
|
+
export declare const Sticky: Story;
|
|
34
|
+
export declare const ManyItems: Story;
|
|
35
|
+
export declare const WithButtons: Story;
|
|
36
|
+
export declare const Responsive: Story;
|
|
37
|
+
//# sourceMappingURL=navbar.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navbar.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/navigation/navbar.stories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAEhE,OAAO,UAAU,CAAC;AAElB,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;CAyBM,CAAC;AAEjB,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAiBrB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAcvB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,KAclB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,KAkCpB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAuBvB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAezB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAoBxB,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { BaseComponent } from '../../core/base-component.js';
|
|
2
|
+
import type { AccessibilityConfig } from '../../types/index.js';
|
|
3
|
+
import { KSidebarProps } from '../../types/components.js';
|
|
4
|
+
/**
|
|
5
|
+
* KSidebar - Responsive sidebar navigation component
|
|
6
|
+
*
|
|
7
|
+
* Features:
|
|
8
|
+
* - Overlay and push modes
|
|
9
|
+
* - Keyboard navigation support
|
|
10
|
+
* - Focus trap when open
|
|
11
|
+
* - Accessibility with ARIA attributes
|
|
12
|
+
* - Theme integration
|
|
13
|
+
* - Mobile-first responsive design
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```html
|
|
17
|
+
* <k-sidebar mode="overlay" position="left">
|
|
18
|
+
* <k-sidebar-header>Navigation</k-sidebar-header>
|
|
19
|
+
* <k-sidebar-nav>
|
|
20
|
+
* <k-sidebar-item href="/dashboard">Dashboard</k-sidebar-item>
|
|
21
|
+
* <k-sidebar-item href="/settings">Settings</k-sidebar-item>
|
|
22
|
+
* </k-sidebar-nav>
|
|
23
|
+
* </k-sidebar>
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export declare class KSidebar extends BaseComponent implements KSidebarProps {
|
|
27
|
+
private sidebar;
|
|
28
|
+
private backdropElement;
|
|
29
|
+
private content;
|
|
30
|
+
private closeButton;
|
|
31
|
+
private focusTrap;
|
|
32
|
+
private previousFocus;
|
|
33
|
+
static get observedAttributes(): string[];
|
|
34
|
+
get open(): boolean;
|
|
35
|
+
set open(value: boolean);
|
|
36
|
+
get mode(): KSidebarProps['mode'];
|
|
37
|
+
set mode(value: KSidebarProps['mode']);
|
|
38
|
+
get position(): KSidebarProps['position'];
|
|
39
|
+
set position(value: KSidebarProps['position']);
|
|
40
|
+
get width(): KSidebarProps['width'];
|
|
41
|
+
set width(value: KSidebarProps['width']);
|
|
42
|
+
get variant(): KSidebarProps['variant'];
|
|
43
|
+
set variant(value: KSidebarProps['variant']);
|
|
44
|
+
get closable(): boolean;
|
|
45
|
+
set closable(value: boolean);
|
|
46
|
+
get backdrop(): boolean;
|
|
47
|
+
set backdrop(value: boolean);
|
|
48
|
+
render(): void;
|
|
49
|
+
private getTransformValue;
|
|
50
|
+
private getWidthValue;
|
|
51
|
+
private setupEventListeners;
|
|
52
|
+
private handleTabNavigation;
|
|
53
|
+
private getFocusableElements;
|
|
54
|
+
private focusNext;
|
|
55
|
+
private focusPrevious;
|
|
56
|
+
private focusFirst;
|
|
57
|
+
private focusLast;
|
|
58
|
+
private updateFocusManagement;
|
|
59
|
+
show(): void;
|
|
60
|
+
hide(): void;
|
|
61
|
+
toggle(): void;
|
|
62
|
+
getAccessibilityConfig(): AccessibilityConfig;
|
|
63
|
+
getDefaultStyles(): CSSStyleSheet;
|
|
64
|
+
protected onAttributeChange(name: string, oldValue: string | null, newValue: string | null): void;
|
|
65
|
+
disconnectedCallback(): void;
|
|
66
|
+
}
|
|
67
|
+
declare global {
|
|
68
|
+
interface HTMLElementTagNameMap {
|
|
69
|
+
'k-sidebar': KSidebar;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=sidebar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sidebar.d.ts","sourceRoot":"","sources":["../../../../src/components/navigation/sidebar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAM1D;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBAAa,QAAS,SAAQ,aAAc,YAAW,aAAa;IAClE,OAAO,CAAC,OAAO,CAAc;IAC7B,OAAO,CAAC,eAAe,CAAc;IACrC,OAAO,CAAC,OAAO,CAAc;IAC7B,OAAO,CAAC,WAAW,CAAoB;IACvC,OAAO,CAAC,SAAS,CAAM;IACvB,OAAO,CAAC,aAAa,CAAwB;IAE7C,WAAoB,kBAAkB,IAAI,MAAM,EAAE,CAWjD;IAGD,IAAI,IAAI,IAAI,OAAO,CAElB;IAED,IAAI,IAAI,CAAC,KAAK,EAAE,OAAO,EAMtB;IAED,IAAI,IAAI,IAAI,aAAa,CAAC,MAAM,CAAC,CAEhC;IAED,IAAI,IAAI,CAAC,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,EAMpC;IAED,IAAI,QAAQ,IAAI,aAAa,CAAC,UAAU,CAAC,CAIxC;IAED,IAAI,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC,UAAU,CAAC,EAM5C;IAED,IAAI,KAAK,IAAI,aAAa,CAAC,OAAO,CAAC,CAElC;IAED,IAAI,KAAK,CAAC,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC,EAMtC;IAED,IAAI,OAAO,IAAI,aAAa,CAAC,SAAS,CAAC,CAItC;IAED,IAAI,OAAO,CAAC,KAAK,EAAE,aAAa,CAAC,SAAS,CAAC,EAM1C;IAED,IAAI,QAAQ,IAAI,OAAO,CAEtB;IAED,IAAI,QAAQ,CAAC,KAAK,EAAE,OAAO,EAM1B;IAED,IAAI,QAAQ,IAAI,OAAO,CAEtB;IAED,IAAI,QAAQ,CAAC,KAAK,EAAE,OAAO,EAM1B;IAEe,MAAM,IAAI,IAAI;IAiN9B,OAAO,CAAC,iBAAiB;IAWzB,OAAO,CAAC,aAAa;IAUrB,OAAO,CAAC,mBAAmB;IAsC3B,OAAO,CAAC,mBAAmB;IAsB3B,OAAO,CAAC,oBAAoB;IAI5B,OAAO,CAAC,SAAS;IASjB,OAAO,CAAC,aAAa;IAUrB,OAAO,CAAC,UAAU;IAKlB,OAAO,CAAC,SAAS;IAKjB,OAAO,CAAC,qBAAqB;IA4BtB,IAAI,IAAI,IAAI;IAcZ,IAAI,IAAI,IAAI;IAiBZ,MAAM,IAAI,IAAI;IAQd,sBAAsB,IAAI,mBAAmB;IAgB7C,gBAAgB,IAAI,aAAa;cAcrB,iBAAiB,CAClC,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,GAAG,IAAI,EACvB,QAAQ,EAAE,MAAM,GAAG,IAAI,GACtB,IAAI;IAoBE,oBAAoB,IAAI,IAAI;CAOtC;AAOD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,WAAW,EAAE,QAAQ,CAAC;KACvB;CACF"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/web-components';
|
|
2
|
+
import './sidebar';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: string;
|
|
6
|
+
parameters: {
|
|
7
|
+
docs: {
|
|
8
|
+
description: {
|
|
9
|
+
component: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
argTypes: {
|
|
14
|
+
mode: {
|
|
15
|
+
control: string;
|
|
16
|
+
options: string[];
|
|
17
|
+
description: string;
|
|
18
|
+
};
|
|
19
|
+
position: {
|
|
20
|
+
control: string;
|
|
21
|
+
options: string[];
|
|
22
|
+
description: string;
|
|
23
|
+
};
|
|
24
|
+
open: {
|
|
25
|
+
control: string;
|
|
26
|
+
description: string;
|
|
27
|
+
};
|
|
28
|
+
width: {
|
|
29
|
+
control: string;
|
|
30
|
+
description: string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
export default meta;
|
|
35
|
+
type Story = StoryObj<typeof meta>;
|
|
36
|
+
export declare const Default: Story;
|
|
37
|
+
export declare const Overlay: Story;
|
|
38
|
+
export declare const Push: Story;
|
|
39
|
+
export declare const Right: Story;
|
|
40
|
+
export declare const Closed: Story;
|
|
41
|
+
export declare const WithHeader: Story;
|
|
42
|
+
export declare const WithFooter: Story;
|
|
43
|
+
//# sourceMappingURL=sidebar.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sidebar.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/navigation/sidebar.stories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAEhE,OAAO,WAAW,CAAC;AAEnB,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+BM,CAAC;AAEjB,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KA+BrB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,KA+BrB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,KA+BlB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KA0BnB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,KA0BpB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KA4BxB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAmCxB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/typography/index.ts"],"names":[],"mappings":"AAEA,cAAc,QAAQ,CAAC;AACvB,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* KText - Typography component with heading and body variants
|
|
3
|
+
*
|
|
4
|
+
* Provides semantic HTML output (h1-h6, p, span) with responsive typography scaling.
|
|
5
|
+
* Supports both heading variants (h1-h6) and body text variants with consistent
|
|
6
|
+
* styling across all themes.
|
|
7
|
+
*
|
|
8
|
+
* Features:
|
|
9
|
+
* - Semantic HTML output based on variant
|
|
10
|
+
* - Responsive typography scaling
|
|
11
|
+
* - Theme-aware styling
|
|
12
|
+
* - Accessibility support
|
|
13
|
+
* - Smart defaults for typography
|
|
14
|
+
*
|
|
15
|
+
* Requirements validated:
|
|
16
|
+
* - 6.3: Typography components with heading and body variants
|
|
17
|
+
* - 13.5: Responsive typography scaling
|
|
18
|
+
*/
|
|
19
|
+
import { BaseComponent } from '../../core/base-component.js';
|
|
20
|
+
import type { AccessibilityConfig } from '../../types/index.js';
|
|
21
|
+
export interface KTextProps {
|
|
22
|
+
variant?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'body' | 'caption' | 'overline' | 'subtitle1' | 'subtitle2';
|
|
23
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | '6xl';
|
|
24
|
+
weight?: 'light' | 'normal' | 'medium' | 'semibold' | 'bold';
|
|
25
|
+
color?: 'primary' | 'secondary' | 'success' | 'warning' | 'error' | 'muted' | 'inverse';
|
|
26
|
+
align?: 'left' | 'center' | 'right' | 'justify';
|
|
27
|
+
truncate?: boolean;
|
|
28
|
+
responsive?: boolean;
|
|
29
|
+
styles?: string;
|
|
30
|
+
}
|
|
31
|
+
export declare class KText extends BaseComponent {
|
|
32
|
+
static get observedAttributes(): string[];
|
|
33
|
+
constructor();
|
|
34
|
+
/**
|
|
35
|
+
* Get the semantic HTML element based on variant
|
|
36
|
+
*/
|
|
37
|
+
private getSemanticElement;
|
|
38
|
+
/**
|
|
39
|
+
* Get font size based on variant and size attribute
|
|
40
|
+
*/
|
|
41
|
+
private getFontSize;
|
|
42
|
+
/**
|
|
43
|
+
* Get font weight based on variant and weight attribute
|
|
44
|
+
*/
|
|
45
|
+
private getFontWeight;
|
|
46
|
+
/**
|
|
47
|
+
* Get line height based on variant
|
|
48
|
+
*/
|
|
49
|
+
private getLineHeight;
|
|
50
|
+
/**
|
|
51
|
+
* Get text color based on color attribute
|
|
52
|
+
*/
|
|
53
|
+
private getTextColor;
|
|
54
|
+
/**
|
|
55
|
+
* Get responsive CSS for typography scaling
|
|
56
|
+
*/
|
|
57
|
+
private getResponsiveCSS;
|
|
58
|
+
/**
|
|
59
|
+
* Render the component
|
|
60
|
+
*/
|
|
61
|
+
render(): void;
|
|
62
|
+
/**
|
|
63
|
+
* Get default styles (required by BaseComponent)
|
|
64
|
+
*/
|
|
65
|
+
getDefaultStyles(): CSSStyleSheet;
|
|
66
|
+
/**
|
|
67
|
+
* Get accessibility configuration
|
|
68
|
+
*/
|
|
69
|
+
getAccessibilityConfig(): AccessibilityConfig;
|
|
70
|
+
/**
|
|
71
|
+
* Handle attribute changes
|
|
72
|
+
*/
|
|
73
|
+
protected onAttributeChange(name: string, oldValue: string | null, newValue: string | null): void;
|
|
74
|
+
/**
|
|
75
|
+
* Set the text variant
|
|
76
|
+
*/
|
|
77
|
+
setVariant(variant: KTextProps['variant']): void;
|
|
78
|
+
/**
|
|
79
|
+
* Set the text size
|
|
80
|
+
*/
|
|
81
|
+
setSize(size: KTextProps['size']): void;
|
|
82
|
+
/**
|
|
83
|
+
* Set the font weight
|
|
84
|
+
*/
|
|
85
|
+
setWeight(weight: KTextProps['weight']): void;
|
|
86
|
+
/**
|
|
87
|
+
* Set the text color
|
|
88
|
+
*/
|
|
89
|
+
setColor(color: KTextProps['color']): void;
|
|
90
|
+
/**
|
|
91
|
+
* Set text alignment
|
|
92
|
+
*/
|
|
93
|
+
setAlign(align: KTextProps['align']): void;
|
|
94
|
+
/**
|
|
95
|
+
* Enable or disable text truncation
|
|
96
|
+
*/
|
|
97
|
+
setTruncate(truncate: boolean): void;
|
|
98
|
+
/**
|
|
99
|
+
* Enable or disable responsive typography
|
|
100
|
+
*/
|
|
101
|
+
setResponsive(responsive: boolean): void;
|
|
102
|
+
get variant(): KTextProps['variant'];
|
|
103
|
+
get size(): KTextProps['size'];
|
|
104
|
+
get weight(): KTextProps['weight'];
|
|
105
|
+
get color(): KTextProps['color'];
|
|
106
|
+
get align(): KTextProps['align'];
|
|
107
|
+
get truncate(): boolean;
|
|
108
|
+
get responsive(): boolean;
|
|
109
|
+
}
|
|
110
|
+
export default KText;
|
|
111
|
+
//# sourceMappingURL=text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../../../src/components/typography/text.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAEhE,MAAM,WAAW,UAAU;IACzB,OAAO,CAAC,EACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,MAAM,GACN,SAAS,GACT,UAAU,GACV,WAAW,GACX,WAAW,CAAC;IAChB,IAAI,CAAC,EACD,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,KAAK,GACL,KAA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,GAAG,IAAI;IAQ7C;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC,OAAO,CAAC,GAAG,IAAI;IAQ1C;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC,OAAO,CAAC,GAAG,IAAI;IAQ1C;;OAEG;IACH,WAAW,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI;IAQpC;;OAEG;IACH,aAAa,CAAC,UAAU,EAAE,OAAO,GAAG,IAAI;IAUxC,IAAI,OAAO,IAAI,UAAU,CAAC,SAAS,CAAC,CAEnC;IAED,IAAI,IAAI,IAAI,UAAU,CAAC,MAAM,CAAC,CAE7B;IAED,IAAI,MAAM,IAAI,UAAU,CAAC,QAAQ,CAAC,CAEjC;IAED,IAAI,KAAK,IAAI,UAAU,CAAC,OAAO,CAAC,CAE/B;IAED,IAAI,KAAK,IAAI,UAAU,CAAC,OAAO,CAAC,CAE/B;IAED,IAAI,QAAQ,IAAI,OAAO,CAEtB;IAED,IAAI,UAAU,IAAI,OAAO,CAExB;CACF;AAOD,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/web-components';
|
|
2
|
+
import './text';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: string;
|
|
6
|
+
parameters: {
|
|
7
|
+
docs: {
|
|
8
|
+
description: {
|
|
9
|
+
component: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
argTypes: {
|
|
14
|
+
variant: {
|
|
15
|
+
control: string;
|
|
16
|
+
options: string[];
|
|
17
|
+
description: string;
|
|
18
|
+
};
|
|
19
|
+
color: {
|
|
20
|
+
control: string;
|
|
21
|
+
description: string;
|
|
22
|
+
};
|
|
23
|
+
align: {
|
|
24
|
+
control: string;
|
|
25
|
+
options: string[];
|
|
26
|
+
description: string;
|
|
27
|
+
};
|
|
28
|
+
weight: {
|
|
29
|
+
control: string;
|
|
30
|
+
options: string[];
|
|
31
|
+
description: string;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
export default meta;
|
|
36
|
+
type Story = StoryObj<typeof meta>;
|
|
37
|
+
export declare const Heading1: Story;
|
|
38
|
+
export declare const Heading2: Story;
|
|
39
|
+
export declare const Heading3: Story;
|
|
40
|
+
export declare const Body: Story;
|
|
41
|
+
export declare const Caption: Story;
|
|
42
|
+
export declare const Code: Story;
|
|
43
|
+
export declare const AllHeadings: Story;
|
|
44
|
+
export declare const FontWeights: Story;
|
|
45
|
+
export declare const TextAlignment: Story;
|
|
46
|
+
export declare const WithColor: Story;
|
|
47
|
+
export declare const Paragraph: Story;
|
|
48
|
+
//# sourceMappingURL=text.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/typography/text.stories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAEhE,OAAO,QAAQ,CAAC;AAEhB,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+BM,CAAC;AAEjB,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,QAAQ,EAAE,KAEtB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAEtB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAEtB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,KAKlB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,KAMrB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,KAGlB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAWzB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KASzB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAY3B,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KASvB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAcvB,CAAC"}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BaseComponent - Abstract base class for all Kenikool UI Web Components
|
|
3
|
+
*
|
|
4
|
+
* Provides core functionality including:
|
|
5
|
+
* - Shadow DOM management
|
|
6
|
+
* - Lifecycle methods (connectedCallback, disconnectedCallback, attributeChangedCallback)
|
|
7
|
+
* - Theme system integration
|
|
8
|
+
* - Styles parsing and application
|
|
9
|
+
* - Smart defaults system
|
|
10
|
+
* - Accessibility features
|
|
11
|
+
* - Event handling and state management
|
|
12
|
+
*
|
|
13
|
+
* All k- prefixed components extend this base class.
|
|
14
|
+
*/
|
|
15
|
+
import type { StylesConfig, SmartDefaultsConfig, AccessibilityConfig, KeyboardConfig, ValidationResult } from '../types/index.js';
|
|
16
|
+
export declare abstract class BaseComponent extends HTMLElement {
|
|
17
|
+
protected shadow: ShadowRoot;
|
|
18
|
+
protected theme: string;
|
|
19
|
+
protected styles: StylesConfig;
|
|
20
|
+
protected smartDefaults: SmartDefaultsConfig;
|
|
21
|
+
protected _isConnected: boolean;
|
|
22
|
+
protected isRendered: boolean;
|
|
23
|
+
static get observedAttributes(): string[];
|
|
24
|
+
constructor();
|
|
25
|
+
/**
|
|
26
|
+
* Web Components lifecycle - called when element is added to DOM
|
|
27
|
+
*/
|
|
28
|
+
connectedCallback(): void;
|
|
29
|
+
/**
|
|
30
|
+
* Web Components lifecycle - called when element is removed from DOM
|
|
31
|
+
*/
|
|
32
|
+
disconnectedCallback(): void;
|
|
33
|
+
/**
|
|
34
|
+
* Web Components lifecycle - called when observed attributes change
|
|
35
|
+
*/
|
|
36
|
+
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
37
|
+
/**
|
|
38
|
+
* Handle attribute changes and update component accordingly
|
|
39
|
+
*/
|
|
40
|
+
protected handleAttributeChange(name: string, oldValue: string | null, newValue: string | null): void;
|
|
41
|
+
/**
|
|
42
|
+
* Get current theme from element or parent elements
|
|
43
|
+
*/
|
|
44
|
+
protected getTheme(): string;
|
|
45
|
+
/**
|
|
46
|
+
* Parse styles attribute into StylesConfig object
|
|
47
|
+
*/
|
|
48
|
+
protected parseStyles(): StylesConfig;
|
|
49
|
+
/**
|
|
50
|
+
* Generate smart defaults configuration
|
|
51
|
+
*/
|
|
52
|
+
protected generateSmartDefaults(): SmartDefaultsConfig;
|
|
53
|
+
/**
|
|
54
|
+
* Apply smart defaults to the component
|
|
55
|
+
*/
|
|
56
|
+
protected applySmartDefaults(): void;
|
|
57
|
+
/**
|
|
58
|
+
* Apply accessibility features to the component
|
|
59
|
+
*/
|
|
60
|
+
protected applyAccessibility(): void;
|
|
61
|
+
/**
|
|
62
|
+
* Fallback basic accessibility implementation
|
|
63
|
+
*/
|
|
64
|
+
private applyBasicAccessibility;
|
|
65
|
+
/**
|
|
66
|
+
* Add keyboard event handling
|
|
67
|
+
*/
|
|
68
|
+
protected addKeyboardSupport(config: KeyboardConfig): void;
|
|
69
|
+
/**
|
|
70
|
+
* Announce a message to screen readers
|
|
71
|
+
*/
|
|
72
|
+
protected announce(message: string, priority?: 'polite' | 'assertive'): void;
|
|
73
|
+
/**
|
|
74
|
+
* Update ARIA expanded state
|
|
75
|
+
*/
|
|
76
|
+
protected setExpanded(expanded: boolean): void;
|
|
77
|
+
/**
|
|
78
|
+
* Update ARIA selected state
|
|
79
|
+
*/
|
|
80
|
+
protected setSelected(selected: boolean): void;
|
|
81
|
+
/**
|
|
82
|
+
* Update ARIA pressed state for toggle buttons
|
|
83
|
+
*/
|
|
84
|
+
protected setPressed(pressed: boolean): void;
|
|
85
|
+
/**
|
|
86
|
+
* Update ARIA disabled state
|
|
87
|
+
*/
|
|
88
|
+
protected setDisabled(disabled: boolean): void;
|
|
89
|
+
/**
|
|
90
|
+
* Generate a unique ID for accessibility relationships
|
|
91
|
+
*/
|
|
92
|
+
protected generateAccessibilityId(prefix?: string): string;
|
|
93
|
+
/**
|
|
94
|
+
* Attach component-specific event listeners
|
|
95
|
+
*/
|
|
96
|
+
protected attachEventListeners(): void;
|
|
97
|
+
/**
|
|
98
|
+
* Observe theme changes on parent elements
|
|
99
|
+
*/
|
|
100
|
+
protected observeThemeChanges(): void;
|
|
101
|
+
/**
|
|
102
|
+
* Create a debounced theme update function (300ms debounce)
|
|
103
|
+
*/
|
|
104
|
+
private createDebouncedThemeUpdate;
|
|
105
|
+
/**
|
|
106
|
+
* Update component when theme changes
|
|
107
|
+
*/
|
|
108
|
+
protected updateTheme(): void;
|
|
109
|
+
/**
|
|
110
|
+
* Update component when styles change
|
|
111
|
+
*/
|
|
112
|
+
protected updateStyles(): void;
|
|
113
|
+
/**
|
|
114
|
+
* Generate CSS classes from styles configuration
|
|
115
|
+
*/
|
|
116
|
+
protected generateStyleClasses(): string;
|
|
117
|
+
/**
|
|
118
|
+
* Get theme CSS variables for current theme
|
|
119
|
+
*/
|
|
120
|
+
protected getThemeVariables(): Record<string, string>;
|
|
121
|
+
/**
|
|
122
|
+
* Clean up resources when component is disconnected
|
|
123
|
+
*/
|
|
124
|
+
protected cleanup(): void;
|
|
125
|
+
/**
|
|
126
|
+
* Handle component-specific attribute changes
|
|
127
|
+
* Override in subclasses to handle custom attributes
|
|
128
|
+
*/
|
|
129
|
+
protected onAttributeChange(_name: string, _oldValue: string | null, _newValue: string | null): void;
|
|
130
|
+
/**
|
|
131
|
+
* Emit a custom event from the component
|
|
132
|
+
*/
|
|
133
|
+
protected emit(eventName: string, detail?: any): boolean;
|
|
134
|
+
/**
|
|
135
|
+
* Sanitize and validate attribute value before setting
|
|
136
|
+
*/
|
|
137
|
+
protected setSecureAttribute(name: string, value: string): void;
|
|
138
|
+
/**
|
|
139
|
+
* Sanitize and validate HTML content
|
|
140
|
+
*/
|
|
141
|
+
protected sanitizeHTMLContent(content: string): string;
|
|
142
|
+
/**
|
|
143
|
+
* Validate form input based on input type
|
|
144
|
+
*/
|
|
145
|
+
protected validateFormInput(type: string, value: string): ValidationResult;
|
|
146
|
+
/**
|
|
147
|
+
* Apply secure defaults to the component
|
|
148
|
+
*/
|
|
149
|
+
protected applySecurityDefaults(): void;
|
|
150
|
+
/**
|
|
151
|
+
* Check if a value is CSP compatible
|
|
152
|
+
*/
|
|
153
|
+
protected isCSPCompatible(value: string): boolean;
|
|
154
|
+
/**
|
|
155
|
+
* Override setAttribute to add security validation
|
|
156
|
+
*/
|
|
157
|
+
setAttribute(name: string, value: string): void;
|
|
158
|
+
/**
|
|
159
|
+
* Override setAttributeNS to add security validation
|
|
160
|
+
*/
|
|
161
|
+
setAttributeNS(namespace: string | null, name: string, value: string): void;
|
|
162
|
+
/**
|
|
163
|
+
* Render the component's Shadow DOM content
|
|
164
|
+
* Must be implemented by each component
|
|
165
|
+
*/
|
|
166
|
+
abstract render(): void;
|
|
167
|
+
/**
|
|
168
|
+
* Get default styles for the component
|
|
169
|
+
* Must be implemented by each component
|
|
170
|
+
*/
|
|
171
|
+
abstract getDefaultStyles(): CSSStyleSheet;
|
|
172
|
+
/**
|
|
173
|
+
* Get accessibility configuration for the component
|
|
174
|
+
* Must be implemented by each component
|
|
175
|
+
*/
|
|
176
|
+
abstract getAccessibilityConfig(): AccessibilityConfig;
|
|
177
|
+
}
|
|
178
|
+
//# sourceMappingURL=base-component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-component.d.ts","sourceRoot":"","sources":["../../../src/core/base-component.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EACV,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,cAAc,EACd,gBAAgB,EACjB,MAAM,mBAAmB,CAAC;AAK3B,8BAAsB,aAAc,SAAQ,WAAW;IACrD,SAAS,CAAC,MAAM,EAAE,UAAU,CAAC;IAC7B,SAAS,CAAC,KAAK,EAAE,MAAM,CAAY;IACnC,SAAS,CAAC,MAAM,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EG;IACH,SAAS,CAAC,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;IAIjD;;OAEG;IACM,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAIxD;;OAEG;IACM,cAAc,CACrB,SAAS,EAAE,MAAM,GAAG,IAAI,EACxB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,GACZ,IAAI;IAmBP;;;OAGG;IACH,QAAQ,CAAC,MAAM,IAAI,IAAI;IAEvB;;;OAGG;IACH,QAAQ,CAAC,gBAAgB,IAAI,aAAa;IAE1C;;;OAGG;IACH,QAAQ,CAAC,sBAAsB,IAAI,mBAAmB;CACvD"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Example usage of BaseComponent
|
|
3
|
+
*
|
|
4
|
+
* This demonstrates how to create a custom Web Component
|
|
5
|
+
* by extending the BaseComponent class.
|
|
6
|
+
*/
|
|
7
|
+
import { BaseComponent } from './base-component.js';
|
|
8
|
+
import type { AccessibilityConfig } from '../types/index.js';
|
|
9
|
+
/**
|
|
10
|
+
* Example Button Component
|
|
11
|
+
*
|
|
12
|
+
* Usage:
|
|
13
|
+
* <k-example-button styles="large primary">Click me</k-example-button>
|
|
14
|
+
*/
|
|
15
|
+
export declare class ExampleButton extends BaseComponent {
|
|
16
|
+
static get observedAttributes(): string[];
|
|
17
|
+
render(): void;
|
|
18
|
+
getDefaultStyles(): CSSStyleSheet;
|
|
19
|
+
getAccessibilityConfig(): AccessibilityConfig;
|
|
20
|
+
click(): void;
|
|
21
|
+
focus(): void;
|
|
22
|
+
blur(): void;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=base-component.example.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-component.example.d.ts","sourceRoot":"","sources":["../../../src/core/base-component.example.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAE7D;;;;;GAKG;AACH,qBAAa,aAAc,SAAQ,aAAa;IAC9C,MAAM,KAAK,kBAAkB,IAAI,MAAM,EAAE,CAExC;IAED,MAAM,IAAI,IAAI;IAqGd,gBAAgB,IAAI,aAAa;IAUjC,sBAAsB,IAAI,mBAAmB;IAS7C,KAAK,IAAI,IAAI;IAKb,KAAK,IAAI,IAAI;IAKb,IAAI,IAAI,IAAI;CAIb"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import type { ComponentDefinition } from '../types/index';
|
|
2
|
+
/**
|
|
3
|
+
* ComponentRegistry manages the registration and lazy loading of Web Components
|
|
4
|
+
* Supports auto-definition when components are first used in the DOM
|
|
5
|
+
*/
|
|
6
|
+
export declare class ComponentRegistry {
|
|
7
|
+
private static components;
|
|
8
|
+
private static loaded;
|
|
9
|
+
private static observers;
|
|
10
|
+
private static dependencies;
|
|
11
|
+
private static loadingPromises;
|
|
12
|
+
private static globalObserver;
|
|
13
|
+
/**
|
|
14
|
+
* Register a component definition with optional lazy loading
|
|
15
|
+
*/
|
|
16
|
+
static register(definition: ComponentDefinition): void;
|
|
17
|
+
/**
|
|
18
|
+
* Get a registered component definition
|
|
19
|
+
*/
|
|
20
|
+
static get(tagName: string): ComponentDefinition | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Get all registered components
|
|
23
|
+
*/
|
|
24
|
+
static getAll(): Map<string, ComponentDefinition>;
|
|
25
|
+
/**
|
|
26
|
+
* Check if a component is registered
|
|
27
|
+
*/
|
|
28
|
+
static isRegistered(tagName: string): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Check if a component is loaded (defined in Custom Elements registry)
|
|
31
|
+
*/
|
|
32
|
+
static isLoaded(tagName: string): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Unregister a component
|
|
35
|
+
*/
|
|
36
|
+
static unregister(tagName: string): void;
|
|
37
|
+
/**
|
|
38
|
+
* Load a component and its dependencies
|
|
39
|
+
*/
|
|
40
|
+
static load(tagName: string): Promise<void>;
|
|
41
|
+
/**
|
|
42
|
+
* Load all registered components
|
|
43
|
+
*/
|
|
44
|
+
static loadAll(): Promise<void>;
|
|
45
|
+
/**
|
|
46
|
+
* Initialize the registry and set up global observers
|
|
47
|
+
*/
|
|
48
|
+
static initialize(): void;
|
|
49
|
+
/**
|
|
50
|
+
* Define a component in the Custom Elements registry
|
|
51
|
+
*/
|
|
52
|
+
private static defineComponent;
|
|
53
|
+
/**
|
|
54
|
+
* Load component with its dependencies in correct order
|
|
55
|
+
*/
|
|
56
|
+
private static loadComponentWithDependencies;
|
|
57
|
+
/**
|
|
58
|
+
* Set up lazy loading for a component using MutationObserver
|
|
59
|
+
*/
|
|
60
|
+
private static setupLazyLoading;
|
|
61
|
+
/**
|
|
62
|
+
* Set up global mutation observer for auto-loading any registered components
|
|
63
|
+
*/
|
|
64
|
+
private static setupGlobalObserver;
|
|
65
|
+
/**
|
|
66
|
+
* Check if an element is a registered component and load it if needed
|
|
67
|
+
*/
|
|
68
|
+
private static checkAndLoadElement;
|
|
69
|
+
/**
|
|
70
|
+
* Scan existing elements in the DOM and auto-load registered components
|
|
71
|
+
*/
|
|
72
|
+
private static scanExistingElements;
|
|
73
|
+
/**
|
|
74
|
+
* Get registry statistics for debugging
|
|
75
|
+
*/
|
|
76
|
+
static getStats(): {
|
|
77
|
+
registered: number;
|
|
78
|
+
loaded: number;
|
|
79
|
+
pending: number;
|
|
80
|
+
components: string[];
|
|
81
|
+
loadedComponents: string[];
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* Clear all registered components (for testing)
|
|
85
|
+
*/
|
|
86
|
+
static clear(): void;
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/core/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