@proj-airi/ui 0.5.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.
Files changed (48) hide show
  1. package/README.md +41 -0
  2. package/dist/Animations-DeJoVt_I.mjs +153 -0
  3. package/dist/{components/Form/Range/Range.vue → Form-BXVt-kFc.css} +135 -114
  4. package/dist/Form-Cy7H3Deq.mjs +1237 -0
  5. package/dist/components/animations.mjs +4 -0
  6. package/dist/components/form.mjs +4 -0
  7. package/dist/export-helper-WDd986Km.mjs +9 -0
  8. package/dist/index.mjs +5 -2
  9. package/package.json +17 -23
  10. package/src/components/Form/Field/FieldInput.vue +20 -2
  11. package/src/components/Form/Field/FieldValues.vue +62 -0
  12. package/src/components/Form/Field/index.ts +1 -0
  13. package/src/components/Form/Range/ColorHueRange.vue +61 -0
  14. package/src/components/Form/Range/index.ts +1 -0
  15. package/tsdown.config.ts +29 -0
  16. package/build.config.ts +0 -11
  17. package/dist/components/Animations/TransitionVertical.vue +0 -95
  18. package/dist/components/Animations/index.d.ts +0 -1
  19. package/dist/components/Animations/index.mjs +0 -1
  20. package/dist/components/Form/Checkbox/Checkbox.vue +0 -26
  21. package/dist/components/Form/Checkbox/index.d.ts +0 -1
  22. package/dist/components/Form/Checkbox/index.mjs +0 -1
  23. package/dist/components/Form/Field/FieldCheckbox.vue +0 -24
  24. package/dist/components/Form/Field/FieldInput.vue +0 -34
  25. package/dist/components/Form/Field/FieldKeyValues.vue +0 -54
  26. package/dist/components/Form/Field/FieldRange.vue +0 -37
  27. package/dist/components/Form/Field/index.d.ts +0 -4
  28. package/dist/components/Form/Field/index.mjs +0 -4
  29. package/dist/components/Form/Input/Input.vue +0 -20
  30. package/dist/components/Form/Input/InputFile.vue +0 -65
  31. package/dist/components/Form/Input/InputKeyValue.vue +0 -17
  32. package/dist/components/Form/Input/index.d.ts +0 -3
  33. package/dist/components/Form/Input/index.mjs +0 -3
  34. package/dist/components/Form/Radio/Radio.vue +0 -103
  35. package/dist/components/Form/Radio/index.d.ts +0 -1
  36. package/dist/components/Form/Radio/index.mjs +0 -1
  37. package/dist/components/Form/Range/index.d.ts +0 -1
  38. package/dist/components/Form/Range/index.mjs +0 -1
  39. package/dist/components/Form/Select/Select.vue +0 -98
  40. package/dist/components/Form/Select/index.d.ts +0 -1
  41. package/dist/components/Form/Select/index.mjs +0 -1
  42. package/dist/components/Form/Textarea/Basic.vue +0 -32
  43. package/dist/components/Form/Textarea/Textarea.vue +0 -17
  44. package/dist/components/Form/Textarea/index.d.ts +0 -2
  45. package/dist/components/Form/Textarea/index.mjs +0 -2
  46. package/dist/components/Form/index.d.ts +0 -7
  47. package/dist/components/Form/index.mjs +0 -7
  48. package/dist/index.d.ts +0 -2
@@ -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,3 +0,0 @@
1
- export { default as Input } from './Input.vue';
2
- export { default as InputFile } from './InputFile.vue';
3
- export { default as InputKeyValue } from './InputKeyValue.vue';
@@ -1,3 +0,0 @@
1
- export { default as Input } from "./Input.vue";
2
- export { default as InputFile } from "./InputFile.vue";
3
- export { default as InputKeyValue } from "./InputKeyValue.vue";
@@ -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 +0,0 @@
1
- export { default as Range } from './Range.vue';
@@ -1 +0,0 @@
1
- export { default as Range } from "./Range.vue";
@@ -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>
@@ -1,2 +0,0 @@
1
- export { default as BasicTextarea } from './Basic.vue';
2
- export { default as Textarea } from './Textarea.vue';
@@ -1,2 +0,0 @@
1
- export { default as BasicTextarea } from "./Basic.vue";
2
- export { default as Textarea } from "./Textarea.vue";
@@ -1,7 +0,0 @@
1
- export * from './Checkbox';
2
- export * from './Field';
3
- export * from './Input';
4
- export * from './Radio';
5
- export * from './Range';
6
- export * from './Select';
7
- export * from './Textarea';
@@ -1,7 +0,0 @@
1
- export * from "./Checkbox/index.mjs";
2
- export * from "./Field/index.mjs";
3
- export * from "./Input/index.mjs";
4
- export * from "./Radio/index.mjs";
5
- export * from "./Range/index.mjs";
6
- export * from "./Select/index.mjs";
7
- export * from "./Textarea/index.mjs";
package/dist/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export * from './components/Animations';
2
- export * from './components/Form';