@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.
Files changed (46) hide show
  1. package/dist/Animations-DeJoVt_I.mjs +153 -0
  2. package/dist/{components/Form/Range/Range.vue → Form-BXVt-kFc.css} +135 -114
  3. package/dist/Form-Cy7H3Deq.mjs +1237 -0
  4. package/dist/components/animations.mjs +4 -0
  5. package/dist/components/form.mjs +4 -0
  6. package/dist/export-helper-WDd986Km.mjs +9 -0
  7. package/dist/index.mjs +5 -2
  8. package/package.json +12 -18
  9. package/src/components/Form/Field/FieldInput.vue +20 -2
  10. package/src/components/Form/Field/FieldValues.vue +62 -0
  11. package/src/components/Form/Field/index.ts +1 -0
  12. package/tsdown.config.ts +29 -0
  13. package/build.config.ts +0 -11
  14. package/dist/components/Animations/TransitionVertical.vue +0 -95
  15. package/dist/components/Animations/index.d.ts +0 -1
  16. package/dist/components/Animations/index.mjs +0 -1
  17. package/dist/components/Form/Checkbox/Checkbox.vue +0 -26
  18. package/dist/components/Form/Checkbox/index.d.ts +0 -1
  19. package/dist/components/Form/Checkbox/index.mjs +0 -1
  20. package/dist/components/Form/Field/FieldCheckbox.vue +0 -24
  21. package/dist/components/Form/Field/FieldInput.vue +0 -34
  22. package/dist/components/Form/Field/FieldKeyValues.vue +0 -54
  23. package/dist/components/Form/Field/FieldRange.vue +0 -37
  24. package/dist/components/Form/Field/index.d.ts +0 -4
  25. package/dist/components/Form/Field/index.mjs +0 -4
  26. package/dist/components/Form/Input/Input.vue +0 -20
  27. package/dist/components/Form/Input/InputFile.vue +0 -65
  28. package/dist/components/Form/Input/InputKeyValue.vue +0 -17
  29. package/dist/components/Form/Input/index.d.ts +0 -3
  30. package/dist/components/Form/Input/index.mjs +0 -3
  31. package/dist/components/Form/Radio/Radio.vue +0 -103
  32. package/dist/components/Form/Radio/index.d.ts +0 -1
  33. package/dist/components/Form/Radio/index.mjs +0 -1
  34. package/dist/components/Form/Range/ColorHueRange.vue +0 -60
  35. package/dist/components/Form/Range/index.d.ts +0 -2
  36. package/dist/components/Form/Range/index.mjs +0 -2
  37. package/dist/components/Form/Select/Select.vue +0 -98
  38. package/dist/components/Form/Select/index.d.ts +0 -1
  39. package/dist/components/Form/Select/index.mjs +0 -1
  40. package/dist/components/Form/Textarea/Basic.vue +0 -32
  41. package/dist/components/Form/Textarea/Textarea.vue +0 -17
  42. package/dist/components/Form/Textarea/index.d.ts +0 -2
  43. package/dist/components/Form/Textarea/index.mjs +0 -2
  44. package/dist/components/Form/index.d.ts +0 -7
  45. package/dist/components/Form/index.mjs +0 -7
  46. package/dist/index.d.ts +0 -2
