diff --git a/examples/webcomponents/components/analytics.js b/examples/webcomponents/components/analytics.js new file mode 100644 index 0000000000..cb0e9a57d1 --- /dev/null +++ b/examples/webcomponents/components/analytics.js @@ -0,0 +1,834 @@ +const trackEvent = (payload) => { + // insert a function to submit to your analytics platform of choice + console.log(payload) +} + +const eventListeners = { + // UI Core components + 'rpl-accordion/toggleAll': () => { + return (payload) => { + trackEvent({ + event: `${payload.action}_accordion_all`, + element_id: payload?.id, + element_text: payload?.text, + name: payload?.name, + component: 'rpl-accordion', + platform_event: 'toggleAll' + }) + } + }, + 'rpl-accordion/toggleItem': () => { + return (payload) => { + trackEvent({ + event: `${payload.action}_accordion`, + element_id: payload?.id, + element_text: payload?.text, + name: payload?.name, + component: 'rpl-accordion', + platform_event: 'toggleItem' + }) + } + }, + 'rpl-alert/dismiss': () => { + return (payload) => { + trackEvent({ + event: `${payload.action}_alert`, + element_id: payload?.id, + element_text: payload?.text, + label: payload?.label, + name: payload?.name, + component: 'rpl-alert', + platform_event: 'dismiss' + }) + } + }, + 'rpl-breadcrumbs/navigate': () => { + return (payload) => { + trackEvent({ + event: `${payload.action}_breadcrumb`, + element_id: payload?.id, + element_text: payload?.text, + link_url: payload?.value, + index: payload?.index, + name: payload?.name, + component: 'rpl-breadcrumbs', + platform_event: 'navigate' + }) + } + }, + 'rpl-campaign-banner/navigate': () => { + return (payload) => { + trackEvent({ + event: `${payload.action}_banner`, + element_id: payload?.id, + element_text: payload?.text, + label: payload?.label, + link_url: payload?.value, + type: payload?.type, + name: payload?.name, + component: 'rpl-campaign-banner', + component_options: payload?.options, + platform_event: 'navigate' + }) + } + }, + 'rpl-card/navigate': () => { + return (payload) => { + trackEvent({ + event: `${payload.action}_card`, + element_id: payload?.id, + element_text: payload?.text, + label: payload?.label, + name: payload?.name, + index: payload?.index, + link_url: payload?.value, + type: payload?.type, + component: 'rpl-card', + platform_event: 'navigate' + }) + } + }, + 'rpl-card-carousel/paginate': () => { + return (payload) => { + trackEvent({ + event: `paginate_${payload.action}`, + element_id: payload?.id, + element_text: payload?.text, + name: payload?.name, + index: payload?.index, + component: 'rpl-card-carousel', + platform_event: 'paginate' + }) + } + }, + 'rpl-card-carousel/swipe': () => { + return (payload) => { + trackEvent({ + event: `swipe_${payload.action}`, + element_id: payload?.id, + name: payload?.name, + index: payload?.index, + component: 'rpl-card-carousel', + platform_event: 'swipe' + }) + } + }, + 'rpl-chip/navigate': () => { + return (payload) => { + trackEvent({ + event: `${payload.action}_chip`, + element_id: payload?.id, + element_text: payload?.text, + name: payload?.name, + index: payload?.index, + link_url: payload?.value, + component: 'rpl-chip', + platform_event: 'navigate' + }) + } + }, + 'rpl-contact-us/itemClick': () => { + return (payload) => { + const { host } = new URL(payload?.value) + + trackEvent({ + event: `${payload.action}_${payload?.type || 'link'}`, + element_id: payload?.id, + element_text: payload?.text, + label: payload?.label, + name: payload?.name, + link_url: payload?.value, + link_domain: host, + component: 'rpl-contact-us', + platform_event: 'itemClick' + }) + } + }, + 'rpl-data-table/expandRow': () => { + return (payload) => { + trackEvent({ + event: `${payload.action}_table_row`, + element_id: payload?.id, + element_text: payload?.text, + label: payload?.label, + name: payload?.name, + index: payload?.index, + component: 'rpl-data-table', + platform_event: 'expandRow' + }) + } + }, + 'rpl-document/download': () => { + return (payload) => { + trackEvent({ + event: `document_${payload.action}`, + element_id: payload?.id, + element_text: payload?.text, + link_url: payload?.value, + name: payload?.name, + component: 'rpl-document', + platform_event: 'download' + }) + } + }, + 'rpl-file/download': () => { + return (payload) => { + const { host, pathname } = new URL(payload?.value) + + trackEvent({ + event: `file_${payload.action}`, + element_id: payload?.id, + element_text: payload?.text, + file_name: pathname.split('/').pop(), + file_extension: payload?.type, + file_size: payload?.size, + link_url: payload?.value, + link_domain: host, + name: payload?.name, + component: 'rpl-file', + platform_event: 'download' + }) + } + }, + 'rpl-footer/expand': () => { + return (payload) => { + trackEvent({ + event: `${payload.action}_footer_nav`, + element_id: payload?.id, + element_text: payload?.text, + index: payload?.index, + name: payload?.name, + component: 'rpl-footer', + platform_event: 'expand' + }) + } + }, + 'rpl-footer/navigate': () => { + return (payload) => { + trackEvent({ + event: `${payload.action}_footer`, + element_id: payload?.id, + element_text: payload?.text, + label: payload?.label, + index: payload?.index, + link_url: payload?.value, + name: payload?.name, + component: 'rpl-footer', + platform_event: 'navigate' + }) + } + }, + 'rpl-header/navigate': () => { + return (payload) => { + trackEvent({ + event: `${payload.action}_header_${payload?.elementType || 'link'}`, + element_id: payload?.id, + element_text: payload?.text, + label: payload?.label, + link_url: payload?.value, + section: payload?.section, + theme: payload?.theme, + type: payload?.type, + name: payload?.name, + component: 'rpl-header', + component_options: payload?.options, + platform_event: 'navigate' + }) + } + }, + 'rpl-in-page-navigation/navigate': () => { + return (payload) => { + trackEvent({ + event: `${payload.action}_in_page_nav`, + element_id: payload?.id, + element_text: payload?.text, + label: payload?.label, + link_url: payload?.value, + name: payload?.name, + component: 'rpl-in-page-navigation', + platform_event: 'navigate' + }) + } + }, + 'rpl-media-embed/viewTranscript': () => { + return (payload) => { + trackEvent({ + event: `${payload.action}_transcript`, + element_id: payload?.id, + element_text: payload?.text, + label: payload?.label, + type: payload?.type, + name: payload?.name, + component: 'rpl-media-embed', + platform_event: 'viewTranscript' + }) + } + }, + 'rpl-media-embed/viewFullscreen': () => { + return (payload) => { + trackEvent({ + event: `${payload.action}_fullscreen`, + element_id: payload?.id, + element_text: payload?.text, + label: payload?.label, + type: payload?.type, + name: payload?.name, + component: 'rpl-media-embed', + platform_event: 'viewFullscreen' + }) + } + }, + 'rpl-media-embed/viewData': () => { + return (payload) => { + trackEvent({ + event: `${payload.action}_data`, + element_id: payload?.id, + element_text: payload?.text, + label: payload?.label, + type: payload?.type, + name: payload?.name, + component: 'rpl-media-embed', + platform_event: 'viewData' + }) + } + }, + 'rpl-media-embed/downloadImage': () => { + return (payload) => { + const { pathname, host } = new URL(payload?.value) + const fileName = pathname.split('/').pop() + + trackEvent({ + event: `file_${payload.action}`, + element_id: payload?.id, + element_text: payload?.text, + label: payload?.label, + link_url: payload?.value, + link_domain: host, + file_name: fileName, + file_extension: fileName.split('.').pop(), + type: payload?.type, + name: payload?.name, + component: 'rpl-media-embed', + platform_event: 'downloadImage' + }) + } + }, + 'rpl-media-gallery/paginate': () => { + return (payload) => { + trackEvent({ + event: `paginate_${payload.action}`, + element_id: payload?.id, + element_text: payload?.text, + index: payload?.index, + label: payload?.label, + name: payload?.name, + component: 'rpl-media-gallery', + platform_event: 'paginate' + }) + } + }, + 'rpl-media-gallery/swipe': () => { + return (payload) => { + trackEvent({ + event: `swipe_${payload.action}`, + element_id: payload?.id, + index: payload?.index, + label: payload?.label, + name: payload?.name, + component: 'rpl-media-gallery', + platform_event: 'swipe' + }) + } + }, + 'rpl-media-gallery/viewFullscreen': () => { + return (payload) => { + trackEvent({ + event: `${payload.action}_fullscreen`, + element_id: payload?.id, + element_text: payload?.text, + label: payload?.label, + name: payload?.name, + value: payload?.value, + index: payload?.index, + component: 'rpl-media-gallery', + platform_event: 'viewFullscreen' + }) + } + }, + 'rpl-page-links/paginate': () => { + return (payload) => { + trackEvent({ + event: `paginate_${payload.action}`, + element_id: payload?.id, + element_text: payload?.text, + link_url: payload?.value, + name: payload?.name, + component: 'rpl-page-links', + platform_event: 'paginate' + }) + } + }, + 'rpl-primary-nav/quickExit': () => { + return (payload) => { + trackEvent({ + event: `${payload.action}_quick_exit`, + element_id: payload?.id, + element_text: payload?.text, + link_url: payload?.value, + name: payload?.name, + component: 'rpl-primary-nav', + platform_event: 'quickExit' + }) + } + }, + 'rpl-primary-nav/toggleMenu': () => { + return (payload) => { + trackEvent({ + event: `${payload.action}_menu`, + element_id: payload?.id, + element_text: payload?.text, + name: payload?.name, + component: 'rpl-primary-nav', + platform_event: 'toggleMenu' + }) + } + }, + 'rpl-primary-nav/toggleMenuItem': () => { + return (payload) => { + trackEvent({ + event: `${payload.action}_menu_item`, + element_id: payload?.id, + element_text: payload?.text, + index: payload?.index, + name: payload?.name, + component: 'rpl-primary-nav', + platform_event: 'toggleMenuItem' + }) + } + }, + 'rpl-primary-nav/clickBackButton': () => { + return (payload) => { + trackEvent({ + event: `${payload.action}_menu_back`, + element_id: payload?.id, + element_text: payload?.text, + index: payload?.index, + name: payload?.name, + component: 'rpl-primary-nav', + platform_event: 'clickBackButton' + }) + } + }, + 'rpl-primary-nav/navigate': () => { + return (payload) => { + trackEvent({ + event: `${payload.action}_menu_item`, + element_id: payload?.id, + element_text: payload?.text, + index: payload?.index, + link_url: payload?.value, + name: payload?.name, + component: 'rpl-primary-nav', + platform_event: 'navigate' + }) + } + }, + 'rpl-primary-nav/toggleSearch': () => { + return (payload) => { + trackEvent({ + event: `${payload.action}_search`, + element_id: payload?.id, + name: payload?.name, + component: 'rpl-primary-nav', + platform_event: 'toggleSearch' + }) + } + }, + 'rpl-related-links/navigate': () => { + return (payload) => { + trackEvent({ + event: `${payload.action}_related_link`, + element_id: payload?.id, + element_text: payload?.text, + index: payload?.index, + name: payload?.name, + link_url: payload?.value, + component: 'rpl-related-links', + platform_event: 'navigate' + }) + } + }, + 'rpl-search-result/navigate': () => { + return (payload) => { + trackEvent({ + event: `${payload.action}_search_result`, + element_id: payload?.id, + element_text: payload?.text, + label: payload?.label, + name: payload?.name, + link_url: payload?.value, + component: 'rpl-search-result', + platform_event: 'navigate' + }) + } + }, + 'rpl-search-bar/submit': () => { + return (payload) => { + trackEvent({ + event: `${payload.action}`, + element_id: payload?.id, + element_text: payload?.text, + label: payload?.value, + type: payload?.type, + name: payload?.name, + component: 'rpl-search-bar', + platform_event: 'search' + }) + } + }, + 'rpl-social-share/openShareWindow': () => { + return (payload) => { + trackEvent({ + event: `${payload.action}_social`, + element_id: payload?.id, + element_text: payload?.text, + label: payload?.label, + name: payload?.text?.toLowerCase(), + component: 'rpl-social-share', + platform_event: 'openShareWindow' + }) + } + }, + 'rpl-tabs/toggleTab': () => { + return (payload) => { + trackEvent({ + event: `${payload.action}_tab`, + element_id: payload?.id, + element_text: payload?.text, + name: payload?.name, + component: 'rpl-tabs', + platform_event: 'toggleTab' + }) + } + }, + 'rpl-timeline/navigate': () => { + return (payload) => { + trackEvent({ + event: `${payload.action}_timeline_item`, + element_id: payload?.id, + element_text: payload?.text, + name: payload?.name, + link_url: payload?.value, + component: 'rpl-timeline', + platform_event: 'navigate' + }) + } + }, + 'rpl-vertical-nav/toggleMenuItem': () => { + return (payload) => { + trackEvent({ + event: `${payload.action}_menu_item`, + element_id: payload?.id, + element_text: payload?.text, + name: payload?.name, + component: 'rpl-vertical-nav', + platform_event: 'toggleMenuItem' + }) + } + }, + 'rpl-vertical-nav/navigate': () => { + return (payload) => { + trackEvent({ + event: `${payload.action}_menu_item`, + element_id: payload?.id, + element_text: payload?.text, + link_url: payload?.value, + name: payload?.name, + index: payload?.index, + component: 'rpl-vertical-nav', + platform_event: 'navigate' + }) + } + }, + // UI Forms components + 'rpl-form/submit': () => { + return (payload) => { + trackEvent({ + event: `form_${payload.action}`, + form_id: payload?.id, + form_name: payload?.name, + form_valid: true, + form_data: payload?.value, + element_text: payload?.text, + component: 'rpl-form', + platform_event: 'submit' + }) + } + }, + 'rpl-form/invalid': () => { + return (payload) => { + trackEvent({ + event: `form_${payload.action}`, + form_id: payload?.id, + form_name: payload?.name, + form_valid: false, + form_data: payload?.value, + element_text: payload?.text, + component: 'rpl-form', + platform_event: 'submit' + }) + } + }, + 'rpl-form/submitted': () => { + return (payload) => { + trackEvent({ + event: `form_${payload.action}`, + form_id: payload?.id, + form_name: payload?.name, + form_data: payload?.value, + element_text: payload?.text, + component: 'rpl-form', + platform_event: 'submit' + }) + } + }, + 'rpl-form-actions/reset': () => { + return (payload) => { + trackEvent({ + event: `${payload.action}_reset_form`, + form_id: payload?.contextId, + form_name: payload?.contextName, + element_text: payload?.text, + component: 'rpl-form-actions', + platform_event: 'resetForm' + }) + } + }, + 'rpl-form-date/update': () => { + return (payload) => { + trackEvent({ + event: `${payload.action}_form_field`, + label: payload?.label, + form_name: payload?.contextName, + form_id: payload?.contextId, + field_id: payload?.id, + value: payload?.value, + type: 'date', + component: 'rpl-form-date', + platform_event: 'update' + }) + } + }, + 'rpl-form-dropdown/toggleOpen': () => { + return (payload) => { + trackEvent({ + event: `${payload.action}_form_field`, + label: payload?.label, + form_name: payload?.contextName, + form_id: payload?.contextId, + field_id: payload?.id, + value: payload?.value, + type: 'select', + component: 'rpl-form-dropdown', + platform_event: 'toggleOpen' + }) + } + }, + 'rpl-form-dropdown/update': () => { + return (payload) => { + trackEvent({ + event: `${payload.action}_form_field`, + label: payload?.label, + form_name: payload?.contextName, + form_id: payload?.contextId, + field_id: payload?.id, + value: payload?.value, + type: 'select', + component: 'rpl-form-dropdown', + platform_event: 'update' + }) + } + }, + 'rpl-form-input/update': () => { + return (payload) => { + trackEvent({ + event: `${payload.action}_form_field`, + label: payload?.label, + form_name: payload?.contextName, + form_id: payload?.contextId, + field_id: payload?.id, + type: payload?.type, + value: payload?.value, + component: 'rpl-form-input', + platform_event: 'update' + }) + } + }, + 'rpl-form-option/update': () => { + return (payload) => { + trackEvent({ + event: `${payload.action}_form_field`, + label: payload?.label, + form_name: payload?.contextName, + form_id: payload?.contextId, + field_id: payload?.id, + type: payload?.type, + value: payload?.value, + component: 'rpl-form-option', + platform_event: 'update' + }) + } + }, + 'rpl-form-option-buttons/update': () => { + return (payload) => { + trackEvent({ + event: `${payload.action}_form_field`, + label: payload?.label, + form_name: payload?.contextName, + form_id: payload?.contextId, + field_id: payload?.id, + value: payload?.value, + type: 'radio', + component: 'rpl-form-option-buttons', + platform_event: 'update' + }) + } + }, + 'rpl-form-checkbox-group/update': () => { + return (payload) => { + trackEvent({ + event: `${payload.action}_form_field`, + label: payload?.label, + form_name: payload?.contextName, + form_id: payload?.contextId, + field_id: payload?.id, + value: payload?.value, + type: 'checkbox', + component: 'rpl-form-checkbox-group', + platform_event: 'update' + }) + } + }, + 'rpl-form-radio-group/update': () => { + return (payload) => { + trackEvent({ + event: `${payload.action}_form_field`, + label: payload?.label, + form_name: payload?.contextName, + form_id: payload?.contextId, + field_id: payload?.id, + value: payload?.value, + type: 'radio', + component: 'rpl-form-radio-group', + platform_event: 'update' + }) + } + }, + 'rpl-form-textarea/update': () => { + return (payload) => { + trackEvent({ + event: `${payload.action}_form_field`, + label: payload?.label, + form_name: payload?.contextName, + form_id: payload?.contextId, + field_id: payload?.id, + value: payload?.value, + type: 'textarea', + component: 'rpl-form-textarea', + platform_event: 'update' + }) + } + }, + // Tide search + 'tide-search/submit': () => { + return (payload) => { + trackEvent({ + event: `${payload.action}`, + element_id: payload?.id, + element_text: payload?.text, + filters: payload?.options, + label: payload?.label, + name: payload?.name, + type: payload?.type, + form_id: payload?.contextId, + component: `tide-${payload.section || 'search'}`, + platform_event: 'search' + }) + } + }, + 'tide-search/results': () => { + return (payload) => { + trackEvent({ + event: `${payload.action}_search_results`, + element_id: payload?.id, + label: payload?.label, + name: payload?.name, + form_id: payload?.contextId, + index: payload?.index, + filters: payload?.options, + count: payload?.value, + component: `tide-${payload.section || 'search'}`, + platform_event: 'search' + }) + } + }, + 'tide-search/paginate': () => { + return (payload) => { + trackEvent({ + event: `paginate_${payload.action}`, + element_id: payload?.id, + element_text: payload?.text, + label: payload?.label, + name: payload?.name, + form_id: payload?.contextId, + index: payload?.index, + count: payload?.value, + filters: payload?.options, + component: `tide-${payload.section || 'search'}`, + platform_event: 'paginate' + }) + } + }, + 'tide-search/toggleFilters': () => { + return (payload) => { + trackEvent({ + event: `${payload.action}_filters`, + element_id: payload?.id, + element_text: payload?.text, + label: payload?.label, + name: payload?.name, + form_id: payload?.contextId, + filters: payload?.options, + component: `tide-${payload.section || 'search'}`, + platform_event: 'toggleFilters' + }) + } + }, + 'tide-search/reset': () => { + return (payload) => { + trackEvent({ + event: `${payload.action}_filters`, + element_id: payload?.id, + element_text: payload?.text, + label: payload?.label, + name: payload?.name, + count: payload?.value, + type: payload?.type, + form_id: payload?.contextId, + filters: payload?.options, + component: `tide-${payload.section || 'search'}`, + platform_event: 'clearQuery' + }) + } + } +} +setTimeout(() => { + if (window.$rplEvent) { + const evtKeys = Object.keys(eventListeners) + if (evtKeys.length > 0) { + evtKeys.forEach((key) => { + window.$rplEvent.on(key, eventListeners[key]()) + }) + } + } +}, 2000) diff --git a/examples/webcomponents/components/footer.js b/examples/webcomponents/components/footer.js new file mode 100644 index 0000000000..d0fbaa4290 --- /dev/null +++ b/examples/webcomponents/components/footer.js @@ -0,0 +1,78 @@ +const footer = document.getElementById('footer') +footer.id = '123' +footer.nav = [ + { + text: 'Your Services', + url: '#services', + single: true, + items: [ + { + text: 'Law and safety', + url: '#' + } + ] + }, + { + text: 'About us', + url: '#about', + single: true + }, + { + text: 'Latest News', + url: '#news', + single: true + }, + { + text: 'Upcoming Events', + url: '#events', + single: true + }, + { + text: 'Connect with us', + url: '', + items: [ + { + text: 'DH Twitter', + url: '#', + icon: 'icon-x' + }, + { + text: 'DFFH LinkedIn', + url: '#', + icon: 'icon-linkedin' + }, + { + text: 'DFFH Facebook', + url: '#', + icon: 'icon-facebook' + } + ] + } +] + +footer.links = [ + { + text: 'Privacy', + url: '#' + }, + { + text: 'Disclaimer', + url: '#' + }, + { + text: 'Terms of use', + url: '#' + }, + { + text: 'Sitemap', + url: '#' + }, + { + text: 'Accessibility Statement', + url: '#' + }, + { + text: 'Help', + url: '#' + } +] diff --git a/examples/webcomponents/components/heroheader.js b/examples/webcomponents/components/heroheader.js new file mode 100644 index 0000000000..e6381ad82c --- /dev/null +++ b/examples/webcomponents/components/heroheader.js @@ -0,0 +1,20 @@ +const heroHeader = document.getElementById('hero-header-container') +heroHeader.primaryAction = { text: 'Primary action', url: '#primary' } +heroHeader.secondaryAction = { + title: 'Find out more', + text: 'Secondary action', + url: '#secondary' +} +heroHeader.background = { + src: 'img/image-landscape-s.jpg', + srcSet: + '/img/image-landscape-s.jpg 640w, /img/image-landscape-m.jpg 960w , /img/image-landscape-l.jpg 1240w', + sizes: + '(min-width: 640px) 640px, (min-width: 960px) 960px, (min-width: 1240px) 1240px', + height: 1920, + width: 2880, + focalPoint: { + x: 2620, + y: 620 + } +} diff --git a/examples/webcomponents/components/page.js b/examples/webcomponents/components/page.js new file mode 100644 index 0000000000..ac494c8f84 --- /dev/null +++ b/examples/webcomponents/components/page.js @@ -0,0 +1,8 @@ +if (window.$rplEventBus) { + const evtKeys = Object.keys(eventListeners) + if (evtKeys.length > 0) { + evtKeys.forEach((key) => { + window.$rplEventBus.on(key, eventListeners[key]()) + }) + } +} diff --git a/examples/webcomponents/components/primarynav.js b/examples/webcomponents/components/primarynav.js new file mode 100644 index 0000000000..10f412c485 --- /dev/null +++ b/examples/webcomponents/components/primarynav.js @@ -0,0 +1,120 @@ +const primaryNav = document.getElementById('rpl-primary-nav') +const navItems = [ + { + id: '1', + text: 'First level A', + url: '#', + items: [ + { + id: '2', + text: 'Second level A', + url: '#', + items: [ + { + id: '3', + text: 'Third level A link with some text that will need to wrap', + url: '#', + items: [{ id: '4', text: 'Fourth level A', url: '#' }] + } + ] + }, + { id: '4', text: 'Second level B', url: '#' }, + { id: '5', text: 'Second level C', url: '#' }, + { id: '6', text: 'Second level D', url: '#' }, + { + id: '7', + text: 'Second level E', + url: '#', + items: [ + { id: '7.1', text: 'Third level B', url: '#' }, + { id: '7.2', text: 'Third level C', url: '#' }, + { id: '7.3', text: 'Third level D', url: '#' }, + { id: '7.4', text: 'Third level E', url: '#' }, + { + id: '7.5', + text: 'Third level F', + url: '#', + items: [ + { id: '7.6', text: 'Fourth level A', url: '#' }, + { id: '7.7', text: 'Fourth level B', url: '#' }, + { id: '7.8', text: 'Fourth level C', url: '#' }, + { id: '7.9', text: 'Fourth level D', url: '#' } + ] + }, + { id: '7.10', text: 'Third level G', url: '#' }, + { id: '7.11', text: 'Third level H', url: '#' }, + { id: '7.12', text: 'Third level I', url: '#' } + ] + }, + + { id: '8', text: 'Second level F', url: '#' }, + { id: '9', text: 'Second level G', url: '#' }, + { id: '10', text: 'Second level H', url: '#' }, + { id: '11', text: 'Second level I', url: '#' }, + { id: '12', text: 'Second level J', url: '#' }, + { id: '13', text: 'Second level K', url: '#' }, + { id: '14', text: 'Second level L', url: '#' }, + { id: '15', text: 'Second level M', url: '#' }, + { id: '16', text: 'Second level N', url: '#' }, + { id: '17', text: 'Second level O', url: '#' }, + { id: '18', text: 'Second level P', url: '#' }, + { id: '19', text: 'Second level Q', url: '#' } + ] + }, + { + id: '20', + text: 'First level B', + url: '#', + items: [ + { + id: '21', + text: 'Second level', + url: '#', + items: [ + { + id: '22', + text: 'Third level link with some text that will need to wrap', + url: '#', + items: [{ id: '23', text: 'Fourth level', url: '#' }] + }, + { + id: '22.5', + text: 'Another third level link', + url: '#' + } + ] + }, + { id: '24', text: 'Second level', url: '#' }, + { id: '25', text: 'Second level', url: '#' } + ] + }, + { id: '26', text: 'First level C', url: '#' }, + { + id: '27', + text: 'First level D', + url: '#', + items: [ + { + id: '28', + text: 'Second level', + url: '#', + items: [ + { + id: '29', + text: 'Third level link with some text that will need to wrap', + url: '#', + items: [{ id: '30', text: 'Fourth level', url: '#' }] + } + ] + }, + { id: '31', text: 'Second level', url: '#' }, + { id: '32', text: 'Second level', url: '#' } + ] + }, + { id: '26', text: 'First level E', url: '#' } +] +primaryNav.items = navItems +primaryNav.primaryLogo = { + href: '#', + altText: 'Primary logo alt text' +} diff --git a/examples/webcomponents/index.html b/examples/webcomponents/index.html index bf5c1bc2b3..c71a6d5a93 100644 --- a/examples/webcomponents/index.html +++ b/examples/webcomponents/index.html @@ -5,18 +5,59 @@
- A short paragraph with a
-
+ A short paragraph with a
+