@koobiq/components 20.3.1 → 20.4.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/accordion/accordion.scss +4 -1
- package/accordion/index.d.ts +36 -12
- package/alert/index.d.ts +8 -0
- package/breadcrumbs/index.d.ts +2 -0
- package/button-toggle/button-toggle-tokens.scss +14 -0
- package/button-toggle/button-toggle.scss +75 -3
- package/core/index.d.ts +146 -5
- package/core/option/_option-theme.scss +3 -0
- package/core/styles/common/_select.scss +98 -3
- package/core/styles/typography/_typography.scss +8 -0
- package/ellipsis-center/ellipsis-center.scss +31 -0
- package/ellipsis-center/index.d.ts +35 -2
- package/fesm2022/koobiq-components-accordion.mjs +143 -44
- package/fesm2022/koobiq-components-accordion.mjs.map +1 -1
- package/fesm2022/koobiq-components-alert.mjs +17 -1
- package/fesm2022/koobiq-components-alert.mjs.map +1 -1
- package/fesm2022/koobiq-components-autocomplete.mjs +2 -2
- package/fesm2022/koobiq-components-autocomplete.mjs.map +1 -1
- package/fesm2022/koobiq-components-breadcrumbs.mjs +8 -3
- package/fesm2022/koobiq-components-breadcrumbs.mjs.map +1 -1
- package/fesm2022/koobiq-components-button-toggle.mjs +2 -2
- package/fesm2022/koobiq-components-button-toggle.mjs.map +1 -1
- package/fesm2022/koobiq-components-code-block.mjs +10 -5
- package/fesm2022/koobiq-components-code-block.mjs.map +1 -1
- package/fesm2022/koobiq-components-core.mjs +214 -11
- package/fesm2022/koobiq-components-core.mjs.map +1 -1
- package/fesm2022/koobiq-components-dropdown.mjs +2 -2
- package/fesm2022/koobiq-components-dropdown.mjs.map +1 -1
- package/fesm2022/koobiq-components-ellipsis-center.mjs +101 -34
- package/fesm2022/koobiq-components-ellipsis-center.mjs.map +1 -1
- package/fesm2022/koobiq-components-file-upload.mjs +7 -7
- package/fesm2022/koobiq-components-file-upload.mjs.map +1 -1
- package/fesm2022/koobiq-components-filter-bar.mjs +94 -55
- package/fesm2022/koobiq-components-filter-bar.mjs.map +1 -1
- package/fesm2022/koobiq-components-inline-edit.mjs +177 -14
- package/fesm2022/koobiq-components-inline-edit.mjs.map +1 -1
- package/fesm2022/koobiq-components-list.mjs +359 -44
- package/fesm2022/koobiq-components-list.mjs.map +1 -1
- package/fesm2022/koobiq-components-markdown.mjs +6 -2
- package/fesm2022/koobiq-components-markdown.mjs.map +1 -1
- package/fesm2022/koobiq-components-modal.mjs +48 -7
- package/fesm2022/koobiq-components-modal.mjs.map +1 -1
- package/fesm2022/koobiq-components-select.mjs +117 -12
- package/fesm2022/koobiq-components-select.mjs.map +1 -1
- package/fesm2022/koobiq-components-sidebar.mjs +5 -1
- package/fesm2022/koobiq-components-sidebar.mjs.map +1 -1
- package/fesm2022/koobiq-components-sidepanel.mjs +25 -6
- package/fesm2022/koobiq-components-sidepanel.mjs.map +1 -1
- package/fesm2022/koobiq-components-tabs.mjs +460 -197
- package/fesm2022/koobiq-components-tabs.mjs.map +1 -1
- package/fesm2022/koobiq-components-time-range.mjs +388 -74
- package/fesm2022/koobiq-components-time-range.mjs.map +1 -1
- package/fesm2022/koobiq-components-timezone.mjs +4 -4
- package/fesm2022/koobiq-components-timezone.mjs.map +1 -1
- package/fesm2022/koobiq-components-title.mjs +15 -3
- package/fesm2022/koobiq-components-title.mjs.map +1 -1
- package/fesm2022/koobiq-components-tree-select.mjs +2 -2
- package/fesm2022/koobiq-components-tree-select.mjs.map +1 -1
- package/fesm2022/koobiq-components-tree.mjs +14 -4
- package/fesm2022/koobiq-components-tree.mjs.map +1 -1
- package/file-upload/file-upload.scss +0 -18
- package/file-upload/index.d.ts +1 -1
- package/file-upload/multiple-file-upload.component.scss +15 -3
- package/file-upload/single-file-upload.component.scss +10 -2
- package/filter-bar/filter-bar-tokens.scss +2 -1
- package/filter-bar/index.d.ts +41 -4
- package/filter-bar/pipes/base-pipe.scss +24 -6
- package/filter-bar/pipes/pipe-input.scss +3 -1
- package/inline-edit/index.d.ts +87 -8
- package/inline-edit/inline-edit-tokens.scss +1 -0
- package/inline-edit/inline-edit.scss +26 -0
- package/link/_link-theme.scss +50 -15
- package/list/index.d.ts +126 -5
- package/markdown/index.d.ts +2 -0
- package/modal/index.d.ts +16 -7
- package/navbar/_navbar-item_horizontal.scss +5 -0
- package/package.json +3 -3
- package/prebuilt-themes/dark-theme.css +1 -1
- package/prebuilt-themes/light-theme.css +1 -1
- package/prebuilt-themes/theme.css +1 -1
- package/schematics/migrations/alert-signals/index.js +4 -1
- package/schematics/migrations/autocomplete-panel-width-auto/index.js +3 -34
- package/schematics/migrations/empty-state-size-attr/index.js +3 -34
- package/schematics/migrations/filter-bar-signals/index.js +4 -1
- package/schematics/migrations/loader-overlay-size-attr/index.js +3 -34
- package/schematics/migrations/v20-upgrade/index.js +4 -1
- package/schematics/ng-add/index.js +1 -1
- package/schematics/utils/angular-parsing.js +11 -12
- package/schematics/utils/package-config.js +5 -4
- package/schematics/utils/typescript.js +24 -0
- package/select/_select-theme.scss +9 -1
- package/select/index.d.ts +18 -2
- package/select/select.scss +13 -0
- package/sidebar/index.d.ts +1 -0
- package/sidepanel/index.d.ts +9 -0
- package/tabs/_tabs-common.scss +111 -2
- package/tabs/index.d.ts +79 -48
- package/tabs/tab-group.scss +0 -4
- package/tabs/tab-header.scss +0 -2
- package/tabs/tab-nav-bar.scss +3 -11
- package/time-range/index.d.ts +140 -5
- package/time-range/time-range.scss +16 -1
- package/title/index.d.ts +10 -2
- package/tree/index.d.ts +1 -0
package/accordion/accordion.scss
CHANGED
|
@@ -45,13 +45,16 @@
|
|
|
45
45
|
overflow: hidden;
|
|
46
46
|
|
|
47
47
|
& > .kbq-accordion-content__body {
|
|
48
|
+
// Nested contents must not inherit this host's pinned height.
|
|
49
|
+
--kbq-accordion-content-height: initial;
|
|
50
|
+
|
|
48
51
|
margin: unset;
|
|
49
52
|
padding: var(--kbq-accordion-size-item-content-padding);
|
|
50
53
|
}
|
|
51
54
|
|
|
52
55
|
&[data-state='open'] {
|
|
53
56
|
transition: height 300ms ease-out;
|
|
54
|
-
height: var(--kbq-accordion-content-height);
|
|
57
|
+
height: var(--kbq-accordion-content-height, auto);
|
|
55
58
|
}
|
|
56
59
|
|
|
57
60
|
&[data-state='closed'] {
|
package/accordion/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import { InjectionToken, AfterViewInit, OnDestroy, ChangeDetectorRef, AfterContentInit, ElementRef, Signal } from '@angular/core';
|
|
2
|
+
import { InjectionToken, AfterViewInit, OnDestroy, OnInit, ChangeDetectorRef, AfterContentInit, ElementRef, Signal, DoCheck } from '@angular/core';
|
|
3
3
|
import { FocusMonitor, FocusKeyManager } from '@angular/cdk/a11y';
|
|
4
4
|
import { Directionality } from '@angular/cdk/bidi';
|
|
5
5
|
import { UniqueSelectionDispatcher } from '@angular/cdk/collections';
|
|
@@ -86,6 +86,7 @@ declare class KbqAccordionTriggerDirective {
|
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
declare class KbqAccordionTrigger implements AfterViewInit, OnDestroy {
|
|
89
|
+
private readonly platform;
|
|
89
90
|
/** @docs-private */
|
|
90
91
|
protected readonly nativeElement: HTMLElement;
|
|
91
92
|
/** @docs-private */
|
|
@@ -108,7 +109,7 @@ declare class KbqAccordionTrigger implements AfterViewInit, OnDestroy {
|
|
|
108
109
|
}
|
|
109
110
|
|
|
110
111
|
type KbqAccordionItemState = 'open' | 'closed';
|
|
111
|
-
declare class KbqAccordionItem implements OnDestroy {
|
|
112
|
+
declare class KbqAccordionItem implements OnInit, OnDestroy {
|
|
112
113
|
/**
|
|
113
114
|
* The accordion this item belongs to — always the nearest one, because it is injected.
|
|
114
115
|
* The accordion reads it back to tell its own items apart from a nested accordion's.
|
|
@@ -131,10 +132,14 @@ declare class KbqAccordionItem implements OnDestroy {
|
|
|
131
132
|
get dataState(): KbqAccordionItemState;
|
|
132
133
|
/** The layout orientation inherited from the parent accordion. @docs-private */
|
|
133
134
|
get orientation(): KbqAccordionOrientation;
|
|
134
|
-
/**
|
|
135
|
+
/**
|
|
136
|
+
* Whether the AccordionItem is expanded. When the accordion initializes, its controlled `value`, the saved
|
|
137
|
+
* state and `defaultValue` take precedence over it.
|
|
138
|
+
*/
|
|
135
139
|
get expanded(): boolean;
|
|
136
140
|
set expanded(expanded: boolean);
|
|
137
141
|
private _expanded;
|
|
142
|
+
private initialized;
|
|
138
143
|
/**
|
|
139
144
|
* The item's own `value` input. Must stay `public`: a `protected` input cannot be bound from a
|
|
140
145
|
* consumer template (TS2445 under full AOT template type-checking).
|
|
@@ -162,6 +167,7 @@ declare class KbqAccordionItem implements OnDestroy {
|
|
|
162
167
|
/** Subscription to openAll/closeAll events. */
|
|
163
168
|
private openCloseAllSubscription;
|
|
164
169
|
constructor();
|
|
170
|
+
ngOnInit(): void;
|
|
165
171
|
ngOnDestroy(): void;
|
|
166
172
|
/** Moves focus to the item's trigger. */
|
|
167
173
|
focus(): void;
|
|
@@ -177,6 +183,8 @@ declare class KbqAccordionItem implements OnDestroy {
|
|
|
177
183
|
disableAnimation(): void;
|
|
178
184
|
/** Restores the open/close animation of the item's content and chevron. @docs-private */
|
|
179
185
|
enableAnimation(): void;
|
|
186
|
+
/** Emits the expanded state and propagates it to the siblings, the content and the saved state. */
|
|
187
|
+
private reportExpanded;
|
|
180
188
|
private subscribeToOpenCloseAllActions;
|
|
181
189
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<KbqAccordionItem, never>;
|
|
182
190
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<KbqAccordionItem, "kbq-accordion-item, [kbq-accordion-item]", never, { "expanded": { "alias": "expanded"; "required": false; }; "valueInput": { "alias": "value"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "closed": "closed"; "opened": "opened"; "expandedChange": "expandedChange"; }, ["trigger", "triggerComponent", "content"], never, true, never>;
|
|
@@ -279,6 +287,11 @@ declare class KbqAccordion implements OnDestroy, AfterViewInit, AfterContentInit
|
|
|
279
287
|
private readonly defaultValueArray;
|
|
280
288
|
private _id;
|
|
281
289
|
private state;
|
|
290
|
+
/**
|
|
291
|
+
* Whether the saved state has been read. An item reports a static `[expanded]` from its own `ngOnInit`,
|
|
292
|
+
* which runs before `ngAfterContentInit`, and writing then would replace the saved state before it is read.
|
|
293
|
+
*/
|
|
294
|
+
private stateRestored;
|
|
282
295
|
constructor();
|
|
283
296
|
ngAfterContentInit(): void;
|
|
284
297
|
ngAfterViewInit(): void;
|
|
@@ -312,8 +325,10 @@ declare class KbqAccordion implements OnDestroy, AfterViewInit, AfterContentInit
|
|
|
312
325
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<KbqAccordion, "kbq-accordion, [kbq-accordion]", never, { "useStateSaving": { "alias": "useStateSaving"; "required": false; "isSignal": true; }; "stateSavingKey": { "alias": "stateSavingKey"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "level": { "alias": "level"; "required": false; "isSignal": true; }; "defaultValue": { "alias": "defaultValue"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "collapsible": { "alias": "collapsible"; "required": false; "isSignal": true; }; "valueInput": { "alias": "value"; "required": false; "isSignal": true; }; }, { "valueChange": "valueChange"; }, ["allItems"], ["*"], true, never>;
|
|
313
326
|
}
|
|
314
327
|
|
|
315
|
-
declare class KbqAccordionContentDirective implements AfterViewInit {
|
|
328
|
+
declare class KbqAccordionContentDirective implements OnInit, DoCheck, AfterViewInit {
|
|
316
329
|
private readonly renderer;
|
|
330
|
+
private readonly platform;
|
|
331
|
+
private readonly injector;
|
|
317
332
|
/** @docs-private */
|
|
318
333
|
protected readonly nativeElement: HTMLElement;
|
|
319
334
|
/** @docs-private */
|
|
@@ -325,23 +340,32 @@ declare class KbqAccordionContentDirective implements AfterViewInit {
|
|
|
325
340
|
/** @docs-private */
|
|
326
341
|
protected readonly hidden: _angular_core.WritableSignal<boolean>;
|
|
327
342
|
private savedTransition;
|
|
328
|
-
|
|
329
|
-
/** Whether the first browser render has happened, i.e. whether the content can be measured. */
|
|
343
|
+
/** Whether the first browser render has happened; until then a toggle only sets the initial state. */
|
|
330
344
|
private rendered;
|
|
331
345
|
constructor();
|
|
346
|
+
ngOnInit(): void;
|
|
347
|
+
ngDoCheck(): void;
|
|
332
348
|
ngAfterViewInit(): void;
|
|
333
349
|
toggle(): void;
|
|
350
|
+
/** @docs-private */
|
|
351
|
+
protected onTransitionEnd(event: TransitionEvent): void;
|
|
334
352
|
disableAnimation(): void;
|
|
335
353
|
enableAnimation(): void;
|
|
336
354
|
/**
|
|
337
|
-
*
|
|
338
|
-
*
|
|
355
|
+
* Pins the height the transition runs between: the natural height of the content when expanding,
|
|
356
|
+
* the current one when collapsing. The pin is released once the transition ends, so expanded
|
|
357
|
+
* content keeps `height: auto` and follows its own size — its container can be laid out later
|
|
358
|
+
* (a content panel, an overlay) or resized, and nested items can toggle.
|
|
339
359
|
*
|
|
340
|
-
* `scrollHeight`
|
|
341
|
-
* and collapsed to `height: 0` while closed, so its box reports `0`, whereas `scrollHeight`
|
|
342
|
-
* still reports the height of the content it clips.
|
|
360
|
+
* `scrollHeight` reports the natural height even while the `overflow: hidden` host is collapsed.
|
|
343
361
|
*/
|
|
344
|
-
private
|
|
362
|
+
private pinHeight;
|
|
363
|
+
/** Checks the pin once `data-state` has flipped. */
|
|
364
|
+
private settleHeight;
|
|
365
|
+
/** Whether a height transition runs on the host; `undefined` without the Web Animations API. */
|
|
366
|
+
private isHeightTransitionRunning;
|
|
367
|
+
private setHeight;
|
|
368
|
+
private releaseHeight;
|
|
345
369
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<KbqAccordionContentDirective, never>;
|
|
346
370
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<KbqAccordionContentDirective, "[kbqAccordionContent]", ["kbqAccordionContent"], {}, {}, never, never, true, never>;
|
|
347
371
|
}
|
package/alert/index.d.ts
CHANGED
|
@@ -42,6 +42,7 @@ declare class KbqAlertControl {
|
|
|
42
42
|
* technology announces it — see the component guide.
|
|
43
43
|
*/
|
|
44
44
|
declare class KbqAlert {
|
|
45
|
+
private readonly elementRef;
|
|
45
46
|
/** @docs-private */
|
|
46
47
|
protected readonly iconItem: _angular_core.Signal<KbqIconItem | undefined>;
|
|
47
48
|
/** @docs-private */
|
|
@@ -74,7 +75,14 @@ declare class KbqAlert {
|
|
|
74
75
|
protected readonly projectedIcon: _angular_core.Signal<KbqIcon | undefined>;
|
|
75
76
|
/** Last color this component auto-assigned to the icon; lets us correct color on change without ignoring consumer's color. */
|
|
76
77
|
private lastAutoColor;
|
|
78
|
+
/** Guards the dev-mode double-icon warning so it fires once per instance. */
|
|
79
|
+
private multipleIconsWarned;
|
|
77
80
|
constructor();
|
|
81
|
+
/**
|
|
82
|
+
* The icon slot projects `[kbq-icon]` and `[kbq-icon-item]` alike, and the two register under separate DI
|
|
83
|
+
* tokens, so projecting both renders two icons side by side while only the `KbqIcon` is auto-tinted.
|
|
84
|
+
*/
|
|
85
|
+
private warnOnMultipleProjectedIcons;
|
|
78
86
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<KbqAlert, never>;
|
|
79
87
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<KbqAlert, "kbq-alert", ["kbqAlert"], { "compact": { "alias": "compact"; "required": false; "isSignal": true; }; "alertStyle": { "alias": "alertStyle"; "required": false; "isSignal": true; }; "alertColor": { "alias": "alertColor"; "required": false; "isSignal": true; }; }, { "closed": "closed"; }, ["iconItem", "icon", "button", "title", "control", "closeButton"], ["[kbq-icon-item],[kbq-icon]", "[kbq-alert-title]", "*", "[kbq-alert-control]", "[kbq-alert-close-button]"], true, never>;
|
|
80
88
|
}
|
package/breadcrumbs/index.d.ts
CHANGED
|
@@ -133,9 +133,11 @@ declare class KbqBreadcrumbsSeparator {
|
|
|
133
133
|
* Directive to style and configure buttons used as breadcrumb items.
|
|
134
134
|
* - Inherits focus management behavior from `RdxRovingFocusItemDirective`.
|
|
135
135
|
* - Optionally injects `KbqButton` to customize its style for breadcrumb usage.
|
|
136
|
+
* - Sets `type="button"` on a `<button>` host, so a breadcrumb never submits a surrounding form.
|
|
136
137
|
*/
|
|
137
138
|
declare class KbqBreadcrumbButton implements OnInit {
|
|
138
139
|
private readonly button;
|
|
140
|
+
protected readonly element: HTMLElement;
|
|
139
141
|
ngOnInit(): void;
|
|
140
142
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<KbqBreadcrumbButton, never>;
|
|
141
143
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<KbqBreadcrumbButton, "[kbq-button][kbqBreadcrumb]", never, {}, {}, never, never, true, [{ directive: typeof RdxRovingFocusItemDirective; inputs: { "focusable": "focusable"; }; outputs: {}; }]>;
|
|
@@ -11,6 +11,20 @@
|
|
|
11
11
|
--kbq-button-toggle-size-item-padding-vertical: var(--kbq-size-3xs);
|
|
12
12
|
--kbq-button-toggle-size-item-content-gap-horizontal: var(--kbq-size-xxs);
|
|
13
13
|
--kbq-button-toggle-size-item-focus-outline-width: var(--kbq-size-3xs);
|
|
14
|
+
// How far an item's hit area reaches past the pill it paints. Measured from the inner button's
|
|
15
|
+
// border box, one item border inside the item's own — hence the border-width term in each. `-gap` is
|
|
16
|
+
// the half of the inter-item gap an item claims; the other two cover the group's padding. The
|
|
17
|
+
// pseudo-element they offset is in button-toggle.scss, next to the note on the two other places
|
|
18
|
+
// this repo extends a hit area the same way.
|
|
19
|
+
--kbq-button-toggle-size-item-hit-area-gap: calc(
|
|
20
|
+
var(--kbq-size-border-width) + var(--kbq-button-toggle-size-container-content-gap-horizontal) / 2
|
|
21
|
+
);
|
|
22
|
+
--kbq-button-toggle-size-item-hit-area-horizontal: calc(
|
|
23
|
+
var(--kbq-size-border-width) + var(--kbq-button-toggle-size-container-padding-horizontal)
|
|
24
|
+
);
|
|
25
|
+
--kbq-button-toggle-size-item-hit-area-vertical: calc(
|
|
26
|
+
var(--kbq-size-border-width) + var(--kbq-button-toggle-size-container-padding-vertical)
|
|
27
|
+
);
|
|
14
28
|
/* THEME TOKENS */
|
|
15
29
|
--kbq-button-toggle-container-background: var(--kbq-background-contrast-fade);
|
|
16
30
|
--kbq-button-toggle-item-default-background: var(--kbq-background-transparent);
|
|
@@ -17,17 +17,31 @@
|
|
|
17
17
|
|
|
18
18
|
.kbq-button-toggle {
|
|
19
19
|
display: flex;
|
|
20
|
-
overflow: hidden;
|
|
21
20
|
justify-content: flex-start;
|
|
22
21
|
align-items: center;
|
|
23
22
|
|
|
23
|
+
// Must not clip: the button's hit area below reaches outside this box. Not `overflow: clip` with
|
|
24
|
+
// an `overflow-clip-margin` — Chromium rejects math functions there, so the margin cannot follow
|
|
25
|
+
// the tokens the offsets come from and computes to `0px`, clipping the hit area away.
|
|
26
|
+
|
|
27
|
+
// What the item stops containing, and why nothing here takes it back: a toggle projects its
|
|
28
|
+
// content into the button's own `.kbq-button-text`, which keeps the `overflow: hidden` of
|
|
29
|
+
// `kbq-truncate-line()`, so content still cannot spill sideways past the button's content box.
|
|
30
|
+
// Content *taller* than the fixed item height no longer is — and cannot be re-clipped from
|
|
31
|
+
// inside the button, since the only boxes there with a definite height are the button itself,
|
|
32
|
+
// whose `::before` this exists for, and the label box, which would clip its own descenders.
|
|
33
|
+
overflow: visible;
|
|
34
|
+
|
|
35
|
+
// What that clip used to give for free: a flex item's automatic minimum size is zero only while
|
|
36
|
+
// its `overflow` is non-`visible`, and that is what lets the label truncate.
|
|
37
|
+
min-width: 0;
|
|
38
|
+
|
|
24
39
|
// Content-box on purpose, and load-bearing. `--kbq-button-toggle-size-item-height` is 22px,
|
|
25
40
|
// not the 24px of the design's `--kbq-size-xxl`: DS-3136 subtracted the border it added here
|
|
26
41
|
// from the token rather than from the rendered box, so the item only reaches its designed
|
|
27
42
|
// 24px while the border sits outside the declared height. A global `border-box` reset in a
|
|
28
43
|
// consuming application would pull the border back inside and leave the item 2px short —
|
|
29
|
-
// and the inner button, which is sized from the same token, would
|
|
30
|
-
// content box and be clipped by `overflow: hidden` above.
|
|
44
|
+
// and the inner button, which is sized from the same token, would then spill past it.
|
|
31
45
|
box-sizing: content-box;
|
|
32
46
|
|
|
33
47
|
height: var(--kbq-button-toggle-size-item-height);
|
|
@@ -57,6 +71,21 @@
|
|
|
57
71
|
button-toggle-size-item-focus-outline-width]
|
|
58
72
|
);
|
|
59
73
|
|
|
74
|
+
// Hit area over the gutters the group's `gap` and `padding` leave around the pill this button
|
|
75
|
+
// paints, so the highlight does not drop out between segments. On the button, not the item
|
|
76
|
+
// host, so pointer events resolve to it and the gutter is clickable too. `::before` because
|
|
77
|
+
// `::after` is the `.kbq-progress` shimmer. Offsets are per orientation, below.
|
|
78
|
+
|
|
79
|
+
// The third place this repo extends a hit area with a transparent pseudo-element, after
|
|
80
|
+
// `.kbq-navbar-item`'s `:before` (DS-2558) and `select.item-active-area()`. Neither is
|
|
81
|
+
// reusable here: the mixin claims a fixed strip on one side of a plain vertical list, with
|
|
82
|
+
// no gap to tile between two neighbours, no group padding at the ends, and no orientation
|
|
83
|
+
// to swap the axes for.
|
|
84
|
+
&:before {
|
|
85
|
+
content: '';
|
|
86
|
+
position: absolute;
|
|
87
|
+
}
|
|
88
|
+
|
|
60
89
|
& .kbq-button-wrapper {
|
|
61
90
|
width: 100%;
|
|
62
91
|
}
|
|
@@ -81,6 +110,16 @@
|
|
|
81
110
|
}
|
|
82
111
|
}
|
|
83
112
|
|
|
113
|
+
// Hit-area offsets, one orientation each — the vertical block below is this one with the axes
|
|
114
|
+
// swapped. The gap is split at its midline so two neighbours tile it rather than overlap, which would
|
|
115
|
+
// hand the whole gutter to whichever paints last; the outermost sides have no neighbour to share with
|
|
116
|
+
// and take the group's padding instead, leaving no point inside the group unclaimed.
|
|
117
|
+
|
|
118
|
+
// `:first-of-type`/`:last-of-type`, not `:first-child`/`:last-child`: the group is a bare directive
|
|
119
|
+
// with no template, so a consumer's own element — a divider, a leading icon — is rendered as a real
|
|
120
|
+
// child among the toggles and would take the positional match away from the toggle that actually sits
|
|
121
|
+
// at the edge, putting the dead zone back. The class only ever lands on a `kbq-button-toggle` element,
|
|
122
|
+
// so matching by type reads the toggles alone.
|
|
84
123
|
&:not(.kbq-button-toggle_vertical) {
|
|
85
124
|
.kbq-button-toggle {
|
|
86
125
|
> .kbq-button,
|
|
@@ -88,6 +127,39 @@
|
|
|
88
127
|
max-width: 100%;
|
|
89
128
|
|
|
90
129
|
height: var(--kbq-button-toggle-size-item-height);
|
|
130
|
+
|
|
131
|
+
&:before {
|
|
132
|
+
inset-block: calc(-1 * var(--kbq-button-toggle-size-item-hit-area-vertical));
|
|
133
|
+
inset-inline: calc(-1 * var(--kbq-button-toggle-size-item-hit-area-gap));
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
&:first-of-type > :is(.kbq-button, .kbq-button-icon):before {
|
|
138
|
+
inset-inline-start: calc(-1 * var(--kbq-button-toggle-size-item-hit-area-horizontal));
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
&:last-of-type > :is(.kbq-button, .kbq-button-icon):before {
|
|
142
|
+
inset-inline-end: calc(-1 * var(--kbq-button-toggle-size-item-hit-area-horizontal));
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
&.kbq-button-toggle_vertical {
|
|
148
|
+
.kbq-button-toggle {
|
|
149
|
+
> .kbq-button,
|
|
150
|
+
> .kbq-button-icon {
|
|
151
|
+
&:before {
|
|
152
|
+
inset-inline: calc(-1 * var(--kbq-button-toggle-size-item-hit-area-horizontal));
|
|
153
|
+
inset-block: calc(-1 * var(--kbq-button-toggle-size-item-hit-area-gap));
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
&:first-of-type > :is(.kbq-button, .kbq-button-icon):before {
|
|
158
|
+
inset-block-start: calc(-1 * var(--kbq-button-toggle-size-item-hit-area-vertical));
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
&:last-of-type > :is(.kbq-button, .kbq-button-icon):before {
|
|
162
|
+
inset-block-end: calc(-1 * var(--kbq-button-toggle-size-item-hit-area-vertical));
|
|
91
163
|
}
|
|
92
164
|
}
|
|
93
165
|
}
|