@bl33dz/fa814698dcde12f86a37ac31dd3aedf9 1.0.20 → 1.0.22
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/fa814698dcde12f86a37ac31dd3aedf9.css +1 -1
- package/dist/perisai-ui.es.js +3485 -2386
- package/dist/perisai-ui.umd.js +20 -1
- package/package.json +3 -3
- package/src/index.ts +6 -5
- package/src/shadcn/context-menu/ContextMenuContent.vue +1 -1
- package/src/shadcn/context-menu/ContextMenuItem.vue +1 -1
- package/src/shadcn/context-menu/ContextMenuSubContent.vue +1 -1
- package/src/shadcn/input-otp/InputOTP.vue +28 -0
- package/src/shadcn/input-otp/InputOTPGroup.vue +22 -0
- package/src/shadcn/input-otp/InputOTPSeparator.vue +21 -0
- package/src/shadcn/input-otp/InputOTPSlot.vue +32 -0
- package/src/shadcn/input-otp/index.ts +4 -0
- package/src/shadcn/navigation-menu/NavigationMenuTrigger.vue +17 -12
- package/src/ui/card.vue +2 -2
- package/src/ui/dialog-body.vue +1 -1
- package/src/ui/dialog-header.vue +1 -1
- package/src/ui/select.vue +2 -1
- package/src/ui/sonner.vue +119 -22
- package/src/ui/toast.ts +55 -0
- package/vite.config.ts +0 -1
- package/src/ui/InputOTP.vue +0 -69
- package/src/ui/InputOTPGroup.vue +0 -7
- package/src/ui/InputOTPSeparator.vue +0 -8
- package/src/ui/InputOTPSlot.vue +0 -61
- package/src/ui/input-otp.vue +0 -52
package/src/ui/InputOTPSlot.vue
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { computed } from 'vue';
|
|
3
|
-
import { cn } from '@/lib/utils';
|
|
4
|
-
|
|
5
|
-
const props = defineProps({
|
|
6
|
-
index: Number,
|
|
7
|
-
char: String,
|
|
8
|
-
class: String,
|
|
9
|
-
disabled: Boolean,
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
const extDisplayChar = computed(() => {
|
|
13
|
-
return '';
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
const extIsActive = computed(() => {
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
const isActive = computed(() => {
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
const handleClick = () => {
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
const handleInput = (e) => {
|
|
26
|
-
const value = e.target.value;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
</script>
|
|
30
|
-
|
|
31
|
-
<template>
|
|
32
|
-
<!-- Fallback context: input field mode -->
|
|
33
|
-
<div
|
|
34
|
-
data-slot="input-otp-slot"
|
|
35
|
-
:data-index="props.index"
|
|
36
|
-
:data-active="isActive"
|
|
37
|
-
:class="cn('data-[active=true]:border-ring data-[active=true]:ring-ring/50 border-input relative flex h-9 w-9 items-center justify-center border-y border-r text-sm bg-input-background transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md data-[active=true]:z-10 data-[active=true]:ring-[3px] cursor-text', props.class)"
|
|
38
|
-
@click="handleClick"
|
|
39
|
-
>
|
|
40
|
-
<input
|
|
41
|
-
ref="inputRef"
|
|
42
|
-
type="text"
|
|
43
|
-
inputmode="numeric"
|
|
44
|
-
pattern="[0-9]*"
|
|
45
|
-
maxlength="1"
|
|
46
|
-
:value="char"
|
|
47
|
-
@input="handleInput"
|
|
48
|
-
@keydown="handleKeydown"
|
|
49
|
-
@focus="isFocused = true"
|
|
50
|
-
@blur="isFocused = false"
|
|
51
|
-
class="absolute inset-0 w-full h-full bg-transparent border-0 outline-none text-center opacity-0 caret-transparent"
|
|
52
|
-
style="caret-color: transparent;"
|
|
53
|
-
/>
|
|
54
|
-
<div class="pointer-events-none select-none relative z-10 flex items-center justify-center">
|
|
55
|
-
<span v-if="char" class="text-foreground">{{ displayChar }}</span>
|
|
56
|
-
</div>
|
|
57
|
-
<div v-if="isActive && !char" class="pointer-events-none absolute inset-0 flex items-center justify-center z-20">
|
|
58
|
-
<div class="animate-caret-blink bg-foreground h-4 w-px duration-1000" />
|
|
59
|
-
</div>
|
|
60
|
-
</div>
|
|
61
|
-
</template>
|
package/src/ui/input-otp.vue
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { computed, provide, defineAsyncComponent, useSlots } from 'vue';
|
|
3
|
-
import { cn } from '@/lib/utils';
|
|
4
|
-
// These would be your context keys (provide/inject)
|
|
5
|
-
const InputOTPMaskContext = Symbol('InputOTPMaskContext');
|
|
6
|
-
const FallbackInputOTPContext = Symbol('FallbackInputOTPContext');
|
|
7
|
-
|
|
8
|
-
const props = defineProps({
|
|
9
|
-
class: String,
|
|
10
|
-
containerClass: String,
|
|
11
|
-
maxLength: { type: Number, required: true },
|
|
12
|
-
modelValue: { type: String, default: '' },
|
|
13
|
-
disabled: { type: Boolean, default: false },
|
|
14
|
-
masked: { type: Boolean, default: false },
|
|
15
|
-
});
|
|
16
|
-
const emit = defineEmits(['update:modelValue']);
|
|
17
|
-
const slots = useSlots();
|
|
18
|
-
|
|
19
|
-
const handleChange = (newValue: string) => {
|
|
20
|
-
if (newValue.length <= props.maxLength) {
|
|
21
|
-
emit('update:modelValue', newValue);
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
import { OTPInput } from "input-otp";
|
|
26
|
-
|
|
27
|
-
const contextValue = computed(() => ({
|
|
28
|
-
value: props.modelValue,
|
|
29
|
-
onChange: handleChange,
|
|
30
|
-
maxLength: props.maxLength,
|
|
31
|
-
disabled: props.disabled,
|
|
32
|
-
masked: props.masked,
|
|
33
|
-
}));
|
|
34
|
-
|
|
35
|
-
</script>
|
|
36
|
-
<template>
|
|
37
|
-
<OTPInput
|
|
38
|
-
data-slot="input-otp"
|
|
39
|
-
:container-class="cn('flex items-center gap-2 has-disabled:opacity-50', props.containerClass)"
|
|
40
|
-
:class-name="cn('disabled:cursor-not-allowed', props.class)"
|
|
41
|
-
:maxlength="props.maxLength"
|
|
42
|
-
:value="props.modelValue"
|
|
43
|
-
:on-change="(val) => emit('update:modelValue', val)"
|
|
44
|
-
:disabled="props.disabled"
|
|
45
|
-
v-bind="props"
|
|
46
|
-
style="display: flex;"
|
|
47
|
-
>
|
|
48
|
-
<div class="flex items-center gap-2">
|
|
49
|
-
<slot />
|
|
50
|
-
</div>
|
|
51
|
-
</OTPInput>
|
|
52
|
-
</template>
|