otimus-library 0.5.6 → 0.5.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/fesm2022/otimus-library.mjs +184 -97
- package/fesm2022/otimus-library.mjs.map +1 -1
- package/index.d.ts +19 -5
- package/package.json +1 -1
- package/styles/components/inputs/inputs.scss +13 -0
- package/styles/components/inputs/inputs.shui.scss +23 -0
- package/styles/components/table/table.scss +9 -9
- package/styles/components/table/table.shui.scss +5 -5
- package/styles/patterns/shui/colors.shui.scss +9 -6
- package/styles/patterns/shui/variables.shui.scss +24 -16
- package/styles/styles.scss +7 -6
- package/styles/tokens.scss +332 -0
- package/styles/variables.scss +61 -44
package/index.d.ts
CHANGED
|
@@ -39,10 +39,11 @@ declare class OcToastService {
|
|
|
39
39
|
static ɵprov: i0.ɵɵInjectableDeclaration<OcToastService>;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
type OcStyleThemeType = 'otimus' | 'shui' | 'semantic';
|
|
42
|
+
type OcStyleThemeType = 'otimus' | 'otimus-dark' | 'asl' | 'asl-dark' | 'shui' | 'shui-dark' | 'semantic';
|
|
43
43
|
|
|
44
44
|
declare class StyleThemeService {
|
|
45
45
|
constructor();
|
|
46
|
+
private static readonly KNOWN_THEMES;
|
|
46
47
|
getStyleTheme(): OcStyleThemeType | undefined;
|
|
47
48
|
static ɵfac: i0.ɵɵFactoryDeclaration<StyleThemeService, never>;
|
|
48
49
|
static ɵprov: i0.ɵɵInjectableDeclaration<StyleThemeService>;
|
|
@@ -249,6 +250,7 @@ declare class OcAutocompleteComponent implements AfterViewInit, OnChanges, OnIni
|
|
|
249
250
|
private styleThemeService;
|
|
250
251
|
private cdr;
|
|
251
252
|
private overlay;
|
|
253
|
+
private readonly viewportRuler;
|
|
252
254
|
constructor(renderer: Renderer2, el: ElementRef, translateService: InternationalizationService, styleThemeService: StyleThemeService, cdr: ChangeDetectorRef, overlay: Overlay);
|
|
253
255
|
input: ElementRef;
|
|
254
256
|
options: ElementRef;
|
|
@@ -343,6 +345,17 @@ declare class OcAutocompleteComponent implements AfterViewInit, OnChanges, OnIni
|
|
|
343
345
|
private updateOverlayPosition;
|
|
344
346
|
private updateOverlayWidth;
|
|
345
347
|
updateOverlay(): void;
|
|
348
|
+
/**
|
|
349
|
+
* Keeps the open overlay coherent with its anchor input when the viewport
|
|
350
|
+
* changes (window resize / browser zoom / orientation change). While the
|
|
351
|
+
* input is still visible we re-anchor the overlay to it; once the input is
|
|
352
|
+
* pushed out of the viewport (e.g. host horizontal overflow) we close the
|
|
353
|
+
* overlay so it does not linger orphaned in a corner — the user can reopen it
|
|
354
|
+
* in a consistent position. (#12918)
|
|
355
|
+
*/
|
|
356
|
+
private handleViewportChange;
|
|
357
|
+
/** True when the anchor input is at least partially inside the viewport. */
|
|
358
|
+
private isInputWithinViewport;
|
|
346
359
|
private closeOverlay;
|
|
347
360
|
private updateDropdownPortal;
|
|
348
361
|
private setDropdownComponentInputs;
|
|
@@ -688,7 +701,7 @@ declare class OcDropdownDirective implements OnInit {
|
|
|
688
701
|
readonly ocDropdownMenu: i0.InputSignal<OcDropdownMenuContentComponent | undefined>;
|
|
689
702
|
readonly ocTrigger: i0.InputSignal<"click" | "hover">;
|
|
690
703
|
readonly ocDisabled: i0.InputSignal<boolean>;
|
|
691
|
-
readonly ocAlign: i0.InputSignal<"
|
|
704
|
+
readonly ocAlign: i0.InputSignal<"start" | "end">;
|
|
692
705
|
ngOnInit(): void;
|
|
693
706
|
protected onClick(event: MouseEvent): void;
|
|
694
707
|
protected onKeydown(event: KeyboardEvent): void;
|
|
@@ -926,6 +939,7 @@ declare class OcModalFooterComponent {
|
|
|
926
939
|
ocSide: 'left' | 'right';
|
|
927
940
|
ocBgColor?: string;
|
|
928
941
|
ocFixed: boolean;
|
|
942
|
+
protected get resolvedBgColor(): string | null;
|
|
929
943
|
static ɵfac: i0.ɵɵFactoryDeclaration<OcModalFooterComponent, never>;
|
|
930
944
|
static ɵcmp: i0.ɵɵComponentDeclaration<OcModalFooterComponent, "oc-modal-footer", never, { "ocSide": { "alias": "ocSide"; "required": false; }; "ocBgColor": { "alias": "ocBgColor"; "required": false; }; "ocFixed": { "alias": "ocFixed"; "required": false; }; }, {}, never, ["*"], true, never>;
|
|
931
945
|
}
|
|
@@ -938,7 +952,7 @@ declare class OcModalComponent implements AfterViewInit, OnDestroy {
|
|
|
938
952
|
private closeTimeout;
|
|
939
953
|
readonly ocClose: i0.InputSignal<boolean>;
|
|
940
954
|
ocTitle: string;
|
|
941
|
-
readonly ocSize: i0.InputSignal<"small" | "
|
|
955
|
+
readonly ocSize: i0.InputSignal<"small" | "large" | "medium" | "screen">;
|
|
942
956
|
readonly ocBgColor: i0.InputSignal<string | undefined>;
|
|
943
957
|
readonly ocWidth: i0.InputSignal<string>;
|
|
944
958
|
readonly ocMaxWidth: i0.InputSignal<string>;
|
|
@@ -969,7 +983,7 @@ declare class OcNotFoundComponent {
|
|
|
969
983
|
|
|
970
984
|
declare class OcOtpComponent implements AfterViewInit, OnDestroy {
|
|
971
985
|
private readonly cdr;
|
|
972
|
-
readonly ocLength: i0.InputSignal<
|
|
986
|
+
readonly ocLength: i0.InputSignal<6 | 8>;
|
|
973
987
|
readonly ocSeparator: i0.InputSignal<boolean>;
|
|
974
988
|
readonly ocError: i0.InputSignal<string | null | undefined>;
|
|
975
989
|
readonly ocDisabled: i0.InputSignal<boolean>;
|
|
@@ -985,7 +999,7 @@ declare class OcOtpComponent implements AfterViewInit, OnDestroy {
|
|
|
985
999
|
constructor(cdr: ChangeDetectorRef);
|
|
986
1000
|
ngAfterViewInit(): void;
|
|
987
1001
|
ngOnDestroy(): void;
|
|
988
|
-
protected readonly inputMode: i0.Signal<"
|
|
1002
|
+
protected readonly inputMode: i0.Signal<"text" | "numeric">;
|
|
989
1003
|
protected onInput(idx: number, event: Event): void;
|
|
990
1004
|
protected onKey(idx: number, event: KeyboardEvent): void;
|
|
991
1005
|
protected onPaste(event: ClipboardEvent): void;
|
package/package.json
CHANGED
|
@@ -93,6 +93,19 @@
|
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
+
// Browser autofill paints its own (often bluish) background — jarring on dark
|
|
97
|
+
// themes and under `color-scheme: dark`. Repaint it with the themed input
|
|
98
|
+
// surface/text via an inset box-shadow (the only way to override -webkit-autofill).
|
|
99
|
+
input:-webkit-autofill,
|
|
100
|
+
input:-webkit-autofill:hover,
|
|
101
|
+
input:-webkit-autofill:focus,
|
|
102
|
+
input:-webkit-autofill:active {
|
|
103
|
+
-webkit-box-shadow: 0 0 0 100px variables.$color-gray-6 inset;
|
|
104
|
+
-webkit-text-fill-color: variables.$color-gray-2;
|
|
105
|
+
caret-color: variables.$color-gray-2;
|
|
106
|
+
transition: background-color 9999s ease-in-out 0s;
|
|
107
|
+
}
|
|
108
|
+
|
|
96
109
|
input:not(:placeholder-shown) ~ label,
|
|
97
110
|
input:-webkit-autofill ~ label,
|
|
98
111
|
input:autofill ~ label,
|
|
@@ -87,6 +87,29 @@
|
|
|
87
87
|
min-width: 100%;
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
+
// Shui inputs are borderless and use the orange `::before` underline as the
|
|
91
|
+
// focus affordance. Without an explicit focus override the base input's
|
|
92
|
+
// `:focus { border: brand-g-1 }` (green + green glow) bleeds through at the
|
|
93
|
+
// edges/corners the underline doesn't cover. Suppress it here.
|
|
94
|
+
input:focus,
|
|
95
|
+
textarea:focus,
|
|
96
|
+
select:focus {
|
|
97
|
+
border: none;
|
|
98
|
+
box-shadow: none;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// Repaint browser autofill with the shui input surface/text (see inputs.scss).
|
|
102
|
+
// Under shui-dark this follows the dark base-2 (#161616) and light ui-1 text.
|
|
103
|
+
input:-webkit-autofill,
|
|
104
|
+
input:-webkit-autofill:hover,
|
|
105
|
+
input:-webkit-autofill:focus,
|
|
106
|
+
input:-webkit-autofill:active {
|
|
107
|
+
-webkit-box-shadow: 0 0 0 100px variables.$color-shui-base-2 inset;
|
|
108
|
+
-webkit-text-fill-color: variables.$color-shui-ui-1;
|
|
109
|
+
caret-color: variables.$color-shui-ui-1;
|
|
110
|
+
transition: background-color 9999s ease-in-out 0s;
|
|
111
|
+
}
|
|
112
|
+
|
|
90
113
|
textarea {
|
|
91
114
|
height: inherit;
|
|
92
115
|
padding-top: 20px;
|
|
@@ -13,14 +13,14 @@
|
|
|
13
13
|
font-size: 0.95rem;
|
|
14
14
|
font-family: inherit;
|
|
15
15
|
color: variables.$color-text-1;
|
|
16
|
-
background-color:
|
|
16
|
+
background-color: variables.$color-surface-1;
|
|
17
17
|
border-radius: 12px;
|
|
18
18
|
overflow: hidden;
|
|
19
|
-
box-shadow: 0 1px 3px
|
|
19
|
+
box-shadow: 0 1px 3px color-mix(in srgb, variables.$color-brand-dp-1 6%, transparent);
|
|
20
20
|
border: 1px solid variables.$color-gray-5;
|
|
21
21
|
|
|
22
22
|
tr {
|
|
23
|
-
background-color:
|
|
23
|
+
background-color: variables.$color-surface-1;
|
|
24
24
|
transition:
|
|
25
25
|
background-color 0.15s ease,
|
|
26
26
|
opacity 0.15s ease;
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
// ----------------------------------------------------------------------------
|
|
71
71
|
|
|
72
72
|
.oc.table tbody tr:hover {
|
|
73
|
-
background-color:
|
|
73
|
+
background-color: color-mix(in srgb, variables.$color-brand-p-1 4%, transparent);
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
// ----------------------------------------------------------------------------
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
|
|
80
80
|
// Striped (zebra)
|
|
81
81
|
.oc.table.striped tbody tr:nth-child(even) {
|
|
82
|
-
background-color:
|
|
82
|
+
background-color: color-mix(in srgb, variables.$color-gray-6 60%, transparent);
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
// Bordered — vertical dividers between columns
|
|
@@ -122,7 +122,7 @@
|
|
|
122
122
|
|
|
123
123
|
.oc.table tr.oc-table-row-detail {
|
|
124
124
|
display: none;
|
|
125
|
-
background-color:
|
|
125
|
+
background-color: color-mix(in srgb, variables.$color-brand-p-1 3%, transparent);
|
|
126
126
|
|
|
127
127
|
&.expanded {
|
|
128
128
|
display: table-row;
|
|
@@ -171,7 +171,7 @@
|
|
|
171
171
|
|
|
172
172
|
// Scrollbar styling appears only when the table actually scrolls.
|
|
173
173
|
scrollbar-width: thin;
|
|
174
|
-
scrollbar-color:
|
|
174
|
+
scrollbar-color: color-mix(in srgb, variables.$color-brand-p-1 25%, transparent) transparent;
|
|
175
175
|
|
|
176
176
|
&::-webkit-scrollbar {
|
|
177
177
|
height: 8px;
|
|
@@ -180,11 +180,11 @@
|
|
|
180
180
|
background: transparent;
|
|
181
181
|
}
|
|
182
182
|
&::-webkit-scrollbar-thumb {
|
|
183
|
-
background:
|
|
183
|
+
background: color-mix(in srgb, variables.$color-brand-p-1 20%, transparent);
|
|
184
184
|
border-radius: 4px;
|
|
185
185
|
}
|
|
186
186
|
&::-webkit-scrollbar-thumb:hover {
|
|
187
|
-
background:
|
|
187
|
+
background: color-mix(in srgb, variables.$color-brand-p-1 40%, transparent);
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
190
|
|
|
@@ -14,14 +14,14 @@
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
tr {
|
|
17
|
-
background-color:
|
|
17
|
+
background-color: variables.$color-surface-1;
|
|
18
18
|
transition: 0.1s ease;
|
|
19
19
|
border: none;
|
|
20
20
|
border-top: 0;
|
|
21
21
|
border-bottom: 0;
|
|
22
22
|
|
|
23
23
|
&:hover {
|
|
24
|
-
background-color:
|
|
24
|
+
background-color: color-mix(in srgb, variables.$color-gray-6 50%, transparent) !important;
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
|
|
@@ -33,18 +33,18 @@
|
|
|
33
33
|
|
|
34
34
|
th {
|
|
35
35
|
background-color: transparent;
|
|
36
|
-
border-bottom: 1px solid
|
|
36
|
+
border-bottom: 1px solid color-mix(in srgb, variables.$color-shui-ui-5 75%, transparent);
|
|
37
37
|
color: variables.$color-shui-ui-1;
|
|
38
38
|
font-weight: 600;
|
|
39
39
|
padding: 12px 15px;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
td {
|
|
43
|
-
border-bottom: 1px solid
|
|
43
|
+
border-bottom: 1px solid color-mix(in srgb, variables.$color-shui-ui-6 50%, transparent);
|
|
44
44
|
font-size: 0.9rem;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
&.striped tr:nth-child(even) {
|
|
48
|
-
background-color:
|
|
48
|
+
background-color: variables.$color-surface-1;
|
|
49
49
|
}
|
|
50
50
|
}
|
|
@@ -137,19 +137,22 @@
|
|
|
137
137
|
}
|
|
138
138
|
|
|
139
139
|
&.text, .oc.color.text {
|
|
140
|
+
// Typography colors derive from the UI text color (ui-1), per the Shui guide
|
|
141
|
+
// — NOT the teal accent (ui-0). Opacity provides the primary/secondary/
|
|
142
|
+
// disabled hierarchy on top of whichever base ui-1 the variant resolves to.
|
|
140
143
|
&.text-primary {
|
|
141
|
-
color: variables.$color-shui-ui-
|
|
144
|
+
color: variables.$color-shui-ui-1;
|
|
142
145
|
opacity: 90%;
|
|
143
146
|
}
|
|
144
|
-
|
|
147
|
+
|
|
145
148
|
&.text-secondary {
|
|
146
|
-
color: variables.$color-shui-ui-
|
|
149
|
+
color: variables.$color-shui-ui-1;
|
|
147
150
|
opacity: 60%;
|
|
148
151
|
}
|
|
149
|
-
|
|
152
|
+
|
|
150
153
|
&.text-disabled {
|
|
151
|
-
color: variables.$color-shui-ui-
|
|
152
|
-
opacity:
|
|
154
|
+
color: variables.$color-shui-ui-1;
|
|
155
|
+
opacity: 30%;
|
|
153
156
|
}
|
|
154
157
|
}
|
|
155
158
|
}
|
|
@@ -1,23 +1,31 @@
|
|
|
1
|
+
// Siemens (shui) palette — ACC-2362
|
|
2
|
+
// Runtime CSS custom properties live in `tokens.scss` under `.shui` (light) and
|
|
3
|
+
// `.shui-dark` (dark). These SCSS names are ALIASES so the existing shui-scoped
|
|
4
|
+
// component rules keep compiling and now switch light/dark by class.
|
|
5
|
+
// A light-value fallback is provided because these tokens are only *declared*
|
|
6
|
+
// inside a `.shui` ancestor; the fallback guards any accidental use outside it.
|
|
7
|
+
// Do NOT pass these into Sass color functions — they hold `var(...)`.
|
|
8
|
+
|
|
1
9
|
// Light base
|
|
2
|
-
$color-shui-base-0: #ffffff;
|
|
3
|
-
$color-shui-base-1: #ebebeb;
|
|
4
|
-
$color-shui-base-2: #f5f5f5;
|
|
10
|
+
$color-shui-base-0: var(--oc-color-shui-base-0, #ffffff);
|
|
11
|
+
$color-shui-base-1: var(--oc-color-shui-base-1, #ebebeb);
|
|
12
|
+
$color-shui-base-2: var(--oc-color-shui-base-2, #f5f5f5);
|
|
5
13
|
|
|
6
|
-
$color-shui-ui-0: #009999;
|
|
7
|
-
$color-shui-ui-1: #000000;
|
|
8
|
-
$color-shui-ui-2: #ec6602;
|
|
9
|
-
$color-shui-ui-3: #cf4b00;
|
|
10
|
-
$color-shui-ui-4: #d85808;
|
|
11
|
-
$color-shui-ui-5: #7d7d7d;
|
|
12
|
-
$color-shui-ui-6: #c8c8c8;
|
|
13
|
-
$color-shui-ui-7: #ffffff;
|
|
14
|
+
$color-shui-ui-0: var(--oc-color-shui-ui-0, #009999);
|
|
15
|
+
$color-shui-ui-1: var(--oc-color-shui-ui-1, #000000);
|
|
16
|
+
$color-shui-ui-2: var(--oc-color-shui-ui-2, #ec6602);
|
|
17
|
+
$color-shui-ui-3: var(--oc-color-shui-ui-3, #cf4b00);
|
|
18
|
+
$color-shui-ui-4: var(--oc-color-shui-ui-4, #d85808);
|
|
19
|
+
$color-shui-ui-5: var(--oc-color-shui-ui-5, #7d7d7d);
|
|
20
|
+
$color-shui-ui-6: var(--oc-color-shui-ui-6, #c8c8c8);
|
|
21
|
+
$color-shui-ui-7: var(--oc-color-shui-ui-7, #ffffff);
|
|
14
22
|
|
|
15
|
-
$color-shui-ui-8: #0169b2;
|
|
23
|
+
$color-shui-ui-8: var(--oc-color-shui-ui-8, #0169b2);
|
|
16
24
|
|
|
17
25
|
// Functional color
|
|
18
|
-
$color-shui-functional-green: #009a38;
|
|
19
|
-
$color-shui-functional-yellow: #ffd200;
|
|
20
|
-
$color-shui-functional-red: #e7001d;
|
|
26
|
+
$color-shui-functional-green: var(--oc-color-shui-functional-green, #009a38);
|
|
27
|
+
$color-shui-functional-yellow: var(--oc-color-shui-functional-yellow, #ffd200);
|
|
28
|
+
$color-shui-functional-red: var(--oc-color-shui-functional-red, #e7001d);
|
|
21
29
|
|
|
22
30
|
// BW Colors
|
|
23
|
-
$color-shui-black: #000000;
|
|
31
|
+
$color-shui-black: var(--oc-color-shui-black, #000000);
|
package/styles/styles.scss
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
@use './tokens.scss';
|
|
1
2
|
@use './components/index.scss' as components;
|
|
2
3
|
@use './grid.scss';
|
|
3
4
|
@use './colors.scss';
|
|
@@ -21,26 +22,26 @@
|
|
|
21
22
|
height: 0px;
|
|
22
23
|
}
|
|
23
24
|
::-webkit-scrollbar-thumb {
|
|
24
|
-
background:
|
|
25
|
+
background: var(--oc-color-brand-p-1);
|
|
25
26
|
border: 0px none #ffffff;
|
|
26
27
|
border-radius: 52px;
|
|
27
28
|
}
|
|
28
29
|
::-webkit-scrollbar-thumb:hover {
|
|
29
|
-
background:
|
|
30
|
+
background: var(--oc-color-brand-p-1);
|
|
30
31
|
}
|
|
31
32
|
::-webkit-scrollbar-thumb:active {
|
|
32
|
-
background:
|
|
33
|
+
background: var(--oc-color-brand-p-1);
|
|
33
34
|
}
|
|
34
35
|
::-webkit-scrollbar-track {
|
|
35
|
-
background:
|
|
36
|
+
background: var(--oc-color-surface-2);
|
|
36
37
|
border: 0px none #ffffff;
|
|
37
38
|
border-radius: 50px;
|
|
38
39
|
}
|
|
39
40
|
::-webkit-scrollbar-track:hover {
|
|
40
|
-
background:
|
|
41
|
+
background: var(--oc-color-border-1);
|
|
41
42
|
}
|
|
42
43
|
::-webkit-scrollbar-track:active {
|
|
43
|
-
background:
|
|
44
|
+
background: var(--oc-color-border-1);
|
|
44
45
|
}
|
|
45
46
|
::-webkit-scrollbar-corner {
|
|
46
47
|
background: transparent;
|