@ulu/frontend-vue 0.1.0-beta.1

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.
Files changed (115) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +9 -0
  3. package/dist/breakpoints-ClT9bfZm.js +211 -0
  4. package/dist/frontend-vue.css +1 -0
  5. package/dist/frontend-vue.js +82 -0
  6. package/dist/frontend-vue.umd.cjs +561 -0
  7. package/dist/index-P5Rwl_Dl.js +7263 -0
  8. package/dist/index.es-HlG3u0J5.js +3134 -0
  9. package/lib/_index.scss +14 -0
  10. package/lib/components/_index.scss +6 -0
  11. package/lib/components/collapsible/UluAccordion.vue +82 -0
  12. package/lib/components/collapsible/UluCollapsibleRegion.vue +278 -0
  13. package/lib/components/collapsible/UluDropdown.vue +42 -0
  14. package/lib/components/collapsible/UluModal.vue +384 -0
  15. package/lib/components/collapsible/UluOverflowPopover.vue +52 -0
  16. package/lib/components/collapsible/UluTab.vue +9 -0
  17. package/lib/components/collapsible/UluTabGroup.vue +31 -0
  18. package/lib/components/collapsible/UluTabList.vue +9 -0
  19. package/lib/components/collapsible/UluTabPanel.vue +9 -0
  20. package/lib/components/collapsible/UluTabPanels.vue +9 -0
  21. package/lib/components/elements/UluAlert.vue +81 -0
  22. package/lib/components/elements/UluBadge.vue +58 -0
  23. package/lib/components/elements/UluBadgeStack.vue +27 -0
  24. package/lib/components/elements/UluButton.vue +161 -0
  25. package/lib/components/elements/UluCallout.vue +30 -0
  26. package/lib/components/elements/UluCard.vue +241 -0
  27. package/lib/components/elements/UluDefinitionList.vue +40 -0
  28. package/lib/components/elements/UluExternalLink.vue +47 -0
  29. package/lib/components/elements/UluIcon.vue +108 -0
  30. package/lib/components/elements/UluList.vue +87 -0
  31. package/lib/components/elements/UluMain.vue +5 -0
  32. package/lib/components/elements/UluSpokeSpinner.vue +25 -0
  33. package/lib/components/elements/UluTag.vue +53 -0
  34. package/lib/components/forms/UluCheckboxMenu.vue +36 -0
  35. package/lib/components/forms/UluFileDisplay.vue +39 -0
  36. package/lib/components/forms/UluFormDropzone.vue +62 -0
  37. package/lib/components/forms/UluFormFile.vue +47 -0
  38. package/lib/components/forms/UluFormMessage.vue +20 -0
  39. package/lib/components/forms/UluFormSelect.vue +37 -0
  40. package/lib/components/forms/UluFormText.vue +32 -0
  41. package/lib/components/forms/UluSearchForm.vue +31 -0
  42. package/lib/components/index.js +54 -0
  43. package/lib/components/layout/UluAdaptiveLayout.vue +11 -0
  44. package/lib/components/layout/UluDataGrid.vue +41 -0
  45. package/lib/components/layout/UluTitleRail.vue +56 -0
  46. package/lib/components/layout/UluWhenBreakpoint.vue +86 -0
  47. package/lib/components/navigation/UluBreadcrumb.vue +72 -0
  48. package/lib/components/navigation/UluMenu.vue +105 -0
  49. package/lib/components/navigation/UluMenuStack.vue +49 -0
  50. package/lib/components/navigation/UluNavStrip.vue +48 -0
  51. package/lib/components/navigation/UluSkipLink.vue +5 -0
  52. package/lib/components/systems/facets/UluFacets.vue +380 -0
  53. package/lib/components/systems/facets/UluFacetsList.vue +39 -0
  54. package/lib/components/systems/facets/UluFacetsSearch.vue +67 -0
  55. package/lib/components/systems/facets/_facets.scss +64 -0
  56. package/lib/components/systems/index.js +17 -0
  57. package/lib/components/systems/scroll-anchors/UluScrollAnchors.vue +152 -0
  58. package/lib/components/systems/scroll-anchors/UluScrollAnchorsNav.vue +37 -0
  59. package/lib/components/systems/scroll-anchors/UluScrollAnchorsNavAnimated.vue +124 -0
  60. package/lib/components/systems/scroll-anchors/UluScrollAnchorsSection.vue +63 -0
  61. package/lib/components/systems/scroll-anchors/symbols.js +6 -0
  62. package/lib/components/systems/skeleton/UluShowSkeleton.vue +13 -0
  63. package/lib/components/systems/skeleton/UluSkeletonContent.vue +60 -0
  64. package/lib/components/systems/skeleton/UluSkeletonMedia.vue +11 -0
  65. package/lib/components/systems/skeleton/UluSkeletonTextInline.vue +9 -0
  66. package/lib/components/systems/slider/UluImageSlideShow.vue +75 -0
  67. package/lib/components/systems/slider/UluSlideShow.vue +331 -0
  68. package/lib/components/systems/slider/UluSlideShowSlide.vue +25 -0
  69. package/lib/components/systems/table-sticky/UluTableSticky.vue +793 -0
  70. package/lib/components/systems/table-sticky/UluTableStickyRows.vue +73 -0
  71. package/lib/components/systems/table-sticky/UluTableStickyTable.vue +237 -0
  72. package/lib/components/systems/table-sticky/_table-sticky.scss +185 -0
  73. package/lib/components/utils/UluCondText.vue +28 -0
  74. package/lib/components/utils/UluEmpty.vue +3 -0
  75. package/lib/components/utils/UluEmptyView.vue +3 -0
  76. package/lib/components/utils/UluPlaceholderImage.vue +53 -0
  77. package/lib/components/utils/UluPlaceholderText.vue +25 -0
  78. package/lib/components/utils/UluRouteAnnouncer.vue +83 -0
  79. package/lib/components/visualizations/UluAnimateNumber.vue +32 -0
  80. package/lib/components/visualizations/UluProgressBar.vue +94 -0
  81. package/lib/components/visualizations/UluProgressDonut.vue +97 -0
  82. package/lib/composables/index.js +10 -0
  83. package/lib/composables/useBreakpointManager.js +68 -0
  84. package/lib/composables/useIcon.js +62 -0
  85. package/lib/composables/useModifiers.js +93 -0
  86. package/lib/composables/useWindowResize.js +64 -0
  87. package/lib/index.js +10 -0
  88. package/lib/plugins/_index.scss +7 -0
  89. package/lib/plugins/breakpoints/index.js +47 -0
  90. package/lib/plugins/index.js +11 -0
  91. package/lib/plugins/modals/UluModalsDisplay.vue +59 -0
  92. package/lib/plugins/modals/api.js +76 -0
  93. package/lib/plugins/modals/index.js +60 -0
  94. package/lib/plugins/modals/useModals.js +9 -0
  95. package/lib/plugins/popovers/UluPopover.vue +189 -0
  96. package/lib/plugins/popovers/UluTooltipDisplay.vue +15 -0
  97. package/lib/plugins/popovers/UluTooltipPopover.vue +83 -0
  98. package/lib/plugins/popovers/defaults.js +108 -0
  99. package/lib/plugins/popovers/directive.js +95 -0
  100. package/lib/plugins/popovers/index.js +18 -0
  101. package/lib/plugins/popovers/manager.js +54 -0
  102. package/lib/plugins/popovers/useFollow.js +80 -0
  103. package/lib/plugins/popovers/utils.js +5 -0
  104. package/lib/plugins/toast/UluToast.vue +87 -0
  105. package/lib/plugins/toast/UluToastDisplay.vue +35 -0
  106. package/lib/plugins/toast/_toast.scss +198 -0
  107. package/lib/plugins/toast/defaults.js +30 -0
  108. package/lib/plugins/toast/index.js +17 -0
  109. package/lib/plugins/toast/store.js +71 -0
  110. package/lib/plugins/toast/useToast.js +18 -0
  111. package/lib/settings.js +119 -0
  112. package/lib/utils/dom.js +14 -0
  113. package/lib/utils/placeholder.js +6 -0
  114. package/lib/utils/vue-router.js +219 -0
  115. package/package.json +75 -0
