@fkui/design 5.38.0 → 5.40.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fkui/design",
3
- "version": "5.38.0",
3
+ "version": "5.40.0",
4
4
  "description": "fkui design",
5
5
  "keywords": [
6
6
  "fkui",
@@ -35,8 +35,8 @@
35
35
  "runner": "jest-light-runner"
36
36
  },
37
37
  "devDependencies": {
38
- "@fkui/css-variables": "5.38.0",
39
- "@fkui/icon-lib-default": "5.38.0",
38
+ "@fkui/css-variables": "5.40.0",
39
+ "@fkui/icon-lib-default": "5.40.0",
40
40
  "autoprefixer": "10.4.20",
41
41
  "cssnano": "7.0.6",
42
42
  "flush-promises": "1.0.2",
@@ -44,7 +44,7 @@
44
44
  "jest-light-runner": "0.6.0",
45
45
  "jest-preset-stylelint": "7.1.0",
46
46
  "picocolors": "1.1.1",
47
- "postcss": "8.4.47",
47
+ "postcss": "8.4.49",
48
48
  "postcss-url": "10.1.3",
49
49
  "postcss-var-func-fallback": "3.0.0",
50
50
  "svgo": "3.3.2"
@@ -66,5 +66,5 @@
66
66
  "node": ">= 20",
67
67
  "npm": ">= 7"
68
68
  },
69
- "gitHead": "999e94ae55b1f2388a4be51d7542c2f9c2589c83"
69
+ "gitHead": "6cd48f3625440d79dd0bb851e9c3875f772ce451"
70
70
  }
@@ -43,6 +43,7 @@
43
43
  @import "loader/loader";
44
44
  @import "message-box/message-box";
45
45
  @import "navbar/navbar";
46
+ @import "navigation-menu/navigation-menu";
46
47
  @import "output-field/output-field";
47
48
  @import "progressbar/progressbar";
48
49
  @import "radio-button/all";
@@ -1,8 +1,10 @@
1
1
  @use "../../core/utils/functions" as *;
2
+ @use "variables" as *;
2
3
 
3
4
  $BADGE_SELECTOR: ".badge" !default;
4
5
 
