@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.
Files changed (91) hide show
  1. package/README.md +1 -11
  2. package/build/themes/cjs/default-dark.d.ts +3 -2
  3. package/build/themes/cjs/default-dark.js +5 -1
  4. package/build/themes/cjs/default.d.ts +3 -2
  5. package/build/themes/cjs/default.js +5 -1
  6. package/build/themes/cjs/index.d.ts +4 -0
  7. package/build/themes/cjs/june-dark.d.ts +3 -2
  8. package/build/themes/cjs/june-dark.js +5 -1
  9. package/build/themes/cjs/june.d.ts +3 -2
  10. package/build/themes/cjs/june.js +5 -1
  11. package/build/themes/esm/default-dark.d.ts +3 -2
  12. package/build/themes/esm/default-dark.js +5 -1
  13. package/build/themes/esm/default.d.ts +3 -2
  14. package/build/themes/esm/default.js +5 -1
  15. package/build/themes/esm/index.d.ts +4 -0
  16. package/build/themes/esm/june-dark.d.ts +3 -2
  17. package/build/themes/esm/june-dark.js +5 -1
  18. package/build/themes/esm/june.d.ts +3 -2
  19. package/build/themes/esm/june.js +5 -1
  20. package/components/accordion/accordion.module.css +163 -0
  21. package/components/badge/badge.module.css +246 -79
  22. package/components/badge/badge.module.css.d.ts +42 -10
  23. package/components/button/button.module.css +401 -74
  24. package/components/button/button.module.css.d.ts +11 -5
  25. package/components/buttonGroup/buttonGroup.module.css +20 -4
  26. package/components/buttonGroup/buttonGroup.module.css.d.ts +2 -1
  27. package/components/calendar/calendar.module.css +9 -2
  28. package/components/calendar/calendar.module.css.d.ts +1 -2
  29. package/components/checkbox/checkbox.module.css +44 -11
  30. package/components/checkbox/checkbox.module.css.d.ts +3 -0
  31. package/components/dateField/dateField.module.css +81 -86
  32. package/components/dateField/dateField.module.css.d.ts +3 -6
  33. package/components/dialog/dialog.module.css +34 -15
  34. package/components/dialog/dialog.module.css.d.ts +2 -2
  35. package/components/field/field.module.css +136 -0
  36. package/components/field/field.module.css.d.ts +0 -1
  37. package/components/fieldGroup/fieldGroup.module.css +8 -54
  38. package/components/fieldGroup/fieldGroup.module.css.d.ts +4 -8
  39. package/components/icon/icon.module.css +11 -6
  40. package/components/icon/icon.module.css.d.ts +1 -0
  41. package/components/iconButton/iconButton.module.css +356 -70
  42. package/components/iconButton/iconButton.module.css.d.ts +8 -4
  43. package/components/label/label.module.css +29 -0
  44. package/components/link/link.module.css +71 -13
  45. package/components/link/link.module.css.d.ts +7 -2
  46. package/components/list/list.module.css +47 -21
  47. package/components/list/list.module.css.d.ts +1 -1
  48. package/components/listbox/listbox.module.css +53 -13
  49. package/components/listbox/listbox.module.css.d.ts +3 -1
  50. package/components/notificationBadge/notificationBadge.module.css +126 -0
  51. package/components/panel/panel.module.css +32 -14
  52. package/components/panel/panel.module.css.d.ts +3 -2
  53. package/components/paragraph/paragraph.module.css +4 -7
  54. package/components/paragraph/paragraph.module.css.d.ts +1 -2
  55. package/components/radio/radio.module.css +34 -9
  56. package/components/radio/radio.module.css.d.ts +2 -0
  57. package/components/searchField/searchField.module.css +43 -19
  58. package/components/searchField/searchField.module.css.d.ts +2 -0
  59. package/components/segmentedControl/segmentedControl.module.css +7 -7
  60. package/components/select/select.module.css +24 -51
  61. package/components/select/select.module.css.d.ts +1 -4
  62. package/components/spinner/spinner.module.css +64 -0
  63. package/components/surface/surface.module.css +5 -1
  64. package/components/surface/surface.module.css.d.ts +1 -0
  65. package/components/switch/switch.module.css +44 -44
  66. package/components/switch/switch.module.css.d.ts +1 -0
  67. package/components/table/table.module.css +22 -40
  68. package/components/tabs/tabs.module.css +155 -23
  69. package/components/tabs/tabs.module.css.d.ts +9 -2
  70. package/components/text/text.module.css +207 -0
  71. package/components/textField/textField.module.css +67 -89
  72. package/components/textField/textField.module.css.d.ts +3 -7
  73. package/components/toast/toast.module.css +101 -0
  74. package/components/tooltip/tooltip.module.css +13 -8
  75. package/components/tooltip/tooltip.module.css.d.ts +1 -0
  76. package/package.json +10 -7
  77. package/themes/default-dark.assets.css +1 -0
  78. package/themes/default-dark.d.ts +3 -2
  79. package/themes/default-dark.js +5 -1
  80. package/themes/default-dark.tokens.scss +1 -0
  81. package/themes/default.assets.css +1 -0
  82. package/themes/default.d.ts +3 -2
  83. package/themes/default.js +5 -1
  84. package/themes/default.tokens.scss +1 -0
  85. package/themes/index.d.ts +4 -0
  86. package/themes/june-dark.d.ts +3 -2
  87. package/themes/june-dark.js +5 -1
  88. package/themes/june-dark.scss +3 -0
  89. package/themes/june.d.ts +3 -2
  90. package/themes/june.js +5 -1
  91. package/themes/june.scss +3 -0
