@tacdaed/fragments 1.0.0-beta.0 → 1.0.0-beta.2
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 +2 -18
- package/ng-package.json +25 -0
- package/package.json +22 -29
- package/src/lib/components/accordion/accordion.component.html +103 -0
- package/src/lib/components/accordion/accordion.component.scss +382 -0
- package/src/lib/components/accordion/accordion.component.spec.ts +147 -0
- package/src/lib/components/accordion/accordion.component.ts +211 -0
- package/src/lib/components/accordion/accordion.type.ts +82 -0
- package/src/lib/components/breadcrumb/breadcrumb.component.html +43 -0
- package/src/lib/components/breadcrumb/breadcrumb.component.scss +112 -0
- package/src/lib/components/breadcrumb/breadcrumb.component.spec.ts +33 -0
- package/src/lib/components/breadcrumb/breadcrumb.component.ts +103 -0
- package/src/lib/components/breadcrumb/breadcrumb.interface.ts +7 -0
- package/src/lib/components/button/button.component.html +57 -0
- package/src/lib/components/button/button.component.scss +445 -0
- package/src/lib/components/button/button.component.spec.ts +99 -0
- package/src/lib/components/button/button.component.ts +143 -0
- package/src/lib/components/button/button.type.ts +7 -0
- package/src/lib/components/card/card.component.html +44 -0
- package/src/lib/components/card/card.component.scss +114 -0
- package/src/lib/components/card/card.component.spec.ts +65 -0
- package/src/lib/components/card/card.component.ts +21 -0
- package/src/lib/components/card/card.type.ts +3 -0
- package/src/lib/components/code-block/code-block.component.html +55 -0
- package/src/lib/components/code-block/code-block.component.scss +122 -0
- package/src/lib/components/code-block/code-block.component.spec.ts +81 -0
- package/src/lib/components/code-block/code-block.component.ts +302 -0
- package/src/lib/components/code-block/code-block.interface.ts +28 -0
- package/src/lib/components/code-block/code-block.type.ts +73 -0
- package/src/lib/components/decorative/sparkle-field/sparkle-field.component.html +14 -0
- package/src/lib/components/decorative/sparkle-field/sparkle-field.component.scss +20 -0
- package/src/lib/components/decorative/sparkle-field/sparkle-field.component.spec.ts +38 -0
- package/src/lib/components/decorative/sparkle-field/sparkle-field.component.ts +181 -0
- package/src/lib/components/input/input-base.ts +187 -0
- package/src/lib/components/input/input-calendar/input-calendar.component.html +76 -0
- package/src/lib/components/input/input-calendar/input-calendar.component.scss +179 -0
- package/src/lib/components/input/input-calendar/input-calendar.component.spec.ts +44 -0
- package/src/lib/components/input/input-calendar/input-calendar.component.ts +299 -0
- package/src/lib/components/input/input-checkbox/input-checkbox.component.html +37 -0
- package/src/lib/components/input/input-checkbox/input-checkbox.component.scss +128 -0
- package/src/lib/components/input/input-checkbox/input-checkbox.component.spec.ts +43 -0
- package/src/lib/components/input/input-checkbox/input-checkbox.component.ts +112 -0
- package/src/lib/components/input/input-checkbox-group/input-checkbox-group.component.html +43 -0
- package/src/lib/components/input/input-checkbox-group/input-checkbox-group.component.scss +140 -0
- package/src/lib/components/input/input-checkbox-group/input-checkbox-group.component.spec.ts +62 -0
- package/src/lib/components/input/input-checkbox-group/input-checkbox-group.component.ts +136 -0
- package/src/lib/components/input/input-clock-picker/input-clock-picker.component.html +81 -0
- package/src/lib/components/input/input-clock-picker/input-clock-picker.component.scss +228 -0
- package/src/lib/components/input/input-clock-picker/input-clock-picker.component.spec.ts +62 -0
- package/src/lib/components/input/input-clock-picker/input-clock-picker.component.ts +178 -0
- package/src/lib/components/input/input-consts.ts +132 -0
- package/src/lib/components/input/input-date/input-date-validators.ts +41 -0
- package/src/lib/components/input/input-date/input-date.component.html +41 -0
- package/src/lib/components/input/input-date/input-date.component.scss +95 -0
- package/src/lib/components/input/input-date/input-date.component.spec.ts +43 -0
- package/src/lib/components/input/input-date/input-date.component.ts +359 -0
- package/src/lib/components/input/input-date-time/input-date-time.component.html +70 -0
- package/src/lib/components/input/input-date-time/input-date-time.component.scss +133 -0
- package/src/lib/components/input/input-date-time/input-date-time.component.spec.ts +36 -0
- package/src/lib/components/input/input-date-time/input-date-time.component.ts +387 -0
- package/src/lib/components/input/input-file-upload/input-file-upload.component.html +89 -0
- package/src/lib/components/input/input-file-upload/input-file-upload.component.scss +171 -0
- package/src/lib/components/input/input-file-upload/input-file-upload.component.spec.ts +43 -0
- package/src/lib/components/input/input-file-upload/input-file-upload.component.ts +351 -0
- package/src/lib/components/input/input-interface.ts +8 -0
- package/src/lib/components/input/input-number/input-number-validators.ts +0 -0
- package/src/lib/components/input/input-number/input-number.component.html +51 -0
- package/src/lib/components/input/input-number/input-number.component.scss +140 -0
- package/src/lib/components/input/input-number/input-number.component.spec.ts +44 -0
- package/src/lib/components/input/input-number/input-number.component.ts +343 -0
- package/src/lib/components/input/input-radio-group/input-radio-group.component.html +44 -0
- package/src/lib/components/input/input-radio-group/input-radio-group.component.scss +139 -0
- package/src/lib/components/input/input-radio-group/input-radio-group.component.spec.ts +58 -0
- package/src/lib/components/input/input-radio-group/input-radio-group.component.ts +132 -0
- package/src/lib/components/input/input-slider/input-slider.component.html +111 -0
- package/src/lib/components/input/input-slider/input-slider.component.scss +203 -0
- package/src/lib/components/input/input-slider/input-slider.component.spec.ts +46 -0
- package/src/lib/components/input/input-slider/input-slider.component.ts +410 -0
- package/src/lib/components/input/input-text/input-text-validators.ts +67 -0
- package/src/lib/components/input/input-text/input-text.component.html +71 -0
- package/src/lib/components/input/input-text/input-text.component.scss +118 -0
- package/src/lib/components/input/input-text/input-text.component.spec.ts +55 -0
- package/src/lib/components/input/input-text/input-text.component.ts +215 -0
- package/src/lib/components/input/input-time/input-time-validators.ts +42 -0
- package/src/lib/components/input/input-time/input-time.component.html +92 -0
- package/src/lib/components/input/input-time/input-time.component.scss +191 -0
- package/src/lib/components/input/input-time/input-time.component.spec.ts +39 -0
- package/src/lib/components/input/input-time/input-time.component.ts +691 -0
- package/src/lib/components/input/input-toggle-switch/input-toggle-switch.component.html +36 -0
- package/src/lib/components/input/input-toggle-switch/input-toggle-switch.component.scss +121 -0
- package/src/lib/components/input/input-toggle-switch/input-toggle-switch.component.spec.ts +54 -0
- package/src/lib/components/input/input-toggle-switch/input-toggle-switch.component.ts +117 -0
- package/src/lib/components/input/input-type.ts +18 -0
- package/src/lib/components/input/input-validation/input-validation.component.html +19 -0
- package/src/lib/components/input/input-validation/input-validation.component.scss +39 -0
- package/src/lib/components/input/input-validation/input-validation.component.spec.ts +45 -0
- package/src/lib/components/input/input-validation/input-validation.component.ts +13 -0
- package/src/lib/components/input/input.pipe.ts +14 -0
- package/src/lib/components/layout/container/container.component.html +1 -0
- package/src/lib/components/layout/container/container.component.scss +33 -0
- package/src/lib/components/layout/container/container.component.ts +32 -0
- package/src/lib/components/layout/container/container.type.ts +1 -0
- package/src/lib/components/layout/divider/divider.component.html +1 -0
- package/src/lib/components/layout/divider/divider.component.scss +60 -0
- package/src/lib/components/layout/divider/divider.component.ts +38 -0
- package/src/lib/components/layout/divider/divider.type.ts +2 -0
- package/src/lib/components/layout/section/section.component.html +21 -0
- package/src/lib/components/layout/section/section.component.scss +43 -0
- package/src/lib/components/layout/section/section.component.ts +33 -0
- package/src/lib/components/layout/section/section.type.ts +2 -0
- package/src/lib/components/layout/separator/separator.component.html +9 -0
- package/src/lib/components/layout/separator/separator.component.scss +52 -0
- package/src/lib/components/layout/separator/separator.component.ts +25 -0
- package/src/lib/components/layout/separator/separator.type.ts +1 -0
- package/src/lib/components/loader/content-blur/content-blur.component.html +13 -0
- package/src/lib/components/loader/content-blur/content-blur.component.scss +43 -0
- package/src/lib/components/loader/content-blur/content-blur.component.spec.ts +42 -0
- package/src/lib/components/loader/content-blur/content-blur.component.ts +34 -0
- package/src/lib/components/loader/loader.type.ts +2 -0
- package/src/lib/components/loader/progress-bar/progress-bar.component.html +26 -0
- package/src/lib/components/loader/progress-bar/progress-bar.component.scss +151 -0
- package/src/lib/components/loader/progress-bar/progress-bar.component.spec.ts +47 -0
- package/src/lib/components/loader/progress-bar/progress-bar.component.ts +28 -0
- package/src/lib/components/loader/progress-bar/progress-bar.type.ts +8 -0
- package/src/lib/components/loader/pulse-loader/pulse-loader.component.html +12 -0
- package/src/lib/components/loader/pulse-loader/pulse-loader.component.scss +202 -0
- package/src/lib/components/loader/pulse-loader/pulse-loader.component.spec.ts +55 -0
- package/src/lib/components/loader/pulse-loader/pulse-loader.component.ts +73 -0
- package/src/lib/components/loader/pulse-loader/pulse-loader.type.ts +6 -0
- package/src/lib/components/loader/skeleton-loader/skeleton-loader.component.html +13 -0
- package/src/lib/components/loader/skeleton-loader/skeleton-loader.component.scss +113 -0
- package/src/lib/components/loader/skeleton-loader/skeleton-loader.component.spec.ts +37 -0
- package/src/lib/components/loader/skeleton-loader/skeleton-loader.component.ts +51 -0
- package/src/lib/components/loader/skeleton-loader/skeleton-loader.type.ts +6 -0
- package/src/lib/components/loader/spinner/spinner.component.html +20 -0
- package/src/lib/components/loader/spinner/spinner.component.scss +137 -0
- package/src/lib/components/loader/spinner/spinner.component.spec.ts +43 -0
- package/src/lib/components/loader/spinner/spinner.component.ts +32 -0
- package/src/lib/components/loader/spinner/spinner.type.ts +6 -0
- package/src/lib/components/modal/modal.component.html +47 -0
- package/src/lib/components/modal/modal.component.scss +139 -0
- package/src/lib/components/modal/modal.component.spec.ts +60 -0
- package/src/lib/components/modal/modal.component.ts +83 -0
- package/src/lib/components/modal/modal.type.ts +9 -0
- package/src/lib/components/morph/blob-moph/blob-moprh.component.spec.ts +79 -0
- package/src/lib/components/morph/blob-moph/blob-moprh.component.ts +96 -0
- package/src/lib/components/morph/blob-moph/blob-morph.component.html +34 -0
- package/src/lib/components/morph/blob-moph/blob-morph.component.scss +7 -0
- package/src/lib/components/morph/morph.abstract.ts +13 -0
- package/src/lib/components/pagination/pagination.interface.ts +4 -0
- package/src/lib/components/pagination/small-pagination/small-pagination.component.html +61 -0
- package/src/lib/components/pagination/small-pagination/small-pagination.component.scss +187 -0
- package/src/lib/components/pagination/small-pagination/small-pagination.component.spec.ts +88 -0
- package/src/lib/components/pagination/small-pagination/small-pagination.component.ts +177 -0
- package/src/lib/components/selection-lists/multi-select/multi-select.component.html +170 -0
- package/src/lib/components/selection-lists/multi-select/multi-select.component.scss +312 -0
- package/src/lib/components/selection-lists/multi-select/multi-select.component.spec.ts +61 -0
- package/src/lib/components/selection-lists/multi-select/multi-select.component.ts +372 -0
- package/src/lib/components/selection-lists/selection-list/selection-list.component.html +125 -0
- package/src/lib/components/selection-lists/selection-list/selection-list.component.scss +267 -0
- package/src/lib/components/selection-lists/selection-list/selection-list.component.spec.ts +66 -0
- package/src/lib/components/selection-lists/selection-list/selection-list.component.ts +315 -0
- package/src/lib/components/selection-lists/selection-lists-base.ts +35 -0
- package/src/lib/components/selection-lists/selection-lists-const.ts +17 -0
- package/src/lib/components/selection-lists/selection-lists-interface.ts +7 -0
- package/src/lib/components/selection-lists/selection-lists.type.ts +1 -0
- package/src/lib/components/side-nav/side-nav.component.html +101 -0
- package/src/lib/components/side-nav/side-nav.component.scss +295 -0
- package/src/lib/components/side-nav/side-nav.component.spec.ts +0 -0
- package/src/lib/components/side-nav/side-nav.component.ts +18 -0
- package/src/lib/components/side-nav/side-nav.type.ts +28 -0
- package/src/lib/components/snackbar/snackbar.component.html +33 -0
- package/src/lib/components/snackbar/snackbar.component.scss +195 -0
- package/src/lib/components/snackbar/snackbar.component.ts +112 -0
- package/src/lib/components/snackbar/snackbar.type.ts +27 -0
- package/src/lib/components/status/chip/chip.component.html +51 -0
- package/src/lib/components/status/chip/chip.component.scss +149 -0
- package/src/lib/components/status/chip/chip.component.spec.ts +62 -0
- package/src/lib/components/status/chip/chip.component.ts +83 -0
- package/src/lib/components/status/chip/chip.type.ts +42 -0
- package/src/lib/components/status/directives/badge/badge.directive.spec.ts +60 -0
- package/src/lib/components/status/directives/badge/badge.directive.ts +190 -0
- package/src/lib/components/status/directives/badge/badge.interface.ts +19 -0
- package/src/lib/components/status/pill/pill.component.html +40 -0
- package/src/lib/components/status/pill/pill.component.scss +113 -0
- package/src/lib/components/status/pill/pill.component.spec.ts +47 -0
- package/src/lib/components/status/pill/pill.component.ts +83 -0
- package/src/lib/components/status/pill/pill.type.ts +42 -0
- package/src/lib/components/status/status.interface.ts +57 -0
- package/src/lib/components/status/status.type.ts +62 -0
- package/src/lib/components/status/tag/tag.component.html +39 -0
- package/src/lib/components/status/tag/tag.component.scss +140 -0
- package/src/lib/components/status/tag/tag.component.spec.ts +47 -0
- package/src/lib/components/status/tag/tag.component.ts +83 -0
- package/src/lib/components/status/tag/tag.type.ts +42 -0
- package/src/lib/components/stepper/stepper.component.html +83 -0
- package/src/lib/components/stepper/stepper.component.scss +196 -0
- package/src/lib/components/stepper/stepper.component.ts +482 -0
- package/src/lib/components/stepper/stepper.type.ts +60 -0
- package/src/lib/components/table/table.component.html +438 -0
- package/src/lib/components/table/table.component.scss +259 -0
- package/src/lib/components/table/table.component.spec.ts +117 -0
- package/src/lib/components/table/table.component.ts +215 -0
- package/src/lib/components/table/table.enum.ts +4 -0
- package/src/lib/components/table/table.function.ts +47 -0
- package/src/lib/components/table/table.interface.ts +143 -0
- package/src/lib/components/table/table.pipe.ts +62 -0
- package/src/lib/components/table/table.type.ts +15 -0
- package/src/lib/components/tabs/tabs.component.html +88 -0
- package/src/lib/components/tabs/tabs.component.scss +305 -0
- package/src/lib/components/tabs/tabs.component.spec.ts +94 -0
- package/src/lib/components/tabs/tabs.component.ts +282 -0
- package/src/lib/components/tabs/tabs.type.ts +81 -0
- package/src/lib/components/title-bar/title-bar.component.html +21 -0
- package/src/lib/components/title-bar/title-bar.component.scss +139 -0
- package/src/lib/components/title-bar/title-bar.component.spec.ts +44 -0
- package/src/lib/components/title-bar/title-bar.component.ts +13 -0
- package/src/lib/components/toast/toast.component.html +36 -0
- package/src/lib/components/toast/toast.component.scss +241 -0
- package/src/lib/components/toast/toast.component.ts +165 -0
- package/src/lib/components/toast/toast.type.ts +37 -0
- package/src/lib/components/toast-stack/toast-stack.component.html +30 -0
- package/src/lib/components/toast-stack/toast-stack.component.scss +35 -0
- package/src/lib/components/toast-stack/toast-stack.component.ts +51 -0
- package/src/lib/consts/country-prefix.ts +244 -0
- package/src/lib/directives/tooltip/popover.directive.ts +274 -0
- package/src/lib/directives/tooltip/tooltip.directive.spec.ts +86 -0
- package/src/lib/directives/tooltip/tooltip.directive.ts +234 -0
- package/src/lib/directives/tooltip/tooltip.interface.ts +29 -0
- package/src/lib/directives/tooltip/tooltip.type.ts +9 -0
- package/src/lib/interfaces/common.interfaces.ts +4 -0
- package/src/lib/pipes/chunk.pipe.ts +16 -0
- package/src/lib/pipes/safe-html.pipe.ts +14 -0
- package/src/lib/pipes/sanitize-html.pipe.ts +23 -0
- package/src/lib/types/base.types.ts +23 -0
- package/src/lib/types/common.types.ts +98 -0
- package/src/lib/types/form.types.ts +5 -0
- package/src/lib/utils/common.utils.ts +53 -0
- package/src/lib/utils/date.utils.ts +474 -0
- package/src/lib/utils/number.utils.ts +16 -0
- package/src/lib/utils/uuid.utils.ts +39 -0
- package/src/public-api.ts +114 -0
- package/tsconfig.lib.json +17 -0
- package/tsconfig.lib.prod.json +10 -0
- package/tsconfig.spec.json +9 -0
- package/fesm2022/fragments.mjs +0 -8928
- package/fesm2022/fragments.mjs.map +0 -1
- package/index.d.ts +0 -3929
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { TemplateRef } from '@angular/core';
|
|
2
|
+
import { TBaseSize, TBaseStyle } from '../../types/base.types';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Style variants supported by tabs.
|
|
6
|
+
*/
|
|
7
|
+
export type TTabStyle = TBaseStyle;
|
|
8
|
+
/**
|
|
9
|
+
* Size variants supported by tabs.
|
|
10
|
+
*/
|
|
11
|
+
export type TTabSize = TBaseSize;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Context passed into projected templates for tabs.
|
|
15
|
+
*/
|
|
16
|
+
export interface TabItemContext<T = unknown> {
|
|
17
|
+
/**
|
|
18
|
+
* Implicit reference to the current tab item.
|
|
19
|
+
*/
|
|
20
|
+
$implicit: TabItem<T>;
|
|
21
|
+
/**
|
|
22
|
+
* Named reference to the current tab item.
|
|
23
|
+
*/
|
|
24
|
+
item: TabItem<T>;
|
|
25
|
+
/**
|
|
26
|
+
* Zero-based index of the tab.
|
|
27
|
+
*/
|
|
28
|
+
index: number;
|
|
29
|
+
/**
|
|
30
|
+
* Whether this tab is currently active.
|
|
31
|
+
*/
|
|
32
|
+
active: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Function to activate this tab.
|
|
35
|
+
*/
|
|
36
|
+
select: () => void;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Definition for a single tab.
|
|
41
|
+
*/
|
|
42
|
+
export interface TabItem<T = unknown> {
|
|
43
|
+
/** Unique identifier for the tab. Auto-generated when omitted. */
|
|
44
|
+
id?: string;
|
|
45
|
+
/** Visible label shown on the tab button. */
|
|
46
|
+
label: string;
|
|
47
|
+
/** Optional secondary label or helper text. */
|
|
48
|
+
description?: string;
|
|
49
|
+
/** Optional icon to render when no template is provided. */
|
|
50
|
+
icon?: string;
|
|
51
|
+
/** Disable interaction for this tab. */
|
|
52
|
+
disabled?: boolean;
|
|
53
|
+
/** Apply a style variant to this tab. */
|
|
54
|
+
style?: TTabStyle;
|
|
55
|
+
/** Adjust spacing and typography for this tab. */
|
|
56
|
+
size?: TTabSize;
|
|
57
|
+
/** Mark this tab as initially active when no activeId input is provided. */
|
|
58
|
+
active?: boolean;
|
|
59
|
+
/** Arbitrary data available to projected templates. */
|
|
60
|
+
data?: T;
|
|
61
|
+
/** Simple content rendering when no template is provided. */
|
|
62
|
+
content?: string;
|
|
63
|
+
/** Custom icon template for this tab only. */
|
|
64
|
+
iconTemplate?: TemplateRef<TabItemContext<T>>;
|
|
65
|
+
/** Custom label template for this tab only. */
|
|
66
|
+
labelTemplate?: TemplateRef<TabItemContext<T>>;
|
|
67
|
+
/** Custom body template for this tab only. */
|
|
68
|
+
contentTemplate?: TemplateRef<TabItemContext<T>>;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Payload emitted when the active tab changes.
|
|
73
|
+
*/
|
|
74
|
+
export interface TabChangeEvent<T = unknown> {
|
|
75
|
+
/** Identifier of the active tab, or null when none available. */
|
|
76
|
+
id: string | null;
|
|
77
|
+
/** Index of the active tab in the view items. */
|
|
78
|
+
index: number;
|
|
79
|
+
/** The full tab item associated with the change. */
|
|
80
|
+
item?: TabItem<T>;
|
|
81
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
@if (title) {
|
|
2
|
+
<div
|
|
3
|
+
class="frg-title-bar"
|
|
4
|
+
[ngClass]="{
|
|
5
|
+
'frg-title-bar__primary': styleType === 'primary',
|
|
6
|
+
'frg-title-bar__secondary': styleType === 'secondary',
|
|
7
|
+
'frg-title-bar__tertiary': styleType === 'tertiary',
|
|
8
|
+
'frg-title-bar__dark': styleType === 'dark',
|
|
9
|
+
'frg-title-bar__light': styleType === 'light'
|
|
10
|
+
}"
|
|
11
|
+
>
|
|
12
|
+
<div
|
|
13
|
+
class="frg-title-bar-title d-flex justify-content-between"
|
|
14
|
+
aria-level="3"
|
|
15
|
+
>
|
|
16
|
+
<div class="frg-title-bar-title__text">
|
|
17
|
+
{{ title }}
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
@use './../../../../assets/styles/scss/variables' as *;
|
|
2
|
+
@use './../../../../assets/styles/scss/fonts';
|
|
3
|
+
|
|
4
|
+
.frg-title-bar {
|
|
5
|
+
color: $color-dark;
|
|
6
|
+
font-weight: normal;
|
|
7
|
+
font-size: 1.25rem;
|
|
8
|
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
9
|
+
font-family:
|
|
10
|
+
'frg-opensans',
|
|
11
|
+
system-ui,
|
|
12
|
+
-apple-system,
|
|
13
|
+
BlinkMacSystemFont,
|
|
14
|
+
'Segoe UI',
|
|
15
|
+
Roboto,
|
|
16
|
+
Oxygen,
|
|
17
|
+
Ubuntu,
|
|
18
|
+
Cantarell,
|
|
19
|
+
'Open Sans',
|
|
20
|
+
'Helvetica Neue',
|
|
21
|
+
sans-serif;
|
|
22
|
+
|
|
23
|
+
&__primary {
|
|
24
|
+
background-color: $color-primary-dark;
|
|
25
|
+
color: $color-light;
|
|
26
|
+
|
|
27
|
+
& .frg-title-bar-title {
|
|
28
|
+
& button {
|
|
29
|
+
color: $color-primary-dark;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
& .frg-title-bar-filter {
|
|
34
|
+
background-color: $color-primary;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
& .frg-title-bar-search {
|
|
38
|
+
background-color: $color-primary;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&__secondary {
|
|
43
|
+
background-color: $color-secondary-dark;
|
|
44
|
+
color: $color-light;
|
|
45
|
+
|
|
46
|
+
& .frg-title-bar-title {
|
|
47
|
+
& button {
|
|
48
|
+
color: $color-secondary-dark;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
& .frg-title-bar-filter {
|
|
53
|
+
background-color: $color-secondary;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
& .frg-title-bar-search {
|
|
57
|
+
background-color: $color-secondary;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
&__tertiary {
|
|
62
|
+
background-color: $color-tertiary-dark;
|
|
63
|
+
color: $color-light;
|
|
64
|
+
|
|
65
|
+
& .frg-title-bar-title {
|
|
66
|
+
& button {
|
|
67
|
+
color: $color-tertiary-dark;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
& .frg-title-bar-filter {
|
|
72
|
+
background-color: $color-tertiary;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
& .frg-title-bar-search {
|
|
76
|
+
background-color: $color-tertiary;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
&__dark {
|
|
81
|
+
background-color: $color-dark;
|
|
82
|
+
color: #fff;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
&__light {
|
|
86
|
+
background-color: $color-light;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
& .frg-title-bar-title {
|
|
90
|
+
padding: 15px 25px;
|
|
91
|
+
|
|
92
|
+
& button {
|
|
93
|
+
outline: none;
|
|
94
|
+
border: none;
|
|
95
|
+
border-radius: 50%;
|
|
96
|
+
width: 25px;
|
|
97
|
+
height: 25px;
|
|
98
|
+
padding: 15px;
|
|
99
|
+
font-size: 1rem;
|
|
100
|
+
|
|
101
|
+
&:focus {
|
|
102
|
+
color: $color-dark;
|
|
103
|
+
background-color: $input-background;
|
|
104
|
+
border-color: $input-focus-border-color;
|
|
105
|
+
outline: 0;
|
|
106
|
+
outline: 3px solid $color-primary;
|
|
107
|
+
box-shadow: none;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
&:focus-visible {
|
|
111
|
+
outline-offset: 5px;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
& .frg-title-bar-filter {
|
|
117
|
+
&__container {
|
|
118
|
+
padding: 25px;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
& label {
|
|
122
|
+
display: block;
|
|
123
|
+
font-size: 0.8rem;
|
|
124
|
+
font-weight: lighter;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
& .frg-title-bar-search {
|
|
129
|
+
&__container {
|
|
130
|
+
padding: 25px;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
& label {
|
|
134
|
+
display: block;
|
|
135
|
+
font-size: 0.8rem;
|
|
136
|
+
font-weight: lighter;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
import { By } from '@angular/platform-browser';
|
|
3
|
+
import { TitleBarComponent } from './title-bar.component';
|
|
4
|
+
|
|
5
|
+
describe('TitleBarComponent', () => {
|
|
6
|
+
let fixture: ComponentFixture<TitleBarComponent>;
|
|
7
|
+
let component: TitleBarComponent;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
imports: [TitleBarComponent]
|
|
12
|
+
}).compileComponents();
|
|
13
|
+
|
|
14
|
+
fixture = TestBed.createComponent(TitleBarComponent);
|
|
15
|
+
component = fixture.componentInstance;
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('renders title when provided', () => {
|
|
19
|
+
component.title = 'Dashboard';
|
|
20
|
+
|
|
21
|
+
fixture.detectChanges();
|
|
22
|
+
|
|
23
|
+
const title = fixture.debugElement.query(By.css('.frg-title-bar-title__text'));
|
|
24
|
+
expect(title.nativeElement.textContent).toContain('Dashboard');
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it('does not render when title is empty', () => {
|
|
28
|
+
component.title = '';
|
|
29
|
+
|
|
30
|
+
fixture.detectChanges();
|
|
31
|
+
|
|
32
|
+
expect(fixture.debugElement.query(By.css('.frg-title-bar'))).toBeNull();
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
it('applies style class based on styleType', () => {
|
|
36
|
+
component.title = 'Dashboard';
|
|
37
|
+
component.styleType = 'dark';
|
|
38
|
+
|
|
39
|
+
fixture.detectChanges();
|
|
40
|
+
|
|
41
|
+
const wrapper = fixture.debugElement.query(By.css('.frg-title-bar'));
|
|
42
|
+
expect(wrapper.nativeElement.classList).toContain('frg-title-bar__dark');
|
|
43
|
+
});
|
|
44
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CommonModule } from '@angular/common';
|
|
2
|
+
import { Component, Input } from '@angular/core';
|
|
3
|
+
import { TBaseStyle } from '../../types/base.types';
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'frg-title-bar',
|
|
6
|
+
imports: [CommonModule],
|
|
7
|
+
templateUrl: './title-bar.component.html',
|
|
8
|
+
styleUrls: ['./title-bar.component.scss']
|
|
9
|
+
})
|
|
10
|
+
export class TitleBarComponent {
|
|
11
|
+
@Input() title = '';
|
|
12
|
+
@Input() styleType: TBaseStyle = 'primary';
|
|
13
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
@if (isRendered) {
|
|
2
|
+
<div
|
|
3
|
+
class="frg-toast"
|
|
4
|
+
[ngClass]="toastClassMap"
|
|
5
|
+
role="status"
|
|
6
|
+
aria-live="polite"
|
|
7
|
+
[attr.aria-label]="ariaLabel"
|
|
8
|
+
[style.--frg-toast-motion]="motionDuration + 'ms'"
|
|
9
|
+
>
|
|
10
|
+
<div class="frg-toast__accent"></div>
|
|
11
|
+
@if (statusIconClass) {
|
|
12
|
+
<span class="frg-toast__status-icon" [ngClass]="statusIconClass" aria-hidden="true"></span>
|
|
13
|
+
}
|
|
14
|
+
<div class="frg-toast__content">
|
|
15
|
+
@if (title) {
|
|
16
|
+
<div class="frg-toast__title">{{ title }}</div>
|
|
17
|
+
}
|
|
18
|
+
<ng-content select="[frg-toast-title]"></ng-content>
|
|
19
|
+
@if (message) {
|
|
20
|
+
<div class="frg-toast__message">{{ message }}</div>
|
|
21
|
+
}
|
|
22
|
+
<ng-content select="[frg-toast-body]"></ng-content>
|
|
23
|
+
<ng-content></ng-content>
|
|
24
|
+
</div>
|
|
25
|
+
@if (hasCloseButton) {
|
|
26
|
+
<button
|
|
27
|
+
type="button"
|
|
28
|
+
class="frg-toast__close"
|
|
29
|
+
aria-label="Close notification"
|
|
30
|
+
(click)="onCloseClick()"
|
|
31
|
+
>
|
|
32
|
+
×
|
|
33
|
+
</button>
|
|
34
|
+
}
|
|
35
|
+
</div>
|
|
36
|
+
}
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
@use 'sass:color';
|
|
2
|
+
@use '../../../../assets/styles/scss/variables' as *;
|
|
3
|
+
|
|
4
|
+
:host {
|
|
5
|
+
display: block;
|
|
6
|
+
|
|
7
|
+
.frg-toast {
|
|
8
|
+
position: fixed;
|
|
9
|
+
display: grid;
|
|
10
|
+
grid-template-columns: 0.35rem auto 1fr auto;
|
|
11
|
+
gap: 0.75rem;
|
|
12
|
+
align-items: start;
|
|
13
|
+
padding: 0.75rem 0.9rem;
|
|
14
|
+
background: var(--frg-toast-bg, $color-light);
|
|
15
|
+
color: var(--frg-toast-text, $color-dark);
|
|
16
|
+
border-radius: 0.25rem;
|
|
17
|
+
border: 1px solid var(--frg-toast-border, rgba($color-dark, 0.1));
|
|
18
|
+
box-shadow: $box-shadow-md;
|
|
19
|
+
min-width: 16rem;
|
|
20
|
+
max-width: 22rem;
|
|
21
|
+
z-index: 1100;
|
|
22
|
+
|
|
23
|
+
&--size-small {
|
|
24
|
+
padding: 0.6rem 0.75rem;
|
|
25
|
+
min-width: 14rem;
|
|
26
|
+
max-width: 20rem;
|
|
27
|
+
.frg-toast__content {
|
|
28
|
+
font-size: 0.8rem;
|
|
29
|
+
}
|
|
30
|
+
.frg-toast__title {
|
|
31
|
+
font-size: 0.85rem;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&--size-medium {
|
|
36
|
+
padding: 0.75rem 0.9rem;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&--size-large {
|
|
40
|
+
padding: 0.9rem 1.1rem;
|
|
41
|
+
min-width: 18rem;
|
|
42
|
+
max-width: 26rem;
|
|
43
|
+
.frg-toast__content {
|
|
44
|
+
font-size: 0.9rem;
|
|
45
|
+
}
|
|
46
|
+
.frg-toast__title {
|
|
47
|
+
font-size: 1rem;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
&--stacked {
|
|
52
|
+
position: relative;
|
|
53
|
+
top: auto !important;
|
|
54
|
+
right: auto !important;
|
|
55
|
+
bottom: auto !important;
|
|
56
|
+
left: auto !important;
|
|
57
|
+
width: 100%;
|
|
58
|
+
max-width: 100%;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
&--enter {
|
|
62
|
+
animation: frg-toast-enter var(--frg-toast-motion, 200ms) ease;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&--leave {
|
|
66
|
+
animation: frg-toast-leave var(--frg-toast-motion, 200ms) ease forwards;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&__accent {
|
|
70
|
+
width: 0.35rem;
|
|
71
|
+
border-radius: 0.35rem;
|
|
72
|
+
background: var(--frg-toast-accent, $color-primary);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
&__content {
|
|
76
|
+
display: flex;
|
|
77
|
+
flex-direction: column;
|
|
78
|
+
gap: 0.2rem;
|
|
79
|
+
font-size: 0.85rem;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
&__status-icon {
|
|
83
|
+
color: var(--frg-toast-accent, $color-primary);
|
|
84
|
+
font-size: 1rem;
|
|
85
|
+
line-height: 1;
|
|
86
|
+
margin-top: 0.15rem;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
&__title {
|
|
90
|
+
font-weight: 600;
|
|
91
|
+
font-size: 0.9rem;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
&__message {
|
|
95
|
+
color: var(--frg-toast-message, $color-dark-soft);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
&__close {
|
|
99
|
+
border: 0;
|
|
100
|
+
background: transparent;
|
|
101
|
+
color: var(--frg-toast-text, $color-dark-soft);
|
|
102
|
+
font-size: 1.2rem;
|
|
103
|
+
line-height: 1;
|
|
104
|
+
padding: 0;
|
|
105
|
+
cursor: pointer;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
&__close:hover,
|
|
109
|
+
&__close:focus-visible {
|
|
110
|
+
color: var(--frg-toast-text, $color-dark);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.frg-toast--top-left {
|
|
115
|
+
top: 1.5rem;
|
|
116
|
+
left: 1.5rem;
|
|
117
|
+
--frg-toast-translate-x: -16px;
|
|
118
|
+
--frg-toast-translate-y: -6px;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.frg-toast--top-right {
|
|
122
|
+
top: 1.5rem;
|
|
123
|
+
right: 1.5rem;
|
|
124
|
+
--frg-toast-translate-x: 16px;
|
|
125
|
+
--frg-toast-translate-y: -6px;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.frg-toast--bottom-left {
|
|
129
|
+
bottom: 1.5rem;
|
|
130
|
+
left: 1.5rem;
|
|
131
|
+
--frg-toast-translate-x: -16px;
|
|
132
|
+
--frg-toast-translate-y: 6px;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.frg-toast--bottom-right {
|
|
136
|
+
bottom: 1.5rem;
|
|
137
|
+
right: 1.5rem;
|
|
138
|
+
--frg-toast-translate-x: 16px;
|
|
139
|
+
--frg-toast-translate-y: 6px;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.frg-toast--default {
|
|
143
|
+
--frg-toast-accent: #{$color-dark-neutral};
|
|
144
|
+
--frg-toast-bg: #{$color-neutral};
|
|
145
|
+
--frg-toast-text: #{$color-dark};
|
|
146
|
+
--frg-toast-message: #{$color-dark-soft};
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.frg-toast--primary {
|
|
150
|
+
--frg-toast-accent: #{$color-primary};
|
|
151
|
+
--frg-toast-bg: #{color.scale($color-primary-light, $lightness: 50%)};
|
|
152
|
+
--frg-toast-text: #{color.scale($color-primary-dark, $lightness: -25%)};
|
|
153
|
+
--frg-toast-message: #{color.scale($color-primary-dark, $lightness: -25%)};
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.frg-toast--secondary {
|
|
157
|
+
--frg-toast-accent: #{$color-secondary};
|
|
158
|
+
--frg-toast-bg: #{color.scale($color-secondary-light, $lightness: 50%)};
|
|
159
|
+
--frg-toast-text: #{color.scale($color-secondary-dark, $lightness: -25%)};
|
|
160
|
+
--frg-toast-message: #{color.scale($color-secondary-dark, $lightness: -25%)};
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.frg-toast--tertiary {
|
|
164
|
+
--frg-toast-accent: #{$color-tertiary};
|
|
165
|
+
--frg-toast-bg: #{color.scale($color-tertiary-light, $lightness: 50%)};
|
|
166
|
+
--frg-toast-text: #{color.scale($color-tertiary-dark, $lightness: -25%)};
|
|
167
|
+
--frg-toast-message: #{color.scale($color-tertiary-dark, $lightness: -25%)};
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.frg-toast--info {
|
|
171
|
+
--frg-toast-accent: #{$color-info};
|
|
172
|
+
--frg-toast-bg: #{$color-light};
|
|
173
|
+
--frg-toast-text: #{$color-dark};
|
|
174
|
+
--frg-toast-message: #{$color-dark-soft};
|
|
175
|
+
border-top: 0.3rem solid #{$color-info};
|
|
176
|
+
border-bottom: 0.3rem solid #{$color-info};
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.frg-toast--success {
|
|
180
|
+
--frg-toast-accent: #{$color-success};
|
|
181
|
+
--frg-toast-bg: #{$color-light};
|
|
182
|
+
--frg-toast-text: #{$color-dark};
|
|
183
|
+
--frg-toast-message: #{$color-dark-soft};
|
|
184
|
+
border-top: 0.3rem solid #{$color-success};
|
|
185
|
+
border-bottom: 0.3rem solid #{$color-success};
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.frg-toast--warning {
|
|
189
|
+
--frg-toast-accent: #{$color-warning};
|
|
190
|
+
--frg-toast-bg: #{$color-light};
|
|
191
|
+
--frg-toast-text: #{$color-dark};
|
|
192
|
+
--frg-toast-message: #{$color-dark-soft};
|
|
193
|
+
border-top: 0.3rem solid #{$color-warning};
|
|
194
|
+
border-bottom: 0.3rem solid #{$color-warning};
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.frg-toast--danger {
|
|
198
|
+
--frg-toast-accent: #{$color-danger};
|
|
199
|
+
--frg-toast-bg: #{$color-light};
|
|
200
|
+
--frg-toast-text: #{$color-dark};
|
|
201
|
+
--frg-toast-message: #{$color-dark-soft};
|
|
202
|
+
border-top: 0.3rem solid #{$color-danger};
|
|
203
|
+
border-bottom: 0.3rem solid #{$color-danger};
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.frg-toast--dark {
|
|
207
|
+
--frg-toast-accent: #{$color-dark};
|
|
208
|
+
--frg-toast-bg: #{$color-dark};
|
|
209
|
+
--frg-toast-text: #{$color-light};
|
|
210
|
+
--frg-toast-message: #{color.scale($color-light, $lightness: -12%)};
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.frg-toast--light {
|
|
214
|
+
--frg-toast-accent: #{$color-light-neutral};
|
|
215
|
+
--frg-toast-bg: #{$color-light};
|
|
216
|
+
--frg-toast-text: #{$color-dark};
|
|
217
|
+
--frg-toast-message: #{$color-dark-soft};
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
@keyframes frg-toast-enter {
|
|
222
|
+
from {
|
|
223
|
+
opacity: 0;
|
|
224
|
+
transform: translate(var(--frg-toast-translate-x, 0), var(--frg-toast-translate-y, 0));
|
|
225
|
+
}
|
|
226
|
+
to {
|
|
227
|
+
opacity: 1;
|
|
228
|
+
transform: translate(0, 0);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
@keyframes frg-toast-leave {
|
|
233
|
+
from {
|
|
234
|
+
opacity: 1;
|
|
235
|
+
transform: translate(0, 0);
|
|
236
|
+
}
|
|
237
|
+
to {
|
|
238
|
+
opacity: 0;
|
|
239
|
+
transform: translate(var(--frg-toast-translate-x, 0), var(--frg-toast-translate-y, 0));
|
|
240
|
+
}
|
|
241
|
+
}
|