@db-ux/core-components 4.4.2 → 4.5.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 (63) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/build/components/accordion/accordion.css +0 -14
  3. package/build/components/accordion-item/accordion-item.css +38 -29
  4. package/build/components/accordion-item/accordion-item.scss +1 -1
  5. package/build/components/badge/badge.css +75 -33
  6. package/build/components/badge/badge.scss +6 -1
  7. package/build/components/brand/brand.css +2 -18
  8. package/build/components/brand/brand.scss +2 -0
  9. package/build/components/button/button.css +245 -82
  10. package/build/components/button/button.scss +1 -105
  11. package/build/components/card/card.css +88 -30
  12. package/build/components/checkbox/checkbox.css +1 -22
  13. package/build/components/custom-button/custom-button.css +892 -0
  14. package/build/components/custom-button/custom-button.scss +78 -0
  15. package/build/components/custom-select/custom-select.css +19 -25
  16. package/build/components/custom-select-dropdown/custom-select-dropdown.css +1 -22
  17. package/build/components/custom-select-dropdown/custom-select-dropdown.scss +1 -0
  18. package/build/components/custom-select-form-field/custom-select-form-field.css +0 -22
  19. package/build/components/custom-select-list/custom-select-list.css +0 -22
  20. package/build/components/custom-select-list-item/custom-select-list-item.css +36 -28
  21. package/build/components/divider/divider.css +0 -10
  22. package/build/components/drawer/drawer.css +4 -14
  23. package/build/components/drawer/drawer.scss +4 -0
  24. package/build/components/header/header.css +0 -22
  25. package/build/components/icon/icon.css +0 -10
  26. package/build/components/infotext/infotext.css +4 -18
  27. package/build/components/infotext/infotext.scss +4 -0
  28. package/build/components/input/input.css +19 -25
  29. package/build/components/link/link.css +73 -34
  30. package/build/components/navigation/navigation.css +0 -22
  31. package/build/components/navigation-item/navigation-item.css +111 -43
  32. package/build/components/navigation-item/navigation-item.scss +2 -1
  33. package/build/components/notification/notification.css +37 -28
  34. package/build/components/page/page.css +0 -10
  35. package/build/components/popover/popover.css +26 -14
  36. package/build/components/radio/radio.css +0 -22
  37. package/build/components/section/section.css +0 -14
  38. package/build/components/select/select.css +19 -25
  39. package/build/components/stack/stack-web-component.css +0 -10
  40. package/build/components/stack/stack.css +0 -10
  41. package/build/components/switch/switch.css +1 -22
  42. package/build/components/tab-item/tab-item.css +52 -32
  43. package/build/components/tab-list/tab-list.css +0 -22
  44. package/build/components/tab-panel/tab-panel.css +0 -10
  45. package/build/components/tabs/tabs.css +2 -22
  46. package/build/components/tabs/tabs.scss +2 -0
  47. package/build/components/tag/tag.css +859 -150
  48. package/build/components/textarea/textarea.css +18 -25
  49. package/build/components/tooltip/tooltip.css +30 -23
  50. package/build/components/tooltip/tooltip.scss +12 -10
  51. package/build/styles/absolute.css +10 -10
  52. package/build/styles/index.css +9 -9
  53. package/build/styles/index.scss +1 -0
  54. package/build/styles/internal/_button-components.scss +140 -2
  55. package/build/styles/internal/_custom-elements.scss +1 -1
  56. package/build/styles/internal/_icon-passing.scss +23 -3
  57. package/build/styles/internal/_popover-component.scss +19 -9
  58. package/build/styles/internal/_tag-components.scss +1 -0
  59. package/build/styles/relative.css +10 -10
  60. package/build/styles/rollup.css +10 -10
  61. package/build/styles/wc-workarounds.css +1 -1
  62. package/build/styles/webpack.css +10 -10
  63. package/package.json +10 -9
