@sbc-connect/nuxt-base 0.1.3 → 0.1.4

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 (33) hide show
  1. package/.env.example +11 -1
  2. package/CHANGELOG.md +37 -0
  3. package/LICENSE +28 -0
  4. package/README.md +36 -47
  5. package/app/app.config.ts +31 -171
  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 +2 -2
  13. package/app/components/Connect/Header/index.vue +16 -1
  14. package/app/components/Connect/LocaleSelect.vue +1 -1
  15. package/app/components/Connect/Slideover/WhatsNew.vue +61 -0
  16. package/app/components/Connect/SystemBanner.vue +50 -0
  17. package/app/composables/useConnectLaunchDarkly.ts +177 -0
  18. package/app/error.vue +53 -0
  19. package/app/interfaces/connect-breadcrumb.ts +5 -0
  20. package/app/interfaces/connect-whatsnew.ts +14 -0
  21. package/app/layouts/{default.vue → ConnectBase.vue} +3 -0
  22. package/app/plugins/launchdarkly.client.ts +9 -0
  23. package/app/plugins/sanitize.client.ts +13 -0
  24. package/app/plugins/whats-new.client.ts +45 -0
  25. package/app/spa-loading-template.html +39 -0
  26. package/app/utils/appendUrlParam.ts +4 -0
  27. package/i18n/locales/en-CA.ts +50 -82
  28. package/i18n/locales/fr-CA.ts +33 -30
  29. package/modules/assets/index.ts +1 -1
  30. package/modules/assets/runtime/assets/core-tw.css +57 -30
  31. package/nuxt.config.ts +62 -1
  32. package/package.json +18 -8
  33. package/app/components/Connect/Header/Base.vue +0 -17
