@una-ui/nuxt 0.29.0-beta.1 → 0.31.0-beta.1

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/README.md CHANGED
@@ -5,10 +5,10 @@
5
5
 
6
6
  ## 🏗ïļ Release Status
7
7
 
8
- | Branch | Version | Status | Downloads |
9
- | --- | --- | --- | --- |
10
- | Main (Edge) | [![npm-edge][npm-edge-src]][npm-edge-href] | [![github-status][github-status-src-main]][github-status-href-main] | [![npm-edge-downloads][npm-edge-downloads-src]][npm-edge-downloads-href] |
11
- | Release | [![npm-version][npm-version-src]][npm-version-href] | [![github-status][github-status-src-release]][github-status-href-release] | [![npm-downloads][npm-downloads-src]][npm-downloads-href] |
8
+ | Branch | Version | Status | Downloads |
9
+ | ----------- | --------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
10
+ | Main (Edge) | [![npm-edge][npm-edge-src]][npm-edge-href] | [![github-status][github-status-src-main]][github-status-href-main] | [![npm-edge-downloads][npm-edge-downloads-src]][npm-edge-downloads-href] |
11
+ | Release | [![npm-version][npm-version-src]][npm-version-href] | [![github-status][github-status-src-release]][github-status-href-release] | [![npm-downloads][npm-downloads-src]][npm-downloads-href] |
12
12
 
13
13
  ## 📙 Documentation
14
14
 
@@ -32,7 +32,7 @@ Visit https://www.unaui.com for full documentation.
32
32
 
33
33
  ## ðŸŠī Project Activity
34
34
 
