@koobiq/components 16.0.0-beta.2 → 16.0.0-beta.6

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 (191) hide show
  1. package/autocomplete/autocomplete.scss +0 -3
  2. package/button/_button-theme.scss +20 -9
  3. package/button/button.scss +5 -2
  4. package/core/common-behaviors/color.d.ts +1 -1
  5. package/core/forms/_forms-theme.scss +4 -4
  6. package/core/forms/_forms.scss +1 -3
  7. package/core/option/_option-theme.scss +39 -16
  8. package/core/option/action.scss +3 -4
  9. package/core/option/option.scss +6 -51
  10. package/core/styles/_koobiq-theme.scss +3 -0
  11. package/core/styles/common/_list.scss +123 -0
  12. package/core/styles/common/_select.scss +218 -0
  13. package/core/styles/theming/_components-theming.scss +414 -47
  14. package/dropdown/_dropdown-theme.scss +30 -37
  15. package/dropdown/dropdown-item.component.d.ts +1 -1
  16. package/dropdown/dropdown-item.scss +18 -40
  17. package/dropdown/dropdown.scss +16 -39
  18. package/esm2022/alert/alert.component.mjs +1 -1
  19. package/esm2022/autocomplete/autocomplete.component.mjs +2 -2
  20. package/esm2022/badge/badge.component.mjs +1 -1
  21. package/esm2022/button/button.component.mjs +2 -2
  22. package/esm2022/code-block/code-block.component.mjs +3 -3
  23. package/esm2022/core/common-behaviors/color.mjs +1 -1
  24. package/esm2022/core/option/action.mjs +5 -5
  25. package/esm2022/core/option/option.mjs +3 -3
  26. package/esm2022/core/overlay/overlay-position-map.mjs +2 -1
  27. package/esm2022/core/version.mjs +2 -2
  28. package/esm2022/dropdown/dropdown-item.component.mjs +3 -3
  29. package/esm2022/dropdown/dropdown.component.mjs +3 -3
  30. package/esm2022/file-upload/multiple-file-upload.component.mjs +2 -2
  31. package/esm2022/file-upload/single-file-upload.component.mjs +2 -2
  32. package/esm2022/form-field/form-field.mjs +6 -9
  33. package/esm2022/form-field/password-hint.mjs +13 -4
  34. package/esm2022/form-field/password-toggle.mjs +7 -3
  35. package/esm2022/icon/icon.component.mjs +3 -3
  36. package/esm2022/list/list-selection.component.mjs +20 -7
  37. package/esm2022/list/list.component.mjs +2 -2
  38. package/esm2022/list/list.module.mjs +8 -4
  39. package/esm2022/loader-overlay/loader-overlay.component.mjs +20 -19
  40. package/esm2022/modal/modal.component.mjs +8 -21
  41. package/esm2022/modal/modal.module.mjs +13 -7
  42. package/esm2022/navbar/navbar-item.component.mjs +13 -13
  43. package/esm2022/progress-spinner/progress-spinner.component.mjs +1 -1
  44. package/esm2022/radio/radio.component.mjs +3 -2
  45. package/esm2022/risk-level/index.mjs +2 -0
  46. package/esm2022/risk-level/koobiq-components-risk-level.mjs +5 -0
  47. package/esm2022/risk-level/public-api.mjs +3 -0
  48. package/esm2022/risk-level/risk-level.component.mjs +40 -0
  49. package/esm2022/risk-level/risk-level.module.mjs +28 -0
  50. package/esm2022/select/select.component.mjs +7 -8
  51. package/esm2022/sidepanel/sidepanel-container.component.mjs +3 -3
  52. package/esm2022/sidepanel/sidepanel-directives.mjs +7 -9
  53. package/esm2022/sidepanel/sidepanel.module.mjs +10 -4
  54. package/esm2022/tabs/paginated-tab-header.mjs +11 -2
  55. package/esm2022/tabs/tab-group.component.mjs +16 -21
  56. package/esm2022/tabs/tab-header.component.mjs +2 -2
  57. package/esm2022/tabs/tab-label-wrapper.directive.mjs +3 -3
  58. package/esm2022/tabs/tab-label.directive.mjs +3 -3
  59. package/esm2022/tabs/tab-nav-bar/tab-nav-bar.mjs +17 -7
  60. package/esm2022/tabs/tabs.module.mjs +2 -6
  61. package/esm2022/tags/tag-default-options.mjs +1 -1
  62. package/esm2022/tags/tag-input.mjs +10 -8
  63. package/esm2022/tags/tag-list.component.mjs +10 -6
  64. package/esm2022/tags/tag.component.mjs +5 -5
  65. package/esm2022/timezone/timezone-option.component.mjs +3 -3
  66. package/esm2022/timezone/timezone-select.component.mjs +2 -2
  67. package/esm2022/title/title.directive.mjs +2 -2
  68. package/esm2022/toast/toast-container.component.mjs +2 -2
  69. package/esm2022/toast/toast.component.mjs +25 -13
  70. package/esm2022/toast/toast.module.mjs +14 -5
  71. package/esm2022/toast/toast.type.mjs +6 -1
  72. package/esm2022/tree/padding.directive.mjs +4 -4
  73. package/esm2022/tree/toggle.mjs +5 -4
  74. package/esm2022/tree/tree-option.component.mjs +5 -7
  75. package/esm2022/tree/tree.module.mjs +13 -4
  76. package/esm2022/tree-select/tree-select.component.mjs +16 -10
  77. package/fesm2022/koobiq-components-alert.mjs.map +1 -1
  78. package/fesm2022/koobiq-components-autocomplete.mjs +2 -2
  79. package/fesm2022/koobiq-components-autocomplete.mjs.map +1 -1
  80. package/fesm2022/koobiq-components-badge.mjs.map +1 -1
  81. package/fesm2022/koobiq-components-button.mjs +2 -2
  82. package/fesm2022/koobiq-components-button.mjs.map +1 -1
  83. package/fesm2022/koobiq-components-code-block.mjs +2 -2
  84. package/fesm2022/koobiq-components-code-block.mjs.map +1 -1
  85. package/fesm2022/koobiq-components-core.mjs +8 -7
  86. package/fesm2022/koobiq-components-core.mjs.map +1 -1
  87. package/fesm2022/koobiq-components-dropdown.mjs +4 -4
  88. package/fesm2022/koobiq-components-dropdown.mjs.map +1 -1
  89. package/fesm2022/koobiq-components-file-upload.mjs +4 -4
  90. package/fesm2022/koobiq-components-file-upload.mjs.map +1 -1
  91. package/fesm2022/koobiq-components-form-field.mjs +22 -13
  92. package/fesm2022/koobiq-components-form-field.mjs.map +1 -1
  93. package/fesm2022/koobiq-components-icon.mjs +2 -2
  94. package/fesm2022/koobiq-components-icon.mjs.map +1 -1
  95. package/fesm2022/koobiq-components-list.mjs +28 -11
  96. package/fesm2022/koobiq-components-list.mjs.map +1 -1
  97. package/fesm2022/koobiq-components-loader-overlay.mjs +19 -18
  98. package/fesm2022/koobiq-components-loader-overlay.mjs.map +1 -1
  99. package/fesm2022/koobiq-components-modal.mjs +18 -25
  100. package/fesm2022/koobiq-components-modal.mjs.map +1 -1
  101. package/fesm2022/koobiq-components-navbar.mjs +12 -12
  102. package/fesm2022/koobiq-components-navbar.mjs.map +1 -1
  103. package/fesm2022/koobiq-components-progress-spinner.mjs.map +1 -1
  104. package/fesm2022/koobiq-components-radio.mjs +2 -1
  105. package/fesm2022/koobiq-components-radio.mjs.map +1 -1
  106. package/fesm2022/koobiq-components-risk-level.mjs +72 -0
  107. package/fesm2022/koobiq-components-risk-level.mjs.map +1 -0
  108. package/fesm2022/koobiq-components-select.mjs +6 -7
  109. package/fesm2022/koobiq-components-select.mjs.map +1 -1
  110. package/fesm2022/koobiq-components-sidepanel.mjs +18 -13
  111. package/fesm2022/koobiq-components-sidepanel.mjs.map +1 -1
  112. package/fesm2022/koobiq-components-tabs.mjs +48 -38
  113. package/fesm2022/koobiq-components-tabs.mjs.map +1 -1
  114. package/fesm2022/koobiq-components-tags.mjs +22 -16
  115. package/fesm2022/koobiq-components-tags.mjs.map +1 -1
  116. package/fesm2022/koobiq-components-timezone.mjs +4 -4
  117. package/fesm2022/koobiq-components-timezone.mjs.map +1 -1
  118. package/fesm2022/koobiq-components-title.mjs +1 -1
  119. package/fesm2022/koobiq-components-title.mjs.map +1 -1
  120. package/fesm2022/koobiq-components-toast.mjs +41 -15
  121. package/fesm2022/koobiq-components-toast.mjs.map +1 -1
  122. package/fesm2022/koobiq-components-tree-select.mjs +15 -9
  123. package/fesm2022/koobiq-components-tree-select.mjs.map +1 -1
  124. package/fesm2022/koobiq-components-tree.mjs +28 -20
  125. package/fesm2022/koobiq-components-tree.mjs.map +1 -1
  126. package/form-field/_form-field-theme.scss +2 -2
  127. package/form-field/form-field.d.ts +0 -1
  128. package/form-field/password-hint.d.ts +6 -3
  129. package/form-field/password-toggle.d.ts +1 -0
  130. package/input/_input-theme.scss +2 -1
  131. package/input/input.scss +3 -1
  132. package/link/_link-theme.scss +1 -3
  133. package/list/_list-theme.scss +35 -15
  134. package/list/list-selection.component.d.ts +5 -1
  135. package/list/list.module.d.ts +1 -1
  136. package/list/list.scss +3 -12
  137. package/loader-overlay/_loader-overlay-theme.scss +43 -11
  138. package/loader-overlay/loader-overlay.component.d.ts +6 -5
  139. package/loader-overlay/loader-overlay.scss +53 -22
  140. package/modal/_modal-confirm.scss +20 -28
  141. package/modal/_modal-theme.scss +5 -35
  142. package/modal/modal.component.d.ts +3 -6
  143. package/modal/modal.module.d.ts +2 -1
  144. package/modal/modal.scss +38 -35
  145. package/navbar/navbar-item.component.d.ts +3 -2
  146. package/package.json +9 -3
  147. package/prebuilt-themes/dark-theme.css +1 -1
  148. package/prebuilt-themes/light-theme.css +1 -1
  149. package/progress-spinner/progress-spinner.component.d.ts +2 -2
  150. package/risk-level/README.md +0 -0
  151. package/risk-level/_risk-level-theme.scss +88 -0
  152. package/risk-level/index.d.ts +1 -0
  153. package/risk-level/public-api.d.ts +2 -0
  154. package/risk-level/risk-level.component.d.ts +18 -0
  155. package/risk-level/risk-level.component.scss +26 -0
  156. package/risk-level/risk-level.module.d.ts +10 -0
  157. package/select/_select-theme.scss +8 -0
  158. package/select/select.scss +6 -190
  159. package/sidepanel/_sidepanel-theme.scss +6 -41
  160. package/sidepanel/sidepanel-directives.d.ts +0 -2
  161. package/sidepanel/sidepanel.scss +33 -35
  162. package/tabs/_tabs-common.scss +27 -146
  163. package/tabs/_tabs-theme.scss +81 -175
  164. package/tabs/paginated-tab-header.d.ts +1 -0
  165. package/tabs/tab-group.component.d.ts +5 -8
  166. package/tabs/tab-group.scss +10 -10
  167. package/tabs/tab-header.scss +2 -24
  168. package/tabs/tab-label-wrapper.directive.d.ts +1 -1
  169. package/tabs/tab-label.directive.d.ts +1 -1
  170. package/tabs/tab-nav-bar/tab-nav-bar.d.ts +3 -1
  171. package/tabs/tab-nav-bar/tab-nav-bar.scss +9 -16
  172. package/tabs/tabs.module.d.ts +1 -1
  173. package/tags/_tag-theme.scss +0 -24
  174. package/tags/tag-default-options.d.ts +4 -0
  175. package/tags/tag-list.component.d.ts +1 -0
  176. package/tags/tag-list.scss +20 -16
  177. package/tags/tag.component.d.ts +1 -1
  178. package/toast/_toast-theme.scss +21 -33
  179. package/toast/toast-container.component.scss +2 -1
  180. package/toast/toast.component.d.ts +4 -1
  181. package/toast/toast.component.scss +41 -34
  182. package/toast/toast.module.d.ts +1 -1
  183. package/toast/toast.type.d.ts +8 -5
  184. package/tree/_tree-theme.scss +46 -34
  185. package/tree/tree-option.component.d.ts +0 -1
  186. package/tree/tree-option.scss +34 -23
  187. package/tree/tree.module.d.ts +2 -1
  188. package/tree-select/_tree-select-theme.scss +9 -1
  189. package/tree-select/tree-select.component.d.ts +5 -3
  190. package/tree-select/tree-select.scss +5 -194
  191. package/list/_list-base.scss +0 -54
