@nuxt/ui 3.0.0-alpha.0 → 3.0.0-alpha.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 +1 -1
- package/cli/node_modules/.ignored/citty/LICENSE +36 -0
- package/cli/node_modules/.ignored/citty/README.md +134 -0
- package/cli/node_modules/.ignored/citty/dist/index.cjs +475 -0
- package/cli/node_modules/.ignored/citty/dist/index.d.cts +80 -0
- package/cli/node_modules/.ignored/citty/dist/index.d.mts +80 -0
- package/cli/node_modules/.ignored/citty/dist/index.d.ts +80 -0
- package/cli/node_modules/.ignored/citty/dist/index.mjs +463 -0
- package/cli/node_modules/.ignored/citty/package.json +49 -0
- package/cli/node_modules/.ignored/consola/LICENSE +47 -0
- package/cli/node_modules/.ignored/consola/README.md +318 -0
- package/cli/node_modules/.ignored/consola/core.d.ts +1 -0
- package/cli/node_modules/.ignored/consola/dist/basic.cjs +32 -0
- package/cli/node_modules/.ignored/consola/dist/basic.d.ts +9 -0
- package/cli/node_modules/.ignored/consola/dist/basic.mjs +24 -0
- package/cli/node_modules/.ignored/consola/dist/browser.cjs +80 -0
- package/cli/node_modules/.ignored/consola/dist/browser.d.ts +7 -0
- package/cli/node_modules/.ignored/consola/dist/browser.mjs +72 -0
- package/cli/node_modules/.ignored/consola/dist/chunks/prompt.cjs +436 -0
- package/cli/node_modules/.ignored/consola/dist/chunks/prompt.mjs +429 -0
- package/cli/node_modules/.ignored/consola/dist/core.cjs +415 -0
- package/cli/node_modules/.ignored/consola/dist/core.d.ts +124 -0
- package/cli/node_modules/.ignored/consola/dist/core.mjs +410 -0
- package/cli/node_modules/.ignored/consola/dist/index.cjs +21 -0
- package/cli/node_modules/.ignored/consola/dist/index.d.ts +9 -0
- package/cli/node_modules/.ignored/consola/dist/index.mjs +8 -0
- package/cli/node_modules/.ignored/consola/dist/shared/consola.06ad8a64.mjs +62 -0
- package/cli/node_modules/.ignored/consola/dist/shared/consola.36c0034f.mjs +636 -0
- package/cli/node_modules/.ignored/consola/dist/shared/consola.4bbae468.cjs +645 -0
- package/cli/node_modules/.ignored/consola/dist/shared/consola.deac7d5a.cjs +65 -0
- package/cli/node_modules/.ignored/consola/dist/utils.cjs +308 -0
- package/cli/node_modules/.ignored/consola/dist/utils.d.ts +169 -0
- package/cli/node_modules/.ignored/consola/dist/utils.mjs +284 -0
- package/cli/node_modules/.ignored/consola/lib/index.cjs +9 -0
- package/cli/node_modules/.ignored/consola/package.json +101 -0
- package/cli/node_modules/.ignored/consola/utils.d.ts +1 -0
- package/cli/node_modules/.ignored/pathe/LICENSE +44 -0
- package/cli/node_modules/.ignored/pathe/README.md +69 -0
- package/cli/node_modules/.ignored/pathe/dist/index.cjs +23 -0
- package/cli/node_modules/.ignored/pathe/dist/index.d.cts +36 -0
- package/cli/node_modules/.ignored/pathe/dist/index.d.mts +36 -0
- package/cli/node_modules/.ignored/pathe/dist/index.d.ts +36 -0
- package/cli/node_modules/.ignored/pathe/dist/index.mjs +1 -0
- package/cli/node_modules/.ignored/pathe/dist/shared/pathe.1f0a373c.cjs +238 -0
- package/cli/node_modules/.ignored/pathe/dist/shared/pathe.ff20891b.mjs +221 -0
- package/cli/node_modules/.ignored/pathe/dist/utils.cjs +58 -0
- package/cli/node_modules/.ignored/pathe/dist/utils.d.cts +5 -0
- package/cli/node_modules/.ignored/pathe/dist/utils.d.mts +5 -0
- package/cli/node_modules/.ignored/pathe/dist/utils.d.ts +5 -0
- package/cli/node_modules/.ignored/pathe/dist/utils.mjs +54 -0
- package/cli/node_modules/.ignored/pathe/package.json +48 -0
- package/cli/node_modules/.ignored/pathe/utils.d.ts +1 -0
- package/cli/node_modules/.ignored/scule/LICENSE +21 -0
- package/cli/node_modules/.ignored/scule/README.md +149 -0
- package/cli/node_modules/.ignored/scule/dist/index.cjs +92 -0
- package/cli/node_modules/.ignored/scule/dist/index.d.cts +57 -0
- package/cli/node_modules/.ignored/scule/dist/index.d.mts +57 -0
- package/cli/node_modules/.ignored/scule/dist/index.d.ts +57 -0
- package/cli/node_modules/.ignored/scule/dist/index.mjs +80 -0
- package/cli/node_modules/.ignored/scule/package.json +43 -0
- package/cli/node_modules/.package-lock.json +33 -0
- package/dist/module.json +3 -3
- package/dist/module.mjs +7 -55
- package/dist/runtime/components/Accordion.vue +49 -6
- package/dist/runtime/components/Alert.vue +58 -6
- package/dist/runtime/components/App.vue +12 -2
- package/dist/runtime/components/Avatar.vue +27 -6
- package/dist/runtime/components/AvatarGroup.vue +30 -6
- package/dist/runtime/components/Badge.vue +28 -6
- package/dist/runtime/components/Breadcrumb.vue +44 -6
- package/dist/runtime/components/Button.vue +33 -6
- package/dist/runtime/components/ButtonGroup.vue +30 -6
- package/dist/runtime/components/Card.vue +25 -6
- package/dist/runtime/components/Checkbox.vue +45 -6
- package/dist/runtime/components/Chip.vue +39 -6
- package/dist/runtime/components/Collapsible.vue +27 -6
- package/dist/runtime/components/CommandPalette.vue +99 -6
- package/dist/runtime/components/Container.vue +22 -6
- package/dist/runtime/components/ContextMenu.vue +58 -6
- package/dist/runtime/components/ContextMenuContent.vue +18 -4
- package/dist/runtime/components/Drawer.vue +48 -6
- package/dist/runtime/components/DropdownMenu.vue +66 -6
- package/dist/runtime/components/DropdownMenuContent.vue +22 -4
- package/dist/runtime/components/Form.vue +34 -13
- package/dist/runtime/components/FormField.vue +41 -16
- package/dist/runtime/components/Icon.vue +12 -2
- package/dist/runtime/components/Input.vue +46 -6
- package/dist/runtime/components/InputMenu.vue +113 -6
- package/dist/runtime/components/Kbd.vue +28 -6
- package/dist/runtime/components/Link.vue +81 -17
- package/dist/runtime/components/LinkBase.vue +12 -2
- package/dist/runtime/components/Modal.vue +69 -6
- package/dist/runtime/components/NavigationMenu.vue +76 -6
- package/dist/runtime/components/Pagination.vue +99 -6
- package/dist/runtime/components/Popover.vue +42 -6
- package/dist/runtime/components/Progress.vue +44 -6
- package/dist/runtime/components/RadioGroup.vue +55 -7
- package/dist/runtime/components/Select.vue +88 -6
- package/dist/runtime/components/SelectMenu.vue +104 -6
- package/dist/runtime/components/Separator.vue +41 -6
- package/dist/runtime/components/Skeleton.vue +18 -6
- package/dist/runtime/components/Slideover.vue +67 -6
- package/dist/runtime/components/Slider.vue +36 -6
- package/dist/runtime/components/Switch.vue +50 -6
- package/dist/runtime/components/Tabs.vue +59 -6
- package/dist/runtime/components/Textarea.vue +46 -6
- package/dist/runtime/components/Toast.vue +55 -6
- package/dist/runtime/components/Toaster.vue +27 -6
- package/dist/runtime/components/Tooltip.vue +42 -6
- package/dist/runtime/composables/useAvatarGroup.d.ts +2 -2
- package/dist/runtime/composables/useButtonGroup.d.ts +3 -3
- package/dist/runtime/composables/useFormField.d.ts +6 -3
- package/dist/runtime/composables/useFormField.js +11 -7
- package/dist/runtime/composables/useModal.d.ts +1 -1
- package/dist/runtime/composables/useSlideover.d.ts +1 -1
- package/dist/runtime/composables/useToast.d.ts +1 -1
- package/dist/runtime/index.css +1 -0
- package/dist/runtime/plugins/colors.d.ts +2 -0
- package/dist/runtime/plugins/modal.d.ts +2 -0
- package/dist/runtime/plugins/slideover.d.ts +2 -0
- package/dist/runtime/types/form.d.ts +1 -2
- package/dist/runtime/utils/link.d.ts +23 -55
- package/package.json +13 -14
- package/dist/runtime/assets/css/animations.css +0 -1
- package/dist/runtime/components/Accordion.vue.d.ts +0 -492
- package/dist/runtime/components/Alert.vue.d.ts +0 -548
- package/dist/runtime/components/App.vue.d.ts +0 -25
- package/dist/runtime/components/Avatar.vue.d.ts +0 -384
- package/dist/runtime/components/AvatarGroup.vue.d.ts +0 -381
- package/dist/runtime/components/Badge.vue.d.ts +0 -422
- package/dist/runtime/components/Breadcrumb.vue.d.ts +0 -307
- package/dist/runtime/components/Button.vue.d.ts +0 -949
- package/dist/runtime/components/ButtonGroup.vue.d.ts +0 -182
- package/dist/runtime/components/Card.vue.d.ts +0 -191
- package/dist/runtime/components/Checkbox.vue.d.ts +0 -819
- package/dist/runtime/components/Chip.vue.d.ts +0 -590
- package/dist/runtime/components/Collapsible.vue.d.ts +0 -159
- package/dist/runtime/components/CommandPalette.vue.d.ts +0 -684
- package/dist/runtime/components/Container.vue.d.ts +0 -27
- package/dist/runtime/components/ContextMenu.vue.d.ts +0 -796
- package/dist/runtime/components/ContextMenuContent.vue.d.ts +0 -0
- package/dist/runtime/components/Drawer.vue.d.ts +0 -343
- package/dist/runtime/components/DropdownMenu.vue.d.ts +0 -815
- package/dist/runtime/components/DropdownMenuContent.vue.d.ts +0 -0
- package/dist/runtime/components/Form.vue.d.ts +0 -39
- package/dist/runtime/components/FormField.vue.d.ts +0 -356
- package/dist/runtime/components/Icon.vue.d.ts +0 -17
- package/dist/runtime/components/Input.vue.d.ts +0 -1137
- package/dist/runtime/components/InputMenu.vue.d.ts +0 -2121
- package/dist/runtime/components/Kbd.vue.d.ts +0 -169
- package/dist/runtime/components/Link.vue.d.ts +0 -76
- package/dist/runtime/components/LinkBase.vue.d.ts +0 -49
- package/dist/runtime/components/Modal.vue.d.ts +0 -319
- package/dist/runtime/components/NavigationMenu.vue.d.ts +0 -1789
- package/dist/runtime/components/Pagination.vue.d.ts +0 -295
- package/dist/runtime/components/Popover.vue.d.ts +0 -197
- package/dist/runtime/components/Progress.vue.d.ts +0 -1781
- package/dist/runtime/components/RadioGroup.vue.d.ts +0 -1715
- package/dist/runtime/components/Select.vue.d.ts +0 -1569
- package/dist/runtime/components/SelectMenu.vue.d.ts +0 -1661
- package/dist/runtime/components/Separator.vue.d.ts +0 -0
- package/dist/runtime/components/Skeleton.vue.d.ts +0 -26
- package/dist/runtime/components/Slideover.vue.d.ts +0 -375
- package/dist/runtime/components/Slider.vue.d.ts +0 -0
- package/dist/runtime/components/Switch.vue.d.ts +0 -1676
- package/dist/runtime/components/Tabs.vue.d.ts +0 -934
- package/dist/runtime/components/Textarea.vue.d.ts +0 -1133
- package/dist/runtime/components/Toast.vue.d.ts +0 -0
- package/dist/runtime/components/Toaster.vue.d.ts +0 -362
- package/dist/runtime/components/Tooltip.vue.d.ts +0 -248
|
@@ -1,9 +1,47 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import { tv } from
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { tv, type VariantProps } from 'tailwind-variants'
|
|
3
|
+
import type { ProgressRootProps, ProgressRootEmits } from 'radix-vue'
|
|
4
|
+
import type { AppConfig } from '@nuxt/schema'
|
|
5
|
+
import _appConfig from '#build/app.config'
|
|
6
|
+
import theme from '#build/ui/progress'
|
|
7
|
+
|
|
8
|
+
const appConfig = _appConfig as AppConfig & { ui: { progress: Partial<typeof theme> } }
|
|
9
|
+
|
|
10
|
+
const progress = tv({ extend: tv(theme), ...(appConfig.ui?.progress || {}) })
|
|
11
|
+
|
|
12
|
+
type ProgressVariants = VariantProps<typeof progress>
|
|
13
|
+
|
|
14
|
+
export interface ProgressProps extends Pick<ProgressRootProps, 'getValueLabel' | 'modelValue'> {
|
|
15
|
+
/**
|
|
16
|
+
* The element or component this component should render as.
|
|
17
|
+
* @defaultValue `div`
|
|
18
|
+
*/
|
|
19
|
+
as?: any
|
|
20
|
+
/** The maximum progress value. */
|
|
21
|
+
max?: number | Array<any>
|
|
22
|
+
/** Display the current progress value. */
|
|
23
|
+
status?: boolean
|
|
24
|
+
/** Whether the progress is visually inverted. */
|
|
25
|
+
inverted?: boolean
|
|
26
|
+
size?: ProgressVariants['size']
|
|
27
|
+
color?: ProgressVariants['color']
|
|
28
|
+
/**
|
|
29
|
+
* The orientation of the progress bar.
|
|
30
|
+
* @defaultValue 'horizontal'
|
|
31
|
+
*/
|
|
32
|
+
orientation?: ProgressVariants['orientation']
|
|
33
|
+
animation?: ProgressVariants['animation']
|
|
34
|
+
class?: any
|
|
35
|
+
ui?: Partial<typeof progress.slots>
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface ProgressEmits extends ProgressRootEmits {}
|
|
39
|
+
|
|
40
|
+
export type ProgressSlots = {
|
|
41
|
+
status(props: { percent?: number }): any
|
|
42
|
+
} & {
|
|
43
|
+
[key: string]: (props: { step: number }) => any
|
|
44
|
+
}
|
|
7
45
|
</script>
|
|
8
46
|
|
|
9
47
|
<script setup lang="ts">
|
|
@@ -1,9 +1,57 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import { tv } from
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { tv, type VariantProps } from 'tailwind-variants'
|
|
3
|
+
import type { RadioGroupRootProps, RadioGroupRootEmits, RadioGroupItemProps } from 'radix-vue'
|
|
4
|
+
import type { AppConfig } from '@nuxt/schema'
|
|
5
|
+
import _appConfig from '#build/app.config'
|
|
6
|
+
import theme from '#build/ui/radio-group'
|
|
7
|
+
import type { AcceptableValue } from '../types/utils'
|
|
8
|
+
|
|
9
|
+
const appConfig = _appConfig as AppConfig & { ui: { radioGroup: Partial<typeof theme> } }
|
|
10
|
+
|
|
11
|
+
const radioGroup = tv({ extend: tv(theme), ...(appConfig.ui?.radioGroup || {}) })
|
|
12
|
+
|
|
13
|
+
type RadioGroupVariants = VariantProps<typeof radioGroup>
|
|
14
|
+
|
|
15
|
+
export interface RadioGroupItem extends Pick<RadioGroupItemProps, 'disabled' | 'value'> {
|
|
16
|
+
label?: string
|
|
17
|
+
description?: string
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface RadioGroupProps<T> extends Pick<RadioGroupRootProps, 'defaultValue' | 'disabled' | 'loop' | 'modelValue' | 'name' | 'required'> {
|
|
21
|
+
/**
|
|
22
|
+
* The element or component this component should render as.
|
|
23
|
+
* @defaultValue `div`
|
|
24
|
+
*/
|
|
25
|
+
as?: any
|
|
26
|
+
legend?: string
|
|
27
|
+
/**
|
|
28
|
+
* When `items` is an array of objects, select the field to use as the value.
|
|
29
|
+
* @defaultValue 'value'
|
|
30
|
+
*/
|
|
31
|
+
valueKey?: string
|
|
32
|
+
items?: T[]
|
|
33
|
+
size?: RadioGroupVariants['size']
|
|
34
|
+
color?: RadioGroupVariants['color']
|
|
35
|
+
/**
|
|
36
|
+
* The orientation the radio buttons are laid out.
|
|
37
|
+
* @defaultValue 'vertical'
|
|
38
|
+
*/
|
|
39
|
+
orientation?: RadioGroupRootProps['orientation']
|
|
40
|
+
class?: any
|
|
41
|
+
ui?: Partial<typeof radioGroup.slots>
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export type RadioGroupEmits = RadioGroupRootEmits & {
|
|
45
|
+
change: [payload: Event]
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
type SlotProps<T> = (props: { item: T, modelValue?: string }) => any
|
|
49
|
+
|
|
50
|
+
export interface RadioGroupSlots<T> {
|
|
51
|
+
legend(props?: {}): any
|
|
52
|
+
label: SlotProps<T>
|
|
53
|
+
description: SlotProps<T>
|
|
54
|
+
}
|
|
7
55
|
</script>
|
|
8
56
|
|
|
9
57
|
<script setup lang="ts" generic="T extends RadioGroupItem | AcceptableValue">
|
|
@@ -21,7 +69,7 @@ const slots = defineSlots<RadioGroupSlots<T>>()
|
|
|
21
69
|
|
|
22
70
|
const rootProps = useForwardPropsEmits(reactivePick(props, 'as', 'modelValue', 'defaultValue', 'orientation', 'loop', 'required'), emits)
|
|
23
71
|
|
|
24
|
-
const { emitFormChange, emitFormInput, color, name, size, id: _id, disabled } = useFormField<RadioGroupProps<T>>(props)
|
|
72
|
+
const { emitFormChange, emitFormInput, color, name, size, id: _id, disabled } = useFormField<RadioGroupProps<T>>(props, { bind: false })
|
|
25
73
|
const id = _id.value ?? useId()
|
|
26
74
|
|
|
27
75
|
const ui = computed(() => radioGroup({
|
|
@@ -1,9 +1,91 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import { tv } from
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { tv, type VariantProps } from 'tailwind-variants'
|
|
3
|
+
import type { SelectRootProps, SelectRootEmits, SelectContentProps, SelectArrowProps, SelectItemProps } from 'radix-vue'
|
|
4
|
+
import type { AppConfig } from '@nuxt/schema'
|
|
5
|
+
import _appConfig from '#build/app.config'
|
|
6
|
+
import theme from '#build/ui/select'
|
|
7
|
+
import type { UseComponentIconsProps } from '../composables/useComponentIcons'
|
|
8
|
+
import type { AvatarProps, ChipProps, InputProps } from '../types'
|
|
9
|
+
import type { AcceptableValue, PartialString } from '../types/utils'
|
|
10
|
+
|
|
11
|
+
const appConfig = _appConfig as AppConfig & { ui: { select: Partial<typeof theme> } }
|
|
12
|
+
|
|
13
|
+
const select = tv({ extend: tv(theme), ...(appConfig.ui?.select || {}) })
|
|
14
|
+
|
|
15
|
+
export interface SelectItem extends Pick<SelectItemProps, 'disabled' | 'value'> {
|
|
16
|
+
label?: string
|
|
17
|
+
icon?: string
|
|
18
|
+
avatar?: AvatarProps
|
|
19
|
+
chip?: ChipProps
|
|
20
|
+
/**
|
|
21
|
+
* The item type.
|
|
22
|
+
* @defaultValue 'item'
|
|
23
|
+
*/
|
|
24
|
+
type?: 'label' | 'separator' | 'item'
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
type SelectVariants = VariantProps<typeof select>
|
|
28
|
+
|
|
29
|
+
export interface SelectProps<T> extends Omit<SelectRootProps, 'dir'>, UseComponentIconsProps {
|
|
30
|
+
id?: string
|
|
31
|
+
/** The placeholder text when the select is empty. */
|
|
32
|
+
placeholder?: string
|
|
33
|
+
color?: SelectVariants['color']
|
|
34
|
+
variant?: SelectVariants['variant']
|
|
35
|
+
size?: SelectVariants['size']
|
|
36
|
+
/**
|
|
37
|
+
* The icon displayed to open the menu.
|
|
38
|
+
* @defaultValue appConfig.ui.icons.chevronDown
|
|
39
|
+
*/
|
|
40
|
+
trailingIcon?: string
|
|
41
|
+
/**
|
|
42
|
+
* The icon displayed when an item is selected.
|
|
43
|
+
* @defaultValue appConfig.ui.icons.check
|
|
44
|
+
*/
|
|
45
|
+
selectedIcon?: string
|
|
46
|
+
/**
|
|
47
|
+
* The content of the menu.
|
|
48
|
+
* @defaultValue { side: 'bottom', sideOffset: 8, position: 'popper' }
|
|
49
|
+
*/
|
|
50
|
+
content?: Omit<SelectContentProps, 'as' | 'asChild' | 'forceMount'>
|
|
51
|
+
/**
|
|
52
|
+
* Display an arrow alongside the menu.
|
|
53
|
+
* @defaultValue false
|
|
54
|
+
*/
|
|
55
|
+
arrow?: boolean | Omit<SelectArrowProps, 'as' | 'asChild'>
|
|
56
|
+
/**
|
|
57
|
+
* Render the menu in a portal.
|
|
58
|
+
* @defaultValue true
|
|
59
|
+
*/
|
|
60
|
+
portal?: boolean
|
|
61
|
+
/**
|
|
62
|
+
* When `items` is an array of objects, select the field to use as the value.
|
|
63
|
+
* @defaultValue 'value'
|
|
64
|
+
*/
|
|
65
|
+
valueKey?: string
|
|
66
|
+
items?: T[] | T[][]
|
|
67
|
+
/** Highlight the ring color like a focus state. */
|
|
68
|
+
highlight?: boolean
|
|
69
|
+
class?: any
|
|
70
|
+
ui?: PartialString<typeof select.slots>
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export type SelectEmits = SelectRootEmits & {
|
|
74
|
+
change: [payload: Event]
|
|
75
|
+
blur: [payload: FocusEvent]
|
|
76
|
+
focus: [payload: FocusEvent]
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
type SlotProps<T> = (props: { item: T, index: number }) => any
|
|
80
|
+
|
|
81
|
+
export interface SelectSlots<T> {
|
|
82
|
+
'leading'(props: { modelValue: string, open: boolean, ui: any }): any
|
|
83
|
+
'trailing'(props: { modelValue: string, open: boolean, ui: any }): any
|
|
84
|
+
'item': SlotProps<T>
|
|
85
|
+
'item-leading': SlotProps<T>
|
|
86
|
+
'item-label': SlotProps<T>
|
|
87
|
+
'item-trailing': SlotProps<T>
|
|
88
|
+
}
|
|
7
89
|
</script>
|
|
8
90
|
|
|
9
91
|
<script setup lang="ts" generic="T extends SelectItem | AcceptableValue">
|
|
@@ -1,9 +1,107 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import { tv } from
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { tv, type VariantProps } from 'tailwind-variants'
|
|
3
|
+
import type { ComboboxRootProps, ComboboxRootEmits, ComboboxContentProps, ComboboxItemProps, ComboboxArrowProps } from 'radix-vue'
|
|
4
|
+
import type { AppConfig } from '@nuxt/schema'
|
|
5
|
+
import _appConfig from '#build/app.config'
|
|
6
|
+
import theme from '#build/ui/select-menu'
|
|
7
|
+
import type { UseComponentIconsProps } from '../composables/useComponentIcons'
|
|
8
|
+
import type { AvatarProps, ChipProps, InputProps } from '../types'
|
|
9
|
+
import type { AcceptableValue, ArrayOrWrapped, PartialString } from '../types/utils'
|
|
10
|
+
|
|
11
|
+
const appConfig = _appConfig as AppConfig & { ui: { selectMenu: Partial<typeof theme> } }
|
|
12
|
+
|
|
13
|
+
const selectMenu = tv({ extend: tv(theme), ...(appConfig.ui?.selectMenu || {}) })
|
|
14
|
+
|
|
15
|
+
export interface SelectMenuItem extends Pick<ComboboxItemProps, 'disabled'> {
|
|
16
|
+
label?: string
|
|
17
|
+
icon?: string
|
|
18
|
+
avatar?: AvatarProps
|
|
19
|
+
chip?: ChipProps
|
|
20
|
+
/**
|
|
21
|
+
* The item type.
|
|
22
|
+
* @defaultValue 'item'
|
|
23
|
+
*/
|
|
24
|
+
type?: 'label' | 'separator' | 'item'
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
type SelectMenuVariants = VariantProps<typeof selectMenu>
|
|
28
|
+
|
|
29
|
+
export interface SelectMenuProps<T> extends Pick<ComboboxRootProps<T>, 'modelValue' | 'defaultValue' | 'selectedValue' | 'open' | 'defaultOpen' | 'searchTerm' | 'multiple' | 'disabled' | 'name' | 'resetSearchTermOnBlur'>, UseComponentIconsProps {
|
|
30
|
+
id?: string
|
|
31
|
+
/** The placeholder text when the select is empty. */
|
|
32
|
+
placeholder?: string
|
|
33
|
+
/**
|
|
34
|
+
* Wether to display the search input or not.
|
|
35
|
+
* @defaultValue true
|
|
36
|
+
*/
|
|
37
|
+
search?: boolean
|
|
38
|
+
/** The placeholder text when the search input is empty. */
|
|
39
|
+
searchPlaceholder?: string
|
|
40
|
+
color?: SelectMenuVariants['color']
|
|
41
|
+
variant?: SelectMenuVariants['variant']
|
|
42
|
+
size?: SelectMenuVariants['size']
|
|
43
|
+
required?: boolean
|
|
44
|
+
/**
|
|
45
|
+
* The icon displayed to open the menu.
|
|
46
|
+
* @defaultValue appConfig.ui.icons.chevronDown
|
|
47
|
+
*/
|
|
48
|
+
trailingIcon?: string
|
|
49
|
+
/**
|
|
50
|
+
* The icon displayed when an item is selected.
|
|
51
|
+
* @defaultValue appConfig.ui.icons.check
|
|
52
|
+
*/
|
|
53
|
+
selectedIcon?: string
|
|
54
|
+
/**
|
|
55
|
+
* The content of the menu.
|
|
56
|
+
* @defaultValue { side: 'bottom', sideOffset: 8, position: 'popper' }
|
|
57
|
+
*/
|
|
58
|
+
content?: Omit<ComboboxContentProps, 'as' | 'asChild' | 'forceMount'>
|
|
59
|
+
/**
|
|
60
|
+
* Display an arrow alongside the menu.
|
|
61
|
+
* @defaultValue false
|
|
62
|
+
*/
|
|
63
|
+
arrow?: boolean | Omit<ComboboxArrowProps, 'as' | 'asChild'>
|
|
64
|
+
/**
|
|
65
|
+
* Render the menu in a portal.
|
|
66
|
+
* @defaultValue true
|
|
67
|
+
*/
|
|
68
|
+
portal?: boolean
|
|
69
|
+
/**
|
|
70
|
+
* Whether to filter items or not, can be an array of fields to filter.
|
|
71
|
+
* When `false`, items will not be filtered which is useful for custom filtering (useAsyncData, useFetch, etc.).
|
|
72
|
+
* @defaultValue ['label']
|
|
73
|
+
*/
|
|
74
|
+
filter?: boolean | string[]
|
|
75
|
+
/**
|
|
76
|
+
* When `items` is an array of objects, select the field to use as the value instead of the object itself.
|
|
77
|
+
* @defaultValue undefined
|
|
78
|
+
*/
|
|
79
|
+
valueKey?: keyof T
|
|
80
|
+
items?: T[] | T[][]
|
|
81
|
+
/** Highlight the ring color like a focus state. */
|
|
82
|
+
highlight?: boolean
|
|
83
|
+
class?: any
|
|
84
|
+
ui?: PartialString<typeof selectMenu.slots>
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export type SelectMenuEmits<T> = ComboboxRootEmits<T> & {
|
|
88
|
+
change: [payload: Event]
|
|
89
|
+
blur: [payload: FocusEvent]
|
|
90
|
+
focus: [payload: FocusEvent]
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
type SlotProps<T> = (props: { item: T, index: number }) => any
|
|
94
|
+
|
|
95
|
+
export type SelectMenuSlots<T> = {
|
|
96
|
+
'leading'(props: { modelValue: T, open: boolean, ui: any }): any
|
|
97
|
+
'default'(props: { modelValue: T, open: boolean }): any
|
|
98
|
+
'trailing'(props: { modelValue: T, open: boolean, ui: any }): any
|
|
99
|
+
'empty'(props: { searchTerm?: string }): any
|
|
100
|
+
'item': SlotProps<T>
|
|
101
|
+
'item-leading': SlotProps<T>
|
|
102
|
+
'item-label': SlotProps<T>
|
|
103
|
+
'item-trailing': SlotProps<T>
|
|
104
|
+
}
|
|
7
105
|
</script>
|
|
8
106
|
|
|
9
107
|
<script setup lang="ts" generic="T extends SelectMenuItem | AcceptableValue">
|
|
@@ -1,9 +1,44 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import { tv } from
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { tv, type VariantProps } from 'tailwind-variants'
|
|
3
|
+
import type { SeparatorProps as _SeparatorProps } from 'radix-vue'
|
|
4
|
+
import type { AppConfig } from '@nuxt/schema'
|
|
5
|
+
import _appConfig from '#build/app.config'
|
|
6
|
+
import theme from '#build/ui/separator'
|
|
7
|
+
import type { AvatarProps } from '../types'
|
|
8
|
+
|
|
9
|
+
const appConfig = _appConfig as AppConfig & { ui: { separator: Partial<typeof theme> } }
|
|
10
|
+
|
|
11
|
+
const separator = tv({ extend: tv(theme), ...(appConfig.ui?.separator || {}) })
|
|
12
|
+
|
|
13
|
+
type SeparatorVariants = VariantProps<typeof separator>
|
|
14
|
+
|
|
15
|
+
export interface SeparatorProps extends Pick<_SeparatorProps, 'decorative'> {
|
|
16
|
+
/**
|
|
17
|
+
* The element or component this component should render as.
|
|
18
|
+
* @defaultValue `div`
|
|
19
|
+
*/
|
|
20
|
+
as?: any
|
|
21
|
+
/** Display a label in the middle. */
|
|
22
|
+
label?: string
|
|
23
|
+
/** Display an icon in the middle. */
|
|
24
|
+
icon?: string
|
|
25
|
+
/** Display an avatar in the middle. */
|
|
26
|
+
avatar?: AvatarProps
|
|
27
|
+
color?: SeparatorVariants['color']
|
|
28
|
+
size?: SeparatorVariants['size']
|
|
29
|
+
type?: SeparatorVariants['type']
|
|
30
|
+
/**
|
|
31
|
+
* The orientation of the separator.
|
|
32
|
+
* @defaultValue 'horizontal'
|
|
33
|
+
*/
|
|
34
|
+
orientation?: _SeparatorProps['orientation']
|
|
35
|
+
class?: any
|
|
36
|
+
ui?: Partial<typeof separator.slots>
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface SeparatorSlots {
|
|
40
|
+
default(props?: {}): any
|
|
41
|
+
}
|
|
7
42
|
</script>
|
|
8
43
|
|
|
9
44
|
<script setup lang="ts">
|
|
@@ -1,9 +1,21 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import { tv } from
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { tv } from 'tailwind-variants'
|
|
3
|
+
import type { AppConfig } from '@nuxt/schema'
|
|
4
|
+
import _appConfig from '#build/app.config'
|
|
5
|
+
import theme from '#build/ui/skeleton'
|
|
6
|
+
|
|
7
|
+
const appConfig = _appConfig as AppConfig & { ui: { skeleton: Partial<typeof theme> } }
|
|
8
|
+
|
|
9
|
+
const skeleton = tv({ extend: tv(theme), ...(appConfig.ui?.skeleton || {}) })
|
|
10
|
+
|
|
11
|
+
export interface SkeletonProps {
|
|
12
|
+
/**
|
|
13
|
+
* The element or component this component should render as.
|
|
14
|
+
* @defaultValue 'div'
|
|
15
|
+
*/
|
|
16
|
+
as?: any
|
|
17
|
+
class?: any
|
|
18
|
+
}
|
|
7
19
|
</script>
|
|
8
20
|
|
|
9
21
|
<script setup lang="ts">
|
|
@@ -1,9 +1,70 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import { tv } from
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { tv, type VariantProps } from 'tailwind-variants'
|
|
3
|
+
import type { DialogRootProps, DialogRootEmits, DialogContentProps } from 'radix-vue'
|
|
4
|
+
import type { AppConfig } from '@nuxt/schema'
|
|
5
|
+
import _appConfig from '#build/app.config'
|
|
6
|
+
import theme from '#build/ui/slideover'
|
|
7
|
+
import type { ButtonProps } from '../types'
|
|
8
|
+
|
|
9
|
+
const appConfig = _appConfig as AppConfig & { ui: { slideover: Partial<typeof theme> } }
|
|
10
|
+
|
|
11
|
+
const slideover = tv({ extend: tv(theme), ...(appConfig.ui?.slideover || {}) })
|
|
12
|
+
|
|
13
|
+
type SlideoverVariants = VariantProps<typeof slideover>
|
|
14
|
+
|
|
15
|
+
export interface SlideoverProps extends DialogRootProps {
|
|
16
|
+
title?: string
|
|
17
|
+
description?: string
|
|
18
|
+
/** The content of the slideover. */
|
|
19
|
+
content?: Omit<DialogContentProps, 'as' | 'asChild' | 'forceMount'>
|
|
20
|
+
/**
|
|
21
|
+
* Render an overlay behind the slideover.
|
|
22
|
+
* @defaultValue true
|
|
23
|
+
*/
|
|
24
|
+
overlay?: boolean
|
|
25
|
+
/**
|
|
26
|
+
* Animate the slideover when opening or closing.
|
|
27
|
+
* @defaultValue true
|
|
28
|
+
*/
|
|
29
|
+
transition?: boolean
|
|
30
|
+
side?: SlideoverVariants['side']
|
|
31
|
+
/**
|
|
32
|
+
* Render the slideover in a portal.
|
|
33
|
+
* @defaultValue true
|
|
34
|
+
*/
|
|
35
|
+
portal?: boolean
|
|
36
|
+
/**
|
|
37
|
+
* Display a close button to dismiss the slideover.
|
|
38
|
+
* `{ size: 'md', color: 'gray', variant: 'ghost' }`{lang="ts-type"}
|
|
39
|
+
* @defaultValue true
|
|
40
|
+
*/
|
|
41
|
+
close?: ButtonProps | boolean
|
|
42
|
+
/**
|
|
43
|
+
* The icon displayed in the close button.
|
|
44
|
+
* @defaultValue appConfig.ui.icons.close
|
|
45
|
+
*/
|
|
46
|
+
closeIcon?: string
|
|
47
|
+
/**
|
|
48
|
+
* When `true`, the slideover will not close when clicking outside.
|
|
49
|
+
* @defaultValue false
|
|
50
|
+
*/
|
|
51
|
+
preventClose?: boolean
|
|
52
|
+
class?: any
|
|
53
|
+
ui?: Partial<typeof slideover.slots>
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface SlideoverEmits extends DialogRootEmits {}
|
|
57
|
+
|
|
58
|
+
export interface SlideoverSlots {
|
|
59
|
+
default(props: { open: boolean }): any
|
|
60
|
+
content(props?: {}): any
|
|
61
|
+
header(props?: {}): any
|
|
62
|
+
title(props?: {}): any
|
|
63
|
+
description(props?: {}): any
|
|
64
|
+
close(props: { ui: any }): any
|
|
65
|
+
body(props?: {}): any
|
|
66
|
+
footer(props?: {}): any
|
|
67
|
+
}
|
|
7
68
|
</script>
|
|
8
69
|
|
|
9
70
|
<script setup lang="ts">
|
|
@@ -1,9 +1,39 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import { tv } from
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { tv, type VariantProps } from 'tailwind-variants'
|
|
3
|
+
import type { SliderRootProps } from 'radix-vue'
|
|
4
|
+
import type { AppConfig } from '@nuxt/schema'
|
|
5
|
+
import _appConfig from '#build/app.config'
|
|
6
|
+
import theme from '#build/ui/slider'
|
|
7
|
+
|
|
8
|
+
const appConfig = _appConfig as AppConfig & { ui: { slider: Partial<typeof theme> } }
|
|
9
|
+
|
|
10
|
+
const slider = tv({ extend: tv(theme), ...(appConfig.ui?.slider || {}) })
|
|
11
|
+
|
|
12
|
+
type SliderVariants = VariantProps<typeof slider>
|
|
13
|
+
|
|
14
|
+
export interface SliderProps extends Pick<SliderRootProps, 'name' | 'disabled' | 'inverted' | 'min' | 'max' | 'step' | 'minStepsBetweenThumbs'> {
|
|
15
|
+
/**
|
|
16
|
+
* The element or component this component should render as.
|
|
17
|
+
* @defaultValue `div`
|
|
18
|
+
*/
|
|
19
|
+
as?: any
|
|
20
|
+
size?: SliderVariants['size']
|
|
21
|
+
color?: SliderVariants['color']
|
|
22
|
+
/**
|
|
23
|
+
* The orientation of the slider.
|
|
24
|
+
* @defaultValue 'horizontal'
|
|
25
|
+
*/
|
|
26
|
+
orientation?: SliderRootProps['orientation']
|
|
27
|
+
/** The value of the slider when initially rendered. Use when you do not need to control the state of the slider. */
|
|
28
|
+
defaultValue?: number | number[]
|
|
29
|
+
class?: any
|
|
30
|
+
ui?: Partial<typeof slider.slots>
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface SliderEmits {
|
|
34
|
+
(e: 'update:modelValue', payload: number | number[]): void
|
|
35
|
+
(e: 'change', payload: Event): void
|
|
36
|
+
}
|
|
7
37
|
</script>
|
|
8
38
|
|
|
9
39
|
<script setup lang="ts">
|
|
@@ -1,9 +1,53 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import { tv } from
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { tv, type VariantProps } from 'tailwind-variants'
|
|
3
|
+
import type { SwitchRootProps } from 'radix-vue'
|
|
4
|
+
import type { AppConfig } from '@nuxt/schema'
|
|
5
|
+
import _appConfig from '#build/app.config'
|
|
6
|
+
import theme from '#build/ui/switch'
|
|
7
|
+
import type { PartialString } from '../types/utils'
|
|
8
|
+
|
|
9
|
+
const appConfig = _appConfig as AppConfig & { ui: { switch: Partial<typeof theme> } }
|
|
10
|
+
|
|
11
|
+
const switchTv = tv({ extend: tv(theme), ...(appConfig.ui?.switch || {}) })
|
|
12
|
+
|
|
13
|
+
type SwitchVariants = VariantProps<typeof switchTv>
|
|
14
|
+
|
|
15
|
+
export interface SwitchProps extends Pick<SwitchRootProps, 'disabled' | 'id' | 'name' | 'required' | 'value'> {
|
|
16
|
+
/**
|
|
17
|
+
* The element or component this component should render as.
|
|
18
|
+
* @defaultValue `div`
|
|
19
|
+
*/
|
|
20
|
+
as?: any
|
|
21
|
+
color?: SwitchVariants['color']
|
|
22
|
+
size?: SwitchVariants['size']
|
|
23
|
+
/** When `true`, the loading icon will be displayed. */
|
|
24
|
+
loading?: boolean
|
|
25
|
+
/**
|
|
26
|
+
* The icon when the `loading` prop is `true`.
|
|
27
|
+
* @defaultValue appConfig.ui.icons.loading
|
|
28
|
+
*/
|
|
29
|
+
loadingIcon?: string
|
|
30
|
+
/** Display an icon when the switch is checked. */
|
|
31
|
+
checkedIcon?: string
|
|
32
|
+
/** Display an icon when the switch is unchecked. */
|
|
33
|
+
uncheckedIcon?: string
|
|
34
|
+
label?: string
|
|
35
|
+
description?: string
|
|
36
|
+
/** The state of the switch when it is initially rendered. Use when you do not need to control its state. */
|
|
37
|
+
defaultValue?: boolean
|
|
38
|
+
class?: any
|
|
39
|
+
ui?: PartialString<typeof switchTv.slots>
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface SwitchEmits {
|
|
43
|
+
(e: 'update:modelValue', payload: boolean): void
|
|
44
|
+
(e: 'change', payload: Event): void
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface SwitchSlots {
|
|
48
|
+
label(props: { label?: string }): any
|
|
49
|
+
description(props: { description?: string }): any
|
|
50
|
+
}
|
|
7
51
|
</script>
|
|
8
52
|
|
|
9
53
|
<script setup lang="ts">
|
|
@@ -1,9 +1,62 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import { tv } from
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { tv, type VariantProps } from 'tailwind-variants'
|
|
3
|
+
import type { TabsRootProps, TabsRootEmits, TabsContentProps, TabsTriggerProps } from 'radix-vue'
|
|
4
|
+
import type { AppConfig } from '@nuxt/schema'
|
|
5
|
+
import _appConfig from '#build/app.config'
|
|
6
|
+
import theme from '#build/ui/tabs'
|
|
7
|
+
import type { AvatarProps } from '../types'
|
|
8
|
+
import type { DynamicSlots, PartialString } from '../types/utils'
|
|
9
|
+
|
|
10
|
+
const appConfig = _appConfig as AppConfig & { ui: { tabs: Partial<typeof theme> } }
|
|
11
|
+
|
|
12
|
+
const tabs = tv({ extend: tv(theme), ...(appConfig.ui?.tabs || {}) })
|
|
13
|
+
|
|
14
|
+
export interface TabsItem extends Pick<TabsTriggerProps, 'disabled'> {
|
|
15
|
+
label?: string
|
|
16
|
+
icon?: string
|
|
17
|
+
avatar?: AvatarProps
|
|
18
|
+
slot?: string
|
|
19
|
+
content?: string
|
|
20
|
+
/** A unique value for the tab item. Defaults to the index. */
|
|
21
|
+
value?: string | number
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
type TabsVariants = VariantProps<typeof tabs>
|
|
25
|
+
|
|
26
|
+
export interface TabsProps<T> extends Pick<TabsRootProps<string | number>, 'defaultValue' | 'modelValue' | 'activationMode'> {
|
|
27
|
+
/**
|
|
28
|
+
* The element or component this component should render as.
|
|
29
|
+
* @defaultValue 'div'
|
|
30
|
+
*/
|
|
31
|
+
as?: any
|
|
32
|
+
items?: T[]
|
|
33
|
+
color?: TabsVariants['color']
|
|
34
|
+
variant?: TabsVariants['variant']
|
|
35
|
+
size?: TabsVariants['size']
|
|
36
|
+
/**
|
|
37
|
+
* The orientation of the tabs.
|
|
38
|
+
* @defaultValue 'horizontal'
|
|
39
|
+
*/
|
|
40
|
+
orientation?: TabsRootProps['orientation']
|
|
41
|
+
/**
|
|
42
|
+
* The content of the tabs, can be disabled to prevent rendering the content.
|
|
43
|
+
* @defaultValue true
|
|
44
|
+
*/
|
|
45
|
+
content?: boolean | Omit<TabsContentProps, 'as' | 'asChild' | 'value'>
|
|
46
|
+
class?: any
|
|
47
|
+
ui?: PartialString<typeof tabs.slots>
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface TabsEmits extends TabsRootEmits<string | number> {}
|
|
51
|
+
|
|
52
|
+
type SlotProps<T> = (props: { item: T, index: number }) => any
|
|
53
|
+
|
|
54
|
+
export type TabsSlots<T extends { slot?: string }> = {
|
|
55
|
+
leading: SlotProps<T>
|
|
56
|
+
default: SlotProps<T>
|
|
57
|
+
trailing: SlotProps<T>
|
|
58
|
+
content: SlotProps<T>
|
|
59
|
+
} & DynamicSlots<T, SlotProps<T>>
|
|
7
60
|
</script>
|
|
8
61
|
|
|
9
62
|
<script setup lang="ts" generic="T extends TabsItem">
|