5
- @mixin make-badge-variant($BADGE_SELECTOR, $background-color, $border-color: "") {
6
+ @mixin make-badge-variant($BADGE_SELECTOR, $text-color, $background-color, $border-color: "") {
7
+ color: $text-color;
6
8
  background-color: $background-color;
7
9
 
8
10
  @if $border-color != "" {
@@ -17,7 +19,6 @@ $BADGE_SELECTOR: ".badge" !default;
17
19
  border-style: solid;
18
20
  border-width: var(--f-border-width-small);
19
21
  box-sizing: border-box;
20
- color: var(--f-text-color-default);
21
22
  display: inline-block;
22
23
  font-size: var(--f-font-size-standard);
23
24
  line-height: densify(var(--f-line-height-large));
@@ -25,48 +26,62 @@ $BADGE_SELECTOR: ".badge" !default;
25
26
  padding: 0 0.5rem;
26
27
 
27
28
  &--default {
28
- @include make-badge-variant($BADGE_SELECTOR, var(--f-background-badge-default));
29
+ @include make-badge-variant($BADGE_SELECTOR, $badge-color-text-default, $badge-color-background-default);
29
30
  }
30
31
 
31
32
  &--default-inverted {
32
- @include make-badge-variant($BADGE_SELECTOR, var(--f-background-badge-default-inverted), var(--f-border-color-badge-default));
33
+ @include make-badge-variant(
34
+ $BADGE_SELECTOR,
35
+ $badge-color-text-default-inverted,
36
+ $badge-color-background-default-inverted,
37
+ $badge-color-border-default-inverted
38
+ );
33
39
  }
34
40
 
35
41
  &--warning {
36
- @include make-badge-variant($BADGE_SELECTOR, var(--f-background-badge-warning));
42
+ @include make-badge-variant($BADGE_SELECTOR, $badge-color-text-warning, $badge-color-background-warning);
37
43
  }
38
44
 
39
45
  &--warning-inverted {
40
- @include make-badge-variant($BADGE_SELECTOR, var(--f-background-badge-warning-inverted), var(--f-border-color-badge-warning));
46
+ @include make-badge-variant(
47
+ $BADGE_SELECTOR,
48
+ $badge-color-text-warning-inverted,
49
+ $badge-color-background-warning-inverted,
50
+ $badge-color-border-warning-inverted
51
+ );
41
52
  }
42
53
 
43
54
  &--error {
44
- color: var(--f-text-color-default-inverted);
45
-
46
- @include make-badge-variant($BADGE_SELECTOR, var(--f-background-badge-error));
55
+ @include make-badge-variant($BADGE_SELECTOR, $badge-color-text-error, $badge-color-background-error);
47
56
  }
48
57
 
49
58
  &--error-inverted {
50
- @include make-badge-variant($BADGE_SELECTOR, var(--f-background-badge-error-inverted), var(--f-border-color-badge-error));
59
+ @include make-badge-variant(
60
+ $BADGE_SELECTOR,
61
+ $badge-color-text-error-inverted,
62
+ $badge-color-background-error-inverted,
63
+ $badge-color-border-error-inverted
64
+ );
51
65
  }
52
66
 
53
67
  &--success {
54
- color: var(--f-text-color-default-inverted);
55
-
56
- @include make-badge-variant($BADGE_SELECTOR, var(--f-background-badge-success));
68
+ @include make-badge-variant($BADGE_SELECTOR, $badge-color-text-success, $badge-color-background-success);
57
69
  }
58
70
 
59
71
  &--success-inverted {
60
- @include make-badge-variant($BADGE_SELECTOR, var(--f-background-badge-success-inverted), var(--f-border-color-badge-success));
72
+ @include make-badge-variant(
73
+ $BADGE_SELECTOR,
74
+ $badge-color-text-success-inverted,
75
+ $badge-color-background-success-inverted,
76
+ $badge-color-border-success-inverted
77
+ );
61
78
  }
62
79
 
63
80
  &--info {
64
- color: var(--f-text-color-default-inverted);
65
-
66
- @include make-badge-variant($BADGE_SELECTOR, var(--f-background-badge-info));
81
+ @include make-badge-variant($BADGE_SELECTOR, $badge-color-text-info, $badge-color-background-info);
67
82
  }
68
83
 
69
84
  &--info-inverted {
70
- @include make-badge-variant($BADGE_SELECTOR, var(--f-background-badge-info-inverted), var(--f-border-color-badge-info));
85
+ @include make-badge-variant($BADGE_SELECTOR, $badge-color-text-info-inverted, $badge-color-background-info-inverted, $badge-color-border-info-inverted);
71
86
  }
72
87
  }
@@ -0,0 +1,25 @@
1
+ $badge-color-text-default: var(--fkds-color-text-primary);
2
+ $badge-color-background-default: var(--fkds-color-feedback-background-neutral-strong);
3
+ $badge-color-text-default-inverted: var(--fkds-color-text-primary);
4
+ $badge-color-background-default-inverted: var(--fkds-color-feedback-background-neutral);
5
+ $badge-color-border-default-inverted: var(--fkds-color-feedback-border-neutral);
6
+ $badge-color-text-warning: var(--fkds-color-text-primary);
7
+ $badge-color-background-warning: var(--fkds-color-feedback-background-warning-strong);
8
+ $badge-color-text-warning-inverted: var(--fkds-color-text-primary);
9
+ $badge-color-background-warning-inverted: var(--fkds-color-feedback-background-warning);
10
+ $badge-color-border-warning-inverted: var(--fkds-color-feedback-border-warning);
11
+ $badge-color-text-error: var(--fkds-color-text-inverted);
12
+ $badge-color-background-error: var(--fkds-color-feedback-background-negative-strong);
13
+ $badge-color-text-error-inverted: var(--fkds-color-text-primary);
14
+ $badge-color-background-error-inverted: var(--fkds-color-feedback-background-negative);
15
+ $badge-color-border-error-inverted: var(--fkds-color-feedback-border-negative);
16
+ $badge-color-text-success: var(--fkds-color-text-inverted);
17
+ $badge-color-background-success: var(--fkds-color-feedback-background-positive-strong);
18
+ $badge-color-text-success-inverted: var(--fkds-color-text-primary);
19
+ $badge-color-background-success-inverted: var(--fkds-color-feedback-background-positive);
20
+ $badge-color-border-success-inverted: var(--fkds-color-feedback-border-positive);
21
+ $badge-color-text-info: var(--fkds-color-text-inverted);
22
+ $badge-color-background-info: var(--fkds-color-feedback-background-info-strong);
23
+ $badge-color-text-info-inverted: var(--fkds-color-text-primary);
24
+ $badge-color-background-info-inverted: var(--fkds-color-feedback-background-info);
25
+ $badge-color-border-info-inverted: var(--fkds-color-feedback-border-info);
@@ -5,9 +5,8 @@
5
5
  $IMENU_SELECTOR: ".imenu" !default;
6
6
 
7
7
  #{$IMENU_SELECTOR} {
8
- background-color: var(--f-background-menu);
9
-
10
8
  &__list {
9
+ background-color: var(--f-background-menu);
11
10
  margin: 0;
12
11
  padding: 0;
13
12
 
@@ -27,6 +26,21 @@ $IMENU_SELECTOR: ".imenu" !default;
27
26
  }
28
27
  }
29
28
  }
