@chromvoid/uikit 0.1.0 → 0.2.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/LICENSE +19 -6
- package/README.md +1 -0
- package/dist/components/cv-accordion-item.d.ts +1 -1
- package/dist/components/cv-accordion.d.ts +1 -1
- package/dist/components/cv-accordion.js +2 -1
- package/dist/components/cv-alert-dialog.d.ts +1 -1
- package/dist/components/cv-alert-dialog.js +17 -2
- package/dist/components/cv-alert.d.ts +1 -1
- package/dist/components/cv-alert.js +2 -1
- package/dist/components/cv-badge.d.ts +1 -1
- package/dist/components/cv-badge.js +2 -1
- package/dist/components/cv-bottom-sheet.d.ts +127 -0
- package/dist/components/cv-bottom-sheet.js +513 -0
- package/dist/components/cv-breadcrumb-item.d.ts +1 -1
- package/dist/components/cv-breadcrumb-item.js +1 -1
- package/dist/components/cv-breadcrumb.d.ts +1 -1
- package/dist/components/cv-breadcrumb.js +2 -1
- package/dist/components/cv-button.d.ts +23 -1
- package/dist/components/cv-button.js +194 -37
- package/dist/components/cv-callout.d.ts +8 -1
- package/dist/components/cv-callout.js +18 -1
- package/dist/components/cv-card.d.ts +1 -1
- package/dist/components/cv-card.js +2 -2
- package/dist/components/cv-carousel-slide.d.ts +1 -1
- package/dist/components/cv-carousel.d.ts +1 -1
- package/dist/components/cv-carousel.js +2 -1
- package/dist/components/cv-checkbox.d.ts +1 -1
- package/dist/components/cv-combobox-group.d.ts +1 -1
- package/dist/components/cv-combobox-option.d.ts +1 -1
- package/dist/components/cv-combobox-option.js +2 -2
- package/dist/components/cv-combobox.d.ts +3 -1
- package/dist/components/cv-combobox.js +49 -8
- package/dist/components/cv-command-item.d.ts +1 -1
- package/dist/components/cv-command-item.js +2 -2
- package/dist/components/cv-command-palette.d.ts +1 -1
- package/dist/components/cv-command-palette.js +21 -1
- package/dist/components/cv-context-menu.d.ts +1 -1
- package/dist/components/cv-context-menu.js +2 -1
- package/dist/components/cv-copy-button.d.ts +37 -9
- package/dist/components/cv-copy-button.js +129 -41
- package/dist/components/cv-date-picker.d.ts +1 -1
- package/dist/components/cv-date-picker.js +20 -1
- package/dist/components/cv-dialog.d.ts +44 -2
- package/dist/components/cv-dialog.js +686 -74
- package/dist/components/cv-disclosure.d.ts +1 -1
- package/dist/components/cv-disclosure.js +2 -1
- package/dist/components/cv-drawer.d.ts +29 -1
- package/dist/components/cv-drawer.js +229 -4
- package/dist/components/cv-feed-article.d.ts +1 -1
- package/dist/components/cv-feed-article.js +2 -1
- package/dist/components/cv-feed.d.ts +1 -1
- package/dist/components/cv-feed.js +2 -1
- package/dist/components/cv-grid-cell.d.ts +1 -1
- package/dist/components/cv-grid-cell.js +3 -3
- package/dist/components/cv-grid-column.d.ts +1 -1
- package/dist/components/cv-grid-column.js +1 -1
- package/dist/components/cv-grid-row.d.ts +1 -1
- package/dist/components/cv-grid.d.ts +1 -1
- package/dist/components/cv-grid.js +2 -1
- package/dist/components/cv-guidance-anchor.d.ts +47 -0
- package/dist/components/cv-guidance-anchor.js +113 -0
- package/dist/components/cv-guidance-panel.d.ts +29 -0
- package/dist/components/cv-guidance-panel.js +245 -0
- package/dist/components/cv-icon.d.ts +2 -1
- package/dist/components/cv-icon.js +28 -3
- package/dist/components/cv-input.d.ts +7 -1
- package/dist/components/cv-input.js +33 -1
- package/dist/components/cv-landmark.d.ts +1 -1
- package/dist/components/cv-landmark.js +2 -1
- package/dist/components/cv-link.d.ts +1 -1
- package/dist/components/cv-link.js +2 -1
- package/dist/components/cv-listbox-group.d.ts +1 -1
- package/dist/components/cv-listbox.d.ts +1 -1
- package/dist/components/cv-listbox.js +2 -1
- package/dist/components/cv-menu-button.d.ts +24 -1
- package/dist/components/cv-menu-button.js +226 -18
- package/dist/components/cv-menu-group.d.ts +1 -1
- package/dist/components/cv-menu-item.d.ts +1 -1
- package/dist/components/cv-menu-item.js +6 -2
- package/dist/components/cv-menu.d.ts +1 -1
- package/dist/components/cv-menu.js +21 -1
- package/dist/components/cv-meter.d.ts +1 -1
- package/dist/components/cv-meter.js +6 -22
- package/dist/components/cv-number.d.ts +1 -1
- package/dist/components/cv-option.d.ts +1 -1
- package/dist/components/cv-option.js +3 -9
- package/dist/components/cv-popover-positioning.d.ts +22 -0
- package/dist/components/cv-popover-positioning.js +112 -0
- package/dist/components/cv-popover.d.ts +45 -8
- package/dist/components/cv-popover.js +395 -113
- package/dist/components/cv-progress-ring.d.ts +1 -1
- package/dist/components/cv-progress-ring.js +2 -1
- package/dist/components/cv-progress.d.ts +8 -1
- package/dist/components/cv-progress.js +41 -10
- package/dist/components/cv-radio-group.d.ts +1 -1
- package/dist/components/cv-radio.d.ts +1 -1
- package/dist/components/cv-radio.js +1 -1
- package/dist/components/cv-select-group.d.ts +1 -1
- package/dist/components/cv-select-option.d.ts +1 -1
- package/dist/components/cv-select-option.js +2 -2
- package/dist/components/cv-select.d.ts +1 -1
- package/dist/components/cv-select.js +28 -1
- package/dist/components/cv-sidebar-item.d.ts +1 -1
- package/dist/components/cv-sidebar.d.ts +1 -1
- package/dist/components/cv-sidebar.js +3 -2
- package/dist/components/cv-slider-multi-thumb.d.ts +1 -1
- package/dist/components/cv-slider-multi-thumb.js +2 -1
- package/dist/components/cv-slider.d.ts +17 -4
- package/dist/components/cv-slider.js +63 -21
- package/dist/components/cv-spinbutton.d.ts +1 -1
- package/dist/components/cv-spinner.d.ts +1 -1
- package/dist/components/cv-spinner.js +2 -1
- package/dist/components/cv-switch.d.ts +1 -1
- package/dist/components/cv-tab-panel.d.ts +1 -1
- package/dist/components/cv-tab.d.ts +1 -1
- package/dist/components/cv-table-cell.d.ts +1 -1
- package/dist/components/cv-table-cell.js +1 -1
- package/dist/components/cv-table-column.d.ts +1 -1
- package/dist/components/cv-table-column.js +1 -1
- package/dist/components/cv-table-row.d.ts +1 -1
- package/dist/components/cv-table-row.js +1 -4
- package/dist/components/cv-table.d.ts +1 -3
- package/dist/components/cv-table.js +4 -11
- package/dist/components/cv-tabs.d.ts +1 -1
- package/dist/components/cv-tabs.js +3 -2
- package/dist/components/cv-textarea.d.ts +11 -1
- package/dist/components/cv-textarea.js +33 -0
- package/dist/components/cv-toast-region.d.ts +1 -1
- package/dist/components/cv-toast-region.js +2 -1
- package/dist/components/cv-toast.d.ts +1 -1
- package/dist/components/cv-toast.js +20 -27
- package/dist/components/cv-toolbar-item.d.ts +1 -1
- package/dist/components/cv-toolbar-separator.d.ts +1 -1
- package/dist/components/cv-toolbar.d.ts +1 -1
- package/dist/components/cv-toolbar.js +2 -1
- package/dist/components/cv-tooltip.d.ts +1 -1
- package/dist/components/cv-tooltip.js +2 -1
- package/dist/components/cv-treegrid-cell.d.ts +1 -1
- package/dist/components/cv-treegrid-cell.js +1 -1
- package/dist/components/cv-treegrid-column.d.ts +1 -1
- package/dist/components/cv-treegrid-column.js +1 -1
- package/dist/components/cv-treegrid-row.d.ts +1 -1
- package/dist/components/cv-treegrid-row.js +1 -1
- package/dist/components/cv-treegrid.d.ts +1 -1
- package/dist/components/cv-treegrid.js +4 -3
- package/dist/components/cv-treeitem.d.ts +1 -1
- package/dist/components/cv-treeitem.js +2 -2
- package/dist/components/cv-treeview.d.ts +1 -1
- package/dist/components/cv-treeview.js +2 -1
- package/dist/components/cv-window-splitter.d.ts +1 -1
- package/dist/components/cv-window-splitter.js +2 -1
- package/dist/components/index.d.ts +7 -0
- package/dist/components/index.js +3 -0
- package/dist/dialog/create-dialog-controller.d.ts +12 -4
- package/dist/dialog/create-dialog-controller.js +84 -22
- package/dist/dialog/index.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/reatom-lit/ReatomLitElement.d.ts +6 -3
- package/dist/reatom-lit/ReatomLitElement.js +18 -8
- package/dist/reatom-lit/createAfterRenderScheduler.d.ts +10 -0
- package/dist/reatom-lit/createAfterRenderScheduler.js +33 -0
- package/dist/reatom-lit/index.d.ts +2 -0
- package/dist/reatom-lit/index.js +1 -0
- package/dist/reatom-lit/watch.d.ts +1 -1
- package/dist/reatom-lit/withReatomElement.js +16 -2
- package/dist/register.js +4 -1
- package/dist/styles/component-styles.js +4 -0
- package/dist/styles/uno-generated.d.ts +2 -0
- package/dist/styles/uno-generated.js +1 -0
- package/dist/styles/uno-utilities.d.ts +5 -0
- package/dist/styles/uno-utilities.js +7 -0
- package/dist/theme/cv-theme-provider.d.ts +1 -1
- package/dist/theme/cv-theme-provider.js +2 -2
- package/dist/theme/tokens.css +619 -162
- package/package.json +9 -5
- package/specs/components/bottom-sheet.md +93 -0
- package/specs/components/button.md +8 -0
- package/specs/components/callout.md +8 -0
- package/specs/components/copy-button.md +54 -17
- package/specs/components/dialog.md +72 -43
- package/specs/components/drawer.md +18 -13
- package/specs/components/guidance-anchor.md +64 -0
- package/specs/components/guidance-panel.md +92 -0
- package/specs/components/input.md +7 -0
- package/specs/components/menu.md +8 -0
- package/specs/components/option.md +9 -9
- package/specs/components/progress.md +11 -0
- package/specs/components/sidebar.md +12 -12
- package/specs/components/table.md +13 -13
- package/specs/components/theme.md +13 -13
- package/specs/components/treegrid.md +15 -15
- package/specs/components/treeview.md +10 -10
|
@@ -41,5 +41,5 @@ export declare class CVProgressRing extends ReatomLitElement {
|
|
|
41
41
|
static define(): void;
|
|
42
42
|
willUpdate(changedProperties: PropertyValues): void;
|
|
43
43
|
private createModel;
|
|
44
|
-
protected render(): import("lit").TemplateResult
|
|
44
|
+
protected render(): import("lit-html").TemplateResult;
|
|
45
45
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createProgress } from '@chromvoid/headless-ui/progress';
|
|
2
|
-
import { css,
|
|
2
|
+
import { css, nothing } from 'lit';
|
|
3
|
+
import { html } from '../reatom-lit/index.js';
|
|
3
4
|
import { ReatomLitElement } from '../reatom-lit/ReatomLitElement.js';
|
|
4
5
|
let cvProgressRingNonce = 0;
|
|
5
6
|
const RADIUS = 45;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { PropertyValues } from 'lit';
|
|
2
2
|
import { ReatomLitElement } from '../reatom-lit/ReatomLitElement.js';
|
|
3
|
+
type CVProgressTone = 'upload' | 'queued' | 'success' | 'danger' | 'warning';
|
|
3
4
|
export declare class CVProgress extends ReatomLitElement {
|
|
4
5
|
static elementName: string;
|
|
5
6
|
static get properties(): {
|
|
@@ -27,6 +28,10 @@ export declare class CVProgress extends ReatomLitElement {
|
|
|
27
28
|
type: StringConstructor;
|
|
28
29
|
attribute: string;
|
|
29
30
|
};
|
|
31
|
+
tone: {
|
|
32
|
+
type: StringConstructor;
|
|
33
|
+
reflect: boolean;
|
|
34
|
+
};
|
|
30
35
|
};
|
|
31
36
|
value: number;
|
|
32
37
|
min: number;
|
|
@@ -34,6 +39,7 @@ export declare class CVProgress extends ReatomLitElement {
|
|
|
34
39
|
indeterminate: boolean;
|
|
35
40
|
valueText: string;
|
|
36
41
|
ariaLabel: string;
|
|
42
|
+
tone: CVProgressTone | undefined;
|
|
37
43
|
private readonly idBase;
|
|
38
44
|
private model;
|
|
39
45
|
constructor();
|
|
@@ -41,5 +47,6 @@ export declare class CVProgress extends ReatomLitElement {
|
|
|
41
47
|
static define(): void;
|
|
42
48
|
willUpdate(changedProperties: PropertyValues): void;
|
|
43
49
|
private createModel;
|
|
44
|
-
protected render(): import("lit").TemplateResult
|
|
50
|
+
protected render(): import("lit-html").TemplateResult;
|
|
45
51
|
}
|
|
52
|
+
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createProgress } from '@chromvoid/headless-ui/progress';
|
|
2
|
-
import { css,
|
|
2
|
+
import { css, nothing } from 'lit';
|
|
3
|
+
import { html } from '../reatom-lit/index.js';
|
|
3
4
|
import { ReatomLitElement } from '../reatom-lit/ReatomLitElement.js';
|
|
4
5
|
let cvProgressNonce = 0;
|
|
5
6
|
export class CVProgress extends ReatomLitElement {
|
|
@@ -12,6 +13,7 @@ export class CVProgress extends ReatomLitElement {
|
|
|
12
13
|
indeterminate: { type: Boolean, reflect: true },
|
|
13
14
|
valueText: { type: String, attribute: 'value-text' },
|
|
14
15
|
ariaLabel: { type: String, attribute: 'aria-label' },
|
|
16
|
+
tone: { type: String, reflect: true },
|
|
15
17
|
};
|
|
16
18
|
}
|
|
17
19
|
idBase = `cv-progress-${++cvProgressNonce}`;
|
|
@@ -24,6 +26,7 @@ export class CVProgress extends ReatomLitElement {
|
|
|
24
26
|
this.indeterminate = false;
|
|
25
27
|
this.valueText = '';
|
|
26
28
|
this.ariaLabel = '';
|
|
29
|
+
this.tone = undefined;
|
|
27
30
|
this.model = this.createModel();
|
|
28
31
|
}
|
|
29
32
|
static styles = [
|
|
@@ -46,11 +49,9 @@ export class CVProgress extends ReatomLitElement {
|
|
|
46
49
|
block-size: 100%;
|
|
47
50
|
inline-size: var(--cv-progress-width, 0%);
|
|
48
51
|
border-radius: inherit;
|
|
49
|
-
background:
|
|
50
|
-
|
|
51
|
-
var(--cv-progress-
|
|
52
|
-
color-mix(in oklab, var(--cv-progress-indicator-color, var(--cv-color-primary, #65d7ff)) 70%, white)
|
|
53
|
-
100%
|
|
52
|
+
background: var(
|
|
53
|
+
--cv-progress-indicator-background,
|
|
54
|
+
var(--cv-gradient-progress-primary, var(--cv-gradient-primary))
|
|
54
55
|
);
|
|
55
56
|
transition: inline-size var(--cv-duration-normal, 220ms) var(--cv-easing-standard, ease);
|
|
56
57
|
position: relative;
|
|
@@ -71,10 +72,40 @@ export class CVProgress extends ReatomLitElement {
|
|
|
71
72
|
}
|
|
72
73
|
|
|
73
74
|
:host([data-complete]) [part='indicator'] {
|
|
74
|
-
background:
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
background: var(--cv-gradient-progress-success, var(--cv-gradient-success));
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
:host([tone='upload']) {
|
|
79
|
+
--cv-progress-height: var(--cv-progress-upload-height, 6px);
|
|
80
|
+
--cv-progress-track-color: var(--cv-progress-upload-track-color, var(--cv-color-border));
|
|
81
|
+
--cv-progress-indicator-background: var(
|
|
82
|
+
--cv-progress-upload-indicator-background,
|
|
83
|
+
var(--cv-gradient-primary)
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
:host([tone='queued']) {
|
|
88
|
+
--cv-progress-indicator-background: var(
|
|
89
|
+
--cv-progress-tone-queued-background,
|
|
90
|
+
var(--cv-color-border-strong)
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
:host([tone='success']) {
|
|
95
|
+
--cv-progress-indicator-background: var(
|
|
96
|
+
--cv-progress-tone-success-background,
|
|
97
|
+
var(--cv-color-success)
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
:host([tone='danger']) {
|
|
102
|
+
--cv-progress-indicator-background: var(--cv-progress-tone-danger-background, var(--cv-color-danger));
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
:host([tone='warning']) {
|
|
106
|
+
--cv-progress-indicator-background: var(
|
|
107
|
+
--cv-progress-tone-warning-background,
|
|
108
|
+
var(--cv-color-warning)
|
|
78
109
|
);
|
|
79
110
|
}
|
|
80
111
|
|
|
@@ -74,6 +74,6 @@ export declare class CVRadioGroup extends FormAssociatedReatomElement {
|
|
|
74
74
|
protected getFormAssociatedValidity(): FormAssociatedValidity;
|
|
75
75
|
private isEffectivelyDisabled;
|
|
76
76
|
private restoreValue;
|
|
77
|
-
protected render(): import("lit").TemplateResult<1>;
|
|
77
|
+
protected render(): import("lit-html").TemplateResult<1>;
|
|
78
78
|
}
|
|
79
79
|
export {};
|
|
@@ -11,5 +11,5 @@ export declare class CVSelectGroup extends LitElement {
|
|
|
11
11
|
constructor();
|
|
12
12
|
static styles: import("lit").CSSResult[];
|
|
13
13
|
static define(): void;
|
|
14
|
-
protected render(): import("lit").TemplateResult<1>;
|
|
14
|
+
protected render(): import("lit-html").TemplateResult<1>;
|
|
15
15
|
}
|
|
@@ -26,5 +26,5 @@ export declare class CVSelectOption extends LitElement {
|
|
|
26
26
|
constructor();
|
|
27
27
|
static styles: import("lit").CSSResult[];
|
|
28
28
|
static define(): void;
|
|
29
|
-
protected render(): import("lit").TemplateResult<1>;
|
|
29
|
+
protected render(): import("lit-html").TemplateResult<1>;
|
|
30
30
|
}
|
|
@@ -36,11 +36,11 @@ export class CVSelectOption extends LitElement {
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
:host([active]) .option {
|
|
39
|
-
background:
|
|
39
|
+
background: var(--cv-color-primary-ring);
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
:host([selected]) .option {
|
|
43
|
-
background:
|
|
43
|
+
background: var(--cv-color-primary-border);
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
:host([disabled]) .option {
|
|
@@ -124,5 +124,5 @@ export declare class CVSelect extends FormAssociatedReatomElement {
|
|
|
124
124
|
private handleClearClick;
|
|
125
125
|
private handleSlotChange;
|
|
126
126
|
private getValueText;
|
|
127
|
-
protected render(): import("lit").TemplateResult<1>;
|
|
127
|
+
protected render(): import("lit-html").TemplateResult<1>;
|
|
128
128
|
}
|
|
@@ -73,6 +73,9 @@ export class CVSelect extends FormAssociatedReatomElement {
|
|
|
73
73
|
css `
|
|
74
74
|
:host {
|
|
75
75
|
inline-size: var(--cv-select-inline-size, 260px);
|
|
76
|
+
--cv-select-border-color: var(--cv-color-border, #2a3245);
|
|
77
|
+
--cv-select-border-radius: var(--cv-radius-sm, 6px);
|
|
78
|
+
--cv-select-background: var(--cv-color-surface, #141923);
|
|
76
79
|
}
|
|
77
80
|
|
|
78
81
|
:host([disabled]) {
|
|
@@ -92,6 +95,9 @@ export class CVSelect extends FormAssociatedReatomElement {
|
|
|
92
95
|
min-block-size: var(--cv-select-min-height, 36px);
|
|
93
96
|
padding: var(--cv-select-padding-block, var(--cv-space-2, 8px))
|
|
94
97
|
var(--cv-select-padding-inline, var(--cv-space-3, 12px));
|
|
98
|
+
border: 1px solid var(--cv-select-border-color);
|
|
99
|
+
border-radius: var(--cv-select-border-radius);
|
|
100
|
+
background: var(--cv-select-background);
|
|
95
101
|
color: var(--cv-color-text, #e8ecf6);
|
|
96
102
|
cursor: pointer;
|
|
97
103
|
}
|
|
@@ -142,6 +148,27 @@ export class CVSelect extends FormAssociatedReatomElement {
|
|
|
142
148
|
gap: var(--cv-space-1, 4px);
|
|
143
149
|
padding: var(--cv-space-1, 4px);
|
|
144
150
|
background: var(--cv-color-surface-elevated, #1d2432);
|
|
151
|
+
opacity: 1;
|
|
152
|
+
transform: translate3d(0, 0, 0);
|
|
153
|
+
transition:
|
|
154
|
+
opacity var(--cv-select-listbox-transition-duration, var(--cv-duration-fast, 120ms))
|
|
155
|
+
var(--cv-easing-standard, ease),
|
|
156
|
+
transform var(--cv-select-listbox-transition-duration, var(--cv-duration-fast, 120ms))
|
|
157
|
+
var(--cv-easing-standard, ease),
|
|
158
|
+
display var(--cv-select-listbox-transition-duration, var(--cv-duration-fast, 120ms)) allow-discrete;
|
|
159
|
+
transition-behavior: allow-discrete;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
[part='listbox'][hidden] {
|
|
163
|
+
opacity: 0;
|
|
164
|
+
transform: translate3d(0, -2px, 0);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
@starting-style {
|
|
168
|
+
[part='listbox']:not([hidden]) {
|
|
169
|
+
opacity: 0;
|
|
170
|
+
transform: translate3d(0, -2px, 0);
|
|
171
|
+
}
|
|
145
172
|
}
|
|
146
173
|
`,
|
|
147
174
|
];
|
|
@@ -655,7 +682,7 @@ export class CVSelect extends FormAssociatedReatomElement {
|
|
|
655
682
|
aria-activedescendant=${listboxProps['aria-activedescendant'] ?? nothing}
|
|
656
683
|
?hidden=${listboxProps.hidden}
|
|
657
684
|
part="listbox"
|
|
658
|
-
class="cv-u-panel-shell"
|
|
685
|
+
class="cv-u-panel-shell cv-u-discrete-presence"
|
|
659
686
|
@keydown=${this.handleListboxKeyDown}
|
|
660
687
|
>
|
|
661
688
|
<slot @slotchange=${this.handleSlotChange}></slot>
|
|
@@ -22,5 +22,5 @@ export declare class CVSidebarItem extends LitElement {
|
|
|
22
22
|
static styles: import("lit").CSSResult[];
|
|
23
23
|
static define(): void;
|
|
24
24
|
private handleClick;
|
|
25
|
-
protected render(): import("lit").TemplateResult<1>;
|
|
25
|
+
protected render(): import("lit-html").TemplateResult<1>;
|
|
26
26
|
}
|
|
@@ -166,6 +166,6 @@ export declare class CVSidebar extends ReatomLitElement {
|
|
|
166
166
|
private updateActiveId;
|
|
167
167
|
private syncScrollspyActiveState;
|
|
168
168
|
private revealActiveBinding;
|
|
169
|
-
protected render(): import("lit").TemplateResult
|
|
169
|
+
protected render(): import("lit-html").TemplateResult;
|
|
170
170
|
}
|
|
171
171
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createSidebar } from '@chromvoid/headless-ui/sidebar';
|
|
2
|
-
import { css,
|
|
2
|
+
import { css, nothing } from 'lit';
|
|
3
|
+
import { html } from '../reatom-lit/index.js';
|
|
3
4
|
import { ReatomLitElement } from '../reatom-lit/ReatomLitElement.js';
|
|
4
5
|
let cvSidebarNonce = 0;
|
|
5
6
|
const TOP_ANCHOR_THRESHOLDS = [0, 0.25, 0.5, 0.75, 1];
|
|
@@ -91,7 +92,7 @@ export class CVSidebar extends ReatomLitElement {
|
|
|
91
92
|
position: fixed;
|
|
92
93
|
inset: 0;
|
|
93
94
|
z-index: calc(var(--cv-sidebar-z-index, 30) + 10);
|
|
94
|
-
background: var(--cv-sidebar-overlay-color, color-
|
|
95
|
+
background: var(--cv-sidebar-overlay-color, var(--cv-color-overlay));
|
|
95
96
|
}
|
|
96
97
|
|
|
97
98
|
[part='overlay'][hidden] {
|
|
@@ -69,5 +69,5 @@ export declare class CVSliderMultiThumb extends ReatomLitElement {
|
|
|
69
69
|
private cleanupDragListeners;
|
|
70
70
|
private handleThumbFocus;
|
|
71
71
|
private handleThumbKeyDown;
|
|
72
|
-
protected render(): import("lit").TemplateResult
|
|
72
|
+
protected render(): import("lit-html").TemplateResult;
|
|
73
73
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createSliderMultiThumb, } from '@chromvoid/headless-ui/slider-multi-thumb';
|
|
2
|
-
import { css,
|
|
2
|
+
import { css, nothing } from 'lit';
|
|
3
|
+
import { html } from '../reatom-lit/index.js';
|
|
3
4
|
import { ReatomLitElement } from '../reatom-lit/ReatomLitElement.js';
|
|
4
5
|
const sliderKeyboardKeys = new Set([
|
|
5
6
|
'ArrowLeft',
|
|
@@ -5,6 +5,12 @@ export interface CVSliderEventDetail {
|
|
|
5
5
|
value: number;
|
|
6
6
|
percentage: number;
|
|
7
7
|
}
|
|
8
|
+
export type CVSliderInputEvent = CustomEvent<CVSliderEventDetail>;
|
|
9
|
+
export type CVSliderChangeEvent = CustomEvent<CVSliderEventDetail>;
|
|
10
|
+
export interface CVSliderEventMap {
|
|
11
|
+
'cv-input': CVSliderInputEvent;
|
|
12
|
+
'cv-change': CVSliderChangeEvent;
|
|
13
|
+
}
|
|
8
14
|
export declare class CVSlider extends ReatomLitElement {
|
|
9
15
|
static elementName: string;
|
|
10
16
|
static get properties(): {
|
|
@@ -64,21 +70,28 @@ export declare class CVSlider extends ReatomLitElement {
|
|
|
64
70
|
private model;
|
|
65
71
|
private dragging;
|
|
66
72
|
private dragValueChanged;
|
|
73
|
+
private activePointerId;
|
|
74
|
+
private dragAbortController;
|
|
67
75
|
constructor();
|
|
68
76
|
static styles: import("lit").CSSResult[];
|
|
69
77
|
static define(): void;
|
|
70
78
|
disconnectedCallback(): void;
|
|
71
79
|
willUpdate(changedProperties: PropertyValues): void;
|
|
80
|
+
updated(changedProperties: PropertyValues): void;
|
|
72
81
|
private createModel;
|
|
73
82
|
private getEventDetail;
|
|
83
|
+
private getSliderPercentage;
|
|
84
|
+
private applySliderPercentage;
|
|
74
85
|
private dispatchInput;
|
|
75
86
|
private dispatchChange;
|
|
76
87
|
private syncFromModelAndEmit;
|
|
77
88
|
private updateValueFromPointer;
|
|
89
|
+
private getPointerId;
|
|
78
90
|
private handleThumbKeyDown;
|
|
79
|
-
private
|
|
80
|
-
private
|
|
81
|
-
private
|
|
91
|
+
private handleBasePointerDown;
|
|
92
|
+
private handleDocumentPointerMove;
|
|
93
|
+
private handleDocumentPointerUp;
|
|
94
|
+
private handleDocumentPointerCancel;
|
|
82
95
|
private cleanupDragListeners;
|
|
83
|
-
protected render(): import("lit").TemplateResult
|
|
96
|
+
protected render(): import("lit-html").TemplateResult;
|
|
84
97
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createSlider } from '@chromvoid/headless-ui/slider';
|
|
2
|
-
import { css,
|
|
2
|
+
import { css, nothing } from 'lit';
|
|
3
|
+
import { html } from '../reatom-lit/index.js';
|
|
3
4
|
import { ReatomLitElement } from '../reatom-lit/ReatomLitElement.js';
|
|
4
5
|
const sliderKeyboardKeys = new Set([
|
|
5
6
|
'ArrowLeft',
|
|
@@ -32,6 +33,8 @@ export class CVSlider extends ReatomLitElement {
|
|
|
32
33
|
model;
|
|
33
34
|
dragging = false;
|
|
34
35
|
dragValueChanged = false;
|
|
36
|
+
activePointerId = null;
|
|
37
|
+
dragAbortController = null;
|
|
35
38
|
constructor() {
|
|
36
39
|
super();
|
|
37
40
|
this.value = 0;
|
|
@@ -60,6 +63,8 @@ export class CVSlider extends ReatomLitElement {
|
|
|
60
63
|
place-items: center;
|
|
61
64
|
inline-size: 100%;
|
|
62
65
|
block-size: 24px;
|
|
66
|
+
touch-action: pan-y;
|
|
67
|
+
-webkit-tap-highlight-color: transparent;
|
|
63
68
|
--cv-slider-percentage: 0%;
|
|
64
69
|
}
|
|
65
70
|
|
|
@@ -70,6 +75,8 @@ export class CVSlider extends ReatomLitElement {
|
|
|
70
75
|
border-radius: 999px;
|
|
71
76
|
border: 1px solid var(--cv-color-border, #2a3245);
|
|
72
77
|
background: var(--cv-color-surface, #141923);
|
|
78
|
+
touch-action: pan-y;
|
|
79
|
+
-webkit-tap-highlight-color: transparent;
|
|
73
80
|
}
|
|
74
81
|
|
|
75
82
|
[part='range'] {
|
|
@@ -96,6 +103,8 @@ export class CVSlider extends ReatomLitElement {
|
|
|
96
103
|
background: var(--cv-color-surface-elevated, #1d2432);
|
|
97
104
|
transform: translate(-50%, -50%);
|
|
98
105
|
cursor: grab;
|
|
106
|
+
touch-action: pan-y;
|
|
107
|
+
-webkit-tap-highlight-color: transparent;
|
|
99
108
|
}
|
|
100
109
|
|
|
101
110
|
[part='thumb']:focus-visible {
|
|
@@ -115,11 +124,13 @@ export class CVSlider extends ReatomLitElement {
|
|
|
115
124
|
:host([orientation='vertical']) [part='base'] {
|
|
116
125
|
inline-size: 24px;
|
|
117
126
|
block-size: 100%;
|
|
127
|
+
touch-action: pan-x;
|
|
118
128
|
}
|
|
119
129
|
|
|
120
130
|
:host([orientation='vertical']) [part='track'] {
|
|
121
131
|
inline-size: 6px;
|
|
122
132
|
block-size: 100%;
|
|
133
|
+
touch-action: pan-x;
|
|
123
134
|
}
|
|
124
135
|
|
|
125
136
|
:host([orientation='vertical']) [part='range'] {
|
|
@@ -140,6 +151,7 @@ export class CVSlider extends ReatomLitElement {
|
|
|
140
151
|
inset-block-start: auto;
|
|
141
152
|
inset-block-end: var(--cv-slider-percentage);
|
|
142
153
|
transform: translate(-50%, 50%);
|
|
154
|
+
touch-action: pan-x;
|
|
143
155
|
}
|
|
144
156
|
|
|
145
157
|
:host([disabled]) [part='base'] {
|
|
@@ -180,6 +192,10 @@ export class CVSlider extends ReatomLitElement {
|
|
|
180
192
|
this.model.actions.setValue(this.value);
|
|
181
193
|
}
|
|
182
194
|
}
|
|
195
|
+
updated(changedProperties) {
|
|
196
|
+
super.updated(changedProperties);
|
|
197
|
+
this.applySliderPercentage();
|
|
198
|
+
}
|
|
183
199
|
createModel() {
|
|
184
200
|
return createSlider({
|
|
185
201
|
idBase: this.idBase,
|
|
@@ -201,6 +217,13 @@ export class CVSlider extends ReatomLitElement {
|
|
|
201
217
|
percentage: this.model.state.percentage(),
|
|
202
218
|
};
|
|
203
219
|
}
|
|
220
|
+
getSliderPercentage() {
|
|
221
|
+
return Math.max(0, Math.min(100, this.model.state.percentage()));
|
|
222
|
+
}
|
|
223
|
+
applySliderPercentage() {
|
|
224
|
+
const base = this.shadowRoot?.querySelector('[part="base"]');
|
|
225
|
+
base?.style.setProperty('--cv-slider-percentage', `${this.getSliderPercentage()}%`);
|
|
226
|
+
}
|
|
204
227
|
dispatchInput(detail) {
|
|
205
228
|
this.dispatchEvent(new CustomEvent('cv-input', {
|
|
206
229
|
detail,
|
|
@@ -218,6 +241,7 @@ export class CVSlider extends ReatomLitElement {
|
|
|
218
241
|
syncFromModelAndEmit(previousValue, emitChange) {
|
|
219
242
|
const nextValue = this.model.state.value();
|
|
220
243
|
this.value = nextValue;
|
|
244
|
+
this.applySliderPercentage();
|
|
221
245
|
if (previousValue === nextValue)
|
|
222
246
|
return false;
|
|
223
247
|
const detail = this.getEventDetail();
|
|
@@ -245,6 +269,9 @@ export class CVSlider extends ReatomLitElement {
|
|
|
245
269
|
this.model.actions.setValue(nextValue);
|
|
246
270
|
return this.syncFromModelAndEmit(previousValue, false);
|
|
247
271
|
}
|
|
272
|
+
getPointerId(event) {
|
|
273
|
+
return Number.isFinite(event.pointerId) ? event.pointerId : 1;
|
|
274
|
+
}
|
|
248
275
|
handleThumbKeyDown(event) {
|
|
249
276
|
if (sliderKeyboardKeys.has(event.key)) {
|
|
250
277
|
event.preventDefault();
|
|
@@ -253,25 +280,38 @@ export class CVSlider extends ReatomLitElement {
|
|
|
253
280
|
this.model.contracts.getThumbProps().onKeyDown(event);
|
|
254
281
|
this.syncFromModelAndEmit(previousValue, true);
|
|
255
282
|
}
|
|
256
|
-
|
|
257
|
-
if (this.disabled || event.button !== 0)
|
|
283
|
+
handleBasePointerDown(event) {
|
|
284
|
+
if (this.disabled || event.isPrimary === false || event.button !== 0)
|
|
258
285
|
return;
|
|
259
286
|
event.preventDefault();
|
|
260
287
|
this.shadowRoot?.querySelector('[part="thumb"]')?.focus();
|
|
288
|
+
this.cleanupDragListeners();
|
|
261
289
|
this.dragging = true;
|
|
290
|
+
this.activePointerId = this.getPointerId(event);
|
|
262
291
|
this.dragValueChanged = this.updateValueFromPointer(event.clientX, event.clientY);
|
|
263
|
-
|
|
264
|
-
|
|
292
|
+
const controller = new AbortController();
|
|
293
|
+
this.dragAbortController = controller;
|
|
294
|
+
document.addEventListener('pointermove', (moveEvent) => this.handleDocumentPointerMove(moveEvent), {
|
|
295
|
+
signal: controller.signal,
|
|
296
|
+
});
|
|
297
|
+
document.addEventListener('pointerup', (upEvent) => this.handleDocumentPointerUp(upEvent), {
|
|
298
|
+
signal: controller.signal,
|
|
299
|
+
});
|
|
300
|
+
document.addEventListener('pointercancel', (cancelEvent) => this.handleDocumentPointerCancel(cancelEvent), {
|
|
301
|
+
signal: controller.signal,
|
|
302
|
+
});
|
|
265
303
|
}
|
|
266
|
-
|
|
267
|
-
if (!this.dragging)
|
|
304
|
+
handleDocumentPointerMove(event) {
|
|
305
|
+
if (!this.dragging || this.getPointerId(event) !== this.activePointerId)
|
|
268
306
|
return;
|
|
307
|
+
event.preventDefault();
|
|
269
308
|
const changed = this.updateValueFromPointer(event.clientX, event.clientY);
|
|
270
309
|
this.dragValueChanged = this.dragValueChanged || changed;
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
if (!this.dragging)
|
|
310
|
+
}
|
|
311
|
+
handleDocumentPointerUp(event) {
|
|
312
|
+
if (!this.dragging || this.getPointerId(event) !== this.activePointerId)
|
|
274
313
|
return;
|
|
314
|
+
event.preventDefault();
|
|
275
315
|
const changed = this.updateValueFromPointer(event.clientX, event.clientY);
|
|
276
316
|
this.dragValueChanged = this.dragValueChanged || changed;
|
|
277
317
|
if (this.dragValueChanged) {
|
|
@@ -280,30 +320,32 @@ export class CVSlider extends ReatomLitElement {
|
|
|
280
320
|
this.dragging = false;
|
|
281
321
|
this.dragValueChanged = false;
|
|
282
322
|
this.cleanupDragListeners();
|
|
283
|
-
}
|
|
323
|
+
}
|
|
324
|
+
handleDocumentPointerCancel(event) {
|
|
325
|
+
if (this.getPointerId(event) !== this.activePointerId)
|
|
326
|
+
return;
|
|
327
|
+
this.dragging = false;
|
|
328
|
+
this.dragValueChanged = false;
|
|
329
|
+
this.cleanupDragListeners();
|
|
330
|
+
}
|
|
284
331
|
cleanupDragListeners() {
|
|
285
|
-
|
|
286
|
-
|
|
332
|
+
this.dragAbortController?.abort();
|
|
333
|
+
this.dragAbortController = null;
|
|
334
|
+
this.activePointerId = null;
|
|
287
335
|
}
|
|
288
336
|
render() {
|
|
289
337
|
const rootProps = this.model.contracts.getRootProps();
|
|
290
338
|
const trackProps = this.model.contracts.getTrackProps();
|
|
291
339
|
const thumbProps = this.model.contracts.getThumbProps();
|
|
292
|
-
const percentage = Math.max(0, Math.min(100, this.model.state.percentage()));
|
|
293
340
|
return html `
|
|
294
341
|
<div
|
|
295
342
|
id=${rootProps.id}
|
|
296
343
|
data-orientation=${rootProps['data-orientation']}
|
|
297
344
|
aria-disabled=${rootProps['aria-disabled'] ?? nothing}
|
|
298
|
-
style=${`--cv-slider-percentage:${percentage}%;`}
|
|
299
345
|
part="base"
|
|
346
|
+
@pointerdown=${this.handleBasePointerDown}
|
|
300
347
|
>
|
|
301
|
-
<div
|
|
302
|
-
id=${trackProps.id}
|
|
303
|
-
data-orientation=${trackProps['data-orientation']}
|
|
304
|
-
part="track"
|
|
305
|
-
@mousedown=${this.handleTrackMouseDown}
|
|
306
|
-
>
|
|
348
|
+
<div id=${trackProps.id} data-orientation=${trackProps['data-orientation']} part="track">
|
|
307
349
|
<div part="range"></div>
|
|
308
350
|
<div
|
|
309
351
|
id=${thumbProps.id}
|
|
@@ -117,5 +117,5 @@ export declare class CVSpinbutton extends FormAssociatedReatomElement {
|
|
|
117
117
|
private handleSpinbuttonKeyDown;
|
|
118
118
|
private handleIncrementClick;
|
|
119
119
|
private handleDecrementClick;
|
|
120
|
-
protected render(): import("lit").TemplateResult<1>;
|
|
120
|
+
protected render(): import("lit-html").TemplateResult<1>;
|
|
121
121
|
}
|
|
@@ -14,5 +14,5 @@ export declare class CVSpinner extends ReatomLitElement {
|
|
|
14
14
|
static styles: import("lit").CSSResult[];
|
|
15
15
|
static define(): void;
|
|
16
16
|
willUpdate(changedProperties: PropertyValues): void;
|
|
17
|
-
protected render(): import("lit").TemplateResult
|
|
17
|
+
protected render(): import("lit-html").TemplateResult;
|
|
18
18
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createSpinner } from '@chromvoid/headless-ui/spinner';
|
|
2
|
-
import { css
|
|
2
|
+
import { css } from 'lit';
|
|
3
|
+
import { svg } from '../reatom-lit/index.js';
|
|
3
4
|
import { ReatomLitElement } from '../reatom-lit/ReatomLitElement.js';
|
|
4
5
|
const RADIUS = 45;
|
|
5
6
|
const CIRCUMFERENCE = 2 * Math.PI * RADIUS;
|
|
@@ -76,6 +76,6 @@ export declare class CVSwitch extends FormAssociatedReatomElement {
|
|
|
76
76
|
private isEffectivelyDisabled;
|
|
77
77
|
private handleClick;
|
|
78
78
|
private handleKeyDown;
|
|
79
|
-
protected render(): import("lit").TemplateResult<1>;
|
|
79
|
+
protected render(): import("lit-html").TemplateResult<1>;
|
|
80
80
|
}
|
|
81
81
|
export {};
|
|
@@ -36,5 +36,5 @@ export declare class CVTab extends LitElement {
|
|
|
36
36
|
static styles: import("lit").CSSResult[];
|
|
37
37
|
static define(): void;
|
|
38
38
|
private handleCloseClick;
|
|
39
|
-
protected render(): import("lit").TemplateResult<1>;
|
|
39
|
+
protected render(): import("lit-html").TemplateResult<1>;
|
|
40
40
|
}
|
|
@@ -22,7 +22,7 @@ export class CVTableCell extends LitElement {
|
|
|
22
22
|
display: table-cell;
|
|
23
23
|
padding: var(--cv-table-cell-padding-block, var(--cv-space-2, 8px))
|
|
24
24
|
var(--cv-table-cell-padding-inline, var(--cv-space-3, 12px));
|
|
25
|
-
border-bottom: 1px solid
|
|
25
|
+
border-bottom: 1px solid var(--cv-color-border-soft);
|
|
26
26
|
color: var(--cv-color-text, #e8ecf6);
|
|
27
27
|
}
|
|
28
28
|
|
|
@@ -33,5 +33,5 @@ export declare class CVTableColumn extends LitElement {
|
|
|
33
33
|
constructor();
|
|
34
34
|
static styles: import("lit").CSSResult[];
|
|
35
35
|
static define(): void;
|
|
36
|
-
protected render(): import("lit").TemplateResult<1>;
|
|
36
|
+
protected render(): import("lit-html").TemplateResult<1>;
|
|
37
37
|
}
|
|
@@ -26,7 +26,7 @@ export class CVTableColumn extends LitElement {
|
|
|
26
26
|
border-bottom: 1px solid var(--cv-color-border, #2a3245);
|
|
27
27
|
font-weight: 600;
|
|
28
28
|
color: var(--cv-color-text, #e8ecf6);
|
|
29
|
-
background:
|
|
29
|
+
background: var(--cv-color-surface-glass-strong);
|
|
30
30
|
outline: none;
|
|
31
31
|
}
|
|
32
32
|
|
|
@@ -26,5 +26,5 @@ export declare class CVTableRow extends LitElement {
|
|
|
26
26
|
static styles: import("lit").CSSResult[];
|
|
27
27
|
static define(): void;
|
|
28
28
|
private handleSlotChange;
|
|
29
|
-
protected render(): import("lit").TemplateResult<1>;
|
|
29
|
+
protected render(): import("lit-html").TemplateResult<1>;
|
|
30
30
|
}
|