@cscfi/csc-ui 4.0.0-alpha.6 → 4.0.0-alpha.8
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 +6932 -6703
- package/dist/custom-elements.json +55 -4
- package/dist/docs/c-checkbox/usage.md +14 -11
- package/dist/docs/c-popover/usage.md +8 -0
- package/dist/docs/c-radio/usage.md +4 -3
- package/dist/docs/c-tooltip/usage.md +3 -1
- package/dist/styles/css/tokens.css +141 -141
- package/dist/vscode.css-custom-data.json +2 -2
- package/dist/vscode.html-custom-data.json +17 -2
- package/dist/web-types.json +35 -5
- package/dist-types/components/c-menu/CMenu.vue.d.ts +10 -0
- package/dist-types/components/c-popover/CPopover.vue.d.ts +9 -0
- package/dist-types/components/c-tooltip/CTooltip.vue.d.ts +10 -0
- package/dist-types/shared/popoverChain.d.ts +62 -0
- package/dist-types/shared/useDesignatedTrigger.d.ts +40 -0
- package/dist-types/tag-name-map.d.ts +29 -3
- package/package.json +1 -1
|
@@ -360,7 +360,7 @@
|
|
|
360
360
|
},
|
|
361
361
|
{
|
|
362
362
|
"name": "c-checkbox",
|
|
363
|
-
"description": "A form control for a single on/off choice: a native checkbox with a label, an optional hint, and validation messaging.\n---\n\n\n### **Events:**\n - **change** - Standard bubbling DOM change event, re-dispatched from the host when the\ncheckbox is toggled (the inner input's change does not cross the shadow\nboundary). No detail; read the new value from the host's `value` property.\n- **changeValue** - Fired when the checkbox is toggled, carrying the new value —\n`trueValue` when checked, `falseValue` when unchecked. Also dispatched as `change-value` — bind that name in Vue templates.\n- **input** - Native bubbling input event fired on toggle so a plain Vue `v-model`\nworks without the `v-control` directive. No detail.\n- **update:value** - v-model contract event fired on toggle, carrying the new value —\n`trueValue` when checked, `falseValue` when unchecked.\n\n### **Slots:**\n - **default** - Default slot for the label\n\n### **CSS Parts:**\n - **root** - The outer wrapper containing the checkbox, label and message\n- **label** - The `<label>` element wrapping the indicator and the label content\n- **indicator** - The checkbox box itself — the bordered square that fills when checked\n- **mark** - The SVG check / indeterminate glyph revealed inside the indicator; draws with `currentColor`, so `color` recolours it\n- **content** - Wrapper around the label text or slotted label content\n- **message** - The hint / error message area below the checkbox (always reserved unless `hide-details`)",
|
|
363
|
+
"description": "A form control for a single on/off choice: a native checkbox with a label, an optional hint, and validation messaging.\n---\n\n\n### **Events:**\n - **change** - Standard bubbling DOM change event, re-dispatched from the host when the\ncheckbox is toggled (the inner input's change does not cross the shadow\nboundary). No detail; read the new value from the host's `value` property.\n- **changeValue** - Fired when the checkbox is toggled, carrying the new value —\n`trueValue` when checked, `falseValue` when unchecked. Also dispatched as `change-value` — bind that name in Vue templates.\n- **input** - Native bubbling input event fired on toggle so a plain Vue `v-model`\nworks without the `v-control` directive. No detail.\n- **update:value** - v-model contract event fired on toggle, carrying the new value —\n`trueValue` when checked, `falseValue` when unchecked.\n\n### **Slots:**\n - **default** - Default slot for the label\n\n### **CSS Parts:**\n - **root** - The outer wrapper containing the checkbox, label and message\n- **label** - The `<label>` element wrapping the indicator and the label content\n- **indicator** - The checkbox box itself — the bordered square that fills when checked; border, fill and the keyboard focus ring (its `::before`) all draw with `currentColor`, so `color` recolours them together\n- **mark** - The SVG check / indeterminate glyph revealed inside the indicator; draws with `currentColor`, so `color` recolours it\n- **content** - Wrapper around the label text or slotted label content\n- **message** - The hint / error message area below the checkbox (always reserved unless `hide-details`)",
|
|
364
364
|
"attributes": [
|
|
365
365
|
{
|
|
366
366
|
"name": "checked",
|
|
@@ -953,6 +953,11 @@
|
|
|
953
953
|
{ "name": "top-start" },
|
|
954
954
|
{ "name": "top" }
|
|
955
955
|
]
|
|
956
|
+
},
|
|
957
|
+
{
|
|
958
|
+
"name": "trigger",
|
|
959
|
+
"description": "Designated trigger: an element elsewhere in the document that opens the\nmenu — its document ID, or the element itself. The same trigger concept\nas the `trigger` slot, supplied by reference: the menu wires\nclick-to-toggle, arrow-key opening, ARIA and focus return onto it and\nanchors the panel to it. When both routes are supplied, this prop wins\nover the slot.",
|
|
960
|
+
"values": [{ "name": "HTMLElement" }]
|
|
956
961
|
}
|
|
957
962
|
],
|
|
958
963
|
"references": []
|
|
@@ -1209,6 +1214,11 @@
|
|
|
1209
1214
|
{ "name": "top-start" },
|
|
1210
1215
|
{ "name": "top" }
|
|
1211
1216
|
]
|
|
1217
|
+
},
|
|
1218
|
+
{
|
|
1219
|
+
"name": "trigger",
|
|
1220
|
+
"description": "Designated trigger: an element elsewhere in the document that opens the\npopover — its document ID, or the element itself. The same trigger\nconcept as the `trigger` slot, supplied by reference: the popover wires\nclick-to-toggle, ARIA and focus return onto it and anchors the panel to\nit. When both routes are supplied, this prop wins over the slot.",
|
|
1221
|
+
"values": [{ "name": "HTMLElement" }]
|
|
1212
1222
|
}
|
|
1213
1223
|
],
|
|
1214
1224
|
"references": []
|
|
@@ -1269,7 +1279,7 @@
|
|
|
1269
1279
|
},
|
|
1270
1280
|
{
|
|
1271
1281
|
"name": "c-radio",
|
|
1272
|
-
"description": "A single radio option inside a `c-radio-group`: a native radio input whose default slot is its clickable, announced label.\n---\n\n\n### **Events:**\n - **change** - Fired when the radio is selected by the user, carrying its `value`.\nBubbles composed so the parent `<c-radio-group>` — whose shadow root a\nlight-DOM event never enters — catches it on its host; a consumer\nlistening on the group hears it too, with the radio as `target`.\n\n### **Slots:**\n - **default** - The radio's label content, rendered inside the shadow `<label>` so it stays click-associated and announced\n\n### **CSS Parts:**\n - **root** - The `<label>` row wrapping the input, indicator and label content\n- **indicator** - The radio ring itself; the selection dot is its `::after` —
|
|
1282
|
+
"description": "A single radio option inside a `c-radio-group`: a native radio input whose default slot is its clickable, announced label.\n---\n\n\n### **Events:**\n - **change** - Fired when the radio is selected by the user, carrying its `value`.\nBubbles composed so the parent `<c-radio-group>` — whose shadow root a\nlight-DOM event never enters — catches it on its host; a consumer\nlistening on the group hears it too, with the radio as `target`.\n\n### **Slots:**\n - **default** - The radio's label content, rendered inside the shadow `<label>` so it stays click-associated and announced\n\n### **CSS Parts:**\n - **root** - The `<label>` row wrapping the input, indicator and label content\n- **indicator** - The radio ring itself; the selection dot is its `::after` and the keyboard focus ring its `::before` — all three follow `currentColor`, so `color` recolours the whole indicator, focus ring included\n- **content** - Wrapper around the slotted label content",
|
|
1273
1283
|
"attributes": [
|
|
1274
1284
|
{
|
|
1275
1285
|
"name": "disabled",
|
|
@@ -1988,6 +1998,11 @@
|
|
|
1988
1998
|
"name": "text",
|
|
1989
1999
|
"description": "The tooltip text. Overridden by the `content` slot when that is\npopulated.",
|
|
1990
2000
|
"values": []
|
|
2001
|
+
},
|
|
2002
|
+
{
|
|
2003
|
+
"name": "trigger",
|
|
2004
|
+
"description": "Designated trigger: an element elsewhere in the document that the\ntooltip describes — its document ID, or the element itself. The same\ntrigger concept as the `trigger` slot, supplied by reference: the\ntooltip wires hover/focus, mirrors `aria-description` onto it and\nanchors the bubble to it. When both routes are supplied, this prop wins\nover the slot.",
|
|
2005
|
+
"values": [{ "name": "HTMLElement" }]
|
|
1991
2006
|
}
|
|
1992
2007
|
],
|
|
1993
2008
|
"references": []
|
package/dist/web-types.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
|
|
3
3
|
"name": "@cscfi/csc-ui",
|
|
4
|
-
"version": "4.0.0-alpha.
|
|
4
|
+
"version": "4.0.0-alpha.8",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
@@ -962,7 +962,7 @@
|
|
|
962
962
|
},
|
|
963
963
|
{
|
|
964
964
|
"name": "c-checkbox",
|
|
965
|
-
"description": "A form control for a single on/off choice: a native checkbox with a label, an optional hint, and validation messaging.\n---\n\n\n### **Events:**\n - **change** - Standard bubbling DOM change event, re-dispatched from the host when the\ncheckbox is toggled (the inner input's change does not cross the shadow\nboundary). No detail; read the new value from the host's `value` property.\n- **changeValue** - Fired when the checkbox is toggled, carrying the new value —\n`trueValue` when checked, `falseValue` when unchecked. Also dispatched as `change-value` — bind that name in Vue templates.\n- **input** - Native bubbling input event fired on toggle so a plain Vue `v-model`\nworks without the `v-control` directive. No detail.\n- **update:value** - v-model contract event fired on toggle, carrying the new value —\n`trueValue` when checked, `falseValue` when unchecked.\n\n### **Slots:**\n - **default** - Default slot for the label\n\n### **CSS Parts:**\n - **root** - The outer wrapper containing the checkbox, label and message\n- **label** - The `<label>` element wrapping the indicator and the label content\n- **indicator** - The checkbox box itself — the bordered square that fills when checked\n- **mark** - The SVG check / indeterminate glyph revealed inside the indicator; draws with `currentColor`, so `color` recolours it\n- **content** - Wrapper around the label text or slotted label content\n- **message** - The hint / error message area below the checkbox (always reserved unless `hide-details`)",
|
|
965
|
+
"description": "A form control for a single on/off choice: a native checkbox with a label, an optional hint, and validation messaging.\n---\n\n\n### **Events:**\n - **change** - Standard bubbling DOM change event, re-dispatched from the host when the\ncheckbox is toggled (the inner input's change does not cross the shadow\nboundary). No detail; read the new value from the host's `value` property.\n- **changeValue** - Fired when the checkbox is toggled, carrying the new value —\n`trueValue` when checked, `falseValue` when unchecked. Also dispatched as `change-value` — bind that name in Vue templates.\n- **input** - Native bubbling input event fired on toggle so a plain Vue `v-model`\nworks without the `v-control` directive. No detail.\n- **update:value** - v-model contract event fired on toggle, carrying the new value —\n`trueValue` when checked, `falseValue` when unchecked.\n\n### **Slots:**\n - **default** - Default slot for the label\n\n### **CSS Parts:**\n - **root** - The outer wrapper containing the checkbox, label and message\n- **label** - The `<label>` element wrapping the indicator and the label content\n- **indicator** - The checkbox box itself — the bordered square that fills when checked; border, fill and the keyboard focus ring (its `::before`) all draw with `currentColor`, so `color` recolours them together\n- **mark** - The SVG check / indeterminate glyph revealed inside the indicator; draws with `currentColor`, so `color` recolours it\n- **content** - Wrapper around the label text or slotted label content\n- **message** - The hint / error message area below the checkbox (always reserved unless `hide-details`)",
|
|
966
966
|
"doc-url": "",
|
|
967
967
|
"attributes": [
|
|
968
968
|
{
|
|
@@ -2427,6 +2427,11 @@
|
|
|
2427
2427
|
"type": "'bottom-end' | 'bottom-start' | 'bottom' | 'left-end' | 'left-start' | 'left' | 'right-end' | 'right-start' | 'right' | 'top-end' | 'top-start' | 'top'",
|
|
2428
2428
|
"default": "'bottom-start'"
|
|
2429
2429
|
}
|
|
2430
|
+
},
|
|
2431
|
+
{
|
|
2432
|
+
"name": "trigger",
|
|
2433
|
+
"description": "Designated trigger: an element elsewhere in the document that opens the\nmenu — its document ID, or the element itself. The same trigger concept\nas the `trigger` slot, supplied by reference: the menu wires\nclick-to-toggle, arrow-key opening, ARIA and focus return onto it and\nanchors the panel to it. When both routes are supplied, this prop wins\nover the slot.",
|
|
2434
|
+
"value": { "type": "HTMLElement | string" }
|
|
2430
2435
|
}
|
|
2431
2436
|
],
|
|
2432
2437
|
"slots": [
|
|
@@ -2467,6 +2472,11 @@
|
|
|
2467
2472
|
"name": "position",
|
|
2468
2473
|
"description": "Preferred placement of the panel relative to the trigger.",
|
|
2469
2474
|
"type": "'bottom-end' | 'bottom-start' | 'bottom' | 'left-end' | 'left-start' | 'left' | 'right-end' | 'right-start' | 'right' | 'top-end' | 'top-start' | 'top'"
|
|
2475
|
+
},
|
|
2476
|
+
{
|
|
2477
|
+
"name": "trigger",
|
|
2478
|
+
"description": "Designated trigger: an element elsewhere in the document that opens the\nmenu — its document ID, or the element itself. The same trigger concept\nas the `trigger` slot, supplied by reference: the menu wires\nclick-to-toggle, arrow-key opening, ARIA and focus return onto it and\nanchors the panel to it. When both routes are supplied, this prop wins\nover the slot.",
|
|
2479
|
+
"type": "HTMLElement | string"
|
|
2470
2480
|
}
|
|
2471
2481
|
],
|
|
2472
2482
|
"events": [
|
|
@@ -3113,6 +3123,11 @@
|
|
|
3113
3123
|
"type": "'bottom-end' | 'bottom-start' | 'bottom' | 'left-end' | 'left-start' | 'left' | 'right-end' | 'right-start' | 'right' | 'top-end' | 'top-start' | 'top'",
|
|
3114
3124
|
"default": "'bottom'"
|
|
3115
3125
|
}
|
|
3126
|
+
},
|
|
3127
|
+
{
|
|
3128
|
+
"name": "trigger",
|
|
3129
|
+
"description": "Designated trigger: an element elsewhere in the document that opens the\npopover — its document ID, or the element itself. The same trigger\nconcept as the `trigger` slot, supplied by reference: the popover wires\nclick-to-toggle, ARIA and focus return onto it and anchors the panel to\nit. When both routes are supplied, this prop wins over the slot.",
|
|
3130
|
+
"value": { "type": "HTMLElement | string" }
|
|
3116
3131
|
}
|
|
3117
3132
|
],
|
|
3118
3133
|
"slots": [
|
|
@@ -3153,6 +3168,11 @@
|
|
|
3153
3168
|
"name": "position",
|
|
3154
3169
|
"description": "Preferred placement of the panel relative to the trigger.",
|
|
3155
3170
|
"type": "'bottom-end' | 'bottom-start' | 'bottom' | 'left-end' | 'left-start' | 'left' | 'right-end' | 'right-start' | 'right' | 'top-end' | 'top-start' | 'top'"
|
|
3171
|
+
},
|
|
3172
|
+
{
|
|
3173
|
+
"name": "trigger",
|
|
3174
|
+
"description": "Designated trigger: an element elsewhere in the document that opens the\npopover — its document ID, or the element itself. The same trigger\nconcept as the `trigger` slot, supplied by reference: the popover wires\nclick-to-toggle, ARIA and focus return onto it and anchors the panel to\nit. When both routes are supplied, this prop wins over the slot.",
|
|
3175
|
+
"type": "HTMLElement | string"
|
|
3156
3176
|
}
|
|
3157
3177
|
],
|
|
3158
3178
|
"events": [
|
|
@@ -3279,7 +3299,7 @@
|
|
|
3279
3299
|
},
|
|
3280
3300
|
{
|
|
3281
3301
|
"name": "c-radio",
|
|
3282
|
-
"description": "A single radio option inside a `c-radio-group`: a native radio input whose default slot is its clickable, announced label.\n---\n\n\n### **Events:**\n - **change** - Fired when the radio is selected by the user, carrying its `value`.\nBubbles composed so the parent `<c-radio-group>` — whose shadow root a\nlight-DOM event never enters — catches it on its host; a consumer\nlistening on the group hears it too, with the radio as `target`.\n\n### **Slots:**\n - **default** - The radio's label content, rendered inside the shadow `<label>` so it stays click-associated and announced\n\n### **CSS Parts:**\n - **root** - The `<label>` row wrapping the input, indicator and label content\n- **indicator** - The radio ring itself; the selection dot is its `::after` —
|
|
3302
|
+
"description": "A single radio option inside a `c-radio-group`: a native radio input whose default slot is its clickable, announced label.\n---\n\n\n### **Events:**\n - **change** - Fired when the radio is selected by the user, carrying its `value`.\nBubbles composed so the parent `<c-radio-group>` — whose shadow root a\nlight-DOM event never enters — catches it on its host; a consumer\nlistening on the group hears it too, with the radio as `target`.\n\n### **Slots:**\n - **default** - The radio's label content, rendered inside the shadow `<label>` so it stays click-associated and announced\n\n### **CSS Parts:**\n - **root** - The `<label>` row wrapping the input, indicator and label content\n- **indicator** - The radio ring itself; the selection dot is its `::after` and the keyboard focus ring its `::before` — all three follow `currentColor`, so `color` recolours the whole indicator, focus ring included\n- **content** - Wrapper around the slotted label content",
|
|
3283
3303
|
"doc-url": "",
|
|
3284
3304
|
"attributes": [
|
|
3285
3305
|
{
|
|
@@ -5365,6 +5385,11 @@
|
|
|
5365
5385
|
"name": "text",
|
|
5366
5386
|
"description": "The tooltip text. Overridden by the `content` slot when that is\npopulated.",
|
|
5367
5387
|
"value": { "type": "string", "default": "''" }
|
|
5388
|
+
},
|
|
5389
|
+
{
|
|
5390
|
+
"name": "trigger",
|
|
5391
|
+
"description": "Designated trigger: an element elsewhere in the document that the\ntooltip describes — its document ID, or the element itself. The same\ntrigger concept as the `trigger` slot, supplied by reference: the\ntooltip wires hover/focus, mirrors `aria-description` onto it and\nanchors the bubble to it. When both routes are supplied, this prop wins\nover the slot.",
|
|
5392
|
+
"value": { "type": "HTMLElement | string" }
|
|
5368
5393
|
}
|
|
5369
5394
|
],
|
|
5370
5395
|
"slots": [
|
|
@@ -5410,6 +5435,11 @@
|
|
|
5410
5435
|
"name": "text",
|
|
5411
5436
|
"description": "The tooltip text. Overridden by the `content` slot when that is\npopulated.",
|
|
5412
5437
|
"type": "string"
|
|
5438
|
+
},
|
|
5439
|
+
{
|
|
5440
|
+
"name": "trigger",
|
|
5441
|
+
"description": "Designated trigger: an element elsewhere in the document that the\ntooltip describes — its document ID, or the element itself. The same\ntrigger concept as the `trigger` slot, supplied by reference: the\ntooltip wires hover/focus, mirrors `aria-description` onto it and\nanchors the bubble to it. When both routes are supplied, this prop wins\nover the slot.",
|
|
5442
|
+
"type": "HTMLElement | string"
|
|
5413
5443
|
}
|
|
5414
5444
|
],
|
|
5415
5445
|
"events": [
|
|
@@ -5562,7 +5592,7 @@
|
|
|
5562
5592
|
},
|
|
5563
5593
|
{
|
|
5564
5594
|
"name": "part(indicator)",
|
|
5565
|
-
"description": "The checkbox box itself — the bordered square that fills when checked"
|
|
5595
|
+
"description": "The checkbox box itself — the bordered square that fills when checked; border, fill and the keyboard focus ring (its `::before`) all draw with `currentColor`, so `color` recolours them together"
|
|
5566
5596
|
},
|
|
5567
5597
|
{
|
|
5568
5598
|
"name": "part(mark)",
|
|
@@ -5876,7 +5906,7 @@
|
|
|
5876
5906
|
},
|
|
5877
5907
|
{
|
|
5878
5908
|
"name": "part(indicator)",
|
|
5879
|
-
"description": "The radio ring itself; the selection dot is its `::after` —
|
|
5909
|
+
"description": "The radio ring itself; the selection dot is its `::after` and the keyboard focus ring its `::before` — all three follow `currentColor`, so `color` recolours the whole indicator, focus ring included"
|
|
5880
5910
|
},
|
|
5881
5911
|
{
|
|
5882
5912
|
"name": "part(content)",
|
|
@@ -6,6 +6,15 @@ interface CMenuProps {
|
|
|
6
6
|
open?: boolean;
|
|
7
7
|
/** Preferred placement of the panel relative to the trigger. */
|
|
8
8
|
position?: CPlacement;
|
|
9
|
+
/**
|
|
10
|
+
* Designated trigger: an element elsewhere in the document that opens the
|
|
11
|
+
* menu — its document ID, or the element itself. The same trigger concept
|
|
12
|
+
* as the `trigger` slot, supplied by reference: the menu wires
|
|
13
|
+
* click-to-toggle, arrow-key opening, ARIA and focus return onto it and
|
|
14
|
+
* anchors the panel to it. When both routes are supplied, this prop wins
|
|
15
|
+
* over the slot.
|
|
16
|
+
*/
|
|
17
|
+
trigger?: HTMLElement | string;
|
|
9
18
|
}
|
|
10
19
|
declare var __VLS_1: {}, __VLS_3: {};
|
|
11
20
|
type __VLS_Slots = {} & {
|
|
@@ -17,6 +26,7 @@ declare const __VLS_base: import("vue").DefineComponent<CMenuProps, {}, {}, {},
|
|
|
17
26
|
open: boolean;
|
|
18
27
|
distance: number | string;
|
|
19
28
|
position: CPlacement;
|
|
29
|
+
trigger: HTMLElement | string;
|
|
20
30
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
21
31
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
22
32
|
declare const _default: typeof __VLS_export;
|
|
@@ -14,6 +14,14 @@ export interface CPopoverProps {
|
|
|
14
14
|
open?: boolean;
|
|
15
15
|
/** Preferred placement of the panel relative to the trigger. */
|
|
16
16
|
position?: CPlacement;
|
|
17
|
+
/**
|
|
18
|
+
* Designated trigger: an element elsewhere in the document that opens the
|
|
19
|
+
* popover — its document ID, or the element itself. The same trigger
|
|
20
|
+
* concept as the `trigger` slot, supplied by reference: the popover wires
|
|
21
|
+
* click-to-toggle, ARIA and focus return onto it and anchors the panel to
|
|
22
|
+
* it. When both routes are supplied, this prop wins over the slot.
|
|
23
|
+
*/
|
|
24
|
+
trigger?: HTMLElement | string;
|
|
17
25
|
}
|
|
18
26
|
declare const _default: typeof __VLS_export;
|
|
19
27
|
export default _default;
|
|
@@ -22,6 +30,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<CPopov
|
|
|
22
30
|
open: boolean;
|
|
23
31
|
distance: number | string;
|
|
24
32
|
position: CPlacement;
|
|
33
|
+
trigger: HTMLElement | string;
|
|
25
34
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
26
35
|
trigger?: (props: {}) => any;
|
|
27
36
|
} & {
|
|
@@ -18,6 +18,15 @@ export interface CTooltipProps {
|
|
|
18
18
|
* @freeform
|
|
19
19
|
*/
|
|
20
20
|
text?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Designated trigger: an element elsewhere in the document that the
|
|
23
|
+
* tooltip describes — its document ID, or the element itself. The same
|
|
24
|
+
* trigger concept as the `trigger` slot, supplied by reference: the
|
|
25
|
+
* tooltip wires hover/focus, mirrors `aria-description` onto it and
|
|
26
|
+
* anchors the bubble to it. When both routes are supplied, this prop wins
|
|
27
|
+
* over the slot.
|
|
28
|
+
*/
|
|
29
|
+
trigger?: HTMLElement | string;
|
|
21
30
|
}
|
|
22
31
|
declare const _default: typeof __VLS_export;
|
|
23
32
|
export default _default;
|
|
@@ -26,6 +35,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<CToolt
|
|
|
26
35
|
open: boolean;
|
|
27
36
|
distance: number | string;
|
|
28
37
|
position: CPlacement;
|
|
38
|
+
trigger: HTMLElement | string;
|
|
29
39
|
delay: number | string;
|
|
30
40
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
31
41
|
trigger?: (props: {}) => any;
|
|
@@ -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,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;
|
|
@@ -703,13 +703,22 @@ export interface CMenuElementEventMap {
|
|
|
703
703
|
value: unknown;
|
|
704
704
|
}>;
|
|
705
705
|
}
|
|
706
|
-
export interface CMenuElement extends Omit<HTMLElement, 'distance' | 'open' | 'position'> {
|
|
706
|
+
export interface CMenuElement extends Omit<HTMLElement, 'distance' | 'open' | 'position' | 'trigger'> {
|
|
707
707
|
/** Distance from the trigger to the panel, in pixels. Defaults to `0`. */
|
|
708
708
|
distance?: number | string;
|
|
709
709
|
/** Whether the menu is open. Two-way: emits `change:open`. */
|
|
710
710
|
open?: boolean;
|
|
711
711
|
/** Preferred placement of the panel relative to the trigger. */
|
|
712
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;
|
|
713
722
|
addEventListener<K extends keyof CMenuElementEventMap>(type: K, listener: (this: CMenuElement, ev: CMenuElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions): void;
|
|
714
723
|
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
715
724
|
removeEventListener<K extends keyof CMenuElementEventMap>(type: K, listener: (this: CMenuElement, ev: CMenuElementEventMap[K]) => void, options?: boolean | EventListenerOptions): void;
|
|
@@ -910,7 +919,7 @@ export interface CPopoverElementEventMap {
|
|
|
910
919
|
'change:open': CustomEvent<boolean>;
|
|
911
920
|
}
|
|
912
921
|
/** A click-opened, non-modal surface anchored to its trigger, floating in the top layer; its content may be interactive. */
|
|
913
|
-
export interface CPopoverElement extends Omit<HTMLElement, 'distance' | 'heading' | 'open' | 'position'> {
|
|
922
|
+
export interface CPopoverElement extends Omit<HTMLElement, 'distance' | 'heading' | 'open' | 'position' | 'trigger'> {
|
|
914
923
|
/** Distance from the trigger to the panel, in pixels. Defaults to `0`. */
|
|
915
924
|
distance?: number | string;
|
|
916
925
|
/**
|
|
@@ -924,6 +933,14 @@ export interface CPopoverElement extends Omit<HTMLElement, 'distance' | 'heading
|
|
|
924
933
|
open?: boolean;
|
|
925
934
|
/** Preferred placement of the panel relative to the trigger. */
|
|
926
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;
|
|
927
944
|
addEventListener<K extends keyof CPopoverElementEventMap>(type: K, listener: (this: CPopoverElement, ev: CPopoverElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions): void;
|
|
928
945
|
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
929
946
|
removeEventListener<K extends keyof CPopoverElementEventMap>(type: K, listener: (this: CPopoverElement, ev: CPopoverElementEventMap[K]) => void, options?: boolean | EventListenerOptions): void;
|
|
@@ -1567,7 +1584,7 @@ export interface CTooltipElementEventMap {
|
|
|
1567
1584
|
'change:open': CustomEvent<boolean>;
|
|
1568
1585
|
}
|
|
1569
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. */
|
|
1570
|
-
export interface CTooltipElement extends Omit<HTMLElement, 'delay' | 'distance' | 'open' | 'position' | 'text'> {
|
|
1587
|
+
export interface CTooltipElement extends Omit<HTMLElement, 'delay' | 'distance' | 'open' | 'position' | 'text' | 'trigger'> {
|
|
1571
1588
|
/**
|
|
1572
1589
|
* Delay before the tooltip shows on hover, in milliseconds. Keyboard focus
|
|
1573
1590
|
* shows the tooltip immediately, regardless of this value. Defaults to
|
|
@@ -1585,6 +1602,15 @@ export interface CTooltipElement extends Omit<HTMLElement, 'delay' | 'distance'
|
|
|
1585
1602
|
* populated.
|
|
1586
1603
|
*/
|
|
1587
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;
|
|
1588
1614
|
addEventListener<K extends keyof CTooltipElementEventMap>(type: K, listener: (this: CTooltipElement, ev: CTooltipElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions): void;
|
|
1589
1615
|
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
1590
1616
|
removeEventListener<K extends keyof CTooltipElementEventMap>(type: K, listener: (this: CTooltipElement, ev: CTooltipElementEventMap[K]) => void, options?: boolean | EventListenerOptions): void;
|
package/package.json
CHANGED