29
+
30
+ &__popup-item {
31
+ position: relative;
32
+ list-style-type: none;
33
+ white-space: nowrap;
34
+
35
+ &__wrapper {
36
+ display: inline-flex;
37
+ position: absolute;
38
+ left: 0;
39
+ padding-top: size.$padding-100;
40
+ padding-left: size.$padding-075;
41
+ padding-right: size.$padding-075;
42
+ }
43
+ }
30
44
  }
31
45
 
32
46
  #{$IMENU_SELECTOR}--vertical {
@@ -69,6 +83,18 @@ $IMENU_SELECTOR: ".imenu" !default;
69
83
  &--highlight {
70
84
  color: var(--f-text-color-menu-horizontal-highlight);
71
85
  font-weight: var(--f-font-weight-medium);
86
+
87
+ .imenu__list__anchor-container {
88
+ border-bottom: 5px solid var(--f-border-color-menu-horizontal-highlight);
89
+ }
90
+
91
+ .imenu__list__anchor:hover {
92
+ font-weight: var(--f-font-weight-medium);
93
+ }
94
+ }
95
+
96
+ &--hidden {
97
+ visibility: hidden;
72
98
  }
73
99
  }
74
100
 
@@ -76,10 +102,6 @@ $IMENU_SELECTOR: ".imenu" !default;
76
102
  padding-bottom: size.$padding-050;
77
103
  border-bottom: 5px solid transparent;
78
104
 
79
- &--highlight {
80
- border-bottom: 5px solid var(--f-border-color-menu-horizontal-highlight);
81
- }
82
-
83
105
  &:hover {
84
106
  border-bottom: 5px solid var(--f-border-color-menu-horizontal-hover);
85
107
  }
@@ -88,19 +110,12 @@ $IMENU_SELECTOR: ".imenu" !default;
88
110
  &__anchor {
89
111
  display: inline-flex;
90
112
 
91
- &--highlight:hover {
92
- font-weight: var(--f-font-weight-medium);
93
- }
94
-
95
113
  &-icon-right {
96
114
  flex: 1 0 auto;
97
115
  padding-top: size.$padding-025;
116
+ margin-left: size.$padding-075;
98
117
  color: var(--f-border-color-menu-horizontal-highlight);
99
118
  }
100
-
101
- &-span {
102
- padding-right: size.$padding-075;
103
- }
104
119
  }
105
120
  }
106
121
  }
@@ -1,87 +1,173 @@
1
+ // stylelint-disable scss/comment-no-empty -- not sure how to write a longer comment that isn't a documentation block or compiled into output
2
+
3
+ @use "sass:math";
4
+ @use "sass:list";
1
5
  @use "../../core/size";
2
- @use "../icon/icon";
3
- @use "../../core/mixins/arrow-creator";
4
- @use "../../core/mixins/breakpoints";
5
6
  @use "../../core/utils/functions" as *;
