@cscfi/csc-ui 4.0.0-alpha.0 → 4.0.0-alpha.10
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/dist/csc-ui.js +7750 -6924
- package/dist/custom-elements.json +1047 -128
- package/dist/docs/c-alert/usage.md +24 -0
- package/dist/docs/c-autocomplete/usage.md +28 -2
- package/dist/docs/c-checkbox/usage.md +53 -0
- package/dist/docs/c-popover/usage.md +33 -0
- package/dist/docs/c-progress-bar/usage.md +23 -0
- package/dist/docs/c-progress-circle/usage.md +25 -0
- package/dist/docs/c-radio/usage.md +45 -0
- package/dist/docs/c-radio-group/usage.md +67 -0
- package/dist/docs/c-spinner/usage.md +21 -0
- package/dist/docs/c-switch/usage.md +36 -0
- package/dist/docs/c-table/usage.md +14 -0
- package/dist/docs/c-tooltip/usage.md +30 -0
- package/dist/styles/css/tailwind-theme.css +31 -0
- package/dist/styles/css/tokens.css +282 -201
- package/dist/vscode.css-custom-data.json +104 -15
- package/dist/vscode.html-custom-data.json +187 -26
- package/dist/web-types.json +547 -90
- package/dist-types/components/c-alert/CAlert.vue.d.ts +18 -4
- package/dist-types/components/c-autocomplete/CAutocomplete.vue.d.ts +12 -2
- package/dist-types/components/c-button/CButton.vue.d.ts +1 -1
- package/dist-types/components/c-data-table/CDataTable.vue.d.ts +1 -1
- package/dist-types/components/c-dropdown/CDropdown.vue.d.ts +0 -1
- package/dist-types/components/c-icon/CIcon.vue.d.ts +1 -1
- package/dist-types/components/c-icon-button/CIconButton.vue.d.ts +1 -1
- package/dist-types/components/c-input/CInput.vue.d.ts +4 -0
- package/dist-types/components/c-login-button/CLoginButton.vue.d.ts +4 -2
- package/dist-types/components/c-menu/CMenu.vue.d.ts +13 -3
- package/dist-types/components/c-menu-item/CMenuItem.vue.d.ts +29 -3
- package/dist-types/components/c-popover/CPopover.vue.d.ts +43 -0
- package/dist-types/components/c-progress-circle/CProgressCircle.vue.d.ts +32 -0
- package/dist-types/components/c-radio/CRadio.vue.d.ts +7 -11
- package/dist-types/components/c-radio-group/CRadioGroup.vue.d.ts +8 -46
- package/dist-types/components/c-select/CSelect.vue.d.ts +4 -1
- package/dist-types/components/c-spinner/CSpinner.vue.d.ts +1 -1
- package/dist-types/components/c-table/CTable.vue.d.ts +11 -1
- package/dist-types/components/c-table/injectTableStyles.d.ts +1 -0
- package/dist-types/components/c-tag/CTag.vue.d.ts +1 -1
- package/dist-types/components/c-text-field/CTextField.vue.d.ts +4 -0
- package/dist-types/components/c-tooltip/CTooltip.vue.d.ts +49 -0
- package/dist-types/index.d.ts +9 -1
- package/dist-types/shared/FieldMessage.vue.d.ts +21 -0
- package/dist-types/shared/popoverChain.d.ts +62 -0
- package/dist-types/shared/positionArea.d.ts +13 -0
- package/dist-types/shared/useDesignatedTrigger.d.ts +40 -0
- package/dist-types/shared/useHostStates.d.ts +25 -0
- package/dist-types/tag-name-map.d.ts +207 -34
- package/dist-types/theme/chart-data.d.ts +50 -0
- package/dist-types/theme/ramp.d.ts +38 -0
- package/dist-types/theme/themeMode.d.ts +13 -0
- package/dist-types/types.d.ts +13 -0
- package/package.json +8 -6
package/dist-types/index.d.ts
CHANGED
|
@@ -8,6 +8,8 @@ export type { CIconButtonProps, CIconButtonSize, } from './components/c-icon-but
|
|
|
8
8
|
export type { CLoginCardActionsAlign, CLoginCardActionsJustify, CLoginCardActionsProps, } from './components/c-login-card-actions/CLoginCardActions.vue';
|
|
9
9
|
export type { CLoginCardBlendMode, CLoginCardProps, } from './components/c-login-card/CLoginCard.vue';
|
|
10
10
|
export type { CPaginationOptions, CPaginationProps, CPaginationSize, } from './components/c-pagination/CPagination.vue';
|
|
11
|
+
export type { CPopoverProps } from './components/c-popover/CPopover.vue';
|
|
12
|
+
export type { CProgressCircleProps } from './components/c-progress-circle/CProgressCircle.vue';
|
|
11
13
|
export type { CStatusProps, CStatusType, } from './components/c-status/CStatus.vue';
|
|
12
14
|
export type { CTabButtonsProps, CTabButtonsSize, } from './components/c-tab-buttons/CTabButtons.vue';
|
|
13
15
|
export type { CTabsJustify, CTabsProps } from './components/c-tabs/CTabs.vue';
|
|
@@ -16,10 +18,16 @@ export type { CTagsProps, CTagsSize } from './components/c-tags/CTags.vue';
|
|
|
16
18
|
export type { CTextFieldAutocapitalize, CTextFieldProps, CTextFieldType, } from './components/c-text-field/CTextField.vue';
|
|
17
19
|
export type { CToastProps } from './components/c-toast/CToast.vue';
|
|
18
20
|
export type { CToastsHorizontal, CToastsProps, CToastsVertical, } from './components/c-toasts/CToasts.vue';
|
|
21
|
+
export type { CTooltipProps } from './components/c-tooltip/CTooltip.vue';
|
|
19
22
|
export type * from './tag-name-map';
|
|
20
23
|
export { applyTheme, resetTheme, themeToCss } from './theme/applyTheme';
|
|
21
24
|
export type { Family, ThemeSeeds } from './theme/applyTheme';
|
|
22
|
-
export
|
|
25
|
+
export { chartAnatomy, chartAnatomyHex, chartSlots, chartSlotsHex, } from './theme/chart-data';
|
|
26
|
+
export type { ChartAnatomy, ChartSlots } from './theme/chart-data';
|
|
27
|
+
export { DEFAULT_SEEDS, FAMILIES } from './theme/ramp.js';
|
|
28
|
+
export { themeMode } from './theme/themeMode';
|
|
29
|
+
export type { ThemeMode } from './theme/themeMode';
|
|
30
|
+
export type { CFieldSize, CPlacement, CSelectItem, CToastMessage, CToastType, } from './types';
|
|
23
31
|
export { h } from 'vue';
|
|
24
32
|
export type { VNode, VNodeChild } from 'vue';
|
|
25
33
|
/**
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
interface FieldMessageProps {
|
|
2
|
+
/** Consumer-supplied text shown in place of the hint while invalid. */
|
|
3
|
+
errorMessage?: string;
|
|
4
|
+
/** Suppress the whole message area (no reserved height either). */
|
|
5
|
+
hideDetails?: boolean;
|
|
6
|
+
/** Neutral helper text shown while valid (or when no error message is supplied). */
|
|
7
|
+
hint?: string;
|
|
8
|
+
/** Part name stamped on the message area (`message` unless the host reserves it). */
|
|
9
|
+
part?: string;
|
|
10
|
+
/** Host control's validity; `false` switches to the error message when one is supplied. */
|
|
11
|
+
valid?: boolean;
|
|
12
|
+
}
|
|
13
|
+
declare const __VLS_export: import("vue").DefineComponent<FieldMessageProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<FieldMessageProps> & Readonly<{}>, {
|
|
14
|
+
part: string;
|
|
15
|
+
errorMessage: string;
|
|
16
|
+
hideDetails: boolean;
|
|
17
|
+
hint: string;
|
|
18
|
+
valid: boolean;
|
|
19
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
20
|
+
declare const _default: typeof __VLS_export;
|
|
21
|
+
export default _default;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Popover chain controller (CONTEXT.md "Popover chain", ADR-0038).
|
|
3
|
+
*
|
|
4
|
+
* The ordered set of currently open `c-popover`s, each logically nested in
|
|
5
|
+
* the one before it. This module is the single owner of popover dismissal:
|
|
6
|
+
*
|
|
7
|
+
* - **Escape** peels the innermost popover only, one per press. The listener
|
|
8
|
+
* is capture-phase and calls `preventDefault()`, so an enclosing
|
|
9
|
+
* `c-modal`'s bubble-phase controller sees the claimed key and does not
|
|
10
|
+
* close itself (ADR-0014). Known pre-existing limitation: a `c-menu` open
|
|
11
|
+
* inside a popover listens on its own host (bubble), i.e. *after* this
|
|
12
|
+
* capture listener — that Escape closes both, exactly as it did when each
|
|
13
|
+
* popover owned its own capture listener.
|
|
14
|
+
* - **Pointerdown** closes every popover that does not *logically* contain
|
|
15
|
+
* the event: from the innermost down, everything above the deepest member
|
|
16
|
+
* whose own inside (host subtree, panel, designated trigger) contains the
|
|
17
|
+
* composed path is closed. Containment is logical, not DOM ancestry — a
|
|
18
|
+
* popover whose host lives elsewhere still shields its ancestors, because
|
|
19
|
+
* ancestry is recorded in the chain itself, not re-derived from the DOM.
|
|
20
|
+
* - **Opening** a popover whose trigger sits inside an open member joins the
|
|
21
|
+
* chain below it; one whose trigger is elsewhere replaces the chain.
|
|
22
|
+
* Siblings therefore never coexist.
|
|
23
|
+
* - **Closing** any member (Escape, light dismiss, `open` prop, unmount)
|
|
24
|
+
* closes its descendants — no orphaned floating panels.
|
|
25
|
+
*
|
|
26
|
+
* Why a shared module: each popover's Escape listener is capture-phase on
|
|
27
|
+
* `document`, and `preventDefault()` does not stop other listeners — two
|
|
28
|
+
* independent popovers cannot see each other's claim, so one press closed
|
|
29
|
+
* them all. Coordination needs a single owner, mirroring `modalStack.ts`.
|
|
30
|
+
*/
|
|
31
|
+
export interface PopoverChainEntry {
|
|
32
|
+
/** Close this popover with no focus return (light dismiss / chain cleanup). */
|
|
33
|
+
close(): void;
|
|
34
|
+
/** True when `node` is inside this popover's own logical inside. */
|
|
35
|
+
containsNode(node: Node): boolean;
|
|
36
|
+
/** True when a composed event path passes through this popover's own inside. */
|
|
37
|
+
containsPath(path: EventTarget[]): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* The node that chains this popover under an open ancestor: its designated
|
|
40
|
+
* trigger, else its slotted trigger, else its host.
|
|
41
|
+
*/
|
|
42
|
+
getAnchorNode(): Node | null;
|
|
43
|
+
/** Escape routed here — this popover is the innermost. Decides focus return. */
|
|
44
|
+
onEscape(): void;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Shadow-piercing containment: like `Node.contains` but hopping from a shadow
|
|
48
|
+
* root to its host, so content inside a descendant component's shadow root
|
|
49
|
+
* (and slotted light DOM) counts as inside.
|
|
50
|
+
*/
|
|
51
|
+
export declare const composedContains: (ancestor: Node, node: Node | null) => boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Register an opening popover. Resolves its chain parent from where its
|
|
54
|
+
* anchor node sits; members that would become siblings are closed first.
|
|
55
|
+
* Idempotent.
|
|
56
|
+
*/
|
|
57
|
+
export declare const enterChain: (entry: PopoverChainEntry) => void;
|
|
58
|
+
/**
|
|
59
|
+
* Unregister a closing popover (idempotent) and close its descendants —
|
|
60
|
+
* whatever closed it, nothing may stay floating above it.
|
|
61
|
+
*/
|
|
62
|
+
export declare const leaveChain: (entry: PopoverChainEntry) => void;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { CPlacement } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* `CPlacement` → CSS `position-area`, shared by the anchor-positioned overlay
|
|
4
|
+
* components (`c-menu`, `c-tooltip`, `c-popover`; ADR-0008). Native flip/shift
|
|
5
|
+
* comes from each component's `position-try-fallbacks` escape-hatch rule.
|
|
6
|
+
*/
|
|
7
|
+
export declare const POSITION_AREA: Record<CPlacement, string>;
|
|
8
|
+
/**
|
|
9
|
+
* The logical axis of a placement's side — the axis the trigger→panel gap
|
|
10
|
+
* margin is applied on (both sides, so the gap survives the position-try
|
|
11
|
+
* flip fallbacks).
|
|
12
|
+
*/
|
|
13
|
+
export declare const placementAxis: (position: CPlacement) => "block" | "inline";
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Designated trigger (CONTEXT.md "Trigger", ADR-0038): the `trigger` prop
|
|
3
|
+
* route of supplying an overlay component's trigger — an element elsewhere in
|
|
4
|
+
* the document, designated by ID or by reference, instead of projected into
|
|
5
|
+
* the `trigger` slot. The two routes are the same concept: the component
|
|
6
|
+
* wires its usual opening interaction and ARIA onto the designated element,
|
|
7
|
+
* exactly as it does for a slotted one.
|
|
8
|
+
*
|
|
9
|
+
* Positioning: CSS anchor names are tree-scoped, so the shadow-DOM panel
|
|
10
|
+
* cannot reference an `anchor-name` on an outer-tree element. Instead the
|
|
11
|
+
* component keeps a *proxy anchor* — an inert, fixed-position box in its own
|
|
12
|
+
* shadow root carrying the anchor name — and this composable pins it over
|
|
13
|
+
* the designated trigger's rect while the panel is open (a rAF loop, the
|
|
14
|
+
* same tracking strategy the OddBird polyfill uses). `position-area`
|
|
15
|
+
* placement and the `position-try-fallbacks` flip/shift keep working
|
|
16
|
+
* unchanged; only the measurement is JS.
|
|
17
|
+
*/
|
|
18
|
+
import { type Ref } from 'vue';
|
|
19
|
+
export interface DesignatedTriggerHandle {
|
|
20
|
+
/** The resolved designated trigger; null when the prop is unset/unresolved. */
|
|
21
|
+
element: Readonly<Ref<HTMLElement | null>>;
|
|
22
|
+
/** Re-resolve the prop (an ID may match only after later DOM insertion). */
|
|
23
|
+
resolve(): HTMLElement | null;
|
|
24
|
+
/** Pin the proxy over the trigger every frame until `stopTracking`. */
|
|
25
|
+
startTracking(): void;
|
|
26
|
+
stopTracking(): void;
|
|
27
|
+
}
|
|
28
|
+
export interface UseDesignatedTriggerOptions {
|
|
29
|
+
/** Tag name for console warnings (e.g. `c-popover`). */
|
|
30
|
+
componentName: string;
|
|
31
|
+
/** Interaction listeners kept installed on the designated element. */
|
|
32
|
+
listeners: Record<string, EventListener>;
|
|
33
|
+
/** Resolved element changed — mirror/clean ARIA here. */
|
|
34
|
+
onElementChange?: (el: HTMLElement | null, prev: HTMLElement | null) => void;
|
|
35
|
+
/** The in-shadow proxy anchor to pin over the designated trigger. */
|
|
36
|
+
proxy: Ref<HTMLElement | null>;
|
|
37
|
+
/** The raw `trigger` prop: a document ID or an element reference. */
|
|
38
|
+
source: () => HTMLElement | string | undefined;
|
|
39
|
+
}
|
|
40
|
+
export declare const useDesignatedTrigger: (options: UseDesignatedTriggerOptions) => DesignatedTriggerHandle;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Host custom-state exposure — the single path for publishing a component's
|
|
3
|
+
* internal state to consumer CSS as `:state(<name>)` selectors (ADR-0035).
|
|
4
|
+
*
|
|
5
|
+
* Selection controls keep their live state (checked, indeterminate, …) on a
|
|
6
|
+
* hidden `<input>` inside the shadow root, where no consumer selector can see
|
|
7
|
+
* it. `ElementInternals.states` republishes it on the host, so a consumer can
|
|
8
|
+
* write per-state `::part()` rules:
|
|
9
|
+
*
|
|
10
|
+
* c-checkbox:state(checked)::part(indicator) { background: green; }
|
|
11
|
+
*
|
|
12
|
+
* Usage:
|
|
13
|
+
*
|
|
14
|
+
* const setState = useHostStates();
|
|
15
|
+
* watch(isChecked, (on) => setState('checked', on), { immediate: true });
|
|
16
|
+
*
|
|
17
|
+
* Each exposed state name is public API — curated like parts, documented with
|
|
18
|
+
* a `@cssstate` docblock tag so it lands in the manifest.
|
|
19
|
+
*
|
|
20
|
+
* `attachInternals()` may be called only once per element; this composable
|
|
21
|
+
* owns that call. Everything degrades to a silent no-op where internals or
|
|
22
|
+
* `states` are unavailable (SSR, tests, an ancient browser) — the component
|
|
23
|
+
* still renders and behaves, only the `:state()` selector surface is absent.
|
|
24
|
+
*/
|
|
25
|
+
export declare const useHostStates: () => ((name: string, on: boolean) => void);
|
|
@@ -18,15 +18,9 @@ type DropdownItem = {
|
|
|
18
18
|
disabled?: boolean;
|
|
19
19
|
name: string;
|
|
20
20
|
outerHTML?: string;
|
|
21
|
-
querySelector?: (s: string) => Element | null;
|
|
22
21
|
selected?: boolean;
|
|
23
22
|
value: number | string;
|
|
24
23
|
};
|
|
25
|
-
interface RadioItem {
|
|
26
|
-
disabled?: boolean;
|
|
27
|
-
name: string;
|
|
28
|
-
value: number | string;
|
|
29
|
-
}
|
|
30
24
|
/** Events dispatched by `<c-accordion>`. */
|
|
31
25
|
export interface CAccordionElementEventMap {
|
|
32
26
|
/**
|
|
@@ -93,9 +87,32 @@ export interface CAccordionItemElement extends Omit<HTMLElement, 'collapsable' |
|
|
|
93
87
|
removeEventListener<K extends keyof CAccordionItemElementEventMap>(type: K, listener: (this: CAccordionItemElement, ev: CAccordionItemElementEventMap[K]) => void, options?: boolean | EventListenerOptions): void;
|
|
94
88
|
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
95
89
|
}
|
|
96
|
-
|
|
90
|
+
/** Events dispatched by `<c-alert>`. */
|
|
91
|
+
export interface CAlertElementEventMap {
|
|
92
|
+
/**
|
|
93
|
+
* Fired when the dismiss button is pressed. The alert does not hide
|
|
94
|
+
* itself — the consumer owns removal.
|
|
95
|
+
*/
|
|
96
|
+
dismiss: CustomEvent<void>;
|
|
97
|
+
}
|
|
98
|
+
/** A persistent, in-flow status message: a tinted box whose type carries a status family's colours through the icon, heading and accent edge, while the body copy stays neutral. */
|
|
99
|
+
export interface CAlertElement extends Omit<HTMLElement, 'dismissible' | 'heading' | 'type'> {
|
|
100
|
+
/**
|
|
101
|
+
* Show a dismiss button. The alert only emits `dismiss` — removing it from
|
|
102
|
+
* the page stays the consumer's job.
|
|
103
|
+
*/
|
|
104
|
+
dismissible?: boolean;
|
|
105
|
+
/**
|
|
106
|
+
* Heading rendered above the message. The `heading` slot overrides it for
|
|
107
|
+
* rich content.
|
|
108
|
+
*/
|
|
109
|
+
heading?: string;
|
|
97
110
|
/** Type of the alert */
|
|
98
111
|
type?: 'default' | 'error' | 'info' | 'success' | 'warning';
|
|
112
|
+
addEventListener<K extends keyof CAlertElementEventMap>(type: K, listener: (this: CAlertElement, ev: CAlertElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions): void;
|
|
113
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
114
|
+
removeEventListener<K extends keyof CAlertElementEventMap>(type: K, listener: (this: CAlertElement, ev: CAlertElementEventMap[K]) => void, options?: boolean | EventListenerOptions): void;
|
|
115
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
99
116
|
}
|
|
100
117
|
/** Events dispatched by `<c-autocomplete>`. */
|
|
101
118
|
export interface CAutocompleteElementEventMap {
|
|
@@ -105,6 +122,13 @@ export interface CAutocompleteElementEventMap {
|
|
|
105
122
|
* form-style listeners.
|
|
106
123
|
*/
|
|
107
124
|
change: CustomEvent<void>;
|
|
125
|
+
/**
|
|
126
|
+
* Fired whenever the query changes — on every keystroke in the search
|
|
127
|
+
* input, and with an empty string when the panel opens. Carries the query
|
|
128
|
+
* string. With `external`, drive your data source from this (debounce on
|
|
129
|
+
* your side) and feed the results back via `items`.
|
|
130
|
+
*/
|
|
131
|
+
'change:query': CustomEvent<string>;
|
|
108
132
|
/**
|
|
109
133
|
* Fired when the selected value changes (an option is committed or the
|
|
110
134
|
* selection is cleared), carrying the new value — the option's value, or
|
|
@@ -124,14 +148,20 @@ export interface CAutocompleteElementEventMap {
|
|
|
124
148
|
'update:value': CustomEvent<CAutocompleteItem | null | number | string>;
|
|
125
149
|
}
|
|
126
150
|
/** A filterable value-selection component: a readonly value field that opens a popover panel with a search input above the matching options. */
|
|
127
|
-
export interface CAutocompleteElement extends Omit<HTMLElement, 'clearable' | 'disabled' | 'errorMessage' | 'filter' | 'hideDetails' | 'hint' | 'hostId' | 'items' | 'itemsPerPage' | 'label' | 'labelOnTop' | 'loading' | 'name' | 'noResultsText' | 'placeholder' | 'required' | 'returnObject' | 'shadow' | 'valid' | 'value'> {
|
|
151
|
+
export interface CAutocompleteElement extends Omit<HTMLElement, 'clearable' | 'disabled' | 'errorMessage' | 'external' | 'filter' | 'hideDetails' | 'hint' | 'hostId' | 'items' | 'itemsPerPage' | 'label' | 'labelOnTop' | 'loading' | 'name' | 'noResultsText' | 'placeholder' | 'required' | 'returnObject' | 'shadow' | 'size' | 'valid' | 'value'> {
|
|
128
152
|
/** Make the selected value clearable */
|
|
129
153
|
clearable?: boolean;
|
|
130
154
|
/** Disable the input */
|
|
131
155
|
disabled?: boolean;
|
|
132
156
|
/** Error message shown in place of the hint while the autocomplete is invalid */
|
|
133
157
|
errorMessage?: string;
|
|
134
|
-
/**
|
|
158
|
+
/**
|
|
159
|
+
* The consumer owns filtering: the component renders its options verbatim
|
|
160
|
+
* and only emits `change:query` as the user types. Pair with `loading` and
|
|
161
|
+
* an async data source feeding `items`
|
|
162
|
+
*/
|
|
163
|
+
external?: boolean;
|
|
164
|
+
/** Custom filter predicate; receives a normalized option + the query. Ignored when `external` is set */
|
|
135
165
|
filter?: CAutocompleteFilter;
|
|
136
166
|
/** Hide the hint and error messages */
|
|
137
167
|
hideDetails?: boolean;
|
|
@@ -161,6 +191,8 @@ export interface CAutocompleteElement extends Omit<HTMLElement, 'clearable' | 'd
|
|
|
161
191
|
returnObject?: boolean;
|
|
162
192
|
/** Shadow variant */
|
|
163
193
|
shadow?: boolean;
|
|
194
|
+
/** Field height: the 44px default or the 36px `small` box */
|
|
195
|
+
size?: 'default' | 'small';
|
|
164
196
|
/** Set the validity of the input */
|
|
165
197
|
valid?: boolean;
|
|
166
198
|
/** Selected value (scalar, or object when return-object is set) */
|
|
@@ -311,6 +343,7 @@ export interface CCheckboxElementEventMap {
|
|
|
311
343
|
*/
|
|
312
344
|
'update:value': CustomEvent<boolean | number | string>;
|
|
313
345
|
}
|
|
346
|
+
/** A form control for a single on/off choice: a native checkbox with a label, an optional hint, and validation messaging. */
|
|
314
347
|
export interface CCheckboxElement extends Omit<HTMLElement, 'checked' | 'disabled' | 'errorMessage' | 'falseValue' | 'hideDetails' | 'hint' | 'hostId' | 'hostName' | 'indeterminate' | 'label' | 'required' | 'trueValue' | 'valid' | 'value'> {
|
|
315
348
|
/** If `true`, the checkbox is selected. */
|
|
316
349
|
checked?: boolean;
|
|
@@ -522,7 +555,7 @@ export interface CIconButtonElement extends Omit<HTMLElement, 'badge' | 'danger'
|
|
|
522
555
|
/** Text variant of the button */
|
|
523
556
|
text?: boolean;
|
|
524
557
|
}
|
|
525
|
-
export interface CInputElement extends Omit<HTMLElement, 'active' | 'disabled' | 'errorMessage' | 'filled' | 'hideDetails' | 'hint' | 'inputId' | 'isTextarea' | 'label' | 'labelOnTop' | 'required' | 'shadow' | 'valid'> {
|
|
558
|
+
export interface CInputElement extends Omit<HTMLElement, 'active' | 'disabled' | 'errorMessage' | 'filled' | 'hideDetails' | 'hint' | 'inputId' | 'isTextarea' | 'label' | 'labelOnTop' | 'required' | 'shadow' | 'size' | 'valid'> {
|
|
526
559
|
/** Set by the wrapping form component when its input has focus or holds a value. */
|
|
527
560
|
active?: boolean;
|
|
528
561
|
/** Disable the input */
|
|
@@ -547,6 +580,8 @@ export interface CInputElement extends Omit<HTMLElement, 'active' | 'disabled' |
|
|
|
547
580
|
required?: boolean;
|
|
548
581
|
/** Shadow variant of the input */
|
|
549
582
|
shadow?: boolean;
|
|
583
|
+
/** Field height: the 44px default or the 36px `small` box */
|
|
584
|
+
size?: 'default' | 'small';
|
|
550
585
|
/** Set the validíty of the input */
|
|
551
586
|
valid?: boolean;
|
|
552
587
|
}
|
|
@@ -668,24 +703,50 @@ export interface CMenuElementEventMap {
|
|
|
668
703
|
value: unknown;
|
|
669
704
|
}>;
|
|
670
705
|
}
|
|
671
|
-
export interface CMenuElement extends Omit<HTMLElement, 'distance' | 'open' | 'position'> {
|
|
706
|
+
export interface CMenuElement extends Omit<HTMLElement, 'distance' | 'open' | 'position' | 'trigger'> {
|
|
672
707
|
/** Distance from the trigger to the panel, in pixels. Defaults to `0`. */
|
|
673
708
|
distance?: number | string;
|
|
674
709
|
/** Whether the menu is open. Two-way: emits `change:open`. */
|
|
675
710
|
open?: boolean;
|
|
676
711
|
/** Preferred placement of the panel relative to the trigger. */
|
|
677
712
|
position?: 'bottom-end' | 'bottom-start' | 'bottom' | 'left-end' | 'left-start' | 'left' | 'right-end' | 'right-start' | 'right' | 'top-end' | 'top-start' | 'top';
|
|
713
|
+
/**
|
|
714
|
+
* Designated trigger: an element elsewhere in the document that opens the
|
|
715
|
+
* menu — its document ID, or the element itself. The same trigger concept
|
|
716
|
+
* as the `trigger` slot, supplied by reference: the menu wires
|
|
717
|
+
* click-to-toggle, arrow-key opening, ARIA and focus return onto it and
|
|
718
|
+
* anchors the panel to it. When both routes are supplied, this prop wins
|
|
719
|
+
* over the slot.
|
|
720
|
+
*/
|
|
721
|
+
trigger?: HTMLElement | string;
|
|
678
722
|
addEventListener<K extends keyof CMenuElementEventMap>(type: K, listener: (this: CMenuElement, ev: CMenuElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions): void;
|
|
679
723
|
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
680
724
|
removeEventListener<K extends keyof CMenuElementEventMap>(type: K, listener: (this: CMenuElement, ev: CMenuElementEventMap[K]) => void, options?: boolean | EventListenerOptions): void;
|
|
681
725
|
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
682
726
|
}
|
|
683
727
|
/** A single command in a `c-menu`. */
|
|
684
|
-
export interface CMenuItemElement extends Omit<HTMLElement, 'danger' | 'disabled' | 'value'> {
|
|
728
|
+
export interface CMenuItemElement extends Omit<HTMLElement, 'active' | 'activeIcon' | 'danger' | 'disabled' | 'icon' | 'value'> {
|
|
729
|
+
/**
|
|
730
|
+
* Marks the item as the currently selected choice: renders the trailing
|
|
731
|
+
* indicator icon and stamps `role="menuitemradio"` + `aria-checked`. Leave
|
|
732
|
+
* unset for regular command items — only a true/false value marks the item
|
|
733
|
+
* as a selectable choice. The state is consumer-owned: the menu emits
|
|
734
|
+
* `select` as usual and never toggles this itself. Distinct from the
|
|
735
|
+
* keyboard highlight (the `data-active` attribute the controlling menu
|
|
736
|
+
* moves between rows).
|
|
737
|
+
*/
|
|
738
|
+
active?: boolean;
|
|
739
|
+
/**
|
|
740
|
+
* SVG path for the trailing indicator shown while `active`; defaults to a
|
|
741
|
+
* check mark.
|
|
742
|
+
*/
|
|
743
|
+
activeIcon?: string;
|
|
685
744
|
/** Marks the action as destructive (renders in the error colour). */
|
|
686
745
|
danger?: boolean;
|
|
687
746
|
/** Disables the item — it is skipped by keyboard nav and emits no select. */
|
|
688
747
|
disabled?: boolean;
|
|
748
|
+
/** SVG path for a leading icon rendered before the item's content. */
|
|
749
|
+
icon?: string;
|
|
689
750
|
/** Value reported in the menu's `select` event when this item is chosen. */
|
|
690
751
|
value?: string;
|
|
691
752
|
closeSubmenu(): void;
|
|
@@ -847,6 +908,45 @@ export interface CPaginationElement extends Omit<HTMLElement, 'hideDetails' | 'h
|
|
|
847
908
|
removeEventListener<K extends keyof CPaginationElementEventMap>(type: K, listener: (this: CPaginationElement, ev: CPaginationElementEventMap[K]) => void, options?: boolean | EventListenerOptions): void;
|
|
848
909
|
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
849
910
|
}
|
|
911
|
+
/** Events dispatched by `<c-popover>`. */
|
|
912
|
+
export interface CPopoverElementEventMap {
|
|
913
|
+
/**
|
|
914
|
+
* Fired whenever the popover opens or closes, carrying the new open state.
|
|
915
|
+
* Named `change:open`, not `update:open`: Vue's runtime silently drops
|
|
916
|
+
* `onUpdate:*` listeners on custom elements (`isModelListener`), so a
|
|
917
|
+
* template `@update:open` would never be attached.
|
|
918
|
+
*/
|
|
919
|
+
'change:open': CustomEvent<boolean>;
|
|
920
|
+
}
|
|
921
|
+
/** A click-opened, non-modal surface anchored to its trigger, floating in the top layer; its content may be interactive. */
|
|
922
|
+
export interface CPopoverElement extends Omit<HTMLElement, 'distance' | 'heading' | 'open' | 'position' | 'trigger'> {
|
|
923
|
+
/** Distance from the trigger to the panel, in pixels. Defaults to `0`. */
|
|
924
|
+
distance?: number | string;
|
|
925
|
+
/**
|
|
926
|
+
* Heading rendered at the top of the panel, doubling as its accessible
|
|
927
|
+
* name. Without it, set `aria-label` on the host. Named `heading`, not
|
|
928
|
+
* `title`: a `title` attribute on the host would trigger the browser's
|
|
929
|
+
* native tooltip and collides with `HTMLElement.title`.
|
|
930
|
+
*/
|
|
931
|
+
heading?: string;
|
|
932
|
+
/** Whether the popover is open. Two-way: emits `change:open`. */
|
|
933
|
+
open?: boolean;
|
|
934
|
+
/** Preferred placement of the panel relative to the trigger. */
|
|
935
|
+
position?: 'bottom-end' | 'bottom-start' | 'bottom' | 'left-end' | 'left-start' | 'left' | 'right-end' | 'right-start' | 'right' | 'top-end' | 'top-start' | 'top';
|
|
936
|
+
/**
|
|
937
|
+
* Designated trigger: an element elsewhere in the document that opens the
|
|
938
|
+
* popover — its document ID, or the element itself. The same trigger
|
|
939
|
+
* concept as the `trigger` slot, supplied by reference: the popover wires
|
|
940
|
+
* click-to-toggle, ARIA and focus return onto it and anchors the panel to
|
|
941
|
+
* it. When both routes are supplied, this prop wins over the slot.
|
|
942
|
+
*/
|
|
943
|
+
trigger?: HTMLElement | string;
|
|
944
|
+
addEventListener<K extends keyof CPopoverElementEventMap>(type: K, listener: (this: CPopoverElement, ev: CPopoverElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions): void;
|
|
945
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
946
|
+
removeEventListener<K extends keyof CPopoverElementEventMap>(type: K, listener: (this: CPopoverElement, ev: CPopoverElementEventMap[K]) => void, options?: boolean | EventListenerOptions): void;
|
|
947
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
948
|
+
}
|
|
949
|
+
/** A horizontal progress bar that fills a track to a known completion percentage, with an optional details line showing the value and a label. */
|
|
850
950
|
export interface CProgressBarElement extends Omit<HTMLElement, 'hideDetails' | 'indeterminate' | 'label' | 'singleLine' | 'value'> {
|
|
851
951
|
/** Hide the percentage display */
|
|
852
952
|
hideDetails?: boolean;
|
|
@@ -859,33 +959,56 @@ export interface CProgressBarElement extends Omit<HTMLElement, 'hideDetails' | '
|
|
|
859
959
|
/** Progress bar value in percentage (0 to 100) */
|
|
860
960
|
value?: number;
|
|
861
961
|
}
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
962
|
+
/** A circular progress indicator that draws a known completion percentage as an arc around a track — the circular counterpart of `c-progress-bar`. */
|
|
963
|
+
export interface CProgressCircleElement extends Omit<HTMLElement, 'size' | 'value' | 'width'> {
|
|
964
|
+
/** Diameter of the circle in pixels */
|
|
965
|
+
size?: number;
|
|
966
|
+
/** Progress value in percentage (0 to 100) */
|
|
967
|
+
value?: number;
|
|
968
|
+
/**
|
|
969
|
+
* Stroke width of the track in pixels; the value arc draws at half this
|
|
970
|
+
* width, inset within the track
|
|
971
|
+
*/
|
|
972
|
+
width?: number;
|
|
973
|
+
}
|
|
974
|
+
/** Events dispatched by `<c-radio>`. */
|
|
975
|
+
export interface CRadioElementEventMap {
|
|
976
|
+
/**
|
|
977
|
+
* Fired when the radio is selected by the user, carrying its `value`.
|
|
978
|
+
* Bubbles composed so the parent `<c-radio-group>` — whose shadow root a
|
|
979
|
+
* light-DOM event never enters — catches it on its host; a consumer
|
|
980
|
+
* listening on the group hears it too, with the radio as `target`.
|
|
981
|
+
*/
|
|
982
|
+
change: CustomEvent<string>;
|
|
983
|
+
}
|
|
984
|
+
/** A single radio option inside a `c-radio-group`: a native radio input whose default slot is its clickable, announced label. */
|
|
985
|
+
export interface CRadioElement extends Omit<HTMLElement, 'disabled' | 'value'> {
|
|
865
986
|
/** Disable the radio button */
|
|
866
987
|
disabled?: boolean;
|
|
867
988
|
/** Radio button value */
|
|
868
989
|
value?: string;
|
|
990
|
+
addEventListener<K extends keyof CRadioElementEventMap>(type: K, listener: (this: CRadioElement, ev: CRadioElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions): void;
|
|
991
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
992
|
+
removeEventListener<K extends keyof CRadioElementEventMap>(type: K, listener: (this: CRadioElement, ev: CRadioElementEventMap[K]) => void, options?: boolean | EventListenerOptions): void;
|
|
993
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
869
994
|
}
|
|
870
995
|
/** Events dispatched by `<c-radio-group>`. */
|
|
871
996
|
export interface CRadioGroupElementEventMap {
|
|
872
|
-
/**
|
|
873
|
-
|
|
874
|
-
* value — or the whole item object when `return-object` is set.
|
|
875
|
-
*/
|
|
876
|
-
changeValue: CustomEvent<number | RadioItem | string>;
|
|
997
|
+
/** Fired when a radio is selected, carrying the selected radio's value. */
|
|
998
|
+
changeValue: CustomEvent<string>;
|
|
877
999
|
/**
|
|
878
1000
|
* Native bubbling input event fired on selection so a plain Vue `v-model`
|
|
879
1001
|
* works without the `v-control` directive. No detail.
|
|
880
1002
|
*/
|
|
881
1003
|
input: CustomEvent<void>;
|
|
882
1004
|
/**
|
|
883
|
-
* v-model contract event fired on selection, carrying the selected
|
|
884
|
-
* value
|
|
1005
|
+
* v-model contract event fired on selection, carrying the selected radio's
|
|
1006
|
+
* value.
|
|
885
1007
|
*/
|
|
886
|
-
'update:value': CustomEvent<
|
|
1008
|
+
'update:value': CustomEvent<string>;
|
|
887
1009
|
}
|
|
888
|
-
|
|
1010
|
+
/** A radio group is a set of mutually exclusive choices where exactly one can be selected, authored as slotted `c-radio` children. Give the group a `label` so the choice it represents is named for every user, and a `hint` describing how to answer. */
|
|
1011
|
+
export interface CRadioGroupElement extends Omit<HTMLElement, 'disabled' | 'errorMessage' | 'hideDetails' | 'hint' | 'inline' | 'label' | 'required' | 'valid' | 'value'> {
|
|
889
1012
|
/** Disable the radio group */
|
|
890
1013
|
disabled?: boolean;
|
|
891
1014
|
/** Error message shown in place of the hint while the group is invalid */
|
|
@@ -894,22 +1017,19 @@ export interface CRadioGroupElement extends Omit<HTMLElement, 'disabled' | 'erro
|
|
|
894
1017
|
hideDetails?: boolean;
|
|
895
1018
|
/** Hint text for the input */
|
|
896
1019
|
hint?: string;
|
|
897
|
-
/** Id of the element */
|
|
898
|
-
hostId?: string;
|
|
899
1020
|
/** Display radio buttons inline */
|
|
900
1021
|
inline?: boolean;
|
|
901
|
-
/** Radio group items */
|
|
902
|
-
items?: RadioItem[];
|
|
903
1022
|
/** Label of the radio group */
|
|
904
1023
|
label?: string;
|
|
905
1024
|
/** Set as required */
|
|
906
1025
|
required?: boolean;
|
|
907
|
-
/** Return the whole item object */
|
|
908
|
-
returnObject?: boolean;
|
|
909
1026
|
/** Set the validity of the input */
|
|
910
1027
|
valid?: boolean;
|
|
911
|
-
/**
|
|
912
|
-
|
|
1028
|
+
/**
|
|
1029
|
+
* Value of the radio group; matched against each radio's `value` by strict
|
|
1030
|
+
* string equality
|
|
1031
|
+
*/
|
|
1032
|
+
value?: null | string;
|
|
913
1033
|
addEventListener<K extends keyof CRadioGroupElementEventMap>(type: K, listener: (this: CRadioGroupElement, ev: CRadioGroupElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions): void;
|
|
914
1034
|
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
915
1035
|
removeEventListener<K extends keyof CRadioGroupElementEventMap>(type: K, listener: (this: CRadioGroupElement, ev: CRadioGroupElementEventMap[K]) => void, options?: boolean | EventListenerOptions): void;
|
|
@@ -934,7 +1054,7 @@ export interface CSelectElementEventMap {
|
|
|
934
1054
|
*/
|
|
935
1055
|
'update:value': CustomEvent<CSelectItem | null | number | string>;
|
|
936
1056
|
}
|
|
937
|
-
export interface CSelectElement extends Omit<HTMLElement, 'clearable' | 'disabled' | 'errorMessage' | 'hideDetails' | 'hint' | 'hostId' | 'items' | 'itemsPerPage' | 'label' | 'labelOnTop' | 'loading' | 'name' | 'optionAsSelection' | 'placeholder' | 'required' | 'returnObject' | 'shadow' | 'valid' | 'value'> {
|
|
1057
|
+
export interface CSelectElement extends Omit<HTMLElement, 'clearable' | 'disabled' | 'errorMessage' | 'hideDetails' | 'hint' | 'hostId' | 'items' | 'itemsPerPage' | 'label' | 'labelOnTop' | 'loading' | 'name' | 'optionAsSelection' | 'placeholder' | 'required' | 'returnObject' | 'shadow' | 'size' | 'valid' | 'value'> {
|
|
938
1058
|
/** Make the selected value clearable */
|
|
939
1059
|
clearable?: boolean;
|
|
940
1060
|
/** Disable the input */
|
|
@@ -969,6 +1089,8 @@ export interface CSelectElement extends Omit<HTMLElement, 'clearable' | 'disable
|
|
|
969
1089
|
returnObject?: boolean;
|
|
970
1090
|
/** Shadow variant */
|
|
971
1091
|
shadow?: boolean;
|
|
1092
|
+
/** Field height: the 44px default or the 36px `small` box */
|
|
1093
|
+
size?: 'default' | 'small';
|
|
972
1094
|
/** Set the validity of the input */
|
|
973
1095
|
valid?: boolean;
|
|
974
1096
|
/** Selected value (scalar, or object when return-object is set) */
|
|
@@ -1084,6 +1206,7 @@ export interface CSliderElement extends Omit<HTMLElement, 'ariaLabelInternal' |
|
|
|
1084
1206
|
removeEventListener<K extends keyof CSliderElementEventMap>(type: K, listener: (this: CSliderElement, ev: CSliderElementEventMap[K]) => void, options?: boolean | EventListenerOptions): void;
|
|
1085
1207
|
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
1086
1208
|
}
|
|
1209
|
+
/** A circular indeterminate activity indicator — pure motion with no value, for waits of unknown duration. */
|
|
1087
1210
|
export interface CSpinnerElement extends Omit<HTMLElement, 'color' | 'size' | 'width'> {
|
|
1088
1211
|
/** Color of the spinner */
|
|
1089
1212
|
color?: string;
|
|
@@ -1142,6 +1265,7 @@ export interface CSwitchElementEventMap {
|
|
|
1142
1265
|
*/
|
|
1143
1266
|
'update:value': CustomEvent<boolean | number | string>;
|
|
1144
1267
|
}
|
|
1268
|
+
/** A toggle for a binary setting that takes effect immediately: a native switch control with a label, an optional hint, and validation messaging. */
|
|
1145
1269
|
export interface CSwitchElement extends Omit<HTMLElement, 'checked' | 'disabled' | 'falseValue' | 'hostId' | 'label' | 'loading' | 'required' | 'trueValue' | 'value'> {
|
|
1146
1270
|
/** If `true`, the checkbox is selected. */
|
|
1147
1271
|
checked?: boolean;
|
|
@@ -1259,6 +1383,7 @@ export interface CTabItemsElement extends Omit<HTMLElement, 'disableAnimation' |
|
|
|
1259
1383
|
/** Currently active tab */
|
|
1260
1384
|
value?: number | string;
|
|
1261
1385
|
}
|
|
1386
|
+
/** A styled wrapper for a table you author yourself: slot in a plain `<table>` and c-table gives it the CSC look plus an optional responsive card layout on narrow screens. The table stays in your own DOM — your stylesheets, your framework's rendering, and `::part()` selectors on components nested in cells (a `c-tag` status chip, a `c-pagination` footer) all keep working. */
|
|
1262
1387
|
export interface CTableElement extends Omit<HTMLElement, 'mobileBreakpoint' | 'responsive'> {
|
|
1263
1388
|
/** Mobile breakpoint in pixels */
|
|
1264
1389
|
mobileBreakpoint?: number;
|
|
@@ -1355,7 +1480,7 @@ export interface CTextFieldElementEventMap {
|
|
|
1355
1480
|
*/
|
|
1356
1481
|
'update:value': CustomEvent<string>;
|
|
1357
1482
|
}
|
|
1358
|
-
export interface CTextFieldElement extends Omit<HTMLElement, 'autocomplete' | 'autocorrect' | 'automaticCapitalize' | 'disabled' | 'errorMessage' | 'hideDetails' | 'hint' | 'hostId' | 'label' | 'labelOnTop' | 'max' | 'min' | 'name' | 'placeholder' | 'readonly' | 'required' | 'rows' | 'shadow' | 'step' | 'trimWhitespace' | 'type' | 'valid' | 'value'> {
|
|
1483
|
+
export interface CTextFieldElement extends Omit<HTMLElement, 'autocomplete' | 'autocorrect' | 'automaticCapitalize' | 'disabled' | 'errorMessage' | 'hideDetails' | 'hint' | 'hostId' | 'label' | 'labelOnTop' | 'max' | 'min' | 'name' | 'placeholder' | 'readonly' | 'required' | 'rows' | 'shadow' | 'size' | 'step' | 'trimWhitespace' | 'type' | 'valid' | 'value'> {
|
|
1359
1484
|
/** HTML input autocomplete */
|
|
1360
1485
|
autocomplete?: string;
|
|
1361
1486
|
/**
|
|
@@ -1397,6 +1522,8 @@ export interface CTextFieldElement extends Omit<HTMLElement, 'autocomplete' | 'a
|
|
|
1397
1522
|
rows?: number;
|
|
1398
1523
|
/** Shadow variant of the input */
|
|
1399
1524
|
shadow?: boolean;
|
|
1525
|
+
/** Field height: the 44px default or the 36px `small` box (single-line fields) */
|
|
1526
|
+
size?: 'default' | 'small';
|
|
1400
1527
|
/** Step size on a numeric input */
|
|
1401
1528
|
step?: null | number;
|
|
1402
1529
|
/** Trim whitespace from the return value */
|
|
@@ -1446,6 +1573,49 @@ export interface CToastsElement extends Omit<HTMLElement, 'absolute' | 'horizont
|
|
|
1446
1573
|
}
|
|
1447
1574
|
export interface CToolbarElement extends HTMLElement {
|
|
1448
1575
|
}
|
|
1576
|
+
/** Events dispatched by `<c-tooltip>`. */
|
|
1577
|
+
export interface CTooltipElementEventMap {
|
|
1578
|
+
/**
|
|
1579
|
+
* Fired whenever the tooltip shows or hides, carrying the new open state.
|
|
1580
|
+
* Named `change:open`, not `update:open`: Vue's runtime silently drops
|
|
1581
|
+
* `onUpdate:*` listeners on custom elements (`isModelListener`), so a
|
|
1582
|
+
* template `@update:open` would never be attached.
|
|
1583
|
+
*/
|
|
1584
|
+
'change:open': CustomEvent<boolean>;
|
|
1585
|
+
}
|
|
1586
|
+
/** A non-interactive text hint shown when its trigger is hovered or keyboard-focused, floating in the top layer on the inverted surface tier. */
|
|
1587
|
+
export interface CTooltipElement extends Omit<HTMLElement, 'delay' | 'distance' | 'open' | 'position' | 'text' | 'trigger'> {
|
|
1588
|
+
/**
|
|
1589
|
+
* Delay before the tooltip shows on hover, in milliseconds. Keyboard focus
|
|
1590
|
+
* shows the tooltip immediately, regardless of this value. Defaults to
|
|
1591
|
+
* `400`.
|
|
1592
|
+
*/
|
|
1593
|
+
delay?: number | string;
|
|
1594
|
+
/** Distance from the trigger to the tooltip, in pixels. Defaults to `4`. */
|
|
1595
|
+
distance?: number | string;
|
|
1596
|
+
/** Whether the tooltip is open. Two-way: emits `change:open`. */
|
|
1597
|
+
open?: boolean;
|
|
1598
|
+
/** Preferred placement of the tooltip relative to the trigger. */
|
|
1599
|
+
position?: 'bottom-end' | 'bottom-start' | 'bottom' | 'left-end' | 'left-start' | 'left' | 'right-end' | 'right-start' | 'right' | 'top-end' | 'top-start' | 'top';
|
|
1600
|
+
/**
|
|
1601
|
+
* The tooltip text. Overridden by the `content` slot when that is
|
|
1602
|
+
* populated.
|
|
1603
|
+
*/
|
|
1604
|
+
text?: string;
|
|
1605
|
+
/**
|
|
1606
|
+
* Designated trigger: an element elsewhere in the document that the
|
|
1607
|
+
* tooltip describes — its document ID, or the element itself. The same
|
|
1608
|
+
* trigger concept as the `trigger` slot, supplied by reference: the
|
|
1609
|
+
* tooltip wires hover/focus, mirrors `aria-description` onto it and
|
|
1610
|
+
* anchors the bubble to it. When both routes are supplied, this prop wins
|
|
1611
|
+
* over the slot.
|
|
1612
|
+
*/
|
|
1613
|
+
trigger?: HTMLElement | string;
|
|
1614
|
+
addEventListener<K extends keyof CTooltipElementEventMap>(type: K, listener: (this: CTooltipElement, ev: CTooltipElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions): void;
|
|
1615
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
1616
|
+
removeEventListener<K extends keyof CTooltipElementEventMap>(type: K, listener: (this: CTooltipElement, ev: CTooltipElementEventMap[K]) => void, options?: boolean | EventListenerOptions): void;
|
|
1617
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
1618
|
+
}
|
|
1449
1619
|
declare global {
|
|
1450
1620
|
interface HTMLElementTagNameMap {
|
|
1451
1621
|
'c-accordion': CAccordionElement;
|
|
@@ -1490,7 +1660,9 @@ declare global {
|
|
|
1490
1660
|
'c-otp-input': COtpInputElement;
|
|
1491
1661
|
'c-page': CPageElement;
|
|
1492
1662
|
'c-pagination': CPaginationElement;
|
|
1663
|
+
'c-popover': CPopoverElement;
|
|
1493
1664
|
'c-progress-bar': CProgressBarElement;
|
|
1665
|
+
'c-progress-circle': CProgressCircleElement;
|
|
1494
1666
|
'c-radio': CRadioElement;
|
|
1495
1667
|
'c-radio-group': CRadioGroupElement;
|
|
1496
1668
|
'c-select': CSelectElement;
|
|
@@ -1516,6 +1688,7 @@ declare global {
|
|
|
1516
1688
|
'c-toast': CToastElement;
|
|
1517
1689
|
'c-toasts': CToastsElement;
|
|
1518
1690
|
'c-toolbar': CToolbarElement;
|
|
1691
|
+
'c-tooltip': CTooltipElement;
|
|
1519
1692
|
}
|
|
1520
1693
|
}
|
|
1521
1694
|
export {};
|