@danske/sapphire-css 16.3.0 → 25.1.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/README.md +1 -11
- package/build/themes/cjs/default-dark.d.ts +3 -2
- package/build/themes/cjs/default-dark.js +5 -1
- package/build/themes/cjs/default.d.ts +3 -2
- package/build/themes/cjs/default.js +5 -1
- package/build/themes/cjs/index.d.ts +4 -0
- package/build/themes/cjs/june-dark.d.ts +3 -2
- package/build/themes/cjs/june-dark.js +5 -1
- package/build/themes/cjs/june.d.ts +3 -2
- package/build/themes/cjs/june.js +5 -1
- package/build/themes/esm/default-dark.d.ts +3 -2
- package/build/themes/esm/default-dark.js +5 -1
- package/build/themes/esm/default.d.ts +3 -2
- package/build/themes/esm/default.js +5 -1
- package/build/themes/esm/index.d.ts +4 -0
- package/build/themes/esm/june-dark.d.ts +3 -2
- package/build/themes/esm/june-dark.js +5 -1
- package/build/themes/esm/june.d.ts +3 -2
- package/build/themes/esm/june.js +5 -1
- package/components/accordion/accordion.module.css +163 -0
- package/components/badge/badge.module.css +246 -79
- package/components/badge/badge.module.css.d.ts +42 -10
- package/components/button/button.module.css +401 -74
- package/components/button/button.module.css.d.ts +11 -5
- package/components/buttonGroup/buttonGroup.module.css +20 -4
- package/components/buttonGroup/buttonGroup.module.css.d.ts +2 -1
- package/components/calendar/calendar.module.css +9 -2
- package/components/calendar/calendar.module.css.d.ts +1 -2
- package/components/checkbox/checkbox.module.css +44 -11
- package/components/checkbox/checkbox.module.css.d.ts +3 -0
- package/components/dateField/dateField.module.css +81 -86
- package/components/dateField/dateField.module.css.d.ts +3 -6
- package/components/dialog/dialog.module.css +34 -15
- package/components/dialog/dialog.module.css.d.ts +2 -2
- package/components/field/field.module.css +136 -0
- package/components/field/field.module.css.d.ts +0 -1
- package/components/fieldGroup/fieldGroup.module.css +8 -54
- package/components/fieldGroup/fieldGroup.module.css.d.ts +4 -8
- package/components/icon/icon.module.css +11 -6
- package/components/icon/icon.module.css.d.ts +1 -0
- package/components/iconButton/iconButton.module.css +356 -70
- package/components/iconButton/iconButton.module.css.d.ts +8 -4
- package/components/label/label.module.css +29 -0
- package/components/link/link.module.css +71 -13
- package/components/link/link.module.css.d.ts +7 -2
- package/components/list/list.module.css +47 -21
- package/components/list/list.module.css.d.ts +1 -1
- package/components/listbox/listbox.module.css +53 -13
- package/components/listbox/listbox.module.css.d.ts +3 -1
- package/components/notificationBadge/notificationBadge.module.css +126 -0
- package/components/panel/panel.module.css +32 -14
- package/components/panel/panel.module.css.d.ts +3 -2
- package/components/paragraph/paragraph.module.css +4 -7
- package/components/paragraph/paragraph.module.css.d.ts +1 -2
- package/components/radio/radio.module.css +34 -9
- package/components/radio/radio.module.css.d.ts +2 -0
- package/components/searchField/searchField.module.css +43 -19
- package/components/searchField/searchField.module.css.d.ts +2 -0
- package/components/segmentedControl/segmentedControl.module.css +7 -7
- package/components/select/select.module.css +24 -51
- package/components/select/select.module.css.d.ts +1 -4
- package/components/spinner/spinner.module.css +64 -0
- package/components/surface/surface.module.css +5 -1
- package/components/surface/surface.module.css.d.ts +1 -0
- package/components/switch/switch.module.css +44 -44
- package/components/switch/switch.module.css.d.ts +1 -0
- package/components/table/table.module.css +22 -40
- package/components/tabs/tabs.module.css +155 -23
- package/components/tabs/tabs.module.css.d.ts +9 -2
- package/components/text/text.module.css +207 -0
- package/components/textField/textField.module.css +67 -89
- package/components/textField/textField.module.css.d.ts +3 -7
- package/components/toast/toast.module.css +101 -0
- package/components/tooltip/tooltip.module.css +13 -8
- package/components/tooltip/tooltip.module.css.d.ts +1 -0
- package/package.json +10 -7
- package/themes/default-dark.assets.css +1 -0
- package/themes/default-dark.d.ts +3 -2
- package/themes/default-dark.js +5 -1
- package/themes/default-dark.tokens.scss +1 -0
- package/themes/default.assets.css +1 -0
- package/themes/default.d.ts +3 -2
- package/themes/default.js +5 -1
- package/themes/default.tokens.scss +1 -0
- package/themes/index.d.ts +4 -0
- package/themes/june-dark.d.ts +3 -2
- package/themes/june-dark.js +5 -1
- package/themes/june-dark.scss +3 -0
- package/themes/june.d.ts +3 -2
- package/themes/june.js +5 -1
- package/themes/june.scss +3 -0
package/README.md
CHANGED
|
@@ -4,14 +4,10 @@ This is the implementation of Sapphire design system as css style rules.
|
|
|
4
4
|
|
|
5
5
|
## List of Styles
|
|
6
6
|
|
|
7
|
-
To view the list of available classes you can
|
|
7
|
+
To view the list of available classes you can run `npm run storybook` from this folder
|
|
8
8
|
|
|
9
9
|
## Use a style/class
|
|
10
10
|
|
|
11
|
-
If you haven't configured npm for `@sapphire` in your repo run:
|
|
12
|
-
`npm i @danske/sapphire-css --registry=http://artifactory.danskenet.net/artifactory/api/npm/joined-npm-build`
|
|
13
|
-
|
|
14
|
-
otherwise:
|
|
15
11
|
`npm i @danske/sapphire-css`
|
|
16
12
|
|
|
17
13
|
after this you can import css and start using it.
|
|
@@ -49,9 +45,3 @@ In js/ts:
|
|
|
49
45
|
```js
|
|
50
46
|
import defaultThemeClass, { tokens } from '@danske/sapphire-css/themes/default';
|
|
51
47
|
```
|
|
52
|
-
|
|
53
|
-
## Further help
|
|
54
|
-
|
|
55
|
-
Drop a message
|
|
56
|
-
[here](https://teams.microsoft.com/l/channel/19%3a03424de3050e4e59a07de47246e264be%40thread.tacv2/General?groupId=446305d4-c81d-417a-97de-74c2759fb760&tenantId=c7d1b6e9-1447-457b-9223-ac25df4941bf)
|
|
57
|
-
in case of any issue.
|
|
@@ -5,4 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
exports.__esModule = true;
|
|
6
6
|
require("@danske/sapphire-design-tokens/build/themes/default-dark/assets/fonts/danske/fontFace.css");
|
|
7
7
|
var tokens_module_css_1 = __importDefault(require("@danske/sapphire-design-tokens/build/themes/default-dark/css/tokens.module.css"));
|
|
8
|
-
|
|
8
|
+
var theme = {
|
|
9
|
+
themeClassName: tokens_module_css_1["default"]['sapphire-theme-default-dark'],
|
|
10
|
+
contrastThemeClassName: tokens_module_css_1["default"]['sapphire-theme-contrast']
|
|
11
|
+
};
|
|
12
|
+
exports["default"] = theme;
|
|
@@ -5,4 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
exports.__esModule = true;
|
|
6
6
|
require("@danske/sapphire-design-tokens/build/themes/default/assets/fonts/danske/fontFace.css");
|
|
7
7
|
var tokens_module_css_1 = __importDefault(require("@danske/sapphire-design-tokens/build/themes/default/css/tokens.module.css"));
|
|
8
|
-
|
|
8
|
+
var theme = {
|
|
9
|
+
themeClassName: tokens_module_css_1["default"]['sapphire-theme-default'],
|
|
10
|
+
contrastThemeClassName: tokens_module_css_1["default"]['sapphire-theme-contrast']
|
|
11
|
+
};
|
|
12
|
+
exports["default"] = theme;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import '@danske/sapphire-design-tokens/build/themes/june-dark/assets/fonts/fira/fontFace.css';
|
|
2
2
|
import '@danske/sapphire-design-tokens/build/themes/june-dark/assets/fonts/playfair/fontFace.css';
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
import type { Theme } from '.';
|
|
4
|
+
declare const theme: Theme;
|
|
5
|
+
export default theme;
|
|
@@ -6,4 +6,8 @@ exports.__esModule = true;
|
|
|
6
6
|
require("@danske/sapphire-design-tokens/build/themes/june-dark/assets/fonts/fira/fontFace.css");
|
|
7
7
|
require("@danske/sapphire-design-tokens/build/themes/june-dark/assets/fonts/playfair/fontFace.css");
|
|
8
8
|
var tokens_module_css_1 = __importDefault(require("@danske/sapphire-design-tokens/build/themes/june-dark/css/tokens.module.css"));
|
|
9
|
-
|
|
9
|
+
var theme = {
|
|
10
|
+
themeClassName: tokens_module_css_1["default"]['sapphire-theme-june-dark'],
|
|
11
|
+
contrastThemeClassName: tokens_module_css_1["default"]['sapphire-theme-contrast']
|
|
12
|
+
};
|
|
13
|
+
exports["default"] = theme;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import '@danske/sapphire-design-tokens/build/themes/june/assets/fonts/fira/fontFace.css';
|
|
2
2
|
import '@danske/sapphire-design-tokens/build/themes/june/assets/fonts/playfair/fontFace.css';
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
import type { Theme } from '.';
|
|
4
|
+
declare const theme: Theme;
|
|
5
|
+
export default theme;
|
package/build/themes/cjs/june.js
CHANGED
|
@@ -6,4 +6,8 @@ exports.__esModule = true;
|
|
|
6
6
|
require("@danske/sapphire-design-tokens/build/themes/june/assets/fonts/fira/fontFace.css");
|
|
7
7
|
require("@danske/sapphire-design-tokens/build/themes/june/assets/fonts/playfair/fontFace.css");
|
|
8
8
|
var tokens_module_css_1 = __importDefault(require("@danske/sapphire-design-tokens/build/themes/june/css/tokens.module.css"));
|
|
9
|
-
|
|
9
|
+
var theme = {
|
|
10
|
+
themeClassName: tokens_module_css_1["default"]['sapphire-theme-june'],
|
|
11
|
+
contrastThemeClassName: tokens_module_css_1["default"]['sapphire-theme-contrast']
|
|
12
|
+
};
|
|
13
|
+
exports["default"] = theme;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import '@danske/sapphire-design-tokens/build/themes/default-dark/assets/fonts/danske/fontFace.css';
|
|
2
2
|
import styles from '@danske/sapphire-design-tokens/build/themes/default-dark/css/tokens.module.css';
|
|
3
|
-
|
|
3
|
+
var theme = {
|
|
4
|
+
themeClassName: styles['sapphire-theme-default-dark'],
|
|
5
|
+
contrastThemeClassName: styles['sapphire-theme-contrast']
|
|
6
|
+
};
|
|
7
|
+
export default theme;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import '@danske/sapphire-design-tokens/build/themes/default/assets/fonts/danske/fontFace.css';
|
|
2
2
|
import styles from '@danske/sapphire-design-tokens/build/themes/default/css/tokens.module.css';
|
|
3
|
-
|
|
3
|
+
var theme = {
|
|
4
|
+
themeClassName: styles['sapphire-theme-default'],
|
|
5
|
+
contrastThemeClassName: styles['sapphire-theme-contrast']
|
|
6
|
+
};
|
|
7
|
+
export default theme;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import '@danske/sapphire-design-tokens/build/themes/june-dark/assets/fonts/fira/fontFace.css';
|
|
2
2
|
import '@danske/sapphire-design-tokens/build/themes/june-dark/assets/fonts/playfair/fontFace.css';
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
import type { Theme } from '.';
|
|
4
|
+
declare const theme: Theme;
|
|
5
|
+
export default theme;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import '@danske/sapphire-design-tokens/build/themes/june-dark/assets/fonts/fira/fontFace.css';
|
|
2
2
|
import '@danske/sapphire-design-tokens/build/themes/june-dark/assets/fonts/playfair/fontFace.css';
|
|
3
3
|
import styles from '@danske/sapphire-design-tokens/build/themes/june-dark/css/tokens.module.css';
|
|
4
|
-
|
|
4
|
+
var theme = {
|
|
5
|
+
themeClassName: styles['sapphire-theme-june-dark'],
|
|
6
|
+
contrastThemeClassName: styles['sapphire-theme-contrast']
|
|
7
|
+
};
|
|
8
|
+
export default theme;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import '@danske/sapphire-design-tokens/build/themes/june/assets/fonts/fira/fontFace.css';
|
|
2
2
|
import '@danske/sapphire-design-tokens/build/themes/june/assets/fonts/playfair/fontFace.css';
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
import type { Theme } from '.';
|
|
4
|
+
declare const theme: Theme;
|
|
5
|
+
export default theme;
|
package/build/themes/esm/june.js
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import '@danske/sapphire-design-tokens/build/themes/june/assets/fonts/fira/fontFace.css';
|
|
2
2
|
import '@danske/sapphire-design-tokens/build/themes/june/assets/fonts/playfair/fontFace.css';
|
|
3
3
|
import styles from '@danske/sapphire-design-tokens/build/themes/june/css/tokens.module.css';
|
|
4
|
-
|
|
4
|
+
var theme = {
|
|
5
|
+
themeClassName: styles['sapphire-theme-june'],
|
|
6
|
+
contrastThemeClassName: styles['sapphire-theme-contrast']
|
|
7
|
+
};
|
|
8
|
+
export default theme;
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
.sapphire-accordion {
|
|
2
|
+
box-sizing: border-box;
|
|
3
|
+
width: 100%;
|
|
4
|
+
|
|
5
|
+
/* sizing */
|
|
6
|
+
padding: 0;
|
|
7
|
+
margin: 0;
|
|
8
|
+
|
|
9
|
+
/* The below is meant to address a font rendering quirk in OSX where the text
|
|
10
|
+
* looks bolder than intended due to subpixel rendering. This quirk generally
|
|
11
|
+
* occurs for bold fonts on dark backgrounds but depending on the font, it
|
|
12
|
+
* can happen in other contexts as well.
|
|
13
|
+
*
|
|
14
|
+
* These do not do anything except in webkit browsers & firefox on OSX.
|
|
15
|
+
*
|
|
16
|
+
* For more details see:
|
|
17
|
+
* - https://azuredevops/Main/WCCJ/_git/sapphire/pullRequest/212710?path=%2Fpackages%2Fcss%2Fcomponents%2Fbutton%2Fbutton.module.css&discussionId=1507702&_a=files
|
|
18
|
+
* - https://usabilitypost.com/2012/11/05/stop-fixing-font-smoothing/
|
|
19
|
+
*/
|
|
20
|
+
-webkit-font-smoothing: antialiased;
|
|
21
|
+
-moz-osx-font-smoothing: grayscale;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.sapphire-accordion__item {
|
|
25
|
+
display: flex;
|
|
26
|
+
flex-direction: column;
|
|
27
|
+
position: relative;
|
|
28
|
+
line-height: var(--sapphire-accordion-size-line-height);
|
|
29
|
+
font-family: var(--sapphire-accordion-font-name);
|
|
30
|
+
background-color: var(--sapphire-accordion-color-background-item);
|
|
31
|
+
color: var(--sapphire-accordion-color-content);
|
|
32
|
+
border-bottom: var(--sapphire-accordion-size-width-border) solid
|
|
33
|
+
var(--sapphire-accordion-color-border);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.sapphire-accordion--without-last-divider .sapphire-accordion__item:last-child {
|
|
37
|
+
border-bottom: none;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/* Disabled */
|
|
41
|
+
|
|
42
|
+
.sapphire-accordion__item.is-disabled .sapphire-accordion__item-header,
|
|
43
|
+
.sapphire-accordion__item.is-disabled
|
|
44
|
+
.sapphire-accordion__item-content-wrapper {
|
|
45
|
+
cursor: not-allowed;
|
|
46
|
+
-webkit-user-select: none;
|
|
47
|
+
-ms-user-select: none;
|
|
48
|
+
user-select: none;
|
|
49
|
+
opacity: var(--sapphire-accordion-opacity-disabled);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/* Header */
|
|
53
|
+
|
|
54
|
+
.sapphire-accordion__item-header {
|
|
55
|
+
cursor: pointer;
|
|
56
|
+
display: flex;
|
|
57
|
+
justify-content: space-between;
|
|
58
|
+
align-items: center;
|
|
59
|
+
padding: var(--sapphire-accordion-size-spacing-header-vertical)
|
|
60
|
+
var(--sapphire-accordion-size-spacing-header-horizontal);
|
|
61
|
+
border: none;
|
|
62
|
+
background-color: inherit;
|
|
63
|
+
font-family: inherit;
|
|
64
|
+
line-height: inherit;
|
|
65
|
+
color: inherit;
|
|
66
|
+
width: 100%;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/* Hover header*/
|
|
70
|
+
|
|
71
|
+
.sapphire-accordion__item:not(.is-disabled)
|
|
72
|
+
.sapphire-accordion__item-header:not(:active):not(.is-active):not(.js-hover):hover,
|
|
73
|
+
.sapphire-accordion__item:not(.is-disabled)
|
|
74
|
+
.sapphire-accordion__item-header:not(:active):not(.is-active).is-hover {
|
|
75
|
+
background-color: var(--sapphire-accordion-color-background-header-hover);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/* Active header */
|
|
79
|
+
|
|
80
|
+
.sapphire-accordion__item:not(.is-disabled)
|
|
81
|
+
.sapphire-accordion__item-header.is-active,
|
|
82
|
+
.sapphire-accordion__item:not(.is-disabled)
|
|
83
|
+
.sapphire-accordion__item-header:active,
|
|
84
|
+
.sapphire-accordion__item:not(.is-disabled)
|
|
85
|
+
.sapphire-accordion__item-header:not(.js-focus):focus-visible:active {
|
|
86
|
+
background-color: var(--sapphire-accordion-color-background-header-active);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/* Focus header*/
|
|
90
|
+
|
|
91
|
+
.sapphire-accordion__item-header:focus {
|
|
92
|
+
outline: none;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.sapphire-accordion__item:not(.is-disabled)
|
|
96
|
+
.sapphire-accordion__item-header.is-focus,
|
|
97
|
+
.sapphire-accordion__item:not(.is-disabled)
|
|
98
|
+
.sapphire-accordion__item-header:not(.js-focus):focus-visible {
|
|
99
|
+
outline: none;
|
|
100
|
+
box-shadow: inset 0px 0px 0px var(--sapphire-accordion-size-focus-ring)
|
|
101
|
+
var(--sapphire-accordion-color-focus-ring);
|
|
102
|
+
border: 0;
|
|
103
|
+
border-radius: var(--sapphire-accordion-size-radius);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/* Remove closed item's border if header is focused */
|
|
107
|
+
.sapphire-accordion__item:not(.sapphire-accordion__item--open):has(.sapphire-accordion__item-header.is-focus, .sapphire-accordion__item-header:not(.js-focus):focus-visible) {
|
|
108
|
+
border: none;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/* Header elements */
|
|
112
|
+
|
|
113
|
+
.sapphire-accordion__item-heading {
|
|
114
|
+
font-size: var(--sapphire-accordion-size-font-heading);
|
|
115
|
+
font-weight: var(--sapphire-accordion-font-weight-heading);
|
|
116
|
+
text-align: left;
|
|
117
|
+
flex: 1;
|
|
118
|
+
/* Wrap if title is long */
|
|
119
|
+
min-width: 0px;
|
|
120
|
+
word-wrap: break-word;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.sapphire-accordion__item-arrow {
|
|
124
|
+
display: flex;
|
|
125
|
+
justify-content: center;
|
|
126
|
+
align-items: center;
|
|
127
|
+
width: var(--sapphire-accordion-size-height-arrow);
|
|
128
|
+
height: var(--sapphire-accordion-size-height-arrow);
|
|
129
|
+
transition: transform var(--sapphire-accordion-time-transition-arrow)
|
|
130
|
+
ease-in-out;
|
|
131
|
+
}
|
|
132
|
+
.sapphire-accordion__item--open .sapphire-accordion__item-arrow {
|
|
133
|
+
transform: rotate(180deg);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/* Content */
|
|
137
|
+
|
|
138
|
+
.sapphire-accordion__item-content-wrapper {
|
|
139
|
+
display: grid;
|
|
140
|
+
grid-template-rows: 0fr;
|
|
141
|
+
transition: grid-template-rows var(--sapphire-accordion-time-transition-body)
|
|
142
|
+
ease-in-out;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.sapphire-accordion__item-content {
|
|
146
|
+
font-size: var(--sapphire-accordion-size-font-content);
|
|
147
|
+
font-weight: var(--sapphire-accordion-font-weight-content);
|
|
148
|
+
overflow: hidden;
|
|
149
|
+
transition: padding-top var(--sapphire-accordion-time-transition-body)
|
|
150
|
+
ease-in-out,
|
|
151
|
+
padding-bottom var(--sapphire-accordion-time-transition-body) ease-in-out;
|
|
152
|
+
padding-right: var(--sapphire-accordion-size-spacing-body-horizontal);
|
|
153
|
+
padding-left: var(--sapphire-accordion-size-spacing-body-horizontal);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.sapphire-accordion__item--open .sapphire-accordion__item-content-wrapper {
|
|
157
|
+
grid-template-rows: 1fr;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.sapphire-accordion__item--open .sapphire-accordion__item-content {
|
|
161
|
+
padding-top: var(--sapphire-accordion-size-spacing-body-top);
|
|
162
|
+
padding-bottom: var(--sapphire-accordion-size-spacing-body-bottom);
|
|
163
|
+
}
|