@sbc-connect/nuxt-base 0.9.0 → 0.10.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,13 @@
1
1
  # @sbc-connect/nuxt-base
2
2
 
3
+ ## 0.10.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#163](https://github.com/bcgov/connect-nuxt/pull/163) [`c0df0d1`](https://github.com/bcgov/connect-nuxt/commit/c0df0d1deb18d2123bc5e562e3c2ba2028de7ce1) Thanks [@vysakh-menon-aot](https://github.com/vysakh-menon-aot)! - floating label input size changed to 16px
8
+
9
+ - [#165](https://github.com/bcgov/connect-nuxt/pull/165) [`8dedd59`](https://github.com/bcgov/connect-nuxt/commit/8dedd5905ad619d8eaf8fee13a74abbc84019b54) Thanks [@deetz99](https://github.com/deetz99)! - Implement ConnectInputMenu component
10
+
3
11
  ## 0.9.0
4
12
 
5
13
  ### Minor Changes
@@ -269,11 +269,11 @@ body {
269
269
 
270
270
  /* floating labels */
271
271
  .floating-label-input {
272
- @apply pointer-events-none absolute left-0 top-3 text-neutral transition-all motion-reduce:transition-none duration-200 text-xs font-medium px-2.5 peer-focus:top-3 peer-focus:text-xs peer-placeholder-shown:text-sm peer-placeholder-shown:top-1/2 -translate-y-1/2 peer-focus:text-primary peer-aria-invalid:text-error;
272
+ @apply pointer-events-none absolute left-0 top-3 text-neutral transition-all motion-reduce:transition-none duration-200 text-xs font-medium px-2.5 peer-focus:top-3 peer-focus:text-xs peer-placeholder-shown:text-base peer-placeholder-shown:top-1/2 -translate-y-1/2 peer-focus:text-primary peer-aria-invalid:text-error;
273
273
  }
274
-
274
+
275
275
  .floating-label-textarea {
276
- @apply pointer-events-none absolute left-0 top-1 text-neutral text-xs font-medium px-2.5 transition-all duration-200 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 peer-aria-invalid:text-error;
276
+ @apply pointer-events-none absolute left-0 top-1 text-neutral text-xs font-medium px-2.5 transition-all duration-200 peer-focus:top-1 peer-focus:text-xs peer-placeholder-shown:text-base peer-placeholder-shown:top-2.5 peer-focus:translate-none peer-focus:text-primary peer-aria-invalid:text-error;
277
277
  }
278
278
 
279
279
  /* Standard container padding */
@@ -0,0 +1,54 @@
1
+ <script setup lang="ts">
2
+ import type { InputMenuProps } from '@nuxt/ui'
3
+
4
+ const props = defineProps<{
5
+ id: string
6
+ label: string
7
+ }>()
8
+
9
+ const labelId = props.id + '-label'
10
+ const model = defineModel<InputMenuProps['modelValue']>()
11
+
12
+ const hasValue = computed(() => {
13
+ const val = model.value
14
+
15
+ if (val === null || val === undefined) {
16
+ return false
17
+ }
18
+
19
+ if (Array.isArray(val)) {
20
+ return val.length > 0
21
+ }
22
+
23
+ if (typeof val === 'object') {
24
+ return Object.keys(val).length > 0
25
+ }
26
+
27
+ return val === 0 || !!val
28
+ })
29
+
30
+ defineOptions({ inheritAttrs: false })
31
+ </script>
32
+
33
+ <template>
34
+ <div class="relative group">
35
+ <span
36
+ :id="labelId"
37
+ :class="[
38
+ 'absolute left-0 z-10 px-2.5 pointer-events-none text-neutral transition-all duration-200 w-fit line-clamp-1',
39
+ 'top-1/2 -translate-y-1/2',
40
+ 'group-focus-within:top-3 group-focus-within:text-xs group-focus-within:text-primary',
41
+ 'group-has-aria-invalid:text-error',
42
+ hasValue ? 'top-3 text-xs' : '',
43
+ ]"
44
+ >
45
+ {{ label }}
46
+ </span>
47
+ <UInputMenu
48
+ v-bind="$attrs"
49
+ :id
50
+ v-model="model"
51
+ :aria-labelledby="labelId"
52
+ />
53
+ </div>
54
+ </template>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sbc-connect/nuxt-base",
3
3
  "type": "module",
4
- "version": "0.9.0",
4
+ "version": "0.10.0",
5
5
  "repository": "github:bcgov/connect-nuxt",
6
6
  "license": "BSD-3-Clause",
7
7
  "main": "./nuxt.config.ts",
@@ -23,8 +23,8 @@
23
23
  "@types/luxon": "3.7.1",
24
24
  "dotenv": "^17.4.2",
25
25
  "nuxt": "4.4.6",
26
- "typescript": "5.9.3",
27
- "vue-tsc": "3.2.5",
26
+ "typescript": "6.0.3",
27
+ "vue-tsc": "3.3.1",
28
28
  "@sbc-connect/eslint-config": "0.0.8",
29
29
  "@sbc-connect/playwright-config": "0.2.0",
30
30
  "@sbc-connect/vitest-config": "0.2.0"