@@ -35,3 +35,4 @@
35
35
  @forward "../components/custom-select-dropdown/custom-select-dropdown";
36
36
  @forward "../components/custom-select-list/custom-select-list";
37
37
  @forward "../components/custom-select-list-item/custom-select-list-item";
38
+ @forward "../components/custom-button/custom-button";
@@ -1,4 +1,9 @@
1
1
  @use "@db-ux/core-foundations/build/styles/helpers";
2
+ @use "@db-ux/core-foundations/build/styles/fonts";
3
+ @use "@db-ux/core-foundations/build/styles/variables";
4
+ @use "@db-ux/core-foundations/build/styles/colors";
5
+ @use "@db-ux/core-foundations/build/styles/icons";
6
+ @use "./component";
2
7
 
3
8
  %default-button {
4
9
  font-weight: 700;
@@ -6,9 +11,142 @@
6
11
  white-space: pre-line; // Multiple lines support
7
12
  justify-content: center;
8
13
  text-align: center;
14
+ align-items: center; // Centering the content vertically and horizontally
15
+ vertical-align: top; // Alignment of inline-flex buttons with different content
9
16
 
10
17
  @include helpers.display(inline-flex);
18
+ }
11
19
 
12
- align-items: center; // Centering the content vertically and horizontally
13
- vertical-align: top; // Alignment of inline-flex buttons with different content
20
+ %button-outlined-ghost-colors {
21
+ background-color: colors.$db-adaptive-bg-basic-transparent-full-default;
22
+
23
+ @include helpers.hover {
24
+ background-color: colors.$db-adaptive-bg-basic-transparent-full-hovered;
25
+ }
26
+
27
+ @include helpers.active {
28
+ background-color: colors.$db-adaptive-bg-basic-transparent-full-pressed;
29
+ }
30
+ }
31
+
32
+ %button-brand-colors {
33
+ background-color: colors.$db-brand-origin-default;
34
+ color: colors.$db-brand-on-origin-default;
35
+ border-color: colors.$db-brand-on-bg-basic-emphasis-70-default;
36
+
37
+ @include helpers.hover {
38
+ background-color: colors.$db-brand-origin-hovered;
39
+ border-color: colors.$db-brand-on-bg-basic-emphasis-70-default;
40
+ }
41
+
42
+ @include helpers.active {
43
+ background-color: colors.$db-brand-origin-pressed;
44
+ border-color: colors.$db-brand-on-bg-basic-emphasis-70-default;
45
+ }
46
+ }
47
+
48
+ @mixin set-basic-button($selector: "&") {
49
+ #{$selector} {
50
+ @extend %default-interactive-component;
51
+ @extend %default-button;
52
+ @extend %db-overwrite-font-size-md;
53
+
54
+ max-inline-size: 100%;
55
+ color: colors.$db-adaptive-on-bg-basic-emphasis-100-default;
56
+ min-block-size: variables.$db-sizing-md;
57
+ block-size: max-content;
58
+ inline-size: fit-content;
59
+ padding: variables.$db-spacing-fixed-2xs variables.$db-spacing-fixed-md;
60
+
61
+ // disable text-decoration if someone wants to use the button for an <a> tag
62
+ text-decoration: none;
63
+ }
64
+
65
+ // Square icon only buttons
66
+ &[data-no-text="true"] {
67
+ #{$selector} {
68
+ padding: 0;
69
+ aspect-ratio: 1;
70
+ inline-size: variables.$db-sizing-md;
71
+
72
+ @include icons.is-icon-text-replace;
73
+
74
+ &::before {
75
+ margin: auto;
76
+ }
77
+ }
78
+ }
79
+
80
+ &[data-wrap="false"] {
81
+ #{$selector} {
82
+ white-space: nowrap;
83
+ }
84
+ }
85
+
86
+ &[data-size="small"] {
87
+ #{$selector} {
88
+ @extend %db-overwrite-font-size-sm;
89
+
90
+ font-weight: 700;
91
+ min-block-size: variables.$db-sizing-sm;
92
+
93
+ &:not([data-no-text="true"]) {
94
+ // stylelint-disable-next-line db-ux/use-spacings
95
+ padding: 1px variables.$db-spacing-fixed-sm;
96
+
97
+ &::before {
98
+ margin-inline-end: variables.$db-spacing-fixed-2xs;
99
+ }
100
+ }
101
+
102
+ // Square icon only buttons
103
+ &[data-no-text="true"] {
104
+ inline-size: variables.$db-sizing-sm;
105
+ }
106
+ }
107
+ }
108
+
109
+ &[data-width="full"] {
110
+ #{$selector} {
111
+ inline-size: 100%;
112
+ }
113
+ }
114
+
115
+ @if $selector == "&" {
116
+ &[data-variant="brand"] {
117
+ #{$selector} {
118
+ @extend %button-brand-colors;
119
+ }
120
+ }
121
+ }
122
+
123
+ &[data-variant="filled"],
124
+ &[data-variant="ghost"] {
125
+ #{$selector} {
126
+ @extend %transparent-border;
127
+ }
128
+ }
129
+
130
+ &[data-variant="outlined"],
131
+ &:not([data-variant]),
132
+ &[data-variant=""],
133
+ &[data-variant="ghost"] {
134
+ #{$selector} {
135
+ @extend %button-outlined-ghost-colors;
136
+ }
137
+ }
138
+
139
+ &[data-variant="filled"] {
140
+ #{$selector} {
141
+ background-color: colors.$db-adaptive-bg-basic-transparent-semi-default;
142
+
143
+ @include helpers.hover {
144
+ background-color: colors.$db-adaptive-bg-basic-transparent-semi-hovered;
145
+ }
146
+
147
+ @include helpers.active {
148
+ background-color: colors.$db-adaptive-bg-basic-transparent-semi-pressed;
149
+ }
150
+ }
151
+ }
14
152
  }
