@proj-airi/ui 0.6.0 → 0.7.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/package.json +9 -20
- package/src/components/Animations/TransitionHorizontal.vue +36 -0
- package/src/components/Animations/index.ts +1 -0
- package/src/components/Form/Field/FieldCheckbox.vue +6 -2
- package/src/components/Form/Field/FieldInput.vue +27 -5
- package/src/components/Form/Field/FieldKeyValues.vue +6 -2
- package/src/components/Form/Field/FieldRange.vue +13 -6
- package/src/components/Form/Field/FieldSelect.vue +50 -0
- package/src/components/Form/Field/FieldValues.vue +66 -0
- package/src/components/Form/Field/index.ts +2 -0
- package/src/components/Form/Input/Input.vue +1 -1
- package/src/components/Form/Range/ColorHueRange.vue +8 -8
- package/src/components/Form/Range/Range.vue +47 -20
- package/src/components/Form/Range/RoundRange.vue +277 -0
- package/src/components/Form/Range/index.ts +1 -0
- package/src/components/Form/Select/Option.vue +29 -0
- package/src/components/Form/Select/Select.vue +45 -26
- package/src/components/Form/Select/index.ts +1 -0
- package/src/components/Form/Textarea/Basic.vue +8 -0
- package/build.config.ts +0 -11
- package/dist/components/Animations/TransitionVertical.vue +0 -95
- package/dist/components/Animations/index.d.ts +0 -1
- package/dist/components/Animations/index.mjs +0 -1
- package/dist/components/Form/Checkbox/Checkbox.vue +0 -26
- package/dist/components/Form/Checkbox/index.d.ts +0 -1
- package/dist/components/Form/Checkbox/index.mjs +0 -1
- package/dist/components/Form/Field/FieldCheckbox.vue +0 -24
- package/dist/components/Form/Field/FieldInput.vue +0 -34
- package/dist/components/Form/Field/FieldKeyValues.vue +0 -54
- package/dist/components/Form/Field/FieldRange.vue +0 -37
- package/dist/components/Form/Field/index.d.ts +0 -4
- package/dist/components/Form/Field/index.mjs +0 -4
- package/dist/components/Form/Input/Input.vue +0 -20
- package/dist/components/Form/Input/InputFile.vue +0 -65
- package/dist/components/Form/Input/InputKeyValue.vue +0 -17
- package/dist/components/Form/Input/index.d.ts +0 -3
- package/dist/components/Form/Input/index.mjs +0 -3
- package/dist/components/Form/Radio/Radio.vue +0 -103
- package/dist/components/Form/Radio/index.d.ts +0 -1
- package/dist/components/Form/Radio/index.mjs +0 -1
- package/dist/components/Form/Range/ColorHueRange.vue +0 -60
- package/dist/components/Form/Range/Range.vue +0 -315
- package/dist/components/Form/Range/index.d.ts +0 -2
- package/dist/components/Form/Range/index.mjs +0 -2
- package/dist/components/Form/Select/Select.vue +0 -98
- package/dist/components/Form/Select/index.d.ts +0 -1
- package/dist/components/Form/Select/index.mjs +0 -1
- package/dist/components/Form/Textarea/Basic.vue +0 -32
- package/dist/components/Form/Textarea/Textarea.vue +0 -17
- package/dist/components/Form/Textarea/index.d.ts +0 -2
- package/dist/components/Form/Textarea/index.mjs +0 -2
- package/dist/components/Form/index.d.ts +0 -7
- package/dist/components/Form/index.mjs +0 -7
- package/dist/index.d.ts +0 -2
- package/dist/index.mjs +0 -2
- package/uno.config.ts +0 -8
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { ref, watch } from "vue";
|
|
3
|
-
import InputKeyValue from "../Input/InputKeyValue.vue";
|
|
4
|
-
const props = defineProps({
|
|
5
|
-
label: { type: String, required: false },
|
|
6
|
-
description: { type: String, required: false },
|
|
7
|
-
name: { type: String, required: false },
|
|
8
|
-
keyPlaceholder: { type: String, required: false },
|
|
9
|
-
valuePlaceholder: { type: String, required: false },
|
|
10
|
-
required: { type: Boolean, required: false },
|
|
11
|
-
inputClass: { type: String, required: false }
|
|
12
|
-
});
|
|
13
|
-
const emit = defineEmits(["remove", "add"]);
|
|
14
|
-
const keyValues = defineModel({ type: Array, ...{ required: true } });
|
|
15
|
-
const inputKey = ref("");
|
|
16
|
-
const inputValue = ref("");
|
|
17
|
-
watch([inputKey, inputValue], () => {
|
|
18
|
-
emit("add", inputKey.value, inputValue.value);
|
|
19
|
-
});
|
|
20
|
-
</script>
|
|
21
|
-
|
|
22
|
-
<template>
|
|
23
|
-
<div max-w-full>
|
|
24
|
-
<label flex="~ col gap-2">
|
|
25
|
-
<div>
|
|
26
|
-
<div class="flex items-center gap-1 text-sm font-medium">
|
|
27
|
-
{{ props.label }}
|
|
28
|
-
<span v-if="props.required !== false" class="text-red-500">*</span>
|
|
29
|
-
</div>
|
|
30
|
-
<div class="text-xs text-neutral-500 dark:text-neutral-400" text-nowrap>
|
|
31
|
-
{{ props.description }}
|
|
32
|
-
</div>
|
|
33
|
-
</div>
|
|
34
|
-
<div v-auto-animate flex="~ col gap-2">
|
|
35
|
-
<div
|
|
36
|
-
v-for="(keyValue, index) in keyValues"
|
|
37
|
-
:key="index"
|
|
38
|
-
w-full flex items-center gap-2
|
|
39
|
-
>
|
|
40
|
-
<InputKeyValue
|
|
41
|
-
v-model:property-key="keyValue.key"
|
|
42
|
-
v-model:property-value="keyValue.value"
|
|
43
|
-
:key-placeholder="props.keyPlaceholder"
|
|
44
|
-
:value-placeholder="props.valuePlaceholder"
|
|
45
|
-
w-full
|
|
46
|
-
/>
|
|
47
|
-
<button @click="emit('remove', index)">
|
|
48
|
-
<div i-solar:minus-circle-line-duotone size="6" />
|
|
49
|
-
</button>
|
|
50
|
-
</div>
|
|
51
|
-
</div>
|
|
52
|
-
</label>
|
|
53
|
-
</div>
|
|
54
|
-
</template>
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import Range from "../Range/Range.vue";
|
|
3
|
-
const props = defineProps({
|
|
4
|
-
min: { type: Number, required: false },
|
|
5
|
-
max: { type: Number, required: false },
|
|
6
|
-
step: { type: Number, required: false },
|
|
7
|
-
label: { type: String, required: false },
|
|
8
|
-
description: { type: String, required: false },
|
|
9
|
-
formatValue: { type: Function, required: false }
|
|
10
|
-
});
|
|
11
|
-
const modelValue = defineModel({ type: Number, ...{ required: true } });
|
|
12
|
-
</script>
|
|
13
|
-
|
|
14
|
-
<template>
|
|
15
|
-
<label flex="~ col gap-4">
|
|
16
|
-
<div flex="~ row" items-center gap-2>
|
|
17
|
-
<div flex="1">
|
|
18
|
-
<div class="flex items-center gap-1 text-sm font-medium">
|
|
19
|
-
{{ label }}
|
|
20
|
-
</div>
|
|
21
|
-
<div class="text-xs text-neutral-500 dark:text-neutral-400">
|
|
22
|
-
{{ description }}
|
|
23
|
-
</div>
|
|
24
|
-
</div>
|
|
25
|
-
<span font-mono>{{ props.formatValue?.(modelValue) || modelValue }}</span>
|
|
26
|
-
</div>
|
|
27
|
-
<div flex="~ row" items-center gap-2>
|
|
28
|
-
<Range
|
|
29
|
-
v-model="modelValue"
|
|
30
|
-
:min="min || 0"
|
|
31
|
-
:max="max || 1"
|
|
32
|
-
:step="step || 0.01"
|
|
33
|
-
w-full
|
|
34
|
-
/>
|
|
35
|
-
</div>
|
|
36
|
-
</label>
|
|
37
|
-
</template>
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
const props = defineProps({
|
|
3
|
-
type: { type: String, required: false }
|
|
4
|
-
});
|
|
5
|
-
const modelValue = defineModel({ type: String, ...{ required: true } });
|
|
6
|
-
</script>
|
|
7
|
-
|
|
8
|
-
<template>
|
|
9
|
-
<input
|
|
10
|
-
v-model="modelValue"
|
|
11
|
-
:type="props.type || 'text'"
|
|
12
|
-
border="focus:primary-300 dark:focus:primary-400/50 2 solid neutral-100 dark:neutral-900"
|
|
13
|
-
transition="all duration-200 ease-in-out"
|
|
14
|
-
text="disabled:neutral-400 dark:disabled:neutral-600"
|
|
15
|
-
cursor="disabled:not-allowed"
|
|
16
|
-
w-full rounded-lg px-2 py-1 text-nowrap text-sm outline-none
|
|
17
|
-
shadow="sm"
|
|
18
|
-
bg="neutral-50 dark:neutral-950 focus:neutral-50 dark:focus:neutral-900"
|
|
19
|
-
>
|
|
20
|
-
</template>
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { useDebounce } from "@vueuse/core";
|
|
3
|
-
import { ref } from "vue";
|
|
4
|
-
defineProps({
|
|
5
|
-
accept: { type: String, required: false },
|
|
6
|
-
multiple: { type: Boolean, required: false }
|
|
7
|
-
});
|
|
8
|
-
const files = defineModel({ type: Array, ...{ required: false, default: () => [] } });
|
|
9
|
-
const firstFile = ref();
|
|
10
|
-
const isDragging = ref(false);
|
|
11
|
-
const isDraggingDebounced = useDebounce(isDragging, 150);
|
|
12
|
-
function handleFileChange(e) {
|
|
13
|
-
const input = e.target;
|
|
14
|
-
if (input.files && input.files.length > 0) {
|
|
15
|
-
firstFile.value = input.files[0];
|
|
16
|
-
}
|
|
17
|
-
files.value = Array.from(input.files || []);
|
|
18
|
-
isDragging.value = false;
|
|
19
|
-
}
|
|
20
|
-
</script>
|
|
21
|
-
|
|
22
|
-
<template>
|
|
23
|
-
<label
|
|
24
|
-
relative
|
|
25
|
-
class="min-h-[120px] flex flex-col cursor-pointer items-center justify-center rounded-xl p-6"
|
|
26
|
-
:class="[
|
|
27
|
-
isDraggingDebounced ? 'border-primary-400 dark:border-primary-600 hover:border-primary-300 dark:hover:border-primary-700' : 'border-neutral-200 dark:border-neutral-700 hover:border-primary-300 dark:hover:border-primary-700',
|
|
28
|
-
isDraggingDebounced ? 'bg-primary-50/5 dark:bg-primary-900/5' : 'bg-white/60 dark:bg-black/30 hover:bg-white/80 dark:hover:bg-black/40',
|
|
29
|
-
]"
|
|
30
|
-
border="dashed 2"
|
|
31
|
-
transition="all duration-300"
|
|
32
|
-
cursor-pointer opacity-95
|
|
33
|
-
hover="scale-100 opacity-100 shadow-md dark:shadow-lg"
|
|
34
|
-
@dragover="isDragging = true"
|
|
35
|
-
@dragleave="isDragging = false"
|
|
36
|
-
>
|
|
37
|
-
<input
|
|
38
|
-
type="file"
|
|
39
|
-
:accept="accept"
|
|
40
|
-
:multiple="multiple"
|
|
41
|
-
cursor-pointer
|
|
42
|
-
class="absolute inset-0 h-full w-full opacity-0"
|
|
43
|
-
@change="handleFileChange"
|
|
44
|
-
>
|
|
45
|
-
<slot :is-dragging="isDraggingDebounced" :first-file="firstFile" :files="files">
|
|
46
|
-
<div
|
|
47
|
-
class="flex flex-col items-center"
|
|
48
|
-
:class="[
|
|
49
|
-
isDraggingDebounced ? 'text-primary-500 dark:text-primary-400' : 'text-neutral-400 dark:text-neutral-500',
|
|
50
|
-
]"
|
|
51
|
-
>
|
|
52
|
-
<div i-solar:upload-square-line-duotone mb-2 text-5xl />
|
|
53
|
-
<p font-medium text="center lg">
|
|
54
|
-
Upload
|
|
55
|
-
</p>
|
|
56
|
-
<p v-if="isDraggingDebounced" text="center" text-sm>
|
|
57
|
-
Release to upload
|
|
58
|
-
</p>
|
|
59
|
-
<p v-else text="center" text-sm>
|
|
60
|
-
Click or drag and drop a file here
|
|
61
|
-
</p>
|
|
62
|
-
</div>
|
|
63
|
-
</slot>
|
|
64
|
-
</label>
|
|
65
|
-
</template>
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import Input from "./Input.vue";
|
|
3
|
-
const props = defineProps({
|
|
4
|
-
name: { type: String, required: false },
|
|
5
|
-
keyPlaceholder: { type: String, required: false },
|
|
6
|
-
valuePlaceholder: { type: String, required: false }
|
|
7
|
-
});
|
|
8
|
-
const key = defineModel("propertyKey", { type: String, ...{ required: true } });
|
|
9
|
-
const value = defineModel("propertyValue", { type: String, ...{ required: true } });
|
|
10
|
-
</script>
|
|
11
|
-
|
|
12
|
-
<template>
|
|
13
|
-
<div flex="~ gap-2">
|
|
14
|
-
<Input v-model="key" :placeholder="props.keyPlaceholder" class="w-1/2" />
|
|
15
|
-
<Input v-model="value" :placeholder="props.valuePlaceholder" class="w-1/2" />
|
|
16
|
-
</div>
|
|
17
|
-
</template>
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
defineProps({
|
|
3
|
-
id: { type: String, required: true },
|
|
4
|
-
name: { type: String, required: true },
|
|
5
|
-
value: { type: String, required: true },
|
|
6
|
-
title: { type: String, required: true },
|
|
7
|
-
deprecated: { type: Boolean, required: false, default: false }
|
|
8
|
-
});
|
|
9
|
-
const modelValue = defineModel({ type: String, ...{ required: true } });
|
|
10
|
-
</script>
|
|
11
|
-
|
|
12
|
-
<template>
|
|
13
|
-
<label
|
|
14
|
-
:key="id"
|
|
15
|
-
class="form_radio relative flex cursor-pointer items-start rounded-xl p-3 pr-[20px]"
|
|
16
|
-
transition="all duration-200 ease-in-out"
|
|
17
|
-
border="2 solid"
|
|
18
|
-
:class="[
|
|
19
|
-
modelValue === value
|
|
20
|
-
? 'bg-primary-50 dark:bg-primary-900/20 border-primary-100 dark:border-primary-900 hover:border-primary-500/30 dark:hover:border-primary-400/30'
|
|
21
|
-
: 'bg-white dark:bg-neutral-900/20 border-neutral-100 dark:border-neutral-900 hover:border-primary-500/30 dark:hover:border-primary-400/30',
|
|
22
|
-
modelValue === value
|
|
23
|
-
? 'form_radio-active'
|
|
24
|
-
: '',
|
|
25
|
-
deprecated ? 'opacity-60' : '',
|
|
26
|
-
]"
|
|
27
|
-
>
|
|
28
|
-
<input
|
|
29
|
-
v-model="modelValue"
|
|
30
|
-
:checked="modelValue === value"
|
|
31
|
-
type="radio"
|
|
32
|
-
:name="name"
|
|
33
|
-
:value="value"
|
|
34
|
-
class="absolute opacity-0"
|
|
35
|
-
>
|
|
36
|
-
<div class="relative mr-3 mt-0.5 flex-shrink-0">
|
|
37
|
-
<div
|
|
38
|
-
class="size-5 border-2 rounded-full transition-colors duration-200"
|
|
39
|
-
:class="[
|
|
40
|
-
modelValue === value
|
|
41
|
-
? 'border-primary-500 dark:border-primary-400'
|
|
42
|
-
: 'border-neutral-300 dark:border-neutral-600',
|
|
43
|
-
]"
|
|
44
|
-
>
|
|
45
|
-
<div
|
|
46
|
-
class="absolute left-1/2 top-1/2 size-3 rounded-full transition-opacity duration-200 -translate-x-1/2 -translate-y-1/2"
|
|
47
|
-
:class="[
|
|
48
|
-
modelValue === value
|
|
49
|
-
? 'opacity-100 bg-primary-500 dark:bg-primary-400'
|
|
50
|
-
: 'opacity-0',
|
|
51
|
-
]"
|
|
52
|
-
/>
|
|
53
|
-
</div>
|
|
54
|
-
</div>
|
|
55
|
-
<div class="w-full flex flex-col gap-2">
|
|
56
|
-
<div class="flex items-center">
|
|
57
|
-
<span
|
|
58
|
-
class="line-clamp-1 font-medium"
|
|
59
|
-
:class="[
|
|
60
|
-
modelValue === value
|
|
61
|
-
? 'text-neutral-700 dark:text-neutral-300'
|
|
62
|
-
: 'text-neutral-700 dark:text-neutral-400',
|
|
63
|
-
]"
|
|
64
|
-
>
|
|
65
|
-
{{ title }}
|
|
66
|
-
</span>
|
|
67
|
-
</div>
|
|
68
|
-
</div>
|
|
69
|
-
</label>
|
|
70
|
-
</template>
|
|
71
|
-
|
|
72
|
-
<style scoped>
|
|
73
|
-
.form_radio {
|
|
74
|
-
position: relative;
|
|
75
|
-
overflow: hidden;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
.form_radio::before {
|
|
79
|
-
--at-apply: 'bg-gradient-to-r from-primary-500/0 to-primary-500/0 dark:from-primary-400/0 dark:to-primary-400/0';
|
|
80
|
-
content: '';
|
|
81
|
-
position: absolute;
|
|
82
|
-
inset: 0;
|
|
83
|
-
z-index: 0;
|
|
84
|
-
width: 25%;
|
|
85
|
-
height: 100%;
|
|
86
|
-
transition: all 0.35s ease-in-out;
|
|
87
|
-
mask-image: linear-gradient(120deg, white 100%);
|
|
88
|
-
opacity: 0;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
.form_radio:hover::before,
|
|
92
|
-
.form_radio._hover::before {
|
|
93
|
-
--at-apply: 'bg-gradient-to-r from-primary-500/20 via-primary-500/10 to-transparent dark:from-primary-400/20 dark:via-primary-400/10 dark:to-transparent';
|
|
94
|
-
width: 85%;
|
|
95
|
-
opacity: 1;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
.form_radio-active::before {
|
|
99
|
-
--at-apply: 'bg-gradient-to-r from-primary-500/20 via-primary-500/10 to-transparent dark:from-primary-400/20 dark:via-primary-400/10 dark:to-transparent';
|
|
100
|
-
width: 85%;
|
|
101
|
-
opacity: 0.5;
|
|
102
|
-
}
|
|
103
|
-
</style>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Radio } from './Radio.vue';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Radio } from "./Radio.vue";
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
const props = defineProps({
|
|
3
|
-
disabled: { type: Boolean, required: false },
|
|
4
|
-
class: { type: String, required: false }
|
|
5
|
-
});
|
|
6
|
-
const colorValue = defineModel("colorValue", { type: String, ...{
|
|
7
|
-
type: String,
|
|
8
|
-
default: ""
|
|
9
|
-
} });
|
|
10
|
-
</script>
|
|
11
|
-
|
|
12
|
-
<template>
|
|
13
|
-
<input
|
|
14
|
-
v-model="colorValue"
|
|
15
|
-
type="range" min="0" max="360" step="0.01"
|
|
16
|
-
class="color-hue-range"
|
|
17
|
-
transition="all ease-in-out duration-250"
|
|
18
|
-
:disabled="props.disabled"
|
|
19
|
-
:class="[
|
|
20
|
-
props.disabled ? 'opacity-25 cursor-not-allowed' : 'cursor-pointer',
|
|
21
|
-
props.class || '',
|
|
22
|
-
]"
|
|
23
|
-
>
|
|
24
|
-
</template>
|
|
25
|
-
|
|
26
|
-
<style scoped>
|
|
27
|
-
.color-hue-range {
|
|
28
|
-
--at-apply: appearance-none h-10 rounded-lg;
|
|
29
|
-
background: linear-gradient(
|
|
30
|
-
to right,
|
|
31
|
-
oklch(85% 0.2 0),
|
|
32
|
-
oklch(85% 0.2 60),
|
|
33
|
-
oklch(85% 0.2 120),
|
|
34
|
-
oklch(85% 0.2 180),
|
|
35
|
-
oklch(85% 0.2 240),
|
|
36
|
-
oklch(85% 0.2 300),
|
|
37
|
-
oklch(85% 0.2 360)
|
|
38
|
-
);
|
|
39
|
-
|
|
40
|
-
&::-webkit-slider-thumb {
|
|
41
|
-
--at-apply: w-1 h-12 appearance-none rounded-md bg-neutral-600 cursor-pointer shadow-lg border-2 border-neutral-500
|
|
42
|
-
hover: bg-neutral-800 transition-colors duration-200;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.dark &::-webkit-slider-thumb {
|
|
46
|
-
--at-apply: w-1 h-12 appearance-none rounded-md bg-neutral-100 cursor-pointer shadow-md border-2 border-white
|
|
47
|
-
hover: bg-neutral-300 transition-colors duration-200;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
&::-moz-range-thumb {
|
|
51
|
-
--at-apply: w-1 h-12 appearance-none rounded-md bg-neutral-600 cursor-pointer shadow-lg border-2 border-neutral-500
|
|
52
|
-
hover: bg-neutral-800 transition-colors duration-200;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
.dark &::-moz-range-thumb {
|
|
56
|
-
--at-apply: w-1 h-12 appearance-none rounded-md bg-neutral-100 cursor-pointer shadow-md border-2 border-white
|
|
57
|
-
hover: bg-neutral-300 transition-colors duration-200;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
</style>
|