@xiriframework/xiri-ng 0.2.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/package.json ADDED
@@ -0,0 +1,52 @@
1
+ {
2
+ "name": "@xiriframework/xiri-ng",
3
+ "version": "0.2.0",
4
+ "description": "Angular UI component library for the Xiri Framework",
5
+ "license": "Apache-2.0",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/xiriframework/xiri-ng.git"
9
+ },
10
+ "homepage": "https://github.com/xiriframework/xiri-ng",
11
+ "author": "Michael Friedl",
12
+ "keywords": [
13
+ "angular",
14
+ "ui",
15
+ "components",
16
+ "material",
17
+ "xiri"
18
+ ],
19
+ "dependencies": {
20
+ "tslib": "^2.5.0"
21
+ },
22
+ "peerDependencies": {
23
+ "@angular/animations": "^21",
24
+ "@angular/compiler": "^21",
25
+ "@angular/platform-browser": "^21",
26
+ "@angular/platform-browser-dynamic": "^21",
27
+ "@angular/router": "^21",
28
+ "@angular/common": "^21",
29
+ "@angular/core": "^21",
30
+ "@angular/material": "^21",
31
+ "@angular/cdk": "^21",
32
+ "@angular/forms": "^21",
33
+ "@angular/material-date-fns-adapter": "^21",
34
+ "date-fns": "^4.1",
35
+ "@date-fns/tz": "^1.4",
36
+ "material-symbols": ">=0.40",
37
+ "ngx-mat-select-search": "^8.0.4",
38
+ "rxjs": "^7.8.1"
39
+ },
40
+ "sideEffects": false,
41
+ "module": "fesm2022/xiriframework-xiri-ng.mjs",
42
+ "typings": "types/xiriframework-xiri-ng.d.ts",
43
+ "exports": {
44
+ "./package.json": {
45
+ "default": "./package.json"
46
+ },
47
+ ".": {
48
+ "types": "./types/xiriframework-xiri-ng.d.ts",
49
+ "default": "./fesm2022/xiriframework-xiri-ng.mjs"
50
+ }
51
+ }
52
+ }
@@ -0,0 +1,50 @@
1
+ // ============================================
2
+ // Global Accessibility Styles
3
+ // ============================================
4
+
5
+ // Focus-visible indicator for keyboard navigation
6
+ // Uses :focus-visible to only show on keyboard focus, not mouse clicks
7
+ *:focus-visible {
8
+ outline: 2px solid var(--primary, #2892D9);
9
+ outline-offset: 2px;
10
+ }
11
+
12
+ // Material buttons already have their own focus indicator via ripple,
13
+ // but we add a visible outline for keyboard-only navigation
14
+ .mat-mdc-button:focus-visible,
15
+ .mat-mdc-raised-button:focus-visible,
16
+ .mat-mdc-unelevated-button:focus-visible,
17
+ .mat-mdc-outlined-button:focus-visible,
18
+ .mat-mdc-icon-button:focus-visible,
19
+ .mat-mdc-fab:focus-visible,
20
+ .mat-mdc-mini-fab:focus-visible {
21
+ outline: 2px solid var(--primary, #2892D9);
22
+ outline-offset: 2px;
23
+ }
24
+
25
+ // Material list items
26
+ .mat-mdc-list-item:focus-visible {
27
+ outline: 2px solid var(--primary, #2892D9);
28
+ outline-offset: -2px;
29
+ }
30
+
31
+ // Material form fields
32
+ .mat-mdc-form-field:focus-within {
33
+ // Material handles this internally, no override needed
34
+ }
35
+
36
+ // Skip link for keyboard users
37
+ .xiri-skip-link {
38
+ position: absolute;
39
+ top: -40px;
40
+ left: 0;
41
+ background: var(--primary, #2892D9);
42
+ color: var(--on-primary, #FFFFFF);
43
+ padding: 8px 16px;
44
+ z-index: 10000;
45
+ transition: top 0.2s;
46
+
47
+ &:focus {
48
+ top: 0;
49
+ }
50
+ }
@@ -0,0 +1,68 @@
1
+ // ============================================
2
+ // Micro-Animations System
3
+ // ============================================
4
+
5
+ @keyframes fadeIn {
6
+ from { opacity: 0; }
7
+ to { opacity: 1; }
8
+ }
9
+
10
+ @keyframes fadeInUp {
11
+ from {
12
+ opacity: 0;
13
+ transform: translateY(8px);
14
+ }
15
+ to {
16
+ opacity: 1;
17
+ transform: translateY(0);
18
+ }
19
+ }
20
+
21
+ @keyframes shimmer {
22
+ 0% { background-position: -200px 0; }
23
+ 100% { background-position: calc(200px + 100%) 0; }
24
+ }
25
+
26
+ @keyframes scaleIn {
27
+ from {
28
+ opacity: 0;
29
+ transform: scale(0.95);
30
+ }
31
+ to {
32
+ opacity: 1;
33
+ transform: scale(1);
34
+ }
35
+ }
36
+
37
+ @keyframes spin {
38
+ from { transform: rotate(0deg); }
39
+ to { transform: rotate(360deg); }
40
+ }
41
+
42
+ // ============================================
43
+ // Animation Utility Classes
44
+ // ============================================
45
+
46
+ .xiri-fade-in {
47
+ animation: fadeIn 0.2s ease-out;
48
+ }
49
+
50
+ .xiri-fade-in-up {
51
+ animation: fadeInUp 0.25s ease-out;
52
+ }
53
+
54
+ .xiri-scale-in {
55
+ animation: scaleIn 0.2s ease-out;
56
+ }
57
+
58
+ // ============================================
59
+ // Respect reduced motion preferences
60
+ // ============================================
61
+
62
+ @media (prefers-reduced-motion: reduce) {
63
+ *, *::before, *::after {
64
+ animation-duration: 0.01ms !important;
65
+ animation-iteration-count: 1 !important;
66
+ transition-duration: 0.01ms !important;
67
+ }
68
+ }
@@ -0,0 +1,54 @@
1
+ // Gray scale (Bootstrap-compatible)
2
+ $color-gray-100: #F8F9FA;
3
+ $color-gray-200: #E9ECEF;
4
+ $color-gray-300: #DEE2E6;
5
+ $color-gray-400: #CED4DA;
6
+ $color-gray-500: #ADB5BD;
7
+ $color-gray-600: #6C757D;
8
+ $color-gray-700: #495057;
9
+ $color-gray-800: #343A40;
10
+ $color-gray-900: #212529;
11
+
12
+ // Semantic colors
13
+ $color-danger: #E74C3C;
14
+ $color-success: #2ECC71;
15
+ $color-info: #17A2B8;
16
+
17
+ // Extended color palette (for icons and buttons)
18
+ $color-emerald: #2892D9;
19
+ $color-red: #E74C3C;
20
+ $color-yellow: #F1C40F;
21
+ $color-green: #2ECC71;
22
+ $color-blue: #3498DB;
23
+ $color-purple: #9B59B6;
24
+ $color-gray: #95A5A6;
25
+ $color-lightgray: #BDC3C7;
26
+ $color-darkgray: #7F8C8D;
27
+ $color-orange: #E67E22;
28
+
29
+ // Color variants map: (name: (bg-color, text-color))
30
+ $color-variants: (
31
+ 'emerald': ($color-emerald, white),
32
+ 'red': ($color-red, white),
33
+ 'yellow': ($color-yellow, black),
34
+ 'green': ($color-green, white),
35
+ 'blue': ($color-blue, white),
36
+ 'purple': ($color-purple, white),
37
+ 'gray': ($color-gray, white),
38
+ 'lightgray': ($color-lightgray, black),
39
+ 'darkgray': ($color-darkgray, white),
40
+ 'orange': ($color-orange, white),
41
+ 'white': (white, black),
42
+ 'black': (black, white),
43
+ );
44
+
45
+ // Theme color variants (use CSS variables for theme switching)
46
+ $theme-color-variants: (
47
+ 'primary': (var(--primary), var(--on-primary)),
48
+ 'secondary': (var(--secondary), var(--on-secondary, white)),
49
+ 'tertiary': (var(--tertiary), var(--on-tertiary, white)),
50
+ 'accent': (var(--secondary), var(--on-secondary, white)),
51
+ 'warn': (var(--error), var(--on-error)),
52
+ 'error': (var(--error), var(--on-error)),
53
+ 'success': (var(--color-success), var(--on-success, white)),
54
+ );
@@ -0,0 +1,97 @@
1
+ @use "sass:map";
2
+ @use "sass:math";
3
+
4
+ @mixin grid( $breakpoints: ( xs: 0, sm: 576px,
5
+ md: 768px, lg: 992px,
6
+ xl: 1200px, xxl: 1400px ) ) {
7
+
8
+ .xcontainer, .xcontainer-fluid {
9
+ width: 100%;
10
+ }
11
+
12
+ .xrow {
13
+ display: grid;
14
+ grid-template-columns: repeat(12, 1fr);
15
+ grid-column-gap: var(--xiri-grid-column-gap, 24px);
16
+ grid-row-gap: var(--xiri-grid-row-gap, 20px);
17
+ width: 100%;
18
+
19
+ &.xsmall {
20
+ grid-row-gap: 4px;
21
+ }
22
+ }
23
+
24
+ .xcol {
25
+ grid-column-end: span 12;
26
+ max-width: 100%;
27
+ }
28
+
29
+ .xcol-start {
30
+ grid-column-start: 1;
31
+ }
32
+
33
+ @each $abbr, $size in $breakpoints {
34
+ @for $i from 1 through 12 {
35
+ .xcol-#{$abbr}-#{$i} {
36
+ grid-column-end: span 12;
37
+ max-width: 100%;
38
+ }
39
+ }
40
+ }
41
+
42
+ @for $i from 1 through 12 {
43
+ .xcol-#{$i} {
44
+ grid-column-end: span $i;
45
+ }
46
+ }
47
+
48
+ @each $abbr, $size in $breakpoints {
49
+ @media (min-width: $size) {
50
+ // Loop through col classes
51
+ @for $i from 1 through 12 {
52
+ .xcol-#{$abbr}-#{$i} {
53
+ grid-column-end: span $i;
54
+ }
55
+ .xcol-middle-#{$abbr}-#{$i} {
56
+ grid-column-start: math.ceil(calc((12 - $i )/2)) + 1;
57
+ grid-column-end: math.ceil(calc((12 - $i )/2)) + $i + 1;
58
+ }
59
+ .xcol-right-#{$abbr}-#{$i} {
60
+ grid-column-start: calc(12 - $i + 1);
61
+ grid-column-end: 13;
62
+ }
63
+ }
64
+
65
+ .x-#{$abbr}-none {
66
+ display: none !important;
67
+ }
68
+ }
69
+ }
70
+
71
+ .x-none, .x-xs-none {
72
+ display: none !important;
73
+ }
74
+
75
+ @each $abbr, $size in $breakpoints {
76
+ @media (max-width: $size) {
77
+ .x-#{$abbr}-none-up {
78
+ display: none !important;
79
+ }
80
+ }
81
+ }
82
+
83
+ .x-valign-center {
84
+ align-content: center;
85
+ }
86
+ .x-valign-bottom {
87
+ align-content: end;
88
+ }
89
+
90
+ .x-align-center {
91
+ justify-self: center;
92
+ }
93
+ .x-align-right {
94
+ justify-self: end;
95
+ }
96
+
97
+ }
@@ -0,0 +1,211 @@
1
+ @use 'sass:list';
2
+ @use 'sass:map';
3
+ @use 'colors' as *;
4
+
5
+ // ============================================
6
+ // Color Variant Mixins
7
+ // ============================================
8
+
9
+ // Button color variant - generates all button types for a color
10
+ @mixin button-color-variant($name, $bg-color, $text-color) {
11
+ .mat-mdc-raised-button.mat-#{$name},
12
+ .mat-mdc-unelevated-button.mat-#{$name},
13
+ .mat-mdc-fab.mat-#{$name},
14
+ .mat-mdc-mini-fab.mat-#{$name} {
15
+ --mat-button-filled-container-color: #{$bg-color};
16
+ --mat-button-filled-label-text-color: #{$text-color};
17
+ --mat-button-protected-container-color: #{$bg-color};
18
+ --mat-button-protected-label-text-color: #{$text-color};
19
+ --mat-fab-container-color: #{$bg-color};
20
+ --mat-fab-foreground-color: #{$text-color};
21
+ --mat-fab-state-layer-color: #{$text-color};
22
+ --mat-fab-small-container-color: #{$bg-color};
23
+ --mat-fab-small-foreground-color: #{$text-color};
24
+ --mat-fab-small-state-layer-color: #{$text-color};
25
+ }
26
+
27
+ .mat-mdc-outlined-button.mat-#{$name} {
28
+ --mat-button-outlined-label-text-color: #{$bg-color};
29
+ --mat-button-outlined-outline-color: #{$bg-color};
30
+ }
31
+
32
+ .mat-mdc-icon-button.mat-#{$name} {
33
+ --mat-icon-button-state-layer-color: #{$bg-color};
34
+ --mat-icon-button-icon-color: #{$bg-color};
35
+ color: #{$bg-color};
36
+ --mat-icon-button-background-color: var(--xiri-icon-button-background-color, #{$color-gray-100});
37
+ background-color: var(--xiri-icon-button-background-color, #{$color-gray-100});
38
+ border-radius: 50%;
39
+ box-shadow: var(--mat-app-elevation-shadow-level-2);
40
+ }
41
+ }
42
+
43
+ // Icon color variant - generates mat-icon class for a color
44
+ @mixin icon-color-variant($name, $color) {
45
+ mat-icon.#{$name} {
46
+ color: #{$color};
47
+ }
48
+ }
49
+
50
+ // Badge color variant - generates mat-badge class for a color
51
+ @mixin badge-color-variant($name, $bg-color, $text-color) {
52
+ .mat-badge-#{$name} {
53
+ --mat-badge-background-color: #{$bg-color};
54
+ --mat-badge-text-color: #{$text-color};
55
+ }
56
+ }
57
+
58
+ // Progress bar color variant - M3 compatible (replaces [color] input)
59
+ @mixin progress-color-variant($name, $color) {
60
+ mat-progress-bar.#{$name} {
61
+ --mat-progress-bar-active-indicator-color: #{$color};
62
+ }
63
+ }
64
+
65
+ // Chip color variant - form chips and display chips
66
+ @mixin chip-color-variant($name, $bg-color, $text-color) {
67
+ mat-chip-row.chip-#{$name} {
68
+ --mdc-chip-elevated-container-color: #{$bg-color};
69
+ --mdc-chip-label-text-color: #{$text-color};
70
+ --mdc-chip-with-icon-icon-color: #{$text-color};
71
+ --mdc-chip-with-trailing-icon-trailing-icon-color: #{$text-color};
72
+ --mat-chip-trailing-action-state-layer-color: #{$text-color};
73
+ }
74
+
75
+ .xiri-chip-display.#{$name} {
76
+ background-color: #{$bg-color};
77
+ color: #{$text-color};
78
+ }
79
+ }
80
+
81
+ // Infopoint icon color variant
82
+ @mixin infopoint-color-variant($name, $bg-color, $text-color) {
83
+ xiri-infopoint .icon.#{$name} {
84
+ background-color: #{$bg-color};
85
+
86
+ mat-icon {
87
+ color: white;
88
+ }
89
+ }
90
+ }
91
+
92
+ // ============================================
93
+ // Special Icon Classes (basic colors only)
94
+ // ============================================
95
+ mat-icon {
96
+ &.white {
97
+ --mat-icon-color: white;
98
+ }
99
+
100
+ &.black {
101
+ --mat-icon-color: black;
102
+ }
103
+
104
+ &.inherit {
105
+ --mat-icon-color: inherit;
106
+ }
107
+ }
108
+
109
+ // ============================================
110
+ // M3 Icon Button Size Variants
111
+ // Default M3 icon button is 40px at density -1
112
+ // ============================================
113
+ .mat-small-icon-button {
114
+ --mat-icon-button-state-layer-size: 28px;
115
+ --mat-icon-button-touch-target-size: 28px;
116
+ --mat-icon-button-icon-size: 18px;
117
+
118
+ .mat-icon {
119
+ font-size: 18px;
120
+ width: 18px;
121
+ height: 18px;
122
+ line-height: 1;
123
+ }
124
+ }
125
+
126
+ .mat-medium-icon-button {
127
+ --mat-icon-button-state-layer-size: 36px;
128
+ --mat-icon-button-touch-target-size: 36px;
129
+ --mat-icon-button-icon-size: 22px;
130
+
131
+ .mat-icon {
132
+ font-size: 22px;
133
+ width: 22px;
134
+ height: 22px;
135
+ line-height: 1;
136
+ }
137
+ }
138
+
139
+ // ============================================
140
+ // Generate ALL Color Variants
141
+ // Merge theme colors + extended colors into single loop
142
+ // ============================================
143
+ $all-color-variants: map.merge($theme-color-variants, $color-variants);
144
+
145
+ @each $name, $colors in $all-color-variants {
146
+ $bg-color: list.nth($colors, 1);
147
+ $text-color: list.nth($colors, 2);
148
+
149
+ @include button-color-variant($name, $bg-color, $text-color);
150
+ @include icon-color-variant($name, $bg-color);
151
+ @include badge-color-variant($name, $bg-color, $text-color);
152
+ @include progress-color-variant($name, $bg-color);
153
+ @include infopoint-color-variant($name, $bg-color, $text-color);
154
+ @include chip-color-variant($name, $bg-color, $text-color);
155
+
156
+ .#{$name} {
157
+ color: #{$bg-color};
158
+ }
159
+ }
160
+
161
+ // ============================================
162
+ // Chip Display (in tables / card lists)
163
+ // ============================================
164
+ .xiri-chips-display {
165
+ display: flex;
166
+ flex-wrap: wrap;
167
+ gap: 4px;
168
+ padding: 2px 0;
169
+ }
170
+
171
+ td.right .xiri-chips-display,
172
+ td.align-right .xiri-chips-display {
173
+ justify-content: flex-end;
174
+ }
175
+
176
+ .xiri-chip-display {
177
+ display: inline-block;
178
+ padding: 2px 8px;
179
+ border-radius: 12px;
180
+ font-size: 12px;
181
+ line-height: 1.6;
182
+ background-color: var(--surface-variant, #DEE3EB);
183
+ color: var(--on-surface-variant, #42474E);
184
+ }
185
+
186
+ // ============================================
187
+ // Snackbar Color Variants
188
+ // ============================================
189
+ .xiri-snackbar-success {
190
+ --mdc-snackbar-container-color: #{$color-success};
191
+ --mdc-snackbar-supporting-text-color: white;
192
+ --mat-snack-bar-button-color: white;
193
+ }
194
+
195
+ .xiri-snackbar-error {
196
+ --mdc-snackbar-container-color: #{$color-red};
197
+ --mdc-snackbar-supporting-text-color: white;
198
+ --mat-snack-bar-button-color: white;
199
+ }
200
+
201
+ .xiri-snackbar-info {
202
+ --mdc-snackbar-container-color: #{$color-info};
203
+ --mdc-snackbar-supporting-text-color: white;
204
+ --mat-snack-bar-button-color: white;
205
+ }
206
+
207
+ .xiri-snackbar-warning {
208
+ --mdc-snackbar-container-color: #{$color-orange};
209
+ --mdc-snackbar-supporting-text-color: white;
210
+ --mat-snack-bar-button-color: white;
211
+ }