@@ -0,0 +1,4 @@
1
+ import { TransitionVertical_default } from "../Animations-DeJoVt_I.mjs";
2
+ import "../export-helper-WDd986Km.mjs";
3
+
4
+ export { TransitionVertical_default as TransitionVertical };
@@ -0,0 +1,4 @@
1
+ import "../export-helper-WDd986Km.mjs";
2
+ import { Basic_default, Checkbox_default, ColorHueRange_default, FieldCheckbox_default, FieldInput_default, FieldKeyValues_default, FieldRange_default, FieldValues_default, InputFile_default, InputKeyValue_default, Input_default, Radio_default, Range_default, Select_default, Textarea_default } from "../Form-Cy7H3Deq.mjs";
3
+
4
+ export { Basic_default as BasicTextarea, Checkbox_default as Checkbox, ColorHueRange_default as ColorHueRange, FieldCheckbox_default as FieldCheckbox, FieldInput_default as FieldInput, FieldKeyValues_default as FieldKeyValues, FieldRange_default as FieldRange, FieldValues_default as FieldValues, Input_default as Input, InputFile_default as InputFile, InputKeyValue_default as InputKeyValue, Radio_default as Radio, Range_default as Range, Select_default as Select, Textarea_default as Textarea };
@@ -0,0 +1,9 @@
1
+ //#region \0/plugin-vue/export-helper
2
+ var export_helper_default = (sfc, props) => {
3
+ const target = sfc.__vccOpts || sfc;
4
+ for (const [key, val] of props) target[key] = val;
5
+ return target;
6
+ };
7
+
8
+ //#endregion
9
+ export { export_helper_default };
package/dist/index.mjs CHANGED
@@ -1,2 +1,5 @@
1
- export * from "./components/Animations/index.mjs";
2
- export * from "./components/Form/index.mjs";
1
+ import { TransitionVertical_default } from "./Animations-DeJoVt_I.mjs";
2
+ import "./export-helper-WDd986Km.mjs";
3
+ import { Basic_default, Checkbox_default, ColorHueRange_default, FieldCheckbox_default, FieldInput_default, FieldKeyValues_default, FieldRange_default, FieldValues_default, InputFile_default, InputKeyValue_default, Input_default, Radio_default, Range_default, Select_default, Textarea_default } from "./Form-Cy7H3Deq.mjs";
4
+
5
+ export { Basic_default as BasicTextarea, Checkbox_default as Checkbox, ColorHueRange_default as ColorHueRange, FieldCheckbox_default as FieldCheckbox, FieldInput_default as FieldInput, FieldKeyValues_default as FieldKeyValues, FieldRange_default as FieldRange, FieldValues_default as FieldValues, Input_default as Input, InputFile_default as InputFile, InputKeyValue_default as InputKeyValue, Radio_default as Radio, Range_default as Range, Select_default as Select, Textarea_default as Textarea, TransitionVertical_default as TransitionVertical };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@proj-airi/ui",
3
3
  "type": "module",
4
- "version": "0.6.0",
4
+ "version": "0.6.1",
5
5
  "description": "A collection of UI components that used by Project AIRI",
6
6
  "author": {
7
7
  "name": "Moeru AI Project AIRI Team",
@@ -15,33 +15,27 @@
15
15
  "directory": "packages/ui"
16
16
  },
17
17
  "exports": {
18
- ".": {
19
- "types": "./dist/index.d.ts",
20
- "import": "./dist/index.mjs"
21
- },
22
- "./components/animations": {
23
- "types": "./dist/components/Animations/index.d.ts",
24
- "import": "./dist/components/Animations/index.mjs"
25
- },
26
- "./components/form": {
27
- "types": "./dist/components/Form/index.d.ts",
28
- "import": "./dist/components/Form/index.mjs"
29
- }
18
+ ".": "./src/index.ts",
19
+ "./components/animations": "./src/components/Animations/index.ts",
20
+ "./components/form": "./src/components/Form/index.ts",
21
+ "./*": "./*"
30
22
  },
23
+ "main": "./dist/index.mjs",
24
+ "module": "./dist/index.mjs",
31
25
  "dependencies": {
32
26
  "@vueuse/core": "^13.3.0",
33
27
  "floating-vue": "^5.2.2",
34
- "reka-ui": "^2.3.0",
28
+ "reka-ui": "^2.3.1",
35
29
  "vue": "^3.5.16"
36
30
  },
37
31
  "devDependencies": {
38
32
  "@vue-macros/volar": "3.0.0-beta.8",
39
- "vue-tsc": "^3.0.0-alpha.8"
33
+ "vue-tsc": "^3.0.0-alpha.10"
40
34
  },
41
35
  "scripts": {
42
- "dev": "pnpm run stub",
43
- "stub": "unbuild --stub",
44
- "build": "unbuild",
36
+ "dev": "pnpm run build",
37
+ "stub": "pnpm run build",
38
+ "build": "tsdown",
45
39
  "typecheck": "vue-tsc --noEmit"
46
40
  }
47
41
  }
@@ -1,14 +1,17 @@
1
1
  <script setup lang="ts">
2
2
  import Input from '../Input/Input.vue'
3
3
 
4
- const props = defineProps<{
4
+ const props = withDefaults(defineProps<{
5
5
  label?: string
6
6
  description?: string
7
7
  placeholder?: string
8
8
  required?: boolean
9
9
  type?: string
10
10
  inputClass?: string
11
- }>()
11
+ singleLine?: boolean
12
+ }>(), {
13
+ singleLine: true,
14
+ })
12
15
 
13
16
  const modelValue = defineModel<string>({ required: true })
14
17
  </script>
@@ -26,11 +29,26 @@ const modelValue = defineModel<string>({ required: true })
26
29
  </div>
