@sbc-connect/nuxt-base 0.1.7 → 0.1.9

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/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @sbc-connect/nuxt-base
2
2
 
3
+ ## 0.1.9
4
+
5
+ ### Patch Changes
6
+
7
+ - [#43](https://github.com/bcgov/connect-nuxt/pull/43) [`3b521b7`](https://github.com/bcgov/connect-nuxt/commit/3b521b70bf1a0cc5a0feea63a825ef5544347aa8) Thanks [@deetz99](https://github.com/deetz99)! - Form components and new lint rules
8
+
9
+ - Forms layer address components
10
+ - Lint rules and fixes to prevent rule collision and promote best practices
11
+
12
+ issue: bcgov/entity#29338
13
+
14
+ ## 0.1.8
15
+
16
+ ### Patch Changes
17
+
18
+ - [#32](https://github.com/bcgov/connect-nuxt/pull/32) [`66d83d1`](https://github.com/bcgov/connect-nuxt/commit/66d83d14b2ec7950057dd39a4d876a8c4096923f) Thanks [@kialj876](https://github.com/kialj876)! - Pay layer cleanup bcgov/entity#29337
19
+
3
20
  ## 0.1.7
4
21
 
5
22
  ### Patch Changes
package/README.md CHANGED
@@ -18,7 +18,7 @@ This package contains the core UI components, styling, and utilities for the Con
18
18
  - Standard utility functions
19
19
  - Pre-configured for Internationalization (i18n)
20
20
 
21
- For detailed usage and documentation, please see the [Base Layer Docs](../../../docs/packages/layers/base/intro.md)
21
+ For detailed usage and documentation, please see the [Base Layer Docs](../../../docs/packages/layers/base/overview.md)
22
22
 
23
23
  ## Usage
24
24
 
@@ -41,15 +41,8 @@ This project requires certain environment variables to be set to run correctly.
41
41
 
42
42
  Create a file named .env in the root of the project.
43
43
 
44
- Copy the contents of the .env.example file into your new .env file.
45
-
46
44
  #### Local Development
47
- For local development, the following variables are required. The default values are suitable for running the application on your local machine:
48
-
49
- ```
50
- # .env
51
- NUXT_PUBLIC_BASE_URL="http://localhost:3000/"
52
- ```
45
+ Copy the contents of the **.env.example** file into your new .env file.
53
46
 
54
47
  #### Production Environments
55
48
  > [!IMPORTANT]
package/app/app.config.ts CHANGED
@@ -10,6 +10,23 @@ export default defineAppConfig({
10
10
  }
11
11
  },
12
12
  ui: {
13
+ alert: {
14
+ slots: {
15
+ root: 'rounded'
16
+ },
17
+ compoundVariants: [
18
+ {
19
+ color: 'warning',
20
+ variant: 'subtle',
21
+ class: {
22
+ root: 'text-highlighted bg-yellow-400/25 ring-2 ring-yellow-400',
23
+ icon: 'text-warning',
24
+ title: 'font-bold text-nuetral-highlighted',
25
+ description: 'text-nuetral-highlighted'
26
+ }
27
+ }
28
+ ]
29
+ },
13
30
  breadcrumb: {
14
31
  slots: {
15
32
  separatorIcon: 'text-secondary'
@@ -144,6 +161,46 @@ export default defineAppConfig({
144
161
  }
145
162
  ]
146
163
  },
164
+ formField: {
165
+ slots: {
166
+ root: '',
167
+ wrapper: 'space-y-1',
168
+ labelWrapper: 'flex content-center items-center justify-between',
169
+ label: 'block font-bold text-base text-neutral-highlighted',
170
+ container: 'mt-1 relative',
171
+ description: 'text-(--ui-text) text-base text-neutral-toned mb-4 whitespace-normal',
172
+ error: 'pl-4.5 mt-1 text-(--ui-error) text-xs',
173
+ hint: 'text-(--ui-text)',
174
+ help: 'pl-4.5 mt-1 text-(--ui-text) text-xs'
175
+ },
176
+ variants: {
177
+ size: {
178
+ xs: {
179
+ root: 'text-xs'
180
+ },
181
+ sm: {
182
+ root: 'text-xs'
183
+ },
184
+ md: {
185
+ root: 'text-sm'
186
+ },
187
+ lg: {
188
+ root: 'text-sm'
189
+ },
190
+ xl: {
191
+ root: 'text-base'
192
+ }
193
+ },
194
+ required: {
195
+ true: {
196
+ label: 'after:content-[\'*\'] after:ms-0.5 after:text-(--ui-error)'
197
+ }
198
+ }
199
+ },
200
+ defaultVariants: {
201
+ size: 'md'
202
+ }
203
+ },
147
204
  icons: {
148
205
  arrowLeft: 'i-mdi-arrow-left',
149
206
  arrowRight: 'i-mdi-arrow-right',
@@ -188,6 +245,42 @@ export default defineAppConfig({
188
245
  variant: 'bcGov'
189
246
  }
190
247
  },
248
+ select: {
249
+ slots: {
250
+ content: 'rounded-sm',
251
+ group: 'px-0 py-2',
252
+ trailingIcon: 'group-data-[state=open]:rotate-180 transition-transform duration-200 text-(--ui-text) group-data-[state=open]:text-primary group-focus:text-primary',
253
+ item: 'my-0.75 text-neutral-highlighted before:rounded-none data-highlighted:not-data-disabled:text-primary data-highlighted:not-data-disabled:before:bg-shade data-[state=checked]:text-primary data-[state=checked]:bg-blue-50',
254
+ itemLeadingIcon: 'group-data-[state=checked]:text-primary group-data-highlighted:not-data-disabled:text-primary text-neutral-highlighted'
255
+ },
256
+ variants: {
257
+ size: {
258
+ bcGov: {
259
+ base: 'px-0 py-0 text-base gap-1.5',
260
+ leading: 'ps-2.5',
261
+ trailing: 'pe-2.5',
262
+ leadingIcon: 'size-5',
263
+ leadingAvatarSize: '2xs',
264
+ trailingIcon: 'size-5',
265
+ label: 'p-1.5 text-xs gap-1.5',
266
+ item: 'py-3 px-4 text-sm gap-3',
267
+ itemLeadingIcon: 'size-5',
268
+ itemLeadingAvatarSize: '2xs',
269
+ itemLeadingChip: 'size-5',
270
+ itemLeadingChipSize: 'md',
271
+ itemTrailingIcon: 'size-5'
272
+ }
273
+ },
274
+ variant: {
275
+ bcGov: 'peer rounded-t-sm rounded-b-none bg-shade focus:ring-0 focus:outline-none shadow-input data-[state=open]:shadow-input-focus focus:shadow-input-focus text-neutral-highlighted'
276
+ }
277
+ },
278
+ defaultVariants: {
279
+ size: 'bcGov',
280
+ color: 'primary',
281
+ variant: 'bcGov'
282
+ }
283
+ },
191
284
  textarea: {
192
285
  variants: {
193
286
  size: {
@@ -1,5 +1,7 @@
1
1
  <script setup lang="ts">
2
- const props = defineProps({ accountId: { type: String, required: false } })
2
+ const props = defineProps<{
3
+ accountId?: string
4
+ }>()
3
5
 
4
6
  const { t } = useI18n()
5
7
 
@@ -36,6 +38,7 @@ function resolveBackHref() {
36
38
  <template>
37
39
  <div
38
40
  v-if="$route.meta.hideBreadcrumbs !== true"
41
+ data-testid="connect-breadcrumb-wrapper"
39
42
  class="bg-blue-350"
40
43
  >
41
44
  <div class="app-inner-container flex items-center p-2 sm:px-4 py-2 gap-3">
@@ -47,7 +50,7 @@ function resolveBackHref() {
47
50
  :aria-label="$t('connect.label.goBack')"
48
51
  :to="resolveBackHref()"
49
52
  :ui="{
50
- leadingIcon: 'text-blue-500',
53
+ leadingIcon: 'text-primary',
51
54
  }"
52
55
  />
53
56
  <div class="w-[1px] bg-shade h-[24px]" />
@@ -1,7 +1,7 @@
1
1
  <script setup lang="ts">
2
- const props = defineProps({
3
- translationPath: { type: String, required: true }
4
- })
2
+ const props = defineProps<{
3
+ translationPath: string
4
+ }>()
5
5
 
6
6
  const attrs = useAttrs()
7
7
  const { t } = useI18n()
@@ -9,15 +9,13 @@
9
9
  <slot name="breadcrumb">
10
10
  <ConnectBreadcrumb />
11
11
  </slot>
12
- <div class="app-inner-container app-body">
13
- <div class="flex flex-col lg:flex-row lg:gap-6 grow">
14
- <slot name="body">
15
- <div class="grow max-w-full overflow-hidden">
16
- <slot />
17
- </div>
18
- </slot>
19
- </div>
20
- </div>
12
+ <main class="app-inner-container app-body">
13
+ <slot name="body">
14
+ <div class="grow max-w-full flex flex-col overflow-hidden">
15
+ <slot />
16
+ </div>
17
+ </slot>
18
+ </main>
21
19
  <slot name="footer">
22
20
  <ConnectFooter />
23
21
  </slot>
@@ -1,18 +1,15 @@
1
1
  <script setup lang="ts">
2
- const props = defineProps({
3
- fullscreen: {
4
- type: Boolean,
5
- default: false
6
- },
7
- size: {
8
- type: Number,
9
- default: 75
10
- }
11
- })
2
+ const {
3
+ fullscreen = false,
4
+ size = 75
5
+ } = defineProps<{
6
+ fullscreen?: boolean
7
+ size?: number
8
+ }>()
12
9
 
13
10
  const spinnerStyle = computed(() => ({
14
- '--spinner-size': `${props.size}px`,
15
- '--spinner-margin': `${props.size / -2}px`
11
+ '--spinner-size': `${size}px`,
12
+ '--spinner-margin': `${size / -2}px`
16
13
  }))
17
14
  </script>
18
15
 
@@ -2,10 +2,13 @@
2
2
  const ld = useConnectLaunchDarkly()
3
3
  const { $sanitize } = useNuxtApp()
4
4
 
5
- defineProps({
6
- dismissible: { type: Boolean, default: false },
7
- icon: { type: String, default: 'i-mdi-information' }
8
- })
5
+ const {
6
+ dismissible = false,
7
+ icon = 'i-mdi-information'
8
+ } = defineProps<{
9
+ dismissible?: boolean
10
+ icon?: string
11
+ }>()
9
12
 
10
13
  const close = ref(false)
11
14
  const message = ref('')
@@ -148,13 +148,6 @@ export const useConnectLaunchDarkly = () => {
148
148
  }))
149
149
  }
150
150
 
151
- // TODO: or do we do this and then everytime the fn is called its required to use await?
152
- // TODO: returning the computed means we dont need to add LD to middleware
153
- // async function getStoredFlag(name: string): Promise<unknown> {
154
- // await ldClient.value?.waitUntilReady()
155
- // return ldFlagSet.value[name]
156
- // }
157
-
158
151
  /**
159
152
  * Resets the LaunchDarkly state and closes the client connection.
160
153
  */
package/app/error.vue CHANGED
@@ -1,4 +1,5 @@
1
1
  <script setup lang="ts">
2
+ /* eslint-disable vue/define-props-declaration */
2
3
  import type { NuxtError } from '#app'
3
4
 
4
5
  const { t } = useI18n()
@@ -36,7 +37,7 @@ onMounted(() => {
36
37
  <template>
37
38
  <UApp :toaster="{ position: 'bottom-center' }">
38
39
  <NuxtLayout name="connect-base">
39
- <div class="m-auto flex flex-col items-center gap-4 h-full justify-center">
40
+ <div class="m-auto flex flex-col items-center gap-4">
40
41
  <h1>
41
42
  {{ $t(`connect.page.error.${errorKey}.h1`) }}
42
43
  </h1>
@@ -6,6 +6,14 @@
6
6
  /* Customize Nuxt UI default tokens */
7
7
  /* Follows https://sites.google.com/bcdevexchange.org/designsystem/foundation-styles/colours */
8
8
  :root {
9
+ /* Default Text Colours */
10
+ --ui-text-dimmed: var(--ui-color-gray-400);
11
+ --ui-text-muted: var(--ui-color-gray-500);
12
+ --ui-text-toned: var(--ui-color-gray-600);
13
+ --ui-text: var(--ui-color-neutral);
14
+ --ui-text-highlighted: var(--ui-color-neutral-highlighted);
15
+ --ui-text-inverted: var(--color-white);
16
+ /* Variant Colours */
9
17
  --ui-error: var(--color-red-600);
10
18
  --ui-primary: var(--color-blue-500);
11
19
  --ui-secondary: white;
@@ -34,6 +42,14 @@
34
42
 
35
43
  /* FUTURE: add dark themed colours (currently set to be the same) */
36
44
  .dark {
45
+ /* Default Text Colours */
46
+ --ui-text-dimmed: var(--ui-color-gray-400);
47
+ --ui-text-muted: var(--ui-color-gray-500);
48
+ --ui-text-toned: var(--ui-color-gray-600);
49
+ --ui-text: var(--ui-color-neutral);
50
+ --ui-text-highlighted: var(--ui-color-neutral-highlighted);
51
+ --ui-text-inverted: var(--color-white);
52
+ /* Variant Colours */
37
53
  --ui-error: var(--color-red-600);
38
54
  --ui-primary: var(--color-blue-500);
39
55
  --ui-secondary: white;
package/nuxt.config.ts CHANGED
@@ -114,7 +114,8 @@ export default defineNuxtConfig({
114
114
  'mdi:menu',
115
115
  'mdi:file-document-outline',
116
116
  'mdi:home',
117
- 'mdi:web'
117
+ 'mdi:web',
118
+ 'mdi:alert'
118
119
  ]
119
120
  }
120
121
  },
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sbc-connect/nuxt-base",
3
3
  "type": "module",
4
- "version": "0.1.7",
4
+ "version": "0.1.9",
5
5
  "repository": "github:bcgov/connect-nuxt",
6
6
  "license": "BSD-3-Clause",
7
7
  "main": "./nuxt.config.ts",
@@ -23,9 +23,9 @@
23
23
  "nuxt": "^4.0.2",
24
24
  "typescript": "^5.8.3",
25
25
  "vue-tsc": "^3.0.4",
26
- "@sbc-connect/playwright-config": "0.0.5",
27
- "@sbc-connect/eslint-config": "0.0.6",
28
- "@sbc-connect/vitest-config": "0.0.6"
26
+ "@sbc-connect/eslint-config": "0.0.7",
27
+ "@sbc-connect/vitest-config": "0.0.6",
28
+ "@sbc-connect/playwright-config": "0.0.6"
29
29
  },
30
30
  "scripts": {
31
31
  "preinstall": "npx only-allow pnpm",