@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
|
@@ -21,10 +21,7 @@ export class CVTableRow extends LitElement {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
:host([selected]) {
|
|
24
|
-
background: var(
|
|
25
|
-
--cv-table-row-selected-background,
|
|
26
|
-
color-mix(in oklab, var(--cv-color-primary, #65d7ff) 12%, transparent)
|
|
27
|
-
);
|
|
24
|
+
background: var(--cv-table-row-selected-background, var(--cv-color-primary-surface));
|
|
28
25
|
}
|
|
29
26
|
`,
|
|
30
27
|
];
|
|
@@ -104,8 +104,6 @@ export declare class CVTable extends ReatomLitElement {
|
|
|
104
104
|
private columnListeners;
|
|
105
105
|
private rowListeners;
|
|
106
106
|
private model;
|
|
107
|
-
private prevFocusedRowIndex;
|
|
108
|
-
private prevFocusedColumnIndex;
|
|
109
107
|
constructor();
|
|
110
108
|
static styles: import("lit").CSSResult[];
|
|
111
109
|
static define(): void;
|
|
@@ -143,5 +141,5 @@ export declare class CVTable extends ReatomLitElement {
|
|
|
143
141
|
private handleColumnsSlotChange;
|
|
144
142
|
private handleRowsSlotChange;
|
|
145
143
|
private handleRowSlotChange;
|
|
146
|
-
protected render(): import("lit").TemplateResult
|
|
144
|
+
protected render(): import("lit-html").TemplateResult;
|
|
147
145
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createTable } from '@chromvoid/headless-ui/table';
|
|
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
|
import { CVTableCell } from './cv-table-cell.js';
|
|
5
6
|
import { CVTableColumn } from './cv-table-column.js';
|
|
@@ -32,8 +33,6 @@ export class CVTable extends ReatomLitElement {
|
|
|
32
33
|
columnListeners = new WeakMap();
|
|
33
34
|
rowListeners = new WeakMap();
|
|
34
35
|
model;
|
|
35
|
-
prevFocusedRowIndex = null;
|
|
36
|
-
prevFocusedColumnIndex = null;
|
|
37
36
|
constructor() {
|
|
38
37
|
super();
|
|
39
38
|
this.sortColumn = '';
|
|
@@ -79,10 +78,7 @@ export class CVTable extends ReatomLitElement {
|
|
|
79
78
|
|
|
80
79
|
[part='head-row'] {
|
|
81
80
|
display: table-row;
|
|
82
|
-
background: var(
|
|
83
|
-
--cv-table-header-background,
|
|
84
|
-
color-mix(in oklab, var(--cv-color-surface, #141923) 82%, transparent)
|
|
85
|
-
);
|
|
81
|
+
background: var(--cv-table-header-background, var(--cv-color-surface-glass-strong));
|
|
86
82
|
}
|
|
87
83
|
|
|
88
84
|
:host([sticky-header]) [part='head-row'] {
|
|
@@ -96,10 +92,7 @@ export class CVTable extends ReatomLitElement {
|
|
|
96
92
|
}
|
|
97
93
|
|
|
98
94
|
:host([striped]) ::slotted(cv-table-row:nth-child(even)) {
|
|
99
|
-
background: var(
|
|
100
|
-
--cv-table-stripe-background,
|
|
101
|
-
color-mix(in oklab, var(--cv-color-surface, #141923) 90%, transparent)
|
|
102
|
-
);
|
|
95
|
+
background: var(--cv-table-stripe-background, var(--cv-color-surface-secondary-glass-strong));
|
|
103
96
|
}
|
|
104
97
|
|
|
105
98
|
:host([compact]) ::slotted(cv-table-row) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createTabs, } from '@chromvoid/headless-ui/tabs';
|
|
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
|
import { CVTab } from './cv-tab.js';
|
|
5
6
|
import { CVTabPanel } from './cv-tab-panel.js';
|
|
@@ -105,7 +106,7 @@ export class CVTabs extends ReatomLitElement {
|
|
|
105
106
|
[part='panels'] {
|
|
106
107
|
border-radius: var(--cv-radius-md, 10px);
|
|
107
108
|
border: 1px solid var(--cv-color-border, #2a3245);
|
|
108
|
-
background:
|
|
109
|
+
background: var(--cv-color-surface-secondary-glass);
|
|
109
110
|
padding: var(--cv-space-3, 12px);
|
|
110
111
|
}
|
|
111
112
|
`,
|
|
@@ -4,6 +4,7 @@ import { FormAssociatedReatomElement } from '../form-associated/FormAssociatedRe
|
|
|
4
4
|
import type { FormAssociatedValidity } from '../form-associated/withFormAssociated.js';
|
|
5
5
|
type CVTextareaSize = 'small' | 'medium' | 'large';
|
|
6
6
|
type CVTextareaVariant = 'outlined' | 'filled';
|
|
7
|
+
type CVTextareaEnterBehavior = 'newline' | 'submit';
|
|
7
8
|
export interface CVTextareaValueDetail {
|
|
8
9
|
value: string;
|
|
9
10
|
}
|
|
@@ -64,6 +65,11 @@ export declare class CVTextarea extends FormAssociatedReatomElement {
|
|
|
64
65
|
type: StringConstructor;
|
|
65
66
|
reflect: boolean;
|
|
66
67
|
};
|
|
68
|
+
enterBehavior: {
|
|
69
|
+
type: StringConstructor;
|
|
70
|
+
reflect: boolean;
|
|
71
|
+
attribute: string;
|
|
72
|
+
};
|
|
67
73
|
name: {
|
|
68
74
|
type: StringConstructor;
|
|
69
75
|
};
|
|
@@ -80,6 +86,7 @@ export declare class CVTextarea extends FormAssociatedReatomElement {
|
|
|
80
86
|
resize: TextareaResize;
|
|
81
87
|
size: CVTextareaSize;
|
|
82
88
|
variant: CVTextareaVariant;
|
|
89
|
+
enterBehavior: CVTextareaEnterBehavior;
|
|
83
90
|
name: string;
|
|
84
91
|
private model;
|
|
85
92
|
private valueOnFocus;
|
|
@@ -94,15 +101,18 @@ export declare class CVTextarea extends FormAssociatedReatomElement {
|
|
|
94
101
|
protected onFormDisabledChanged(_disabled: boolean): void;
|
|
95
102
|
protected onFormReset(): void;
|
|
96
103
|
protected onFormStateRestore(state: string | File | FormData | null): void;
|
|
104
|
+
focus(options?: FocusOptions): void;
|
|
97
105
|
protected isFormAssociatedDisabled(): boolean;
|
|
98
106
|
protected getFormAssociatedValue(): string | File | FormData | null;
|
|
99
107
|
protected getFormAssociatedValidity(): FormAssociatedValidity;
|
|
100
108
|
private isEffectivelyDisabled;
|
|
101
109
|
private normalizeResize;
|
|
110
|
+
private normalizeEnterBehavior;
|
|
102
111
|
private toNonNegativeIntegerOrUndefined;
|
|
103
112
|
private handleNativeInput;
|
|
104
113
|
private handleNativeFocus;
|
|
105
114
|
private handleNativeBlur;
|
|
106
|
-
|
|
115
|
+
private handleNativeKeyDown;
|
|
116
|
+
protected render(): import("lit-html").TemplateResult<1>;
|
|
107
117
|
}
|
|
108
118
|
export {};
|
|
@@ -18,6 +18,7 @@ export class CVTextarea extends FormAssociatedReatomElement {
|
|
|
18
18
|
resize: { type: String, reflect: true },
|
|
19
19
|
size: { type: String, reflect: true },
|
|
20
20
|
variant: { type: String, reflect: true },
|
|
21
|
+
enterBehavior: { type: String, reflect: true, attribute: 'enter-behavior' },
|
|
21
22
|
name: { type: String },
|
|
22
23
|
};
|
|
23
24
|
}
|
|
@@ -39,6 +40,7 @@ export class CVTextarea extends FormAssociatedReatomElement {
|
|
|
39
40
|
this.resize = 'vertical';
|
|
40
41
|
this.size = 'medium';
|
|
41
42
|
this.variant = 'outlined';
|
|
43
|
+
this.enterBehavior = 'newline';
|
|
42
44
|
this.name = '';
|
|
43
45
|
this.model = this.createModel();
|
|
44
46
|
}
|
|
@@ -98,6 +100,7 @@ export class CVTextarea extends FormAssociatedReatomElement {
|
|
|
98
100
|
|
|
99
101
|
[part='form-control-label'] {
|
|
100
102
|
display: block;
|
|
103
|
+
margin-bottom: 5px;
|
|
101
104
|
}
|
|
102
105
|
|
|
103
106
|
[part='form-control-help-text'] {
|
|
@@ -235,6 +238,14 @@ export class CVTextarea extends FormAssociatedReatomElement {
|
|
|
235
238
|
this.value = state;
|
|
236
239
|
this.model.actions.setValue(state);
|
|
237
240
|
}
|
|
241
|
+
focus(options) {
|
|
242
|
+
const textarea = this.shadowRoot?.querySelector('[part="textarea"]');
|
|
243
|
+
if (textarea) {
|
|
244
|
+
textarea.focus(options);
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
247
|
+
super.focus(options);
|
|
248
|
+
}
|
|
238
249
|
isFormAssociatedDisabled() {
|
|
239
250
|
return this.isEffectivelyDisabled();
|
|
240
251
|
}
|
|
@@ -256,6 +267,9 @@ export class CVTextarea extends FormAssociatedReatomElement {
|
|
|
256
267
|
normalizeResize(resize) {
|
|
257
268
|
return resize === 'none' ? 'none' : 'vertical';
|
|
258
269
|
}
|
|
270
|
+
normalizeEnterBehavior(value) {
|
|
271
|
+
return value === 'submit' ? 'submit' : 'newline';
|
|
272
|
+
}
|
|
259
273
|
toNonNegativeIntegerOrUndefined(value) {
|
|
260
274
|
if (typeof value !== 'number' || !Number.isFinite(value) || value < 0) {
|
|
261
275
|
return undefined;
|
|
@@ -295,6 +309,24 @@ export class CVTextarea extends FormAssociatedReatomElement {
|
|
|
295
309
|
}
|
|
296
310
|
this.syncFormAssociatedState();
|
|
297
311
|
}
|
|
312
|
+
handleNativeKeyDown(event) {
|
|
313
|
+
if (this.normalizeEnterBehavior(this.enterBehavior) !== 'submit' ||
|
|
314
|
+
event.key !== 'Enter' ||
|
|
315
|
+
event.defaultPrevented ||
|
|
316
|
+
event.isComposing ||
|
|
317
|
+
event.shiftKey ||
|
|
318
|
+
event.altKey ||
|
|
319
|
+
event.ctrlKey ||
|
|
320
|
+
event.metaKey) {
|
|
321
|
+
return;
|
|
322
|
+
}
|
|
323
|
+
const form = this.form ?? this.closest('form');
|
|
324
|
+
if (!form) {
|
|
325
|
+
return;
|
|
326
|
+
}
|
|
327
|
+
event.preventDefault();
|
|
328
|
+
form.requestSubmit();
|
|
329
|
+
}
|
|
298
330
|
render() {
|
|
299
331
|
const textareaProps = this.model.contracts.getTextareaProps();
|
|
300
332
|
return html `
|
|
@@ -320,6 +352,7 @@ export class CVTextarea extends FormAssociatedReatomElement {
|
|
|
320
352
|
@input=${this.handleNativeInput}
|
|
321
353
|
@focus=${this.handleNativeFocus}
|
|
322
354
|
@blur=${this.handleNativeBlur}
|
|
355
|
+
@keydown=${this.handleNativeKeyDown}
|
|
323
356
|
></textarea>
|
|
324
357
|
</div>
|
|
325
358
|
<span part="form-control-help-text"><slot name="help-text"></slot></span>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { css
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
import { html } from '../reatom-lit/index.js';
|
|
2
3
|
import { ReatomLitElement } from '../reatom-lit/ReatomLitElement.js';
|
|
3
4
|
import { createToastController } from '../toast/create-toast-controller.js';
|
|
4
5
|
import { CVToast } from './cv-toast.js';
|
|
@@ -63,5 +63,5 @@ export declare class CVToast extends ReatomLitElement {
|
|
|
63
63
|
private handleActionClick;
|
|
64
64
|
updated(changedProperties: Map<string, unknown>): void;
|
|
65
65
|
private renderFallbackIcon;
|
|
66
|
-
protected render(): import("lit").TemplateResult
|
|
66
|
+
protected render(): import("lit-html").TemplateResult;
|
|
67
67
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { css,
|
|
1
|
+
import { css, nothing } from 'lit';
|
|
2
|
+
import { html } from '../reatom-lit/index.js';
|
|
2
3
|
import { ReatomLitElement } from '../reatom-lit/ReatomLitElement.js';
|
|
3
4
|
import { CVIcon } from './cv-icon.js';
|
|
4
5
|
import { CVSpinner } from './cv-spinner.js';
|
|
@@ -54,35 +55,19 @@ export class CVToast extends ReatomLitElement {
|
|
|
54
55
|
}
|
|
55
56
|
|
|
56
57
|
[part='base'][data-level='success'] {
|
|
57
|
-
border-color: color-
|
|
58
|
-
in oklab,
|
|
59
|
-
var(--cv-color-success, #6ef7c8) 45%,
|
|
60
|
-
var(--cv-color-border, #2a3245)
|
|
61
|
-
);
|
|
58
|
+
border-color: var(--cv-color-success-border-strong, var(--cv-color-success, #6ef7c8));
|
|
62
59
|
}
|
|
63
60
|
|
|
64
61
|
[part='base'][data-level='warning'] {
|
|
65
|
-
border-color: color-
|
|
66
|
-
in oklab,
|
|
67
|
-
var(--cv-color-warning, #ffd36e) 45%,
|
|
68
|
-
var(--cv-color-border, #2a3245)
|
|
69
|
-
);
|
|
62
|
+
border-color: var(--cv-color-warning-border-strong, var(--cv-color-warning, #ffd36e));
|
|
70
63
|
}
|
|
71
64
|
|
|
72
65
|
[part='base'][data-level='error'] {
|
|
73
|
-
border-color: color-
|
|
74
|
-
in oklab,
|
|
75
|
-
var(--cv-color-danger, #ff7d86) 45%,
|
|
76
|
-
var(--cv-color-border, #2a3245)
|
|
77
|
-
);
|
|
66
|
+
border-color: var(--cv-color-danger-border-strong, var(--cv-color-danger, #ff7d86));
|
|
78
67
|
}
|
|
79
68
|
|
|
80
69
|
[part='base'][data-level='loading'] {
|
|
81
|
-
border-color: color-
|
|
82
|
-
in oklab,
|
|
83
|
-
var(--cv-color-primary, #65d7ff) 40%,
|
|
84
|
-
var(--cv-color-border, #2a3245)
|
|
85
|
-
);
|
|
70
|
+
border-color: var(--cv-color-primary-border-strong, var(--cv-color-primary, #65d7ff));
|
|
86
71
|
}
|
|
87
72
|
|
|
88
73
|
[part='icon-wrap'] {
|
|
@@ -151,7 +136,7 @@ export class CVToast extends ReatomLitElement {
|
|
|
151
136
|
|
|
152
137
|
[part='action'] {
|
|
153
138
|
border: 1px solid var(--cv-color-border, #2a3245);
|
|
154
|
-
background: color-
|
|
139
|
+
background: var(--cv-color-surface-glass, var(--cv-color-surface-elevated, #1d2432));
|
|
155
140
|
color: var(--cv-color-text, #e8ecf6);
|
|
156
141
|
font: inherit;
|
|
157
142
|
font-size: var(--cv-font-size-xs, 0.75rem);
|
|
@@ -176,14 +161,22 @@ export class CVToast extends ReatomLitElement {
|
|
|
176
161
|
inset-inline: 0;
|
|
177
162
|
inset-block-end: 0;
|
|
178
163
|
block-size: var(--cv-toast-progress-height, 3px);
|
|
179
|
-
background:
|
|
180
|
-
90deg,
|
|
181
|
-
var(--cv-toast-accent, var(--cv-color-primary, #65d7ff)) 0%,
|
|
182
|
-
color-mix(in oklab, var(--cv-toast-accent, var(--cv-color-primary, #65d7ff)) 70%, white) 100%
|
|
183
|
-
);
|
|
164
|
+
background: var(--cv-gradient-progress-primary, var(--cv-gradient-primary));
|
|
184
165
|
transform-origin: left center;
|
|
185
166
|
}
|
|
186
167
|
|
|
168
|
+
[part='base'][data-level='success'] [part='progress'] {
|
|
169
|
+
background: var(--cv-gradient-progress-success, var(--cv-gradient-success));
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
[part='base'][data-level='warning'] [part='progress'] {
|
|
173
|
+
background: var(--cv-gradient-progress-warning, var(--cv-gradient-primary));
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
[part='base'][data-level='error'] [part='progress'] {
|
|
177
|
+
background: var(--cv-gradient-progress-danger, var(--cv-gradient-primary));
|
|
178
|
+
}
|
|
179
|
+
|
|
187
180
|
:host([progress]) [part='progress'] {
|
|
188
181
|
animation: cv-toast-progress var(--cv-toast-progress-duration, 5000ms) linear forwards;
|
|
189
182
|
animation-play-state: var(--cv-toast-progress-play-state, running);
|
|
@@ -21,5 +21,5 @@ export declare class CVToolbarItem extends LitElement {
|
|
|
21
21
|
constructor();
|
|
22
22
|
static styles: import("lit").CSSResult[];
|
|
23
23
|
static define(): void;
|
|
24
|
-
protected render(): import("lit").TemplateResult<1>;
|
|
24
|
+
protected render(): import("lit-html").TemplateResult<1>;
|
|
25
25
|
}
|
|
@@ -21,5 +21,5 @@ export declare class CVToolbarSeparator extends LitElement {
|
|
|
21
21
|
constructor();
|
|
22
22
|
static styles: import("lit").CSSResult[];
|
|
23
23
|
static define(): void;
|
|
24
|
-
protected render(): import("lit").TemplateResult<1>;
|
|
24
|
+
protected render(): import("lit-html").TemplateResult<1>;
|
|
25
25
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {} from '@chromvoid/headless-ui/interactions/composite-navigation';
|
|
2
2
|
import { createToolbar } from '@chromvoid/headless-ui/toolbar';
|
|
3
|
-
import { css,
|
|
3
|
+
import { css, nothing } from 'lit';
|
|
4
|
+
import { html } from '../reatom-lit/index.js';
|
|
4
5
|
import { ReatomLitElement } from '../reatom-lit/ReatomLitElement.js';
|
|
5
6
|
import { CVToolbarItem } from './cv-toolbar-item.js';
|
|
6
7
|
import { CVToolbarSeparator } from './cv-toolbar-separator.js';
|
|
@@ -79,5 +79,5 @@ export declare class CVTooltip extends ReatomLitElement {
|
|
|
79
79
|
show(): void;
|
|
80
80
|
/** Programmatically closes the tooltip (intended for manual trigger mode). */
|
|
81
81
|
hide(): void;
|
|
82
|
-
protected render(): import("lit").TemplateResult
|
|
82
|
+
protected render(): import("lit-html").TemplateResult;
|
|
83
83
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createTooltip } from '@chromvoid/headless-ui/tooltip';
|
|
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 supportsNativePopover = typeof HTMLElement !== 'undefined' &&
|
|
5
6
|
typeof HTMLElement.prototype.showPopover === 'function' &&
|
|
@@ -26,5 +26,5 @@ export declare class CVTreegridCell 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
|
}
|
|
@@ -33,5 +33,5 @@ export declare class CVTreegridColumn 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
|
}
|
|
@@ -28,7 +28,7 @@ export class CVTreegridColumn extends LitElement {
|
|
|
28
28
|
border-bottom: 1px solid var(--cv-color-border, #2a3245);
|
|
29
29
|
font-weight: 600;
|
|
30
30
|
color: var(--cv-color-text, #e8ecf6);
|
|
31
|
-
background:
|
|
31
|
+
background: var(--cv-color-surface-glass-strong);
|
|
32
32
|
outline: none;
|
|
33
33
|
}
|
|
34
34
|
|
|
@@ -51,5 +51,5 @@ export declare class CVTreegridRow extends LitElement {
|
|
|
51
51
|
static styles: import("lit").CSSResult[];
|
|
52
52
|
static define(): void;
|
|
53
53
|
private handleSlotChange;
|
|
54
|
-
protected render(): import("lit").TemplateResult<1>;
|
|
54
|
+
protected render(): import("lit-html").TemplateResult<1>;
|
|
55
55
|
}
|
|
@@ -43,7 +43,7 @@ export class CVTreegridRow extends LitElement {
|
|
|
43
43
|
|
|
44
44
|
:host([active]) [part='row'],
|
|
45
45
|
:host([selected]) [part='row'] {
|
|
46
|
-
background:
|
|
46
|
+
background: var(--cv-color-active);
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
:host([disabled]) [part='row'],
|
|
@@ -92,5 +92,5 @@ export declare class CVTreegrid extends ReatomLitElement {
|
|
|
92
92
|
private setActiveCellFromRecord;
|
|
93
93
|
private handleTreegridKeyDown;
|
|
94
94
|
private handleSlotChange;
|
|
95
|
-
protected render(): import("lit").TemplateResult
|
|
95
|
+
protected render(): import("lit-html").TemplateResult;
|
|
96
96
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createTreegrid, } from '@chromvoid/headless-ui/treegrid';
|
|
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
|
import { CVTreegridCell } from './cv-treegrid-cell.js';
|
|
5
6
|
import { CVTreegridColumn } from './cv-treegrid-column.js';
|
|
@@ -351,7 +352,7 @@ export class CVTreegrid extends ReatomLitElement {
|
|
|
351
352
|
if (!record.valid)
|
|
352
353
|
continue;
|
|
353
354
|
const focus = () => this.handleCellFocus(record);
|
|
354
|
-
const click = (
|
|
355
|
+
const click = () => this.handleCellPointer(record);
|
|
355
356
|
record.element.addEventListener('focus', focus);
|
|
356
357
|
record.element.addEventListener('click', click);
|
|
357
358
|
this.cellListeners.set(record.element, { focus, click });
|
|
@@ -572,7 +573,7 @@ export class CVTreegrid extends ReatomLitElement {
|
|
|
572
573
|
this.model.contracts.getCellProps(record.rowId, record.colId).onFocus();
|
|
573
574
|
this.applyInteractionResult(previous);
|
|
574
575
|
};
|
|
575
|
-
handleCellPointer = (
|
|
576
|
+
handleCellPointer = (record) => {
|
|
576
577
|
if (record.element.disabled)
|
|
577
578
|
return;
|
|
578
579
|
const previous = this.captureSnapshot();
|
|
@@ -54,5 +54,5 @@ export declare class CVTreeItem extends LitElement {
|
|
|
54
54
|
static styles: import("lit").CSSResult[];
|
|
55
55
|
static define(): void;
|
|
56
56
|
private handleToggleClick;
|
|
57
|
-
protected render(): import("lit").TemplateResult<1>;
|
|
57
|
+
protected render(): import("lit-html").TemplateResult<1>;
|
|
58
58
|
}
|
|
@@ -51,11 +51,11 @@ export class CVTreeItem extends LitElement {
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
:host([active]) [part='row'] {
|
|
54
|
-
background:
|
|
54
|
+
background: var(--cv-color-primary-ring);
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
:host([selected]) [part='row'] {
|
|
58
|
-
background:
|
|
58
|
+
background: var(--cv-color-primary-border);
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
:host([disabled]) [part='row'] {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createTreeview } from '@chromvoid/headless-ui/treeview';
|
|
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
|
import { CVTreeItem } from './cv-treeitem.js';
|
|
5
6
|
const treeviewKeysToPrevent = new Set([
|
|
@@ -75,5 +75,5 @@ export declare class CVWindowSplitter extends ReatomLitElement {
|
|
|
75
75
|
private _onPointerMove;
|
|
76
76
|
private _onPointerUp;
|
|
77
77
|
private _onLostPointerCapture;
|
|
78
|
-
protected render(): import("lit").TemplateResult
|
|
78
|
+
protected render(): import("lit-html").TemplateResult;
|
|
79
79
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createWindowSplitter, } from '@chromvoid/headless-ui/window-splitter';
|
|
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 splitterKeysToPrevent = new Set([
|
|
5
6
|
'ArrowLeft',
|
|
@@ -5,6 +5,8 @@ export { CVAlert } from './cv-alert.js';
|
|
|
5
5
|
export { CVBreadcrumb } from './cv-breadcrumb.js';
|
|
6
6
|
export { CVBreadcrumbItem } from './cv-breadcrumb-item.js';
|
|
7
7
|
export { CVBadge } from './cv-badge.js';
|
|
8
|
+
export { CVBottomSheet } from './cv-bottom-sheet.js';
|
|
9
|
+
export type { CVBottomSheetChangeEvent, CVBottomSheetDetent, CVBottomSheetEventDetail, CVBottomSheetEventMap, CVBottomSheetInputEvent, } from './cv-bottom-sheet.js';
|
|
8
10
|
export { CVButton } from './cv-button.js';
|
|
9
11
|
export { CVCallout } from './cv-callout.js';
|
|
10
12
|
export { CVCopyButton } from './cv-copy-button.js';
|
|
@@ -28,6 +30,10 @@ export { CVGridCell } from './cv-grid-cell.js';
|
|
|
28
30
|
export { CVGridColumn } from './cv-grid-column.js';
|
|
29
31
|
export { CVGridRow } from './cv-grid-row.js';
|
|
30
32
|
export { CVGrid } from './cv-grid.js';
|
|
33
|
+
export { CVGuidanceAnchor, GUIDANCE_ANCHOR_REGISTER_EVENT, GUIDANCE_ANCHOR_UNREGISTER_EVENT, } from './cv-guidance-anchor.js';
|
|
34
|
+
export type { CVGuidanceAnchorEventDetail, CVGuidanceAnchorRegisterEvent, CVGuidanceAnchorUnregisterEvent, } from './cv-guidance-anchor.js';
|
|
35
|
+
export { CVGuidancePanel } from './cv-guidance-panel.js';
|
|
36
|
+
export type { GuidancePanelDensity, GuidancePanelVariant } from './cv-guidance-panel.js';
|
|
31
37
|
export { CVIcon } from './cv-icon.js';
|
|
32
38
|
export { CVInput } from './cv-input.js';
|
|
33
39
|
export type { CVAccordionItemEventMap, CVAccordionItemTriggerClickEvent, CVAccordionItemTriggerFocusEvent, CVAccordionItemTriggerKeydownDetail, CVAccordionItemTriggerKeydownEvent, } from './cv-accordion-item.js';
|
|
@@ -57,6 +63,7 @@ export { CVMeter } from './cv-meter.js';
|
|
|
57
63
|
export { CVNumber } from './cv-number.js';
|
|
58
64
|
export { CVOption } from './cv-option.js';
|
|
59
65
|
export { CVPopover } from './cv-popover.js';
|
|
66
|
+
export type { CVPopoverAnchor, CVPopoverEventDetail, CVPopoverPlacement, CVPopoverShowOptions, CVPopoverTriggerMode, } from './cv-popover.js';
|
|
60
67
|
export { CVProgress } from './cv-progress.js';
|
|
61
68
|
export { CVProgressRing } from './cv-progress-ring.js';
|
|
62
69
|
export { CVRadio } from './cv-radio.js';
|
package/dist/components/index.js
CHANGED
|
@@ -5,6 +5,7 @@ export { CVAlert } from './cv-alert.js';
|
|
|
5
5
|
export { CVBreadcrumb } from './cv-breadcrumb.js';
|
|
6
6
|
export { CVBreadcrumbItem } from './cv-breadcrumb-item.js';
|
|
7
7
|
export { CVBadge } from './cv-badge.js';
|
|
8
|
+
export { CVBottomSheet } from './cv-bottom-sheet.js';
|
|
8
9
|
export { CVButton } from './cv-button.js';
|
|
9
10
|
export { CVCallout } from './cv-callout.js';
|
|
10
11
|
export { CVCopyButton } from './cv-copy-button.js';
|
|
@@ -28,6 +29,8 @@ export { CVGridCell } from './cv-grid-cell.js';
|
|
|
28
29
|
export { CVGridColumn } from './cv-grid-column.js';
|
|
29
30
|
export { CVGridRow } from './cv-grid-row.js';
|
|
30
31
|
export { CVGrid } from './cv-grid.js';
|
|
32
|
+
export { CVGuidanceAnchor, GUIDANCE_ANCHOR_REGISTER_EVENT, GUIDANCE_ANCHOR_UNREGISTER_EVENT, } from './cv-guidance-anchor.js';
|
|
33
|
+
export { CVGuidancePanel } from './cv-guidance-panel.js';
|
|
31
34
|
export { CVIcon } from './cv-icon.js';
|
|
32
35
|
export { CVInput } from './cv-input.js';
|
|
33
36
|
export { CVLandmark } from './cv-landmark.js';
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import { type TemplateResult } from 'lit';
|
|
2
|
-
export type DialogPriority = 'polite' | 'assertive';
|
|
3
2
|
export interface DialogControllerAdapters {
|
|
4
|
-
announce?: (message: string, priority?: DialogPriority) => void;
|
|
5
|
-
setInertExcept?: (element: HTMLElement) => void;
|
|
6
|
-
restoreInert?: () => void;
|
|
7
3
|
findFirstFocusable?: (container: Element) => HTMLElement | null;
|
|
4
|
+
createCustomDialogElement?: () => ManagedDialogSurfaceElement;
|
|
8
5
|
}
|
|
9
6
|
export interface ManagedDialogOptions<T> {
|
|
10
7
|
element: HTMLElement;
|
|
11
8
|
title?: string;
|
|
12
9
|
show: () => Promise<T>;
|
|
13
10
|
close: () => void;
|
|
11
|
+
autoFocus?: boolean;
|
|
14
12
|
}
|
|
15
13
|
export interface CustomDialogOptions {
|
|
16
14
|
title?: string;
|
|
@@ -25,7 +23,17 @@ export interface CustomDialogOptions {
|
|
|
25
23
|
export interface DialogController {
|
|
26
24
|
present<T>(options: ManagedDialogOptions<T>): Promise<T>;
|
|
27
25
|
showCustom<T>(options: CustomDialogOptions, resultHandler: (dialog: HTMLElement, resolve: (value: T | null) => void) => void): Promise<T | null>;
|
|
26
|
+
closeTop(): boolean;
|
|
28
27
|
closeAll(): void;
|
|
29
28
|
getActiveCount(): number;
|
|
30
29
|
}
|
|
30
|
+
export interface ManagedDialogSurfaceElement extends HTMLElement {
|
|
31
|
+
open: boolean;
|
|
32
|
+
noHeader: boolean;
|
|
33
|
+
closable: boolean;
|
|
34
|
+
closeOnEscape: boolean;
|
|
35
|
+
closeOnOutsidePointer: boolean;
|
|
36
|
+
closeOnOutsideFocus: boolean;
|
|
37
|
+
updateComplete?: Promise<boolean>;
|
|
38
|
+
}
|
|
31
39
|
export declare function createDialogController(adapters?: DialogControllerAdapters): DialogController;
|