@scion/components 22.1.0 → 22.3.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/_index.scss +75 -5
- package/common/package.json +4 -0
- package/design/_theming.scss +25 -10
- package/design/components/_scion-component-dark-tokens.scss +153 -0
- package/design/components/_scion-component-light-tokens.scss +153 -0
- package/design/icons/_scion-icon-font.scss +50 -0
- package/design/themes/_scion-dark-theme.scss +2 -7
- package/design/themes/_scion-light-theme.scss +3 -8
- package/fesm2022/scion-components-common.mjs +251 -0
- package/fesm2022/scion-components-common.mjs.map +1 -0
- package/fesm2022/scion-components-dimension.mjs +7 -6
- package/fesm2022/scion-components-dimension.mjs.map +1 -1
- package/fesm2022/scion-components-icon.mjs +380 -0
- package/fesm2022/scion-components-icon.mjs.map +1 -0
- package/fesm2022/scion-components-menu.mjs +3271 -0
- package/fesm2022/scion-components-menu.mjs.map +1 -0
- package/fesm2022/scion-components-sashbox.mjs +21 -21
- package/fesm2022/scion-components-sashbox.mjs.map +1 -1
- package/fesm2022/scion-components-splitter.mjs +16 -13
- package/fesm2022/scion-components-splitter.mjs.map +1 -1
- package/fesm2022/scion-components-table.mjs +2265 -0
- package/fesm2022/scion-components-table.mjs.map +1 -0
- package/fesm2022/scion-components-text.mjs +322 -0
- package/fesm2022/scion-components-text.mjs.map +1 -0
- package/fesm2022/scion-components-throbber.mjs +15 -15
- package/fesm2022/scion-components-throbber.mjs.map +1 -1
- package/fesm2022/scion-components-viewport.mjs +142 -125
- package/fesm2022/scion-components-viewport.mjs.map +1 -1
- package/icon/package.json +4 -0
- package/menu/package.json +4 -0
- package/package.json +22 -2
- package/table/package.json +4 -0
- package/text/package.json +4 -0
- package/types/scion-components-common.d.ts +185 -0
- package/types/scion-components-icon.d.ts +146 -0
- package/types/scion-components-menu.d.ts +1922 -0
- package/types/scion-components-sashbox.d.ts +4 -2
- package/types/scion-components-splitter.d.ts +4 -3
- package/types/scion-components-table.d.ts +577 -0
- package/types/scion-components-text.d.ts +131 -0
- package/types/scion-components-viewport.d.ts +32 -39
- package/viewport/scrollbar/_scrollbar.scss +4 -4
- package/design/components/_scion-component-tokens.scss +0 -48
package/_index.scss
CHANGED
|
@@ -60,7 +60,13 @@
|
|
|
60
60
|
* ```
|
|
61
61
|
*
|
|
62
62
|
* ## SCION Design Tokens
|
|
63
|
-
* SCION
|
|
63
|
+
* SCION uses the following design tokens:
|
|
64
|
+
*
|
|
65
|
+
* ### Component Design Tokens
|
|
66
|
+
* Tokens specific to SCION Components.
|
|
67
|
+
*
|
|
68
|
+
* [Component Design Tokens (light theme)](https://raw.githubusercontent.com/SchweizerischeBundesbahnen/scion-toolkit/master/projects/scion/components/design/components/_scion-component-light-tokens.scss)
|
|
69
|
+
* [Component Design Tokens (dark theme)](https://raw.githubusercontent.com/SchweizerischeBundesbahnen/scion-toolkit/master/projects/scion/components/design/components/_scion-component-dark-tokens.scss)
|
|
64
70
|
*
|
|
65
71
|
* ### Static Color Tokens
|
|
66
72
|
* Colors that have a fixed color value across all themes.
|
|
@@ -68,7 +74,7 @@
|
|
|
68
74
|
* [Static Color Tokens](https://raw.githubusercontent.com/SchweizerischeBundesbahnen/scion-toolkit/master/projects/scion/components/design/colors/_scion-static-colors.scss)
|
|
69
75
|
*
|
|
70
76
|
* ### Named Color Tokens
|
|
71
|
-
* Predefined set of named colors as palette of tints and shades.
|
|
77
|
+
* Predefined set of named colors as a palette of tints and shades.
|
|
72
78
|
*
|
|
73
79
|
* [Named Color Tokens (light theme)](https://raw.githubusercontent.com/SchweizerischeBundesbahnen/scion-toolkit/master/projects/scion/components/design/colors/_scion-light-colors.scss)
|
|
74
80
|
* [Named Color Tokens (dark theme)](https://raw.githubusercontent.com/SchweizerischeBundesbahnen/scion-toolkit/master/projects/scion/components/design/colors/_scion-dark-colors.scss)
|
|
@@ -79,17 +85,77 @@
|
|
|
79
85
|
* [Semantic Tokens (light theme)](https://raw.githubusercontent.com/SchweizerischeBundesbahnen/scion-toolkit/master/projects/scion/components/design/themes/_scion-light-theme.scss)
|
|
80
86
|
* [Semantic Tokens (dark theme)](https://raw.githubusercontent.com/SchweizerischeBundesbahnen/scion-toolkit/master/projects/scion/components/design/themes/_scion-dark-theme.scss)
|
|
81
87
|
*
|
|
82
|
-
* ### Component-specific Tokens
|
|
83
|
-
* Tokens for a particular component.
|
|
84
88
|
*
|
|
85
|
-
*
|
|
89
|
+
* ## SCION Icon Font
|
|
90
|
+
* This module provides the standard icon font used by SCION components.
|
|
91
|
+
*
|
|
92
|
+
* By default, SCION icons are loaded from the CDN: https://cdn.jsdelivr.net/npm/@scion/components/resources/scion-icons.
|
|
93
|
+
*
|
|
94
|
+
* ### Content Security Policy (CSP)
|
|
95
|
+
* Applications enforcing a Content Security Policy must whitelist the CDN using the `font-src` directive.
|
|
96
|
+
*
|
|
97
|
+
* ```
|
|
98
|
+
* Content-Security-Policy: font-src 'self' https://cdn.jsdelivr.net/npm/@scion/components/;
|
|
99
|
+
* ```
|
|
100
|
+
*
|
|
101
|
+
* ### Self-Hosting the SCION Icon Font
|
|
102
|
+
* As an alternative to loading SCION icons from the CDN, the application can host the SCION icon font.
|
|
103
|
+
*
|
|
104
|
+
* To host the icon font locally:
|
|
105
|
+
* 1. Download the icon font from `https://cdn.jsdelivr.net/npm/@scion/components/resources/scion-icons/scion-icons.zip`.
|
|
106
|
+
* 2. Extract the font files into the application's public assets folder (e.g., `/public/scion-icons`).
|
|
107
|
+
* 3. Configure the path in the `@scion/components` SCSS module:
|
|
108
|
+
* ```scss
|
|
109
|
+
* @use '@scion/components' with (
|
|
110
|
+
* $icon-font: (
|
|
111
|
+
* directory: '/scion-icons' // must start with a leading slash
|
|
112
|
+
* )
|
|
113
|
+
* );
|
|
114
|
+
* ```
|
|
115
|
+
*
|
|
116
|
+
* ### Loading Self-Hosted Icon Font Relative to Document Base
|
|
117
|
+
* Applications deployed in a subdirectory must configure the `@scion/components` SCSS module to load the self-hosted icon font relative to the document base URL (defined by the `<base>` HTML tag)
|
|
118
|
+
* and exclude the font files from the application build.
|
|
119
|
+
*
|
|
120
|
+
* Different steps are required depending on whether building the application with esbuild or Webpack.
|
|
121
|
+
*
|
|
122
|
+
* **Using `@angular/build:application` (esbuild, default since Angular 20)**
|
|
123
|
+
*
|
|
124
|
+
* 1. Remove the leading slash from the directory configuration:
|
|
125
|
+
* ```scss
|
|
126
|
+
* @use '@scion/components' with (
|
|
127
|
+
* $icon-font: (
|
|
128
|
+
* directory: 'scion-icons' // relative to document base URL
|
|
129
|
+
* )
|
|
130
|
+
* );
|
|
131
|
+
* ```
|
|
132
|
+
* 2. Exclude the font files from the application build via `externalDependencies` in `angular.json`:
|
|
133
|
+
* ```json
|
|
134
|
+
* "externalDependencies": [
|
|
135
|
+
* "scion-icons/scion-icons.*"
|
|
136
|
+
* ]
|
|
137
|
+
* ```
|
|
138
|
+
*
|
|
139
|
+
* **Using `@angular-devkit/build-angular:browser` (Webpack)**
|
|
140
|
+
*
|
|
141
|
+
* Configure the directory path with a leading caret (`^`), instructing Webpack to exclude the font files from the application build:
|
|
142
|
+
*
|
|
143
|
+
* ```scss
|
|
144
|
+
* @use '@scion/components' with (
|
|
145
|
+
* $icon-font: (
|
|
146
|
+
* directory: '^scion-icons' // leading caret excludes the font files from Webpack build
|
|
147
|
+
* )
|
|
148
|
+
* );
|
|
149
|
+
* ```
|
|
86
150
|
*/
|
|
87
151
|
|
|
88
152
|
@use './design/theming' as sci-theming;
|
|
89
153
|
@use './design/themes/scion-light-theme';
|
|
90
154
|
@use './design/themes/scion-dark-theme';
|
|
155
|
+
@use './design/icons/scion-icon-font' as sci-icon-font;
|
|
91
156
|
@use 'sass:map';
|
|
92
157
|
|
|
158
|
+
// Install theme
|
|
93
159
|
$-built-in-themes: (
|
|
94
160
|
scion-light: map.set(scion-light-theme.$theme, color-scheme, light),
|
|
95
161
|
scion-dark: map.set(scion-dark-theme.$theme, color-scheme, dark),
|
|
@@ -97,3 +163,7 @@ $-built-in-themes: (
|
|
|
97
163
|
$themes: $-built-in-themes !default;
|
|
98
164
|
$themes: sci-theming.augment($themes, $-built-in-themes);
|
|
99
165
|
@include sci-theming.install($themes);
|
|
166
|
+
|
|
167
|
+
// Install icon font
|
|
168
|
+
$icon-font: null !default;
|
|
169
|
+
@include sci-icon-font.install-icon-font($icon-font);
|
package/design/_theming.scss
CHANGED
|
@@ -47,7 +47,8 @@
|
|
|
47
47
|
@error 'No themes provided to "@scion/components" SCSS module. Provide a map of themes with token mappings. Refer to the documentation for an example.';
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
$void: -warn-if-color-scheme-
|
|
50
|
+
$void: -warn-if-color-scheme-missing($themes);
|
|
51
|
+
$themes: -add-color-scheme-token($themes);
|
|
51
52
|
$themes: -add-theme-name-token($themes);
|
|
52
53
|
|
|
53
54
|
@layer sci-theme {
|
|
@@ -58,7 +59,7 @@
|
|
|
58
59
|
|
|
59
60
|
/**
|
|
60
61
|
* Augments the provided themes with the provided built-in themes, matching the themes by name or, if there is no match, by light or dark color scheme.
|
|
61
|
-
* The color scheme of a theme is determined by evaluating the "color-scheme"
|
|
62
|
+
* The color scheme of a theme is determined by evaluating the "color-scheme" CSS property.
|
|
62
63
|
*
|
|
63
64
|
* @param {map} $themes - map of themes to be augmented with tokens of the built-in themes.
|
|
64
65
|
* @param {map} $built-in-themes - map of built-in themes.
|
|
@@ -71,7 +72,7 @@
|
|
|
71
72
|
$themes: map.set($themes, $theme, map.merge($built-in-theme, $tokens));
|
|
72
73
|
}
|
|
73
74
|
@else {
|
|
74
|
-
$void: -warn-if-color-scheme-
|
|
75
|
+
$void: -warn-if-color-scheme-missing(($theme: $tokens));
|
|
75
76
|
|
|
76
77
|
@if -is-dark-theme($tokens) {
|
|
77
78
|
$dark-theme: -get-dark-theme($built-in-themes);
|
|
@@ -87,10 +88,10 @@
|
|
|
87
88
|
}
|
|
88
89
|
|
|
89
90
|
/**
|
|
90
|
-
* Adds each theme the token 'sci-theme' with its name.
|
|
91
|
+
* Adds each theme the token '--sci-theme' with its name.
|
|
91
92
|
*
|
|
92
93
|
* @param {map} $themes - map of themes with token mappings.
|
|
93
|
-
* @return {map} Themes with the token 'sci-theme' added to each theme.
|
|
94
|
+
* @return {map} Themes with the token '--sci-theme' added to each theme.
|
|
94
95
|
*/
|
|
95
96
|
@function -add-theme-name-token($themes) {
|
|
96
97
|
@each $theme, $tokens in $themes {
|
|
@@ -99,6 +100,20 @@
|
|
|
99
100
|
@return $themes;
|
|
100
101
|
}
|
|
101
102
|
|
|
103
|
+
/**
|
|
104
|
+
* Adds each theme the token '--sci-color-theme' based on the 'color-scheme' CSS property.
|
|
105
|
+
*
|
|
106
|
+
* @param {map} $themes - map of themes with token mappings.
|
|
107
|
+
* @return {map} Themes with the token '--sci-color-theme' added to each theme.
|
|
108
|
+
*/
|
|
109
|
+
@function -add-color-scheme-token($themes) {
|
|
110
|
+
@each $theme, $tokens in $themes {
|
|
111
|
+
$color-scheme: map.get($tokens, 'color-scheme');
|
|
112
|
+
$themes: map.set($themes, $theme, map.merge((--sci-color-theme: $color-scheme), $tokens));
|
|
113
|
+
}
|
|
114
|
+
@return $themes;
|
|
115
|
+
}
|
|
116
|
+
|
|
102
117
|
/**
|
|
103
118
|
* Creates a theme selector on the root HTML element for each provided theme and sets its tokens as CSS variables, as following:
|
|
104
119
|
*
|
|
@@ -125,7 +140,7 @@
|
|
|
125
140
|
/**
|
|
126
141
|
* Selects a theme based on the user's OS color scheme preference, but ony if no theme is set on the root HTML element.
|
|
127
142
|
*
|
|
128
|
-
* The color scheme of a theme is determined by evaluating the "color-scheme"
|
|
143
|
+
* The color scheme of a theme is determined by evaluating the "color-scheme" CSS property.
|
|
129
144
|
*
|
|
130
145
|
* @param {map} $themes - A map of themes with token mappings.
|
|
131
146
|
*/
|
|
@@ -177,7 +192,7 @@
|
|
|
177
192
|
}
|
|
178
193
|
|
|
179
194
|
/**
|
|
180
|
-
* Returns `true` for a theme with a color-scheme
|
|
195
|
+
* Returns `true` for a theme with a color-scheme 'dark'.
|
|
181
196
|
*
|
|
182
197
|
* @param {map} $tokens - Token mappings of a theme.
|
|
183
198
|
* @return {boolean} `true` if dark theme, otherwise `false`.
|
|
@@ -218,12 +233,12 @@
|
|
|
218
233
|
}
|
|
219
234
|
|
|
220
235
|
/**
|
|
221
|
-
* Logs a warning if
|
|
236
|
+
* Logs a warning if 'color-scheme' CSS property is missing.
|
|
222
237
|
*/
|
|
223
|
-
@function -warn-if-color-scheme-
|
|
238
|
+
@function -warn-if-color-scheme-missing($themes) {
|
|
224
239
|
@each $theme, $tokens in $themes {
|
|
225
240
|
@if (not map.has-key($tokens, 'color-scheme')) {
|
|
226
|
-
@warn 'Missing required
|
|
241
|
+
@warn 'Missing required "color-scheme" in theme "#{$theme}". Add "color-scheme" to the theme "#{$theme}". For a dark theme, add "color-scheme: dark". For a light theme, add "color-scheme: light".';
|
|
227
242
|
}
|
|
228
243
|
}
|
|
229
244
|
@return null;
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
@use '../theming' as sci-theming;
|
|
2
|
+
|
|
3
|
+
$sci-scrollbar: (
|
|
4
|
+
--sci-scrollbar-color: var(--sci-color-gray-700),
|
|
5
|
+
);
|
|
6
|
+
|
|
7
|
+
$sci-viewport: (
|
|
8
|
+
--sci-viewport-scrollbar-color: var(--sci-scrollbar-color),
|
|
9
|
+
);
|
|
10
|
+
|
|
11
|
+
$sci-throbber: (
|
|
12
|
+
--sci-throbber-color: var(--sci-color-gray-300),
|
|
13
|
+
--sci-throbber-size: 50px,
|
|
14
|
+
--sci-throbber-duration: 1.25s,
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
$sci-splitter: (
|
|
18
|
+
--sci-splitter-background-color: var(--sci-color-border), // background color of the splitter
|
|
19
|
+
--sci-splitter-background-color-hover: var(--sci-splitter-background-color), // background color of the splitter when hovering it
|
|
20
|
+
--sci-splitter-size: 1px, // size of the splitter along the main axis (width if direction is row, or height if direction is column)
|
|
21
|
+
--sci-splitter-size-hover: 8px, // size of the splitter along the main axis when hovering it.
|
|
22
|
+
--sci-splitter-touch-target-size: 15px, // touch target size to move the splitter (accessibility)
|
|
23
|
+
--sci-splitter-cross-axis-size: 100%, // handle size along the cross-axis
|
|
24
|
+
--sci-splitter-cross-axis-start: auto, // handle start position on the cross-axis
|
|
25
|
+
--sci-splitter-cross-axis-end: auto, // handle end position on the cross-axis. Requires `--sci-splitter-cross-axis-start: auto`.
|
|
26
|
+
--sci-splitter-border-radius: 0, // border radius of the splitter
|
|
27
|
+
--sci-splitter-opacity-active: 1, // opacity of the splitter while the user moves the splitter
|
|
28
|
+
--sci-splitter-opacity-hover: .3, // opacity of the splitter when hovering it
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
$sci-sashbox: (
|
|
32
|
+
--sci-sashbox-gap: 10px, // gaps (gutters) between sashes
|
|
33
|
+
--sci-sashbox-splitter-background-color: var(--sci-splitter-background-color), // background color of the splitter
|
|
34
|
+
--sci-sashbox-splitter-background-color-hover: var(--sci-splitter-background-color), // background color of the splitter when hovering it
|
|
35
|
+
--sci-sashbox-splitter-size: var(--sci-splitter-size), // size of the splitter along the main axis (width if direction is row, or height if direction is column)
|
|
36
|
+
--sci-sashbox-splitter-size-hover: var(--sci-splitter-size-hover), // size of the splitter along the main axis when hovering it.
|
|
37
|
+
--sci-sashbox-splitter-touch-target-size: var(--sci-splitter-touch-target-size), // touch target size to move the splitter (accessibility)
|
|
38
|
+
--sci-sashbox-splitter-cross-axis-size: var(--sci-splitter-cross-axis-size), // handle size along the cross-axis
|
|
39
|
+
--sci-sashbox-splitter-cross-axis-start: var(--sci-splitter-cross-axis-start), // handle start position on the cross-axis
|
|
40
|
+
--sci-sashbox-splitter-cross-axis-end: var(--sci-splitter-cross-axis-end), // handle end position on the cross-axis. Requires `--sci-sashbox-splitter-cross-axis-size: auto`.
|
|
41
|
+
--sci-sashbox-splitter-border-radius: var(--sci-splitter-border-radius), // border radius of the splitter
|
|
42
|
+
--sci-sashbox-splitter-opacity-active: var(--sci-splitter-opacity-active), // opacity of the splitter while the user moves the splitter
|
|
43
|
+
--sci-sashbox-splitter-opacity-hover: var(--sci-splitter-opacity-hover), // opacity of the splitter when hovering it
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
$sci-menu: (
|
|
47
|
+
--sci-menu-font-size: initial, // based on --sci-menu-item-size
|
|
48
|
+
--sci-menu-border-radius: var(--sci-corner),
|
|
49
|
+
--sci-menu-min-width: 15em,
|
|
50
|
+
--sci-menu-submenu-min-width: 10em,
|
|
51
|
+
--sci-menu-item-size: var(--sci-button-icon-size),
|
|
52
|
+
--sci-menu-item-cursor: var(--sci-button-cursor),
|
|
53
|
+
--sci-menu-item-text-color: var(--sci-button-text-color),
|
|
54
|
+
--sci-menu-item-text-color-disabled: var(--sci-button-text-color-disabled),
|
|
55
|
+
--sci-menu-item-background-color-hover: color-mix(in srgb, var(--sci-color-accent) 35%, var(--sci-color-gray-100)),
|
|
56
|
+
--sci-menu-item-background-color-active: color-mix(in srgb, var(--sci-menu-item-background-color-hover) 97.5%, var(--sci-static-color-white)),
|
|
57
|
+
--sci-menu-item-border-radius: var(--sci-button-border-radius),
|
|
58
|
+
--sci-menu-item-outline-width: var(--sci-button-outline-width),
|
|
59
|
+
--sci-menu-item-accelerator-text-color: var(--sci-color-text-subtlest),
|
|
60
|
+
--sci-menu-item-active-indicator-size: 3px,
|
|
61
|
+
--sci-menu-item-active-indicator-background-color: var(--sci-color-accent),
|
|
62
|
+
--sci-menu-item-active-indicator-border-radius: var(--sci-corner-small),
|
|
63
|
+
--sci-menu-group-header-font-family: inherit,
|
|
64
|
+
--sci-menu-group-header-font-size: .95em,
|
|
65
|
+
--sci-menu-group-header-font-weight: 500,
|
|
66
|
+
--sci-menu-group-header-text-color: var(--sci-color-text-subtlest),
|
|
67
|
+
--sci-menu-filter-outline-width: var(--sci-button-outline-width),
|
|
68
|
+
--sci-menu-filter-outline-radius: var(--sci-corner-small),
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
$sci-toolbar: (
|
|
72
|
+
--sci-toolbar-font-size: initial, // based on --sci-toolbar-item-size
|
|
73
|
+
--sci-toolbar-item-size: var(--sci-button-icon-size),
|
|
74
|
+
--sci-toolbar-item-cursor: var(--sci-button-cursor),
|
|
75
|
+
--sci-toolbar-item-text-color: var(--sci-button-text-color),
|
|
76
|
+
--sci-toolbar-item-text-color-disabled: var(--sci-button-text-color-disabled),
|
|
77
|
+
--sci-toolbar-item-background-color: transparent,
|
|
78
|
+
--sci-toolbar-item-background-color-hover: var(--sci-button-background-color-hover),
|
|
79
|
+
--sci-toolbar-item-background-color-active: var(--sci-button-background-color-active),
|
|
80
|
+
--sci-toolbar-item-background-color-checked: color-mix(in srgb, var(--sci-color-gray-200) 95%, var(--sci-static-color-white)),
|
|
81
|
+
--sci-toolbar-item-border-radius: var(--sci-button-border-radius),
|
|
82
|
+
--sci-toolbar-item-border-color-hover: transparent,
|
|
83
|
+
--sci-toolbar-item-border-color-checked: var(--sci-color-border),
|
|
84
|
+
--sci-toolbar-item-outline-width: var(--sci-button-outline-width),
|
|
85
|
+
--sci-toolbar-item-menu-indicator-color: var(--sci-color-text-subtle),
|
|
86
|
+
--sci-toolbar-item-menu-indicator-color-disabled: var(--sci-color-gray-500),
|
|
87
|
+
--sci-toolbar-item-menu-indicator-size: 3px,
|
|
88
|
+
);
|
|
89
|
+
|
|
90
|
+
$sci-menubar: (
|
|
91
|
+
--sci-menubar-font-size: initial, // based on --sci-menubar-item-size
|
|
92
|
+
--sci-menubar-item-size: var(--sci-button-icon-size),
|
|
93
|
+
--sci-menubar-item-cursor: var(--sci-button-cursor),
|
|
94
|
+
--sci-menubar-item-border-radius: var(--sci-button-border-radius),
|
|
95
|
+
--sci-menubar-item-background-color-hover: var(--sci-button-background-color-hover),
|
|
96
|
+
--sci-menubar-item-background-color-active: var(--sci-button-background-color-active),
|
|
97
|
+
--sci-menubar-item-outline-width: var(--sci-button-outline-width),
|
|
98
|
+
);
|
|
99
|
+
|
|
100
|
+
$sci-table: (
|
|
101
|
+
--sci-table-gridline-color: transparent,
|
|
102
|
+
--sci-table-header-height: 2em,
|
|
103
|
+
--sci-table-header-cursor: var(--sci-button-cursor),
|
|
104
|
+
--sci-table-header-background-color: var(--sci-color-background-primary),
|
|
105
|
+
--sci-table-header-background-color-hover: var(--sci-table-row-background-color-hover),
|
|
106
|
+
--sci-table-header-font-family: inherit,
|
|
107
|
+
--sci-table-header-font-size: 1em,
|
|
108
|
+
--sci-table-header-font-weight: 700,
|
|
109
|
+
--sci-table-header-text-color: inherit,
|
|
110
|
+
--sci-table-header-column-divider: visible,
|
|
111
|
+
--sci-table-row-height: 2em,
|
|
112
|
+
--sci-table-row-background-color-hover: var(--sci-color-gray-100),
|
|
113
|
+
--sci-table-row-background-color-selected: color-mix(in srgb, var(--sci-color-accent) 35%, var(--sci-color-gray-100)),
|
|
114
|
+
--sci-table-row-border-radius: var(--sci-corner-small),
|
|
115
|
+
--sci-table-row-outline-color: var(--sci-color-accent),
|
|
116
|
+
--sci-table-row-outline-width: 1px,
|
|
117
|
+
--sci-table-row-outline-style: dotted,
|
|
118
|
+
--sci-table-row-action-background-color: var(--sci-color-gray-200),
|
|
119
|
+
--sci-table-row-action-background-color-selected: color-mix(in srgb, var(--sci-table-row-background-color-selected) 87.5%, var(--sci-static-color-white)),
|
|
120
|
+
--sci-table-cell-padding-inline: .5em,
|
|
121
|
+
);
|
|
122
|
+
|
|
123
|
+
$sci-button: (
|
|
124
|
+
--sci-button-cursor: default,
|
|
125
|
+
--sci-button-background-color-hover: var(--sci-color-gray-200),
|
|
126
|
+
--sci-button-background-color-active: var(--sci-color-gray-300),
|
|
127
|
+
--sci-button-text-color: var(--sci-color-text),
|
|
128
|
+
--sci-button-text-color-disabled: var(--sci-color-text-subtlest),
|
|
129
|
+
--sci-button-border-radius: var(--sci-corner),
|
|
130
|
+
--sci-button-outline-width: 2px,
|
|
131
|
+
--sci-button-icon-size: 16px,
|
|
132
|
+
);
|
|
133
|
+
|
|
134
|
+
$sci-skeleton: (
|
|
135
|
+
--sci-color-skeleton-subtle: var(--sci-color-gray-200),
|
|
136
|
+
--sci-color-skeleton: var(--sci-color-gray-300),
|
|
137
|
+
--sci-color-skeleton-hover: var(--sci-color-gray-400),
|
|
138
|
+
--sci-color-skeleton-active: var(--sci-color-gray-400),
|
|
139
|
+
);
|
|
140
|
+
|
|
141
|
+
$tokens: sci-theming.map-merge(
|
|
142
|
+
$sci-scrollbar,
|
|
143
|
+
$sci-viewport,
|
|
144
|
+
$sci-throbber,
|
|
145
|
+
$sci-splitter,
|
|
146
|
+
$sci-sashbox,
|
|
147
|
+
$sci-menu,
|
|
148
|
+
$sci-menubar,
|
|
149
|
+
$sci-toolbar,
|
|
150
|
+
$sci-button,
|
|
151
|
+
$sci-table,
|
|
152
|
+
$sci-skeleton,
|
|
153
|
+
);
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
@use '../theming' as sci-theming;
|
|
2
|
+
|
|
3
|
+
$sci-scrollbar: (
|
|
4
|
+
--sci-scrollbar-color: var(--sci-color-gray-700),
|
|
5
|
+
);
|
|
6
|
+
|
|
7
|
+
$sci-viewport: (
|
|
8
|
+
--sci-viewport-scrollbar-color: var(--sci-scrollbar-color),
|
|
9
|
+
);
|
|
10
|
+
|
|
11
|
+
$sci-throbber: (
|
|
12
|
+
--sci-throbber-color: var(--sci-color-gray-300),
|
|
13
|
+
--sci-throbber-size: 50px,
|
|
14
|
+
--sci-throbber-duration: 1.25s,
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
$sci-splitter: (
|
|
18
|
+
--sci-splitter-background-color: var(--sci-color-border), // background color of the splitter
|
|
19
|
+
--sci-splitter-background-color-hover: var(--sci-splitter-background-color), // background color of the splitter when hovering it
|
|
20
|
+
--sci-splitter-size: 1px, // size of the splitter along the main axis (width if direction is row, or height if direction is column)
|
|
21
|
+
--sci-splitter-size-hover: 8px, // size of the splitter along the main axis when hovering it.
|
|
22
|
+
--sci-splitter-touch-target-size: 15px, // touch target size to move the splitter (accessibility)
|
|
23
|
+
--sci-splitter-cross-axis-size: 100%, // handle size along the cross-axis
|
|
24
|
+
--sci-splitter-cross-axis-start: auto, // handle start position on the cross-axis
|
|
25
|
+
--sci-splitter-cross-axis-end: auto, // handle end position on the cross-axis. Requires `--sci-splitter-cross-axis-start: auto`.
|
|
26
|
+
--sci-splitter-border-radius: 0, // border radius of the splitter
|
|
27
|
+
--sci-splitter-opacity-active: 1, // opacity of the splitter while the user moves the splitter
|
|
28
|
+
--sci-splitter-opacity-hover: .3, // opacity of the splitter when hovering it
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
$sci-sashbox: (
|
|
32
|
+
--sci-sashbox-gap: 10px, // gaps (gutters) between sashes
|
|
33
|
+
--sci-sashbox-splitter-background-color: var(--sci-splitter-background-color), // background color of the splitter
|
|
34
|
+
--sci-sashbox-splitter-background-color-hover: var(--sci-splitter-background-color), // background color of the splitter when hovering it
|
|
35
|
+
--sci-sashbox-splitter-size: var(--sci-splitter-size), // size of the splitter along the main axis (width if direction is row, or height if direction is column)
|
|
36
|
+
--sci-sashbox-splitter-size-hover: var(--sci-splitter-size-hover), // size of the splitter along the main axis when hovering it.
|
|
37
|
+
--sci-sashbox-splitter-touch-target-size: var(--sci-splitter-touch-target-size), // touch target size to move the splitter (accessibility)
|
|
38
|
+
--sci-sashbox-splitter-cross-axis-size: var(--sci-splitter-cross-axis-size), // handle size along the cross-axis
|
|
39
|
+
--sci-sashbox-splitter-cross-axis-start: var(--sci-splitter-cross-axis-start), // handle start position on the cross-axis
|
|
40
|
+
--sci-sashbox-splitter-cross-axis-end: var(--sci-splitter-cross-axis-end), // handle end position on the cross-axis. Requires `--sci-sashbox-splitter-cross-axis-size: auto`.
|
|
41
|
+
--sci-sashbox-splitter-border-radius: var(--sci-splitter-border-radius), // border radius of the splitter
|
|
42
|
+
--sci-sashbox-splitter-opacity-active: var(--sci-splitter-opacity-active), // opacity of the splitter while the user moves the splitter
|
|
43
|
+
--sci-sashbox-splitter-opacity-hover: var(--sci-splitter-opacity-hover), // opacity of the splitter when hovering it
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
$sci-menu: (
|
|
47
|
+
--sci-menu-font-size: initial, // based on --sci-menu-item-size
|
|
48
|
+
--sci-menu-border-radius: var(--sci-corner),
|
|
49
|
+
--sci-menu-min-width: 15em,
|
|
50
|
+
--sci-menu-submenu-min-width: 10em,
|
|
51
|
+
--sci-menu-item-size: var(--sci-button-icon-size),
|
|
52
|
+
--sci-menu-item-cursor: var(--sci-button-cursor),
|
|
53
|
+
--sci-menu-item-text-color: var(--sci-button-text-color),
|
|
54
|
+
--sci-menu-item-text-color-disabled: var(--sci-button-text-color-disabled),
|
|
55
|
+
--sci-menu-item-background-color-hover: var(--sci-button-background-color-hover),
|
|
56
|
+
--sci-menu-item-background-color-active: var(--sci-button-background-color-active),
|
|
57
|
+
--sci-menu-item-border-radius: var(--sci-button-border-radius),
|
|
58
|
+
--sci-menu-item-outline-width: var(--sci-button-outline-width),
|
|
59
|
+
--sci-menu-item-accelerator-text-color: var(--sci-color-text-subtlest),
|
|
60
|
+
--sci-menu-item-active-indicator-size: 3px,
|
|
61
|
+
--sci-menu-item-active-indicator-background-color: var(--sci-color-accent),
|
|
62
|
+
--sci-menu-item-active-indicator-border-radius: var(--sci-corner-small),
|
|
63
|
+
--sci-menu-group-header-font-family: inherit,
|
|
64
|
+
--sci-menu-group-header-font-size: .95em,
|
|
65
|
+
--sci-menu-group-header-font-weight: 500,
|
|
66
|
+
--sci-menu-group-header-text-color: var(--sci-color-text-subtlest),
|
|
67
|
+
--sci-menu-filter-outline-width: var(--sci-button-outline-width),
|
|
68
|
+
--sci-menu-filter-outline-radius: var(--sci-corner-small),
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
$sci-toolbar: (
|
|
72
|
+
--sci-toolbar-font-size: initial, // based on --sci-toolbar-item-size
|
|
73
|
+
--sci-toolbar-item-size: var(--sci-button-icon-size),
|
|
74
|
+
--sci-toolbar-item-cursor: var(--sci-button-cursor),
|
|
75
|
+
--sci-toolbar-item-text-color: var(--sci-button-text-color),
|
|
76
|
+
--sci-toolbar-item-text-color-disabled: var(--sci-button-text-color-disabled),
|
|
77
|
+
--sci-toolbar-item-background-color: transparent,
|
|
78
|
+
--sci-toolbar-item-background-color-hover: var(--sci-button-background-color-hover),
|
|
79
|
+
--sci-toolbar-item-background-color-active: var(--sci-button-background-color-active),
|
|
80
|
+
--sci-toolbar-item-background-color-checked: color-mix(in srgb, var(--sci-color-gray-200) 65%, var(--sci-static-color-white)),
|
|
81
|
+
--sci-toolbar-item-border-radius: var(--sci-button-border-radius),
|
|
82
|
+
--sci-toolbar-item-border-color-hover: transparent,
|
|
83
|
+
--sci-toolbar-item-border-color-checked: var(--sci-color-border),
|
|
84
|
+
--sci-toolbar-item-outline-width: var(--sci-button-outline-width),
|
|
85
|
+
--sci-toolbar-item-menu-indicator-color: var(--sci-color-text-subtle),
|
|
86
|
+
--sci-toolbar-item-menu-indicator-color-disabled: var(--sci-color-gray-500),
|
|
87
|
+
--sci-toolbar-item-menu-indicator-size: 3px,
|
|
88
|
+
);
|
|
89
|
+
|
|
90
|
+
$sci-menubar: (
|
|
91
|
+
--sci-menubar-font-size: initial, // based on --sci-menubar-item-size
|
|
92
|
+
--sci-menubar-item-size: var(--sci-button-icon-size),
|
|
93
|
+
--sci-menubar-item-cursor: var(--sci-button-cursor),
|
|
94
|
+
--sci-menubar-item-border-radius: var(--sci-button-border-radius),
|
|
95
|
+
--sci-menubar-item-background-color-hover: var(--sci-button-background-color-hover),
|
|
96
|
+
--sci-menubar-item-background-color-active: var(--sci-button-background-color-active),
|
|
97
|
+
--sci-menubar-item-outline-width: var(--sci-button-outline-width),
|
|
98
|
+
);
|
|
99
|
+
|
|
100
|
+
$sci-table: (
|
|
101
|
+
--sci-table-gridline-color: transparent,
|
|
102
|
+
--sci-table-header-height: 2em,
|
|
103
|
+
--sci-table-header-cursor: var(--sci-button-cursor),
|
|
104
|
+
--sci-table-header-background-color: var(--sci-color-background-primary),
|
|
105
|
+
--sci-table-header-background-color-hover: var(--sci-table-row-background-color-hover),
|
|
106
|
+
--sci-table-header-font-family: inherit,
|
|
107
|
+
--sci-table-header-font-size: 1em,
|
|
108
|
+
--sci-table-header-font-weight: 700,
|
|
109
|
+
--sci-table-header-text-color: inherit,
|
|
110
|
+
--sci-table-header-column-divider: visible,
|
|
111
|
+
--sci-table-row-height: 2em,
|
|
112
|
+
--sci-table-row-background-color-hover: color-mix(in srgb, var(--sci-color-gray-200) 60%, var(--sci-static-color-white)),
|
|
113
|
+
--sci-table-row-background-color-selected: var(--sci-color-background-accent),
|
|
114
|
+
--sci-table-row-border-radius: var(--sci-corner-small),
|
|
115
|
+
--sci-table-row-outline-color: var(--sci-color-accent),
|
|
116
|
+
--sci-table-row-outline-width: 1px,
|
|
117
|
+
--sci-table-row-outline-style: dotted,
|
|
118
|
+
--sci-table-row-action-background-color: var(--sci-color-background-primary),
|
|
119
|
+
--sci-table-row-action-background-color-selected: var(--sci-color-background-primary),
|
|
120
|
+
--sci-table-cell-padding-inline: .5em,
|
|
121
|
+
);
|
|
122
|
+
|
|
123
|
+
$sci-button: (
|
|
124
|
+
--sci-button-cursor: default,
|
|
125
|
+
--sci-button-background-color-hover: color-mix(in srgb, var(--sci-color-gray-200) 95%, var(--sci-static-color-white)),
|
|
126
|
+
--sci-button-background-color-active: var(--sci-color-gray-300),
|
|
127
|
+
--sci-button-text-color: var(--sci-color-text),
|
|
128
|
+
--sci-button-text-color-disabled: var(--sci-color-text-subtlest),
|
|
129
|
+
--sci-button-border-radius: var(--sci-corner),
|
|
130
|
+
--sci-button-outline-width: 2px,
|
|
131
|
+
--sci-button-icon-size: 16px,
|
|
132
|
+
);
|
|
133
|
+
|
|
134
|
+
$sci-skeleton: (
|
|
135
|
+
--sci-color-skeleton-subtle: var(--sci-color-gray-200),
|
|
136
|
+
--sci-color-skeleton: var(--sci-color-gray-300),
|
|
137
|
+
--sci-color-skeleton-hover: var(--sci-color-gray-400),
|
|
138
|
+
--sci-color-skeleton-active: var(--sci-color-gray-400),
|
|
139
|
+
);
|
|
140
|
+
|
|
141
|
+
$tokens: sci-theming.map-merge(
|
|
142
|
+
$sci-scrollbar,
|
|
143
|
+
$sci-viewport,
|
|
144
|
+
$sci-throbber,
|
|
145
|
+
$sci-splitter,
|
|
146
|
+
$sci-sashbox,
|
|
147
|
+
$sci-menu,
|
|
148
|
+
$sci-menubar,
|
|
149
|
+
$sci-toolbar,
|
|
150
|
+
$sci-button,
|
|
151
|
+
$sci-table,
|
|
152
|
+
$sci-skeleton,
|
|
153
|
+
);
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Installs icons used in SCION.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
@use 'sass:map';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Current version of the icon font.
|
|
9
|
+
*
|
|
10
|
+
* UPDATE THIS VERSION WHEN ADDING, REMOVING OR CHANGING ICONS.
|
|
11
|
+
*
|
|
12
|
+
* This version is appended to the HTTP request as query parameter when fetching the icon font to support cache busting.
|
|
13
|
+
*/
|
|
14
|
+
$-version: 1;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* By default, the icon font is loaded from the CDN: https://cdn.jsdelivr.net/npm/@scion/components/resources/scion-icons
|
|
18
|
+
*/
|
|
19
|
+
$-icon-font-defaults: (
|
|
20
|
+
// NOTE: If self-hosting SCION icons, the font path must be "root-relative" or excluded from the application build.
|
|
21
|
+
// Otherwise, the build fails because the builder cannot resolve the font files relative to "this" SASS file.
|
|
22
|
+
// For esbuild, register excluded assets as `externalDependencies` in angular.json.
|
|
23
|
+
// For webpack, exclude assets by prefixing their path with a leading caret (^).
|
|
24
|
+
directory: 'https://cdn.jsdelivr.net/npm/@scion/components/resources/scion-icons',
|
|
25
|
+
filename: 'scion-icons',
|
|
26
|
+
version: $-version,
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Installs the 'scion-icons' font to render SCION icons.
|
|
31
|
+
*
|
|
32
|
+
* SCION icons are rendered in `ScionIconComponent`.
|
|
33
|
+
*/
|
|
34
|
+
@mixin install-icon-font($config) {
|
|
35
|
+
$config: if(sass($config): $config; else: ());
|
|
36
|
+
$config: map.merge($-icon-font-defaults, $config);
|
|
37
|
+
$path: map.get($config, directory) + '/' + map.get($config, filename);
|
|
38
|
+
$version: map.get($config, version);
|
|
39
|
+
|
|
40
|
+
@font-face {
|
|
41
|
+
font-family: 'scion-icons';
|
|
42
|
+
src: url($path + '.ttf?' + $version) format('truetype'),
|
|
43
|
+
url($path + '.woff?' + $version) format('woff'),
|
|
44
|
+
url($path + '.svg?' + $version + '#scion-icons') format('svg');
|
|
45
|
+
font-weight: normal;
|
|
46
|
+
font-style: normal;
|
|
47
|
+
// Prevent a flash of unstyled text content (FOUC) showing the ligatures until the font loads.
|
|
48
|
+
font-display: block;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
@use '../theming' as sci-theming;
|
|
3
3
|
@use '../colors/scion-static-colors';
|
|
4
4
|
@use '../colors/scion-dark-colors';
|
|
5
|
-
@use '../components/scion-component-tokens';
|
|
5
|
+
@use '../components/scion-component-dark-tokens';
|
|
6
6
|
|
|
7
|
-
$theme: sci-theming.map-merge(scion-static-colors.$tokens, scion-dark-colors.$tokens, scion-component-tokens.$tokens, (
|
|
7
|
+
$theme: sci-theming.map-merge(scion-static-colors.$tokens, scion-dark-colors.$tokens, scion-component-dark-tokens.$tokens, (
|
|
8
8
|
// Use for highlighting calls to action and emphasizing important information or key messages.
|
|
9
9
|
--sci-color-accent: var(--sci-color-blue-500),
|
|
10
10
|
--sci-color-accent-inverse: var(--sci-static-color-white),
|
|
@@ -21,11 +21,6 @@ $theme: sci-theming.map-merge(scion-static-colors.$tokens, scion-dark-colors.$to
|
|
|
21
21
|
--sci-color-notice: var(--sci-color-orange-700),
|
|
22
22
|
--sci-color-notice-inverse: var(--sci-static-color-white),
|
|
23
23
|
--sci-color-background-notice: var(--sci-color-orange-1200),
|
|
24
|
-
// Use for skeleton loading progress indicators.
|
|
25
|
-
--sci-color-skeleton-subtle: var(--sci-color-gray-200),
|
|
26
|
-
--sci-color-skeleton: var(--sci-color-gray-300),
|
|
27
|
-
--sci-color-skeleton-hover: var(--sci-color-gray-400),
|
|
28
|
-
--sci-color-skeleton-active: var(--sci-color-gray-400),
|
|
29
24
|
// Use as the primary background for the UI.
|
|
30
25
|
--sci-color-background-primary: var(--sci-color-gray-50),
|
|
31
26
|
// Use as the background for navbars, menubars, toolbars, tabbars, sidebars and panels
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
@use '../theming' as sci-theming;
|
|
3
3
|
@use '../colors/scion-static-colors';
|
|
4
4
|
@use '../colors/scion-light-colors';
|
|
5
|
-
@use '../components/scion-component-tokens';
|
|
5
|
+
@use '../components/scion-component-light-tokens';
|
|
6
6
|
|
|
7
|
-
$theme: sci-theming.map-merge(scion-static-colors.$tokens, scion-light-colors.$tokens, scion-component-tokens.$tokens, (
|
|
7
|
+
$theme: sci-theming.map-merge(scion-static-colors.$tokens, scion-light-colors.$tokens, scion-component-light-tokens.$tokens, (
|
|
8
8
|
// Use for highlighting calls to action and emphasizing important information or key messages.
|
|
9
9
|
--sci-color-accent: var(--sci-color-blue-900),
|
|
10
10
|
--sci-color-accent-inverse: var(--sci-static-color-white),
|
|
11
|
-
--sci-color-background-accent: var(--sci-color-blue-
|
|
11
|
+
--sci-color-background-accent: var(--sci-color-blue-200),
|
|
12
12
|
// Use as positive semantic color to indicate success, positive states and completed tasks.
|
|
13
13
|
--sci-color-positive: var(--sci-color-green-900),
|
|
14
14
|
--sci-color-positive-inverse: var(--sci-static-color-white),
|
|
@@ -21,11 +21,6 @@ $theme: sci-theming.map-merge(scion-static-colors.$tokens, scion-light-colors.$t
|
|
|
21
21
|
--sci-color-notice: var(--sci-color-orange-700),
|
|
22
22
|
--sci-color-notice-inverse: var(--sci-static-color-white),
|
|
23
23
|
--sci-color-background-notice: var(--sci-color-orange-100),
|
|
24
|
-
// Use for skeleton loading progress indicators.
|
|
25
|
-
--sci-color-skeleton-subtle: var(--sci-color-gray-200),
|
|
26
|
-
--sci-color-skeleton: var(--sci-color-gray-300),
|
|
27
|
-
--sci-color-skeleton-hover: var(--sci-color-gray-400),
|
|
28
|
-
--sci-color-skeleton-active: var(--sci-color-gray-400),
|
|
29
24
|
// Use as the primary background for the UI.
|
|
30
25
|
--sci-color-background-primary: var(--sci-color-gray-50),
|
|
31
26
|
// Use as the background for navbars, menubars, toolbars, tabbars, sidebars and panels
|