@@ -3,13 +3,17 @@ declare const styles: {
3
3
  readonly "is-disabled": string;
4
4
  readonly "is-focus": string;
5
5
  readonly "js-focus": string;
6
- readonly "sapphire-icon-button--primary": string;
6
+ readonly "sapphire-icon-button--primary-fill": string;
7
7
  readonly "is-active": string;
8
8
  readonly "js-hover": string;
9
9
  readonly "is-hover": string;
10
- readonly "sapphire-icon-button--secondary": string;
11
- readonly "sapphire-icon-button--neutral": string;
12
- readonly "sapphire-icon-button--danger": string;
10
+ readonly "sapphire-icon-button--secondary-fill": string;
11
+ readonly "sapphire-icon-button--secondary-surface": string;
12
+ readonly "sapphire-icon-button--secondary-ghost": string;
13
+ readonly "sapphire-icon-button--tertiary-fill": string;
14
+ readonly "sapphire-icon-button--tertiary-ghost": string;
15
+ readonly "sapphire-icon-button--danger-fill": string;
16
+ readonly "sapphire-icon-button--danger-ghost": string;
13
17
  readonly "sapphire-icon-button__icon": string;
14
18
  readonly "sapphire-icon-button--large": string;
15
19
  readonly "sapphire-icon-button--small": string;
@@ -0,0 +1,29 @@
1
+ .sapphire-label {
2
+ display: inline-flex;
3
+ align-items: center;
4
+ min-height: var(--sapphire-label-size-height-l);
5
+ line-height: var(--sapphire-label-size-line-height-l);
6
+ font-size: var(--sapphire-label-size-font-l);
7
+ gap: var(--sapphire-label-size-spacing-horizontal);
8
+ }
9
+
10
+ .sapphire-label--medium {
11
+ line-height: var(--sapphire-label-size-line-height-m);
12
+ font-size: var(--sapphire-label-size-font-m);
13
+ min-height: var(--sapphire-label-size-height-m);
14
+ }
15
+
16
+ .sapphire-label__text {
17
+ font-weight: var(--sapphire-label-size-font-weight);
18
+ color: var(--sapphire-label-color-text);
19
+ }
20
+
21
+ .sapphire-label__required-indicator {
22
+ background-image: url("data:image/svg+xml,%3Csvg width='8' height='8' viewBox='0 0 8 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M3.99999 0.583344C4.41421 0.583344 4.74999 0.91913 4.74999 1.33334V3.22127L6.6017 2.62001C6.99567 2.49208 7.41874 2.70775 7.54666 3.10172C7.67459 3.49568 7.45892 3.91876 7.06495 4.04668L5.21363 4.64782L6.3601 6.22585C6.60356 6.56096 6.52927 7.02998 6.19416 7.27345C5.85905 7.51691 5.39002 7.44262 5.14656 7.10751L3.99999 5.52935L2.85343 7.10751C2.60996 7.44262 2.14094 7.51691 1.80583 7.27345C1.47072 7.02998 1.39642 6.56096 1.63989 6.22585L2.78636 4.64782L0.935036 4.04668C0.541071 3.91876 0.325401 3.49568 0.453323 3.10172C0.581246 2.70775 1.00432 2.49208 1.39829 2.62001L3.24999 3.22127V1.33334C3.24999 0.91913 3.58578 0.583344 3.99999 0.583344Z' fill='%23DD3254'/%3E%3C/svg%3E%0A");
23
+ width: 8px; /* Hard coded, since it's linked to the svg above */
24
+ height: 8px; /* Hard coded, since it's linked to the svg above */
25
+ }
26
+
27
+ .sapphire-label__optional-indicator {
28
+ color: var(--sapphire-label-color-necessity-indicator);
29
+ }
@@ -7,29 +7,87 @@
7
7
  * These do not do anything except in webkit browsers & firefox on OSX.
8
8
  *
9
9
  * For more details see:
10
- * - https://azuredevops/Main/WCCJ/_git/sapphire/pullRequest/212710?path=%2Fpackages%2Fcss%2Fcomponents%2Fbutton%2Fbutton.module.css&discussionId=1507702&_a=files
10
+ * - https://azuredevops/Main/WCCJ/_git/sapphire/pullRequest/212710?path=%2Fpackages%2Fcss%2Fcomponents%2Flink%2Flink.module.css&discussionId=1507702&_a=files
11
11
  * - https://usabilitypost.com/2012/11/05/stop-fixing-font-smoothing/
12
12
  */
13
13
  -webkit-font-smoothing: antialiased;
14
14
  -moz-osx-font-smoothing: grayscale;
15
15
 
16
+ /**
17
+ * For making line-height take effect in all scenarios
18
+ * Otherwise in some cases the link can be set to display: inline
19
+ * by the browser which would not make line-height apply
20
+ * and focus styles would eg. be too cramped
21
+ */
22
+ display: inline-block;
23
+
16
24
  font-family: var(--sapphire-link-font-name);
17
- color: var(--sapphire-link-color-text-default);
18
- text-decoration: none;
25
+ font-size: var(--sapphire-link-size-font-l);
26
+ line-height: var(--sapphire-link-size-line-height);
19
27
  cursor: pointer;
20
28
  outline: 0;
21
- text-decoration: underline;
29
+ border-radius: var(--sapphire-link-size-radius);
22
30
  }