@@ -6,9 +6,6 @@
6
6
 
7
7
  $tokens: meta.module-variables(tokens) !default;
8
8
 
9
- .kbq-autocomplete-trigger {
10
- text-overflow: ellipsis;
11
- }
12
9
 
13
10
  .kbq-autocomplete-panel {
14
11
  visibility: hidden;
@@ -44,12 +44,14 @@
44
44
  }
45
45
  }
46
46
 
47
- @mixin kbq-outline-button($params) {
47
+ @mixin kbq-outline-button($params, $include-icons: true) {
48
48
  border-color: map.get($params, border);
49
49
  color: map.get($params, foreground);
50
50
  background: map.get($params, background);
51
51
 
52
- @include _icon(map.get($params, left-icon), map.get($params, right-icon));
52
+ @if $include-icons {
53
+ @include _icon(map.get($params, left-icon), map.get($params, right-icon));
54
+ }
53
55
 
54
56
  &:hover:not([disabled]),
55
57
  &.kbq-hover:not([disabled]) {
@@ -130,13 +132,6 @@
130
132
 
131
133
  @include kbq-outline-button($outline-theme-fade-on);
132
134
  }
133
-
134
- &.kbq-contrast-fade {
135
- $outline-contrast-fade-on: map.get(map.get($button, outline), contrast-fade-on);
136
-
137
- @include kbq-outline-button($outline-contrast-fade-on);
138
-
139
- }
140
135
  }
141
136
 
142
137
  &.kbq-button_transparent {
@@ -161,6 +156,22 @@
161
156
  }
162
157
  }