7
+ @use "variables" as *;
8
+
9
+ $tooltip-border-radius: var(--f-border-radius-small);
10
+ $tooltip-arrow-width: 20;
11
+ $tooltip-arrow-height: 10;
12
+ $tooltip-border-width: 2;
13
+
14
+ // Width and height are the sides of the two right angle triangles:
15
+ //
16
+ // +---+---+ --+
17
+ // | /|\ | |
18
+ // | / | \ | h
19
+ // |/α | \| |
20
+ // +---+---+ --+
21
+ //
22
+ // | |
23
+ // +---w---+
24
+ //
25
+ // Note that the width is the combined width of both triangles
26
+
27
+ // First we calculate the angle α as `atan(w / 2h)`
28
+ $a: math.atan(math.div($tooltip-arrow-width, 2 * $tooltip-arrow-height));
29
+
30
+ // Given the angle α we can compute
31
+ $b: math.div($tooltip-border-width, math.sin(90deg - $a));
32
+ $c: math.div($tooltip-border-width, math.sin($a));
33
+
34
+ // prettier-ignore
35
+ $outer-border:
36
+ math.div($tooltip-arrow-width, 2),
37
+ $tooltip-arrow-height;
6
38
 
7
- $TOOLTIP_SELECTOR: ".tooltip" !default;
39
+ // prettier-ignore
40
+ $inner-border:
41
+ math.div(math.round((list.nth($outer-border, 1) - $b) * 10), 10),
42
+ math.div(math.round((list.nth($outer-border, 2) - $c) * 10), 10);
8
43
 
9
- #{$TOOLTIP_SELECTOR}-before {
10
- display: inline-block;
44
+ .tooltip {
45
+ display: none;
46
+ overflow: hidden;
47
+ width: 100%;
48
+ margin-bottom: densify(size.$margin-100);
11
49
 
12
- &__label {
50
+ &.expanded,
51
+ &.animating {
13
52
  display: block;
14
53
  }
15
- }
16
-
17
- #{$TOOLTIP_SELECTOR} {
18
- display: inline;
19
- margin-left: size.$margin-050;
20
54
 
21
55
  &__container {
22
- display: inline;
56
+ text-wrap: pretty;
57
+ margin-bottom: densify(size.$margin-025);
58
+
59
+ &:has(+ .tooltip.expanded),
60
+ &:has(+ .tooltip.animating) {
61
+ margin-bottom: 0;
62
+ }
63
+
64
+ .label {
65
+ display: inline;
66
+ width: max-content;
67
+ }
68
+
69
+ h1,
70
+ h2,
71
+ h3,
72
+ h4,
73
+ h5,
74
+ h6 {
75
+ display: inline;
76
+ width: max-content;
77
+ }
78
+
79
+ &:has(h1) .tooltip__button {
80
+ bottom: 0.2lh;
81
+ }
82
+
83
+ &:has(h2) .tooltip__button {
84
+ bottom: 0.1lh;
85
+ }
86
+
87
+ &:has(h3) .tooltip__button {
88
+ bottom: 0;
89
+ }
23
90
  }
24
91
 
25
92
  &__button {
93
+ display: inline-flex;
94
+ appearance: none;
26
95
  background: none;
27
96
  border: 0;
97
+ padding: 0;
28
98
  cursor: pointer;
29
- font-size: var(--f-font-size-large);
30
- padding: 0.125rem;
31
- transform: translateY(0.125rem);
32
- height: var(--f-icon-size-large);
33
- width: var(--f-icon-size-large);
34
-
35
- #{icon.$ICON_SELECTOR}-stack {
36
- height: 100%;
37
- width: 100%;
38
- }
99
+ margin-left: 0.25rem;
39
100
 
40
- #{icon.$ICON_SELECTOR} {
41
- height: 100%;
42
- width: 100%;
101
+ // shift it slightly downwards so it aligns better with text
102
+ position: relative;
103
+ bottom: -0.1lh;
104
+
105
+ // bug in icon?
106
+ .icon {
107
+ top: 0;
43
108
  left: 0;
44
109
  }
45
- }
46
110
 