@@ -1,6 +1,6 @@
1
1
  $custom-elements: //hygen-insert
2
2
 
3
- db-custom-select-list-item, db-custom-select-list,
3
+ db-custom-button, db-custom-select-list-item, db-custom-select-list,
4
4
  db-custom-select-dropdown, db-custom-select-form-field, db-custom-select,
5
5
  db-stack, db-switch, db-tab-panel, db-tabs, db-tab-list, db-tab-item,
6
6
  db-tab-bar, db-tooltip, db-popover, db-textarea, db-navigation,
@@ -1,7 +1,10 @@
1
1
  @use "@db-ux/core-foundations/build/styles/variables";
2
2
  @use "@db-ux/core-foundations/build/styles/icons";
3
3
 
4
+ $interactive-button-selectors: "label,button,a";
5
+
4
6
  @mixin icon-passing($inline-start: variables.$db-spacing-fixed-sm) {
7
+ &[data-icon-leading]:not([data-show-icon-leading="false"]),
5
8
  &[data-icon]:not([data-show-icon="false"]) {
6
9
  &::before {
7
10
  position: absolute;
@@ -11,9 +14,7 @@
11
14
  z-index: 1;
12
15
  }
13
16
 
14
- a,
15
- button,
16
- label {
17
+ #{$interactive-button-selectors} {
17
18
  --db-padding-inline-start: calc(
18
19
  #{$inline-start} + #{icons.$default-icon-margin-end} +
19
20
  var(--db-icon-font-size)
@@ -24,3 +25,22 @@
24
25
  }
25
26
  }
26
27
  }
28
+
29
+ @mixin icon-passing-trailing($inline-end: variables.$db-spacing-fixed-sm) {
30
+ &[data-icon-trailing]:not([data-show-icon-trailing="false"]) {
31
+ &::after {
32
+ position: absolute;
33
+ inset-block-start: calc(50% - 0.5em);
34
+ inset-inline-end: $inline-end;
35
+ pointer-events: none;
36
+ z-index: 1;
37
+ }
38
+
39
+ #{$interactive-button-selectors} {
40
+ padding-inline-end: calc(
41
+ #{$inline-end} + #{icons.$default-icon-margin-end} +
42
+ var(--db-icon-font-size)
43
+ );
44
+ }
45
+ }
46
+ }
@@ -17,6 +17,7 @@ $popover-gap-inset: calc(-1 * #{$popover-gap-size});
17
17
  --db-popover-center-x: -50%;
18
18
 
19
19
  inset-inline-start: 50%;
20
+ transform: translateX(var(--db-popover-center-x, 0));
20
21
  }