27
30
  </div>
28
31
  <Input
32
+ v-if="singleLine"
29
33
  v-model="modelValue"
30
34
  :type="props.type"
31
35
  :placeholder="props.placeholder"
32
36
  :class="props.inputClass"
33
37
  />
38
+ <textarea
39
+ v-else
40
+ v-model="modelValue"
41
+ :type="props.type"
42
+ :placeholder="props.placeholder"
43
+ :class="props.inputClass"
44
+ border="focus:primary-300 dark:focus:primary-400/50 2 solid neutral-100 dark:neutral-900"
45
+ transition="all duration-200 ease-in-out"
46
+ text="disabled:neutral-400 dark:disabled:neutral-600"
47
+ cursor="disabled:not-allowed"
48
+ w-full rounded-lg px-2 py-1 text-sm outline-none
49
+ shadow="sm"
50
+ bg="neutral-50 dark:neutral-950 focus:neutral-50 dark:focus:neutral-900"
51
+ />
34
52
  </label>
35
53
  </div>
36
54
  </template>
@@ -0,0 +1,62 @@
1
+ <script setup lang="ts">
2
+ import Input from '../Input/Input.vue'
3
+
4
+ const props = defineProps<{
5
+ label?: string
6
+ description?: string
7
+ name?: string
8
+ valuePlaceholder?: string
9
+ required?: boolean
10
+ inputClass?: string
11
+ }>()
12
+
13
+ const emit = defineEmits<{
14
+ (e: 'remove', index: number): void
15
+ (e: 'add'): void
16
+ }>()
17
+
18
+ const items = defineModel<string[]>({ required: true })
19
+
20
+ function addItem() {
21
+ items.value.push('')
22
+ emit('add')
23
+ }
24
+
25
+ function removeItem(index: number) {
26
+ items.value.splice(index, 1)
27
+ emit('remove', index)
28
+ }
29
+ </script>
30
+
31
+ <template>
32
+ <div class="max-w-full">
33
+ <label class="flex flex-col gap-2">
34
+ <div>
35
+ <div class="flex items-center gap-1 text-sm font-medium">
36
+ {{ props.label }}
37
+ <span v-if="props.required !== false" class="text-red-500">*</span>
38
+ </div>
39
+ <div class="text-nowrap text-xs text-neutral-500 dark:text-neutral-400">
40
+ {{ props.description }}
41
+ </div>
42
+ </div>
43
+
44
+ <div v-auto-animate class="~ col gap-2">
45
+ <div
46
+ v-for="(_, index) in items"
47
+ :key="index"
48
+ class="w-full flex items-center gap-2"
49
+ >
50
+ <Input
51
+ v-model="items[index]"
52
+ :placeholder="props.valuePlaceholder"
53
+ class="w-90%"
54
+ />
55
+ <button i-solar:minus-circle-line-duotone size="6" class="min-w-20px w-10% flex text-red-500" @click="removeItem(index)" />
56
+ </div>
57
+
58
+ <div i-solar:add-circle-line-duotone size="6" class="mt-2 w-4/5 text-blue-500" @click="addItem" />
59
+ </div>
60
+ </label>
61
+ </div>
62
+ </template>
@@ -2,3 +2,4 @@ export { default as FieldCheckbox } from './FieldCheckbox.vue'
2
2
  export { default as FieldInput } from './FieldInput.vue'
3
3
  export { default as FieldKeyValues } from './FieldKeyValues.vue'
4
4
  export { default as FieldRange } from './FieldRange.vue'