35
- ![Alt](https://repobeats.axiom.co/api/embed/49dee6a65be83113d1241c7bd38f23e211a0f189.svg "Repobeats analytics image")
35
+ ![Alt](https://repobeats.axiom.co/api/embed/49dee6a65be83113d1241c7bd38f23e211a0f189.svg 'Repobeats analytics image')
36
36
 
37
37
  ## ðŸ‘Ļ‍ðŸ’ŧ Contributors
38
38
 
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@una-ui/nuxt",
3
3
  "configKey": "una",
4
- "version": "0.29.0-beta.1",
4
+ "version": "0.31.0-beta.1",
5
5
  "compatibility": {
6
6
  "nuxt": ">=3.0.0"
7
7
  },
package/dist/module.mjs CHANGED
@@ -7,7 +7,7 @@ import 'unocss';
7
7
  import 'unocss-preset-animations';
8
8
 
9
9
  const name = "@una-ui/nuxt";
10
- const version = "0.29.0-beta.1";
10
+ const version = "0.31.0-beta.1";
11
11
 
12
12
  const module = defineNuxtModule({
13
13
  meta: {
@@ -113,6 +113,13 @@ const module = defineNuxtModule({
113
113
  watch: nuxt.options.dev,
114
114
  priority: 10
115
115
  });
116
+ addComponentsDir({
117
+ path: resolve(runtimeDir, "components/forms", "radio-group"),
118
+ prefix: options.prefix,
119
+ global: options.global,
120
+ watch: nuxt.options.dev,
121
+ priority: 10
122
+ });
116
123
  addComponentsDir({
117
124
  path: resolve(runtimeDir, "components", "misc"),
118
125
  prefix: options.prefix,
@@ -422,4 +422,4 @@ defineExpose({
422
422
  </slot>
423
423
  </TableFooter>
424
424
  </TableRoot>
425
- </template>.
425
+ </template>
@@ -2,10 +2,6 @@
2
2
  import type { NAvatarGroupProps } from '../../types'
3
3
  import NAvatarGroupDefaultSlot from '../slots/AvatarGroupDefault'
4
4
 
5
- defineOptions({
6
- inheritAttrs: false,
7
- })
8
-
9
5
  const props = withDefaults(defineProps<NAvatarGroupProps>(), {
10
6
  max: 3,
11
7
  })
@@ -14,11 +10,11 @@ const props = withDefaults(defineProps<NAvatarGroupProps>(), {
14
10
  <template>
15
11
  <div
16
12
  avatar-group
17
- v-bind="{ ...$attrs, size }"
13
+ :size
18
14
  :class="una?.avatarGroup"
19
15
  >
20
16
  <NAvatarGroupDefaultSlot
21
- :max="max"
17
+ :max
22
18
  :avatar="props"
23
19
  >
24
20
  <slot />
@@ -1,21 +1,17 @@
1
1
  <script setup lang="ts">
2
2
  import type { NLabelProps } from '../../types'
3
+ import { reactiveOmit } from '@vueuse/core'
3
4
  import { Label } from 'radix-vue'
4
- import { computed } from 'vue'
5
5
  import { cn } from '../../utils'
6
6
 
7
7
  const props = defineProps<NLabelProps>()
8
8
 
9
- const delegatedProps = computed(() => {
10
- const { class: _, ...delegated } = props
11
-
12
- return delegated
13
- })
9
+ const rootProps = reactiveOmit(props, ['label', 'class'])
14
10
  </script>
15
11
 
16
12
  <template>
17
13
  <Label
18
- v-bind="delegatedProps"
14
+ v-bind="rootProps"
19
15
  :class="
20
16
  cn(
21
17
  'label-base',
@@ -23,6 +19,8 @@ const delegatedProps = computed(() => {
23
19
  )
24
20
  "
25
21
  >
26
- <slot />
22
+ <slot>
23
+ {{ label }}
24
+ </slot>
27
25
  </Label>
28
26
  </template>
@@ -245,6 +245,10 @@ declare global {
245
245
  type __VLS_PrettifyGlobal<T> = {
246
246
  [K in keyof T]: T[K];
247
247
  } & {};
248
+ type __VLS_PickFunctionalComponentCtx<T, K> = NonNullable<__VLS_PickNotAny<'__ctx' extends keyof __VLS_PickNotAny<K, {}> ? K extends {
249
+ __ctx?: infer Ctx;
250
+ } ? Ctx : never : any, T extends (props: any, ctx: infer Ctx) => any ? Ctx : any>>;
251
+ type __VLS_UseTemplateRef<T> = Readonly<import('vue').ShallowRef<T | null>>;
248
252
  function __VLS_getVForSourceType(source: number): [number, number, number][];
249
253
  function __VLS_getVForSourceType(source: string): [string, number, number][];
250
254
  function __VLS_getVForSourceType<T extends any[]>(source: T): [
@@ -277,7 +281,7 @@ declare global {
277
281
  ][];
278
282
  function __VLS_getSlotParams<T>(slot: T): Parameters<__VLS_PickNotAny<NonNullable<T>, (...args: any[]) => any>>;
279
283
  function __VLS_getSlotParam<T>(slot: T): Parameters<__VLS_PickNotAny<NonNullable<T>, (...args: any[]) => any>>[0];
280
- function __VLS_directiveAsFunction<T extends import('vue').Directive>(dir: T): T extends (...args: any) => any ? T | __VLS_unknownDirective : NonNullable<(T & Record<string, __VLS_unknownDirective>)['created' | 'beforeMount' | 'mounted' | 'beforeUpdate' | 'updated' | 'beforeUnmount' | 'unmounted']>;
284
+ function __VLS_asFunctionalDirective<T>(dir: T): T extends import('vue').ObjectDirective ? NonNullable<T['created' | 'beforeMount' | 'mounted' | 'beforeUpdate' | 'updated' | 'beforeUnmount' | 'unmounted']> : T extends (...args: any) => any ? T : __VLS_unknownDirective;
281
285
  function __VLS_withScope<T, K>(ctx: T, scope: K): ctx is T & K;
282
286
  function __VLS_makeOptional<T>(t: T): {
283
287
  [K in keyof T]?: T[K];
@@ -311,9 +315,6 @@ declare global {
311
315
  };
312
316
  function __VLS_elementAsFunction<T>(tag: T, endTag?: T): (_: T & Record<string, unknown>) => void;
313
317
  function __VLS_functionalComponentArgsRest<T extends (...args: any) => any>(t: T): 2 extends Parameters<T>['length'] ? [any] : [];
314
- function __VLS_pickFunctionalComponentCtx<T, K>(comp: T, compInstance: K): NonNullable<__VLS_PickNotAny<'__ctx' extends keyof __VLS_PickNotAny<K, {}> ? K extends {
315
- __ctx?: infer Ctx;
316
- } ? Ctx : never : any, T extends (props: any, ctx: infer Ctx) => any ? Ctx : any>>;
317
318
  function __VLS_normalizeSlot<S>(s: S): S extends () => infer R ? (props: {}) => R : S;
318
319
  function __VLS_tryAsConstant<const T>(t: T): T;
319
320
  }
@@ -1,7 +1,7 @@
1
1
  <script setup lang="ts">
2
2
  import type { NAvatarAvatarFallbackProps } from '../../../types'
3
3
  import { AvatarFallback } from 'radix-vue'
4
- import { cn } from '../../../utils'
4
+ import { cn, omitProps } from '../../../utils'
5
5
  import Icon from '../Icon.vue'
6
6
 
7
7
  const props = withDefaults(defineProps<NAvatarAvatarFallbackProps>(), {
@@ -15,7 +15,7 @@ const props = withDefaults(defineProps<NAvatarAvatarFallbackProps>(), {
15
15
  >
16
16
  <component
17
17
  :is="as"
18
- v-bind="props"
18
+ v-bind="omitProps(props, ['label', 'una', 'icon'])"
19
19
  :class="cn(
20
20
  'avatar-fallback',
21
21
  una?.avatarFallback,
@@ -1,14 +1,14 @@
1
1
  <script setup lang="ts">
2
2
  import type { NAvatarImageProps } from '../../../types'
3
3
  import { AvatarImage } from 'radix-vue'
4
- import { cn } from '../../../utils'
4
+ import { cn, omitProps } from '../../../utils'
5
5
 
6
6
  const props = defineProps<NAvatarImageProps>()
7
7
  </script>
8
8
 
9
9
  <template>
10
10
  <AvatarImage
11
- v-bind="props"
11
+ v-bind="omitProps(props, ['class', 'una'])"
12
12
  :src="src!"
13
13
  :class="cn(
14
14
  'avatar-image',
@@ -45,6 +45,7 @@ const id = computed(() => props.id ?? randomId('checkbox'))
45
45
  'peer checkbox',
46
46
  props.class,
47
47
  )"
48
+ :checkbox
48
49
  >
49
50
  <CheckboxIndicator
50
51
  :force-mount
@@ -0,0 +1,50 @@
1
+ <script setup lang="ts">
2
+ import type { NRadioGroupProps } from '../../../types'
3
+ import { reactivePick } from '@vueuse/core'
4
+ import { RadioGroupRoot, type RadioGroupRootEmits, useForwardPropsEmits } from 'radix-vue'
5
+ import { cn } from '../../../utils'
6
+ import RadioGroupItem from './RadioGroupItem.vue'
7
+
8
+ const props = withDefaults(defineProps<NRadioGroupProps>(), {
9
+ radioGroup: 'primary',
10
+ size: 'md',
11
+ square: '1em',
12
+ })
13
+ const emits = defineEmits<RadioGroupRootEmits>()
14
+
15
+ const rootProps = reactivePick(props, [
16
+ 'as',
17
+ 'asChild',
18
+ 'defaultValue',
19
+ 'dir',
20
+ 'disabled',
21
+ 'loop',
22
+ 'modelValue',
23
+ 'name',
24
+ 'orientation',
25
+ 'required',
26
+ ])
27
+
28
+ const forwarded = useForwardPropsEmits(rootProps, emits)
29
+ </script>
30
+
31
+ <template>
32
+ <RadioGroupRoot
33
+ :class="cn(
34
+ 'radio-group',
35
+ orientation === 'horizontal' ? 'radio-group-orientation-horizontal' : 'radio-group-orientation-vertical',
36
+ una?.radioGroup,
37
+ props.class,
38
+ )"
39
+ v-bind="forwarded"
40
+ >
41
+ <slot>
42
+ <RadioGroupItem
43
+ v-for="item in items"
44
+ :key="item.value"
45
+ v-bind="{ rounded, icon, size, square, radioGroup, ...item }"
46
+ :una="{ ...una, ...item.una }"
47
+ />
48
+ </slot>
49
+ </RadioGroupRoot>
50
+ </template>
@@ -0,0 +1,95 @@
1
+ <script setup lang="ts">
2
+ import type { NRadioGroupItemProps } from '../../../types'
3
+ import { reactivePick } from '@vueuse/core'
4
+ import {
5
+ RadioGroupIndicator,
6
+ RadioGroupItem,
7
+ useForwardProps,
8
+ } from 'radix-vue'
9
+ import { cn, randomId } from '../../../utils'
10
+ import Icon from '../../elements/Icon.vue'
11
+ import Label from '../../elements/Label.vue'
12
+
13
+ defineOptions({
14
+ inheritAttrs: false,
15
+ })
16
+
17
+ const props = withDefaults(defineProps<NRadioGroupItemProps>(), {
18
+ icon: 'radio-group-indicator-icon',
19
+ radioGroup: 'primary',
20
+ size: 'md',
21
+ square: '1em',
22
+ })
23
+
24
+ const id = props.id || randomId('radio-group')
25
+
26
+ const delegatedProps = reactivePick(props, [
27
+ 'as',
28
+ 'disabled',
29
+ 'id',
30
+ 'name',
31
+ 'required',
32
+ 'value',
33
+ ])
34
+
35
+ const forwardedProps = useForwardProps(delegatedProps)
36
+ </script>
37
+
38
+ <template>
39
+ <div
40
+ :class="cn(
41
+ 'radio-group-item-wrapper',
42
+ una?.radioGroupItemWrapper,
43
+ )"
44
+ :radio-group="radioGroup"
45
+ >
46
+ <RadioGroupItem
47
+ as-child
48
+ v-bind="forwardedProps"
49
+ >
50
+ <button
51
+ :id
52
+ :class="
53
+ cn(
54
+ 'radio-group-item',
55
+ una?.radioGroupItem,
56
+ props.class,
57
+ )
58
+ "
59
+ :square
60
+ :size
61
+ :rounded
62
+ >
63
+ <RadioGroupIndicator
64
+ :class="cn(
65
+ 'radio-group-indicator',
66
+ una?.radioGroupIndicator,
67
+ )"
68
+ >
69
+ <slot name="icon">
70
+ <Icon
71
+ :name="icon"
72
+ :class="cn(
73
+ 'radio-group-indicator-icon-base',
74
+ una?.radioGroupIndicatorIcon,
75
+ )"
76
+ />
77
+ </slot>
78
+ </RadioGroupIndicator>
79
+ </button>
80
+ </RadioGroupItem>
81
+
82
+ <slot name="label">
83
+ <Label
84
+ v-if="props.label"
85
+ :for="props.id ?? id"
86
+ :class="cn(
87
+ 'radio-group-item-label',
88
+ una?.radioGroupItemLabel,
89
+ )"
90
+ >
91
+ {{ label }}
92
+ </Label>
93
+ </slot>
94
+ </div>
95
+ </template>
@@ -178,7 +178,6 @@ function shuffleTheme(): void {
178
178
  <div class="flex space-x-3">
179
179
  <Button
180
180
  btn="solid-gray block"
181
- size="xs"
182
181
  label="Reset"
183
182
  leading="i-radix-icons-reload"
184
183
  @click="reset"
@@ -32,8 +32,9 @@ export default defineComponent({
32
32
  return h(Avatar, {
33
33
  // TODO: add `more` configuration
34
34
  class: "avatar-(soft group-margin)",
35
+ size: props.avatar?.size,
35
36
  label: `+${countChildren.value - props.max}`,
36
- una: { avatarLabel: `${props.avatar?.una?.avatarGroupLabel} avatar-group-label` }
37
+ una: { avatarLabel: `${props.avatar?.una?.avatarGroupLabel ?? ""} avatar-group-label` }
37
38
  });
38
39
  });
39
40
  return () => [
@@ -23,6 +23,7 @@ export * from './pagination.js';
23
23
  export * from './popover.js';
24
24
  export * from './progress.js';
25
25
  export * from './radio.js';
26
+ export * from './radio-group.js';
26
27
  export * from './select.js';
27
28
  export * from './separator.js';
28
29
  export * from './skeleton.js';
@@ -23,6 +23,7 @@ export * from "./pagination.js";
23
23
  export * from "./popover.js";
24
24
  export * from "./progress.js";
25
25
  export * from "./radio.js";
26
+ export * from "./radio-group.js";
26
27
  export * from "./select.js";
27
28
  export * from "./separator.js";
28
29
  export * from "./skeleton.js";
@@ -4,5 +4,6 @@ interface BaseExtensions {
4
4
  class?: HTMLAttributes['class'];
5
5
  }
6
6
  export interface NLabelProps extends BaseExtensions, LabelProps {
7
+ label?: string;
7
8
  }
8
9
  export {};
@@ -0,0 +1,67 @@
1
+ import type { RadioGroupItemProps, RadioGroupRootProps } from 'radix-vue';
2
+ import type { HTMLAttributes } from 'vue';
3
+ interface BaseProps {
4
+ class?: HTMLAttributes['class'];
5
+ /**
6
+ * Set the size of the avatar.
7
+ */
8
+ size?: HTMLAttributes['class'];
9
+ /**
10
+ * Set the height and width of the avatar.
11
+ */
12
+ square?: HTMLAttributes['class'];
13
+ /**
14
+ * Set the border radius of the avatar.
15
+ */
16
+ rounded?: HTMLAttributes['class'];
17
+ /**
18
+ * Update the icon of the radio.
19
+ */
20
+ icon?: HTMLAttributes['class'];
21
+ }
22
+ export interface NRadioGroupProps extends BaseProps, RadioGroupRootProps {
23
+ items?: NRadioGroupItemProps[];
24
+ /**
25
+ * Switch the position of label and radio.
26
+ *
27
+ * @default false
28
+ */
29
+ reverse?: boolean;
30
+ /**
31
+ * Allows you to add `UnaUI` radio preset properties,
32
+ * Think of it as a shortcut for adding options or variants to the preset if available.
33
+ *
34
+ * @see https://github.com/una-ui/una-ui/blob/main/packages/preset/src/_shortcuts/radio-group.ts
35
+ * @example
36
+ * radio-group="green"
37
+ */
38
+ radioGroup?: HTMLAttributes['class'];
39
+ /**
40
+ * `UnaUI` preset configuration
41
+ *
42
+ * @see https://github.com/una-ui/una-ui/blob/main/packages/preset/src/_shortcuts/radio.ts
43
+ */
44
+ una?: NRadioGroupUnaProps;
45
+ }
46
+ export interface NRadioGroupItemProps extends BaseProps, RadioGroupItemProps {
47
+ label?: string;
48
+ /**
49
+ * Allows you to add `UnaUI` radio preset properties,
50
+ * Think of it as a shortcut for adding options or variants to the preset if available.
51
+ *
52
+ * @see https://github.com/una-ui/una-ui/blob/main/packages/preset/src/_shortcuts/radio-group.ts
53
+ * @example
54
+ * radio-group="green"
55
+ */
56
+ radioGroup?: HTMLAttributes['class'];
57
+ una?: NRadioGroupUnaProps;
58
+ }
59
+ export interface NRadioGroupUnaProps {
60
+ radioGroup?: HTMLAttributes['class'];
61
+ radioGroupItemWrapper?: HTMLAttributes['class'];
62
+ radioGroupItem?: HTMLAttributes['class'];
63
+ radioGroupItemLabel?: HTMLAttributes['class'];
64
+ radioGroupIndicator?: HTMLAttributes['class'];
65
+ radioGroupIndicatorIcon?: HTMLAttributes['class'];
66
+ }
67
+ export {};
File without changes
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@una-ui/nuxt",
3
3
  "type": "module",
4
- "version": "0.29.0-beta.1",
4
+ "version": "0.31.0-beta.1",
5
5
  "description": "Nuxt module for @una-ui",
6
6
  "author": "Phojie Rengel <phojrengel@gmail.com>",
7
7
  "license": "MIT",
@@ -27,34 +27,33 @@
27
27
  ],
28
28
  "dependencies": {
29
29
  "@headlessui/vue": "^1.7.23",
30
- "@iconify-json/heroicons": "^1.2.1",
31
- "@iconify-json/lucide": "^1.2.15",
30
+ "@iconify-json/lucide": "^1.2.16",
32
31
  "@iconify-json/radix-icons": "^1.2.1",
33
32
  "@iconify-json/tabler": "^1.2.8",
34
- "@nuxt/kit": "^3.14.159",
33
+ "@nuxt/kit": "^3.14.1592",
35
34
  "@nuxtjs/color-mode": "^3.5.2",
36
35
  "@tanstack/vue-table": "^8.20.5",
37
- "@unocss/core": "^0.63.6",
38
- "@unocss/nuxt": "^0.63.6",
39
- "@unocss/preset-attributify": "^0.63.6",
40
- "@unocss/preset-icons": "^0.63.6",
41
- "@vueuse/core": "^11.3.0",
42
- "@vueuse/integrations": "^11.3.0",
43
- "@vueuse/nuxt": "^11.3.0",
36
+ "@unocss/core": "^0.64.1",
37
+ "@unocss/nuxt": "^0.64.1",
38
+ "@unocss/preset-attributify": "^0.64.1",
39
+ "@unocss/preset-icons": "^0.64.1",
40
+ "@vueuse/core": "^12.0.0",
41
+ "@vueuse/integrations": "^12.0.0",
42
+ "@vueuse/nuxt": "^12.0.0",
44
43
  "clsx": "^2.1.1",
45
44
  "ohash": "^1.1.4",
46
- "radix-vue": "^1.9.7",
47
- "tailwind-merge": "^2.5.4",
48
- "typescript": "^5.6.3",
49
- "unocss": "^0.63.6",
45
+ "radix-vue": "^1.9.10",
46
+ "tailwind-merge": "^2.5.5",
47
+ "typescript": "5.6.3",
48
+ "unocss": "^0.64.1",
50
49
  "unocss-preset-animations": "^1.1.0",
51
- "@una-ui/extractor-vue-script": "^0.29.0-beta.1",
52
- "@una-ui/preset": "^0.29.0-beta.1"
50
+ "@una-ui/extractor-vue-script": "^0.31.0-beta.1",
51
+ "@una-ui/preset": "^0.31.0-beta.1"
53
52
  },
54
53
  "devDependencies": {
55
54
  "@nuxt/module-builder": "^0.8.4",
56
- "@nuxt/schema": "^3.14.159",
57
- "nuxt": "^3.14.159"
55
+ "@nuxt/schema": "^3.14.1592",
56
+ "nuxt": "^3.14.1592"
58
57
  },
59
58
  "publishConfig": {
60
59
  "access": "public"