47
- &__arrow {
48
- @include arrow-creator.arrow-creator(
49
- $background: var(--f-background-info),
50
- $border: var(--f-tooltip-border-color),
51
- $position: size.$margin-200,
52
- $size: size.$margin-075,
53
- $up: true,
54
- $width: var(--f-tooltip-border-width)
55
- );
56
- }
57
-
58
- /// Content wrapper is placed around everything, i.e.
59
- /// arrow, close button, header and body.
60
- &__content-wrapper {
61
- background-color: var(--f-background-info);
62
- border: var(--f-tooltip-border-width) solid var(--f-tooltip-border-color);
63
- border-radius: var(--f-border-radius-small);
64
- box-sizing: content-box;
65
- margin-top: size.$margin-075;
66
- margin-bottom: size.$margin-050;
67
- position: relative;
111
+ &,
112
+ .icon,
113
+ .icon-stack {
114
+ width: 1em;
115
+ height: 1em;
116
+ }
68
117
  }
69
118
 
70
- /// Content is placed around header and body.
71
- &__content {
72
- margin: densify(size.$margin-100) size.$margin-100 0 size.$margin-100;
119
+ &__body {
120
+ padding: 0 size.$padding-100;
73
121
  }
74
122
 
75
123
  &__header {
76
- align-items: flex-start;
77
- display: flex;
78
124
  font-size: var(--f-font-size-large);
79
125
  font-weight: var(--f-font-weight-bold);
80
126
  line-height: var(--f-line-height-medium);
127
+ padding: 0 size.$padding-100;
81
128
  margin-bottom: size.$margin-050;
82
129
  }
83
130
 
84
131
  .close-button {
85
132
  margin: var(--f-tooltip-close-button-margin);
86
133
  }
134
+
135
+ &__footer {
136
+ display: flex;
137
+ justify-content: flex-end;
138
+ }
139
+
140
+ &__bubble {
141
+ display: flex;
142
+ flex-direction: column;
143
+ position: relative;
144
+ margin-top: $tooltip-arrow-height * 1px;
145
+ margin-bottom: size.$margin-050;
146
+ border: 2px solid $tooltip-color-border;
147
+ border-radius: $tooltip-border-radius;
148
+ background-color: $tooltip-color-background;
149
+ padding-top: size.$padding-100;
150
+
151
+ &::before {
152
+ content: "";
153
+ position: absolute;
154
+ top: 0;
155
+ left: clamp(calc(#{$tooltip-arrow-width}px / 2), var(--f-tooltip-offset), calc(100% - #{$tooltip-arrow-width}px / 2));
156
+ border-style: solid;
157
+ border-width: 0 #{list.nth($outer-border, 1)}px #{list.nth($outer-border, 2)}px #{list.nth($outer-border, 1)}px;
158
+ border-color: transparent transparent $tooltip-color-border;
159
+ translate: -50% -100%;
160
+ }
161
+
162
+ &::after {
163
+ content: "";
164
+ position: absolute;
165
+ top: 0;
166
+ left: clamp(calc(#{$tooltip-arrow-width}px / 2), var(--f-tooltip-offset), calc(100% - #{$tooltip-arrow-width}px / 2));
167
+ border-style: solid;
168
+ border-width: 0 #{list.nth($inner-border, 1)}px #{list.nth($inner-border, 2)}px #{list.nth($inner-border, 1)}px;
169
+ border-color: transparent transparent $tooltip-color-background;
170
+ translate: -50% -100%;
171
+ }
172
+ }
87
173
  }
@@ -0,0 +1,2 @@
1
+ $tooltip-color-background: var(--fkds-color-feedback-background-info);
2
+ $tooltip-color-border: var(--fkds-color-feedback-border-info);
@@ -1,6 +1,5 @@
1
1
  /* stylelint-disable no-invalid-position-at-import-rule -- technical debt */
2
2
  @forward "IFlex/iflex";
3
- @import "IMenu/imenu";
4
3
  @import "IPopupMenu/ipopupmenu";
5
4
  @import "popup/popup";
6
5
  @import "animate-expand/animate-expand";