@sbc-connect/nuxt-forms 0.4.0 → 0.5.0
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,18 @@
|
|
|
1
1
|
# @sbc-connect/nuxt-forms
|
|
2
2
|
|
|
3
|
+
## 0.5.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#129](https://github.com/bcgov/connect-nuxt/pull/129) [`93c5650`](https://github.com/bcgov/connect-nuxt/commit/93c5650be9a6b48e51d876d522f168d885d006c4) Thanks [@deetz99](https://github.com/deetz99)! - ConnectFieldset and ConnectFormFieldWrapper: Update error styling to be border only, remove title error styling, add padding to body, make orientation horizontal by default.
|
|
8
|
+
|
|
9
|
+
## 0.4.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies [[`8cc8cc0`](https://github.com/bcgov/connect-nuxt/commit/8cc8cc09aad741dc841a864998129c6ac5a6af2f)]:
|
|
14
|
+
- @sbc-connect/nuxt-base@0.6.1
|
|
15
|
+
|
|
3
16
|
## 0.4.0
|
|
4
17
|
|
|
5
18
|
### Minor Changes
|
|
@@ -2,17 +2,16 @@
|
|
|
2
2
|
import type { FormError } from '@nuxt/ui'
|
|
3
3
|
|
|
4
4
|
const {
|
|
5
|
-
orientation = '
|
|
5
|
+
orientation = 'horizontal',
|
|
6
6
|
bodyVariant = 'none'
|
|
7
7
|
} = defineProps<{
|
|
8
8
|
label?: string
|
|
9
9
|
description?: string
|
|
10
|
-
error?: FormError
|
|
10
|
+
error?: FormError | boolean
|
|
11
11
|
showErrorMsg?: boolean
|
|
12
12
|
orientation?: 'vertical' | 'horizontal'
|
|
13
13
|
bodyVariant?: FieldsetBodyVariant
|
|
14
14
|
}>()
|
|
15
|
-
// TODO: figure out why text-error doesnt work on the legend text
|
|
16
15
|
|
|
17
16
|
const id = useId()
|
|
18
17
|
const legendId = id + '-legend'
|
|
@@ -29,8 +28,11 @@ const bodyClass = bodyClassMap[bodyVariant]
|
|
|
29
28
|
<template>
|
|
30
29
|
<fieldset :aria-labelledby="legendId" :aria-describedby="descriptionId">
|
|
31
30
|
<div
|
|
32
|
-
class="
|
|
33
|
-
|
|
31
|
+
:class="[
|
|
32
|
+
'py-6 px-4 sm:py-10 sm:px-8 flex gap-4 sm:gap-6',
|
|
33
|
+
orientation === 'horizontal' ? 'flex-col sm:flex-row' : 'flex-col',
|
|
34
|
+
(error && bodyVariant === 'none') ? 'border-error border-l-3' : 'border-transparent border-l-3',
|
|
35
|
+
]"
|
|
34
36
|
>
|
|
35
37
|
<div
|
|
36
38
|
class="flex flex-col gap-1"
|
|
@@ -41,14 +43,11 @@ const bodyClass = bodyClassMap[bodyVariant]
|
|
|
41
43
|
class="text-base text-neutral-highlighted font-bold"
|
|
42
44
|
>
|
|
43
45
|
<slot name="label">
|
|
44
|
-
<div
|
|
45
|
-
class="flex flex-wrap gap-4"
|
|
46
|
-
:class="[{ 'text-red-600': !!error }]"
|
|
47
|
-
>
|
|
46
|
+
<div class="flex flex-wrap gap-4">
|
|
48
47
|
<span>{{ label }}</span>
|
|
49
48
|
<span
|
|
50
|
-
v-if="
|
|
51
|
-
class="font-normal"
|
|
49
|
+
v-if="error && typeof error === 'object' && 'message' in error && showErrorMsg"
|
|
50
|
+
class="font-normal text-error"
|
|
52
51
|
>
|
|
53
52
|
{{ error.message }}
|
|
54
53
|
</span>
|
|
@@ -66,7 +65,10 @@ const bodyClass = bodyClassMap[bodyVariant]
|
|
|
66
65
|
|
|
67
66
|
<div
|
|
68
67
|
class="flex-1"
|
|
69
|
-
:class="
|
|
68
|
+
:class="[
|
|
69
|
+
bodyClass,
|
|
70
|
+
(error && bodyVariant === 'card') ? 'border-error border-l-3' : 'border-transparent border-l-3',
|
|
71
|
+
]"
|
|
70
72
|
>
|
|
71
73
|
<slot />
|
|
72
74
|
</div>
|
|
@@ -2,34 +2,33 @@
|
|
|
2
2
|
import type { FormError } from '@nuxt/ui'
|
|
3
3
|
|
|
4
4
|
const {
|
|
5
|
-
orientation = '
|
|
5
|
+
orientation = 'horizontal'
|
|
6
6
|
} = defineProps<{
|
|
7
7
|
label: string
|
|
8
|
-
error?: FormError
|
|
8
|
+
error?: FormError | boolean
|
|
9
9
|
showErrorMsg?: boolean
|
|
10
10
|
orientation?: 'vertical' | 'horizontal'
|
|
11
11
|
}>()
|
|
12
|
-
// TODO: figure out why text-error doesnt work on the legend text
|
|
13
12
|
</script>
|
|
14
13
|
|
|
15
14
|
<template>
|
|
16
15
|
<div
|
|
17
|
-
class="
|
|
18
|
-
|
|
16
|
+
:class="[
|
|
17
|
+
'py-6 px-4 sm:py-10 sm:px-8 flex gap-4 sm:gap-6',
|
|
18
|
+
orientation === 'horizontal' ? 'flex-col sm:flex-row' : 'flex-col',
|
|
19
|
+
error ? 'border-error border-l-3' : 'border-transparent border-l-3',
|
|
20
|
+
]"
|
|
19
21
|
>
|
|
20
22
|
<span
|
|
21
23
|
aria-hidden="true"
|
|
22
24
|
class="text-base text-neutral-highlighted font-bold"
|
|
23
25
|
:class="{ 'w-full sm:basis-1/4': orientation === 'horizontal' }"
|
|
24
26
|
>
|
|
25
|
-
<div
|
|
26
|
-
class="flex flex-wrap gap-4"
|
|
27
|
-
:class="{ 'text-red-600': !!error }"
|
|
28
|
-
>
|
|
27
|
+
<div class="flex gap-2.5" :class="orientation === 'horizontal' ? 'flex-col' : 'flex-wrap'">
|
|
29
28
|
<span>{{ label }}</span>
|
|
30
29
|
<span
|
|
31
|
-
v-if="
|
|
32
|
-
class="font-normal"
|
|
30
|
+
v-if="error && typeof error === 'object' && 'message' in error && showErrorMsg"
|
|
31
|
+
class="font-normal text-error"
|
|
33
32
|
>
|
|
34
33
|
{{ error.message }}
|
|
35
34
|
</span>
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sbc-connect/nuxt-forms",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.5.0",
|
|
5
5
|
"repository": "github:bcgov/connect-nuxt",
|
|
6
6
|
"license": "BSD-3-Clause",
|
|
7
7
|
"main": "./nuxt.config.ts",
|
|
@@ -12,13 +12,13 @@
|
|
|
12
12
|
"typescript": "5.9.3",
|
|
13
13
|
"vue-tsc": "3.2.1",
|
|
14
14
|
"@sbc-connect/eslint-config": "0.0.8",
|
|
15
|
-
"@sbc-connect/playwright-config": "0.1.
|
|
15
|
+
"@sbc-connect/playwright-config": "0.1.1",
|
|
16
16
|
"@sbc-connect/vitest-config": "0.1.0"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"country-codes-list": "2.0.0",
|
|
20
20
|
"vue-country-flag-next": "2.3.2",
|
|
21
|
-
"@sbc-connect/nuxt-base": "0.6.
|
|
21
|
+
"@sbc-connect/nuxt-base": "0.6.1"
|
|
22
22
|
},
|
|
23
23
|
"scripts": {
|
|
24
24
|
"preinstall": "npx only-allow pnpm",
|