@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
|
@@ -38,11 +38,11 @@ export class CVCommandItem extends LitElement {
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
:host([active]) [part='base'] {
|
|
41
|
-
background:
|
|
41
|
+
background: var(--cv-color-primary-ring);
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
:host([selected]) [part='base'] {
|
|
45
|
-
background:
|
|
45
|
+
background: var(--cv-color-primary-border);
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
:host([disabled]) [part='base'] {
|
|
@@ -101,5 +101,5 @@ export declare class CVCommandPalette extends ReatomLitElement {
|
|
|
101
101
|
private handleInputKeyDown;
|
|
102
102
|
private handleItemClick;
|
|
103
103
|
private handleSlotChange;
|
|
104
|
-
protected render(): import("lit").TemplateResult
|
|
104
|
+
protected render(): import("lit-html").TemplateResult;
|
|
105
105
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createCommandPalette } from '@chromvoid/headless-ui/command-palette';
|
|
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 { CVCommandItem } from './cv-command-item.js';
|
|
5
6
|
const commandPaletteKeysToPrevent = new Set(['ArrowUp', 'ArrowDown', 'Home', 'End', 'Enter', 'Escape']);
|
|
@@ -79,10 +80,28 @@ export class CVCommandPalette extends ReatomLitElement {
|
|
|
79
80
|
border: 1px solid var(--cv-color-border, #2a3245);
|
|
80
81
|
background: var(--cv-color-surface-elevated, #1d2432);
|
|
81
82
|
box-shadow: var(--cv-shadow-2, 0 8px 30px rgba(0, 0, 0, 0.35));
|
|
83
|
+
opacity: 1;
|
|
84
|
+
transform: translate3d(0, 0, 0);
|
|
85
|
+
transition:
|
|
86
|
+
opacity var(--cv-command-palette-transition-duration, var(--cv-duration-fast, 120ms))
|
|
87
|
+
var(--cv-easing-standard, ease),
|
|
88
|
+
transform var(--cv-command-palette-transition-duration, var(--cv-duration-fast, 120ms))
|
|
89
|
+
var(--cv-easing-standard, ease),
|
|
90
|
+
display var(--cv-command-palette-transition-duration, var(--cv-duration-fast, 120ms)) allow-discrete;
|
|
91
|
+
transition-behavior: allow-discrete;
|
|
82
92
|
}
|
|
83
93
|
|
|
84
94
|
[part='dialog'][hidden] {
|
|
85
95
|
display: none;
|
|
96
|
+
opacity: 0;
|
|
97
|
+
transform: translate3d(0, -4px, 0);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
@starting-style {
|
|
101
|
+
[part='dialog']:not([hidden]) {
|
|
102
|
+
opacity: 0;
|
|
103
|
+
transform: translate3d(0, -4px, 0);
|
|
104
|
+
}
|
|
86
105
|
}
|
|
87
106
|
|
|
88
107
|
[part='input'] {
|
|
@@ -542,6 +561,7 @@ export class CVCommandPalette extends ReatomLitElement {
|
|
|
542
561
|
aria-modal=${dialogProps['aria-modal']}
|
|
543
562
|
aria-label=${dialogProps['aria-label'] ?? nothing}
|
|
544
563
|
?hidden=${dialogProps.hidden}
|
|
564
|
+
class="cv-u-discrete-presence"
|
|
545
565
|
part="dialog"
|
|
546
566
|
@keydown=${this.handleDialogKeyDown}
|
|
547
567
|
>
|
|
@@ -94,5 +94,5 @@ export declare class CVContextMenu extends ReatomLitElement {
|
|
|
94
94
|
private handleMenuKeyDown;
|
|
95
95
|
private handleItemClick;
|
|
96
96
|
private handleSlotChange;
|
|
97
|
-
protected render(): import("lit").TemplateResult
|
|
97
|
+
protected render(): import("lit-html").TemplateResult;
|
|
98
98
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createContextMenu } from '@chromvoid/headless-ui/context-menu';
|
|
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 { CVMenuItem } from './cv-menu-item.js';
|
|
5
6
|
const contextMenuKeysToPrevent = new Set([
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { type CopyButtonValue } from '@chromvoid/headless-ui/copy-button';
|
|
1
|
+
import { type ClipboardAdapter, type CopyButtonValue } from '@chromvoid/headless-ui/copy-button';
|
|
2
2
|
import type { PropertyValues } from 'lit';
|
|
3
3
|
import { ReatomLitElement } from '../reatom-lit/ReatomLitElement.js';
|
|
4
4
|
type CVCopyButtonSize = 'small' | 'medium' | 'large';
|
|
5
|
+
type CVCopyButtonAppearance = 'default' | 'plain';
|
|
5
6
|
export interface CVCopyButtonCopyDetail {
|
|
6
7
|
value: string;
|
|
7
8
|
}
|
|
@@ -20,6 +21,9 @@ export declare class CVCopyButton extends ReatomLitElement {
|
|
|
20
21
|
value: {
|
|
21
22
|
attribute: boolean;
|
|
22
23
|
};
|
|
24
|
+
clipboard: {
|
|
25
|
+
attribute: boolean;
|
|
26
|
+
};
|
|
23
27
|
disabled: {
|
|
24
28
|
type: BooleanConstructor;
|
|
25
29
|
reflect: boolean;
|
|
@@ -33,20 +37,44 @@ export declare class CVCopyButton extends ReatomLitElement {
|
|
|
33
37
|
type: StringConstructor;
|
|
34
38
|
reflect: boolean;
|
|
35
39
|
};
|
|
40
|
+
appearance: {
|
|
41
|
+
type: StringConstructor;
|
|
42
|
+
reflect: boolean;
|
|
43
|
+
};
|
|
44
|
+
successLabel: {
|
|
45
|
+
type: StringConstructor;
|
|
46
|
+
attribute: string;
|
|
47
|
+
};
|
|
48
|
+
errorLabel: {
|
|
49
|
+
type: StringConstructor;
|
|
50
|
+
attribute: string;
|
|
51
|
+
};
|
|
52
|
+
ariaLabel: {
|
|
53
|
+
type: StringConstructor;
|
|
54
|
+
attribute: string;
|
|
55
|
+
};
|
|
36
56
|
};
|
|
37
57
|
value: CopyButtonValue;
|
|
38
58
|
disabled: boolean;
|
|
39
59
|
feedbackDuration: number;
|
|
40
60
|
size: CVCopyButtonSize;
|
|
41
|
-
|
|
61
|
+
appearance: CVCopyButtonAppearance;
|
|
42
62
|
private model;
|
|
63
|
+
private clipboardAdapter?;
|
|
64
|
+
private successText;
|
|
65
|
+
private errorText;
|
|
66
|
+
private idleAriaLabel;
|
|
67
|
+
get clipboard(): ClipboardAdapter | undefined;
|
|
68
|
+
set clipboard(clip: ClipboardAdapter | undefined);
|
|
69
|
+
get successLabel(): string;
|
|
70
|
+
set successLabel(label: string | null | undefined);
|
|
71
|
+
get errorLabel(): string;
|
|
72
|
+
set errorLabel(label: string | null | undefined);
|
|
73
|
+
get ariaLabel(): string | null;
|
|
74
|
+
set ariaLabel(label: string | null | undefined);
|
|
43
75
|
/** @internal Overridable clipboard adapter for testing */
|
|
44
|
-
get _clipboard():
|
|
45
|
-
|
|
46
|
-
} | undefined;
|
|
47
|
-
set _clipboard(clip: {
|
|
48
|
-
writeText(text: string): Promise<void>;
|
|
49
|
-
} | undefined);
|
|
76
|
+
get _clipboard(): ClipboardAdapter | undefined;
|
|
77
|
+
set _clipboard(clip: ClipboardAdapter | undefined);
|
|
50
78
|
constructor();
|
|
51
79
|
static styles: import("lit").CSSResult[];
|
|
52
80
|
static define(): void;
|
|
@@ -56,6 +84,6 @@ export declare class CVCopyButton extends ReatomLitElement {
|
|
|
56
84
|
private handleClick;
|
|
57
85
|
private handleKeyDown;
|
|
58
86
|
private handleKeyUp;
|
|
59
|
-
protected render(): import("lit").TemplateResult
|
|
87
|
+
protected render(): import("lit-html").TemplateResult;
|
|
60
88
|
}
|
|
61
89
|
export {};
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { createCopyButton, } from '@chromvoid/headless-ui/copy-button';
|
|
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';
|
|
5
|
+
const DEFAULT_SUCCESS_LABEL = 'Copied';
|
|
6
|
+
const DEFAULT_ERROR_LABEL = 'Copy failed';
|
|
4
7
|
// Default SVG icons
|
|
5
8
|
const copyIcon = html `
|
|
6
9
|
<svg
|
|
@@ -48,21 +51,82 @@ export class CVCopyButton extends ReatomLitElement {
|
|
|
48
51
|
static get properties() {
|
|
49
52
|
return {
|
|
50
53
|
value: { attribute: false },
|
|
54
|
+
clipboard: { attribute: false },
|
|
51
55
|
disabled: { type: Boolean, reflect: true },
|
|
52
56
|
feedbackDuration: { type: Number, reflect: true, attribute: 'feedback-duration' },
|
|
53
57
|
size: { type: String, reflect: true },
|
|
58
|
+
appearance: { type: String, reflect: true },
|
|
59
|
+
successLabel: { type: String, attribute: 'success-label' },
|
|
60
|
+
errorLabel: { type: String, attribute: 'error-label' },
|
|
61
|
+
ariaLabel: { type: String, attribute: 'aria-label' },
|
|
54
62
|
};
|
|
55
63
|
}
|
|
56
|
-
__clipboard;
|
|
57
64
|
model;
|
|
65
|
+
clipboardAdapter;
|
|
66
|
+
successText = DEFAULT_SUCCESS_LABEL;
|
|
67
|
+
errorText = DEFAULT_ERROR_LABEL;
|
|
68
|
+
idleAriaLabel = null;
|
|
69
|
+
get clipboard() {
|
|
70
|
+
return this.clipboardAdapter;
|
|
71
|
+
}
|
|
72
|
+
set clipboard(clip) {
|
|
73
|
+
const old = this.clipboardAdapter;
|
|
74
|
+
if (old === clip)
|
|
75
|
+
return;
|
|
76
|
+
this.clipboardAdapter = clip;
|
|
77
|
+
if (this.model) {
|
|
78
|
+
this.model = this._createModel();
|
|
79
|
+
}
|
|
80
|
+
this.requestUpdate('clipboard', old);
|
|
81
|
+
}
|
|
82
|
+
get successLabel() {
|
|
83
|
+
return this.successText;
|
|
84
|
+
}
|
|
85
|
+
set successLabel(label) {
|
|
86
|
+
const old = this.successText;
|
|
87
|
+
const next = label || DEFAULT_SUCCESS_LABEL;
|
|
88
|
+
if (old === next)
|
|
89
|
+
return;
|
|
90
|
+
this.successText = next;
|
|
91
|
+
if (this.model) {
|
|
92
|
+
this.model = this._createModel();
|
|
93
|
+
}
|
|
94
|
+
this.requestUpdate('successLabel', old);
|
|
95
|
+
}
|
|
96
|
+
get errorLabel() {
|
|
97
|
+
return this.errorText;
|
|
98
|
+
}
|
|
99
|
+
set errorLabel(label) {
|
|
100
|
+
const old = this.errorText;
|
|
101
|
+
const next = label || DEFAULT_ERROR_LABEL;
|
|
102
|
+
if (old === next)
|
|
103
|
+
return;
|
|
104
|
+
this.errorText = next;
|
|
105
|
+
if (this.model) {
|
|
106
|
+
this.model = this._createModel();
|
|
107
|
+
}
|
|
108
|
+
this.requestUpdate('errorLabel', old);
|
|
109
|
+
}
|
|
110
|
+
get ariaLabel() {
|
|
111
|
+
return this.idleAriaLabel;
|
|
112
|
+
}
|
|
113
|
+
set ariaLabel(label) {
|
|
114
|
+
const old = this.idleAriaLabel;
|
|
115
|
+
const next = label ?? null;
|
|
116
|
+
if (old === next)
|
|
117
|
+
return;
|
|
118
|
+
this.idleAriaLabel = next;
|
|
119
|
+
if (this.model) {
|
|
120
|
+
this.model = this._createModel();
|
|
121
|
+
}
|
|
122
|
+
this.requestUpdate('ariaLabel', old);
|
|
123
|
+
}
|
|
58
124
|
/** @internal Overridable clipboard adapter for testing */
|
|
59
125
|
get _clipboard() {
|
|
60
|
-
return this.
|
|
126
|
+
return this.clipboard;
|
|
61
127
|
}
|
|
62
128
|
set _clipboard(clip) {
|
|
63
|
-
this.
|
|
64
|
-
this.model = this._createModel();
|
|
65
|
-
this.requestUpdate();
|
|
129
|
+
this.clipboard = clip;
|
|
66
130
|
}
|
|
67
131
|
constructor() {
|
|
68
132
|
super();
|
|
@@ -70,6 +134,7 @@ export class CVCopyButton extends ReatomLitElement {
|
|
|
70
134
|
this.disabled = false;
|
|
71
135
|
this.feedbackDuration = 1500;
|
|
72
136
|
this.size = 'medium';
|
|
137
|
+
this.appearance = 'default';
|
|
73
138
|
this.model = this._createModel();
|
|
74
139
|
}
|
|
75
140
|
static styles = [
|
|
@@ -89,9 +154,9 @@ export class CVCopyButton extends ReatomLitElement {
|
|
|
89
154
|
width: var(--cv-copy-button-size);
|
|
90
155
|
height: var(--cv-copy-button-size);
|
|
91
156
|
border-radius: var(--cv-copy-button-border-radius);
|
|
92
|
-
border: 1px solid var(--cv-color-border, #2a3245);
|
|
93
|
-
background: var(--cv-color-surface, #141923);
|
|
94
|
-
color: var(--cv-color-text, #e8ecf6);
|
|
157
|
+
border: 1px solid var(--cv-copy-button-border-color, var(--cv-color-border, #2a3245));
|
|
158
|
+
background: var(--cv-copy-button-background, var(--cv-color-surface, #141923));
|
|
159
|
+
color: var(--cv-copy-button-color, var(--cv-color-text, #e8ecf6));
|
|
95
160
|
cursor: pointer;
|
|
96
161
|
user-select: none;
|
|
97
162
|
padding: 0;
|
|
@@ -103,7 +168,12 @@ export class CVCopyButton extends ReatomLitElement {
|
|
|
103
168
|
}
|
|
104
169
|
|
|
105
170
|
[part='base']:hover {
|
|
106
|
-
|
|
171
|
+
background: var(
|
|
172
|
+
--cv-copy-button-hover-background,
|
|
173
|
+
var(--cv-copy-button-background, var(--cv-color-surface, #141923))
|
|
174
|
+
);
|
|
175
|
+
border-color: var(--cv-copy-button-hover-border-color, var(--cv-color-primary, #65d7ff));
|
|
176
|
+
color: var(--cv-copy-button-hover-color, var(--cv-copy-button-color, var(--cv-color-text, #e8ecf6)));
|
|
107
177
|
}
|
|
108
178
|
|
|
109
179
|
[part='base']:focus-visible {
|
|
@@ -122,6 +192,14 @@ export class CVCopyButton extends ReatomLitElement {
|
|
|
122
192
|
position: absolute;
|
|
123
193
|
top: 0;
|
|
124
194
|
left: 0;
|
|
195
|
+
opacity: 0;
|
|
196
|
+
pointer-events: none;
|
|
197
|
+
transform: scale(0.78);
|
|
198
|
+
filter: blur(2px);
|
|
199
|
+
transition:
|
|
200
|
+
opacity var(--cv-duration-fast, 120ms) var(--cv-easing-standard, ease),
|
|
201
|
+
transform var(--cv-duration-fast, 120ms) var(--cv-easing-decelerate, ease-out),
|
|
202
|
+
filter var(--cv-duration-fast, 120ms) var(--cv-easing-standard, ease);
|
|
125
203
|
}
|
|
126
204
|
|
|
127
205
|
[part='copy-icon'] svg,
|
|
@@ -157,10 +235,29 @@ export class CVCopyButton extends ReatomLitElement {
|
|
|
157
235
|
pointer-events: none;
|
|
158
236
|
}
|
|
159
237
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
238
|
+
:host([appearance='plain']) [part='base'] {
|
|
239
|
+
background: var(--cv-copy-button-plain-background, transparent);
|
|
240
|
+
border-color: var(--cv-copy-button-plain-border-color, transparent);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
:host([appearance='plain']) [part='base']:hover {
|
|
244
|
+
background: var(
|
|
245
|
+
--cv-copy-button-plain-hover-background,
|
|
246
|
+
var(--cv-copy-button-hover-background, transparent)
|
|
247
|
+
);
|
|
248
|
+
border-color: var(
|
|
249
|
+
--cv-copy-button-plain-hover-border-color,
|
|
250
|
+
var(--cv-copy-button-plain-border-color, transparent)
|
|
251
|
+
);
|
|
252
|
+
color: var(--cv-copy-button-plain-hover-color, var(--cv-copy-button-hover-color, currentColor));
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
:host([status='idle']) [part='copy-icon'],
|
|
256
|
+
:host([status='success']) [part='success-icon'],
|
|
257
|
+
:host([status='error']) [part='error-icon'] {
|
|
258
|
+
opacity: 1;
|
|
259
|
+
transform: scale(1);
|
|
260
|
+
filter: blur(0);
|
|
164
261
|
}
|
|
165
262
|
|
|
166
263
|
/* --- status: success --- */
|
|
@@ -169,22 +266,12 @@ export class CVCopyButton extends ReatomLitElement {
|
|
|
169
266
|
border-color: var(--cv-copy-button-success-color);
|
|
170
267
|
}
|
|
171
268
|
|
|
172
|
-
:host([status='success']) [part='copy-icon'],
|
|
173
|
-
:host([status='success']) [part='error-icon'] {
|
|
174
|
-
display: none;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
269
|
/* --- status: error --- */
|
|
178
270
|
:host([status='error']) [part='base'] {
|
|
179
271
|
color: var(--cv-copy-button-error-color);
|
|
180
272
|
border-color: var(--cv-copy-button-error-color);
|
|
181
273
|
}
|
|
182
274
|
|
|
183
|
-
:host([status='error']) [part='copy-icon'],
|
|
184
|
-
:host([status='error']) [part='success-icon'] {
|
|
185
|
-
display: none;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
275
|
/* --- copying --- */
|
|
189
276
|
:host([copying]) {
|
|
190
277
|
cursor: progress;
|
|
@@ -202,6 +289,16 @@ export class CVCopyButton extends ReatomLitElement {
|
|
|
202
289
|
:host([size='large']) {
|
|
203
290
|
--cv-copy-button-size: 42px;
|
|
204
291
|
}
|
|
292
|
+
|
|
293
|
+
@media (prefers-reduced-motion: reduce) {
|
|
294
|
+
[part='copy-icon'],
|
|
295
|
+
[part='success-icon'],
|
|
296
|
+
[part='error-icon'] {
|
|
297
|
+
transform: none;
|
|
298
|
+
filter: none;
|
|
299
|
+
transition: opacity var(--cv-duration-fast, 120ms) var(--cv-easing-standard, ease);
|
|
300
|
+
}
|
|
301
|
+
}
|
|
205
302
|
`,
|
|
206
303
|
];
|
|
207
304
|
static define() {
|
|
@@ -214,7 +311,10 @@ export class CVCopyButton extends ReatomLitElement {
|
|
|
214
311
|
value: this.value,
|
|
215
312
|
isDisabled: this.disabled,
|
|
216
313
|
feedbackDuration: this.feedbackDuration,
|
|
217
|
-
|
|
314
|
+
ariaLabel: this.ariaLabel ?? undefined,
|
|
315
|
+
successLabel: this.successLabel,
|
|
316
|
+
errorLabel: this.errorLabel,
|
|
317
|
+
clipboard: this.clipboard,
|
|
218
318
|
onCopy: (value) => {
|
|
219
319
|
this.dispatchEvent(new CustomEvent('cv-copy', {
|
|
220
320
|
detail: { value },
|
|
@@ -273,7 +373,7 @@ export class CVCopyButton extends ReatomLitElement {
|
|
|
273
373
|
const successIconProps = this.model.contracts.getIconContainerProps('success');
|
|
274
374
|
const errorIconProps = this.model.contracts.getIconContainerProps('error');
|
|
275
375
|
const statusText = this.model.state.status();
|
|
276
|
-
const statusAnnouncement = statusText === 'success' ?
|
|
376
|
+
const statusAnnouncement = statusText === 'success' ? this.successLabel : statusText === 'error' ? this.errorLabel : nothing;
|
|
277
377
|
return html `
|
|
278
378
|
<div
|
|
279
379
|
part="base"
|
|
@@ -285,25 +385,13 @@ export class CVCopyButton extends ReatomLitElement {
|
|
|
285
385
|
@keydown=${this.handleKeyDown}
|
|
286
386
|
@keyup=${this.handleKeyUp}
|
|
287
387
|
>
|
|
288
|
-
<span
|
|
289
|
-
part="copy-icon"
|
|
290
|
-
aria-hidden=${copyIconProps['aria-hidden']}
|
|
291
|
-
.hidden=${copyIconProps.hidden ?? false}
|
|
292
|
-
>
|
|
388
|
+
<span part="copy-icon" aria-hidden=${copyIconProps['aria-hidden']}>
|
|
293
389
|
<slot name="copy-icon">${copyIcon}</slot>
|
|
294
390
|
</span>
|
|
295
|
-
<span
|
|
296
|
-
part="success-icon"
|
|
297
|
-
aria-hidden=${successIconProps['aria-hidden']}
|
|
298
|
-
.hidden=${successIconProps.hidden ?? false}
|
|
299
|
-
>
|
|
391
|
+
<span part="success-icon" aria-hidden=${successIconProps['aria-hidden']}>
|
|
300
392
|
<slot name="success-icon">${successIcon}</slot>
|
|
301
393
|
</span>
|
|
302
|
-
<span
|
|
303
|
-
part="error-icon"
|
|
304
|
-
aria-hidden=${errorIconProps['aria-hidden']}
|
|
305
|
-
.hidden=${errorIconProps.hidden ?? false}
|
|
306
|
-
>
|
|
394
|
+
<span part="error-icon" aria-hidden=${errorIconProps['aria-hidden']}>
|
|
307
395
|
<slot name="error-icon">${errorIcon}</slot>
|
|
308
396
|
</span>
|
|
309
397
|
<span
|
|
@@ -156,6 +156,6 @@ export declare class CVDatePicker extends FormAssociatedReatomElement {
|
|
|
156
156
|
protected getFormAssociatedValidity(): FormAssociatedValidity;
|
|
157
157
|
private isEffectivelyDisabled;
|
|
158
158
|
private formatMonthLabel;
|
|
159
|
-
protected render(): import("lit").TemplateResult<1>;
|
|
159
|
+
protected render(): import("lit-html").TemplateResult<1>;
|
|
160
160
|
}
|
|
161
161
|
export {};
|
|
@@ -120,10 +120,28 @@ export class CVDatePicker extends FormAssociatedReatomElement {
|
|
|
120
120
|
border-radius: var(--cv-date-picker-border-radius, var(--cv-radius-md, 10px));
|
|
121
121
|
border: 1px solid var(--cv-color-border, #2a3245);
|
|
122
122
|
background: var(--cv-color-surface-elevated, #1d2432);
|
|
123
|
+
opacity: 1;
|
|
124
|
+
transform: translate3d(0, 0, 0);
|
|
125
|
+
transition:
|
|
126
|
+
opacity var(--cv-date-picker-transition-duration, var(--cv-duration-fast, 120ms))
|
|
127
|
+
var(--cv-easing-standard, ease),
|
|
128
|
+
transform var(--cv-date-picker-transition-duration, var(--cv-duration-fast, 120ms))
|
|
129
|
+
var(--cv-easing-standard, ease),
|
|
130
|
+
display var(--cv-date-picker-transition-duration, var(--cv-duration-fast, 120ms)) allow-discrete;
|
|
131
|
+
transition-behavior: allow-discrete;
|
|
123
132
|
}
|
|
124
133
|
|
|
125
134
|
[part='dialog'][hidden] {
|
|
126
135
|
display: none;
|
|
136
|
+
opacity: 0;
|
|
137
|
+
transform: translate3d(0, -2px, 0);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
@starting-style {
|
|
141
|
+
[part='dialog']:not([hidden]) {
|
|
142
|
+
opacity: 0;
|
|
143
|
+
transform: translate3d(0, -2px, 0);
|
|
144
|
+
}
|
|
127
145
|
}
|
|
128
146
|
|
|
129
147
|
[part='calendar-shell'] {
|
|
@@ -169,7 +187,7 @@ export class CVDatePicker extends FormAssociatedReatomElement {
|
|
|
169
187
|
}
|
|
170
188
|
|
|
171
189
|
[part='calendar-day'][aria-selected='true'] {
|
|
172
|
-
background:
|
|
190
|
+
background: var(--cv-color-primary-surface-strong);
|
|
173
191
|
}
|
|
174
192
|
|
|
175
193
|
[part='time-row'] {
|
|
@@ -650,6 +668,7 @@ export class CVDatePicker extends FormAssociatedReatomElement {
|
|
|
650
668
|
role=${dialogProps.role}
|
|
651
669
|
tabindex=${dialogProps.tabindex}
|
|
652
670
|
?hidden=${dialogProps.hidden}
|
|
671
|
+
class="cv-u-discrete-presence"
|
|
653
672
|
aria-modal=${dialogProps['aria-modal']}
|
|
654
673
|
aria-label=${dialogProps['aria-label']}
|
|
655
674
|
@keydown=${this.handleDialogKeyDown}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type PropertyValues } from 'lit';
|
|
2
2
|
import { ReatomLitElement } from '../reatom-lit/ReatomLitElement.js';
|
|
3
3
|
export interface CVDialogEventDetail {
|
|
4
4
|
open: boolean;
|
|
@@ -61,6 +61,15 @@ export declare class CVDialog extends ReatomLitElement {
|
|
|
61
61
|
private previousBodyOverflow;
|
|
62
62
|
private suppressLifecycleFromUpdate;
|
|
63
63
|
private lifecycleToken;
|
|
64
|
+
private focusRestoreTarget;
|
|
65
|
+
private portalVisible;
|
|
66
|
+
private presenceState;
|
|
67
|
+
private presenceAnimationTimeout;
|
|
68
|
+
private pendingFocusRestoreTargetId;
|
|
69
|
+
private shouldAnimatePresence;
|
|
70
|
+
private suppressNextNativeCancel;
|
|
71
|
+
private lastTouchClientY;
|
|
72
|
+
private readonly handleDocumentFocusInBound;
|
|
64
73
|
constructor();
|
|
65
74
|
static styles: import("lit").CSSResult[];
|
|
66
75
|
static define(): void;
|
|
@@ -69,21 +78,54 @@ export declare class CVDialog extends ReatomLitElement {
|
|
|
69
78
|
willUpdate(changedProperties: PropertyValues): void;
|
|
70
79
|
updated(changedProperties: PropertyValues): void;
|
|
71
80
|
private createModel;
|
|
81
|
+
private clearPresenceAnimationQueue;
|
|
82
|
+
private startOpenPresenceTransition;
|
|
83
|
+
private startClosePresenceTransition;
|
|
84
|
+
private finishPresenceTransition;
|
|
85
|
+
private syncRenderedPresenceState;
|
|
86
|
+
private shouldLockScrollForPresence;
|
|
87
|
+
private getPresenceTransitionDuration;
|
|
88
|
+
private readTransitionDuration;
|
|
89
|
+
private parseTimeValues;
|
|
72
90
|
private captureState;
|
|
73
91
|
private dispatchInput;
|
|
74
92
|
private dispatchChange;
|
|
75
93
|
private dispatchLifecycleEvent;
|
|
76
94
|
private dispatchLifecycleTransition;
|
|
77
95
|
private applyInteractionResult;
|
|
96
|
+
private captureFocusRestoreTarget;
|
|
97
|
+
private queueFocusRestore;
|
|
98
|
+
private restoreQueuedFocus;
|
|
99
|
+
private restoreFocus;
|
|
100
|
+
private getPortalOverlay;
|
|
101
|
+
private getContentElement;
|
|
102
|
+
private getModalShell;
|
|
103
|
+
private getPopoverShell;
|
|
104
|
+
private getCurrentPortalShell;
|
|
105
|
+
private isPopoverOpen;
|
|
106
|
+
private openPopoverShell;
|
|
107
|
+
private closePopoverShell;
|
|
108
|
+
private syncTopLayerVisibility;
|
|
109
|
+
private closeNativeShells;
|
|
78
110
|
private syncOutsideFocusListener;
|
|
79
111
|
private syncScrollLock;
|
|
80
112
|
private releaseScrollLock;
|
|
81
113
|
private focusInitialTarget;
|
|
114
|
+
private getTouchClientY;
|
|
115
|
+
private isVerticallyScrollable;
|
|
116
|
+
private collectScrollableContentAncestors;
|
|
117
|
+
private canScrollDialogContent;
|
|
118
|
+
private warnAboutDeprecatedTriggerSlot;
|
|
82
119
|
private handleDocumentFocusIn;
|
|
83
120
|
private handleTriggerClick;
|
|
84
121
|
private handleTriggerKeyDown;
|
|
85
122
|
private handleOverlayPointerDown;
|
|
123
|
+
private handleOverlayTouchStart;
|
|
124
|
+
private handleOverlayTouchMove;
|
|
125
|
+
private handleOverlayWheel;
|
|
86
126
|
private handleContentKeyDown;
|
|
127
|
+
private handleNativeCancel;
|
|
87
128
|
private handleHeaderCloseClick;
|
|
88
|
-
|
|
129
|
+
private renderContent;
|
|
130
|
+
protected render(): import("lit-html").TemplateResult;
|
|
89
131
|
}
|