163
158
  }
159
+
160
+ .kbq-button_outline {
161
+ $outline-contrast-fade-on: map.get(map.get($button, outline), contrast-fade-on);
162
+
163
+ &.kbq-button {
164
+ &.kbq-contrast-fade {
165
+ @include kbq-outline-button($outline-contrast-fade-on);
166
+ }
167
+ }
168
+
169
+ &.kbq-button-icon {
170
+ &.kbq-contrast-fade {
171
+ @include kbq-outline-button($outline-contrast-fade-on, $include-icons: false);
172
+ }
173
+ }
174
+ }
164
175
  }
165
176
 
166
177
  @mixin kbq-button-typography($config) {
@@ -11,13 +11,16 @@ $tokens: meta.module-variables(tokens) !default;
11
11
  .kbq-button {
12
12
  @extend %kbq-button-base;
13
13
 
14
+ // base padding + compensation (4px) - border-width (2px)
14
15
  padding-left: calc(
15
16
  var(--kbq-button-size-horizontal-padding, map.get($tokens, button-size-horizontal-padding)) +
16
- 4px
17
+ 4px -
18
+ var(--kbq-button-size-border-width, map.get($tokens, button-size-border-width))
17
19
  );
18
20
  padding-right: calc(
19
21
  var(--kbq-button-size-horizontal-padding, map.get($tokens, button-size-horizontal-padding)) +
20
- 4px
22
+ 4px -
23
+ var(--kbq-button-size-border-width, map.get($tokens, button-size-border-width))
21
24
  );
22
25
 
23
26
  &.kbq-button-icon_left {
@@ -1,7 +1,7 @@
1
1
  import { ElementRef } from '@angular/core';
2
2
  import { AbstractConstructor, Constructor } from './constructor';
3
3
  export interface CanColor {
4
- color: KbqComponentColors | ThemePalette;
4
+ color: KbqComponentColors | ThemePalette | string;
5
5
  }
6
6
  /** @docs-private */
7
7
  export type CanColorCtor = Constructor<CanColor> & AbstractConstructor<CanColor>;
@@ -25,10 +25,10 @@
25
25
  $tokens: map.get($config, tokens);
26
26
 
27
27
  .kbq-form__label {
28
- @include kbq-typography-level-to-styles($config, map.get($tokens, forms-font-default-label));
28
+ @include kbq-typography-level-to-styles($config, map.get($tokens, forms-font-label));
29
29
  }
30
30
 
31
- .kbq-form__legend {
32
- @include kbq-typography-level-to-styles($config, map.get($tokens, forms-font-default-legend));
33
- }
31
+ //.kbq-form__legend {
32
+ // @include kbq-typography-level-to-styles($config, map.get($tokens, forms-font-default-legend));
33
+ //}
34
34
  }
@@ -20,10 +20,8 @@
20
20
  .kbq-form-horizontal {
21
21
  $config: kbq-typography-config($tokens);
22
22
 
23
- $line-height: kbq-line-height($config, body);
24
-
23
+ $line-height: kbq-line-height($config, map.get($tokens, forms-font-label));
25
24
  $form-field-size-height: map.get($tokens, form-field-size-height);
26
-
27
25
  $label-padding-top: calc(($form-field-size-height - $line-height) / 2);
28
26
 
29
27
  & .kbq-form-row_margin {
@@ -4,33 +4,52 @@
4
4
  @use '../styles/typography/typography-utils' as *;
5
5
 
6
6
 
7
- @mixin kbq-option-theme($theme) {
8
- $foreground: map.get($theme, foreground);
9
- $background: map.get($theme, background);
7
+ @mixin kbq-option($state) {
8
+ background: map.get($state, container-background);
9
+
10
+ .kbq-option-text {
11
+ color: map.get($state, text);
12
+ }
13
+
14
+ .kbq-icon {
15
+ color: map.get($state, icon);
16
+ }
10
17
 
11
- $primary: map.get($theme, theme);
18
+ .kbq-option-action .kbq-icon {
19
+ color: map.get($state, icon-button);
20
+ }
21
+
22
+ .kbq-option-caption {
23
+ color: map.get($state, caption);
24
+ }
25
+ }
26
+
27
+ @mixin kbq-option-theme($theme) {
28
+ $list-item: map.get(map.get($theme, components), list-item);
12
29
 
13
30
  .kbq-option {
14
- color: map.get($foreground, text);
31
+ @include kbq-option(map.get($list-item, default));
15
32
 
16
- &:hover:not(.kbq-disabled) {
17
- .kbq-option-overlay {
18
- background: map.get($background, overlay-hover);
19
- }
33
+ &:hover:not(.kbq-disabled):not([disabled]) {
34
+ @include kbq-option(map.get($list-item, hover));
20
35
  }
21
36
 
37
+ &.kbq-focused,
22
38
  &.kbq-active {
23
- border-color: map.get(map.get($theme, states), focused-color);
39
+ border-color: map.get(map.get($list-item, focused), focus-outline);
24
40
  }
25
41
 
26
42
  &.kbq-selected {
27
- background: map.get(map.get($theme, states), selected-color);
28
- }
43
+ @include kbq-option(map.get($list-item, selected));
29
44
 
30
- &.kbq-disabled {
31
- background: transparent;
45
+ &:hover:not(.kbq-disabled):not([disabled]) {
46
+ @include kbq-option(map.get($list-item, selected-hover));
47
+ }
48
+ }
32
49
 
33
- color: map.get($foreground, text-disabled);
50
+ &.kbq-disabled,
51
+ &[disabled] {
52
+ @include kbq-option(map.get($list-item, disabled));
34
53
  }
35
54
  }
36
55
  }
@@ -39,6 +58,10 @@
39
58
  $tokens: map.get($config, tokens);
40
59
 
41
60
  .kbq-option {
42
- @include kbq-typography-level-to-styles($config, map.get($tokens, option-font-default));
61
+ @include kbq-typography-level-to-styles($config, map.get($tokens, list-font-text));
62
+ }
63
+
64
+ .kbq-list-option-caption {
65
+ @include kbq-typography-level-to-styles($config, map.get($tokens, list-font-caption));
43
66
  }
44
67
  }
@@ -1,5 +1,5 @@
1
1
  .kbq-option-action {
2
- box-sizing: unset;
2
+ box-sizing: border-box;
3
3
 
4
4
  position: relative;
5
5
 
@@ -10,9 +10,8 @@
10
10
 
11
11
  margin-right: -2px;
12
12
 
13
- //width 28px for total width 32px (left border + right border);
14
- width: 28px;
15
- height: 100%;
13
+ width: 24px;
14
+ height: 24px;
16
15
 
17
16
  cursor: pointer;
18
17
 
@@ -1,62 +1,17 @@
1
1
  @use 'sass:meta';
2
2
  @use 'sass:map';
3
3
 
4
- @use '../styles/tokens';
4
+ @use '../styles/common';
5
5
 
6
6
 
7
- $tokens: meta.module-variables(tokens) !default;
8
-
9
7
  .kbq-option {
10
- display: flex;
11
- flex-direction: row;
12
- align-items: center;
13
-
14
- box-sizing: border-box;
15
-
16
- position: relative;
17
-
18
- max-width: 100%;
19
-
20
- height: var(--kbq-option-size-height, map.get($tokens, option-size-height));
21
-
22
- border: var(--kbq-option-size-border-width, map.get($tokens, option-size-border-width)) solid transparent;
23
-
24
- cursor: pointer;
25
-
26
- outline: none;
27
-
28
- padding-left: var(--kbq-option-size-horizontal-padding, map.get($tokens, option-size-horizontal-padding));
29
- padding-right: var(--kbq-option-size-horizontal-padding, map.get($tokens, option-size-horizontal-padding));
30
-
31
- -webkit-tap-highlight-color: transparent;
32
-
33
- &.kbq-disabled {
34
- cursor: default;
35
- }
36
-
37
- & .kbq-pseudo-checkbox {
38
- margin-right: 8px;
39
- }
40
-
41
- & .kbq-option-overlay {
42
- position: absolute;
43
-
44
- top: calc(-1 * var(--kbq-option-size-border-width, #{map.get($tokens, option-size-border-width)}));
45
- left: calc(-1 * var(--kbq-option-size-border-width, #{map.get($tokens, option-size-border-width)}));
46
- right: calc(-1 * var(--kbq-option-size-border-width, #{map.get($tokens, option-size-border-width)}));
47
- bottom: calc(-1 * var(--kbq-option-size-border-width, #{map.get($tokens, option-size-border-width)}));
48
-
49
- pointer-events: none;
50
- border-radius: inherit;
51
- }
8
+ @include common.kbq-list-item-base();
52
9
  }
53
10
 
54
11
  .kbq-option-text {
55
- display: inline-block;
56
- flex-grow: 1;
12
+ @include common.kbq-list-text();
57
13
 
58
- overflow: hidden;
59
-
60
- white-space: nowrap;
61
- text-overflow: ellipsis;
14
+ &:not(.kbq-disabled):not([disabled]) {
15
+ cursor: pointer;
16
+ }
62
17
  }
@@ -30,6 +30,7 @@
30
30
  @use '../../progress-bar/progress-bar-theme' as *;
31
31
  @use '../../progress-spinner/progress-spinner-theme' as *;
32
32
  @use '../../radio/radio-theme' as *;
33
+ @use '../../risk-level/risk-level-theme' as *;
33
34
  @use '../../select/select-theme' as *;
34
35
  @use '../../sidepanel/sidepanel-theme' as *;
35
36
  @use '../../splitter/splitter-theme' as *;
@@ -86,6 +87,7 @@
86
87
  @include kbq-progress-spinner-theme($theme);
87
88
  @include kbq-pseudo-checkbox-theme($theme);
88
89
  @include kbq-radio-theme($theme);
90
+ @include kbq-risk-level-theme($theme);
89
91
  @include kbq-scrollbar-theme($theme);
90
92
  @include kbq-select-theme($theme);
91
93
  @include kbq-sidepanel-theme($theme);
@@ -136,6 +138,7 @@
136
138
  @include kbq-progress-bar-typography($config);
137
139
  @include kbq-progress-spinner-typography($config);
138
140
  @include kbq-radio-typography($config);
141
+ @include kbq-risk-level-typography($config);
139
142
  @include kbq-select-typography($config);
140
143
  @include kbq-sidepanel-typography($config);
141
144
  @include kbq-tabs-typography($config);
@@ -1,3 +1,9 @@
1
+ @use 'sass:meta';
2
+ @use 'sass:map';
3
+
4
+ @use '../tokens';
5
+
6
+
1
7
  // This mixin will ensure that lines that overflow the container will hide the overflow and
2
8
  // truncate neatly with an ellipsis.
3
9
  @mixin kbq-truncate-line() {
@@ -41,6 +47,123 @@
41
47
  user-select: none; /* Non-prefixed version, currently supported by Chrome and Opera */
42
48
  }
43
49
 
50
+ @mixin kbq-list-text() {
51
+ $tokens: meta.module-variables(tokens) !default;
52
+
53
+ @include kbq-line-wrapper-base();
54
+ display: inline-block;
55
+
56
+ @include kbq-truncate-line();
57
+
58
+ padding-top: var(--kbq-list-size-text-padding-vertical, map.get($tokens, list-size-text-padding-vertical));
59
+ padding-bottom: var(--kbq-list-size-text-padding-vertical, map.get($tokens, list-size-text-padding-vertical));
60
+ }
61
+
62
+ // This mixin provides all list-item styles, changing font size and height based on whether the list is in dense mode.
63
+ @mixin kbq-list-item-base() {
64
+ $tokens: meta.module-variables(tokens) !default;
65
+
66
+ $outline-width: map.get($tokens, list-size-container-focus-outline-width);
67
+
68
+ $padding-vertical: map.get($tokens, list-size-container-padding-vertical);
69
+ $padding-left: map.get($tokens, list-size-container-padding-left);
70
+ $padding-right: map.get($tokens, list-size-container-padding-right);
71
+
72
+ position: relative;
73
+
74
+ display: flex;
75
+ flex-direction: row;
76
+ align-items: center;
77
+
78
+ box-sizing: border-box;
79
+
80
+ outline: none;
81
+ -webkit-tap-highlight-color: transparent;
82
+
83
+ min-height: 32px;
84
+
85
+ gap: var(
86
+ --kbq-list-size-container-content-gap-horizontal, map.get($tokens, list-size-container-content-gap-horizontal)
87
+ );
88
+
89
+ border-width: var(--kbq-list-size-container-focus-outline-width, $outline-width);
90
+ border-style: solid;
91
+ border-color: transparent;
92
+
93
+ padding:
94
+ calc(
95
+ var(--kbq-list-size-container-padding-vertical, $padding-vertical) -
96
+ var(--kbq-list-size-container-focus-outline-width, $outline-width)
97
+ )
98
+ calc(
99
+ var(--kbq-list-size-container-padding-right, $padding-right) -
100
+ var(--kbq-list-size-container-focus-outline-width, $outline-width)
101
+ )
102
+ calc(
103
+ var(--kbq-list-size-container-padding-vertical, $padding-vertical) -
104
+ var(--kbq-list-size-container-focus-outline-width, $outline-width)
105
+ )
106
+ calc(
107
+ var(--kbq-list-size-container-padding-left, $padding-left) -
108
+ var(--kbq-list-size-container-focus-outline-width, $outline-width)
109
+ );
110
+
111
+ .kbq-list-text {
112
+ @include kbq-list-text();
113
+ }
114
+
115
+ .kbq-list-option-caption {
116
+ padding-top: var(
117
+ --kbq-list-size-container-content-gap-vertical,
118
+ map.get($tokens, list-size-container-content-gap-vertical)
119
+ );
120
+ }
121
+ }
122
+
123
+ @mixin kbq-list-header-base() {
124
+ $tokens: meta.module-variables(tokens) !default;
125
+
126
+ display: flex;
127
+ flex-direction: row;
128
+ align-items: center;
129
+
130
+ box-sizing: border-box;
131
+
132
+ min-height: 32px;
133
+
134
+ padding:
135
+ var(--kbq-list-size-header-padding-top, map.get($tokens, list-size-header-padding-top))
136
+ var(--kbq-list-size-header-padding-horizontal, map.get($tokens, list-size-header-padding-horizontal))
137
+ var(--kbq-list-size-header-padding-bottom, map.get($tokens, list-size-header-padding-bottom))
138
+ var(--kbq-list-size-header-padding-horizontal, map.get($tokens, list-size-header-padding-horizontal));
139
+
140
+ .kbq-list-text {
141
+ @include kbq-list-text();
142
+ }
143
+ }
144
+
145
+ @mixin kbq-list-subheading-base() {
146
+ $tokens: meta.module-variables(tokens) !default;
147
+
148
+ display: flex;
149
+ flex-direction: row;
150
+ align-items: center;
151
+
152
+ box-sizing: border-box;
153
+
154
+ min-height: 32px;
155
+
156
+ padding:
157
+ var(--kbq-list-size-subheading-padding-top, map.get($tokens, list-size-subheading-padding-top))
158
+ var(--kbq-list-size-subheading-padding-horizontal, map.get($tokens, list-size-subheading-padding-horizontal))
159
+ var(--kbq-list-size-subheading-padding-bottom, map.get($tokens, list-size-subheading-padding-bottom))
160
+ var(--kbq-list-size-subheading-padding-horizontal, map.get($tokens, list-size-subheading-padding-horizontal));
161
+
162
+ .kbq-list-text {
163
+ @include kbq-list-text();
164
+ }
165
+ }
166
+
44
167
  .kbq-no-select {
45
168
  @include kbq-no-select;
46
169
  }
@@ -0,0 +1,218 @@
1
+ @use 'sass:meta';
2
+ @use 'sass:map';
3
+
4
+ @use '../common/vendor-prefixes';
5
+ @use '../tokens';
6
+
7
+
8
+ $tokens: meta.module-variables(tokens) !default;
9
+
10
+
11
+ %kbq-select-base {
12
+ box-sizing: border-box;
13
+
14
+ display: inline-block;
15
+
16
+ width: 100%;
17
+
18
+ outline: none;
19
+
20
+ .kbq-select__matcher {
21
+ display: flex;
22
+ align-items: center;
23
+
24
+ width: 100%;
25
+
26
+ overflow: hidden;
27
+
28
+ white-space: nowrap;
29
+
30
+ // todo
31
+ & > span {
32
+ flex: 1;
33
+ overflow: hidden;
34
+ }
35
+ }
36
+
37
+ $border-width: map.get($tokens, form-field-size-border-width);
38
+
39
+ .kbq-select__trigger {
40
+ display: flex;
41
+ box-sizing: border-box;
42
+ position: relative;
43
+
44
+ cursor: pointer;
45
+
46
+ height: calc(
47
+ var(--kbq-form-field-size-height, map.get($tokens, form-field-size-height)) -
48
+ (var(--kbq-form-field-size-border-width, map.get($tokens, form-field-size-border-width)) * 2)
49
+ );
50
+
51
+ & .kbq-select__matcher {
52
+ $padding-vertical: map.get($tokens, select-size-single-padding-vertical);
53
+
54
+ padding:
55
+ calc(
56
+ var(--kbq-select-size-single-padding-vertical, #{$padding-vertical}) -
57
+ var(--kbq-form-field-size-border-width, #{$border-width})
58
+ )
59
+ calc(
60
+ var(--kbq-select-size-single-padding-right, #{map.get($tokens, select-size-single-padding-right)}) -
61
+ var(--kbq-form-field-size-border-width, #{$border-width})
62
+ )
63
+ calc(
64
+ var(--kbq-select-size-single-padding-vertical, #{$padding-vertical}) -
65
+ var(--kbq-form-field-size-border-width, #{$border-width})
66
+ )
67
+ calc(
68
+ var(--kbq-select-size-single-padding-left, #{map.get($tokens, select-size-single-padding-left)}) -
69
+ var(--kbq-form-field-size-border-width, #{$border-width})
70
+ );
71
+ }
72
+ }
73
+
74
+ .kbq-select__trigger.kbq-select__trigger_multiple:not(.kbq-select__trigger_empty) {
75
+ & .kbq-select__matcher {
76
+ padding-left: calc(
77
+ var(--kbq-select-size-multiple-padding-left, #{map.get($tokens, select-size-multiple-padding-left)}) -
78
+ var(--kbq-form-field-size-border-width, #{$border-width})
79
+ );
80
+
81
+ .kbq-select__match-container {
82
+ display: flex;
83
+ }
84
+ }
85
+ }
86
+
87
+ .kbq-select__match-container {
88
+ width: 100%;
89
+
90
+ text-overflow: ellipsis;
91
+ overflow: hidden;
92
+
93
+ & .kbq-select__match-hidden-text {
94
+ flex: 0 0 70px;
95
+ align-self: center;
96
+ padding-left: 4px;
97
+ padding-right: var(
98
+ --kbq-select-size-multiple-content-gap, #{map.get($tokens, select-size-multiple-content-gap)}
99
+ );
100
+
101
+ text-align: right;
102
+ }
103
+ }
104
+
105
+ .kbq-select__match-list {
106
+ display: flex;
107
+ flex-wrap: wrap;
108
+ overflow: hidden;
109
+
110
+ $padding-vertical: map.get($tokens, select-size-multiple-padding-vertical);
111
+
112
+ max-height: calc(
113
+ var(--kbq-form-field-size-height, map.get($tokens, form-field-size-height)) -
114
+ (var(--kbq-select-size-multiple-padding-vertical, $padding-vertical) * 2)
115
+ );
116
+
117
+ height: calc(
118
+ var(--kbq-form-field-size-height, map.get($tokens, form-field-size-height)) -
119
+ (var(--kbq-select-size-multiple-padding-vertical, $padding-vertical) * 2)
120
+ );
121
+
122
+ gap: var(
123
+ --kbq-select-size-multiple-content-gap, #{map.get($tokens, select-size-multiple-content-gap)}
124
+ );
125
+
126
+ margin-right: var(
127
+ --kbq-select-size-multiple-content-gap, #{map.get($tokens, select-size-multiple-content-gap)}
128
+ );
129
+ }
130
+
131
+ .kbq-select__arrow-wrapper {
132
+ display: flex;
133
+ align-self: center;
134
+
135
+ padding: 4px;
136
+
137
+ // When used in a box or standard appearance form-field the arrow should be shifted up 50%.
138
+ .kbq-form-field-appearance-fill &,
139
+ .kbq-form-field-appearance-standard & {
140
+ transform: translateY(-50%);
141
+ }
142
+
143
+ // When used in a outline form-field the arrow should be shifted up 25%.
144
+ .kbq-form-field-appearance-outline & {
145
+ transform: translateY(-25%);
146
+ }
147
+ }
148
+
149
+ .kbq-select__no-options-message {
150
+ display: flex;
151
+ flex-direction: row;
152
+ align-items: center;
153
+ box-sizing: border-box;
154
+
155
+ position: relative;
156
+
157
+ max-width: 100%;
158
+ height: var(--kbq-option-size-height, map.get($tokens, option-size-height));
159
+
160
+ cursor: default;
161
+ outline: none;
162
+
163
+ padding-left: var(--kbq-option-size-horizontal-padding, map.get($tokens, option-size-horizontal-padding));
164
+ padding-right: var(--kbq-option-size-horizontal-padding, map.get($tokens, option-size-horizontal-padding));
165
+
166
+ border: var(--kbq-option-size-border-width, map.get($tokens, option-size-border-width)) solid transparent;
167
+ }
168
+
169
+ .kbq-select__search-container {
170
+ border-bottom: {
171
+ width: 1px;
172
+ style: solid;
173
+ }
174
+ }
175
+
176
+ &.kbq-disabled {
177
+ & .kbq-select__trigger {
178
+ @include vendor-prefixes.user-select(none);
179
+
180
+ cursor: default;
181
+ }
182
+ }
183
+ }
184
+
185
+ %kbq-select-panel {
186
+ min-width: 100%; // prevents some animation twitching and test inconsistencies in IE11
187
+
188
+ overflow: hidden;
189
+
190
+ border-radius: var(
191
+ --kbq-select-panel-size-border-radius, map.get($tokens, select-panel-size-border-radius)
192
+ );
193
+
194
+ // Override optgroup and option to scale based on font-size of the trigger.
195
+ .kbq-optgroup-label,
196
+ .kbq-option {
197
+ font-size: inherit;
198
+ }
199
+ }
200
+
201
+ %kbq-select-content {
202
+ max-height: var(--kbq-select-panel-size-max-height, map.get($tokens, select-panel-size-max-height));
203
+ padding: 4px 0;
204
+ overflow: hidden auto;
205
+ }
206
+
207
+ %kbq-select-footer {
208
+ display: flex;
209
+ align-items: center;
210
+ box-sizing: border-box;
211
+
212
+ min-height: 40px;
213
+
214
+ border-top-width: 1px;
215
+ border-top-style: solid;
216
+
217
+ padding: map.get($tokens, size-xxs) map.get($tokens, size-m);
218
+ }