21
22
 
22
23
  &[data-corrected-placement="left"],
@@ -26,6 +27,7 @@ $popover-gap-inset: calc(-1 * #{$popover-gap-size});
26
27
  --db-popover-center-y: -50%;
27
28
 
28
29
  inset-block-start: 50%;
30
+ transform: translateY(var(--db-popover-center-y, 0));
29
31
  }
30
32
  }
31
33
 
@@ -44,7 +46,7 @@ $popover-gap-inset: calc(-1 * #{$popover-gap-size});
44
46
  &::before {
45
47
  inset-block-end: 100%;
46
48
  inset-inline: 0;
47
- block-size: var(--db-popover-distance);
49
+ block-size: $popover-gap-size;
48
50
  }
49
51
  }
50
52
 
@@ -53,7 +55,7 @@ $popover-gap-inset: calc(-1 * #{$popover-gap-size});
53
55
  &::before {
54
56
  inset-block-start: 100%;
55
57
  inset-inline: 0;
56
- block-size: var(--db-popover-distance);
58
+ block-size: $popover-gap-size;
57
59
  }
58
60
  }
59
61
 
@@ -62,7 +64,7 @@ $popover-gap-inset: calc(-1 * #{$popover-gap-size});
62
64
  &::before {
63
65
  inset-inline-end: 100%;
64
66
  inset-block: 0;
65
- inline-size: var(--db-popover-distance);
67
+ inline-size: $popover-gap-size;
66
68
  }
67
69
  }
68
70
 
@@ -71,7 +73,7 @@ $popover-gap-inset: calc(-1 * #{$popover-gap-size});
71
73
  &::before {
72
74
  inset-inline-start: 100%;
73
75
  inset-block: 0;
74
- inline-size: var(--db-popover-distance);
76
+ inline-size: $popover-gap-size;
75
77
  }
76
78
  }
77
79
 
@@ -155,14 +157,22 @@ $popover-gap-inset: calc(-1 * #{$popover-gap-size});
155
157
  }
156
158
  }
157
159
 
160
+ @mixin set-no-animation {
161
+ opacity: 1;
162
+ transform: translate(
163
+ var(--db-popover-center-x, 0),
164
+ var(--db-popover-center-y, 0)
165
+ );
166
+ }
167
+
158
168
  @mixin get-popover-show() {
159
169
  &:not([data-animation]),
160
170
  &[data-animation="false"] {
161
- opacity: 1;
162
- transform: translate(
163
- var(--db-popover-center-x, 0),
164
- var(--db-popover-center-y, 0)
165
- );
171
+ @include set-no-animation;
172
+ }
173
+
174
+ @media screen and (prefers-reduced-motion: reduce) {
175
+ @include set-no-animation;
166
176
  }
167
177
 
168
178
  @media screen and (prefers-reduced-motion: no-preference) {
@@ -121,6 +121,7 @@ $interactive-selectors: "label, button:not(.db-tab-remove-button), a";
121
121
  }
122
122
 
123
123
  @mixin get-tag-colors-interactive() {
124
+ @extend %set-interactive-weak;
124
125
  @include revert-db-components;
125
126
 
126
127
  // overwrite current variables for semantic color