@sbc-connect/nuxt-base 0.1.3 → 0.1.5

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 (43) hide show
  1. package/.env.example +11 -1
  2. package/CHANGELOG.md +54 -0
  3. package/LICENSE +28 -0
  4. package/README.md +36 -47
  5. package/app/app.config.ts +56 -138
  6. package/app/app.vue +16 -3
  7. package/app/components/Connect/BCGovLogo.vue +4 -4
  8. package/app/components/Connect/Breadcrumb.vue +61 -0
  9. package/app/components/Connect/Footer.vue +104 -0
  10. package/app/components/Connect/Header/LogoHomeLink.vue +4 -4
  11. package/app/components/Connect/Header/WhatsNew.vue +36 -0
  12. package/app/components/Connect/Header/Wrapper.vue +3 -3
  13. package/app/components/Connect/Header/index.vue +16 -1
  14. package/app/components/Connect/I18n/Helper.vue +24 -0
  15. package/app/components/Connect/Input.vue +32 -0
  16. package/app/components/Connect/LocaleSelect.vue +1 -1
  17. package/app/components/Connect/PageSection.vue +57 -0
  18. package/app/components/Connect/Slideover/WhatsNew.vue +61 -0
  19. package/app/components/Connect/Spinner.vue +94 -0
  20. package/app/components/Connect/SystemBanner.vue +50 -0
  21. package/app/components/Connect/Textarea.vue +30 -0
  22. package/app/composables/useConnectLaunchDarkly.ts +177 -0
  23. package/app/error.vue +53 -0
  24. package/app/interfaces/connect-breadcrumb.ts +5 -0
  25. package/app/interfaces/connect-whatsnew.ts +14 -0
  26. package/app/layouts/{default.vue → ConnectBase.vue} +3 -0
  27. package/app/plugins/launchdarkly.client.ts +9 -0
  28. package/app/plugins/maska.client.ts +10 -0
  29. package/app/plugins/sanitize.client.ts +13 -0
  30. package/app/plugins/whats-new.client.ts +45 -0
  31. package/app/spa-loading-template.html +61 -0
  32. package/app/types/base-app-config.d.ts +15 -0
  33. package/app/types/base-page-meta.d.ts +8 -0
  34. package/app/utils/appendUrlParam.ts +4 -0
  35. package/app/utils/parseSpecialCharacters.ts +25 -0
  36. package/app/utils/setBreadcrumbs.ts +5 -0
  37. package/i18n/locales/en-CA.ts +53 -84
  38. package/i18n/locales/fr-CA.ts +33 -30
  39. package/modules/assets/index.ts +1 -1
  40. package/modules/assets/runtime/assets/core-tw.css +61 -32
  41. package/nuxt.config.ts +80 -1
  42. package/package.json +20 -9
  43. package/app/components/Connect/Header/Base.vue +0 -17
package/.env.example CHANGED
@@ -1 +1,11 @@
1
- NUXT_BASE_URL="http://localhost:3000/"
1
+ # Web Urls
2
+ NUXT_PUBLIC_BASE_URL="http://localhost:3000/"
3
+ NUXT_PUBLIC_REGISTRY_HOME_URL="https://dev.bcregistry.gov.bc.ca/"
4
+
5
+ # API Urls
6
+ # Status API
7
+ NUXT_PUBLIC_STATUS_API_URL="https://status-api-dev.apps.gold.devops.gov.bc.ca"
8
+ NUXT_PUBLIC_STATUS_API_VERSION="/api/v1"
9
+
10
+ # LaunchDarkly
11
+ NUXT_PUBLIC_LD_CLIENT_ID=""
package/CHANGELOG.md CHANGED
@@ -1,5 +1,59 @@
1
1
  # @sbc-connect/nuxt-base
2
2
 
