crdx-components 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/.github/workflows/publish.yml +38 -0
- package/bun.lock +491 -0
- package/crdx-components-1.0.0.tgz +0 -0
- package/crdx-components-tokenized-components-1.0.1.tgz +0 -0
- package/ng-package.json +12 -0
- package/npm +0 -0
- package/package.json +33 -0
- package/src/index.ts +45 -0
- package/src/lib/components/breadcrumb/breadcrumb.component.css +206 -0
- package/src/lib/components/breadcrumb/breadcrumb.component.html +15 -0
- package/src/lib/components/breadcrumb/breadcrumb.component.ts +47 -0
- package/src/lib/components/button/button.css +371 -0
- package/src/lib/components/button/button.html +187 -0
- package/src/lib/components/button/button.ts +103 -0
- package/src/lib/components/card/card.css +285 -0
- package/src/lib/components/card/card.html +69 -0
- package/src/lib/components/card/card.ts +93 -0
- package/src/lib/components/checkbox/checkbox-showcase.component.css +42 -0
- package/src/lib/components/checkbox/checkbox-showcase.component.html +36 -0
- package/src/lib/components/checkbox/checkbox-showcase.component.ts +13 -0
- package/src/lib/components/checkbox/checkbox.css +10 -0
- package/src/lib/components/checkbox/checkbox.html +13 -0
- package/src/lib/components/checkbox/checkbox.ts +64 -0
- package/src/lib/components/circular-progress-stepper/circular-progress-stepper.css +89 -0
- package/src/lib/components/circular-progress-stepper/circular-progress-stepper.html +23 -0
- package/src/lib/components/circular-progress-stepper/circular-progress-stepper.ts +40 -0
- package/src/lib/components/dialogs/alert-modal/alert-modal.css +118 -0
- package/src/lib/components/dialogs/alert-modal/alert-modal.html +29 -0
- package/src/lib/components/dialogs/alert-modal/alert-modal.ts +28 -0
- package/src/lib/components/dialogs/confirm-modal/confirm-modal.css +219 -0
- package/src/lib/components/dialogs/confirm-modal/confirm-modal.html +60 -0
- package/src/lib/components/dialogs/confirm-modal/confirm-modal.store.ts +139 -0
- package/src/lib/components/dialogs/confirm-modal/confirm-modal.ts +63 -0
- package/src/lib/components/dialogs/container-custom/container-custom.css +11 -0
- package/src/lib/components/dialogs/container-custom/container-custom.html +3 -0
- package/src/lib/components/dialogs/container-custom/container-custom.ts +37 -0
- package/src/lib/components/dialogs/container-custom/custom-modal.state.ts +57 -0
- package/src/lib/components/dialogs/error-modal/error-modal.css +53 -0
- package/src/lib/components/dialogs/error-modal/error-modal.html +17 -0
- package/src/lib/components/dialogs/error-modal/error-modal.ts +20 -0
- package/src/lib/components/dialogs/side-modal/side-modal.css +80 -0
- package/src/lib/components/dialogs/side-modal/side-modal.html +30 -0
- package/src/lib/components/dialogs/side-modal/side-modal.state.ts +78 -0
- package/src/lib/components/dialogs/side-modal/side-modal.ts +50 -0
- package/src/lib/components/divider/divider.css +24 -0
- package/src/lib/components/divider/divider.html +7 -0
- package/src/lib/components/divider/divider.ts +13 -0
- package/src/lib/components/footer-actions/footer/footer-flow.store.ts +30 -0
- package/src/lib/components/footer-actions/footer/footer.html +14 -0
- package/src/lib/components/footer-actions/footer/footer.ts +50 -0
- package/src/lib/components/footer-actions/modal-footer-actions/modal-footer-actions.css +44 -0
- package/src/lib/components/footer-actions/modal-footer-actions/modal-footer-actions.html +7 -0
- package/src/lib/components/footer-actions/modal-footer-actions/modal-footer-actions.ts +12 -0
- package/src/lib/components/footer-actions/page-footer-actions/page-footer-actions.css +31 -0
- package/src/lib/components/footer-actions/page-footer-actions/page-footer-actions.html +7 -0
- package/src/lib/components/footer-actions/page-footer-actions/page-footer-actions.ts +12 -0
- package/src/lib/components/form-field/select-field.css +178 -0
- package/src/lib/components/form-field/select-field.html +94 -0
- package/src/lib/components/form-field/select-field.ts +324 -0
- package/src/lib/components/form-field/text-field.css +41 -0
- package/src/lib/components/form-field/text-field.html +38 -0
- package/src/lib/components/form-field/text-field.ts +102 -0
- package/src/lib/components/header/header.css +142 -0
- package/src/lib/components/header/header.html +36 -0
- package/src/lib/components/header/header.ts +101 -0
- package/src/lib/components/icon-button/icon-button.css +445 -0
- package/src/lib/components/icon-button/icon-button.html +15 -0
- package/src/lib/components/icon-button/icon-button.ts +49 -0
- package/src/lib/components/list-item/list-item.css +122 -0
- package/src/lib/components/list-item/list-item.html +79 -0
- package/src/lib/components/list-item/list-item.ts +104 -0
- package/src/lib/components/menu/menu.css +39 -0
- package/src/lib/components/menu/menu.html +57 -0
- package/src/lib/components/menu/menu.ts +159 -0
- package/src/lib/components/shared-table/shared-table-cell-template.directive.ts +25 -0
- package/src/lib/components/shared-table/shared-table.component.css +223 -0
- package/src/lib/components/shared-table/shared-table.component.html +96 -0
- package/src/lib/components/shared-table/shared-table.component.ts +172 -0
- package/src/lib/components/sidebar/sidebar.css +234 -0
- package/src/lib/components/sidebar/sidebar.html +67 -0
- package/src/lib/components/sidebar/sidebar.ts +92 -0
- package/src/lib/components/slide-toggle/slide-toggle.css +0 -0
- package/src/lib/components/slide-toggle/slide-toggle.html +3 -0
- package/src/lib/components/slide-toggle/slide-toggle.ts +18 -0
- package/src/lib/components/spinner/spinner.css +9 -0
- package/src/lib/components/spinner/spinner.html +9 -0
- package/src/lib/components/spinner/spinner.ts +17 -0
- package/src/lib/components/tooltip/tooltip.css +32 -0
- package/src/lib/components/tooltip/tooltip.html +3 -0
- package/src/lib/components/tooltip/tooltip.ts +31 -0
- package/src/lib/icons/configuration-countable.svg +8 -0
- package/src/lib/icons/edit-table.svg +3 -0
- package/src/lib/icons/edit.svg +3 -0
- package/src/lib/icons/error-circle.svg +8 -0
- package/src/lib/icons/hub.svg +3 -0
- package/src/lib/icons/icon-menu.svg +8 -0
- package/src/lib/icons/info-error.svg +8 -0
- package/src/lib/icons/keyboard_arrow_down.svg +1 -0
- package/src/lib/icons/logo.svg +0 -0
- package/src/lib/icons/logout.svg +0 -0
- package/src/lib/icons/notifications.svg +0 -0
- package/src/lib/icons/profile-user-menu.svg +0 -0
- package/src/lib/icons/profile.svg +0 -0
- package/src/lib/icons/register-icons.ts +101 -0
- package/src/lib/icons/visibility.svg +0 -0
- package/src/lib/lib-ui/lib-ui.html +1 -0
- package/src/lib/lib-ui/lib-ui.scss +0 -0
- package/src/lib/lib-ui/lib-ui.ts +9 -0
- package/src/lib/styles/generated/_app-tokens.scss +2757 -0
- package/src/lib/styles/generated/_md3-tokens.scss +179 -0
- package/src/lib/styles/generated/_tokens-avatars.scss +4 -0
- package/src/lib/styles/global-material-theme.scss +69 -0
- package/src/lib/styles/index.scss +16 -0
- package/src/lib/styles/layout.scss +29 -0
- package/src/lib/styles/overrides/_index.scss +11 -0
- package/src/lib/styles/overrides/_mat-button-overrides.scss +105 -0
- package/src/lib/styles/overrides/_mat-checkbox-overrides.scss +49 -0
- package/src/lib/styles/overrides/_mat-form-field-overrides.scss +148 -0
- package/src/lib/styles/overrides/_mat-icon-button-overrides.scss +20 -0
- package/src/lib/styles/overrides/_mat-list-overrides.scss +59 -0
- package/src/lib/styles/overrides/_mat-slide-toggle-overrides.scss +33 -0
- package/src/lib/styles/overrides/_mat-table-overrides.scss +259 -0
- package/src/lib/styles/overrides/_mat-tabs-overrides.scss +116 -0
- package/src/lib/styles/scrollbar.scss +40 -0
- package/src/lib/styles/text-classes.scss +116 -0
- package/src/lib/styles/typography.scss +14 -0
- package/tsconfig.json +30 -0
- package/tsconfig.lib.json +20 -0
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { DomSanitizer } from '@angular/platform-browser';
|
|
2
|
+
import { MatIconRegistry } from '@angular/material/icon';
|
|
3
|
+
|
|
4
|
+
const DEFAULT_ICON_BASE_PATH = 'assets/icons';
|
|
5
|
+
|
|
6
|
+
const ICON_MENU_FILE = 'icon-menu.svg';
|
|
7
|
+
const LOGO_FILE = 'logo.svg';
|
|
8
|
+
const SMILEY_FILE = 'smiley.svg';
|
|
9
|
+
|
|
10
|
+
const ICON_FILE_MAP = Object.freeze({
|
|
11
|
+
CollapseMenu: ICON_MENU_FILE,
|
|
12
|
+
'collapse-menu': ICON_MENU_FILE,
|
|
13
|
+
'icon-menu': ICON_MENU_FILE,
|
|
14
|
+
|
|
15
|
+
logo: LOGO_FILE,
|
|
16
|
+
'credix-logo': LOGO_FILE,
|
|
17
|
+
smiley: SMILEY_FILE,
|
|
18
|
+
'error-circle': 'error-circle.svg',
|
|
19
|
+
'info-error': 'info-error.svg',
|
|
20
|
+
'configuration-countable': 'configuration-countable.svg',
|
|
21
|
+
edit: 'edit.svg',
|
|
22
|
+
'edit-table': 'edit-table.svg',
|
|
23
|
+
hub: 'hub.svg',
|
|
24
|
+
logout: 'logout.svg',
|
|
25
|
+
notifications: 'notifications.svg',
|
|
26
|
+
profile: 'profile.svg',
|
|
27
|
+
'profile-user-menu': 'profile-user-menu.svg',
|
|
28
|
+
visibility: 'visibility-eye.svg',
|
|
29
|
+
check: 'success-check_icon.svg',
|
|
30
|
+
'gif-icon-massive': 'gif-icon.svg',
|
|
31
|
+
'background-color-massive': 'background-color-massive.svg',
|
|
32
|
+
'content-edit-massive': 'trailing-icon.svg',
|
|
33
|
+
'edit-massive': 'edit-massive.svg',
|
|
34
|
+
'edit-massive-white': 'edit-white.svg',
|
|
35
|
+
'edit-gray': 'edit-gray.svg',
|
|
36
|
+
'check-update': 'check-update.svg',
|
|
37
|
+
'download-simple': 'download-simple.svg',
|
|
38
|
+
'download-file': 'download-file.svg',
|
|
39
|
+
'content-copy': 'content-copy.svg',
|
|
40
|
+
'add-create': 'add-create.svg',
|
|
41
|
+
'add-create-dark': 'add-create-dark.svg',
|
|
42
|
+
'add-create-dark-icon': 'add-create-dark-icon.svg',
|
|
43
|
+
'add-circle-filled': 'add_circle_filled.svg',
|
|
44
|
+
'add-circle-tonal': 'add_circle_tonal.svg',
|
|
45
|
+
'add-circle-outlined': 'add_circle_outline.svg',
|
|
46
|
+
'add-circle-elevated': 'add_circle_text.svg',
|
|
47
|
+
'add-circle-text': 'add_circle_text.svg',
|
|
48
|
+
} satisfies Record<string, string>);
|
|
49
|
+
|
|
50
|
+
function normalizeBasePath(basePath?: string): string {
|
|
51
|
+
const targetPath = basePath ?? DEFAULT_ICON_BASE_PATH;
|
|
52
|
+
|
|
53
|
+
if (/^(https?:)?\/\//.test(targetPath)) {
|
|
54
|
+
return targetPath.replace(/\/$/, '');
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return targetPath.replace(/\/$/, '');
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export type UiIconName = keyof typeof ICON_FILE_MAP;
|
|
61
|
+
|
|
62
|
+
export const UI_ICON_NAMES = Object.keys(ICON_FILE_MAP) as UiIconName[];
|
|
63
|
+
|
|
64
|
+
export interface RegisterUiIconOptions {
|
|
65
|
+
basePath?: string;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export function resolveUiIconResource(
|
|
69
|
+
iconName: UiIconName,
|
|
70
|
+
options?: RegisterUiIconOptions
|
|
71
|
+
): string {
|
|
72
|
+
const fileName = ICON_FILE_MAP[iconName];
|
|
73
|
+
|
|
74
|
+
if (!fileName) {
|
|
75
|
+
throw new Error(`Icon "${iconName}" is not registered in ICON_FILE_MAP.`);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return `${normalizeBasePath(options?.basePath)}/${fileName}`;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export function registerUiIcons(
|
|
82
|
+
registry: MatIconRegistry,
|
|
83
|
+
sanitizer: DomSanitizer,
|
|
84
|
+
icons: UiIconName[] = UI_ICON_NAMES,
|
|
85
|
+
options?: RegisterUiIconOptions
|
|
86
|
+
): void {
|
|
87
|
+
const basePath = normalizeBasePath(options?.basePath);
|
|
88
|
+
|
|
89
|
+
icons.forEach((iconName) => {
|
|
90
|
+
const fileName = ICON_FILE_MAP[iconName];
|
|
91
|
+
if (!fileName) {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
const resourceUrl = `${basePath}/${fileName}`;
|
|
96
|
+
registry.addSvgIcon(
|
|
97
|
+
iconName,
|
|
98
|
+
sanitizer.bypassSecurityTrustResourceUrl(resourceUrl)
|
|
99
|
+
);
|
|
100
|
+
});
|
|
101
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<p>LibUi works!</p>
|
|
File without changes
|