5
+ export { default as FieldValues } from './FieldValues.vue'
@@ -0,0 +1,29 @@
1
+ import { env } from 'node:process'
2
+
3
+ import { defineConfig } from 'tsdown'
4
+ import Raw from 'unplugin-raw/rolldown'
5
+ import Vue from 'unplugin-vue/rolldown'
6
+
7
+ export default defineConfig({
8
+ entry: {
9
+ 'index': './src/index.ts',
10
+ 'components/form': './src/components/Form/index.ts',
11
+ 'components/animations': './src/components/Animations/index.ts',
12
+ },
13
+ define: {
14
+ 'import.meta.DEV': JSON.stringify(!!env.DEV),
15
+ },
16
+ exports: {
17
+ devExports: true,
18
+ all: true,
19
+ },
20
+ fixedExtension: true,
21
+ plugins: [
22
+ Vue(),
23
+ Raw({
24
+ transform: {
25
+ options: { minifyWhitespace: true },
26
+ },
27
+ }),
28
+ ],
29
+ })
package/build.config.ts DELETED
@@ -1,11 +0,0 @@
1
- import { defineBuildConfig } from 'unbuild'
2
-
3
- export default defineBuildConfig({
4
- entries: [
5
- { builder: 'mkdist', input: './src/', outDir: './dist/', pattern: '**/*.vue', loaders: ['vue'] },
6
- { builder: 'mkdist', input: './src/', outDir: './dist/', pattern: '**/*.ts', format: 'esm', loaders: ['js'] },
7
- ],
8
- declaration: true,
9
- sourcemap: true,
10
- clean: true,
11
- })
@@ -1,95 +0,0 @@
1
- <script setup>
2
- const props = defineProps({
3
- duration: { type: Number, required: false, default: 250 },
4
- easingEnter: { type: String, required: false, default: "ease-in-out" },
5
- easingLeave: { type: String, required: false, default: "ease-in-out" },
6
- opacityClosed: { type: Number, required: false, default: 0 },
7
- opacityOpened: { type: Number, required: false, default: 1 }
8
- });
9
- const closed = "0px";
10
- function getElementStyle(element) {
11
- return {
12
- height: element.style.height,
13
- width: element.style.width,
14
- position: element.style.position,
15
- visibility: element.style.visibility,
16
- overflow: element.style.overflow,
17
- paddingTop: element.style.paddingTop,
18
- paddingBottom: element.style.paddingBottom,
19
- borderTopWidth: element.style.borderTopWidth,
20
- borderBottomWidth: element.style.borderBottomWidth,
21
- marginTop: element.style.marginTop,
22
- marginBottom: element.style.marginBottom
23
- };
24
- }
25
- function prepareElement(element, initialStyle) {
26
- const { width } = getComputedStyle(element);
27
- element.style.width = width;
28
- element.style.position = "absolute";
29
- element.style.visibility = "hidden";
30
- element.style.height = "";
31
- const { height } = getComputedStyle(element);
32
- element.style.width = initialStyle.width;
33
- element.style.position = initialStyle.position;
34
- element.style.visibility = initialStyle.visibility;
35
- element.style.height = closed;
36
- element.style.overflow = "hidden";
37
- return initialStyle.height && initialStyle.height !== closed ? initialStyle.height : height;
38
- }
39
- function animateTransition(element, initialStyle, done, keyframes, options) {
40
- const animation = element.animate(keyframes, options);
41
- element.style.height = initialStyle.height;
42
- animation.onfinish = () => {
43
- element.style.overflow = initialStyle.overflow;
44
- done();
45
- };
46
- }
47
- function getEnterKeyframes(height, initialStyle) {
48
- return [
49
- {
50
- height: closed,
51
- opacity: props.opacityClosed,
52
- paddingTop: closed,
53
- paddingBottom: closed,
54
- borderTopWidth: closed,
55
- borderBottomWidth: closed,
56
- marginTop: closed,
57
- marginBottom: closed
58
- },
59
- {
60
- height,
61
- opacity: props.opacityOpened,
62
- paddingTop: initialStyle.paddingTop,
63
- paddingBottom: initialStyle.paddingBottom,
64
- borderTopWidth: initialStyle.borderTopWidth,
65
- borderBottomWidth: initialStyle.borderBottomWidth,
66
- marginTop: initialStyle.marginTop,
67
- marginBottom: initialStyle.marginBottom
68
- }
69
- ];
70
- }
71
- function enterTransition(element, done) {
72
- const HTMLElement = element;
73
- const initialStyle = getElementStyle(HTMLElement);
74
- const height = prepareElement(HTMLElement, initialStyle);
75
- const keyframes = getEnterKeyframes(height, initialStyle);
76
- const options = { duration: props.duration, easing: props.easingEnter };
77
- animateTransition(HTMLElement, initialStyle, done, keyframes, options);
78
- }
79
- function leaveTransition(element, done) {
80
- const HTMLElement = element;
81
- const initialStyle = getElementStyle(HTMLElement);
82
- const { height } = getComputedStyle(HTMLElement);
83
- HTMLElement.style.height = height;
84
- HTMLElement.style.overflow = "hidden";
85
- const keyframes = getEnterKeyframes(height, initialStyle).reverse();
86
- const options = { duration: props.duration, easing: props.easingLeave };
87
- animateTransition(HTMLElement, initialStyle, done, keyframes, options);
88
- }
89
- </script>
90
-
91
- <template>
92
- <Transition :css="false" @enter="enterTransition" @leave="leaveTransition">
93
- <slot />
94
- </Transition>
95
- </template>
@@ -1 +0,0 @@
1
- export { default as TransitionVertical } from './TransitionVertical.vue';
@@ -1 +0,0 @@
1
- export { default as TransitionVertical } from "./TransitionVertical.vue";
@@ -1,26 +0,0 @@
1
- <script setup>
2
- import { SwitchRoot, SwitchThumb } from "reka-ui";
3
- const modelValue = defineModel({ type: Boolean, ...{ required: true } });
4
- </script>
5
-
6
- <template>
7
- <SwitchRoot
8
- v-model="modelValue"
9
- transition="background duration-250 ease-in-out"
10
- outline="focus-within:none"
11
- flex="~"
12
- border="neutral-300 dark:neutral-700 data-[state=checked]:primary-200 data-[state=unchecked]:neutral-300 focus-within:neutral-800"
13
- bg="data-[state=checked]:primary-400 data-[state=unchecked]:neutral-300 data-[state=checked]:dark:primary-400/80 dark:data-[state=unchecked]:neutral-800"
14
- relative h-7 w="12.5" rounded-full
15
- shadow="sm focus-within:shadow-neutral-800 focus-within:[0_0_0_1px] "
16
- >
17
- <SwitchThumb
18
- my-auto size-6
19
- flex items-center justify-center
20
- translate-x="0.5 data-[state=checked]:full"
21
- rounded-full bg-white text-xs shadow-xl
22
- transition="transform duration-250 ease-in-out"
23
- will-change-transform
24
- />
25
- </SwitchRoot>
26
- </template>
@@ -1 +0,0 @@
1
- export { default as Checkbox } from './Checkbox.vue';
@@ -1 +0,0 @@
1
- export { default as Checkbox } from "./Checkbox.vue";
@@ -1,24 +0,0 @@
1
- <script setup>
2
- import Checkbox from "../Checkbox/Checkbox.vue";
3
- const props = defineProps({
4
- label: { type: String, required: false },
5
- description: { type: String, required: false }
6
- });
7
- const modelValue = defineModel({ type: Boolean, ...{ required: true } });
8
- </script>
9
-
10
- <template>
11
- <label flex="~ col gap-4">
12
- <div flex="~ row" items-center gap-2>
13
- <div flex="1">
14
- <div class="flex items-center gap-1 text-sm font-medium">
15
- {{ props.label }}
16
- </div>
17
- <div class="text-xs text-neutral-500 dark:text-neutral-400">
18
- {{ props.description }}
19
- </div>
20
- </div>
21
- <Checkbox v-model="modelValue" />
22
- </div>
23
- </label>
24
- </template>
@@ -1,34 +0,0 @@
1
- <script setup>
2
- import Input from "../Input/Input.vue";
3
- const props = defineProps({
4
- label: { type: String, required: false },
5
- description: { type: String, required: false },
6
- placeholder: { type: String, required: false },
7
- required: { type: Boolean, required: false },
8
- type: { type: String, required: false },
9
- inputClass: { type: String, required: false }
10
- });
11
- const modelValue = defineModel({ type: String, ...{ required: true } });
12
- </script>
13
-
14
- <template>
15
- <div max-w-full>
16
- <label flex="~ col gap-4">
17
- <div>
18
- <div class="flex items-center gap-1 text-sm font-medium">
19
- {{ props.label }}
20
- <span v-if="props.required !== false" class="text-red-500">*</span>
21
- </div>
22
- <div class="text-xs text-neutral-500 dark:text-neutral-400" text-nowrap>
23
- {{ props.description }}
24
- </div>
25
- </div>
26
- <Input
27
- v-model="modelValue"
28
- :type="props.type"
29
- :placeholder="props.placeholder"
30
- :class="props.inputClass"
31
- />
32
- </label>
33
- </div>
34
- </template>
@@ -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,4 +0,0 @@
1
- export { default as FieldCheckbox } from './FieldCheckbox.vue';
2
- export { default as FieldInput } from './FieldInput.vue';
3
- export { default as FieldKeyValues } from './FieldKeyValues.vue';
4
- export { default as FieldRange } from './FieldRange.vue';
@@ -1,4 +0,0 @@
1
- export { default as FieldCheckbox } from "./FieldCheckbox.vue";
2
- export { default as FieldInput } from "./FieldInput.vue";
3
- export { default as FieldKeyValues } from "./FieldKeyValues.vue";
4
- export { default as FieldRange } from "./FieldRange.vue";
@@ -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,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";