sdga-ui 1.0.6 → 1.0.7
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 +4 -4
- package/css/dga-ui.css +4146 -1040
- package/css/dga-ui.css.map +1 -1
- package/demo-angular/package-lock.json +41 -41
- package/demo-angular/package.json +8 -8
- package/demo-angular/public/404.html +35 -0
- package/demo-angular/public/i18n/ar.json +47 -0
- package/demo-angular/public/i18n/en.json +47 -0
- package/demo-angular/src/app/app.routes.ts +12 -4
- package/demo-angular/src/app/app.ts +8 -2
- package/demo-angular/src/app/views/alerts/alerts.component.html +10 -10
- package/demo-angular/src/app/views/alerts/alerts.component.ts +10 -10
- package/demo-angular/src/app/views/buttons/buttons.component.html +23 -23
- package/demo-angular/src/app/views/buttons/buttons.component.ts +14 -14
- package/demo-angular/src/app/views/cards/cards.component.html +6 -6
- package/demo-angular/src/app/views/cards/cards.component.ts +10 -10
- package/demo-angular/src/app/views/contexts/contexts.component.html +204 -0
- package/demo-angular/src/app/views/contexts/contexts.component.ts +10 -0
- package/demo-angular/src/app/views/footer/footer.html +282 -0
- package/demo-angular/src/app/views/footer/footer.scss +0 -0
- package/demo-angular/src/app/views/footer/footer.spec.ts +23 -0
- package/demo-angular/src/app/views/footer/footer.ts +142 -0
- package/demo-angular/src/app/views/header/header.html +1 -0
- package/demo-angular/src/app/views/header/header.scss +0 -0
- package/demo-angular/src/app/views/header/header.spec.ts +23 -0
- package/demo-angular/src/app/views/header/header.ts +11 -0
- package/demo-angular/src/app/views/home/home.component.html +0 -5
- package/demo-angular/src/app/views/links/links.component.html +2 -2
- package/demo-angular/src/app/views/toasts/toasts.component.html +7 -7
- package/demo-angular/src/app/views/toasts/toasts.component.ts +7 -7
- package/demo-angular/src/index.html +15 -1
- package/package.json +2 -2
- package/sdga-ui/README.md +45 -0
- package/sdga-ui/content/docs/components/alerts.mdx +475 -0
- package/sdga-ui/content/docs/index.mdx +239 -0
- package/sdga-ui/next.config.mjs +10 -0
- package/sdga-ui/package-lock.json +5851 -0
- package/sdga-ui/package.json +32 -0
- package/sdga-ui/postcss.config.mjs +5 -0
- package/sdga-ui/source.config.ts +27 -0
- package/sdga-ui/src/app/(home)/layout.tsx +6 -0
- package/sdga-ui/src/app/(home)/page.tsx +202 -0
- package/sdga-ui/src/app/api/search/route.ts +7 -0
- package/sdga-ui/src/app/docs/[[...slug]]/page.tsx +54 -0
- package/sdga-ui/src/app/docs/layout.tsx +11 -0
- package/sdga-ui/src/app/global.css +3 -0
- package/sdga-ui/src/app/layout.tsx +25 -0
- package/sdga-ui/src/app/llms-full.txt/route.ts +10 -0
- package/sdga-ui/src/app/og/docs/[...slug]/route.tsx +34 -0
- package/sdga-ui/src/app/sdga-scoped.css +7 -0
- package/sdga-ui/src/components/sdga-preview.tsx +105 -0
- package/sdga-ui/src/lib/layout.shared.tsx +9 -0
- package/sdga-ui/src/lib/source.ts +27 -0
- package/sdga-ui/src/mdx-components.tsx +9 -0
- package/sdga-ui/tsconfig.json +46 -0
- package/theme/_variables.scss +7 -5
- package/theme/components/_buttons.scss +105 -0
- package/theme/config/_base.scss +10 -0
- package/theme/config/_contexts.scss +471 -0
- package/theme/customizations/_alerts.scss +100 -112
- package/theme/customizations/_badges.scss +15 -0
- package/theme/customizations/_buttons.scss +288 -146
- package/theme/customizations/_cards.scss +52 -0
- package/theme/customizations/_contexts.scss +432 -0
- package/theme/customizations/_footer.scss +83 -0
- package/theme/customizations/_links.scss +55 -39
- package/theme/customizations/_toasts.scss +79 -100
- package/theme/dga-ui.scss +2 -0
- package/demo-angular/src/app/views/bootstrap/bootstrap.component.html +0 -14
- package/demo-angular/src/app/views/bootstrap/bootstrap.component.scss +0 -91
- package/demo-angular/src/app/views/bootstrap/bootstrap.component.ts +0 -23
|
@@ -56,78 +56,78 @@
|
|
|
56
56
|
<h3 class="mt-5">{{ 'buttons.section_icons' | translate }}</h3>
|
|
57
57
|
<div class="component-showcase mb-3">
|
|
58
58
|
<button type="button" class="btn btn-primary btn-icon">
|
|
59
|
-
<i class="
|
|
59
|
+
<i class="bi bi-download"></i>{{ 'buttons.download' | translate }}
|
|
60
60
|
</button>
|
|
61
61
|
<button type="button" class="btn btn-neutral btn-icon">
|
|
62
|
-
<i class="
|
|
62
|
+
<i class="bi bi-upload"></i>{{ 'buttons.upload' | translate }}
|
|
63
63
|
</button>
|
|
64
64
|
<button type="button" class="btn btn-secondary btn-icon">
|
|
65
|
-
<i class="
|
|
65
|
+
<i class="bi bi-pencil"></i>{{ 'buttons.edit' | translate }}
|
|
66
66
|
</button>
|
|
67
67
|
<button type="button" class="btn btn-danger btn-icon">
|
|
68
|
-
<i class="
|
|
68
|
+
<i class="bi bi-trash"></i>{{ 'buttons.delete' | translate }}
|
|
69
69
|
</button>
|
|
70
70
|
</div>
|
|
71
71
|
<app-code-example [htmlCode]="buttonIconLeftCode"></app-code-example>
|
|
72
72
|
<div class="component-showcase mb-3">
|
|
73
73
|
<button type="button" class="btn btn-primary btn-icon">
|
|
74
|
-
{{ 'buttons.save' | translate }}<i class="
|
|
74
|
+
{{ 'buttons.save' | translate }}<i class="bi bi-check"></i>
|
|
75
75
|
</button>
|
|
76
76
|
<button type="button" class="btn btn-neutral btn-icon">
|
|
77
|
-
{{ 'buttons.search' | translate }}<i class="
|
|
77
|
+
{{ 'buttons.search' | translate }}<i class="bi bi-search"></i>
|
|
78
78
|
</button>
|
|
79
79
|
<button type="button" class="btn btn-secondary btn-icon">
|
|
80
|
-
{{ 'buttons.settings' | translate }}<i class="
|
|
80
|
+
{{ 'buttons.settings' | translate }}<i class="bi bi-gear"></i>
|
|
81
81
|
</button>
|
|
82
82
|
</div>
|
|
83
83
|
<app-code-example [htmlCode]="buttonIconRightCode"></app-code-example>
|
|
84
84
|
<div class="component-showcase mb-3">
|
|
85
85
|
<button type="button" class="btn btn-primary btn-icon btn-sm">
|
|
86
|
-
<i class="
|
|
86
|
+
<i class="bi bi-plus-circle"></i>{{ 'buttons.add' | translate }}
|
|
87
87
|
</button>
|
|
88
88
|
<button type="button" class="btn btn-outline-primary btn-icon">
|
|
89
|
-
<i class="
|
|
89
|
+
<i class="bi bi-arrow-right"></i>{{ 'buttons.next' | translate }}
|
|
90
90
|
</button>
|
|
91
91
|
<button type="button" class="btn btn-outline-secondary btn-icon">
|
|
92
|
-
<i class="
|
|
92
|
+
<i class="bi bi-arrow-left"></i>{{ 'buttons.previous' | translate }}
|
|
93
93
|
</button>
|
|
94
94
|
</div>
|
|
95
95
|
|
|
96
96
|
<h3 class="mt-5">{{ 'buttons.section_icon_only' | translate }}</h3>
|
|
97
97
|
<div class="component-showcase mb-3">
|
|
98
98
|
<button type="button" class="btn btn-primary btn-icon" aria-label="{{ 'buttons.download' | translate }}">
|
|
99
|
-
<i class="
|
|
99
|
+
<i class="bi bi-download"></i>
|
|
100
100
|
</button>
|
|
101
101
|
<button type="button" class="btn btn-neutral btn-icon" aria-label="{{ 'buttons.upload' | translate }}">
|
|
102
|
-
<i class="
|
|
102
|
+
<i class="bi bi-upload"></i>
|
|
103
103
|
</button>
|
|
104
104
|
<button type="button" class="btn btn-secondary btn-icon" aria-label="{{ 'buttons.edit' | translate }}">
|
|
105
|
-
<i class="
|
|
105
|
+
<i class="bi bi-pencil"></i>
|
|
106
106
|
</button>
|
|
107
107
|
<button type="button" class="btn btn-danger btn-icon" aria-label="{{ 'buttons.delete' | translate }}">
|
|
108
|
-
<i class="
|
|
108
|
+
<i class="bi bi-trash"></i>
|
|
109
109
|
</button>
|
|
110
110
|
</div>
|
|
111
111
|
<div class="component-showcase mb-3">
|
|
112
112
|
<button type="button" class="btn btn-outline-primary btn-icon" aria-label="{{ 'buttons.search' | translate }}">
|
|
113
|
-
<i class="
|
|
113
|
+
<i class="bi bi-search"></i>
|
|
114
114
|
</button>
|
|
115
115
|
<button type="button" class="btn btn-outline-secondary btn-icon" aria-label="{{ 'buttons.settings' | translate }}">
|
|
116
|
-
<i class="
|
|
116
|
+
<i class="bi bi-gear"></i>
|
|
117
117
|
</button>
|
|
118
118
|
<button type="button" class="btn btn-outline-neutral btn-icon" aria-label="{{ 'buttons.add' | translate }}">
|
|
119
|
-
<i class="
|
|
119
|
+
<i class="bi bi-plus-circle"></i>
|
|
120
120
|
</button>
|
|
121
121
|
</div>
|
|
122
122
|
<div class="component-showcase">
|
|
123
123
|
<button type="button" class="btn btn-primary btn-icon" aria-label="{{ 'buttons.search' | translate }}">
|
|
124
|
-
<i class="
|
|
124
|
+
<i class="bi bi-search"></i>
|
|
125
125
|
</button>
|
|
126
126
|
<button type="button" class="btn btn-neutral btn-icon btn-sm" aria-label="{{ 'buttons.settings' | translate }}">
|
|
127
|
-
<i class="
|
|
127
|
+
<i class="bi bi-gear"></i>
|
|
128
128
|
</button>
|
|
129
129
|
<button type="button" class="btn btn-secondary btn-icon btn-xs" aria-label="{{ 'buttons.add' | translate }}">
|
|
130
|
-
<i class="
|
|
130
|
+
<i class="bi bi-plus-circle"></i>
|
|
131
131
|
</button>
|
|
132
132
|
</div>
|
|
133
133
|
<app-code-example [htmlCode]="buttonIconOnlyCode"></app-code-example>
|
|
@@ -253,7 +253,7 @@
|
|
|
253
253
|
<div class="component-showcase">
|
|
254
254
|
<div class="dropdown">
|
|
255
255
|
<button class="btn btn-primary dropdown-toggle btn-lg" type="button" data-bs-toggle="dropdown" aria-expanded="false">
|
|
256
|
-
<i class="
|
|
256
|
+
<i class="bi bi-gear"></i>
|
|
257
257
|
</button>
|
|
258
258
|
<ul class="dropdown-menu">
|
|
259
259
|
<li><button class="dropdown-item" type="button">{{ 'buttons.dropdown_action' | translate }}</button></li>
|
|
@@ -264,7 +264,7 @@
|
|
|
264
264
|
|
|
265
265
|
<div class="dropdown">
|
|
266
266
|
<button class="btn btn-neutral dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
|
|
267
|
-
<i class="
|
|
267
|
+
<i class="bi bi-gear"></i>
|
|
268
268
|
</button>
|
|
269
269
|
<ul class="dropdown-menu">
|
|
270
270
|
<li><button class="dropdown-item" type="button">{{ 'buttons.dropdown_action' | translate }}</button></li>
|
|
@@ -275,7 +275,7 @@
|
|
|
275
275
|
|
|
276
276
|
<div class="dropdown">
|
|
277
277
|
<button class="btn btn-secondary dropdown-toggle btn-sm" type="button" data-bs-toggle="dropdown" aria-expanded="false">
|
|
278
|
-
<i class="
|
|
278
|
+
<i class="bi bi-gear"></i>
|
|
279
279
|
</button>
|
|
280
280
|
<ul class="dropdown-menu">
|
|
281
281
|
<li><button class="dropdown-item" type="button">{{ 'buttons.dropdown_action' | translate }}</button></li>
|
|
@@ -30,39 +30,39 @@ export class ButtonsComponent {
|
|
|
30
30
|
<button type="button" class="btn btn-primary" disabled>Disabled</button>`;
|
|
31
31
|
|
|
32
32
|
buttonIconLeftCode = `<button type="button" class="btn btn-primary btn-icon">
|
|
33
|
-
<i class="
|
|
33
|
+
<i class="bi bi-download"></i>Download
|
|
34
34
|
</button>
|
|
35
35
|
<button type="button" class="btn btn-neutral btn-icon">
|
|
36
|
-
<i class="
|
|
36
|
+
<i class="bi bi-upload"></i>Upload
|
|
37
37
|
</button>
|
|
38
38
|
<button type="button" class="btn btn-secondary btn-icon">
|
|
39
|
-
<i class="
|
|
39
|
+
<i class="bi bi-pencil"></i>Edit
|
|
40
40
|
</button>
|
|
41
41
|
<button type="button" class="btn btn-danger btn-icon">
|
|
42
|
-
<i class="
|
|
42
|
+
<i class="bi bi-trash"></i>Delete
|
|
43
43
|
</button>`;
|
|
44
44
|
|
|
45
45
|
buttonIconRightCode = `<button type="button" class="btn btn-primary btn-icon">
|
|
46
|
-
Save<i class="
|
|
46
|
+
Save<i class="bi bi-check"></i>
|
|
47
47
|
</button>
|
|
48
48
|
<button type="button" class="btn btn-neutral btn-icon">
|
|
49
|
-
Search<i class="
|
|
49
|
+
Search<i class="bi bi-search"></i>
|
|
50
50
|
</button>
|
|
51
51
|
<button type="button" class="btn btn-secondary btn-icon">
|
|
52
|
-
Settings<i class="
|
|
52
|
+
Settings<i class="bi bi-gear"></i>
|
|
53
53
|
</button>`;
|
|
54
54
|
|
|
55
55
|
buttonIconOnlyCode = `<button type="button" class="btn btn-primary btn-icon" aria-label="Download">
|
|
56
|
-
<i class="
|
|
56
|
+
<i class="bi bi-download"></i>
|
|
57
57
|
</button>
|
|
58
58
|
<button type="button" class="btn btn-neutral btn-icon" aria-label="Upload">
|
|
59
|
-
<i class="
|
|
59
|
+
<i class="bi bi-upload"></i>
|
|
60
60
|
</button>
|
|
61
61
|
<button type="button" class="btn btn-secondary btn-icon" aria-label="Edit">
|
|
62
|
-
<i class="
|
|
62
|
+
<i class="bi bi-pencil"></i>
|
|
63
63
|
</button>
|
|
64
64
|
<button type="button" class="btn btn-danger btn-icon" aria-label="Delete">
|
|
65
|
-
<i class="
|
|
65
|
+
<i class="bi bi-trash"></i>
|
|
66
66
|
</button>`;
|
|
67
67
|
|
|
68
68
|
dropdownButtonCode = `<div class="dropdown">
|
|
@@ -122,7 +122,7 @@ export class ButtonsComponent {
|
|
|
122
122
|
|
|
123
123
|
iconDropdownCode = `<div class="dropdown">
|
|
124
124
|
<button class="btn btn-primary dropdown-toggle btn-lg" type="button" data-bs-toggle="dropdown" aria-expanded="false">
|
|
125
|
-
<i class="
|
|
125
|
+
<i class="bi bi-gear"></i>
|
|
126
126
|
</button>
|
|
127
127
|
<ul class="dropdown-menu">
|
|
128
128
|
<li><button class="dropdown-item" type="button">Action</button></li>
|
|
@@ -133,7 +133,7 @@ export class ButtonsComponent {
|
|
|
133
133
|
|
|
134
134
|
<div class="dropdown">
|
|
135
135
|
<button class="btn btn-neutral dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
|
|
136
|
-
<i class="
|
|
136
|
+
<i class="bi bi-gear"></i>
|
|
137
137
|
</button>
|
|
138
138
|
<ul class="dropdown-menu">
|
|
139
139
|
<li><button class="dropdown-item" type="button">Action</button></li>
|
|
@@ -144,7 +144,7 @@ export class ButtonsComponent {
|
|
|
144
144
|
|
|
145
145
|
<div class="dropdown">
|
|
146
146
|
<button class="btn btn-secondary dropdown-toggle btn-sm" type="button" data-bs-toggle="dropdown" aria-expanded="false">
|
|
147
|
-
<i class="
|
|
147
|
+
<i class="bi bi-gear"></i>
|
|
148
148
|
</button>
|
|
149
149
|
<ul class="dropdown-menu">
|
|
150
150
|
<li><button class="dropdown-item" type="button">Action</button></li>
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
<div class="card" tabindex="0">
|
|
12
12
|
<div class="card-body">
|
|
13
13
|
<h5 class="card-title">
|
|
14
|
-
<i class="
|
|
14
|
+
<i class="bi bi-check-circle card-title-icon"></i>
|
|
15
15
|
</h5>
|
|
16
16
|
<h6 class="card-subtitle mb-2">{{ 'cards.card_title' | translate }}</h6>
|
|
17
17
|
<p class="card-text">{{ 'cards.card_text' | translate }}</p>
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
<div class="card disabled" tabindex="0">
|
|
50
50
|
<div class="card-body">
|
|
51
51
|
<h5 class="card-title">
|
|
52
|
-
<i class="
|
|
52
|
+
<i class="bi bi-check-circle card-title-icon"></i>
|
|
53
53
|
<input class="card-title-checked form-check-input ripple" disabled type="checkbox" value="" id="check1" aria-label="{{ 'cards.select_card' | translate }}">
|
|
54
54
|
</h5>
|
|
55
55
|
<h6 class="card-subtitle mb-2">{{ 'cards.card_title' | translate }}</h6>
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
<div class="card" tabindex="0" [class.expanded]="isExpanded(1)">
|
|
89
89
|
<div class="card-body">
|
|
90
90
|
<h5 class="card-title">
|
|
91
|
-
<i class="
|
|
91
|
+
<i class="bi bi-check-circle card-title-icon"></i>
|
|
92
92
|
<input class="card-title-checked form-check-input ripple" type="checkbox" value="" id="check3" aria-label="{{ 'cards.select_card' | translate }}">
|
|
93
93
|
</h5>
|
|
94
94
|
<h6 class="card-subtitle mb-2">{{ 'cards.expandable_title' | translate }}</h6>
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
<div class="card-footer">
|
|
109
|
-
<i class="
|
|
109
|
+
<i class="bi card-expanded-icon" [class.bi-chevron-up]="isExpanded(1)" [class.bi-chevron-down]="!isExpanded(1)" (click)="toggleCard(1)"></i>
|
|
110
110
|
</div>
|
|
111
111
|
</div>
|
|
112
112
|
</div>
|
|
@@ -122,7 +122,7 @@
|
|
|
122
122
|
<div class="card" tabindex="0" [class.expanded]="isExpanded(2)">
|
|
123
123
|
<div class="card-body">
|
|
124
124
|
<h5 class="card-title">
|
|
125
|
-
<i class="
|
|
125
|
+
<i class="bi bi-check-circle card-title-icon"></i>
|
|
126
126
|
</h5>
|
|
127
127
|
<h6 class="card-subtitle mb-2">{{ 'cards.expandable_title' | translate }}</h6>
|
|
128
128
|
<p class="card-text">{{ 'cards.expandable_text' | translate }}</p>
|
|
@@ -143,7 +143,7 @@
|
|
|
143
143
|
}
|
|
144
144
|
|
|
145
145
|
<div class="card-footer">
|
|
146
|
-
<i class="
|
|
146
|
+
<i class="bi card-expanded-icon" [class.bi-chevron-up]="isExpanded(2)" [class.bi-chevron-down]="!isExpanded(2)" (click)="toggleCard(2)"></i>
|
|
147
147
|
</div>
|
|
148
148
|
</div>
|
|
149
149
|
</div>
|
|
@@ -32,7 +32,7 @@ export class CardsComponent {
|
|
|
32
32
|
cardWithIconCode = `<div class="card" tabindex="0">
|
|
33
33
|
<div class="card-body">
|
|
34
34
|
<h5 class="card-title">
|
|
35
|
-
<i class="
|
|
35
|
+
<i class="bi bi-check-circle card-title-icon"></i>
|
|
36
36
|
</h5>
|
|
37
37
|
<h6 class="card-subtitle mb-2">Card Title</h6>
|
|
38
38
|
<p class="card-text">This is a sample card text that describes the content.</p>
|
|
@@ -64,7 +64,7 @@ export class CardsComponent {
|
|
|
64
64
|
disabledCardCode = `<div class="card disabled" tabindex="0">
|
|
65
65
|
<div class="card-body">
|
|
66
66
|
<h5 class="card-title">
|
|
67
|
-
<i class="
|
|
67
|
+
<i class="bi bi-check-circle card-title-icon"></i>
|
|
68
68
|
<input class="card-title-checked form-check-input ripple"
|
|
69
69
|
disabled
|
|
70
70
|
type="checkbox"
|
|
@@ -102,7 +102,7 @@ export class CardsComponent {
|
|
|
102
102
|
expandableCardHtmlCode = `<div class="card" tabindex="0" [class.expanded]="isExpanded(1)">
|
|
103
103
|
<div class="card-body">
|
|
104
104
|
<h5 class="card-title">
|
|
105
|
-
<i class="
|
|
105
|
+
<i class="bi bi-check-circle card-title-icon"></i>
|
|
106
106
|
<input class="card-title-checked form-check-input ripple"
|
|
107
107
|
type="checkbox"
|
|
108
108
|
value=""
|
|
@@ -124,9 +124,9 @@ export class CardsComponent {
|
|
|
124
124
|
}
|
|
125
125
|
|
|
126
126
|
<div class="card-footer">
|
|
127
|
-
<i class="
|
|
128
|
-
[class.
|
|
129
|
-
[class.
|
|
127
|
+
<i class="bi card-expanded-icon"
|
|
128
|
+
[class.bi-chevron-up]="isExpanded(1)"
|
|
129
|
+
[class.bi-chevron-down]="!isExpanded(1)"
|
|
130
130
|
(click)="toggleCard(1)"></i>
|
|
131
131
|
</div>
|
|
132
132
|
</div>
|
|
@@ -163,7 +163,7 @@ export class CardsComponent {
|
|
|
163
163
|
expandableCardSimpleHtmlCode = `<div class="card" tabindex="0" [class.expanded]="isExpanded(2)">
|
|
164
164
|
<div class="card-body">
|
|
165
165
|
<h5 class="card-title">
|
|
166
|
-
<i class="
|
|
166
|
+
<i class="bi bi-check-circle card-title-icon"></i>
|
|
167
167
|
</h5>
|
|
168
168
|
<h6 class="card-subtitle mb-2">Expandable Card Title</h6>
|
|
169
169
|
<p class="card-text">Click the arrow to see more details.</p>
|
|
@@ -184,9 +184,9 @@ export class CardsComponent {
|
|
|
184
184
|
}
|
|
185
185
|
|
|
186
186
|
<div class="card-footer">
|
|
187
|
-
<i class="
|
|
188
|
-
[class.
|
|
189
|
-
[class.
|
|
187
|
+
<i class="bi card-expanded-icon"
|
|
188
|
+
[class.bi-chevron-up]="isExpanded(2)"
|
|
189
|
+
[class.bi-chevron-down]="!isExpanded(2)"
|
|
190
190
|
(click)="toggleCard(2)"></i>
|
|
191
191
|
</div>
|
|
192
192
|
</div>
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
<!-- Context-Aware Theming Demo -->
|
|
2
|
+
<div class="container py-5">
|
|
3
|
+
<h1 class="mb-5">Context-Aware Theming System</h1>
|
|
4
|
+
<p class="lead mb-5">
|
|
5
|
+
Components automatically adapt their colors based on the background context.
|
|
6
|
+
Simply wrap content in context classes like <code>.on-primary</code>, <code>.on-dark</code>, etc.
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
<!-- Default Context (Light Background) -->
|
|
10
|
+
<section class="mb-5">
|
|
11
|
+
<h2>Default Context</h2>
|
|
12
|
+
<div class="p-4 border rounded">
|
|
13
|
+
<p class="mb-3">This is the default light background context.</p>
|
|
14
|
+
<div class="d-flex gap-2 mb-3">
|
|
15
|
+
<button class="btn btn-primary">Primary Button</button>
|
|
16
|
+
<button class="btn btn-secondary">Secondary Button</button>
|
|
17
|
+
<button class="btn btn-outline-primary">Outline Button</button>
|
|
18
|
+
</div>
|
|
19
|
+
<p class="mb-2">
|
|
20
|
+
<a href="#" class="me-3">Regular Link</a>
|
|
21
|
+
<a href="#" class="link-primary">Primary Link</a>
|
|
22
|
+
</p>
|
|
23
|
+
<input type="text" class="form-control" placeholder="Input field">
|
|
24
|
+
</div>
|
|
25
|
+
</section>
|
|
26
|
+
|
|
27
|
+
<!-- On Primary Context -->
|
|
28
|
+
<section class="mb-5">
|
|
29
|
+
<h2>On Primary Context</h2>
|
|
30
|
+
<div class="on-primary p-4 rounded context-section">
|
|
31
|
+
<h3>Content on Primary Background</h3>
|
|
32
|
+
<p class="mb-3">All components automatically adapt to white/light colors for better contrast.</p>
|
|
33
|
+
<div class="d-flex gap-2 mb-3">
|
|
34
|
+
<button class="btn btn-primary">Primary Button</button>
|
|
35
|
+
<button class="btn btn-secondary">Secondary Button</button>
|
|
36
|
+
<button class="btn btn-outline-primary">Outline Button</button>
|
|
37
|
+
</div>
|
|
38
|
+
<p class="mb-3">
|
|
39
|
+
<a href="#" class="me-3">Regular Link</a>
|
|
40
|
+
<span class="text-muted">Muted text adapts too</span>
|
|
41
|
+
</p>
|
|
42
|
+
<input type="text" class="form-control" placeholder="Input field adapts">
|
|
43
|
+
|
|
44
|
+
<div class="card mt-3 on-light">
|
|
45
|
+
<div class="card-body">
|
|
46
|
+
<h5 class="card-title">Card in Primary Context</h5>
|
|
47
|
+
<p class="card-text">Cards have subtle transparency to blend with the background.</p>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
</section>
|
|
52
|
+
|
|
53
|
+
<!-- On Dark Context -->
|
|
54
|
+
<section class="mb-5">
|
|
55
|
+
<h2>On Dark Context</h2>
|
|
56
|
+
<div class="on-dark p-4 rounded context-section">
|
|
57
|
+
<h3>Content on Dark Background</h3>
|
|
58
|
+
<p class="mb-3">Perfect for dark mode or dark sections. All components adapt automatically.</p>
|
|
59
|
+
<div class="d-flex gap-2 mb-3">
|
|
60
|
+
<button class="btn btn-primary">Primary Button</button>
|
|
61
|
+
<button class="btn btn-secondary">Secondary Button</button>
|
|
62
|
+
<button class="btn btn-outline-primary">Outline Button</button>
|
|
63
|
+
</div>
|
|
64
|
+
<p class="mb-3">
|
|
65
|
+
<a href="#" class="me-3">Regular Link</a>
|
|
66
|
+
<span class="text-muted">Muted text is readable</span>
|
|
67
|
+
</p>
|
|
68
|
+
<input type="text" class="form-control mb-3" placeholder="Form fields work great">
|
|
69
|
+
<select class="form-select">
|
|
70
|
+
<option>Select options adapt too</option>
|
|
71
|
+
<option>Option 2</option>
|
|
72
|
+
</select>
|
|
73
|
+
</div>
|
|
74
|
+
</section>
|
|
75
|
+
|
|
76
|
+
<!-- On Danger Context -->
|
|
77
|
+
<section class="mb-5">
|
|
78
|
+
<h2>On Danger Context</h2>
|
|
79
|
+
<div class="on-danger p-4 rounded context-section">
|
|
80
|
+
<h3>Critical Alerts or Warnings</h3>
|
|
81
|
+
<p class="mb-3">Use for error states, critical warnings, or important notices.</p>
|
|
82
|
+
<div class="d-flex gap-2 mb-3">
|
|
83
|
+
<button class="btn btn-primary">Primary Action</button>
|
|
84
|
+
<button class="btn btn-secondary">Secondary Action</button>
|
|
85
|
+
<button class="btn btn-outline-primary">Outline Action</button>
|
|
86
|
+
</div>
|
|
87
|
+
<div class="alert alert-warning mb-0">
|
|
88
|
+
<strong>Warning!</strong> Even alerts adapt to the context.
|
|
89
|
+
</div>
|
|
90
|
+
</div>
|
|
91
|
+
</section>
|
|
92
|
+
|
|
93
|
+
<!-- On Success Context -->
|
|
94
|
+
<section class="mb-5">
|
|
95
|
+
<h2>On Success Context</h2>
|
|
96
|
+
<div class="on-success p-4 rounded context-section">
|
|
97
|
+
<h3>Success Messages or Confirmation</h3>
|
|
98
|
+
<p class="mb-3">Perfect for success states, completed actions, or positive feedback.</p>
|
|
99
|
+
<div class="d-flex gap-2 mb-3">
|
|
100
|
+
<button class="btn btn-primary">Continue</button>
|
|
101
|
+
<button class="btn btn-outline-primary">View Details</button>
|
|
102
|
+
</div>
|
|
103
|
+
<p class="mb-0">
|
|
104
|
+
<a href="#">Learn more about this success</a>
|
|
105
|
+
</p>
|
|
106
|
+
</div>
|
|
107
|
+
</section>
|
|
108
|
+
|
|
109
|
+
<!-- On Warning Context -->
|
|
110
|
+
<section class="mb-5">
|
|
111
|
+
<h2>On Warning Context</h2>
|
|
112
|
+
<div class="on-warning p-4 rounded context-section">
|
|
113
|
+
<h3>Warning or Attention Needed</h3>
|
|
114
|
+
<p class="mb-3">Note: Uses dark text for better contrast on yellow/warning background.</p>
|
|
115
|
+
<div class="d-flex gap-2 mb-3">
|
|
116
|
+
<button class="btn btn-primary">Take Action</button>
|
|
117
|
+
<button class="btn btn-secondary">Dismiss</button>
|
|
118
|
+
</div>
|
|
119
|
+
<input type="text" class="form-control" placeholder="Dark text on warning background">
|
|
120
|
+
</div>
|
|
121
|
+
</section>
|
|
122
|
+
|
|
123
|
+
<!-- On Light Context -->
|
|
124
|
+
<section class="mb-5">
|
|
125
|
+
<h2>On Light Context</h2>
|
|
126
|
+
<div class="on-light p-4 rounded context-section">
|
|
127
|
+
<h3>Subtle Light Background</h3>
|
|
128
|
+
<p class="mb-3">Slightly different from default - useful for sections, sidebars, or panels.</p>
|
|
129
|
+
<div class="d-flex gap-2 mb-3">
|
|
130
|
+
<button class="btn btn-primary">Primary Button</button>
|
|
131
|
+
<button class="btn btn-secondary">Secondary Button</button>
|
|
132
|
+
<button class="btn btn-outline-primary">Outline Button</button>
|
|
133
|
+
</div>
|
|
134
|
+
<p class="mb-3">
|
|
135
|
+
<a href="#">Links maintain primary color</a>
|
|
136
|
+
<span class="text-muted ms-3">Muted text for less emphasis</span>
|
|
137
|
+
</p>
|
|
138
|
+
<div class="row g-2">
|
|
139
|
+
<div class="col">
|
|
140
|
+
<input type="text" class="form-control" placeholder="First name">
|
|
141
|
+
</div>
|
|
142
|
+
<div class="col">
|
|
143
|
+
<input type="text" class="form-control" placeholder="Last name">
|
|
144
|
+
</div>
|
|
145
|
+
</div>
|
|
146
|
+
</div>
|
|
147
|
+
</section>
|
|
148
|
+
|
|
149
|
+
<!-- Nested Contexts Example -->
|
|
150
|
+
<section class="mb-5">
|
|
151
|
+
<h2>Nested Contexts</h2>
|
|
152
|
+
<div class="on-primary p-4 rounded">
|
|
153
|
+
<h3>Primary Background</h3>
|
|
154
|
+
<p class="mb-3">You can nest different contexts for complex layouts.</p>
|
|
155
|
+
<button class="btn btn-primary me-2">Button on Primary</button>
|
|
156
|
+
|
|
157
|
+
<div class="on-light p-3 rounded mt-3">
|
|
158
|
+
<h4>Light Context Inside Primary</h4>
|
|
159
|
+
<p class="mb-2">This light section is nested inside the primary background.</p>
|
|
160
|
+
<button class="btn btn-primary">Button on Light</button>
|
|
161
|
+
</div>
|
|
162
|
+
</div>
|
|
163
|
+
</section>
|
|
164
|
+
|
|
165
|
+
<!-- Usage Guide -->
|
|
166
|
+
<section class="mt-5 p-4 bg-light rounded">
|
|
167
|
+
<h2>How to Use</h2>
|
|
168
|
+
<div class="row">
|
|
169
|
+
<div class="col-md-6">
|
|
170
|
+
<h4>Available Context Classes:</h4>
|
|
171
|
+
<ul>
|
|
172
|
+
<li><code>.on-primary</code> - White text on primary color</li>
|
|
173
|
+
<li><code>.on-dark</code> - White text on dark background</li>
|
|
174
|
+
<li><code>.on-danger</code> - White text on danger/error color</li>
|
|
175
|
+
<li><code>.on-success</code> - White text on success color</li>
|
|
176
|
+
<li><code>.on-warning</code> - Dark text on warning color</li>
|
|
177
|
+
<li><code>.on-light</code> - Dark text on light background</li>
|
|
178
|
+
</ul>
|
|
179
|
+
</div>
|
|
180
|
+
<div class="col-md-6">
|
|
181
|
+
<h4>What Adapts Automatically:</h4>
|
|
182
|
+
<ul>
|
|
183
|
+
<li>✅ Buttons (all variants)</li>
|
|
184
|
+
<li>✅ Links</li>
|
|
185
|
+
<li>✅ Form inputs and selects</li>
|
|
186
|
+
<li>✅ Text colors</li>
|
|
187
|
+
<li>✅ Border colors</li>
|
|
188
|
+
<li>✅ Cards and alerts</li>
|
|
189
|
+
<li>✅ Tables and badges</li>
|
|
190
|
+
</ul>
|
|
191
|
+
</div>
|
|
192
|
+
</div>
|
|
193
|
+
|
|
194
|
+
<div class="mt-4">
|
|
195
|
+
<h4>Example Code:</h4>
|
|
196
|
+
<pre class="bg-dark text-white p-3 rounded"><code><div class="on-primary p-4">
|
|
197
|
+
<h3>Content adapts automatically</h3>
|
|
198
|
+
<button class="btn btn-primary">Primary Button</button>
|
|
199
|
+
<a href="#">Link</a>
|
|
200
|
+
<input type="text" class="form-control" placeholder="Input">
|
|
201
|
+
</div></code></pre>
|
|
202
|
+
</div>
|
|
203
|
+
</section>
|
|
204
|
+
</div>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Component, ChangeDetectionStrategy } from '@angular/core';
|
|
2
|
+
import { TranslateModule } from '@ngx-translate/core';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'app-buttons',
|
|
6
|
+
imports: [TranslateModule],
|
|
7
|
+
templateUrl: './contexts.component.html',
|
|
8
|
+
changeDetection: ChangeDetectionStrategy.OnPush
|
|
9
|
+
})
|
|
10
|
+
export class ContextsComponent {}
|