@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
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
import { html } from '../reatom-lit/index.js';
|
|
3
|
+
import { ReatomLitElement } from '../reatom-lit/ReatomLitElement.js';
|
|
4
|
+
export const GUIDANCE_ANCHOR_REGISTER_EVENT = 'guidance-anchor-register';
|
|
5
|
+
export const GUIDANCE_ANCHOR_UNREGISTER_EVENT = 'guidance-anchor-unregister';
|
|
6
|
+
export class CVGuidanceAnchor extends ReatomLitElement {
|
|
7
|
+
static elementName = 'cv-guidance-anchor';
|
|
8
|
+
static get properties() {
|
|
9
|
+
return {
|
|
10
|
+
anchorId: { type: String, attribute: 'anchor-id', reflect: true },
|
|
11
|
+
surface: { type: String, reflect: true },
|
|
12
|
+
owner: { type: String, reflect: true },
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
registeredDetail = null;
|
|
16
|
+
unregisterEventTarget = null;
|
|
17
|
+
constructor() {
|
|
18
|
+
super();
|
|
19
|
+
this.anchorId = '';
|
|
20
|
+
this.surface = '';
|
|
21
|
+
this.owner = '';
|
|
22
|
+
}
|
|
23
|
+
static styles = [
|
|
24
|
+
css `
|
|
25
|
+
:host {
|
|
26
|
+
display: contents;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
:host([hidden]) {
|
|
30
|
+
display: none;
|
|
31
|
+
}
|
|
32
|
+
`,
|
|
33
|
+
];
|
|
34
|
+
static define() {
|
|
35
|
+
if (!customElements.get(this.elementName)) {
|
|
36
|
+
customElements.define(this.elementName, this);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
connectedCallback() {
|
|
40
|
+
super.connectedCallback();
|
|
41
|
+
const root = this.getRootNode();
|
|
42
|
+
this.unregisterEventTarget = root instanceof ShadowRoot ? root.host : (this.parentNode ?? root);
|
|
43
|
+
this.dispatchRegister();
|
|
44
|
+
}
|
|
45
|
+
disconnectedCallback() {
|
|
46
|
+
this.dispatchUnregister(this.registeredDetail, this.unregisterEventTarget ?? undefined);
|
|
47
|
+
this.unregisterEventTarget = null;
|
|
48
|
+
super.disconnectedCallback();
|
|
49
|
+
}
|
|
50
|
+
updated(changedProperties) {
|
|
51
|
+
super.updated(changedProperties);
|
|
52
|
+
if (changedProperties.has('anchorId') ||
|
|
53
|
+
changedProperties.has('surface') ||
|
|
54
|
+
changedProperties.has('owner')) {
|
|
55
|
+
this.dispatchRegister();
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
createDetail() {
|
|
59
|
+
return {
|
|
60
|
+
anchorId: this.anchorId,
|
|
61
|
+
surface: this.surface,
|
|
62
|
+
owner: this.owner,
|
|
63
|
+
element: this,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
createDetailKey() {
|
|
67
|
+
return JSON.stringify([this.anchorId, this.surface, this.owner]);
|
|
68
|
+
}
|
|
69
|
+
hasRequiredMetadata() {
|
|
70
|
+
return Boolean(this.anchorId && this.surface && this.owner);
|
|
71
|
+
}
|
|
72
|
+
dispatchRegister() {
|
|
73
|
+
if (!this.hasRequiredMetadata())
|
|
74
|
+
return;
|
|
75
|
+
const detailKey = this.createDetailKey();
|
|
76
|
+
const registeredDetailKey = this.registeredDetail
|
|
77
|
+
? JSON.stringify([
|
|
78
|
+
this.registeredDetail.anchorId,
|
|
79
|
+
this.registeredDetail.surface,
|
|
80
|
+
this.registeredDetail.owner,
|
|
81
|
+
])
|
|
82
|
+
: '';
|
|
83
|
+
if (detailKey === registeredDetailKey)
|
|
84
|
+
return;
|
|
85
|
+
if (this.registeredDetail) {
|
|
86
|
+
this.dispatchUnregister(this.registeredDetail);
|
|
87
|
+
}
|
|
88
|
+
const detail = this.createDetail();
|
|
89
|
+
this.registeredDetail = detail;
|
|
90
|
+
this.dispatchEvent(new CustomEvent(GUIDANCE_ANCHOR_REGISTER_EVENT, {
|
|
91
|
+
detail,
|
|
92
|
+
bubbles: true,
|
|
93
|
+
composed: true,
|
|
94
|
+
}));
|
|
95
|
+
}
|
|
96
|
+
dispatchUnregister(detail = this.registeredDetail, target = this) {
|
|
97
|
+
if (!detail)
|
|
98
|
+
return;
|
|
99
|
+
if (detail === this.registeredDetail) {
|
|
100
|
+
this.registeredDetail = null;
|
|
101
|
+
}
|
|
102
|
+
target.dispatchEvent(new CustomEvent(GUIDANCE_ANCHOR_UNREGISTER_EVENT, {
|
|
103
|
+
detail,
|
|
104
|
+
bubbles: true,
|
|
105
|
+
composed: true,
|
|
106
|
+
}));
|
|
107
|
+
}
|
|
108
|
+
render() {
|
|
109
|
+
return html `
|
|
110
|
+
<slot></slot>
|
|
111
|
+
`;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ReatomLitElement } from '../reatom-lit/ReatomLitElement.js';
|
|
2
|
+
export type GuidancePanelVariant = 'coach-mark' | 'hint' | 'warning' | 'blocked';
|
|
3
|
+
export type GuidancePanelDensity = 'comfortable' | 'compact';
|
|
4
|
+
export declare class CVGuidancePanel extends ReatomLitElement {
|
|
5
|
+
static elementName: string;
|
|
6
|
+
static get properties(): {
|
|
7
|
+
variant: {
|
|
8
|
+
type: StringConstructor;
|
|
9
|
+
reflect: boolean;
|
|
10
|
+
};
|
|
11
|
+
density: {
|
|
12
|
+
type: StringConstructor;
|
|
13
|
+
reflect: boolean;
|
|
14
|
+
};
|
|
15
|
+
hasIcon: {
|
|
16
|
+
type: BooleanConstructor;
|
|
17
|
+
attribute: string;
|
|
18
|
+
reflect: boolean;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
variant: GuidancePanelVariant;
|
|
22
|
+
density: GuidancePanelDensity;
|
|
23
|
+
hasIcon: boolean;
|
|
24
|
+
constructor();
|
|
25
|
+
static styles: import("lit").CSSResult[];
|
|
26
|
+
static define(): void;
|
|
27
|
+
private handleIconSlotChange;
|
|
28
|
+
protected render(): import("lit-html").TemplateResult;
|
|
29
|
+
}
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
import { html } from '../reatom-lit/index.js';
|
|
3
|
+
import { ReatomLitElement } from '../reatom-lit/ReatomLitElement.js';
|
|
4
|
+
export class CVGuidancePanel extends ReatomLitElement {
|
|
5
|
+
static elementName = 'cv-guidance-panel';
|
|
6
|
+
static get properties() {
|
|
7
|
+
return {
|
|
8
|
+
variant: { type: String, reflect: true },
|
|
9
|
+
density: { type: String, reflect: true },
|
|
10
|
+
hasIcon: { type: Boolean, attribute: 'has-icon', reflect: true },
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
constructor() {
|
|
14
|
+
super();
|
|
15
|
+
this.variant = 'coach-mark';
|
|
16
|
+
this.density = 'comfortable';
|
|
17
|
+
this.hasIcon = false;
|
|
18
|
+
}
|
|
19
|
+
static styles = [
|
|
20
|
+
css `
|
|
21
|
+
:host {
|
|
22
|
+
display: block;
|
|
23
|
+
color: var(--cv-guidance-panel-color, var(--cv-color-text, #e8ecf6));
|
|
24
|
+
font-size: var(--cv-guidance-panel-font-size, var(--cv-font-size-base, 14px));
|
|
25
|
+
line-height: var(--cv-guidance-panel-line-height, 1.45);
|
|
26
|
+
contain: content;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
[part='base'] {
|
|
30
|
+
display: grid;
|
|
31
|
+
gap: var(--cv-guidance-panel-gap, 14px);
|
|
32
|
+
padding: var(--cv-guidance-panel-padding-block, 20px) var(--cv-guidance-panel-padding-inline, 20px);
|
|
33
|
+
border: 1px solid var(--cv-guidance-panel-border-color, var(--cv-color-border, #2a3245));
|
|
34
|
+
border-radius: var(--cv-guidance-panel-border-radius, 14px);
|
|
35
|
+
background: var(--cv-guidance-panel-background, var(--cv-color-surface-elevated, #1d2432));
|
|
36
|
+
box-shadow: var(--cv-guidance-panel-shadow, none);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
[part='header'] {
|
|
40
|
+
display: grid;
|
|
41
|
+
grid-template-columns: minmax(0, 1fr) auto;
|
|
42
|
+
align-items: start;
|
|
43
|
+
gap: var(--cv-guidance-panel-header-gap, var(--cv-space-2, 8px));
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
[part='icon'] {
|
|
47
|
+
display: none;
|
|
48
|
+
align-items: center;
|
|
49
|
+
justify-content: center;
|
|
50
|
+
min-inline-size: var(--cv-guidance-panel-icon-size, 20px);
|
|
51
|
+
min-block-size: var(--cv-guidance-panel-icon-size, 20px);
|
|
52
|
+
color: var(--cv-guidance-panel-icon-color, currentColor);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
:host([has-icon]) [part='header'] {
|
|
56
|
+
grid-template-columns: auto minmax(0, 1fr) auto;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
:host([has-icon]) [part='icon'] {
|
|
60
|
+
display: inline-flex;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
[part='title'] {
|
|
64
|
+
min-inline-size: 0;
|
|
65
|
+
color: var(--cv-guidance-panel-title-color, var(--cv-color-text-strong, currentColor));
|
|
66
|
+
font-size: var(--cv-guidance-panel-title-font-size, var(--cv-font-size-md, 16px));
|
|
67
|
+
font-weight: var(--cv-guidance-panel-title-font-weight, 700);
|
|
68
|
+
line-height: var(--cv-guidance-panel-title-line-height, 1.25);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
[part='progress'] {
|
|
72
|
+
color: var(--cv-guidance-panel-progress-color, var(--cv-color-text-muted, #9ca8bd));
|
|
73
|
+
font-size: var(--cv-guidance-panel-progress-font-size, var(--cv-font-size-sm, 12px));
|
|
74
|
+
line-height: 1.3;
|
|
75
|
+
white-space: nowrap;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
[part='body'] {
|
|
79
|
+
min-inline-size: 0;
|
|
80
|
+
color: var(--cv-guidance-panel-body-color, var(--cv-color-text-muted, #bac4d8));
|
|
81
|
+
line-height: var(--cv-guidance-panel-body-line-height, 1.55);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
[part='body'] ::slotted(*) {
|
|
85
|
+
margin-block: 0;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
[part='actions'] {
|
|
89
|
+
display: flex;
|
|
90
|
+
flex-wrap: wrap;
|
|
91
|
+
align-items: center;
|
|
92
|
+
gap: var(--cv-guidance-panel-actions-gap, 10px);
|
|
93
|
+
padding-block-start: var(--cv-guidance-panel-actions-padding-block-start, 2px);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
::slotted(button) {
|
|
97
|
+
min-block-size: 34px;
|
|
98
|
+
padding: 0 14px;
|
|
99
|
+
border: 1px solid transparent;
|
|
100
|
+
border-radius: var(--cv-guidance-panel-action-radius, 999px);
|
|
101
|
+
background: transparent;
|
|
102
|
+
color: var(--cv-guidance-panel-action-color, var(--cv-color-text, #e8ecf6));
|
|
103
|
+
font: inherit;
|
|
104
|
+
font-size: var(--cv-guidance-panel-action-font-size, 13px);
|
|
105
|
+
font-weight: var(--cv-guidance-panel-action-font-weight, 650);
|
|
106
|
+
line-height: 1;
|
|
107
|
+
cursor: pointer;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
::slotted(button:hover) {
|
|
111
|
+
background: var(--cv-guidance-panel-action-hover-background, rgba(255, 255, 255, 0.08));
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
::slotted(button:focus-visible) {
|
|
115
|
+
outline: 2px solid var(--cv-color-primary, #65d7ff);
|
|
116
|
+
outline-offset: 2px;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
::slotted(button[data-guidance-action='primary']) {
|
|
120
|
+
border-color: var(--cv-guidance-panel-primary-border-color, transparent);
|
|
121
|
+
background: var(--cv-guidance-panel-primary-background, var(--cv-color-primary, #65d7ff));
|
|
122
|
+
color: var(--cv-guidance-panel-primary-color, var(--cv-color-on-primary, #06131a));
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
::slotted(button[data-guidance-action='primary']:hover) {
|
|
126
|
+
background: var(
|
|
127
|
+
--cv-guidance-panel-primary-hover-background,
|
|
128
|
+
color-mix(in oklab, var(--cv-color-primary, #65d7ff) 86%, white)
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
::slotted(button[data-guidance-action='secondary']) {
|
|
133
|
+
border-color: var(--cv-guidance-panel-secondary-border-color, var(--cv-color-border, #2a3245));
|
|
134
|
+
background: var(--cv-guidance-panel-secondary-background, rgba(255, 255, 255, 0.04));
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
::slotted(button[data-guidance-action='close']) {
|
|
138
|
+
min-inline-size: 30px;
|
|
139
|
+
min-block-size: 30px;
|
|
140
|
+
padding: 0;
|
|
141
|
+
display: inline-flex;
|
|
142
|
+
align-items: center;
|
|
143
|
+
justify-content: center;
|
|
144
|
+
color: var(--cv-guidance-panel-close-color, var(--cv-color-text-muted, #bac4d8));
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
:host([density='compact']) [part='base'] {
|
|
148
|
+
gap: var(--cv-guidance-panel-compact-gap, var(--cv-space-2, 8px));
|
|
149
|
+
padding: var(--cv-guidance-panel-compact-padding-block, var(--cv-space-3, 12px))
|
|
150
|
+
var(--cv-guidance-panel-compact-padding-inline, var(--cv-space-3, 12px));
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
:host([density='compact']) [part='title'] {
|
|
154
|
+
font-size: var(--cv-guidance-panel-compact-title-font-size, var(--cv-font-size-base, 14px));
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
:host([density='compact']) [part='body'] {
|
|
158
|
+
font-size: var(--cv-guidance-panel-compact-body-font-size, var(--cv-font-size-sm, 13px));
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
:host([variant='coach-mark']) [part='base'] {
|
|
162
|
+
border-color: color-mix(in oklab, var(--cv-color-info, #65d7ff) 44%, var(--cv-color-border, #2a3245));
|
|
163
|
+
background: color-mix(
|
|
164
|
+
in oklab,
|
|
165
|
+
var(--cv-color-info, #65d7ff) 10%,
|
|
166
|
+
var(--cv-color-surface-elevated, #1d2432)
|
|
167
|
+
);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
:host([variant='coach-mark']) [part='icon'] {
|
|
171
|
+
color: var(--cv-color-info, #65d7ff);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
:host([variant='hint']) [part='base'] {
|
|
175
|
+
border-color: var(--cv-guidance-panel-hint-border-color, var(--cv-color-border, #2a3245));
|
|
176
|
+
background: var(
|
|
177
|
+
--cv-guidance-panel-hint-background,
|
|
178
|
+
var(--cv-color-surface-subtle, var(--cv-color-surface-elevated, #1d2432))
|
|
179
|
+
);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
:host([variant='hint']) [part='icon'] {
|
|
183
|
+
color: var(--cv-guidance-panel-hint-icon-color, var(--cv-color-text-muted, #9ca8bd));
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
:host([variant='warning']) [part='base'] {
|
|
187
|
+
border-color: color-mix(
|
|
188
|
+
in oklab,
|
|
189
|
+
var(--cv-color-warning, #ffc857) 54%,
|
|
190
|
+
var(--cv-color-border, #2a3245)
|
|
191
|
+
);
|
|
192
|
+
background: color-mix(
|
|
193
|
+
in oklab,
|
|
194
|
+
var(--cv-color-warning, #ffc857) 12%,
|
|
195
|
+
var(--cv-color-surface-elevated, #1d2432)
|
|
196
|
+
);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
:host([variant='warning']) [part='icon'] {
|
|
200
|
+
color: var(--cv-color-warning, #ffc857);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
:host([variant='blocked']) [part='base'] {
|
|
204
|
+
border-color: color-mix(
|
|
205
|
+
in oklab,
|
|
206
|
+
var(--cv-color-danger, #ff7d86) 54%,
|
|
207
|
+
var(--cv-color-border, #2a3245)
|
|
208
|
+
);
|
|
209
|
+
background: color-mix(
|
|
210
|
+
in oklab,
|
|
211
|
+
var(--cv-color-danger, #ff7d86) 12%,
|
|
212
|
+
var(--cv-color-surface-elevated, #1d2432)
|
|
213
|
+
);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
:host([variant='blocked']) [part='icon'] {
|
|
217
|
+
color: var(--cv-color-danger, #ff7d86);
|
|
218
|
+
}
|
|
219
|
+
`,
|
|
220
|
+
];
|
|
221
|
+
static define() {
|
|
222
|
+
if (!customElements.get(this.elementName)) {
|
|
223
|
+
customElements.define(this.elementName, this);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
handleIconSlotChange(event) {
|
|
227
|
+
const slot = event.currentTarget;
|
|
228
|
+
if (!(slot instanceof HTMLSlotElement))
|
|
229
|
+
return;
|
|
230
|
+
this.hasIcon = slot.assignedElements({ flatten: true }).length > 0;
|
|
231
|
+
}
|
|
232
|
+
render() {
|
|
233
|
+
return html `
|
|
234
|
+
<section part="base" role="note" data-variant=${this.variant} data-density=${this.density}>
|
|
235
|
+
<header part="header">
|
|
236
|
+
<span part="icon"><slot name="icon" @slotchange=${this.handleIconSlotChange}></slot></span>
|
|
237
|
+
<div part="title"><slot name="title"></slot></div>
|
|
238
|
+
<div part="progress"><slot name="progress"></slot></div>
|
|
239
|
+
</header>
|
|
240
|
+
<div part="body"><slot></slot></div>
|
|
241
|
+
<div part="actions"><slot name="actions"></slot></div>
|
|
242
|
+
</section>
|
|
243
|
+
`;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
@@ -9,6 +9,7 @@ export declare class CVIcon extends ReatomLitElement {
|
|
|
9
9
|
static elementName: string;
|
|
10
10
|
private static svgCache;
|
|
11
11
|
private static inFlight;
|
|
12
|
+
private loadVersion;
|
|
12
13
|
static get properties(): {
|
|
13
14
|
name: {
|
|
14
15
|
type: StringConstructor;
|
|
@@ -51,7 +52,7 @@ export declare class CVIcon extends ReatomLitElement {
|
|
|
51
52
|
private static fetchSvg;
|
|
52
53
|
private static fetchSingleSvg;
|
|
53
54
|
private handleSlotChange;
|
|
54
|
-
protected render(): import("lit").TemplateResult
|
|
55
|
+
protected render(): import("lit-html").TemplateResult;
|
|
55
56
|
}
|
|
56
57
|
export type LucideIconName = string;
|
|
57
58
|
export type IconName = LucideIconName;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { css
|
|
1
|
+
import { css } from 'lit';
|
|
2
2
|
import { unsafeHTML } from 'lit/directives/unsafe-html.js';
|
|
3
|
+
import { html } from '../reatom-lit/index.js';
|
|
3
4
|
import { ReatomLitElement } from '../reatom-lit/ReatomLitElement.js';
|
|
4
5
|
let iconBasePath = '/assets/icons/lucide';
|
|
5
6
|
const iconCollections = new Map();
|
|
@@ -9,6 +10,15 @@ function normalizeBasePath(path) {
|
|
|
9
10
|
function normalizeCollectionName(name) {
|
|
10
11
|
return name.trim().toLowerCase();
|
|
11
12
|
}
|
|
13
|
+
function looksLikeSvgMarkup(markup) {
|
|
14
|
+
const normalized = markup.trim();
|
|
15
|
+
if (!normalized)
|
|
16
|
+
return false;
|
|
17
|
+
if (/<(html|head|body|script|meta|title|link)\b/i.test(normalized)) {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
return /<svg[\s>]/i.test(normalized);
|
|
21
|
+
}
|
|
12
22
|
export function setIconBasePath(path) {
|
|
13
23
|
iconBasePath = normalizeBasePath(path);
|
|
14
24
|
}
|
|
@@ -66,6 +76,7 @@ const BOOTSTRAP_TO_LUCIDE = {
|
|
|
66
76
|
x: 'x',
|
|
67
77
|
'x-lg': 'x',
|
|
68
78
|
'plus-lg': 'plus',
|
|
79
|
+
'check-lg': 'check',
|
|
69
80
|
check: 'check',
|
|
70
81
|
justify: 'align-justify',
|
|
71
82
|
bars: 'menu',
|
|
@@ -132,6 +143,7 @@ export class CVIcon extends ReatomLitElement {
|
|
|
132
143
|
static elementName = 'cv-icon';
|
|
133
144
|
static svgCache = new Map();
|
|
134
145
|
static inFlight = new Map();
|
|
146
|
+
loadVersion = 0;
|
|
135
147
|
static get properties() {
|
|
136
148
|
return {
|
|
137
149
|
name: { type: String },
|
|
@@ -201,7 +213,12 @@ export class CVIcon extends ReatomLitElement {
|
|
|
201
213
|
}
|
|
202
214
|
|
|
203
215
|
.icon {
|
|
204
|
-
display:
|
|
216
|
+
display: inline-flex;
|
|
217
|
+
align-items: center;
|
|
218
|
+
justify-content: center;
|
|
219
|
+
inline-size: 100%;
|
|
220
|
+
block-size: 100%;
|
|
221
|
+
flex: 0 0 100%;
|
|
205
222
|
}
|
|
206
223
|
|
|
207
224
|
.icon svg,
|
|
@@ -282,7 +299,11 @@ export class CVIcon extends ReatomLitElement {
|
|
|
282
299
|
return urls;
|
|
283
300
|
}
|
|
284
301
|
async loadSvg(urls) {
|
|
285
|
-
|
|
302
|
+
const loadVersion = ++this.loadVersion;
|
|
303
|
+
const svgMarkup = await CVIcon.fetchSvg(urls);
|
|
304
|
+
if (loadVersion !== this.loadVersion)
|
|
305
|
+
return;
|
|
306
|
+
this.svgMarkup = svgMarkup;
|
|
286
307
|
this.requestUpdate();
|
|
287
308
|
}
|
|
288
309
|
static async fetchSvg(urls) {
|
|
@@ -310,6 +331,10 @@ export class CVIcon extends ReatomLitElement {
|
|
|
310
331
|
return '';
|
|
311
332
|
}
|
|
312
333
|
const svg = await response.text();
|
|
334
|
+
if (!looksLikeSvgMarkup(svg)) {
|
|
335
|
+
CVIcon.inFlight.delete(url);
|
|
336
|
+
return '';
|
|
337
|
+
}
|
|
313
338
|
CVIcon.svgCache.set(url, svg);
|
|
314
339
|
CVIcon.inFlight.delete(url);
|
|
315
340
|
return svg;
|
|
@@ -4,6 +4,7 @@ import { FormAssociatedReatomElement } from '../form-associated/FormAssociatedRe
|
|
|
4
4
|
import type { FormAssociatedValidity } from '../form-associated/withFormAssociated.js';
|
|
5
5
|
type CVInputSize = 'small' | 'medium' | 'large';
|
|
6
6
|
type CVInputVariant = 'outlined' | 'filled';
|
|
7
|
+
type CVInputPreset = 'search-mobile';
|
|
7
8
|
export interface CVInputValueDetail {
|
|
8
9
|
value: string;
|
|
9
10
|
}
|
|
@@ -61,6 +62,10 @@ export declare class CVInput extends FormAssociatedReatomElement {
|
|
|
61
62
|
type: StringConstructor;
|
|
62
63
|
reflect: boolean;
|
|
63
64
|
};
|
|
65
|
+
preset: {
|
|
66
|
+
type: StringConstructor;
|
|
67
|
+
reflect: boolean;
|
|
68
|
+
};
|
|
64
69
|
name: {
|
|
65
70
|
type: StringConstructor;
|
|
66
71
|
};
|
|
@@ -89,6 +94,7 @@ export declare class CVInput extends FormAssociatedReatomElement {
|
|
|
89
94
|
passwordToggle: boolean;
|
|
90
95
|
size: CVInputSize;
|
|
91
96
|
variant: CVInputVariant;
|
|
97
|
+
preset: CVInputPreset | undefined;
|
|
92
98
|
name: string;
|
|
93
99
|
autofocus: boolean;
|
|
94
100
|
autocomplete: string;
|
|
@@ -122,6 +128,6 @@ export declare class CVInput extends FormAssociatedReatomElement {
|
|
|
122
128
|
private handleNativeKeyDown;
|
|
123
129
|
private handleClearClick;
|
|
124
130
|
private handlePasswordToggleClick;
|
|
125
|
-
protected render(): import("lit").TemplateResult<1>;
|
|
131
|
+
protected render(): import("lit-html").TemplateResult<1>;
|
|
126
132
|
}
|
|
127
133
|
export {};
|
|
@@ -17,6 +17,7 @@ export class CVInput extends FormAssociatedReatomElement {
|
|
|
17
17
|
passwordToggle: { type: Boolean, reflect: true, attribute: 'password-toggle' },
|
|
18
18
|
size: { type: String, reflect: true },
|
|
19
19
|
variant: { type: String, reflect: true },
|
|
20
|
+
preset: { type: String, reflect: true },
|
|
20
21
|
name: { type: String },
|
|
21
22
|
autofocus: { type: Boolean, reflect: true },
|
|
22
23
|
autocomplete: { type: String },
|
|
@@ -41,6 +42,7 @@ export class CVInput extends FormAssociatedReatomElement {
|
|
|
41
42
|
this.passwordToggle = false;
|
|
42
43
|
this.size = 'medium';
|
|
43
44
|
this.variant = 'outlined';
|
|
45
|
+
this.preset = undefined;
|
|
44
46
|
this.name = '';
|
|
45
47
|
this.autofocus = false;
|
|
46
48
|
this.autocomplete = '';
|
|
@@ -119,6 +121,7 @@ export class CVInput extends FormAssociatedReatomElement {
|
|
|
119
121
|
|
|
120
122
|
[part='form-control-label'] {
|
|
121
123
|
display: block;
|
|
124
|
+
margin-bottom: 5px;
|
|
122
125
|
}
|
|
123
126
|
|
|
124
127
|
[part='form-control-help-text'] {
|
|
@@ -147,7 +150,7 @@ export class CVInput extends FormAssociatedReatomElement {
|
|
|
147
150
|
}
|
|
148
151
|
|
|
149
152
|
:host([invalid][focused]) [part='base'] {
|
|
150
|
-
box-shadow: 0 0 0 2px
|
|
153
|
+
box-shadow: 0 0 0 2px var(--cv-color-danger-border-strong);
|
|
151
154
|
}
|
|
152
155
|
|
|
153
156
|
/* --- sizes --- */
|
|
@@ -163,6 +166,35 @@ export class CVInput extends FormAssociatedReatomElement {
|
|
|
163
166
|
--cv-input-font-size: var(--cv-font-size-md, 16px);
|
|
164
167
|
}
|
|
165
168
|
|
|
169
|
+
:host([preset='search-mobile']) {
|
|
170
|
+
--cv-input-height: var(--cv-input-search-mobile-height, 42px);
|
|
171
|
+
--cv-input-padding-inline: var(--cv-input-search-mobile-padding-inline, 14px);
|
|
172
|
+
--cv-input-font-size: var(--cv-input-search-mobile-font-size, 16px);
|
|
173
|
+
--cv-input-border-radius: var(--cv-input-search-mobile-border-radius, 14px);
|
|
174
|
+
--cv-input-background: var(--cv-input-search-mobile-background, var(--cv-color-surface-2));
|
|
175
|
+
--cv-input-border-color: var(--cv-input-search-mobile-border-color, var(--cv-color-border-glass));
|
|
176
|
+
--cv-input-placeholder-color: var(
|
|
177
|
+
--cv-input-search-mobile-placeholder-color,
|
|
178
|
+
var(--cv-color-text-muted)
|
|
179
|
+
);
|
|
180
|
+
--cv-input-icon-size: var(--cv-input-search-mobile-icon-size, 20px);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
:host([preset='search-mobile']) [part='base'] {
|
|
184
|
+
box-shadow: var(
|
|
185
|
+
--cv-input-search-mobile-shadow,
|
|
186
|
+
inset 0 1px 2px var(--cv-alpha-black-10),
|
|
187
|
+
0 1px 0 var(--cv-alpha-white-4)
|
|
188
|
+
);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
:host([preset='search-mobile']:hover) {
|
|
192
|
+
--cv-input-border-color: var(
|
|
193
|
+
--cv-input-search-mobile-border-color-hover,
|
|
194
|
+
var(--cv-color-primary-border)
|
|
195
|
+
);
|
|
196
|
+
}
|
|
197
|
+
|
|
166
198
|
/* --- disabled --- */
|
|
167
199
|
:host([disabled]) [part='base'] {
|
|
168
200
|
opacity: 0.55;
|
|
@@ -28,5 +28,5 @@ export declare class CVLandmark extends ReatomLitElement {
|
|
|
28
28
|
static define(): void;
|
|
29
29
|
willUpdate(changedProperties: PropertyValues): void;
|
|
30
30
|
private createModel;
|
|
31
|
-
protected render(): import("lit").TemplateResult
|
|
31
|
+
protected render(): import("lit-html").TemplateResult;
|
|
32
32
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createLandmark } from '@chromvoid/headless-ui/landmarks';
|
|
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 cvLandmarkNonce = 0;
|
|
5
6
|
export class CVLandmark extends ReatomLitElement {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createLink } from '@chromvoid/headless-ui/link';
|
|
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 cvLinkNonce = 0;
|
|
5
6
|
export class CVLink extends ReatomLitElement {
|
|
@@ -11,5 +11,5 @@ export declare class CVListboxGroup 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
|
}
|
|
@@ -76,6 +76,6 @@ export declare class CVListbox extends ReatomLitElement {
|
|
|
76
76
|
private handleOptionPointerSelect;
|
|
77
77
|
private handleListboxKeyDown;
|
|
78
78
|
private handleSlotChange;
|
|
79
|
-
protected render(): import("lit").TemplateResult
|
|
79
|
+
protected render(): import("lit-html").TemplateResult;
|
|
80
80
|
}
|
|
81
81
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createListbox } from '@chromvoid/headless-ui/listbox';
|
|
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 { CVListboxGroup } from './cv-listbox-group.js';
|
|
5
6
|
import { CVOption } from './cv-option.js';
|