@proj-airi/ui 0.6.0 → 0.6.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/dist/Animations-DeJoVt_I.mjs +153 -0
- package/dist/{components/Form/Range/Range.vue → Form-BXVt-kFc.css} +135 -114
- package/dist/Form-Cy7H3Deq.mjs +1237 -0
- package/dist/components/animations.mjs +4 -0
- package/dist/components/form.mjs +4 -0
- package/dist/export-helper-WDd986Km.mjs +9 -0
- package/dist/index.mjs +5 -2
- package/package.json +12 -18
- package/src/components/Form/Field/FieldInput.vue +20 -2
- package/src/components/Form/Field/FieldValues.vue +62 -0
- package/src/components/Form/Field/index.ts +1 -0
- package/tsdown.config.ts +29 -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/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
|
@@ -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>
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { Dropdown as VDropdown } from "floating-vue";
|
|
3
|
-
import { computed } from "vue";
|
|
4
|
-
const props = defineProps({
|
|
5
|
-
options: { type: Array, required: true },
|
|
6
|
-
placeholder: { type: String, required: false },
|
|
7
|
-
disabled: { type: Boolean, required: false },
|
|
8
|
-
title: { type: String, required: false }
|
|
9
|
-
});
|
|
10
|
-
const modelValue = defineModel({ type: [String, Number], ...{ required: true } });
|
|
11
|
-
const selectedLabel = computed(() => {
|
|
12
|
-
const selected = props.options.find((opt) => opt.value === modelValue.value);
|
|
13
|
-
return selected ? selected.label : props.placeholder;
|
|
14
|
-
});
|
|
15
|
-
function selectOption(value) {
|
|
16
|
-
modelValue.value = value;
|
|
17
|
-
}
|
|
18
|
-
</script>
|
|
19
|
-
|
|
20
|
-
<template>
|
|
21
|
-
<VDropdown
|
|
22
|
-
auto-size
|
|
23
|
-
auto-boundary-max-size
|
|
24
|
-
>
|
|
25
|
-
<div
|
|
26
|
-
class="min-w-[160px] flex cursor-pointer items-center justify-between gap-2 border rounded-lg bg-white p-2.5 text-xs text-neutral-700 shadow-sm outline-none transition-colors disabled:cursor-not-allowed dark:border-neutral-800 dark:bg-neutral-900 disabled:bg-neutral-100 hover:bg-neutral-50 dark:text-neutral-200 disabled:text-neutral-400 focus:ring-2 focus:ring-black/10 dark:disabled:bg-neutral-800 dark:hover:bg-neutral-800 dark:disabled:text-neutral-600"
|
|
27
|
-
:class="{ 'pointer-events-none': props.disabled }"
|
|
28
|
-
>
|
|
29
|
-
<div class="flex-1 truncate">
|
|
30
|
-
<slot :label="selectedLabel">
|
|
31
|
-
{{ selectedLabel }}
|
|
32
|
-
</slot>
|
|
33
|
-
</div>
|
|
34
|
-
<div i-solar:alt-arrow-down-bold-duotone class="h-3.5 w-3.5 text-neutral-500 dark:text-neutral-400" />
|
|
35
|
-
</div>
|
|
36
|
-
|
|
37
|
-
<template #popper="{ hide }">
|
|
38
|
-
<div class="min-w-[160px] flex flex-col gap-0.5 border border-neutral-200 rounded-lg bg-white p-1 shadow-lg dark:border-neutral-800 dark:bg-neutral-900">
|
|
39
|
-
<div
|
|
40
|
-
v-for="option of props.options"
|
|
41
|
-
v-bind="{ ...$attrs, class: null, style: null }"
|
|
42
|
-
:key="option.value"
|
|
43
|
-
class="cursor-pointer rounded px-2 py-1.5 text-sm text-neutral-700 hover:bg-neutral-100 dark:text-neutral-200 dark:hover:bg-neutral-800"
|
|
44
|
-
:class="{
|
|
45
|
-
'bg-neutral-100 dark:bg-neutral-800': modelValue === option.value,
|
|
46
|
-
}"
|
|
47
|
-
@click="selectOption(option.value); hide()"
|
|
48
|
-
>
|
|
49
|
-
{{ option.label }}
|
|
50
|
-
</div>
|
|
51
|
-
</div>
|
|
52
|
-
</template>
|
|
53
|
-
</VDropdown>
|
|
54
|
-
</template>
|
|
55
|
-
|
|
56
|
-
<style>
|
|
57
|
-
.resize-observer[data-v-b329ee4c] {
|
|
58
|
-
position: absolute;
|
|
59
|
-
top: 0;
|
|
60
|
-
left: 0;
|
|
61
|
-
z-index: -1;
|
|
62
|
-
width: 100%;
|
|
63
|
-
height: 100%;
|
|
64
|
-
border: none;
|
|
65
|
-
background-color: transparent;
|
|
66
|
-
pointer-events: none;
|
|
67
|
-
display: block;
|
|
68
|
-
overflow: hidden;
|
|
69
|
-
opacity: 0;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.resize-observer[data-v-b329ee4c] object {
|
|
73
|
-
display: block;
|
|
74
|
-
position: absolute;
|
|
75
|
-
top: 0;
|
|
76
|
-
left: 0;
|
|
77
|
-
height: 100%;
|
|
78
|
-
width: 100%;
|
|
79
|
-
overflow: hidden;
|
|
80
|
-
pointer-events: none;
|
|
81
|
-
z-index: -1;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
.v-popper__popper {
|
|
85
|
-
z-index: 10000;
|
|
86
|
-
top: 0;
|
|
87
|
-
left: 0;
|
|
88
|
-
outline: none;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
.v-popper__arrow-container {
|
|
92
|
-
display: none;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.v-popper__inner {
|
|
96
|
-
border: none !important;
|
|
97
|
-
}
|
|
98
|
-
</style>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Select } from './Select.vue';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Select } from "./Select.vue";
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { ref, watch } from "vue";
|
|
3
|
-
const events = defineEmits(["submit"]);
|
|
4
|
-
const input = defineModel({ type: String, ...{
|
|
5
|
-
default: ""
|
|
6
|
-
} });
|
|
7
|
-
const textareaRef = ref();
|
|
8
|
-
const textareaHeight = ref("auto");
|
|
9
|
-
function onKeyDown(e) {
|
|
10
|
-
if (e.code === "Enter" && !e.shiftKey) {
|
|
11
|
-
e.preventDefault();
|
|
12
|
-
events("submit", input.value);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
watch(input, () => {
|
|
16
|
-
textareaHeight.value = "auto";
|
|
17
|
-
requestAnimationFrame(() => {
|
|
18
|
-
if (!textareaRef.value)
|
|
19
|
-
return;
|
|
20
|
-
textareaHeight.value = `${textareaRef.value.scrollHeight}px`;
|
|
21
|
-
});
|
|
22
|
-
}, { immediate: true });
|
|
23
|
-
</script>
|
|
24
|
-
|
|
25
|
-
<template>
|
|
26
|
-
<textarea
|
|
27
|
-
ref="textareaRef"
|
|
28
|
-
v-model="input"
|
|
29
|
-
:style="{ height: textareaHeight }"
|
|
30
|
-
@keydown="onKeyDown"
|
|
31
|
-
/>
|
|
32
|
-
</template>
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import BasicTextarea from "./Basic.vue";
|
|
3
|
-
const modelValue = defineModel({ type: String, ...{ default: "" } });
|
|
4
|
-
</script>
|
|
5
|
-
|
|
6
|
-
<template>
|
|
7
|
-
<BasicTextarea
|
|
8
|
-
v-model="modelValue"
|
|
9
|
-
border="focus:primary-300 dark:focus:primary-400/50 2 solid neutral-100 dark:neutral-900"
|
|
10
|
-
transition="all duration-200 ease-in-out"
|
|
11
|
-
text="disabled:neutral-400 dark:disabled:neutral-600"
|
|
12
|
-
cursor="disabled:not-allowed"
|
|
13
|
-
w-full rounded-lg px-2 py-1 text-sm outline-none
|
|
14
|
-
shadow="sm"
|
|
15
|
-
bg="neutral-50 dark:neutral-950 focus:neutral-50 dark:focus:neutral-900"
|
|
16
|
-
/>
|
|
17
|
-
</template>
|
package/dist/index.d.ts
DELETED