@redvars/peacock 4.2.0 → 4.3.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/dist/{BaseField-_unSNU5x.js → BaseField-CHBcjVc2.js} +3 -3
- package/dist/{BaseField-_unSNU5x.js.map → BaseField-CHBcjVc2.js.map} +1 -1
- package/dist/{BaseInput-DtZH0fPJ.js → BaseInput-DZp2O8Gh.js} +2 -2
- package/dist/{BaseInput-DtZH0fPJ.js.map → BaseInput-DZp2O8Gh.js.map} +1 -1
- package/dist/ai-badge.js +2 -2
- package/dist/ai-summary.js +2 -2
- package/dist/alert.js +2 -2
- package/dist/anchor-nav.js +2 -2
- package/dist/app-shell.js +2 -2
- package/dist/assistant-panel.js +2 -2
- package/dist/assistant-step.js +2 -2
- package/dist/assistant-steps.js +2 -2
- package/dist/avatar-group.js +2 -2
- package/dist/banner.js +2 -2
- package/dist/{base-progress-D7Nmfh1s.js → base-progress-CKQ32Ruw.js} +2 -2
- package/dist/{base-progress-D7Nmfh1s.js.map → base-progress-CKQ32Ruw.js.map} +1 -1
- package/dist/bottom-sheet.js +2 -2
- package/dist/breadcrumb.js +2 -2
- package/dist/calendar.js +2 -2
- package/dist/{canvas-base-CWQ4rQ2s.js → canvas-base-BoKef3yr.js} +2 -2
- package/dist/{canvas-base-CWQ4rQ2s.js.map → canvas-base-BoKef3yr.js.map} +1 -1
- package/dist/carousel.js +644 -0
- package/dist/carousel.js.map +1 -0
- package/dist/{cartesian-chart-CS5yRLfE.js → cartesian-chart-DqZxnoG1.js} +2 -2
- package/dist/{cartesian-chart-CS5yRLfE.js.map → cartesian-chart-DqZxnoG1.js.map} +1 -1
- package/dist/{cb-group-base-CO30uFQZ.js → cb-group-base-Bf7iOIGS.js} +2 -2
- package/dist/{cb-group-base-CO30uFQZ.js.map → cb-group-base-Bf7iOIGS.js.map} +1 -1
- package/dist/cb-group.js +3 -3
- package/dist/cb-rule.js +3 -3
- package/dist/chart-area.js +4 -4
- package/dist/chart-bar.js +4 -4
- package/dist/{chart-base-C_XKVyhf.js → chart-base-ByCJM_9C.js} +2 -2
- package/dist/{chart-base-C_XKVyhf.js.map → chart-base-ByCJM_9C.js.map} +1 -1
- package/dist/chart-doughnut.js +3 -3
- package/dist/chart-line.js +4 -4
- package/dist/chart-pie.js +3 -3
- package/dist/chat-event.js +2 -2
- package/dist/chat-message.js +2 -2
- package/dist/chat-thread.js +2 -2
- package/dist/checkbox-group.js +3 -3
- package/dist/checkbox.js +3 -3
- package/dist/chip-set.js +2 -2
- package/dist/chip.js +2 -2
- package/dist/circular-progress.js +3 -3
- package/dist/citation.js +2 -2
- package/dist/code-editor.js +3 -3
- package/dist/code-highlighter.js +2 -2
- package/dist/color-field.js +4 -4
- package/dist/color-picker.js +2 -2
- package/dist/command-palette.js +2 -2
- package/dist/comment-composer.js +24 -12
- package/dist/comment-composer.js.map +1 -1
- package/dist/condition-builder.js +3 -3
- package/dist/confirm-dialog.js +2 -2
- package/dist/copy-button.js +2 -2
- package/dist/currency-field.js +4 -4
- package/dist/custom-elements-jsdocs.json +936 -56
- package/dist/custom-elements.json +3486 -554
- package/dist/date-field.js +5 -5
- package/dist/date-picker.js +2 -2
- package/dist/date-range-field.js +5 -5
- package/dist/datetime-field.js +5 -5
- package/dist/dependency-map.js +3 -3
- package/dist/description-item.js +2 -2
- package/dist/description-list.js +2 -2
- package/dist/{diagram-Va096vj9.js → diagram-Cnrj-4y3.js} +2 -2
- package/dist/{diagram-Va096vj9.js.map → diagram-Cnrj-4y3.js.map} +1 -1
- package/dist/diagram-controls.js +2 -2
- package/dist/diagram-minimap.js +2 -2
- package/dist/diagram.js +4 -4
- package/dist/diff-viewer.js +2 -2
- package/dist/discussion-activity.js +2 -2
- package/dist/discussion-comment.js +2 -2
- package/dist/discussion.js +4 -4
- package/dist/{document-editor-Dc8JeFVB.js → document-editor-C8ThjDQ7.js} +22 -10
- package/dist/{document-editor-Dc8JeFVB.js.map → document-editor-C8ThjDQ7.js.map} +1 -1
- package/dist/document-editor.js +3 -3
- package/dist/draft-card.js +2 -2
- package/dist/erd.js +3 -3
- package/dist/file-upload.js +3 -3
- package/dist/filter-bar.js +2 -2
- package/dist/flow.js +4 -4
- package/dist/form.js +2 -2
- package/dist/{generative-view-BKlcuujw.js → generative-view-CQ8-g1wY.js} +2 -2
- package/dist/{generative-view-BKlcuujw.js.map → generative-view-CQ8-g1wY.js.map} +1 -1
- package/dist/generative-view.js +3 -3
- package/dist/highlight-Be0wu7kh.js +252 -0
- package/dist/highlight-Be0wu7kh.js.map +1 -0
- package/dist/highlight.js +6 -0
- package/dist/highlight.js.map +1 -0
- package/dist/html-editor.js +29 -12
- package/dist/html-editor.js.map +1 -1
- package/dist/{i18n-controller-DJHsE1YH.js → i18n-controller-DLJcJ5gO.js} +2 -2
- package/dist/{i18n-controller-DJHsE1YH.js.map → i18n-controller-DLJcJ5gO.js.map} +1 -1
- package/dist/image.js +2 -2
- package/dist/index.js +26 -16
- package/dist/index.js.map +1 -1
- package/dist/inline-edit.js +2 -2
- package/dist/input.js +3 -3
- package/dist/json-viewer.js +2 -2
- package/dist/kanban.js +2 -2
- package/dist/kbd.js +2 -2
- package/dist/linear-progress.js +3 -3
- package/dist/listbox.js +2 -2
- package/dist/loader-full.js +19 -9
- package/dist/loader-full.js.map +1 -1
- package/dist/loader.js +46 -9
- package/dist/loader.js.map +1 -1
- package/dist/markdown-editor.js +29 -12
- package/dist/markdown-editor.js.map +1 -1
- package/dist/mention-input.js +4 -4
- package/dist/modal.js +2 -2
- package/dist/navigation-bar.js +2 -2
- package/dist/navigation-drawer.js +2 -2
- package/dist/navigation-rail.js +2 -2
- package/dist/notification-center.js +2 -2
- package/dist/number-field.js +4 -4
- package/dist/page-header.js +2 -2
- package/dist/pagination.js +2 -2
- package/dist/password-field.js +4 -4
- package/dist/password-rules.js +2 -2
- package/dist/phone-field.js +4 -4
- package/dist/{picker-field-CUI05sWc.js → picker-field-B5xOFc3-.js} +3 -3
- package/dist/{picker-field-CUI05sWc.js.map → picker-field-B5xOFc3-.js.map} +1 -1
- package/dist/pin-input.js +4 -4
- package/dist/presence-indicator.js +2 -2
- package/dist/prompt-input.js +24 -12
- package/dist/prompt-input.js.map +1 -1
- package/dist/radio.js +3 -3
- package/dist/rating.js +3 -3
- package/dist/redvars-loader.js +2 -2
- package/dist/relative-time.js +2 -2
- package/dist/resizable-panels.js +2 -2
- package/dist/{rich-text-input-N_hqnXej.js → rich-text-input-C4B9D6oD.js} +21 -18
- package/dist/rich-text-input-C4B9D6oD.js.map +1 -0
- package/dist/{schema-Dy0z-80u.js → schema-CPhNrjrx.js} +2 -2
- package/dist/{schema-Dy0z-80u.js.map → schema-CPhNrjrx.js.map} +1 -1
- package/dist/search.js +3 -3
- package/dist/select.js +4 -4
- package/dist/side-sheet.js +2 -2
- package/dist/signature-pad.js +3 -3
- package/dist/site-footer-group.js +142 -0
- package/dist/site-footer-group.js.map +1 -0
- package/dist/site-footer.js +338 -0
- package/dist/site-footer.js.map +1 -0
- package/dist/site-header.js +774 -0
- package/dist/site-header.js.map +1 -0
- package/dist/site-nav-group.js +123 -0
- package/dist/site-nav-group.js.map +1 -0
- package/dist/site-nav-link.js +321 -0
- package/dist/site-nav-link.js.map +1 -0
- package/dist/site-nav-menu.js +506 -0
- package/dist/site-nav-menu.js.map +1 -0
- package/dist/site-nav-shared-BDR2HG8e.js +23 -0
- package/dist/site-nav-shared-BDR2HG8e.js.map +1 -0
- package/dist/slider.js +3 -3
- package/dist/snackbar.js +2 -2
- package/dist/sparkline.js +2 -2
- package/dist/split-button.js +2 -2
- package/dist/src/__internal/i18n/strings.d.ts +24 -1
- package/dist/src/__internal/rich-text/rich-text-input.d.ts +6 -1
- package/dist/src/carousel/carousel.d.ts +135 -0
- package/dist/src/carousel/index.d.ts +1 -0
- package/dist/src/highlight/highlight.d.ts +56 -0
- package/dist/src/highlight/index.d.ts +2 -0
- package/dist/src/highlight/matches.d.ts +9 -0
- package/dist/src/html-editor/html-editor.d.ts +5 -0
- package/dist/src/index.d.ts +9 -0
- package/dist/src/markdown-editor/markdown-editor.d.ts +5 -0
- package/dist/src/site-footer/index.d.ts +2 -0
- package/dist/src/site-footer/site-footer-group.d.ts +34 -0
- package/dist/src/site-footer/site-footer.d.ts +74 -0
- package/dist/src/site-header/index.d.ts +4 -0
- package/dist/src/site-header/site-header.d.ts +170 -0
- package/dist/src/site-header/site-nav-group.d.ts +32 -0
- package/dist/src/site-header/site-nav-link.d.ts +65 -0
- package/dist/src/site-header/site-nav-menu.d.ts +104 -0
- package/dist/src/site-header/site-nav-shared.d.ts +13 -0
- package/dist/src/video/index.d.ts +2 -0
- package/dist/src/video/video-source.d.ts +12 -0
- package/dist/src/video/video.d.ts +80 -0
- package/dist/stat.js +2 -2
- package/dist/status-indicator.js +2 -2
- package/dist/step.js +2 -2
- package/dist/stepper.js +2 -2
- package/dist/{strings-DnYjGbbc.js → strings-MXyrGrNs.js} +28 -2
- package/dist/strings-MXyrGrNs.js.map +1 -0
- package/dist/svg.js +2 -2
- package/dist/switch.js +3 -3
- package/dist/table.js +2 -2
- package/dist/test/carousel.test.d.ts +1 -0
- package/dist/test/highlight.test.d.ts +1 -0
- package/dist/test/site-footer.test.d.ts +1 -0
- package/dist/test/site-header.test.d.ts +1 -0
- package/dist/test/video.test.d.ts +1 -0
- package/dist/textarea.js +4 -4
- package/dist/time-field.js +5 -5
- package/dist/time-picker.js +2 -2
- package/dist/timeline-item.js +2 -2
- package/dist/timeline.js +2 -2
- package/dist/{toggle-base-CXmFSp3b.js → toggle-base-I1wE_fVe.js} +2 -2
- package/dist/{toggle-base-CXmFSp3b.js.map → toggle-base-I1wE_fVe.js.map} +1 -1
- package/dist/tour.js +2 -2
- package/dist/transfer-list.js +3 -3
- package/dist/tree-chart.js +3 -3
- package/dist/tree-item.js +2 -2
- package/dist/tree.js +2 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/typing-indicator.js +2 -2
- package/dist/url-field.js +4 -4
- package/dist/user-menu.js +2 -2
- package/dist/video-IwNmHyft.js +509 -0
- package/dist/video-IwNmHyft.js.map +1 -0
- package/dist/video.js +12 -0
- package/dist/video.js.map +1 -0
- package/dist/virtual-list.js +2 -2
- package/dist/workflow-timeline.js +2 -2
- package/dist/workflow.js +3 -3
- package/dist/workspace-switcher.js +2 -2
- package/package.json +1 -1
- package/readme.md +5 -0
- package/src/__internal/i18n/strings.ts +31 -1
- package/src/__internal/rich-text/editor-chrome.scss +27 -10
- package/src/__internal/rich-text/rich-text-input.ts +17 -16
- package/src/carousel/carousel.scss +124 -0
- package/src/carousel/carousel.ts +547 -0
- package/src/carousel/index.ts +1 -0
- package/src/highlight/highlight.scss +25 -0
- package/src/highlight/highlight.ts +123 -0
- package/src/highlight/index.ts +2 -0
- package/src/highlight/matches.ts +94 -0
- package/src/html-editor/html-editor.ts +5 -0
- package/src/index.ts +18 -0
- package/src/loader.ts +36 -0
- package/src/markdown-editor/markdown-editor.ts +5 -0
- package/src/site-footer/index.ts +2 -0
- package/src/site-footer/site-footer-group.scss +53 -0
- package/src/site-footer/site-footer-group.ts +52 -0
- package/src/site-footer/site-footer.scss +171 -0
- package/src/site-footer/site-footer.ts +151 -0
- package/src/site-header/index.ts +8 -0
- package/src/site-header/site-header.scss +238 -0
- package/src/site-header/site-header.ts +565 -0
- package/src/site-header/site-nav-group.scss +29 -0
- package/src/site-header/site-nav-group.ts +57 -0
- package/src/site-header/site-nav-link.scss +154 -0
- package/src/site-header/site-nav-link.ts +140 -0
- package/src/site-header/site-nav-menu.scss +182 -0
- package/src/site-header/site-nav-menu.ts +336 -0
- package/src/site-header/site-nav-shared.ts +27 -0
- package/src/video/index.ts +2 -0
- package/src/video/video-source.ts +80 -0
- package/src/video/video.scss +183 -0
- package/src/video/video.ts +246 -0
- package/dist/rich-text-input-N_hqnXej.js.map +0 -1
- package/dist/strings-DnYjGbbc.js.map +0 -1
|
@@ -14,7 +14,6 @@ export declare const defaultStrings: {
|
|
|
14
14
|
disabled: string;
|
|
15
15
|
readOnly: string;
|
|
16
16
|
dragToReorder: string;
|
|
17
|
-
readOnlyTag: string;
|
|
18
17
|
intentNote: string;
|
|
19
18
|
intentInfo: string;
|
|
20
19
|
intentSuccess: string;
|
|
@@ -100,6 +99,30 @@ export declare const defaultStrings: {
|
|
|
100
99
|
/** Title of the svg preview dialog, for example "Preview: Logo". */
|
|
101
100
|
previewTitle: (title: string) => string;
|
|
102
101
|
svgPreview: string;
|
|
102
|
+
/** Spoken role of a carousel, read as "Testimonials, carousel". */
|
|
103
|
+
carouselRole: string;
|
|
104
|
+
/** Spoken role of each slide, read as "2 of 5, slide". */
|
|
105
|
+
carouselSlideRole: string;
|
|
106
|
+
/** Name of each slide, for example "2 of 5". */
|
|
107
|
+
carouselSlideLabel: (position: string, total: string) => string;
|
|
108
|
+
previousSlide: string;
|
|
109
|
+
nextSlide: string;
|
|
110
|
+
/** The autoplay button while slides rotate. */
|
|
111
|
+
stopSlideRotation: string;
|
|
112
|
+
/** The autoplay button while slides are still. */
|
|
113
|
+
startSlideRotation: string;
|
|
114
|
+
/** Name of the group of picker buttons. */
|
|
115
|
+
chooseSlide: string;
|
|
116
|
+
/** A picker button, for example "Slide 2 of 5" or "Slides 4 to 6 of 9". */
|
|
117
|
+
carouselPicker: (first: string, last: string, total: string) => string;
|
|
118
|
+
/** The counter shown instead of pickers when there are many pages, for example "3 of 9". */
|
|
119
|
+
carouselCounter: (page: string, total: string) => string;
|
|
120
|
+
/** Name of a video without `label`. */
|
|
121
|
+
video: string;
|
|
122
|
+
/** The play button of a video, for example "Play: Build a portal in ten minutes". */
|
|
123
|
+
playVideo: (label: string) => string;
|
|
124
|
+
videoFromYouTube: string;
|
|
125
|
+
videoFromVimeo: string;
|
|
103
126
|
navigation: string;
|
|
104
127
|
mainNavigation: string;
|
|
105
128
|
breadcrumb: string;
|
|
@@ -53,6 +53,8 @@ export default abstract class RichTextInput extends BaseInput implements RichTex
|
|
|
53
53
|
debounce: number;
|
|
54
54
|
/** Hides the fixed toolbar; formatting stays available from the selection bubble, `/` and shortcuts. */
|
|
55
55
|
hideToolbar: boolean;
|
|
56
|
+
/** Shows a "Read only" badge in the toolbar while the editor is read-only or disabled. Not shown with `hide-toolbar`. */
|
|
57
|
+
showReadonlyBadge: boolean;
|
|
56
58
|
/** Maximum number of characters of text. Typing stops there, and a count shows below. */
|
|
57
59
|
maxlength?: number;
|
|
58
60
|
/** Height of the empty editor, in lines. */
|
|
@@ -151,8 +153,11 @@ export default abstract class RichTextInput extends BaseInput implements RichTex
|
|
|
151
153
|
protected renderTools(editor: Editor): TemplateResult;
|
|
152
154
|
/** Keeps the editor's selection when a tool is pressed. */
|
|
153
155
|
protected keepSelection: (event: MouseEvent) => void;
|
|
156
|
+
/**
|
|
157
|
+
* The toolbar. A read-only or disabled editor shows no formatting tools, which could do
|
|
158
|
+
* nothing: only View source, and the "Read only" badge with `show-readonly-badge`.
|
|
159
|
+
*/
|
|
154
160
|
private renderToolbar;
|
|
155
|
-
protected renderStateTag(): typeof nothing | TemplateResult<1>;
|
|
156
161
|
/** The count below the field, with `maxlength`. */
|
|
157
162
|
private textCount;
|
|
158
163
|
/**
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { LitElement, type PropertyValues } from 'lit';
|
|
2
|
+
/** Detail of the `change` event. */
|
|
3
|
+
export interface CarouselChangeDetail {
|
|
4
|
+
/** The first slide in view, from 0. */
|
|
5
|
+
index: number;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* @label Carousel
|
|
9
|
+
* @tag wc-carousel
|
|
10
|
+
* @rawTag carousel
|
|
11
|
+
*
|
|
12
|
+
* @summary A row of slides shown one or a few at a time, with previous and next buttons and pickers.
|
|
13
|
+
* @overview
|
|
14
|
+
* <p>Carousel shows its children as slides, <code>per-view</code> at a time, for screenshots on a
|
|
15
|
+
* product page or a row of testimonials. The slides scroll with snap points, so touch swipe,
|
|
16
|
+
* trackpads and the scroll wheel work as they do anywhere else, and previous, next and picker
|
|
17
|
+
* buttons sit under them. With more than seven pages a "3 of 9" counter replaces the pickers.</p>
|
|
18
|
+
* <p>Each slide is never narrower than 15rem, so a carousel of three drops to two and then one as its
|
|
19
|
+
* container narrows. Slides out of view are <code>inert</code>, so Tab never reaches a link the
|
|
20
|
+
* person cannot see.</p>
|
|
21
|
+
* <p>Slides do not move on their own unless you set <code>autoplay</code>, and then a button to stop
|
|
22
|
+
* them comes first in the controls. Rotation pauses while the pointer rests on the carousel or focus
|
|
23
|
+
* is inside it, stops for good when the person uses any control, and does not start at all when the
|
|
24
|
+
* person asks for reduced motion.</p>
|
|
25
|
+
*
|
|
26
|
+
* @slot - The slides: any elements, one per slide. Give a slide an `aria-label` to name it; otherwise it is named "2 of 5".
|
|
27
|
+
*
|
|
28
|
+
* @csspart base - The carousel region.
|
|
29
|
+
* @csspart track - The scrolling row of slides.
|
|
30
|
+
* @csspart controls - The row of buttons under the slides.
|
|
31
|
+
*
|
|
32
|
+
* @cssprop --carousel-gap - Space between slides. Defaults to `--spacing-200`.
|
|
33
|
+
*
|
|
34
|
+
* @fires {CustomEvent<CarouselChangeDetail>} change - Dispatched when the slides in view change because the person used a control or scrolled, or autoplay moved on.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```html
|
|
38
|
+
* <wc-carousel label="Testimonials" per-view="3">
|
|
39
|
+
* <blockquote>We moved our incident process off spreadsheets in a week.</blockquote>
|
|
40
|
+
* <blockquote>Our customer portal runs on the same rules as the agents' workspace.</blockquote>
|
|
41
|
+
* <blockquote>Self-hosting took one command and a coffee.</blockquote>
|
|
42
|
+
* </wc-carousel>
|
|
43
|
+
* ```
|
|
44
|
+
* @example
|
|
45
|
+
* ```html
|
|
46
|
+
* <wc-carousel label="Product screenshots" autoplay loop>
|
|
47
|
+
* <img src="/img/workspace.webp" alt="The ITSM workspace" />
|
|
48
|
+
* <img src="/img/portal.webp" alt="The customer portal" />
|
|
49
|
+
* </wc-carousel>
|
|
50
|
+
* ```
|
|
51
|
+
* @tags media layout
|
|
52
|
+
*/
|
|
53
|
+
export declare class Carousel extends LitElement {
|
|
54
|
+
static styles: import("lit").CSSResultGroup[];
|
|
55
|
+
/** What the slides are, such as "Testimonials": the name of the carousel region. */
|
|
56
|
+
label: string;
|
|
57
|
+
/** How many slides show at once. Fewer show when the carousel is too narrow for them. */
|
|
58
|
+
perView: number;
|
|
59
|
+
/** The first slide in view, from 0. */
|
|
60
|
+
index: number;
|
|
61
|
+
/** Whether previous and next wrap around from the last page to the first and back. */
|
|
62
|
+
loop: boolean;
|
|
63
|
+
/** Whether the slides move on by themselves. A stop button comes first in the controls. */
|
|
64
|
+
autoplay: boolean;
|
|
65
|
+
/** How long each page shows while `autoplay` runs, in milliseconds. */
|
|
66
|
+
interval: number;
|
|
67
|
+
private slideCount;
|
|
68
|
+
/** How many slides fit: `per-view`, or fewer when the carousel is narrow. */
|
|
69
|
+
private visible;
|
|
70
|
+
/** Whether autoplay rotates the slides: off once the person stops it or uses a control. */
|
|
71
|
+
private rotating;
|
|
72
|
+
/** Whether the pointer or focus is inside, which pauses rotation. */
|
|
73
|
+
private held;
|
|
74
|
+
private readonly track?;
|
|
75
|
+
private readonly i18n;
|
|
76
|
+
private slides;
|
|
77
|
+
/** Whether the person started rotation with the button, so hover and focus no longer pause it. */
|
|
78
|
+
private startedByPerson;
|
|
79
|
+
/** Whether the person stopped rotation or used a control, so autoplay never starts again. */
|
|
80
|
+
private stoppedByPerson;
|
|
81
|
+
/** Whether the next `index` update came from scrolling, so it needs no scroll of its own. */
|
|
82
|
+
private indexFromScroll;
|
|
83
|
+
/** Whether the next scroll to `index` is animated. */
|
|
84
|
+
private smoothScroll;
|
|
85
|
+
private timer?;
|
|
86
|
+
private settleTimer?;
|
|
87
|
+
private readonly resizeObserver;
|
|
88
|
+
private readonly reducedMotion;
|
|
89
|
+
connectedCallback(): void;
|
|
90
|
+
disconnectedCallback(): void;
|
|
91
|
+
protected willUpdate(changed: PropertyValues<this>): void;
|
|
92
|
+
protected firstUpdated(): void;
|
|
93
|
+
protected updated(changed: PropertyValues): void;
|
|
94
|
+
/** Shows the page after the current one, or the first after the last when `loop` is set. */
|
|
95
|
+
next(): void;
|
|
96
|
+
/** Shows the page before the current one, or the last before the first when `loop` is set. */
|
|
97
|
+
previous(): void;
|
|
98
|
+
/** Scrolls the slide at `index`, from 0, into the first place in view. */
|
|
99
|
+
goTo(index: number): void;
|
|
100
|
+
/** The first slide index that still fills the view. */
|
|
101
|
+
private get maxStart();
|
|
102
|
+
private get pageCount();
|
|
103
|
+
/** The page in view: the last one once the view reaches the end. */
|
|
104
|
+
private get page();
|
|
105
|
+
private pageStart;
|
|
106
|
+
private clamp;
|
|
107
|
+
private goToPage;
|
|
108
|
+
private moveTo;
|
|
109
|
+
private dispatchChange;
|
|
110
|
+
private syncVisible;
|
|
111
|
+
/** Names each slide and makes the ones out of view inert. */
|
|
112
|
+
private syncSlides;
|
|
113
|
+
private scrollToIndex;
|
|
114
|
+
/** The slide nearest the start edge of the track. */
|
|
115
|
+
private nearestIndex;
|
|
116
|
+
private get shouldRotate();
|
|
117
|
+
private syncTimer;
|
|
118
|
+
private stopTimer;
|
|
119
|
+
private advance;
|
|
120
|
+
/** The person took over: autoplay stops and does not start again. */
|
|
121
|
+
private stopRotation;
|
|
122
|
+
private readonly handleSlotChange;
|
|
123
|
+
private readonly handleScroll;
|
|
124
|
+
private readonly handlePrevious;
|
|
125
|
+
private readonly handleNext;
|
|
126
|
+
private handlePicker;
|
|
127
|
+
private readonly handleRotation;
|
|
128
|
+
private readonly handlePointerEnter;
|
|
129
|
+
private readonly handlePointerLeave;
|
|
130
|
+
private readonly handleFocusIn;
|
|
131
|
+
private readonly handleFocusOut;
|
|
132
|
+
private renderPickers;
|
|
133
|
+
private renderControls;
|
|
134
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
135
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Carousel, type CarouselChangeDetail } from './carousel.js';
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { LitElement, type PropertyValues } from 'lit';
|
|
2
|
+
import { type HighlightRange } from './matches.js';
|
|
3
|
+
export type { HighlightRange } from './matches.js';
|
|
4
|
+
/**
|
|
5
|
+
* @label Highlight
|
|
6
|
+
* @tag wc-highlight
|
|
7
|
+
* @rawTag highlight
|
|
8
|
+
*
|
|
9
|
+
* @summary Marks the words of a search query in a piece of text.
|
|
10
|
+
* @overview
|
|
11
|
+
* <p>Highlight shows its text with each word of <code>query</code> marked, for search results in a
|
|
12
|
+
* knowledge base, a site search or a filtered list. Words match on their own, in any order,
|
|
13
|
+
* ignoring case and accents, so "resume" marks "Résumé".</p>
|
|
14
|
+
* <p>It reads its children as plain text and never parses HTML, so text from records or a search
|
|
15
|
+
* index is safe to put in it. When the server already knows where the matches are, set
|
|
16
|
+
* <code>ranges</code> instead of <code>query</code>.</p>
|
|
17
|
+
* <p>Marks use the tertiary container colour, so they differ from links and from the selection.</p>
|
|
18
|
+
*
|
|
19
|
+
* @slot - The text. Only its text content is used; markup in it is not rendered.
|
|
20
|
+
*
|
|
21
|
+
* @csspart mark - Each marked run of text, a `<mark>` element.
|
|
22
|
+
*
|
|
23
|
+
* @cssprop --highlight-background - Background of the marks. Defaults to `--color-tertiary-container`.
|
|
24
|
+
* @cssprop --highlight-color - Text colour of the marks. Defaults to `--color-on-tertiary-container`.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```html
|
|
28
|
+
* <wc-highlight query="reset password">
|
|
29
|
+
* If you forgot your password, choose Forgot password and reset it from the link we email you.
|
|
30
|
+
* </wc-highlight>
|
|
31
|
+
* ```
|
|
32
|
+
* @tags display search
|
|
33
|
+
*/
|
|
34
|
+
export declare class Highlight extends LitElement {
|
|
35
|
+
static styles: import("lit").CSSResultGroup[];
|
|
36
|
+
/** The search query whose words are marked. */
|
|
37
|
+
query: string;
|
|
38
|
+
/**
|
|
39
|
+
* Runs to mark, as `[start, end)` offsets in the element's `textContent`, for matches the server
|
|
40
|
+
* already found. When set, `query` is ignored.
|
|
41
|
+
*/
|
|
42
|
+
ranges?: HighlightRange[];
|
|
43
|
+
/** The language to fold case in. Defaults to the nearest `lang`, else the browser's. */
|
|
44
|
+
locale?: string;
|
|
45
|
+
/** The element's text content. */
|
|
46
|
+
private text;
|
|
47
|
+
/** Watches the text, so the marks follow when it changes. */
|
|
48
|
+
private readonly textObserver;
|
|
49
|
+
connectedCallback(): void;
|
|
50
|
+
disconnectedCallback(): void;
|
|
51
|
+
protected willUpdate(changed: PropertyValues<this>): void;
|
|
52
|
+
/** The runs to mark, as `[start, end)` offsets in the text. */
|
|
53
|
+
private get marks();
|
|
54
|
+
private syncText;
|
|
55
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
56
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** A run of marked text: `[start, end)` in UTF-16 code units of the original text. */
|
|
2
|
+
export type HighlightRange = [start: number, end: number];
|
|
3
|
+
/** Sorts ranges and merges the ones that touch or overlap. */
|
|
4
|
+
export declare function mergeRanges(ranges: readonly HighlightRange[], length: number): HighlightRange[];
|
|
5
|
+
/**
|
|
6
|
+
* Where the words of `query` occur in `text`, each word on its own, ignoring case and accents.
|
|
7
|
+
* Ranges are sorted and do not overlap.
|
|
8
|
+
*/
|
|
9
|
+
export declare function findMatches(text: string, query: string, locale?: string): HighlightRange[];
|
|
@@ -26,6 +26,11 @@ import RichTextInput, { type RichTextContent } from '../__internal/rich-text/ric
|
|
|
26
26
|
* <code>{ value }</code>, and supports <code>required</code>, <code>maxlength</code>,
|
|
27
27
|
* <code>rows</code> and <code>max-rows</code>, as the Markdown editor does.</p>
|
|
28
28
|
*
|
|
29
|
+
* <p><strong>Read-only and disabled.</strong> <code>readonly</code> keeps the text at full contrast
|
|
30
|
+
* and leaves only <strong>View source</strong> in the toolbar, which shows the HTML read-only.
|
|
31
|
+
* <code>disabled</code> dims the toolbar and the text. <code>show-readonly-badge</code> adds a
|
|
32
|
+
* lock badge to the toolbar in either state.</p>
|
|
33
|
+
*
|
|
29
34
|
* @cssprop --rich-text-editor-background - Background behind the text.
|
|
30
35
|
* @cssprop --prose-link-color - Color of links.
|
|
31
36
|
* @cssprop --prose-mention-background - Background of mention chips.
|
package/dist/src/index.d.ts
CHANGED
|
@@ -90,6 +90,15 @@ export { AppBar } from './app-bar/index.js';
|
|
|
90
90
|
export { NavigationRail, NavigationRailItem } from './navigation-rail/index.js';
|
|
91
91
|
export { NavigationBar, NavigationBarItem } from './navigation-bar/index.js';
|
|
92
92
|
export { NavigationDrawer, NavigationDrawerItem, NavigationDrawerGroup, } from './navigation-drawer/index.js';
|
|
93
|
+
export { SiteHeader, SiteNavMenu, SiteNavGroup, SiteNavLink, } from './site-header/index.js';
|
|
94
|
+
export type { SiteHeaderCloseDetail, SiteNavMenuCloseDetail, SiteNavMenuCloseReason, } from './site-header/index.js';
|
|
95
|
+
export { SiteFooter, SiteFooterGroup } from './site-footer/index.js';
|
|
96
|
+
export { Carousel } from './carousel/index.js';
|
|
97
|
+
export type { CarouselChangeDetail } from './carousel/index.js';
|
|
98
|
+
export { Video, parseVideoSource } from './video/index.js';
|
|
99
|
+
export type { VideoProvider } from './video/index.js';
|
|
100
|
+
export { Highlight, findMatches } from './highlight/index.js';
|
|
101
|
+
export type { HighlightRange } from './highlight/index.js';
|
|
93
102
|
export { Listbox, ListboxOption } from './listbox/index.js';
|
|
94
103
|
export type { ListboxChangeDetail } from './listbox/index.js';
|
|
95
104
|
export { PinInput } from './pin-input/index.js';
|
|
@@ -38,6 +38,11 @@ import RichTextInput, { type RichTextContent } from '../__internal/rich-text/ric
|
|
|
38
38
|
* <p><code>rows</code> sets the height of the empty editor in lines; it grows with the text, up to
|
|
39
39
|
* <code>max-rows</code> if set, and then scrolls.</p>
|
|
40
40
|
*
|
|
41
|
+
* <p><strong>Read-only and disabled.</strong> <code>readonly</code> keeps the text at full contrast
|
|
42
|
+
* and leaves only <strong>View source</strong> in the toolbar, which shows the Markdown read-only.
|
|
43
|
+
* <code>disabled</code> dims the toolbar and the text. <code>show-readonly-badge</code> adds a
|
|
44
|
+
* lock badge to the toolbar in either state.</p>
|
|
45
|
+
*
|
|
41
46
|
* @cssprop --rich-text-editor-background - Background behind the text.
|
|
42
47
|
* @cssprop --prose-link-color - Color of links.
|
|
43
48
|
* @cssprop --prose-mention-background - Background of mention chips.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* @label Site Footer Group
|
|
4
|
+
* @tag wc-site-footer-group
|
|
5
|
+
* @rawTag site-footer-group
|
|
6
|
+
*
|
|
7
|
+
* @summary A titled column of links in a site footer.
|
|
8
|
+
* @overview
|
|
9
|
+
* <p>A column of a <code>wc-site-footer</code>: a title and a list of links. The column is a
|
|
10
|
+
* navigation landmark named by its <code>label</code>, so a screen reader lists "Product",
|
|
11
|
+
* "Company" and so on among the page's landmarks.</p>
|
|
12
|
+
* <p>Put plain <code><a></code> elements or <code>wc-link</code> in it; the group lays them
|
|
13
|
+
* out and styles plain links.</p>
|
|
14
|
+
*
|
|
15
|
+
* @slot - The column's links.
|
|
16
|
+
*
|
|
17
|
+
* @csspart nav - The `<nav>` element.
|
|
18
|
+
* @csspart title - The column's title.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```html
|
|
22
|
+
* <wc-site-footer-group label="Developers">
|
|
23
|
+
* <a href="/docs">Docs</a>
|
|
24
|
+
* <a href="https://peacock.redvars.com">Peacock</a>
|
|
25
|
+
* </wc-site-footer-group>
|
|
26
|
+
* ```
|
|
27
|
+
* @tags navigation
|
|
28
|
+
*/
|
|
29
|
+
export declare class SiteFooterGroup extends LitElement {
|
|
30
|
+
static styles: import("lit").CSSResultGroup[];
|
|
31
|
+
/** The column's title, also the name of its navigation landmark. */
|
|
32
|
+
label: string;
|
|
33
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
34
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { SiteFooterGroup } from './site-footer-group.js';
|
|
3
|
+
/**
|
|
4
|
+
* @label Site Footer
|
|
5
|
+
* @tag wc-site-footer
|
|
6
|
+
* @rawTag site-footer
|
|
7
|
+
*
|
|
8
|
+
* @summary The footer of a website or portal: brand, columns of links, legal links and social links.
|
|
9
|
+
* @overview
|
|
10
|
+
* <p>Site footer is the page's <code>contentinfo</code> landmark. The <code>brand</code> slot and
|
|
11
|
+
* the <code>wc-site-footer-group</code> columns sit at the top; a bottom row holds the
|
|
12
|
+
* <code>legal</code> slot (copyright and policy links) and the <code>social</code> slot (icon
|
|
13
|
+
* buttons that link to the site's profiles).</p>
|
|
14
|
+
* <p>Slots that are empty take no room, so the same component is a full website footer or a slim
|
|
15
|
+
* portal footer with one row of text and links.</p>
|
|
16
|
+
* <p>The footer responds to its own width, not the viewport's: narrower than 48rem the columns wrap
|
|
17
|
+
* two to a row, and narrower than 24rem they stack. Links stay visible at every width, one tap away,
|
|
18
|
+
* rather than folded into an accordion.</p>
|
|
19
|
+
*
|
|
20
|
+
* @slot brand - The site's logo and name, and an optional line of text under it.
|
|
21
|
+
* @slot - The footer's `wc-site-footer-group` columns.
|
|
22
|
+
* @slot legal - Copyright and policy links, in small type.
|
|
23
|
+
* @slot social - Links to the site's profiles, usually `wc-icon-button shape="round"` with an `aria-label` each.
|
|
24
|
+
*
|
|
25
|
+
* @csspart base - The `<footer>` element.
|
|
26
|
+
* @csspart top - The row of the brand and the columns.
|
|
27
|
+
* @csspart groups - The columns.
|
|
28
|
+
* @csspart bottom - The row of the legal and social slots.
|
|
29
|
+
*
|
|
30
|
+
* @cssprop --site-footer-background - Background of the footer. Defaults to `--color-surface-container-low`.
|
|
31
|
+
* @cssprop --site-footer-max-width - Width the footer's content is centred in. Defaults to `none`.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```html
|
|
35
|
+
* <wc-site-footer>
|
|
36
|
+
* <a slot="brand" href="/">Redvars</a>
|
|
37
|
+
* <p slot="brand">Code less. Scale everywhere. Build natively.</p>
|
|
38
|
+
* <wc-site-footer-group label="Product">
|
|
39
|
+
* <a href="/tables">Tables and forms</a>
|
|
40
|
+
* <a href="/pricing">Pricing</a>
|
|
41
|
+
* </wc-site-footer-group>
|
|
42
|
+
* <wc-site-footer-group label="Company">
|
|
43
|
+
* <a href="/about">About</a>
|
|
44
|
+
* <a href="/blog">Blog</a>
|
|
45
|
+
* </wc-site-footer-group>
|
|
46
|
+
* <span slot="legal">© 2026 Redvars</span>
|
|
47
|
+
* <a slot="legal" href="/privacy">Privacy</a>
|
|
48
|
+
* <wc-icon-button slot="social" variant="text" shape="round" href="https://github.com/redvars" aria-label="GitHub">
|
|
49
|
+
* <wc-icon name="code"></wc-icon>
|
|
50
|
+
* </wc-icon-button>
|
|
51
|
+
* </wc-site-footer>
|
|
52
|
+
* ```
|
|
53
|
+
* @example
|
|
54
|
+
* ```html
|
|
55
|
+
* <wc-site-footer>
|
|
56
|
+
* <span slot="legal">© Acme Corp. Support hours 08:00–18:00 CET.</span>
|
|
57
|
+
* <a slot="legal" href="/p/support/contact">Contact us</a>
|
|
58
|
+
* <a slot="legal" href="/p/support/privacy">Privacy</a>
|
|
59
|
+
* </wc-site-footer>
|
|
60
|
+
* ```
|
|
61
|
+
* @tags navigation layout
|
|
62
|
+
*/
|
|
63
|
+
export declare class SiteFooter extends LitElement {
|
|
64
|
+
static styles: import("lit").CSSResultGroup[];
|
|
65
|
+
static Group: typeof SiteFooterGroup;
|
|
66
|
+
/** Which slots have content. */
|
|
67
|
+
private filled;
|
|
68
|
+
/** Watches the children, so the rows show and hide with their content. */
|
|
69
|
+
private readonly childObserver;
|
|
70
|
+
connectedCallback(): void;
|
|
71
|
+
disconnectedCallback(): void;
|
|
72
|
+
private syncSlots;
|
|
73
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
74
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { SiteHeader, type SiteHeaderCloseDetail } from './site-header.js';
|
|
2
|
+
export { SiteNavMenu, type SiteNavMenuCloseDetail, type SiteNavMenuCloseReason, } from './site-nav-menu.js';
|
|
3
|
+
export { SiteNavGroup } from './site-nav-group.js';
|
|
4
|
+
export { SiteNavLink } from './site-nav-link.js';
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { LitElement, type PropertyValues } from 'lit';
|
|
2
|
+
import { type CloseReason } from '../__internal/controllers/overlay-controller.js';
|
|
3
|
+
import { SiteNavMenu } from './site-nav-menu.js';
|
|
4
|
+
import { SiteNavGroup } from './site-nav-group.js';
|
|
5
|
+
import { SiteNavLink } from './site-nav-link.js';
|
|
6
|
+
/** Detail of the `close` event. */
|
|
7
|
+
export interface SiteHeaderCloseDetail {
|
|
8
|
+
/** Why the navigation drawer closed. */
|
|
9
|
+
reason: CloseReason;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* @label Site Header
|
|
13
|
+
* @tag wc-site-header
|
|
14
|
+
* @rawTag site-header
|
|
15
|
+
*
|
|
16
|
+
* @summary The top navigation bar of a website or portal: brand, links, menus and actions.
|
|
17
|
+
* @overview
|
|
18
|
+
* <p>Site header is the banner of a site: the brand at the start, the site's navigation, and actions
|
|
19
|
+
* such as Sign in or a call to action at the end. It is for websites and portals. For an
|
|
20
|
+
* application's own chrome use <code>wc-app-bar</code>, and for a bar at the bottom of a phone
|
|
21
|
+
* screen <code>wc-navigation-bar</code>.</p>
|
|
22
|
+
* <p>Put <code>wc-site-nav-link</code> elements in it for destinations and
|
|
23
|
+
* <code>wc-site-nav-menu</code> elements for sections with several pages. A menu is a disclosure
|
|
24
|
+
* button that opens a panel of links, as a list or, with <code>layout="columns"</code>, as columns
|
|
25
|
+
* of <code>wc-site-nav-group</code> with a featured card. These are links and disclosure buttons,
|
|
26
|
+
* not an ARIA menu, so Tab moves through them as through any links.</p>
|
|
27
|
+
* <p>When the header is narrower than <code>collapse-at</code> (720px by default), or too narrow
|
|
28
|
+
* for the bar's content to fit, the links and
|
|
29
|
+
* menus move into a drawer that slides in from the start edge, opened by a menu button. The
|
|
30
|
+
* <code>actions</code> slot moves to the bottom of the drawer; the <code>end</code> slot stays in
|
|
31
|
+
* the bar, for something that must always show, such as a user menu or one short button.</p>
|
|
32
|
+
* <p>A visually hidden <em>Skip to main content</em> link is the first focusable element. It moves
|
|
33
|
+
* focus to <code>skip-target</code> (<code>#main</code> by default).</p>
|
|
34
|
+
*
|
|
35
|
+
* @slot brand - The site's logo and name, usually a link to the home page.
|
|
36
|
+
* @slot - The navigation: `wc-site-nav-link` and `wc-site-nav-menu` elements.
|
|
37
|
+
* @slot actions - Buttons at the end of the bar, such as Sign in and a call to action. They move to the bottom of the drawer when the header is collapsed.
|
|
38
|
+
* @slot end - Content that always stays in the bar, such as a `wc-user-menu`, a search button or one short call to action.
|
|
39
|
+
*
|
|
40
|
+
* @fires {CustomEvent} open - Dispatched when the navigation drawer opens on a narrow header.
|
|
41
|
+
* @fires {CustomEvent<{reason: 'escape' | 'light-dismiss' | 'action' | 'api'}>} close - Dispatched when the navigation drawer closes: Escape, a click on the scrim, choosing a link, or `hideDrawer()` (and widening the header past `collapse-at`).
|
|
42
|
+
*
|
|
43
|
+
* @csspart bar - The `<header>` bar.
|
|
44
|
+
* @csspart nav - The navigation landmark in the bar.
|
|
45
|
+
* @csspart skip-link - The skip link.
|
|
46
|
+
* @csspart menu-button - The button that opens the drawer.
|
|
47
|
+
* @csspart drawer - The drawer `<dialog>` on a narrow header.
|
|
48
|
+
*
|
|
49
|
+
* @cssprop --site-header-height - Height of the bar. Defaults to 4rem.
|
|
50
|
+
* @cssprop --site-header-background - Background of the bar. Defaults to `--color-surface`.
|
|
51
|
+
* @cssprop --site-header-max-width - Width the bar's content is centred in, for a full-bleed background with a narrower content column. Defaults to `none`.
|
|
52
|
+
* @cssprop --site-header-z-index - Stacking order of the header and its panels. Defaults to 10.
|
|
53
|
+
* @cssprop --site-header-drawer-width - Width of the drawer. Defaults to 22.5rem.
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```html
|
|
57
|
+
* <wc-site-header>
|
|
58
|
+
* <a slot="brand" href="/">Redvars</a>
|
|
59
|
+
* <wc-site-nav-menu label="Solutions">
|
|
60
|
+
* <wc-site-nav-link href="/itsm">IT service management</wc-site-nav-link>
|
|
61
|
+
* <wc-site-nav-link href="/support">Customer support</wc-site-nav-link>
|
|
62
|
+
* </wc-site-nav-menu>
|
|
63
|
+
* <wc-site-nav-link href="/docs" current>Docs</wc-site-nav-link>
|
|
64
|
+
* <wc-site-nav-link href="/pricing">Pricing</wc-site-nav-link>
|
|
65
|
+
* <wc-link-button slot="actions" variant="text" href="/sign-in">Sign in</wc-link-button>
|
|
66
|
+
* <wc-link-button slot="actions" href="/waitlist">Join the waitlist</wc-link-button>
|
|
67
|
+
* </wc-site-header>
|
|
68
|
+
* ```
|
|
69
|
+
* @example
|
|
70
|
+
* ```html
|
|
71
|
+
* <wc-site-header sticky hide-on-scroll>
|
|
72
|
+
* <a slot="brand" href="/p/support">Acme Support</a>
|
|
73
|
+
* <wc-site-nav-link href="/p/support" current>Home</wc-site-nav-link>
|
|
74
|
+
* <wc-site-nav-link href="/p/support/tickets">My tickets</wc-site-nav-link>
|
|
75
|
+
* <wc-user-menu slot="end" name="Ada Lovelace"></wc-user-menu>
|
|
76
|
+
* </wc-site-header>
|
|
77
|
+
* ```
|
|
78
|
+
* @tags navigation layout
|
|
79
|
+
*/
|
|
80
|
+
export declare class SiteHeader extends LitElement {
|
|
81
|
+
static styles: import("lit").CSSResultGroup[];
|
|
82
|
+
static Menu: typeof SiteNavMenu;
|
|
83
|
+
static Group: typeof SiteNavGroup;
|
|
84
|
+
static Link: typeof SiteNavLink;
|
|
85
|
+
/** Accessible name of the navigation landmark. Defaults to Peacock's "Main navigation". */
|
|
86
|
+
label: string;
|
|
87
|
+
/** Header width in pixels below which the navigation moves into a drawer. The header also collapses whenever the bar's content does not fit. */
|
|
88
|
+
collapseAt: number;
|
|
89
|
+
/** Keeps the header at the top of the viewport while the page scrolls. */
|
|
90
|
+
sticky: boolean;
|
|
91
|
+
/** With `sticky`, slides the header away while scrolling down and back while scrolling up. */
|
|
92
|
+
hideOnScroll: boolean;
|
|
93
|
+
/** Selector of the element the skip link moves focus to. */
|
|
94
|
+
skipTarget: string;
|
|
95
|
+
/** Opens a menu's panel when a mouse rests on it, as well as on click. */
|
|
96
|
+
openOnHover: boolean;
|
|
97
|
+
/** Whether the navigation drawer is open. Only has an effect while the header is collapsed. */
|
|
98
|
+
drawerOpen: boolean;
|
|
99
|
+
/** Whether the header is narrower than `collapse-at`. */
|
|
100
|
+
private compact;
|
|
101
|
+
/** Whether the header has slid away while scrolling down. */
|
|
102
|
+
private scrolledAway;
|
|
103
|
+
/** Which slots have content. */
|
|
104
|
+
private filled;
|
|
105
|
+
private dialogElement?;
|
|
106
|
+
/** Peacock's strings for the skip link, the menu button and the landmark. */
|
|
107
|
+
private readonly i18n;
|
|
108
|
+
private readonly overlay;
|
|
109
|
+
/** Watches the header's width against `collapse-at`. */
|
|
110
|
+
private resizeObserver?;
|
|
111
|
+
/** Watches the children, since a slot that is not rendered fires no `slotchange`. */
|
|
112
|
+
private readonly childObserver;
|
|
113
|
+
/** The last measured width of the header. */
|
|
114
|
+
private width;
|
|
115
|
+
/** The header width the bar's content needs, measured while it was last shown wide. */
|
|
116
|
+
private neededWidth;
|
|
117
|
+
/** Watches the bar's parts, whose width changes as links render, fonts load or text changes. */
|
|
118
|
+
private contentObserver?;
|
|
119
|
+
/** Pending measurement after the bar's parts changed size. */
|
|
120
|
+
private fitTimer?;
|
|
121
|
+
/** Scroll position at the last scroll event, to tell the direction. */
|
|
122
|
+
private lastScrollY;
|
|
123
|
+
/** Why the drawer is closing, for the next `close` event. */
|
|
124
|
+
private closeReason;
|
|
125
|
+
/** Whether the drawer was open at the last `open`/`close` event, so each change fires once. */
|
|
126
|
+
private announcedOpen?;
|
|
127
|
+
connectedCallback(): void;
|
|
128
|
+
disconnectedCallback(): void;
|
|
129
|
+
protected willUpdate(changed: PropertyValues): void;
|
|
130
|
+
protected updated(changed: PropertyValues): void;
|
|
131
|
+
/** Whether the header is narrower than `collapse-at`, with its navigation in the drawer. */
|
|
132
|
+
get collapsed(): boolean;
|
|
133
|
+
/** Opens the navigation drawer (while collapsed). */
|
|
134
|
+
showDrawer(): void;
|
|
135
|
+
/** Closes the navigation drawer. */
|
|
136
|
+
hideDrawer(): void;
|
|
137
|
+
/** Closes every open menu panel in the bar. */
|
|
138
|
+
close(): void;
|
|
139
|
+
/** Whether the drawer is showing right now. */
|
|
140
|
+
private get drawerShown();
|
|
141
|
+
private closeDrawer;
|
|
142
|
+
private syncCompact;
|
|
143
|
+
/**
|
|
144
|
+
* Measures the width the wide bar's content needs: the brand, links, actions and end at their
|
|
145
|
+
* natural widths, with the gaps and padding. The header collapses below it, as below
|
|
146
|
+
* `collapse-at`, so links never run into the actions.
|
|
147
|
+
*/
|
|
148
|
+
private measureFit;
|
|
149
|
+
/** Reads which slots have content from the light DOM, so it does not depend on what is rendered. */
|
|
150
|
+
private syncSlots;
|
|
151
|
+
private handleScroll;
|
|
152
|
+
/**
|
|
153
|
+
* Fragment links do not reach elements inside shadow roots, so move focus directly. The target is
|
|
154
|
+
* looked for beside the header first, for a header in an app's own shadow root, then in the page.
|
|
155
|
+
*/
|
|
156
|
+
private handleSkipClick;
|
|
157
|
+
private handleMenuButtonClick;
|
|
158
|
+
private handleCloseButtonClick;
|
|
159
|
+
/** Choosing a link in the drawer closes it. */
|
|
160
|
+
private handleDrawerLinkClick;
|
|
161
|
+
/** The native Escape `cancel`: keep `drawer-open` in charge. */
|
|
162
|
+
private handleCancel;
|
|
163
|
+
/** The browser closed the dialog on its own: keep `drawer-open` in step. */
|
|
164
|
+
private handleNativeClose;
|
|
165
|
+
/** A click outside the drawer's box lands on its backdrop: a light dismiss. */
|
|
166
|
+
private handleDialogClick;
|
|
167
|
+
private renderMenuButton;
|
|
168
|
+
private renderDrawer;
|
|
169
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
170
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* @label Site Nav Group
|
|
4
|
+
* @tag wc-site-nav-group
|
|
5
|
+
* @rawTag site-nav-group
|
|
6
|
+
*
|
|
7
|
+
* @summary A titled column of links in a site header menu.
|
|
8
|
+
* @overview
|
|
9
|
+
* <p>Groups <code>wc-site-nav-link</code> elements under a title inside a
|
|
10
|
+
* <code>wc-site-nav-menu</code>, usually one with <code>layout="columns"</code>, where each group is
|
|
11
|
+
* a column. The group is labelled by its title for assistive technology.</p>
|
|
12
|
+
*
|
|
13
|
+
* @slot - The group's `wc-site-nav-link` elements.
|
|
14
|
+
*
|
|
15
|
+
* @csspart title - The group's title.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```html
|
|
19
|
+
* <wc-site-nav-group label="Build">
|
|
20
|
+
* <wc-site-nav-link href="/tables">Tables and forms</wc-site-nav-link>
|
|
21
|
+
* <wc-site-nav-link href="/rules">Rules</wc-site-nav-link>
|
|
22
|
+
* </wc-site-nav-group>
|
|
23
|
+
* ```
|
|
24
|
+
* @tags navigation
|
|
25
|
+
*/
|
|
26
|
+
export declare class SiteNavGroup extends LitElement {
|
|
27
|
+
static styles: import("lit").CSSResultGroup[];
|
|
28
|
+
/** The group's title. */
|
|
29
|
+
label: string;
|
|
30
|
+
connectedCallback(): void;
|
|
31
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
32
|
+
}
|