23
31
 
24
- .sapphire-link:active .sapphire-link.is-active {
25
- color: var(--sapphire-link-color-text-active);
32
+ /* Disabled state for all variants */
33
+ .sapphire-link.is-disabled {
34
+ opacity: var(--sapphire-link-opacity-disabled);
35
+ cursor: not-allowed;
36
+ }
37
+
38
+ /**
39
+ * Skin rules
40
+ */
41
+ /* primary */
42
+ .sapphire-link--primary {
43
+ color: var(--sapphire-link-color-content-primary-default);
44
+ }
45
+ .sapphire-link--primary:not(:disabled):not(.is-disabled):not(:active):not(.is-active):not(.js-hover):hover,
46
+ .sapphire-link--primary:not(:disabled):not(.is-disabled):not(:active):not(.is-active).is-hover {
47
+ color: var(--sapphire-link-color-content-primary-hover);
26
48
  }
27
- .sapphire-link:not(.js-focus):focus-visible,
28
- .sapphire-link.is-focus {
29
- color: var(--sapphire-link-color-text-default);
30
- outline: 2px solid var(--sapphire-link-color-focus-ring);
49
+ .sapphire-link--primary.is-focus,
50
+ .sapphire-link--primary:not(.js-focus):focus-visible {
51
+ color: var(--sapphire-link-color-content-primary-default);
52
+ outline: var(--sapphire-link-size-focus-ring-border) solid
53
+ var(--sapphire-link-color-focus-ring);
31
54
  }
32
- .sapphire-link:not(.js-hover):hover,
33
- .sapphire-link.is-hover {
34
- color: var(--sapphire-link-color-text-hover);
55
+ .sapphire-link--primary:not(:disabled):not(.is-disabled).is-active,
56
+ .sapphire-link--primary:not(:disabled):not(.is-disabled):active,
57
+ .sapphire-link--primary:not(:disabled):not(.is-disabled):focus-visible:active {
58
+ color: var(--sapphire-link-color-content-primary-active);
59
+ }
60
+
61
+ /* secondary */
62
+ .sapphire-link--secondary {
63
+ color: var(--sapphire-link-color-content-secondary-default);
64
+ }
65
+
66
+ .sapphire-link--secondary:not(:disabled):not(.is-disabled):not(:active):not(.is-active):not(.js-hover):hover,
67
+ .sapphire-link--secondary:not(:disabled):not(.is-disabled):not(:active):not(.is-active).is-hover {
68
+ color: var(--sapphire-link-color-content-secondary-hover);
69
+ }
70
+
71
+ .sapphire-link--secondary.is-focus,
72
+ .sapphire-link--secondary:not(.js-focus):focus-visible {
73
+ color: var(--sapphire-link-color-content-secondary-default);
74
+ outline: var(--sapphire-link-size-focus-ring-border) solid
75
+ var(--sapphire-link-color-focus-ring);
76
+ }
77
+
78
+ .sapphire-link--secondary:not(:disabled):not(.is-disabled).is-active,
79
+ .sapphire-link--secondary:not(:disabled):not(.is-disabled):active,
80
+ .sapphire-link--secondary:not(:disabled):not(.is-disabled):focus-visible:active {
81
+ color: var(--sapphire-link-color-content-secondary-active);
82
+ }
83
+
84
+ /**
85
+ * Size variations
86
+ */
87
+ .sapphire-link--medium {
88
+ font-size: var(--sapphire-link-size-font-m);
89
+ }
90
+
91
+ .sapphire-link--small {
92
+ font-size: var(--sapphire-link-size-font-s);
35
93
  }
@@ -1,10 +1,15 @@
1
1
  declare const styles: {
2
2
  readonly "sapphire-link": string;
3
+ readonly "is-disabled": string;
4
+ readonly "sapphire-link--primary": string;
3
5
  readonly "is-active": string;
4
- readonly "js-focus": string;
5
- readonly "is-focus": string;
6
6
  readonly "js-hover": string;
7
7
  readonly "is-hover": string;
8
+ readonly "is-focus": string;
9
+ readonly "js-focus": string;
10
+ readonly "sapphire-link--secondary": string;
11
+ readonly "sapphire-link--medium": string;
12
+ readonly "sapphire-link--small": string;
8
13
  };
9
14
  export = styles;
10
15
 
@@ -30,13 +30,12 @@
30
30
  background-color: var(--sapphire-list-color-background-item-default);
31
31
  }
32
32
 
33
- /* pure css approach, not properly supported in all browsers at the moment */
34
33
  .sapphire-list__item:has(.sapphire-list__item-content-wrapper) {
35
34
  padding: 0;
36
35
  }
37
- /* fallback js-based solution */
38
- .sapphire-list__item--content-wrapped {
39
- padding: 0;
36
+
37
+ .sapphire-list__item:focus-within {
38
+ z-index: 1;
40
39
  }
41
40
 
42
41
  .sapphire-list__item-content-wrapper {
@@ -62,35 +61,62 @@
62
61
  text-align: inherit;
63
62
  align-items: inherit;
64
63
  }
64
+
65
+ .sapphire-list--negative-margin-self {
66
+ margin-left: calc(var(--sapphire-list-spacing-item-horizontal-default) * -1);
67
+ width: calc(
68
+ 100% + (var(--sapphire-list-spacing-item-horizontal-default) * 2)
69
+ );
70
+ }
71
+
65
72
  .sapphire-list__item-content-wrapper:disabled,
66
73
  .sapphire-list__item-content-wrapper[aria-disabled='true'] {
67
- cursor: inherit;
68
- /* TODO: Ask designers to provide disabled styles and apply them here */
74
+ cursor: not-allowed;
69
75
  }
70
76
 
71
- .sapphire-list__item-content-wrapper:not(.is-focus, :not(.js-focus):focus-visible)::after,
72
- .sapphire-list__item:not(.sapphire-list__item--content-wrapped)::after {
73
- content: '';
74
- position: absolute;
75
- height: var(--sapphire-list-size-width-border-item-default);
76
- background: var(--sapphire-list-color-border-item-default);
77
- bottom: 0;
78
- left: var(--sapphire-list-spacing-item-horizontal-default);
79
- right: var(--sapphire-list-spacing-item-horizontal-default);
77
+ .sapphire-list__item-content-wrapper:disabled > *,
78
+ .sapphire-list__item-content-wrapper[aria-disabled='true'] > * {
79
+ opacity: var(--sapphire-list-opacity-disabled);
80
80
  }
81
81
 
82
+ /*
83
+ Only render a divider if
84
+ - item isn't last child of without-last-divider list
85
+ - next item is focused (as next item's top box-shadow will act as divider) either by
86
+ - parent item of item-content-wrapper not having a sibling with a focused child item-content-wrapper
87
+ - sibling of a list item without a child item-content-wrapper not having a focused child item-content-wrapper
88
+ - item-content-wrapper is not focused itself
89
+
90
+ Note that using box-shadow both for divider and focus styling complicates the selectors
91
+ as we for instance have to exclude the focus states when adding the divider.
92
+ */
93
+ .sapphire-list__item-content-wrapper:not(.is-focus, :not(.js-focus):focus),
94
+ .sapphire-list__item:not(:has(.sapphire-list__item-content-wrapper)) {
95
+ box-shadow: inset 0px -1px 0px 0px var(--sapphire-list-color-border-item-default);
96
+ }
82
97
  .sapphire-list--without-last-divider
83
98
  .sapphire-list__item:last-child
84
- .sapphire-list__item-content-wrapper::after,
85
- .sapphire-list--without-last-divider .sapphire-list__item:last-child::after {
86
- height: 0;
99
+ .sapphire-list__item-content-wrapper:not(.is-focus):not(:focus),
100
+ .sapphire-list--without-last-divider .sapphire-list__item:last-child,
101
+ .sapphire-list__item:has(+ .sapphire-list__item
102
+ > .sapphire-list__item-content-wrapper.is-focus)
103
+ > .sapphire-list__item-content-wrapper:not(.is-focus, :not(.js-focus):focus),
104
+ .sapphire-list__item:has(+ .sapphire-list__item
105
+ > .sapphire-list__item-content-wrapper:not(.js-focus):focus)
106
+ > .sapphire-list__item-content-wrapper:not(.is-focus, :not(.js-focus):focus),
107
+ .sapphire-list__item:has(+ .sapphire-list__item
108
+ > .sapphire-list__item-content-wrapper.is-focus),
109
+ .sapphire-list__item:has(+ .sapphire-list__item
110
+ > .sapphire-list__item-content-wrapper:not(.js-focus):focus) {
111
+ box-shadow: none;
87
112
  }
88
113
 
89
114
  /*
90
115
  * Hover
91
116
  */
92
- .sapphire-list__item-content-wrapper.is-hover,
93
- .sapphire-list__item-content-wrapper:not(.js-hover):not([aria-disabled='true']):not(:disabled):hover {
117
+ .sapphire-list .sapphire-list__item-content-wrapper.is-hover,
118
+ .sapphire-list
119
+ .sapphire-list__item-content-wrapper:not(.js-hover):not([aria-disabled='true']):not(:disabled):hover {
94
120
  background-color: var(--sapphire-list-color-background-item-hover);
95
121
  }
96
122
 
@@ -109,7 +135,7 @@
109
135
  var(--sapphire-list-size-width-border-item-focus)
110
136
  var(--sapphire-list-color-border-item-focus);
111
137
  border: 0;
112
- background-color: var(--sapphire-list-color-background-item-focus);
138
+ border-radius: var(--sapphire-list-size-radius);
113
139
  }
114
140
 
115
141
  .sapphire-list__item-content-left {
@@ -2,7 +2,7 @@ declare const styles: {
2
2
  readonly "sapphire-list": string;
3
3
  readonly "sapphire-list__item": string;
4
4
  readonly "sapphire-list__item-content-wrapper": string;
5
- readonly "sapphire-list__item--content-wrapped": string;
5
+ readonly "sapphire-list--negative-margin-self": string;
6
6
  readonly "is-focus": string;
7
7
  readonly "js-focus": string;
8
8
  readonly "sapphire-list--without-last-divider": string;
@@ -82,24 +82,48 @@
82
82
  display: grid;
83
83
  grid-auto-flow: column;
84
84
  align-items: center;
85
- gap: var(--sapphire-listbox-size-spacing-inner-horizontal);
85
+ gap: var(--sapphire-listbox-size-spacing-inner-horizontal-l);
86
86
  /*
87
87
  * We want the left-side icon column to not take space if it's empty. The
88
88
  * right-side "checkmark" icon column should always take space even if the
89
89
  * checkmark isn't there. This is to make sure the listbox doesn't jump when
90
90
  * selecting items that add the checkmark in the last column.
91
91
  */
92
- grid-template-columns: auto 1fr var(--sapphire-listbox-size-width-icon);
93
- padding: var(--sapphire-listbox-size-spacing-inner-vertical)
94
- var(--sapphire-listbox-size-spacing-inner-horizontal);
92
+ grid-template-columns: auto 1fr var(--sapphire-listbox-size-width-icon-l);
93
+ padding: calc(
94
+ var(--sapphire-listbox-size-spacing-inner-vertical-l) -
95
+ var(--sapphire-listbox-size-spacing-outer-vertical)
96
+ )
97
+ var(--sapphire-listbox-size-spacing-inner-horizontal-l);
95
98
  border-radius: var(--sapphire-listbox-size-radius-item);
96
99
  transition-property: opacity, background-color, color;
97
100
  transition-duration: var(--sapphire-listbox-time-transition);
98
101
  transition-timing-function: ease-in-out;
102
+
103
+ min-height: var(--sapphire-listbox-size-height-min-height);
99
104
  }
100
105
 
101
- /* Icon content */
106
+ .sapphire-listbox--medium .sapphire-listbox__content {
107
+ gap: var(--sapphire-listbox-size-spacing-inner-horizontal-m);
108
+ grid-template-columns: auto 1fr var(--sapphire-listbox-size-width-icon-m);
109
+ padding: calc(
110
+ var(--sapphire-listbox-size-spacing-inner-vertical-m) -
111
+ var(--sapphire-listbox-size-spacing-outer-vertical)
112
+ )
113
+ var(--sapphire-listbox-size-spacing-inner-horizontal-m);
114
+ }
102
115
 
116
+ .sapphire-listbox--small .sapphire-listbox__content {
117
+ gap: var(--sapphire-listbox-size-spacing-inner-horizontal-s);
118
+ grid-template-columns: auto 1fr var(--sapphire-listbox-size-width-icon-s);
119
+ padding: calc(
120
+ var(--sapphire-listbox-size-spacing-inner-vertical-s) -
121
+ var(--sapphire-listbox-size-spacing-outer-vertical)
122
+ )
123
+ var(--sapphire-listbox-size-spacing-inner-horizontal-s);
124
+ }
125
+
126
+ /* Icon content */
103
127
  .sapphire-listbox__icon {
104
128
  line-height: 0;
105
129
  }
@@ -120,12 +144,27 @@
120
144
 
121
145
  .sapphire-listbox__primary-text {
122
146
  font-weight: var(--sapphire-listbox-font-weight-primary);
123
- font-size: var(--sapphire-listbox-size-font-primary);
147
+ font-size: var(--sapphire-listbox-size-font-primary-l);
124
148
  }
125
149
 
126
150
  .sapphire-listbox__secondary-text {
127
151
  font-weight: var(--sapphire-listbox-font-weight-secondary);
128
- font-size: var(--sapphire-listbox-size-font-secondary);
152
+ font-size: var(--sapphire-listbox-size-font-secondary-l);
153
+ }
154
+
155
+ .sapphire-listbox--medium .sapphire-listbox__primary-text {
156
+ font-size: var(--sapphire-listbox-size-font-primary-m);
157
+ }
158
+ .sapphire-listbox--small .sapphire-listbox__primary-text {
159
+ font-size: var(--sapphire-listbox-size-font-primary-s);
160
+ }
161
+
162
+ .sapphire-listbox--medium .sapphire-listbox__secondary-text {
163
+ font-size: var(--sapphire-listbox-size-font-secondary-m);
164
+ }
165
+
166
+ .sapphire-listbox--small .sapphire-listbox__secondary-text {
167
+ font-size: var(--sapphire-listbox-size-font-secondary-s);
129
168
  }
130
169
 
131
170
  .sapphire-listbox__item:not(.sapphire-listbox__item--danger):not(.sapphire-listbox__item--selected)
@@ -168,24 +207,25 @@
168
207
 
169
208
  /* Hover */
170
209
 
171
- .sapphire-listbox__item:not(.is-disabled).is-hover .sapphire-listbox__content,
172
- .sapphire-listbox__item:not(.is-disabled):not(.js-hover):hover
210
+ .sapphire-listbox__item:not(.is-disabled).is-hover:not(.is-active)
211
+ .sapphire-listbox__content,
212
+ .sapphire-listbox__item:not(.is-disabled):not(.js-hover):not(.is-active):hover
173
213
  .sapphire-listbox__content {
174
214
  color: var(--sapphire-listbox-color-content-normal-primary-hover);
175
215
  background-color: var(--sapphire-listbox-color-background-normal-hover);
176
216
  }
177
217
 
178
- .sapphire-listbox__item--danger:not(.is-disabled).is-hover
218
+ .sapphire-listbox__item--danger:not(.is-disabled):not(.is-active).is-hover
179
219
  .sapphire-listbox__content,
180
- .sapphire-listbox__item--danger:not(.is-disabled):not(.js-hover):hover
220
+ .sapphire-listbox__item--danger:not(.is-disabled):not(.js-hover):not(.is-active):hover
181
221
  .sapphire-listbox__content {
182
222
  color: var(--sapphire-listbox-color-content-danger-hover);
183
223
  background-color: var(--sapphire-listbox-color-background-danger-hover);
184
224
  }
185
225
 
186
- .sapphire-listbox__item--selected:not(.is-disabled).is-hover
226
+ .sapphire-listbox__item--selected:not(.is-disabled):not(.is-active).is-hover
187
227
  .sapphire-listbox__content,
188
- .sapphire-listbox__item--selected:not(.is-disabled):not(.js-hover):hover
228
+ .sapphire-listbox__item--selected:not(.is-disabled):not(.is-active):not(.js-hover):hover
189
229
  .sapphire-listbox__content {
190
230
  color: var(--sapphire-listbox-color-content-selected-hover);
191
231
  background-color: var(--sapphire-listbox-color-background-selected-hover);
@@ -4,6 +4,8 @@ declare const styles: {
4
4
  readonly "sapphire-listbox__item--danger": string;
5
5
  readonly "sapphire-listbox__item--selected": string;
6
6
  readonly "sapphire-listbox__content": string;
7
+ readonly "sapphire-listbox--medium": string;
8
+ readonly "sapphire-listbox--small": string;
7
9
  readonly "sapphire-listbox__icon": string;
8
10
  readonly "sapphire-listbox__text-container": string;
9
11
  readonly "sapphire-listbox__primary-text": string;
@@ -14,8 +16,8 @@ declare const styles: {
14
16
  readonly "is-focus": string;
15
17
  readonly "js-focus": string;
16
18
  readonly "is-hover": string;
17
- readonly "js-hover": string;
18
19
  readonly "is-active": string;
20
+ readonly "js-hover": string;
19
21
  };
20
22
  export = styles;
21
23
 
@@ -0,0 +1,126 @@
1
+ @keyframes pop-in {
2
+ 0% {
3
+ transform: scale(0) translate(50%, -50%);
4
+ opacity: 0;
5
+ }
6
+
7
+ 25% {
8
+ opacity: 0.1;
9
+ }
10
+
11
+ 100% {
12
+ transform: scale(1) translate(50%, -50%);
13
+ }
14
+ }
15
+
16
+ @keyframes pop-out {
17
+ 0% {
18
+ transform: scale(1) translate(50%, -50%);
19
+ }
20
+
21
+ 75% {
22
+ opacity: 0.1;
23
+ }
24
+
25
+ 100% {
26
+ transform: scale(0) translate(50%, -50%);
27
+ opacity: 0;
28
+ display: none;
29
+ }
30
+ }
31
+
32
+ .sapphire-notification-badge {
33
+ display: flex;
34
+ flex-direction: column;
35
+ justify-content: center;
36
+ align-items: center;
37
+ color: var(--sapphire-notification-badge-color-content-default);
38
+ font-family: var(--sapphire-notification-badge-font-name);
39
+ font-weight: var(--sapphire-notification-badge-font-weight);
40
+ box-sizing: border-box;
41
+ font-style: normal;
42
+ /* The below is meant to address a font rendering quirk in OSX where the text
43
+ * looks bolder than intended due to subpixel rendering. This quirk generally
44
+ * occurs for bold fonts on dark backgrounds but depending on the font, it
45
+ * can happen in other contexts as well.
46
+ *
47
+ * These do not do anything except in webkit browsers & firefox on OSX.
48
+ *
49
+ * For more details see:
50
+ * - https://azuredevops/Main/WCCJ/_git/sapphire/pullRequest/212710?path=%2Fpackages%2Fcss%2Fcomponents%2Fbutton%2Fbutton.module.css&discussionId=1507702&_a=files
51
+ * - https://usabilitypost.com/2012/11/05/stop-fixing-font-smoothing/
52
+ */
53
+ -webkit-font-smoothing: antialiased;
54
+ -moz-osx-font-smoothing: grayscale;
55
+ }
56
+
57
+ .sapphire-notification-badge--pop-in {
58
+ animation: pop-in var(--sapphire-notification-badge-time-transition)
59
+ cubic-bezier(0.55, -0.49, 0.39, 1.49);
60
+ }
61
+
62
+ .sapphire-notification-badge--pop-out {
63
+ animation: pop-out var(--sapphire-notification-badge-time-transition) forwards;
64
+ }
65
+
66
+ /* Sizes */
67
+ .sapphire-notification-badge--large {
68
+ height: var(--sapphire-notification-badge-size-height-l);
69
+ border-radius: var(--sapphire-notification-badge-size-radius-l);
70
+ padding: var(--sapphire-notification-badge-size-spacing-l-vertical)
71
+ var(--sapphire-notification-badge-size-spacing-l-horizontal);
72
+ font-size: var(--sapphire-notification-badge-size-font-primary);
73
+ }
74
+
75
+ .sapphire-notification-badge--medium {
76
+ height: var(--sapphire-notification-badge-size-height-m);
77
+ border-radius: var(--sapphire-notification-badge-size-radius-m);
78
+ padding: 0 var(--sapphire-notification-badge-size-spacing-m-horizontal);
79
+ font-size: var(--sapphire-notification-badge-size-font-secondary);
80
+ min-width: var(--sapphire-notification-badge-size-width-m);
81
+ box-sizing: border-box;
82
+ }
83
+
84
+ .sapphire-notification-badge--small {
85
+ min-width: var(--sapphire-notification-badge-size-width-s);
86
+ height: var(--sapphire-notification-badge-size-height-s);
87
+ border-radius: var(--sapphire-notification-badge-size-radius-s);
88
+ }
89
+
90
+ /* Variants */
91
+ .sapphire-notification-badge--primary {
92
+ background-color: var(--sapphire-notification-badge-color-background-primary);
93
+ }
94
+
95
+ .sapphire-notification-badge--secondary {
96
+ background-color: var(
97
+ --sapphire-notification-badge-color-background-secondary
98
+ );
99
+ }
100
+
101
+ /* Positioned */
102
+ .sapphire-notification-badge-container {
103
+ position: relative;
104
+ display: inline-block;
105
+ width: max-content;
106
+ }
107
+
108
+ /* Placement in container with circular or circular-looking content */
109
+ .sapphire-notification-badge-container .sapphire-notification-badge {
110
+ position: absolute;
111
+ top: 14%;
112
+ right: 14%;
113
+ transform: scale(1) translate(50%, -50%);
114
+ transform-origin: 100% 0;
115
+ pointer-events: none;
116
+ }
117
+
118
+ /* Placement in container with rectangular content */
119
+ .sapphire-notification-badge-container--rectangle .sapphire-notification-badge {
120
+ position: absolute;
121
+ top: 0;
122
+ right: 0;
123
+ transform: scale(1) translate(50%, -50%);
124
+ transform-origin: 100% 0;
125
+ pointer-events: none;
126
+ }
@@ -1,5 +1,7 @@
1
1
  .sapphire-panel {
2
2
  background-color: var(--sapphire-panel-color-background);
3
+ font-family: var(--sapphire-panel-font-name);
4
+ color: var(--sapphire-panel-color-content);
3
5
  box-sizing: border-box;
4
6
  overflow: hidden;
5
7
  max-width: 100%;
@@ -9,7 +11,19 @@
9
11
  outline: 0;
10
12
  transition: transform var(--sapphire-panel-time-transition) ease-in-out;
11
13
  transform: translateX(100%);
12
- width: var(--sapphire-panel-size-width-large);
14
+ width: var(--sapphire-panel-size-width-l);
15
+ }
16
+
17
+ /* Temporary alternative to `.sapphire-panel` if one wants to render the panel inline
18
+ * TODO: split panel into 2 independent blocks: panel layout and the panel content.
19
+ * UC-2757
20
+ */
21
+ .sapphire-panel-inline {
22
+ display: flex;
23
+ flex-direction: column;
24
+ background-color: var(--sapphire-panel-color-background);
25
+ font-family: var(--sapphire-panel-font-name);
26
+ color: var(--sapphire-panel-color-content);
13
27
  }
14
28
 
15
29
  .sapphire-panel--visible {
@@ -17,18 +31,16 @@
17
31
  }
18
32
 
19
33
  .sapphire-panel--small {
20
- width: var(--sapphire-panel-size-width-small);
34
+ width: var(--sapphire-panel-size-width-s);
21
35
  }
22
36
 
23
37
  .sapphire-panel-header {
24
- /** invisible line wrap attached only for visual consistency, once we get attached border-bottom with scrolled content **/
25
- border-bottom: var(--sapphire-panel-size-border) solid
26
- var(--sapphire-panel-color-separator-transparent);
27
38
  flex-shrink: 0;
28
39
  }
29
40
 
30
41
  .sapphire-panel-body {
31
42
  overflow-y: auto;
43
+ overflow-x: hidden;
32
44
  flex-grow: 1;
33
45
  padding: 0 var(--sapphire-panel-size-spacing-side);
34
46
  }
@@ -38,9 +50,6 @@
38
50
  }
39
51
 
40
52
  .sapphire-panel-footer {
41
- /** invisible line wrap attached only for visual consistency, once we get attached border-bottom with scrolled content **/
42
- border-top: var(--sapphire-panel-size-border) solid
43
- var(--sapphire-panel-color-separator-transparent);
44
53
  flex-shrink: 0;
45
54
  }
46
55
 
@@ -62,7 +71,6 @@
62
71
  .sapphire-panel-panel-header-subheading {
63
72
  color: var(--sapphire-panel-color-subheading);
64
73
  margin-top: var(--sapphire-panel-size-spacing-heading-gap);
65
- font-family: var(--sapphire-panel-font-name);
66
74
  }
67
75
 
68
76
  .sapphire-panel-panel-footer {
@@ -76,12 +84,22 @@
76
84
  margin-left: var(--sapphire-panel-size-spacing-close-icon-left);
77
85
  }
78
86
 
79
- .sapphire-panel--scrollable .sapphire-panel-footer {
87
+ .sapphire-panel-header + .sapphire-panel-body {
88
+ /** invisible line wrap attached only for visual consistency, once we get attached border-bottom with scrolled content **/
89
+ border-top: var(--sapphire-panel-size-border) solid transparent;
90
+ }
91
+
92
+ .sapphire-panel-header + .sapphire-panel-body.sapphire-panel-body--scrolled {
80
93
  border-top: var(--sapphire-panel-size-border) solid
81
- var(--sapphire-panel-color-separator-default);
94
+ var(--sapphire-panel-color-separator);
82
95
  }
83
96
 
84
- .sapphire-panel--scrolled .sapphire-panel-header {
85
- border-bottom: var(--sapphire-panel-size-border) solid
86
- var(--sapphire-panel-color-separator-default);
97
+ .sapphire-panel-body + .sapphire-panel-footer {
98
+ /** invisible line wrap attached only for visual consistency, once we get attached border-bottom with scrolled content **/
99
+ border-top: var(--sapphire-panel-size-border) solid transparent;
100
+ }
101
+
102
+ .sapphire-panel-body.sapphire-panel-body--scrollable + .sapphire-panel-footer {
103
+ border-top: var(--sapphire-panel-size-border) solid
104
+ var(--sapphire-panel-color-separator);
87
105
  }
@@ -1,5 +1,6 @@
1
1
  declare const styles: {
2
2
  readonly "sapphire-panel": string;
3
+ readonly "sapphire-panel-inline": string;
3
4
  readonly "sapphire-panel--visible": string;
4
5
  readonly "sapphire-panel--small": string;
5
6
  readonly "sapphire-panel-header": string;
@@ -11,8 +12,8 @@ declare const styles: {
11
12
  readonly "sapphire-panel-panel-header-subheading": string;
12
13
  readonly "sapphire-panel-panel-footer": string;
13
14
  readonly "sapphire-panel-panel-header-close-button-container": string;
14
- readonly "sapphire-panel--scrollable": string;
15
- readonly "sapphire-panel--scrolled": string;
15
+ readonly "sapphire-panel-body--scrolled": string;
16
+ readonly "sapphire-panel-body--scrollable": string;
16
17
  };
17
18
  export = styles;
18
19