@chromvoid/uikit 0.1.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 +8 -0
- package/README.md +96 -0
- package/dist/components/cv-accordion-item.d.ts +69 -0
- package/dist/components/cv-accordion-item.js +176 -0
- package/dist/components/cv-accordion.d.ts +79 -0
- package/dist/components/cv-accordion.js +310 -0
- package/dist/components/cv-alert-dialog.d.ts +86 -0
- package/dist/components/cv-alert-dialog.js +393 -0
- package/dist/components/cv-alert.d.ts +48 -0
- package/dist/components/cv-alert.js +156 -0
- package/dist/components/cv-badge.d.ts +56 -0
- package/dist/components/cv-badge.js +280 -0
- package/dist/components/cv-breadcrumb-item.d.ts +35 -0
- package/dist/components/cv-breadcrumb-item.js +64 -0
- package/dist/components/cv-breadcrumb.d.ts +39 -0
- package/dist/components/cv-breadcrumb.js +160 -0
- package/dist/components/cv-button.d.ts +83 -0
- package/dist/components/cv-button.js +541 -0
- package/dist/components/cv-callout.d.ts +32 -0
- package/dist/components/cv-callout.js +221 -0
- package/dist/components/cv-card.d.ts +48 -0
- package/dist/components/cv-card.js +269 -0
- package/dist/components/cv-carousel-slide.d.ts +25 -0
- package/dist/components/cv-carousel-slide.js +51 -0
- package/dist/components/cv-carousel.d.ts +96 -0
- package/dist/components/cv-carousel.js +457 -0
- package/dist/components/cv-checkbox.d.ts +84 -0
- package/dist/components/cv-checkbox.js +274 -0
- package/dist/components/cv-combobox-group.d.ts +15 -0
- package/dist/components/cv-combobox-group.js +34 -0
- package/dist/components/cv-combobox-option.d.ts +30 -0
- package/dist/components/cv-combobox-option.js +66 -0
- package/dist/components/cv-combobox.d.ts +135 -0
- package/dist/components/cv-combobox.js +834 -0
- package/dist/components/cv-command-item.d.ts +30 -0
- package/dist/components/cv-command-item.js +68 -0
- package/dist/components/cv-command-palette.d.ts +105 -0
- package/dist/components/cv-command-palette.js +578 -0
- package/dist/components/cv-context-menu.d.ts +98 -0
- package/dist/components/cv-context-menu.js +515 -0
- package/dist/components/cv-copy-button.d.ts +61 -0
- package/dist/components/cv-copy-button.js +318 -0
- package/dist/components/cv-date-picker.d.ts +161 -0
- package/dist/components/cv-date-picker.js +803 -0
- package/dist/components/cv-dialog.d.ts +89 -0
- package/dist/components/cv-dialog.js +459 -0
- package/dist/components/cv-disclosure.d.ts +57 -0
- package/dist/components/cv-disclosure.js +241 -0
- package/dist/components/cv-drawer.d.ts +102 -0
- package/dist/components/cv-drawer.js +595 -0
- package/dist/components/cv-feed-article.d.ts +26 -0
- package/dist/components/cv-feed-article.js +52 -0
- package/dist/components/cv-feed.d.ts +62 -0
- package/dist/components/cv-feed.js +310 -0
- package/dist/components/cv-grid-cell.d.ts +30 -0
- package/dist/components/cv-grid-cell.js +57 -0
- package/dist/components/cv-grid-column.d.ts +30 -0
- package/dist/components/cv-grid-column.js +43 -0
- package/dist/components/cv-grid-row.d.ts +30 -0
- package/dist/components/cv-grid-row.js +42 -0
- package/dist/components/cv-grid.d.ts +119 -0
- package/dist/components/cv-grid.js +567 -0
- package/dist/components/cv-icon.d.ts +57 -0
- package/dist/components/cv-icon.js +352 -0
- package/dist/components/cv-input.d.ts +127 -0
- package/dist/components/cv-input.js +482 -0
- package/dist/components/cv-landmark.d.ts +32 -0
- package/dist/components/cv-landmark.js +62 -0
- package/dist/components/cv-link.d.ts +22 -0
- package/dist/components/cv-link.js +99 -0
- package/dist/components/cv-listbox-group.d.ts +15 -0
- package/dist/components/cv-listbox-group.js +42 -0
- package/dist/components/cv-listbox.d.ts +81 -0
- package/dist/components/cv-listbox.js +388 -0
- package/dist/components/cv-menu-button.d.ts +118 -0
- package/dist/components/cv-menu-button.js +822 -0
- package/dist/components/cv-menu-group.d.ts +20 -0
- package/dist/components/cv-menu-group.js +48 -0
- package/dist/components/cv-menu-item.d.ts +52 -0
- package/dist/components/cv-menu-item.js +105 -0
- package/dist/components/cv-menu.d.ts +62 -0
- package/dist/components/cv-menu.js +414 -0
- package/dist/components/cv-meter.d.ts +66 -0
- package/dist/components/cv-meter.js +154 -0
- package/dist/components/cv-number.d.ts +139 -0
- package/dist/components/cv-number.js +553 -0
- package/dist/components/cv-option.d.ts +30 -0
- package/dist/components/cv-option.js +84 -0
- package/dist/components/cv-popover.d.ts +87 -0
- package/dist/components/cv-popover.js +373 -0
- package/dist/components/cv-progress-ring.d.ts +45 -0
- package/dist/components/cv-progress-ring.js +169 -0
- package/dist/components/cv-progress.d.ts +45 -0
- package/dist/components/cv-progress.js +148 -0
- package/dist/components/cv-radio-group.d.ts +79 -0
- package/dist/components/cv-radio-group.js +398 -0
- package/dist/components/cv-radio.d.ts +36 -0
- package/dist/components/cv-radio.js +123 -0
- package/dist/components/cv-select-group.d.ts +15 -0
- package/dist/components/cv-select-group.js +44 -0
- package/dist/components/cv-select-option.d.ts +30 -0
- package/dist/components/cv-select-option.js +66 -0
- package/dist/components/cv-select.d.ts +128 -0
- package/dist/components/cv-select.js +666 -0
- package/dist/components/cv-sidebar-item.d.ts +26 -0
- package/dist/components/cv-sidebar-item.js +142 -0
- package/dist/components/cv-sidebar.d.ts +171 -0
- package/dist/components/cv-sidebar.js +767 -0
- package/dist/components/cv-slider-multi-thumb.d.ts +73 -0
- package/dist/components/cv-slider-multi-thumb.js +374 -0
- package/dist/components/cv-slider.d.ts +84 -0
- package/dist/components/cv-slider.js +328 -0
- package/dist/components/cv-spinbutton.d.ts +121 -0
- package/dist/components/cv-spinbutton.js +486 -0
- package/dist/components/cv-spinner.d.ts +18 -0
- package/dist/components/cv-spinner.js +95 -0
- package/dist/components/cv-switch.d.ts +81 -0
- package/dist/components/cv-switch.js +285 -0
- package/dist/components/cv-tab-panel.d.ts +20 -0
- package/dist/components/cv-tab-panel.js +37 -0
- package/dist/components/cv-tab.d.ts +40 -0
- package/dist/components/cv-tab.js +132 -0
- package/dist/components/cv-table-cell.d.ts +31 -0
- package/dist/components/cv-table-cell.js +49 -0
- package/dist/components/cv-table-column.d.ts +37 -0
- package/dist/components/cv-table-column.js +63 -0
- package/dist/components/cv-table-row.d.ts +30 -0
- package/dist/components/cv-table-row.js +45 -0
- package/dist/components/cv-table.d.ts +147 -0
- package/dist/components/cv-table.js +607 -0
- package/dist/components/cv-tabs.d.ts +70 -0
- package/dist/components/cv-tabs.js +524 -0
- package/dist/components/cv-textarea.d.ts +108 -0
- package/dist/components/cv-textarea.js +328 -0
- package/dist/components/cv-toast-region.d.ts +39 -0
- package/dist/components/cv-toast-region.js +162 -0
- package/dist/components/cv-toast.d.ts +67 -0
- package/dist/components/cv-toast.js +315 -0
- package/dist/components/cv-toolbar-item.d.ts +25 -0
- package/dist/components/cv-toolbar-item.js +72 -0
- package/dist/components/cv-toolbar-separator.d.ts +25 -0
- package/dist/components/cv-toolbar-separator.js +45 -0
- package/dist/components/cv-toolbar.d.ts +63 -0
- package/dist/components/cv-toolbar.js +295 -0
- package/dist/components/cv-tooltip.d.ts +83 -0
- package/dist/components/cv-tooltip.js +455 -0
- package/dist/components/cv-treegrid-cell.d.ts +30 -0
- package/dist/components/cv-treegrid-cell.js +57 -0
- package/dist/components/cv-treegrid-column.d.ts +37 -0
- package/dist/components/cv-treegrid-column.js +53 -0
- package/dist/components/cv-treegrid-row.d.ts +55 -0
- package/dist/components/cv-treegrid-row.js +90 -0
- package/dist/components/cv-treegrid.d.ts +96 -0
- package/dist/components/cv-treegrid.js +632 -0
- package/dist/components/cv-treeitem.d.ts +58 -0
- package/dist/components/cv-treeitem.js +144 -0
- package/dist/components/cv-treeview.d.ts +70 -0
- package/dist/components/cv-treeview.js +396 -0
- package/dist/components/cv-window-splitter.d.ts +79 -0
- package/dist/components/cv-window-splitter.js +316 -0
- package/dist/components/index.d.ts +94 -0
- package/dist/components/index.js +79 -0
- package/dist/dialog/create-dialog-controller.d.ts +31 -0
- package/dist/dialog/create-dialog-controller.js +320 -0
- package/dist/dialog/index.d.ts +2 -0
- package/dist/dialog/index.js +1 -0
- package/dist/form-associated/FormAssociatedReatomElement.d.ts +25 -0
- package/dist/form-associated/FormAssociatedReatomElement.js +70 -0
- package/dist/form-associated/withFormAssociated.d.ts +5 -0
- package/dist/form-associated/withFormAssociated.js +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +9 -0
- package/dist/reatom-lit/ReatomLitElement.d.ts +27 -0
- package/dist/reatom-lit/ReatomLitElement.js +118 -0
- package/dist/reatom-lit/html.d.ts +4 -0
- package/dist/reatom-lit/html.js +10 -0
- package/dist/reatom-lit/index.d.ts +4 -0
- package/dist/reatom-lit/index.js +4 -0
- package/dist/reatom-lit/watch.d.ts +15 -0
- package/dist/reatom-lit/watch.js +40 -0
- package/dist/reatom-lit/withReatomElement.d.ts +4 -0
- package/dist/reatom-lit/withReatomElement.js +57 -0
- package/dist/register.d.ts +1 -0
- package/dist/register.js +84 -0
- package/dist/styles/component-styles.d.ts +4 -0
- package/dist/styles/component-styles.js +78 -0
- package/dist/theme/cv-theme-provider.d.ts +32 -0
- package/dist/theme/cv-theme-provider.js +110 -0
- package/dist/theme/index.d.ts +4 -0
- package/dist/theme/index.js +2 -0
- package/dist/theme/theme-engine.d.ts +4 -0
- package/dist/theme/theme-engine.js +67 -0
- package/dist/theme/tokens.css +265 -0
- package/dist/theme/types.d.ts +7 -0
- package/dist/theme/types.js +1 -0
- package/dist/toast/create-toast-controller.d.ts +12 -0
- package/dist/toast/create-toast-controller.js +12 -0
- package/dist/toast/index.d.ts +2 -0
- package/dist/toast/index.js +1 -0
- package/package.json +146 -0
- package/specs/_template.md +110 -0
- package/specs/components/accordion.md +207 -0
- package/specs/components/alert.md +83 -0
- package/specs/components/badge.md +183 -0
- package/specs/components/breadcrumb.md +152 -0
- package/specs/components/button.md +227 -0
- package/specs/components/callout.md +153 -0
- package/specs/components/card.md +192 -0
- package/specs/components/carousel.md +232 -0
- package/specs/components/checkbox.md +141 -0
- package/specs/components/combobox.md +427 -0
- package/specs/components/context-menu.md +375 -0
- package/specs/components/copy-button.md +236 -0
- package/specs/components/date-picker.md +290 -0
- package/specs/components/dialog.md +184 -0
- package/specs/components/disclosure.md +151 -0
- package/specs/components/drawer.md +216 -0
- package/specs/components/feed.md +266 -0
- package/specs/components/grid.md +423 -0
- package/specs/components/input.md +237 -0
- package/specs/components/landmark.md +92 -0
- package/specs/components/link.md +117 -0
- package/specs/components/listbox.md +327 -0
- package/specs/components/menu.md +508 -0
- package/specs/components/meter.md +148 -0
- package/specs/components/number.md +268 -0
- package/specs/components/option.md +167 -0
- package/specs/components/popover.md +207 -0
- package/specs/components/progress-ring.md +134 -0
- package/specs/components/progress.md +110 -0
- package/specs/components/radio.md +208 -0
- package/specs/components/select.md +305 -0
- package/specs/components/sidebar.md +204 -0
- package/specs/components/spinbutton.md +157 -0
- package/specs/components/spinner.md +83 -0
- package/specs/components/switch.md +145 -0
- package/specs/components/table.md +372 -0
- package/specs/components/tabs.md +242 -0
- package/specs/components/textarea.md +166 -0
- package/specs/components/theme.md +364 -0
- package/specs/components/toast.md +198 -0
- package/specs/components/toolbar.md +258 -0
- package/specs/components/tooltip.md +152 -0
- package/specs/components/treegrid.md +363 -0
- package/specs/components/treeview.md +263 -0
- package/specs/components/window-splitter.md +225 -0
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import type { PropertyValues } from 'lit';
|
|
2
|
+
import { ReatomLitElement } from '../reatom-lit/ReatomLitElement.js';
|
|
3
|
+
type CVPopoverPlacement = 'top-start' | 'top' | 'top-end' | 'right-start' | 'right' | 'right-end' | 'bottom-start' | 'bottom' | 'bottom-end' | 'left-start' | 'left' | 'left-end';
|
|
4
|
+
type CVPopoverAnchor = 'trigger' | 'host';
|
|
5
|
+
export declare class CVPopover extends ReatomLitElement {
|
|
6
|
+
static elementName: string;
|
|
7
|
+
static get properties(): {
|
|
8
|
+
open: {
|
|
9
|
+
type: BooleanConstructor;
|
|
10
|
+
reflect: boolean;
|
|
11
|
+
};
|
|
12
|
+
ariaLabel: {
|
|
13
|
+
type: StringConstructor;
|
|
14
|
+
attribute: string;
|
|
15
|
+
};
|
|
16
|
+
ariaLabelledBy: {
|
|
17
|
+
type: StringConstructor;
|
|
18
|
+
attribute: string;
|
|
19
|
+
};
|
|
20
|
+
closeOnEscape: {
|
|
21
|
+
type: BooleanConstructor;
|
|
22
|
+
attribute: string;
|
|
23
|
+
reflect: boolean;
|
|
24
|
+
};
|
|
25
|
+
closeOnOutsidePointer: {
|
|
26
|
+
type: BooleanConstructor;
|
|
27
|
+
attribute: string;
|
|
28
|
+
reflect: boolean;
|
|
29
|
+
};
|
|
30
|
+
closeOnOutsideFocus: {
|
|
31
|
+
type: BooleanConstructor;
|
|
32
|
+
attribute: string;
|
|
33
|
+
reflect: boolean;
|
|
34
|
+
};
|
|
35
|
+
placement: {
|
|
36
|
+
type: StringConstructor;
|
|
37
|
+
reflect: boolean;
|
|
38
|
+
};
|
|
39
|
+
anchor: {
|
|
40
|
+
type: StringConstructor;
|
|
41
|
+
reflect: boolean;
|
|
42
|
+
};
|
|
43
|
+
offset: {
|
|
44
|
+
type: NumberConstructor;
|
|
45
|
+
reflect: boolean;
|
|
46
|
+
};
|
|
47
|
+
arrow: {
|
|
48
|
+
type: BooleanConstructor;
|
|
49
|
+
reflect: boolean;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
open: boolean;
|
|
53
|
+
ariaLabel: string;
|
|
54
|
+
ariaLabelledBy: string;
|
|
55
|
+
closeOnEscape: boolean;
|
|
56
|
+
closeOnOutsidePointer: boolean;
|
|
57
|
+
closeOnOutsideFocus: boolean;
|
|
58
|
+
placement: CVPopoverPlacement;
|
|
59
|
+
anchor: CVPopoverAnchor;
|
|
60
|
+
offset: number;
|
|
61
|
+
arrow: boolean;
|
|
62
|
+
private readonly idBase;
|
|
63
|
+
private model;
|
|
64
|
+
private previousOpen;
|
|
65
|
+
constructor();
|
|
66
|
+
static styles: import("lit").CSSResult[];
|
|
67
|
+
static define(): void;
|
|
68
|
+
connectedCallback(): void;
|
|
69
|
+
disconnectedCallback(): void;
|
|
70
|
+
willUpdate(changedProperties: PropertyValues): void;
|
|
71
|
+
updated(changedProperties: PropertyValues): void;
|
|
72
|
+
private createModel;
|
|
73
|
+
private buildEventDetail;
|
|
74
|
+
/**
|
|
75
|
+
* Dispatches beforetoggle and toggle events and syncs open state from headless.
|
|
76
|
+
* If beforetoggle is canceled on open, reverts headless state.
|
|
77
|
+
*/
|
|
78
|
+
private emitToggleEvents;
|
|
79
|
+
private syncOutsideListeners;
|
|
80
|
+
private handleDocumentPointerDown;
|
|
81
|
+
private handleDocumentFocusIn;
|
|
82
|
+
private handleTriggerClick;
|
|
83
|
+
private handleTriggerKeyDown;
|
|
84
|
+
private handleContentKeyDown;
|
|
85
|
+
protected render(): import("lit").TemplateResult<1>;
|
|
86
|
+
}
|
|
87
|
+
export {};
|
|
@@ -0,0 +1,373 @@
|
|
|
1
|
+
import { createPopover } from '@chromvoid/headless-ui/popover';
|
|
2
|
+
import { css, html, nothing } from 'lit';
|
|
3
|
+
import { ReatomLitElement } from '../reatom-lit/ReatomLitElement.js';
|
|
4
|
+
const popoverTriggerKeys = new Set(['Enter', ' ', 'Spacebar', 'ArrowDown']);
|
|
5
|
+
const supportsNativePopover = typeof HTMLElement !== 'undefined' && typeof HTMLElement.prototype.showPopover === 'function';
|
|
6
|
+
let cvPopoverNonce = 0;
|
|
7
|
+
export class CVPopover extends ReatomLitElement {
|
|
8
|
+
static elementName = 'cv-popover';
|
|
9
|
+
static get properties() {
|
|
10
|
+
return {
|
|
11
|
+
open: { type: Boolean, reflect: true },
|
|
12
|
+
ariaLabel: { type: String, attribute: 'aria-label' },
|
|
13
|
+
ariaLabelledBy: { type: String, attribute: 'aria-labelledby' },
|
|
14
|
+
closeOnEscape: { type: Boolean, attribute: 'close-on-escape', reflect: true },
|
|
15
|
+
closeOnOutsidePointer: { type: Boolean, attribute: 'close-on-outside-pointer', reflect: true },
|
|
16
|
+
closeOnOutsideFocus: { type: Boolean, attribute: 'close-on-outside-focus', reflect: true },
|
|
17
|
+
placement: { type: String, reflect: true },
|
|
18
|
+
anchor: { type: String, reflect: true },
|
|
19
|
+
offset: { type: Number, reflect: true },
|
|
20
|
+
arrow: { type: Boolean, reflect: true },
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
idBase = `cv-popover-${++cvPopoverNonce}`;
|
|
24
|
+
model;
|
|
25
|
+
previousOpen = false;
|
|
26
|
+
constructor() {
|
|
27
|
+
super();
|
|
28
|
+
this.open = false;
|
|
29
|
+
this.ariaLabel = '';
|
|
30
|
+
this.ariaLabelledBy = '';
|
|
31
|
+
this.closeOnEscape = true;
|
|
32
|
+
this.closeOnOutsidePointer = true;
|
|
33
|
+
this.closeOnOutsideFocus = true;
|
|
34
|
+
this.placement = 'bottom-start';
|
|
35
|
+
this.anchor = 'trigger';
|
|
36
|
+
this.offset = 4;
|
|
37
|
+
this.arrow = false;
|
|
38
|
+
this.model = this.createModel();
|
|
39
|
+
this.previousOpen = this.model.state.isOpen();
|
|
40
|
+
}
|
|
41
|
+
static styles = [
|
|
42
|
+
css `
|
|
43
|
+
:host {
|
|
44
|
+
display: inline-block;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
[part='base'] {
|
|
48
|
+
position: relative;
|
|
49
|
+
display: inline-grid;
|
|
50
|
+
gap: var(--cv-space-1, 4px);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
[part='trigger'] {
|
|
54
|
+
display: inline-flex;
|
|
55
|
+
align-items: center;
|
|
56
|
+
justify-content: center;
|
|
57
|
+
min-block-size: 36px;
|
|
58
|
+
padding: 0 var(--cv-space-3, 12px);
|
|
59
|
+
border-radius: var(--cv-radius-sm, 6px);
|
|
60
|
+
border: 1px solid var(--cv-color-border, #2a3245);
|
|
61
|
+
background: var(--cv-color-surface, #141923);
|
|
62
|
+
color: var(--cv-color-text, #e8ecf6);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
[part='trigger']:focus-visible {
|
|
66
|
+
outline: 2px solid var(--cv-color-primary, #65d7ff);
|
|
67
|
+
outline-offset: 1px;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
[part='content'] {
|
|
71
|
+
position: absolute;
|
|
72
|
+
inset-inline-start: 0;
|
|
73
|
+
inset-block-start: calc(100% + var(--cv-popover-offset, var(--cv-space-1, 4px)));
|
|
74
|
+
z-index: var(--cv-popover-z-index, 20);
|
|
75
|
+
min-inline-size: var(--cv-popover-min-inline-size, max(220px, 100%));
|
|
76
|
+
max-inline-size: var(--cv-popover-max-inline-size, min(560px, calc(100vw - 32px)));
|
|
77
|
+
display: grid;
|
|
78
|
+
gap: var(--cv-space-2, 8px);
|
|
79
|
+
padding: var(--cv-popover-padding, var(--cv-space-3, 12px));
|
|
80
|
+
border-radius: var(--cv-popover-border-radius, var(--cv-radius-md, 10px));
|
|
81
|
+
border: 1px solid var(--cv-color-border, #2a3245);
|
|
82
|
+
background: var(--cv-color-surface-elevated, #1d2432);
|
|
83
|
+
box-shadow: var(--cv-shadow-1, 0 2px 8px rgba(0, 0, 0, 0.24));
|
|
84
|
+
color: var(--cv-color-text, #e8ecf6);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
[part='content'][hidden] {
|
|
88
|
+
display: none;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
[part='content']:focus-visible {
|
|
92
|
+
outline: 2px solid var(--cv-color-primary, #65d7ff);
|
|
93
|
+
outline-offset: 1px;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
[part='content'][data-placement='bottom'] {
|
|
97
|
+
inset-inline-start: 50%;
|
|
98
|
+
transform: translateX(-50%);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
[part='content'][data-placement='bottom-end'] {
|
|
102
|
+
inset-inline-start: auto;
|
|
103
|
+
inset-inline-end: 0;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
[part='content'][data-placement='top-start'] {
|
|
107
|
+
inset-block-start: auto;
|
|
108
|
+
inset-block-end: calc(100% + var(--cv-popover-offset, var(--cv-space-1, 4px)));
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
[part='content'][data-placement='top'] {
|
|
112
|
+
inset-inline-start: 50%;
|
|
113
|
+
inset-block-start: auto;
|
|
114
|
+
inset-block-end: calc(100% + var(--cv-popover-offset, var(--cv-space-1, 4px)));
|
|
115
|
+
transform: translateX(-50%);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
[part='content'][data-placement='top-end'] {
|
|
119
|
+
inset-inline-start: auto;
|
|
120
|
+
inset-inline-end: 0;
|
|
121
|
+
inset-block-start: auto;
|
|
122
|
+
inset-block-end: calc(100% + var(--cv-popover-offset, var(--cv-space-1, 4px)));
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
[part='content'][data-placement='right-start'] {
|
|
126
|
+
inset-inline-start: calc(100% + var(--cv-popover-offset, var(--cv-space-1, 4px)));
|
|
127
|
+
inset-block-start: 0;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
[part='content'][data-placement='right'] {
|
|
131
|
+
inset-inline-start: calc(100% + var(--cv-popover-offset, var(--cv-space-1, 4px)));
|
|
132
|
+
inset-block-start: 50%;
|
|
133
|
+
transform: translateY(-50%);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
[part='content'][data-placement='right-end'] {
|
|
137
|
+
inset-inline-start: calc(100% + var(--cv-popover-offset, var(--cv-space-1, 4px)));
|
|
138
|
+
inset-block-start: auto;
|
|
139
|
+
inset-block-end: 0;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
[part='content'][data-placement='left-start'] {
|
|
143
|
+
inset-inline-start: auto;
|
|
144
|
+
inset-inline-end: calc(100% + var(--cv-popover-offset, var(--cv-space-1, 4px)));
|
|
145
|
+
inset-block-start: 0;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
[part='content'][data-placement='left'] {
|
|
149
|
+
inset-inline-start: auto;
|
|
150
|
+
inset-inline-end: calc(100% + var(--cv-popover-offset, var(--cv-space-1, 4px)));
|
|
151
|
+
inset-block-start: 50%;
|
|
152
|
+
transform: translateY(-50%);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
[part='content'][data-placement='left-end'] {
|
|
156
|
+
inset-inline-start: auto;
|
|
157
|
+
inset-inline-end: calc(100% + var(--cv-popover-offset, var(--cv-space-1, 4px)));
|
|
158
|
+
inset-block-start: auto;
|
|
159
|
+
inset-block-end: 0;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
[part='content'][data-anchor='host'] {
|
|
163
|
+
min-inline-size: min(560px, calc(100vw - 32px));
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
[part='arrow'] {
|
|
167
|
+
position: absolute;
|
|
168
|
+
display: block;
|
|
169
|
+
inline-size: var(--cv-popover-arrow-size, 8px);
|
|
170
|
+
block-size: var(--cv-popover-arrow-size, 8px);
|
|
171
|
+
}
|
|
172
|
+
`,
|
|
173
|
+
];
|
|
174
|
+
static define() {
|
|
175
|
+
if (!customElements.get(this.elementName)) {
|
|
176
|
+
customElements.define(this.elementName, this);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
connectedCallback() {
|
|
180
|
+
super.connectedCallback();
|
|
181
|
+
this.syncOutsideListeners();
|
|
182
|
+
}
|
|
183
|
+
disconnectedCallback() {
|
|
184
|
+
super.disconnectedCallback();
|
|
185
|
+
this.syncOutsideListeners(true);
|
|
186
|
+
}
|
|
187
|
+
willUpdate(changedProperties) {
|
|
188
|
+
super.willUpdate(changedProperties);
|
|
189
|
+
if (changedProperties.has('ariaLabel') ||
|
|
190
|
+
changedProperties.has('ariaLabelledBy') ||
|
|
191
|
+
changedProperties.has('closeOnEscape') ||
|
|
192
|
+
changedProperties.has('closeOnOutsidePointer') ||
|
|
193
|
+
changedProperties.has('closeOnOutsideFocus')) {
|
|
194
|
+
const wasOpen = this.model.state.isOpen();
|
|
195
|
+
this.model = this.createModel(wasOpen);
|
|
196
|
+
this.previousOpen = wasOpen;
|
|
197
|
+
}
|
|
198
|
+
if (changedProperties.has('open') && this.model.state.isOpen() !== this.open) {
|
|
199
|
+
if (this.open) {
|
|
200
|
+
this.model.actions.open('programmatic');
|
|
201
|
+
}
|
|
202
|
+
else {
|
|
203
|
+
this.model.actions.close('programmatic');
|
|
204
|
+
}
|
|
205
|
+
this.open = this.model.state.isOpen();
|
|
206
|
+
this.previousOpen = this.open;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
updated(changedProperties) {
|
|
210
|
+
super.updated(changedProperties);
|
|
211
|
+
this.syncOutsideListeners();
|
|
212
|
+
}
|
|
213
|
+
createModel(initialOpen = this.open) {
|
|
214
|
+
return createPopover({
|
|
215
|
+
idBase: this.idBase,
|
|
216
|
+
initialOpen,
|
|
217
|
+
ariaLabel: this.ariaLabel || undefined,
|
|
218
|
+
ariaLabelledBy: this.ariaLabelledBy || undefined,
|
|
219
|
+
closeOnEscape: this.closeOnEscape,
|
|
220
|
+
closeOnOutsidePointer: this.closeOnOutsidePointer,
|
|
221
|
+
closeOnOutsideFocus: this.closeOnOutsideFocus,
|
|
222
|
+
useNativePopover: supportsNativePopover,
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
buildEventDetail() {
|
|
226
|
+
return {
|
|
227
|
+
open: this.model.state.isOpen(),
|
|
228
|
+
openedBy: this.model.state.openedBy(),
|
|
229
|
+
dismissIntent: this.model.state.lastDismissIntent(),
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Dispatches beforetoggle and toggle events and syncs open state from headless.
|
|
234
|
+
* If beforetoggle is canceled on open, reverts headless state.
|
|
235
|
+
*/
|
|
236
|
+
emitToggleEvents() {
|
|
237
|
+
const isOpen = this.model.state.isOpen();
|
|
238
|
+
// Only emit if state actually changed
|
|
239
|
+
if (isOpen === this.previousOpen)
|
|
240
|
+
return;
|
|
241
|
+
const detail = this.buildEventDetail();
|
|
242
|
+
// Dispatch beforetoggle (cancelable only on open)
|
|
243
|
+
const cancelable = detail.open;
|
|
244
|
+
const beforeToggleEvent = new CustomEvent('beforetoggle', {
|
|
245
|
+
detail,
|
|
246
|
+
bubbles: true,
|
|
247
|
+
composed: true,
|
|
248
|
+
cancelable,
|
|
249
|
+
});
|
|
250
|
+
this.dispatchEvent(beforeToggleEvent);
|
|
251
|
+
// If opening was prevented, revert headless state
|
|
252
|
+
if (cancelable && beforeToggleEvent.defaultPrevented) {
|
|
253
|
+
this.model.actions.close('programmatic');
|
|
254
|
+
this.open = false;
|
|
255
|
+
this.previousOpen = false;
|
|
256
|
+
return;
|
|
257
|
+
}
|
|
258
|
+
// Sync host attribute
|
|
259
|
+
this.open = isOpen;
|
|
260
|
+
this.previousOpen = isOpen;
|
|
261
|
+
// Dispatch toggle (not cancelable)
|
|
262
|
+
this.dispatchEvent(new CustomEvent('toggle', {
|
|
263
|
+
detail,
|
|
264
|
+
bubbles: false,
|
|
265
|
+
composed: true,
|
|
266
|
+
cancelable: false,
|
|
267
|
+
}));
|
|
268
|
+
// Restore focus if needed
|
|
269
|
+
if (!isOpen) {
|
|
270
|
+
const restoreId = this.model.state.restoreTargetId();
|
|
271
|
+
if (restoreId) {
|
|
272
|
+
const trigger = this.shadowRoot?.querySelector(`[id="${restoreId}"]`);
|
|
273
|
+
trigger?.focus();
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
syncOutsideListeners(forceOff = false) {
|
|
278
|
+
const shouldListen = !forceOff && this.model.state.isOpen();
|
|
279
|
+
if (shouldListen) {
|
|
280
|
+
document.addEventListener('pointerdown', this.handleDocumentPointerDown);
|
|
281
|
+
document.addEventListener('focusin', this.handleDocumentFocusIn);
|
|
282
|
+
}
|
|
283
|
+
else {
|
|
284
|
+
document.removeEventListener('pointerdown', this.handleDocumentPointerDown);
|
|
285
|
+
document.removeEventListener('focusin', this.handleDocumentFocusIn);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
handleDocumentPointerDown = (event) => {
|
|
289
|
+
if (!this.model || !this.model.state.isOpen())
|
|
290
|
+
return;
|
|
291
|
+
const path = event.composedPath();
|
|
292
|
+
if (path.includes(this))
|
|
293
|
+
return;
|
|
294
|
+
this.model.contracts.getContentProps().onPointerDownOutside();
|
|
295
|
+
this.emitToggleEvents();
|
|
296
|
+
this.syncOutsideListeners();
|
|
297
|
+
};
|
|
298
|
+
handleDocumentFocusIn = (event) => {
|
|
299
|
+
if (!this.model || !this.model.state.isOpen())
|
|
300
|
+
return;
|
|
301
|
+
const path = event.composedPath();
|
|
302
|
+
if (path.includes(this))
|
|
303
|
+
return;
|
|
304
|
+
this.model.contracts.getContentProps().onFocusOutside();
|
|
305
|
+
this.emitToggleEvents();
|
|
306
|
+
this.syncOutsideListeners();
|
|
307
|
+
};
|
|
308
|
+
handleTriggerClick() {
|
|
309
|
+
this.model.contracts.getTriggerProps().onClick();
|
|
310
|
+
this.emitToggleEvents();
|
|
311
|
+
this.syncOutsideListeners();
|
|
312
|
+
}
|
|
313
|
+
handleTriggerKeyDown(event) {
|
|
314
|
+
if (popoverTriggerKeys.has(event.key)) {
|
|
315
|
+
event.preventDefault();
|
|
316
|
+
}
|
|
317
|
+
this.model.contracts.getTriggerProps().onKeyDown({ key: event.key });
|
|
318
|
+
this.emitToggleEvents();
|
|
319
|
+
this.syncOutsideListeners();
|
|
320
|
+
}
|
|
321
|
+
handleContentKeyDown(event) {
|
|
322
|
+
if (event.key === 'Escape') {
|
|
323
|
+
event.preventDefault();
|
|
324
|
+
}
|
|
325
|
+
this.model.contracts.getContentProps().onKeyDown({ key: event.key });
|
|
326
|
+
this.emitToggleEvents();
|
|
327
|
+
this.syncOutsideListeners();
|
|
328
|
+
}
|
|
329
|
+
render() {
|
|
330
|
+
const triggerProps = this.model.contracts.getTriggerProps();
|
|
331
|
+
const contentProps = this.model.contracts.getContentProps();
|
|
332
|
+
return html `
|
|
333
|
+
<div part="base">
|
|
334
|
+
<button
|
|
335
|
+
id=${triggerProps.id}
|
|
336
|
+
role=${triggerProps.role}
|
|
337
|
+
tabindex=${triggerProps.tabindex}
|
|
338
|
+
aria-haspopup=${triggerProps['aria-haspopup']}
|
|
339
|
+
aria-expanded=${triggerProps['aria-expanded']}
|
|
340
|
+
aria-controls=${triggerProps['aria-controls']}
|
|
341
|
+
part="trigger"
|
|
342
|
+
type="button"
|
|
343
|
+
@click=${this.handleTriggerClick}
|
|
344
|
+
@keydown=${this.handleTriggerKeyDown}
|
|
345
|
+
>
|
|
346
|
+
<slot name="trigger">Open popover</slot>
|
|
347
|
+
</button>
|
|
348
|
+
|
|
349
|
+
<div
|
|
350
|
+
id=${contentProps.id}
|
|
351
|
+
role=${contentProps.role}
|
|
352
|
+
tabindex=${contentProps.tabindex}
|
|
353
|
+
aria-modal=${contentProps['aria-modal']}
|
|
354
|
+
aria-label=${contentProps['aria-label'] ?? nothing}
|
|
355
|
+
aria-labelledby=${contentProps['aria-labelledby'] ?? nothing}
|
|
356
|
+
?hidden=${contentProps.hidden}
|
|
357
|
+
data-placement=${this.placement}
|
|
358
|
+
data-anchor=${this.anchor}
|
|
359
|
+
style=${`--cv-popover-offset:${this.offset}px;`}
|
|
360
|
+
part="content"
|
|
361
|
+
@keydown=${this.handleContentKeyDown}
|
|
362
|
+
>
|
|
363
|
+
<slot></slot>
|
|
364
|
+
${this.arrow
|
|
365
|
+
? html `
|
|
366
|
+
<span part="arrow"><slot name="arrow"></slot></span>
|
|
367
|
+
`
|
|
368
|
+
: nothing}
|
|
369
|
+
</div>
|
|
370
|
+
</div>
|
|
371
|
+
`;
|
|
372
|
+
}
|
|
373
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { PropertyValues } from 'lit';
|
|
2
|
+
import { ReatomLitElement } from '../reatom-lit/ReatomLitElement.js';
|
|
3
|
+
export declare class CVProgressRing extends ReatomLitElement {
|
|
4
|
+
static elementName: string;
|
|
5
|
+
static get properties(): {
|
|
6
|
+
value: {
|
|
7
|
+
type: NumberConstructor;
|
|
8
|
+
reflect: boolean;
|
|
9
|
+
};
|
|
10
|
+
min: {
|
|
11
|
+
type: NumberConstructor;
|
|
12
|
+
reflect: boolean;
|
|
13
|
+
};
|
|
14
|
+
max: {
|
|
15
|
+
type: NumberConstructor;
|
|
16
|
+
reflect: boolean;
|
|
17
|
+
};
|
|
18
|
+
indeterminate: {
|
|
19
|
+
type: BooleanConstructor;
|
|
20
|
+
reflect: boolean;
|
|
21
|
+
};
|
|
22
|
+
valueText: {
|
|
23
|
+
type: StringConstructor;
|
|
24
|
+
attribute: string;
|
|
25
|
+
};
|
|
26
|
+
ariaLabel: {
|
|
27
|
+
type: StringConstructor;
|
|
28
|
+
attribute: string;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
value: number;
|
|
32
|
+
min: number;
|
|
33
|
+
max: number;
|
|
34
|
+
indeterminate: boolean;
|
|
35
|
+
valueText: string;
|
|
36
|
+
ariaLabel: string;
|
|
37
|
+
private readonly idBase;
|
|
38
|
+
private model;
|
|
39
|
+
constructor();
|
|
40
|
+
static styles: import("lit").CSSResult[];
|
|
41
|
+
static define(): void;
|
|
42
|
+
willUpdate(changedProperties: PropertyValues): void;
|
|
43
|
+
private createModel;
|
|
44
|
+
protected render(): import("lit").TemplateResult<1>;
|
|
45
|
+
}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { createProgress } from '@chromvoid/headless-ui/progress';
|
|
2
|
+
import { css, html, nothing } from 'lit';
|
|
3
|
+
import { ReatomLitElement } from '../reatom-lit/ReatomLitElement.js';
|
|
4
|
+
let cvProgressRingNonce = 0;
|
|
5
|
+
const RADIUS = 45;
|
|
6
|
+
const CIRCUMFERENCE = 2 * Math.PI * RADIUS;
|
|
7
|
+
export class CVProgressRing extends ReatomLitElement {
|
|
8
|
+
static elementName = 'cv-progress-ring';
|
|
9
|
+
static get properties() {
|
|
10
|
+
return {
|
|
11
|
+
value: { type: Number, reflect: true },
|
|
12
|
+
min: { type: Number, reflect: true },
|
|
13
|
+
max: { type: Number, reflect: true },
|
|
14
|
+
indeterminate: { type: Boolean, reflect: true },
|
|
15
|
+
valueText: { type: String, attribute: 'value-text' },
|
|
16
|
+
ariaLabel: { type: String, attribute: 'aria-label' },
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
idBase = `cv-progress-ring-${++cvProgressRingNonce}`;
|
|
20
|
+
model;
|
|
21
|
+
constructor() {
|
|
22
|
+
super();
|
|
23
|
+
this.value = 0;
|
|
24
|
+
this.min = 0;
|
|
25
|
+
this.max = 100;
|
|
26
|
+
this.indeterminate = false;
|
|
27
|
+
this.valueText = '';
|
|
28
|
+
this.ariaLabel = '';
|
|
29
|
+
this.model = this.createModel();
|
|
30
|
+
}
|
|
31
|
+
static styles = [
|
|
32
|
+
css `
|
|
33
|
+
:host {
|
|
34
|
+
display: inline-block;
|
|
35
|
+
position: relative;
|
|
36
|
+
inline-size: var(--cv-progress-ring-size, 80px);
|
|
37
|
+
block-size: var(--cv-progress-ring-size, 80px);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
[part='base'] {
|
|
41
|
+
position: relative;
|
|
42
|
+
inline-size: 100%;
|
|
43
|
+
block-size: 100%;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
[part='svg'] {
|
|
47
|
+
inline-size: 100%;
|
|
48
|
+
block-size: 100%;
|
|
49
|
+
transform: rotate(-90deg);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
[part='track'] {
|
|
53
|
+
fill: none;
|
|
54
|
+
stroke: var(--cv-progress-ring-track-color, var(--cv-color-surface, #141923));
|
|
55
|
+
stroke-width: var(--cv-progress-ring-track-width, 4px);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
[part='indicator'] {
|
|
59
|
+
fill: none;
|
|
60
|
+
stroke: var(--cv-progress-ring-indicator-color, var(--cv-color-primary, #65d7ff));
|
|
61
|
+
stroke-width: var(--cv-progress-ring-indicator-width, 4px);
|
|
62
|
+
stroke-linecap: round;
|
|
63
|
+
transition: stroke-dashoffset var(--cv-duration-normal, 220ms) var(--cv-easing-standard, ease);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
[part='label'] {
|
|
67
|
+
position: absolute;
|
|
68
|
+
inset: 0;
|
|
69
|
+
display: flex;
|
|
70
|
+
align-items: center;
|
|
71
|
+
justify-content: center;
|
|
72
|
+
color: var(--cv-progress-ring-label-color, var(--cv-color-text, #e8ecf6));
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
:host([indeterminate]) [part='svg'] {
|
|
76
|
+
animation: cv-progress-ring-spin 1.15s linear infinite;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
:host([indeterminate]) [part='indicator'] {
|
|
80
|
+
transition: none;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
:host([data-complete]) [part='indicator'] {
|
|
84
|
+
stroke: var(--cv-color-success, #6ef7c8);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
@keyframes cv-progress-ring-spin {
|
|
88
|
+
0% {
|
|
89
|
+
transform: rotate(-90deg);
|
|
90
|
+
}
|
|
91
|
+
100% {
|
|
92
|
+
transform: rotate(270deg);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
`,
|
|
96
|
+
];
|
|
97
|
+
static define() {
|
|
98
|
+
if (!customElements.get(this.elementName)) {
|
|
99
|
+
customElements.define(this.elementName, this);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
willUpdate(changedProperties) {
|
|
103
|
+
super.willUpdate(changedProperties);
|
|
104
|
+
if (changedProperties.has('min') ||
|
|
105
|
+
changedProperties.has('max') ||
|
|
106
|
+
changedProperties.has('valueText') ||
|
|
107
|
+
changedProperties.has('ariaLabel')) {
|
|
108
|
+
this.model = this.createModel();
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
if (changedProperties.has('value') && this.model.state.value() !== this.value) {
|
|
112
|
+
this.model.actions.setValue(this.value);
|
|
113
|
+
}
|
|
114
|
+
if (changedProperties.has('indeterminate')) {
|
|
115
|
+
this.model.actions.setIndeterminate(this.indeterminate);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
createModel() {
|
|
119
|
+
return createProgress({
|
|
120
|
+
idBase: this.idBase,
|
|
121
|
+
value: this.value,
|
|
122
|
+
min: this.min,
|
|
123
|
+
max: this.max,
|
|
124
|
+
isIndeterminate: this.indeterminate,
|
|
125
|
+
valueText: this.valueText || undefined,
|
|
126
|
+
ariaLabel: this.ariaLabel || undefined,
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
render() {
|
|
130
|
+
const props = this.model.contracts.getProgressProps();
|
|
131
|
+
const percentage = Math.max(0, Math.min(100, this.model.state.percentage()));
|
|
132
|
+
const isComplete = this.model.state.isComplete();
|
|
133
|
+
const isIndeterminate = this.model.state.isIndeterminate();
|
|
134
|
+
this.toggleAttribute('data-complete', isComplete);
|
|
135
|
+
const dashoffset = isIndeterminate ? CIRCUMFERENCE * 0.75 : CIRCUMFERENCE * (1 - percentage / 100);
|
|
136
|
+
return html `
|
|
137
|
+
<div
|
|
138
|
+
id=${props.id}
|
|
139
|
+
role=${props.role}
|
|
140
|
+
aria-valuenow=${props['aria-valuenow'] ?? nothing}
|
|
141
|
+
aria-valuemin=${props['aria-valuemin'] ?? nothing}
|
|
142
|
+
aria-valuemax=${props['aria-valuemax'] ?? nothing}
|
|
143
|
+
aria-valuetext=${props['aria-valuetext'] ?? nothing}
|
|
144
|
+
aria-label=${props['aria-label'] ?? nothing}
|
|
145
|
+
aria-labelledby=${props['aria-labelledby'] ?? nothing}
|
|
146
|
+
aria-describedby=${props['aria-describedby'] ?? nothing}
|
|
147
|
+
part="base"
|
|
148
|
+
>
|
|
149
|
+
<svg part="svg" viewBox="0 0 100 100">
|
|
150
|
+
<circle
|
|
151
|
+
part="track"
|
|
152
|
+
cx="50"
|
|
153
|
+
cy="50"
|
|
154
|
+
r="${RADIUS}"
|
|
155
|
+
></circle>
|
|
156
|
+
<circle
|
|
157
|
+
part="indicator"
|
|
158
|
+
cx="50"
|
|
159
|
+
cy="50"
|
|
160
|
+
r="${RADIUS}"
|
|
161
|
+
stroke-dasharray="${CIRCUMFERENCE}"
|
|
162
|
+
style="stroke-dashoffset: ${dashoffset};"
|
|
163
|
+
></circle>
|
|
164
|
+
</svg>
|
|
165
|
+
<span part="label"><slot></slot></span>
|
|
166
|
+
</div>
|
|
167
|
+
`;
|
|
168
|
+
}
|
|
169
|
+
}
|