@@ -0,0 +1,86 @@
1
+ <template>
2
+ <slot v-if="shouldShow" />
3
+ </template>
4
+
5
+ <script>
6
+ export default {
7
+ name: "UluWhenBreakpoint",
8
+ inject: ["uluBreakpointManager"],
9
+ props: {
10
+ max: String,
11
+ min: String,
12
+ only: String,
13
+ },
14
+ data() {
15
+ return {
16
+ conditions: {},
17
+ handlers: [],
18
+ handlersSetup: false,
19
+ };
20
+ },
21
+ computed: {
22
+ shouldShow() {
23
+ if (!this.handlersSetup) return false;
24
+ const props = ['max', 'min', 'only'].filter(p => this[p]);
25
+ if (props.length === 0) {
26
+ return false;
27
+ }
28
+ return Object.values(this.conditions).every(c => c);
29
+ },
30
+ propsIdentifier() {
31
+ return `${this.max || ''}-${this.min || ''}-${this.only || ''}`;
32
+ }
33
+ },
34
+ watch: {
35
+ uluBreakpointManager: {
36
+ handler(manager) {
37
+ if (manager && !this.handlersSetup) {
38
+ this.setupHandlers(manager);
39
+ }
40
+ },
41
+ immediate: true
42
+ },
43
+ propsIdentifier() {
44
+ if (this.uluBreakpointManager && this.handlersSetup) {
45
+ this.tearDownHandlers();
46
+ this.setupHandlers(this.uluBreakpointManager);
47
+ }
48
+ }
49
+ },
50
+ methods: {
51
+ setupHandlers(manager) {
52
+ const setupCondition = (direction) => {
53
+ const breakpointName = this[direction];
54
+ if (breakpointName) {
55
+ this.conditions[direction] = false;
56
+ const handler = {
57
+ on: () => { this.conditions[direction] = true; },
58
+ off: () => { this.conditions[direction] = false; },
59
+ };
60
+ manager.at(breakpointName)[direction](handler);
61
+ this.handlers.push({ name: breakpointName, direction, handler });
62
+ }
63
+ };
64
+
65
+ setupCondition('max');
66
+ setupCondition('min');
67
+ setupCondition('only');
68
+
69
+ this.handlersSetup = true;
70
+ },
71
+ tearDownHandlers() {
72
+ if (this.uluBreakpointManager) {
73
+ this.handlers.forEach(({ name, direction, handler }) => {
74
+ this.uluBreakpointManager.at(name).remove(handler, direction);
75
+ });
76
+ }
77
+ this.handlers = [];
78
+ this.conditions = {};
79
+ this.handlersSetup = false;
80
+ }
81
+ },
82
+ beforeUnmount() {
83
+ this.tearDownHandlers();
84
+ },
85
+ };
86
+ </script>
@@ -0,0 +1,72 @@
1
+ <template>
2
+ <nav
3
+ :class="classes.nav"
4
+ aria-label="Breadcrumb"
5
+ v-if="items.length"
6
+ >
7
+ <ul :class="classes.list">
8
+ <li v-for="(item, index) in items" :key="index" :class="classes.item">
9
+ <router-link
10
+ :to="item.to"
11
+ :class="classes.link"
12
+ :aria-current="item.current ? 'page' : null"
13
+ >
14
+ <slot :item="item">
15
+ {{ item.title }}
16
+ </slot>
17
+ </router-link>
18
+ <template v-if="index < items.length - 1">
19
+ <slot name="separator">
20
+ <UluIcon
21
+ :class="classes.separator"
22
+ type="pathSeparator"
23
+ :definition="separatorIcon"
24
+ />
25
+ </slot>
26
+ </template>
27
+ </li>
28
+ </ul>
29
+ </nav>
30
+ </template>
31
+
32
+ <script>
33
+ import UluIcon from '../elements/UluIcon.vue';
34
+ /**
35
+ * Breadcrumb trail component
36
+ * - Is now agnostic of router, pass precomputed breadcrumb trail via items prop
37
+ */
38
+ export default {
39
+ name: 'UluBreadcrumb',
40
+ components: {
41
+ UluIcon
42
+ },
43
+ props: {
44
+ /**
45
+ * Array of breadcrumb items.
46
+ * Each item is an object: { title: String, to: [String, Object], current: Boolean }
47
+ */
48
+ items: {
49
+ type: Array,
50
+ default: () => []
51
+ },
52
+ /**
53
+ * Icon to use as a separator.
54
+ */
55
+ separatorIcon: String,
56
+ /**
57
+ * Classes object to be applied to elements.
58
+ * Keys: nav, list, item, link, icon
59
+ */
60
+ classes: {
61
+ type: Object,
62
+ default: () => ({
63
+ nav: "breadcrumb",
64
+ list: "breadcrumb__list",
65
+ item: "breadcrumb__item",
66
+ link: "breadcrumb__link",
67
+ separator: "breadcrumb__separator"
68
+ })
69
+ }
70
+ }
71
+ }
72
+ </script>
@@ -0,0 +1,105 @@
1
+ <template>
2
+ <ul v-if="items?.length" :class="classes.list">
3
+ <li
4
+ v-for="(item, index) in items"
5
+ :key="index"
6
+ :class="[classes.item, item?.classes?.item]"
7
+ >
8
+ <!--
9
+ Note: The ternary spread method below is conditionally adding certain
10
+ props/handlers for each of the different element types.
11
+ -->
12
+ <component
13
+ :is="item.to || item.path ? 'router-link' : item.click ? 'button' : 'a'"
14
+ v-bind="{
15
+ ...(item.to || item.path ? { to: item.to || item.path } : {}),
16
+ ...(item.href ? { 'href' : item.href || '#' } : {}),
17
+ }"
18
+ @click="(event) => { handleItemClick(event, item) }"
19
+ :class="[classes.link, item?.classes?.link]"
20
+ :activeClass="classes.linkActive"
21
+ :exactActiveClass="classes.linkExactActive"
22
+ :aria-label="iconOnly ? item.title : null"
23
+ :id="item.id"
24
+ v-ulu-tooltip="iconOnly ? item.title : item.tooltip || null"
25
+ >
26
+ <slot :item="item" :index="index">
27
+ <UluIcon
28
+ v-if="item.icon"
29
+ :definition="item.icon"
30
+ :class="[classes.linkIcon, item?.classes?.linkIcon]"
31
+ />
32
+ <span :class="[classes.linkText, item?.classes?.linkText]">{{ item.title }}</span>
33
+ <UluTag v-if="item.tag" v-bind="item.tag"/>
34
+ </slot>
35
+ </component>
36
+ <!-- Component calls itself recursively for children if allowed (noChildren) -->
37
+ <UluMenu v-if="!noChildren && item?.children?.length"
38
+ :iconOnly="iconOnly"
39
+ :classes="classes"
40
+ :items="item.children"
41
+ />
42
+ </li>
43
+ </ul>
44
+ </template>
45
+
46
+ <script>
47
+ import UluIcon from "../elements/UluIcon.vue";
48
+ import UluTag from "../elements/UluTag.vue";
49
+ /**
50
+ * Reusable menu component (ul > li > [a/button/router-link])
51
+ * - Requires ulu tooltip plugin (as items themselves can have tooltips)
52
+ */
53
+ export default {
54
+ name: "UluMenu",
55
+ components: {
56
+ UluIcon,
57
+ UluTag
58
+ },
59
+ emits: [
60
+ /**
61
+ * Fired anytime a item is clicked
62
+ */
63
+ "itemClick"
64
+ ],
65
+ props: {
66
+ /**
67
+ * Items Array of Objects for each link
68
+ * [{
69
+ * title: String (title of link)
70
+ * icon: Icon definition passed to UluIcon
71
+ * tag: Tag appearing after link text (count/etc), pass props you want bound to tag
72
+ * tooltip: Add tooltip to menu item (pass options for tooltip), unless iconOnly than the title is presented in the tooltip
73
+ * href: Will result in <a>
74
+ * click: Will be called on click and result in <button>
75
+ * to: Will result in <a> and use vue-router router-link component
76
+ * }]
77
+ */
78
+ items: Array,
79
+ /**
80
+ * Classes object to add class bindings to the different elements
81
+ * - { list, item, link, linkActive, linkExactActive, linkIcon, linkText }
82
+ */
83
+ classes: {
84
+ type: Object,
85
+ default: () => ({})
86
+ },
87
+ /**
88
+ * Use icon only version of menu
89
+ */
90
+ iconOnly: Boolean,
91
+ /**
92
+ * Do not print menu items children recursively
93
+ */
94
+ noChildren: Boolean
95
+ },
96
+ methods: {
97
+ handleItemClick(event, item) {
98
+ if (item.click) {
99
+ item.click(event);
100
+ }
101
+ this.$emit("itemClick", { item, event });
102
+ }
103
+ }
104
+ };
105
+ </script>
@@ -0,0 +1,49 @@
1
+ <template>
2
+ <nav
3
+ class="menu-stack"
4
+ :class="{
5
+ 'menu-stack--hanging' : hanging,
6
+ 'menu-stack--compact' : compact
7
+ }"
8
+ >
9
+ <UluMenu
10
+ :items="items"
11
+ :classes="{
12
+ list: 'menu-stack__list',
13
+ item: 'menu-stack__item',
14
+ link: 'menu-stack__link',
15
+ linkText: 'menu-stack__link-text',
16
+ linkIcon: 'menu-stack__link-icon'
17
+ }"
18
+ :noChildren="noChildren"
19
+ />
20
+ </nav>
21
+ </template>
22
+
23
+ <script>
24
+ import UluMenu from "./UluMenu.vue";
25
+ export default {
26
+ name: "UluMenuStack",
27
+ components: {
28
+ UluMenu
29
+ },
30
+ props: {
31
+ /**
32
+ * Menu item (see UluMenu)
33
+ */
34
+ items: Array,
35
+ /**
36
+ * Hanging style menu
37
+ */
38
+ hanging: Boolean,
39
+ /**
40
+ * Compact style menu
41
+ */
42
+ compact: Boolean,
43
+ /**
44
+ * Don't include children of menu
45
+ */
46
+ noChildren: Boolean
47
+ }
48
+ };
49
+ </script>
@@ -0,0 +1,48 @@
1
+ <template>
2
+ <nav
3
+ class="nav-strip"
4
+ :class="{
5
+ 'nav-strip--rule' : rule,
6
+ 'nav-strip--center' : center,
7
+ 'nav-strip--right' : right
8
+ }"
9
+ >
10
+ <UluMenu
11
+ :items="items"
12
+ :classes="{
13
+ list: 'nav-strip__list',
14
+ item: 'nav-strip__item',
15
+ link: 'nav-strip__link',
16
+ linkExactActive: 'is-active'
17
+ }"
18
+ />
19
+ </nav>
20
+ </template>
21
+
22
+ <script>
23
+ import UluMenu from "./UluMenu.vue";
24
+ export default {
25
+ name: "UluNavStrip",
26
+ components: {
27
+ UluMenu
28
+ },
29
+ props: {
30
+ /**
31
+ * Array of items for list (uses UluMenu, see structure there)
32
+ */
33
+ items: Array,
34
+ /**
35
+ * Center aligned
36
+ */
37
+ center: Boolean,
38
+ /**
39
+ * Right aligned
40
+ */
41
+ right: Boolean,
42
+ /**
43
+ * Rule nav strip style
44
+ */
45
+ rule: Boolean
46
+ },
47
+ };
48
+ </script>
@@ -0,0 +1,5 @@
1
+ <template>
2
+ <a class="site-skip-link hidden-visually-focusable" href="#main-content">
3
+ Skip to main content
4
+ </a>
5
+ </template>