@@ -1,88 +1,56 @@
1
- /* eslint-disable max-len */
2
1
  export default {
3
- btn: {
4
- appVersion: 'App Version',
5
- bcRegHome: 'BC Registries Home',
6
- createAccount: 'Create Account',
7
- editProfile: 'Edit Profile',
8
- logout: 'Log out',
9
- login: 'Log in',
10
- accountInfo: 'Account Info',
11
- teamMembers: 'Team Members',
12
- transactions: 'Transactions',
13
- notifications: {
14
- main: 'Notifications',
15
- aria: 'Notifications, {count} New'
2
+ /* Ordering should be alphabetical unless otherwise specified */
3
+ connect: {
4
+ breadcrumb: {
5
+ /* Only include breadcrumb values that extended apps may overwrite */
6
+ arialabel: 'Breadcrumb',
7
+ default: 'Service BC Connect'
16
8
  },
17
- accountOptionsMenu: 'Account Options Menu',
18
- whatsNew: "What's New",
19
- mainMenu: 'Main menu',
20
- goHome: 'Go Home'
21
- },
22
- label: {
23
- accountSettings: 'Account Settings',
24
- bcRegOLServices: 'BC Registries and Online Services',
25
- switchAccount: 'Switch Account',
26
- selectLoginMethod: 'Select log in method',
27
- bcsc: 'BC Services Card',
28
- bceid: 'BCeID',
29
- idir: 'IDIR',
30
- whatsNewSlideover: "What's New at BC Registries"
31
- },
32
- notifications: {
33
- none: 'No Notifications',
34
- teamMemberApproval: '{count} team member requires approval to access this account. | {count} team members require approval to access this account.'
35
- },
36
- ConnectFooter: {
37
- navLabel: 'Useful Links', // <nav> aria-label
38
- home: 'Home',
39
- releaseNotes: 'Release Notes',
40
- fees: 'Fees',
41
- disclaimer: 'Disclaimer',
42
- privacy: 'Privacy',
43
- ally: 'Accessibility',
44
- copyright: 'Copyright',
45
- bcApp: 'A BC Online Application'
46
- },
47
- ConnectHeader: {
48
- title: 'Service BC Connect',
49
- logoBtnLabel: 'Home', // <img> link aria-label
50
- navLabel: 'Main Navigation', // <nav> aria-label
51
- homeLink: 'Home'
52
- },
53
- ConnectBCGovLogo: {
54
- alt: 'Government of British Columbia Logo' // <img> alt
55
- },
56
- ConnectLocaleSelect: {
57
- // aria-label
58
- label: 'Select a Language, current language: English'
59
- },
60
- ConnectBreadcrumb: {
61
- default: 'Service BC Connect',
62
- backBtn: 'Go Back',
63
- arialabel: 'Breadcrumb'
64
- },
65
- ConnectPage: {
66
- error: {
67
- 404: {
68
- title: 'Page Not Found - Service BC Connect',
69
- h1: '404 Page Not Found',
70
- content: 'This page could not be found or does not exist.'
71
- },
72
- unknown: {
73
- title: 'Unknown Error - Service BC Connect',
74
- h1: 'Unknown Error',
75
- content: 'An unknown error occured, please refresh the page or try again later.'
9
+ footer: {
10
+ /* Only include footer values that extended apps may overwrite */
11
+ navLabel: 'Useful Links' // <nav> aria-label
12
+ },
13
+ header: {
14
+ /* Only include header values that extended apps may overwrite */
15
+ homeLink: 'Home', // aria-label
16
+ navLabel: 'Main Navigation', // <nav> aria-label
17
+ title: 'Service BC Connect'
18
+ },
19
+ label: {
20
+ accessibility: 'Accessibility',
21
+ appVersion: 'App Version',
22
+ bcApp: 'A BC Online Application',
23
+ bcGovLogo: 'Government of British Columbia Logo',
24
+ copyright: 'Copyright',
25
+ disclaimer: 'Disclaimer',
26
+ fees: 'Fees',
27
+ goBack: 'Go Back',
28
+ goHome: 'Go Home',
29
+ home: 'Home',
30
+ localeSelect: 'Select a Language, current language: English',
31
+ privacy: 'Privacy',
32
+ releaseNotes: 'Release Notes',
33
+ whatsNew: "What's New",
34
+ whatsNewAria: "What's New, {count} unread",
35
+ whatsNewSlideover: "What's New at BC Registries"
36
+ },
37
+ page: {
38
+ error: {
39
+ 404: {
40
+ title: 'Page Not Found - Service BC Connect',
41
+ h1: '404 Page Not Found',
42
+ content: 'This page could not be found or does not exist.'
43
+ },
44
+ unknown: {
45
+ title: 'Unknown Error - Service BC Connect',
46
+ h1: 'Unknown Error',
47
+ content: 'An unknown error occured, please refresh the page or try again later.'
48
+ }
76
49
  }
77
- }
78
- },
79
- ConnectModalSessionExpiring: {
80
- title: 'Session Expiring Soon',
81
- content: 'Your session is about to expire due to inactivity. You will be logged out in {boldStart}0{boldEnd} seconds. Press any key to continue your session. | Your session is about to expire due to inactivity. You will be logged out in {boldStart}1{boldEnd} second. Press any key to continue your session. | Your session is about to expire due to inactivity. You will be logged out in {boldStart}{count}{boldEnd} seconds. Press any key to continue your session.',
82
- sessionExpired: 'Session Expired',
83
- continueBtn: {
84
- main: 'Continue Session',
85
- aria: 'Your session is about to expire, press any key to continue your session.'
50
+ },
51
+ text: {
52
+ whatsNewSlideoverDescription: ' ',
53
+ whatsNewSlideoverEmpty: 'No new items.'
86
54
  }
87
55
  },
88
56
  test: {
@@ -1,7 +1,39 @@
1
1
  /* eslint-disable max-len */
2
2
  export default {
3
+ /* Ordering should be alphabetical unless otherwise specified */
4
+ connect: {
5
+ breadcrumb: {
6
+ /* Only include breadcrumb values that extended apps may overwrite */
7
+ arialabel: "Fil d'Ariane",
8
+ default: 'Service Connect CB'
9
+ },
10
+ footer: {
11
+ /* Only include footer values that extended apps may overwrite */
12
+ navLabel: 'Liens utiles' // <nav> aria-label
13
+ },
14
+ header: {
15
+ /* Only include header values that extended apps may overwrite */
16
+ homeLink: 'Accueil', // aria-label
17
+ navLabel: 'Navigation principale', // <nav> aria-label
18
+ title: 'Service Connect CB'
19
+ },
20
+ label: {
21
+ accessibility: 'Accessibilité',
22
+ appVersion: "Version de l'Application",
23
+ bcApp: 'Une application en ligne CB',
24
+ bcGovLogo: 'Logo du gouvernement de la Colombie-Britannique',
25
+ copyright: "Droits d'auteur",
26
+ disclaimer: 'Clause de non-responsabilité',
27
+ fees: 'Frais',
28
+ goBack: 'Retour',
29
+ home: 'Accueil',
30
+ localeSelect: 'Sélectionnez une langue, langue courante: Français',
31
+ privacy: 'Confidentialité',
32
+ releaseNotes: 'Notes de Version'
33
+ },
34
+ text: {}
35
+ },
3
36
  btn: {
4
- appVersion: "Version de l'Application",
5
37
  bcRegHome: 'Accueil des Registres de la CB',
6
38
  createAccount: 'Créer un Compte',
7
39
  editProfile: 'Editer le Profil',
@@ -33,35 +65,6 @@ export default {
33
65
  none: 'Aucune Notification',
34
66
  teamMemberApproval: "{count} membre de l'équipe doit être approuvé pour accéder à ce compte. | {count} membres de l'équipe doivent être approuvés pour accéder à ce compte."
35
67
  },
36
- ConnectFooter: {
37
- navLabel: 'Liens utiles', // <nav> aria-label
38
- home: 'Accueil',
39
- releaseNotes: 'Notes de Version',
40
- fees: 'Frais',
41
- disclaimer: 'Clause de non-responsabilité',
42
- privacy: 'Confidentialité',
43
- ally: 'Accessibilité',
44
- copyright: "Droits d'auteur",
45
- bcApp: 'Une application en ligne CB'
46
- },
47
- ConnectHeader: {
48
- title: 'Service Connect CB',
49
- logoBtnLabel: 'Accueil', // <img> link aria-label
50
- navLabel: 'Navigation principale', // <nav> aria-label
51
- homeLink: 'Home'
52
- },
53
- ConnectBCGovLogo: {
54
- alt: 'Logo du gouvernement de la Colombie-Britannique' // <img> alt
55
- },
56
- ConnectLocaleSelect: {
57
- // aria-label
58
- label: 'Sélectionnez une langue, langue courante: Français'
59
- },
60
- ConnectBreadcrumb: {
61
- default: 'Service Connect CB',
62
- backBtn: 'Retour',
63
- arialabel: "Fil d'Ariane"
64
- },
65
68
  ConnectPage: {
66
69
  error: {
67
70
  404: {
@@ -18,7 +18,7 @@ export default defineNuxtModule<ModuleOptions>({
18
18
 
19
19
  _nuxt.options.css.push(resolver.resolve('./runtime/assets/core-tw.css'))
20
20
  _nuxt.options.css.push(resolver.resolve('./runtime/assets/core-layout.css'))
21
- _nuxt.options.css.push(resolver.resolve('./runtime/assets/core-main.css'))
21
+ // _nuxt.options.css.push(resolver.resolve('./runtime/assets/core-main.css'))
22
22
  await installModule('@nuxt/ui')
23
23
  }
24
24
  })
@@ -1,15 +1,63 @@
1
- @reference "tailwindcss";
2
- @reference "@nuxt/ui";
1
+ @import "tailwindcss";
2
+ @import "@nuxt/ui";
3
+
4
+ @source "../../../../app/";
3
5
 
4
6
  /* Customize Nuxt UI default tokens */
7
+ /* Follows https://sites.google.com/bcdevexchange.org/designsystem/foundation-styles/colours */
5
8
  :root {
6
- --ui-error: var(--color-connect-error);
9
+ --ui-error: var(--color-red-600);
10
+ --ui-primary: var(--color-blue-500);
11
+ --ui-secondary: white;
12
+ --ui-success: var(--color-green-600);
13
+ --ui-warning: #F8661A;
14
+ /* Custom themes */
15
+ --ui-brandDark: var(--color-midnightBlue-900);
16
+ --ui-brandLight: var(--color-yellow-400);
17
+ --ui-lineDark: #6F7780;
18
+ --ui-lineLight: var(--color-gray-300);
19
+ --ui-lineSpecial: #899EB2;
20
+ --ui-markBlue: #1A5A96;
21
+ --ui-markBlueHover: #0000EE;
7
22
  --ui-neutral: var(--color-gray-700);
23
+ --ui-neutralDark: var(--color-gray-900);
24
+ --ui-neutralLight: #757575;
25
+ --ui-shadeCaution: #FFF7E3;
26
+ --ui-shadeLight: white;
27
+ --ui-shadeNew: #E8F5E9;
28
+ --ui-shadePrimary: var(--color-gray-100);
29
+ --ui-shadeSecondary: #E2E8EE;
30
+ --ui-shadeSpecial: var(--color-blue-50);
31
+ --ui-shadeWarning: #FAE9E9;
32
+ --ui-radius: 0.1667rem;
33
+ }
34
+
35
+ /* FUTURE: add dark themed colours (currently set to be the same) */
36
+ .dark {
37
+ --ui-error: var(--color-red-600);
8
38
  --ui-primary: var(--color-blue-500);
9
39
  --ui-secondary: white;
10
40
  --ui-success: var(--color-green-600);
11
41
  --ui-warning: #F8661A;
12
- --ui-radius: 0.25rem;
42
+ /* Custom themes */
43
+ --ui-brandDark: var(--color-midnightBlue-900);
44
+ --ui-brandLight: var(--color-yellow-400);
45
+ --ui-lineDark: #6F7780;
46
+ --ui-lineLight: var(--color-gray-300);
47
+ --ui-lineSpecial: #899EB2;
48
+ --ui-markBlue: #1A5A96;
49
+ --ui-markBlueHover: #0000EE;
50
+ --ui-neutral: var(--color-gray-700);
51
+ --ui-neutralDark: var(--color-gray-900);
52
+ --ui-neutralLight: #757575;
53
+ --ui-shadeCaution: #FFF7E3;
54
+ --ui-shadeLight: white;
55
+ --ui-shadeNew: #E8F5E9;
56
+ --ui-shadePrimary: var(--color-gray-100);
57
+ --ui-shadeSecondary: #E2E8EE;
58
+ --ui-shadeSpecial: var(--color-blue-50);
59
+ --ui-shadeWarning: #FAE9E9;
60
+ --ui-radius: 0.1667rem;
13
61
  }
14
62
 
15
63
  @theme static {
@@ -28,27 +76,6 @@
28
76
  /* box shadow */
29
77
  --shadow-bcGovInput: inset 0 -2px 0 0px #1669bb;
30
78
 
31
- /* COLOURS */
32
- /* these colours are as defined in styleguide: */
33
- /* https://preview.uxpin.com/73eb31e6346bc2863a066f02218a3af289325619#/pages/138840439/simulate/sitemap?mode=i */
34
- /* for more details see previous link */
35
- --color-connect-darkBlue: var(--color-midnightBlue-900);
36
- --color-connect-lightBlue: var(--color-blue-50);
37
- --color-connect-darkGray: var(--color-gray-900);
38
- --color-connect-midGray: var(--color-gray-700);
39
- --color-connect-lightGray: #757575;
40
- --color-connect-yellow: var(--color-yellow-400);
41
- /* Are below used? */
42
- /* --color-bcGovColor-markBlue: #1a5a96; */
43
- /* --color-bcGovColor-markBlueHover: #0000EE; */
44
- --color-connect-nonClickable: var(--color-blue-350);
45
- --color-connect-gray1: var(--color-gray-100);
46
- --color-connect-gray2: #E2E8EE;
47
- /* LINES */
48
- --color-connect-hairlinesOnWhite: var(--color-gray-300);
49
- --color-connect-specialityDottedLines: #899EB2;
50
- --color-connect-formFieldLines: #6F7780;
51
-
52
79
  /* GRAY */
53
80
  --color-gray-50: #f8f9fa;
54
81
  --color-gray-100: #f1f3f5;
@@ -186,7 +213,7 @@ body {
186
213
  h2,
187
214
  h3,
188
215
  h4 {
189
- @apply text-gray-900;
216
+ @apply text-neutralDark;
190
217
  }
191
218
 
192
219
  h1,
@@ -213,20 +240,20 @@ body {
213
240
  }
214
241
 
215
242
  p {
216
- @apply font-normal text-connect-midGray;
243
+ @apply font-normal text-neutral;
217
244
  }
218
245
 
219
246
  td,
220
247
  th {
221
- @apply text-gray-900 text-sm;
248
+ @apply text-neutralDark text-sm;
222
249
  }
223
250
 
224
251
  /* floating labels */
225
252
  .floating-label-input {
226
- @apply pointer-events-none absolute left-0 top-1 text-gray-900 text-xs font-medium px-2.5 transition-all peer-focus:top-1 peer-focus:text-xs peer-placeholder-shown:text-sm peer-placeholder-shown:top-1/2 peer-placeholder-shown:-translate-y-1/2 peer-focus:translate-none peer-focus:text-blue-500;
253
+ @apply pointer-events-none absolute left-0 top-1 text-neutralDark text-xs font-medium px-2.5 transition-all peer-focus:top-1 peer-focus:text-xs peer-placeholder-shown:text-sm peer-placeholder-shown:top-1/2 peer-placeholder-shown:-translate-y-1/2 peer-focus:translate-none peer-focus:text-primary;
227
254
  }
228
255
 
229
256
  .floating-label-textarea {
230
- @apply pointer-events-none absolute left-0 top-1 text-gray-900 text-xs font-medium px-2.5 transition-all peer-focus:top-1 peer-focus:text-xs peer-placeholder-shown:text-sm peer-placeholder-shown:top-2.5 peer-focus:translate-none peer-focus:text-blue-500;
257
+ @apply pointer-events-none absolute left-0 top-1 text-neutralDark text-xs font-medium px-2.5 transition-all peer-focus:top-1 peer-focus:text-xs peer-placeholder-shown:text-sm peer-placeholder-shown:top-2.5 peer-focus:translate-none peer-focus:text-primary;
231
258
  }
232
259
  }
package/nuxt.config.ts CHANGED
@@ -18,7 +18,14 @@ export default defineNuxtConfig({
18
18
 
19
19
  compatibilityDate: '2025-07-10',
20
20
 
21
- modules: ['@nuxtjs/i18n'],
21
+ imports: {
22
+ dirs: ['interfaces']
23
+ },
24
+
25
+ modules: [
26
+ '@nuxtjs/i18n',
27
+ '@vueuse/nuxt'
28
+ ],
22
29
 
23
30
  // For more details on i18n in layers: https://i18n.nuxtjs.org/docs/guide/layers
24
31
  // For more details on config: https://i18n.nuxtjs.org/docs/api/options
@@ -43,5 +50,59 @@ export default defineNuxtConfig({
43
50
  }
44
51
  ],
45
52
  strategy: 'prefix'
53
+ },
54
+
55
+ ui: {
56
+ colorMode: false,
57
+ theme: {
58
+ colors: [
59
+ 'primary',
60
+ 'secondary',
61
+ 'success',
62
+ 'info',
63
+ 'warning',
64
+ 'error',
65
+ 'brandDark',
66
+ 'brandLight',
67
+ 'lineDark',
68
+ 'lineLight',
69
+ 'lineSpecial',
70
+ 'neutral',
71
+ 'neutralDark',
72
+ 'neutralLight',
73
+ 'shadeCaution',
74
+ 'shadeLight',
75
+ 'shadeNew',
76
+ 'shadePrimary',
77
+ 'shadeSecondary',
78
+ 'shadeSpecial',
79
+ 'shadeWarning'
80
+ ]
81
+ }
82
+ },
83
+
84
+ icon: {
85
+ clientBundle: {
86
+ icons: [
87
+ 'mdi:arrow-left',
88
+ 'mdi:info-outline',
89
+ 'mdi:information',
90
+ 'mdi:web',
91
+ 'mdi:check'
92
+ ]
93
+ }
94
+ },
95
+
96
+ runtimeConfig: {
97
+ public: {
98
+ // Should in alphabetical order
99
+ appName: process.env.npm_package_name || '',
100
+ version: `Connect Base Layer v${process.env.npm_package_version || ''}`,
101
+ baseUrl: '',
102
+ registryHomeUrl: '',
103
+ ldClientId: '',
104
+ statusApiUrl: '',
105
+ statusApiVersion: ''
106
+ }
46
107
  }
47
108
  })
package/package.json CHANGED
@@ -1,23 +1,31 @@
1
1
  {
2
2
  "name": "@sbc-connect/nuxt-base",
3
3
  "type": "module",
4
- "version": "0.1.3",
4
+ "version": "0.1.4",
5
5
  "repository": "github:bcgov/connect-nuxt",
6
+ "license": "BSD-3-Clause",
6
7
  "main": "./nuxt.config.ts",
7
8
  "dependencies": {
8
- "@nuxt/ui": "^3.2.0",
9
- "@nuxtjs/i18n": "^10.0.1"
9
+ "@iconify-json/mdi": "^1.2.3",
10
+ "@nuxt/ui": "^3.3.0",
11
+ "@nuxtjs/i18n": "^10.0.2",
12
+ "dompurify": "^3.2.6",
13
+ "launchdarkly-vue-client-sdk": "^2.4.1",
14
+ "@vueuse/nuxt": "^13.5.0",
15
+ "@vueuse/core": "^13.5.0",
16
+ "lodash-es": "^4.17.21"
10
17
  },
11
18
  "devDependencies": {
12
19
  "@axe-core/playwright": "^4.10.2",
13
- "@vitest/coverage-v8": "^3.2.3",
20
+ "@vitest/coverage-v8": "^3.2.4",
14
21
  "dotenv": "^17.2.0",
15
22
  "nuxt": "4.0.0",
16
23
  "typescript": "^5.8.3",
17
- "vue-tsc": "^3.0.2",
18
- "@sbc-connect/eslint-config": "0.0.4",
24
+ "vue-tsc": "^3.0.3",
25
+ "@types/lodash-es": "^4.17.12",
26
+ "@sbc-connect/eslint-config": "0.0.5",
19
27
  "@sbc-connect/playwright-config": "0.0.4",
20
- "@sbc-connect/vitest-config": "0.0.4"
28
+ "@sbc-connect/vitest-config": "0.0.5"
21
29
  },
22
30
  "scripts": {
23
31
  "preinstall": "npx only-allow pnpm",
@@ -29,8 +37,10 @@
29
37
  "lint": "eslint .",
30
38
  "lint:fix": "eslint --fix .",
31
39
  "test": "pnpm run test:unit; pnpm run test:e2e",
32
- "test:unit": "vitest run",
40
+ "test:unit": "vitest run --passWithNoTests",
41
+ "test:unit:watch": "vitest",
33
42
  "test:e2e": "npx playwright test",
43
+ "test:e2e:ui": "npx playwright test --ui",
34
44
  "typecheck": "npx nuxt typecheck"
35
45
  }
36
46
  }
@@ -1,17 +0,0 @@
1
- <script setup lang="ts">
2
- const localeSelect = useAppConfig().connect.header.localeSelect
3
- </script>
4
-
5
- <template>
6
- <ConnectHeaderWrapper>
7
- <div class="flex items-center justify-between">
8
- <ConnectHeaderLogoHomeLink />
9
- <ClientOnly>
10
- <div class="flex gap-4">
11
- <slot />
12
- <ConnectLocaleSelect v-if="localeSelect" />
13
- </div>
14
- </ClientOnly>
15
- </div>
16
- </ConnectHeaderWrapper>
17
- </template>