3
+ ## 0.1.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [#19](https://github.com/bcgov/connect-nuxt/pull/19) [`4231254`](https://github.com/bcgov/connect-nuxt/commit/42312540f5eec65f5d3979d5492bdfaa9bb0b079) Thanks [@deetz99](https://github.com/deetz99)! - Several components and utils
8
+
9
+ - ConnectInput
10
+ - ConnectTextarea
11
+ - ConnectI18nHelper
12
+ - ConnectSpinner
13
+ - ConnectPageSection
14
+ - parseSpecialCharacters util
15
+ - setBreadcrumbs util
16
+ - set nuxt ui default icons to use mdi instead of lucide icons
17
+
18
+ issue: bcgov/entity#29334
19
+
20
+ ## 0.1.4
21
+
22
+ ### Patch Changes
23
+
24
+ - [#18](https://github.com/bcgov/connect-nuxt/pull/18) [`90f240f`](https://github.com/bcgov/connect-nuxt/commit/90f240fd789a5286ded5df710bddd6dc953bcba5) Thanks [@deetz99](https://github.com/deetz99)! - **Feat: Whats New**
25
+
26
+ - fetch whats new inside a plugin
27
+ - whats new header button
28
+ - whats new slideover component
29
+ - whats new plugin tests
30
+ - fix eslint to ignore playwright reports
31
+ - whats new items tracked in local storage to display button chip or not
32
+
33
+ issue: bcgov/entity#29334
34
+
35
+ - [#15](https://github.com/bcgov/connect-nuxt/pull/15) [`0fb8c54`](https://github.com/bcgov/connect-nuxt/commit/0fb8c54e059d78b246b80a03f049d075b7bbcf72) Thanks [@deetz99](https://github.com/deetz99)! - - add spa-loading-template
36
+
37
+ - add error.vue
38
+ - add html attrs to app.vue
39
+ - add launch darkly composable & start tests
40
+ - add Banner component
41
+ - add iconify dep and icons to client bundle
42
+ - add test:unit:watch command to run vitest in watch mode
43
+ - update vitest config to search nested folders
44
+ - update --ui-radius var so rounded-md is 0.25rem
45
+ - remove core main css file causing duplicate fonts
46
+ - add html sanitizer plugin
47
+
48
+ issue: bcgov/entity#29334
49
+
50
+ - [#16](https://github.com/bcgov/connect-nuxt/pull/16) [`9b8c225`](https://github.com/bcgov/connect-nuxt/commit/9b8c225a011e3c89c9b490e93a554f55a4e29b78) Thanks [@kialj876](https://github.com/kialj876)! - - add base header components (logo, localeSelect, wrapper)
51
+
52
+ - add footer component
53
+ - appendUrlParam util
54
+
55
+ issue: bcgov/entity#29334
56
+
3
57
  ## 0.1.3
4
58
 
5
59
  ### Patch Changes
package/LICENSE ADDED
@@ -0,0 +1,28 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2025, bcgov
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+
8
+ 1. Redistributions of source code must retain the above copyright notice, this
9
+ list of conditions and the following disclaimer.
10
+
11
+ 2. Redistributions in binary form must reproduce the above copyright notice,
12
+ this list of conditions and the following disclaimer in the documentation
13
+ and/or other materials provided with the distribution.
14
+
15
+ 3. Neither the name of the copyright holder nor the names of its
16
+ contributors may be used to endorse or promote products derived from
17
+ this software without specific prior written permission.
18
+
19
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package/README.md CHANGED
@@ -1,73 +1,62 @@
1
- # Nuxt Layer Starter
1
+ [![License](https://img.shields.io/badge/License-BSD%203%20Clause-blue.svg)](LICENSE) [![pkg.pr.new](https://pkg.pr.new/badge/OWNER/REPO)](https://pkg.pr.new/~/bcgov/connect-nuxt)
2
2
 
3
- Create Nuxt extendable layer with this GitHub template.
3
+ # @sbc-connect/nuxt-base
4
+ The foundational Nuxt layer for all Connect applications.
4
5
 
5
- ## Setup
6
+ This package contains the core UI components, styling, and utilities for the Connect ecosystem. Extend this layer in your Nuxt project to get a consistent, on-brand starting point with zero configuration.
6
7
 
7
- Make sure to install the dependencies:
8
+ ## Features
8
9
 
9
- ```bash
10
- pnpm install
11
- ```
12
-
13
- ## Working on your layer
14
-
15
- Your layer is at the root of this repository, it is exactly like a regular Nuxt project, except you can publish it on NPM.
16
-
17
- The `.playground` directory should help you on trying your layer during development.
10
+ ### BC Government Branding
11
+ - Official color theme and design tokens
12
+ - BCSans font family with pre-configured @font-face rules
13
+ - BC Government logos and favicon assets
18
14
 
19
- Running `pnpm dev` will prepare and boot `.playground` directory, which imports your layer itself.
15
+ ### Core Development Assets
16
+ - A library of reusable base components
17
+ - Essential composables for common application logic
18
+ - Standard utility functions
19
+ - Pre-configured for Internationalization (i18n)
20
20
 
21
- ## Distributing your layer
22
-
23
- Your Nuxt layer is shaped exactly the same as any other Nuxt project, except you can publish it on NPM.
24
-
25
- To do so, you only have to check if `files` in `package.json` are valid, then run:
26
-
27
- ```bash
28
- npm publish --access public
29
- ```
21
+ For detailed usage and documentation, please see the [Base Layer Docs](../../../docs/packages/layers/base/intro.md)
30
22
 
31
- Once done, your users will only have to run:
23
+ ## Usage
32
24
 
25
+ ### Install
33
26
  ```bash
34
- npm install --save your-layer
27
+ pnpm install @sbc-connect/nuxt-base
35
28
  ```
36
29
 
37
- Then add the dependency to their `extends` in `nuxt.config`:
30
+ ### Configure
31
+ Then add the dependency to `extends` in `nuxt.config`:
38
32
 
39
33
  ```ts
40
34
  defineNuxtConfig({
41
- extends: 'your-layer'
35
+ extends: '@sbc-connect/nuxt-base'
42
36
  })
43
37
  ```
44
38
 
45
- ## Development Server
39
+ ### Environment Variables
40
+ This project requires certain environment variables to be set to run correctly.
46
41
 
47
- Start the development server on http://localhost:3000
42
+ Create a file named .env in the root of the project.
48
43
 
49
- ```bash
50
- pnpm dev
51
- ```
52
-
53
- ## Production
44
+ Copy the contents of the .env.example file into your new .env file.
54
45
 
55
- Build the application for production:
46
+ #### Local Development
47
+ For local development, the following variables are required. The default values are suitable for running the application on your local machine:
56
48
 
57
- ```bash
58
- pnpm build
59
49
  ```
60
-
61
- Or statically generate it with:
62
-
63
- ```bash
64
- pnpm generate
50
+ # .env
51
+ NUXT_BASE_URL="http://localhost:3000/"
65
52
  ```
66
53
 
67
- Locally preview production build:
54
+ #### Production Environments
55
+ > [!IMPORTANT]
56
+ > The values for staging and production environments are managed securely and should not be stored in this file.
68
57
 
69
- ```bash
70
- pnpm preview
71
- ```
58
+ To obtain the correct values for a production build or deployment, please contact the Connect Platform Team.
59
+
60
+ ## Contributing
72
61
 
73
- Checkout the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information.
62
+ We welcome contributions to this package! Please see the main [Contribution Guidelines](../../../CONTRIBUTING.md) for information on our branching strategy, commit conventions, and pull request process.
package/app/app.config.ts CHANGED
@@ -2,105 +2,76 @@
2
2
  export default defineAppConfig({
3
3
  connect: {
4
4
  header: {
5
- localeSelect: true
5
+ localeSelect: true,
6
+ whatsNew: true
6
7
  },
7
8
  footer: {
8
9
  versions: []
9
10
  }
10
11
  },
11
12
  ui: {
12
- badge: {
13
+ breadcrumb: {
13
14
  slots: {
14
- base: 'font-medium inline-flex items-center',
15
- label: 'truncate font-bold',
16
- leadingIcon: 'shrink-0',
17
- leadingAvatar: 'shrink-0',
18
- leadingAvatarSize: '',
19
- trailingIcon: 'shrink-0'
20
- }
21
- },
22
- button: {
15
+ separatorIcon: 'text-secondary'
16
+ },
17
+ variants: {
18
+ active: {
19
+ true: {
20
+ link: 'text-secondary font-medium'
21
+ },
22
+ false: {
23
+ link: 'text-secondary underline font-medium'
24
+ }
25
+ }
26
+ },
23
27
  compoundVariants: [
24
28
  {
25
- color: 'primary',
26
- variant: 'solid',
27
- class: 'font-bold text-(--ui-bg) bg-(--ui-primary) hover:bg-(--ui-primary)/75 disabled:bg-(--ui-primary) aria-disabled:bg-(--ui-primary) focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-(--ui-primary)'
28
- },
29
- {
30
- color: 'primary',
31
- variant: 'ghost',
32
- class: 'text-(--ui-primary) hover:bg-(--ui-primary)/10 active:bg-(--ui-primary)/25 focus:outline-none focus-visible:bg-(--ui-primary)/10 disabled:bg-transparent aria-disabled:bg-transparent dark:disabled:bg-transparent dark:aria-disabled:bg-transparent'
29
+ disabled: false,
30
+ active: false,
31
+ to: true,
32
+ class: {
33
+ link: 'hover:text-secondary hover:underline transition-colors'
34
+ }
33
35
  }
34
36
  ]
35
37
  },
36
- buttonGroup: {
37
- base: 'relative',
38
- variants: {
39
- size: {
40
- xs: '',
41
- sm: '',
42
- md: '',
43
- lg: '',
44
- xl: ''
45
- },
46
- orientation: {
47
- horizontal: 'inline-flex -space-x-px divide-x divide-gray-300',
48
- vertical: 'flex flex-col -space-y-px'
49
- }
38
+ button: {
39
+ slots: {
40
+ base: 'cursor-pointer'
50
41
  }
51
42
  },
52
- checkbox: {
43
+ card: {
53
44
  slots: {
54
- root: 'relative flex items-start',
55
- base: 'shrink-0 flex items-center justify-center rounded-(--ui-radius) text-(--ui-bg) ring-2 ring-inset ring-gray-700 focus-visible:outline-2 focus-visible:outline-offset-2',
56
- label: 'block font-medium text-(--ui-text) text-base'
45
+ root: 'rounded-md'
57
46
  }
58
47
  },
59
48
  dropdownMenu: {
60
49
  slots: {
61
- content: 'bg-white ring-0',
50
+ content: 'bg-secondary ring-0',
62
51
  group: 'p-0'
63
52
  }
64
53
  },
65
- formField: {
66
- slots: {
67
- root: '',
68
- wrapper: 'space-y-1',
69
- labelWrapper: 'flex content-center items-center justify-between',
70
- label: 'block font-bold text-base text-gray-900',
71
- container: 'mt-1 relative',
72
- description: 'text-(--ui-text) text-base text-bcGovColor-lightGray mb-4 whitespace-normal',
73
- error: 'pl-4.5 mt-1 text-(--ui-error) text-xs',
74
- hint: 'text-(--ui-text)',
75
- help: 'pl-4.5 mt-1 text-(--ui-text) text-xs'
76
- },
77
- variants: {
78
- size: {
79
- xs: {
80
- root: 'text-xs'
81
- },
82
- sm: {
83
- root: 'text-xs'
84
- },
85
- md: {
86
- root: 'text-sm'
87
- },
88
- lg: {
89
- root: 'text-sm'
90
- },
91
- xl: {
92
- root: 'text-base'
93
- }
94
- },
95
- required: {
96
- true: {
97
- label: 'after:content-[\'*\'] after:ms-0.5 after:text-(--ui-error)'
98
- }
99
- }
100
- },
101
- defaultVariants: {
102
- size: 'md'
103
- }
54
+ icons: {
55
+ arrowLeft: 'i-mdi-arrow-left',
56
+ arrowRight: 'i-mdi-arrow-right',
57
+ check: 'i-mdi-check',
58
+ chevronDoubleLeft: 'i-mdi-chevron-double-left',
59
+ chevronDoubleRight: 'i-mdi-chevron-double-right',
60
+ chevronDown: 'i-mdi-menu-down',
61
+ chevronLeft: 'i-mdi-menu-left',
62
+ chevronRight: 'i-mdi-menu-right',
63
+ chevronUp: 'i-mdi-menu-up',
64
+ close: 'i-mdi-close',
65
+ ellipsis: 'i-mdi-dots-horizontal',
66
+ external: 'i-mdi-open-in-new',
67
+ file: 'i-mdi-file',
68
+ folder: 'i-mdi-folder',
69
+ folderOpen: 'i-mdi-folder-open',
70
+ loading: 'i-mdi-loading',
71
+ minus: 'i-mdi-minus',
72
+ plus: 'i-mdi-plus',
73
+ search: 'i-mdi-magnify',
74
+ upload: 'i-mdi-upload'
104
75
  },
105
76
  input: {
106
77
  variants: {
@@ -115,7 +86,7 @@ export default defineAppConfig({
115
86
  }
116
87
  },
117
88
  variant: {
118
- bcGov: 'ring-0 ring-transparent peer rounded-t-sm rounded-b-none bg-gray-100 shadow-bcGovInput focus:ring-0 focus:outline-none focus:shadow-bcGovInputFocus text-gray-900'
89
+ bcGov: 'ring-0 ring-transparent peer rounded-t-sm rounded-b-none bg-shadePrimary shadow-input focus:ring-0 focus:outline-none focus:shadow-inputFocus text-neutralDark'
119
90
  }
120
91
  },
121
92
  defaultVariants: {
@@ -124,51 +95,6 @@ export default defineAppConfig({
124
95
  variant: 'bcGov'
125
96
  }
126
97
  },
127
- modal: {
128
- variants: {
129
- fullscreen: {
130
- false: {
131
- content: 'max-w-2xl'
132
- }
133
- }
134
- }
135
- },
136
- select: {
137
- slots: {
138
- content: 'rounded-sm',
139
- group: 'px-0 py-2',
140
- trailingIcon: 'group-data-[state=open]:rotate-180 transition-transform duration-200 text-(--ui-text)', // group-data-[state=open]:text-blue-500 group-data-focus:text-blue-500 // TODO: icon colour when focused
141
- item: 'my-0.75 text-gray-900 before:rounded-none data-highlighted:text-blue-500 data-highlighted:before:bg-gray-100 data-[state=checked]:text-blue-500 data-[state=checked]:bg-blue-50',
142
- itemLeadingIcon: 'group-data-[state=checked]:text-blue-500 group-data-highlighted:text-blue-500 text-gray-900'
143
- },
144
- variants: {
145
- size: {
146
- bcGov: {
147
- base: 'px-0 py-0 text-base gap-1.5',
148
- leading: 'ps-2.5',
149
- trailing: 'pe-2.5',
150
- leadingIcon: 'size-5',
151
- leadingAvatarSize: '2xs',
152
- trailingIcon: 'size-5',
153
- label: 'p-1.5 text-xs gap-1.5',
154
- item: 'py-3 px-4 text-sm gap-3',
155
- itemLeadingIcon: 'size-5',
156
- itemLeadingAvatarSize: '2xs',
157
- itemLeadingChip: 'size-5',
158
- itemLeadingChipSize: 'md',
159
- itemTrailingIcon: 'size-5'
160
- }
161
- },
162
- variant: {
163
- bcGov: 'peer rounded-t-sm rounded-b-none bg-gray-100 focus:ring-0 focus:outline-none shadow-bcGovInput data-[state=open]:shadow-bcGovInputFocus focus:shadow-bcGovInputFocus text-gray-900'
164
- }
165
- },
166
- defaultVariants: {
167
- size: 'bcGov',
168
- color: 'primary',
169
- variant: 'bcGov'
170
- }
171
- },
172
98
  textarea: {
173
99
  variants: {
174
100
  size: {
@@ -182,7 +108,7 @@ export default defineAppConfig({
182
108
  }
183
109
  },
184
110
  variant: {
185
- bcGov: 'peer rounded-t-sm rounded-b-none bg-gray-100 focus:ring-0 focus:outline-none shadow-bcGovInput focus:shadow-bcGovInputFocus text-gray-900'
111
+ bcGov: 'peer rounded-t-sm rounded-b-none bg-shadePrimary focus:ring-0 focus:outline-none shadow-input focus:shadow-inputFocus text-neutralDark'
186
112
  }
187
113
  },
188
114
  defaultVariants: {
@@ -190,20 +116,12 @@ export default defineAppConfig({
190
116
  color: 'primary',
191
117
  variant: 'bcGov'
192
118
  }
193
- }
194
- }
195
- })
196
-
197
- declare module '@nuxt/schema' {
198
- interface AppConfigInput {
199
- myLayer?: {
200
- /** Project name */
201
- name?: string
202
- }
203
- connect?: {
204
- header?: {
205
- localeSelect?: boolean
119
+ },
120
+ tooltip: {
121
+ slots: {
122
+ content: 'bg-neutral ring-neutral text-secondary p-4',
123
+ arrow: 'fill-neutral'
206
124
  }
207
125
  }
208
126
  }
209
- }
127
+ })
package/app/app.vue CHANGED
@@ -1,5 +1,18 @@
1
+ <script setup lang="ts">
2
+ const { localeProperties } = useI18n()
3
+
4
+ useHead({
5
+ htmlAttrs: {
6
+ lang: () => localeProperties.value.code,
7
+ dir: () => localeProperties.value.dir
8
+ }
9
+ })
10
+ </script>
11
+
1
12
  <template>
2
- <nuxt-layout>
3
- <nuxt-page />
4
- </nuxt-layout>
13
+ <UApp :toaster="{ position: 'bottom-center' }">
14
+ <NuxtLayout>
15
+ <NuxtPage />
16
+ </NuxtLayout>
17
+ </UApp>
5
18
  </template>
@@ -19,24 +19,24 @@ import enSmallLogo from 'BCGovLogoSmEn'
19
19
  <img
20
20
  class="hidden h-[60px] scale-125 sm:block"
21
21
  :src="frLargeLogo"
22
- :alt="$t('ConnectBCGovLogo.alt')"
22
+ :alt="$t('connect.label.bcGovLogo')"
23
23
  >
24
24
  <img
25
25
  class="block h-[64px] scale-125 sm:hidden"
26
26
  :src="frSmallLogo"
27
- :alt="$t('ConnectBCGovLogo.alt')"
27
+ :alt="$t('connect.label.bcGovLogo')"
28
28
  >
29
29
  </div>
30
30
  <div v-else class="shrink-0">
31
31
  <img
32
32
  class="hidden h-[60px] scale-125 sm:block"
33
33
  :src="enLargeLogo"
34
- :alt="$t('ConnectBCGovLogo.alt')"
34
+ :alt="$t('connect.label.bcGovLogo')"
35
35
  >
36
36
  <img
37
37
  class="block h-[64px] scale-150 sm:hidden"
38
38
  :src="enSmallLogo"
39
- :alt="$t('ConnectBCGovLogo.alt')"
39
+ :alt="$t('connect.label.bcGovLogo')"
40
40
  >
41
41
  </div>
42
42
  </template>
@@ -0,0 +1,61 @@
1
+ <script setup lang="ts">
2
+ const props = defineProps({ accountId: { type: String, required: false } })
3
+
4
+ const { t } = useI18n()
5
+
6
+ const breadcrumbs = computed<ConnectBreadcrumb[]>(() => {
7
+ const metaCrumbs = useRoute().meta.breadcrumbs as ConnectBreadcrumb[] | undefined
8
+
9
+ if (metaCrumbs) {
10
+ return metaCrumbs.map((bc) => {
11
+ if (bc.appendAccountId && props.accountId) {
12
+ return {
13
+ ...bc,
14
+ to: appendUrlParam(bc.to as string, 'accountid', props.accountId)
15
+ }
16
+ }
17
+ return bc
18
+ })
19
+ } else {
20
+ return [{ label: t('connect.breadcrumb.default') }]
21
+ }
22
+ })
23
+
24
+ function resolveBackHref() {
25
+ const bcLength = breadcrumbs.value.length
26
+
27
+ if (bcLength > 1) {
28
+ // return the second to last breadcrumb link
29
+ return breadcrumbs.value[bcLength - 2]?.to ?? breadcrumbs.value[bcLength - 2]?.href
30
+ } else {
31
+ return ''
32
+ }
33
+ }
34
+ </script>
35
+
36
+ <template>
37
+ <div
38
+ v-if="$route.meta.hideBreadcrumbs !== true"
39
+ class="bg-blue-350"
40
+ >
41
+ <div class="app-inner-container flex items-center p-2 sm:px-4 py-2 gap-3">
42
+ <UButton
43
+ class="size-[28px] rounded-full px-1 bg-secondary hover:bg-secondary/75"
44
+ :disabled="breadcrumbs.length < 2"
45
+ color="secondary"
46
+ icon="i-mdi-arrow-left"
47
+ :aria-label="$t('connect.label.goBack')"
48
+ :to="resolveBackHref()"
49
+ :ui="{
50
+ leadingIcon: 'text-blue-500',
51
+ }"
52
+ />
53
+ <div class="w-[1px] bg-shadePrimary h-[24px]" />
54
+ <UBreadcrumb
55
+ :items="breadcrumbs"
56
+ :aria-label="$t('connect.breadcrumb.arialabel')"
57
+ separator-icon="i-mdi-chevron-right"
58
+ />
59
+ </div>
60
+ </div>
61
+ </template>
@@ -0,0 +1,104 @@
1
+ <script setup lang="ts">
2
+ const rtc = useRuntimeConfig().public
3
+ const uiVersion = rtc.version
4
+ const feesUrl = `${rtc.registryHomeUrl}product-fees`
5
+ const dependencyVersions: string[] = useAppConfig().connect?.footer?.versions || []
6
+ const localePath = useLocalePath()
7
+ const links = [
8
+ {
9
+ label: 'connect.label.home',
10
+ to: localePath('/')
11
+ },
12
+ {
13
+ label: 'connect.label.releaseNotes',
14
+ to: 'https://www.release-notes.bcregistry.gov.bc.ca',
15
+ target: '_blank'
16
+ },
17
+ {
18
+ label: 'connect.label.fees',
19
+ to: feesUrl,
20
+ target: '_blank'
21
+ },
22
+ {
23
+ label: 'connect.label.disclaimer',
24
+ to: 'https://www2.gov.bc.ca/gov/content/home/disclaimer',
25
+ target: '_blank'
26
+ },
27
+ {
28
+ label: 'connect.label.privacy',
29
+ to: 'https://www2.gov.bc.ca/gov/content/home/privacy',
30
+ target: '_blank'
31
+ },
32
+ {
33
+ label: 'connect.label.accessibility',
34
+ to: 'https://www2.gov.bc.ca/gov/content/home/accessibility',
35
+ target: '_blank'
36
+ },
37
+ {
38
+ label: 'connect.label.copyright',
39
+ to: 'https://www2.gov.bc.ca/gov/content/home/copyright',
40
+ target: '_blank'
41
+ }
42
+ ]
43
+
44
+ const appVersions = computed<string[]>(() => {
45
+ const items = [...dependencyVersions]
46
+ if (uiVersion) {
47
+ items.unshift(uiVersion)
48
+ }
49
+ return items
50
+ })
51
+ </script>
52
+
53
+ <template>
54
+ <footer
55
+ id="connect-main-footer"
56
+ data-testid="connect-main-footer"
57
+ class="border-t-2 border-brandLight bg-brandDark"
58
+ >
59
+ <div class="app-inner-container flex items-center justify-between p-2">
60
+ <nav :aria-label="$t('connect.footer.navLabel')" class="flex grow">
61
+ <ul class="list-none flex-col gap-1 p-0 sm:-ml-2 sm:flex-row sm:flex-wrap">
62
+ <li
63
+ v-for="link in links"
64
+ :key="link.to"
65
+ :class="[
66
+ 'flex-col gap-2 border-r-0 pr-2 last:mr-0',
67
+ 'last:border-r-0 sm:mr-2 sm:inline-block sm:flex-none',
68
+ 'sm:border-r sm:first:ml-2 border-lineLight',
69
+ ]"
70
+ >
71
+ <NuxtLink
72
+ :to="link.to === '/' ? `/${$i18n.locale}` : link.to"
73
+ :target="link.target"
74
+ :class="[
75
+ 'rounded p-1 text-sm text-secondary',
76
+ 'hover:underline focus:outline-none',
77
+ 'focus-visible:ring-2 focus-visible:ring-secondary',
78
+ ]"
79
+ >
80
+ {{ $t(link.label) }}
81
+ </NuxtLink>
82
+ </li>
83
+ </ul>
84
+ </nav>
85
+ <div class="-mb-1 flex items-center">
86
+ <span class="italic text-brandLight">{{ $t('connect.label.bcApp') }}</span>
87
+ <UTooltip arrow :delay-duration="200">
88
+ <UButton
89
+ :aria-label="$t('connect.label.appVersion')"
90
+ color="secondary"
91
+ icon="i-mdi-info-outline"
92
+ variant="ghost"
93
+ />
94
+
95
+ <template #content>
96
+ <div class="flex flex-col">
97
+ <span v-for="(item, i) in appVersions" :key="i">{{ item }}</span>
98
+ </div>
99
+ </template>
100
+ </UTooltip>
101
+ </div>
102
+ </div>
103
+ </footer>
104
+ </template>