@sbc-connect/nuxt-forms 0.6.1 → 0.6.2

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,11 @@
1
1
  # @sbc-connect/nuxt-forms
2
2
 
3
+ ## 0.6.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#141](https://github.com/bcgov/connect-nuxt/pull/141) [`83c5627`](https://github.com/bcgov/connect-nuxt/commit/83c5627689a50d6fa27f12f2ab7b2ef65e752d0e) Thanks [@deetz99](https://github.com/deetz99)! - ConnectFieldset, ConnectFormFieldWrapper: Move error text to always be under label instead of wrapping. ConnectFieldset: add error border styling to card bodyVariant
8
+
3
9
  ## 0.6.1
4
10
 
5
11
  ### Patch Changes
@@ -4,7 +4,8 @@ import type { FormError } from '@nuxt/ui'
4
4
  const {
5
5
  orientation = 'horizontal',
6
6
  bodyVariant = 'none',
7
- paddingClass = 'x-default'
7
+ paddingClass = 'x-default',
8
+ error
8
9
  } = defineProps<{
9
10
  label?: string
10
11
  description?: string
@@ -19,12 +20,15 @@ const id = useId()
19
20
  const legendId = id + '-legend'
20
21
  const descriptionId = id + '-description'
21
22
 
22
- const bodyClassMap: Record<FieldsetBodyVariant, string> = {
23
- none: '',
24
- card: 'bg-white rounded shadow-xs'
25
- }
23
+ const bodyClassMap = computed<Record<FieldsetBodyVariant, string>>(() => {
24
+ const cardError = error ? 'border-error border-l-3' : 'border-transparent border-l-3'
25
+ return {
26
+ none: '',
27
+ card: 'bg-white rounded shadow-xs ' + cardError
28
+ }
29
+ })
26
30
 
27
- const bodyClass = bodyClassMap[bodyVariant]
31
+ const bodyClass = computed(() => bodyClassMap.value[bodyVariant])
28
32
 
29
33
  const padding = paddingClass === 'x-default'
30
34
  ? 'px-4 sm:px-8'
@@ -52,7 +56,7 @@ const padding = paddingClass === 'x-default'
52
56
  class="text-base text-neutral-highlighted font-bold"
53
57
  >
54
58
  <slot name="label">
55
- <div class="flex flex-wrap gap-4">
59
+ <div class="flex flex-col gap-1">
56
60
  <span>{{ label }}</span>
57
61
  <span
58
62
  v-if="error && typeof error === 'object' && 'message' in error && showErrorMsg"
@@ -33,7 +33,7 @@ const padding = paddingClass === 'x-default'
33
33
  class="text-base text-neutral-highlighted font-bold"
34
34
  :class="{ 'w-full sm:basis-1/4': orientation === 'horizontal' }"
35
35
  >
36
- <div class="flex gap-2.5" :class="orientation === 'horizontal' ? 'flex-col' : 'flex-wrap'">
36
+ <div class="flex flex-col gap-1">
37
37
  <span>{{ label }}</span>
38
38
  <span
39
39
  v-if="error && typeof error === 'object' && 'message' in error && showErrorMsg"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sbc-connect/nuxt-forms",
3
3
  "type": "module",
4
- "version": "0.6.1",
4
+ "version": "0.6.2",
5
5
  "repository": "github:bcgov/connect-nuxt",
6
6
  "license": "BSD-3-Clause",
7
7
  "main": "./nuxt.config.ts",
@@ -11,8 +11,8 @@
11
11
  "nuxt": "4.2.2",
12
12
  "typescript": "5.9.3",
13
13
  "vue-tsc": "3.2.1",
14
- "@sbc-connect/eslint-config": "0.0.8",
15
14
  "@sbc-connect/playwright-config": "0.1.1",
15
+ "@sbc-connect/eslint-config": "0.0.8",
16
16
  "@sbc-connect/vitest-config": "0.1.0"
17
17
  },
18
18
  "dependencies": {