A self-hosted media server and file management system
Vue ffmpegfile-serverjellyfinlaravelmediamedia-playermedia-servermediabrowsermediaservermusicmusic-librarymusic-playermusicplayerself-hostedvuejs
feat: inital cedar-ui components installation
aminnausin174dcd128bda
diff --git a/resources/css/app.css b/resources/css/app.cssindex c6d4cbaa..ac5e2f4c 100755--- a/resources/css/app.css+++ b/resources/css/app.css@@ -5,6 +5,7 @@@config '../../tailwind.config.ts';+@import './cedar-theme.css';/*The default border color has changed to `currentcolor` in Tailwind CSS v4,so we've added these compatibility styles to make sure everything stilldiff --git a/resources/css/cedar-base.css b/resources/css/cedar-base.cssnew file mode 100644index 00000000..5f5e314e--- /dev/null+++ b/resources/css/cedar-base.css@@ -0,0 +1,141 @@+@import 'tailwindcss';++@config '../../tailwind.config.js';++/* Global Defaults */+@layer base {+ *,+ ::after,+ ::before,+ ::backdrop,+ ::file-selector-button {+ /* @apply border-border; */+ border-color: var(--color-gray-200, currentcolor);+ }++ [v-cloak] {+ display: none;+ }++ input[type='number']::-webkit-inner-spin-button,+ input[type='number']::-webkit-outer-spin-button {+ -webkit-appearance: none;+ margin: 0;+ }++ input[type='number'] {+ appearance: textfield;+ }+}++/* Custom Base Themes */+@layer base {+ @theme {+ /* Border radius */+ --radius-xl: calc(var(--radius) + 4px);+ --radius-lg: var(--radius);+ --radius-md: calc(var(--radius) - 2px);+ --radius-sm: calc(var(--radius) - 4px);++ /* Aspect ratios */+ --aspect-video: 16 / 9;+ --aspect-square: 1 / 1;+ --aspect-portrait: 9 / 16;+ --aspect-1-2: 1 / 2;+ --aspect-2-3: 2 / 3;+ --aspect-3-4: 3 / 4;++ /* Breakpoints */+ --breakpoint-xs: 20rem; /* 320px */+ --breakpoint-xms: 25rem; /* 400px */+ --breakpoint-3xl: 125rem; /* 2000px */++ /* Container */+ --container-center: true;+ --container-padding: 2rem;+ --container-2xl: 1536px;+ }+}++/* Scrollbar */++@layer base {+ ::-webkit-scrollbar {+ width: var(--scrollbar-width);+ }+ ::-webkit-scrollbar-track {+ background: var(--color-scrollbar-track);+ border-radius: var(--radius-scrollbar-thumb);+ }+ ::-webkit-scrollbar-thumb {+ background: var(--color-scrollbar-thumb);+ border-radius: var(--radius-scrollbar-thumb);+ }++ * {+ scrollbar-color: var(--color-scrollbar-thumb) var(--color-scrollbar-track);+ }+}++@layer utilities {+ .scrollbar-thin {+ --width-scrollbar: thin;+ scrollbar-width: var(--width-scrollbar);+ }++ /* Hide until hover */+ .scrollbar-hover {+ scrollbar-width: none;+ /* scrollbar-color: color-mix(in oklab, oklch(26.9% 0 0) 10%, transparent) color-mix(in oklab, oklch(26.9% 0 0) 00%, transparent); */+ }++ .group:hover .scrollbar-hover {+ scrollbar-width: var(--width-scrollbar);+ /* scrollbar-color: color-mix(in oklab, var(--color-scrollbar-thumb) 100%, transparent)+ color-mix(in oklab, var(--color-scrollbar-track) 00%, transparent); */+ }++ .scrollable-input {+ --color-scrollbar-thumb: var(--color-scrollbar-thumb-2);+ --color-scrollbar-track: var(--color-scrollbar-track-2);+ /* scrollbar-color: var(--color-scrollbar-thumb-2) var(--color-scrollbar-track-2); */+ }++ @supports selector(::-webkit-scrollbar) {+ .scrollbar-thin::-webkit-scrollbar {+ width: var(--default-scrollbar-width);+ height: var(--default-scrollbar-width);+ }++ .scrollbar-hover::-webkit-scrollbar {+ width: 0;+ height: 0;+ }++ .group:hover .scrollbar-hover::-webkit-scrollbar {+ width: var(--default-scrollbar-width);+ height: var(--default-scrollbar-width);+ }+ }+}++/* Other Classes */++@layer utilities {+ .antialised {+ -webkit-font-smoothing: antialiased;+ -moz-osx-font-smoothing: grayscale;+ }++ .opacity-disabled {+ opacity: var(--opacity-disabled);+ }++ .button-disabled {+ @apply opacity-disabled cursor-not-allowed;+ }++ .button-disabled-pointer {+ @apply pointer-events-none;+ }+}diff --git a/resources/css/cedar-theme.css b/resources/css/cedar-theme.cssnew file mode 100644index 00000000..4fce04e8--- /dev/null+++ b/resources/css/cedar-theme.css@@ -0,0 +1,155 @@+@import 'tailwindcss';++@config '../../tailwind.config.ts';++/* Custom Colour Themes */+@layer base {+ @theme {+ /* Border radius */+ --radius-xl: calc(var(--radius) + 4px);+ --radius-lg: var(--radius);+ --radius-md: calc(var(--radius) - 2px);+ --radius-sm: calc(var(--radius) - 4px);++ /* Aspect ratios */+ --aspect-video: 16 / 9;+ --aspect-square: 1 / 1;+ --aspect-portrait: 9 / 16;+ --aspect-1-2: 1 / 2;+ --aspect-2-3: 2 / 3;+ --aspect-3-4: 3 / 4;++ /* Breakpoints */+ --breakpoint-xs: 20rem; /* 320px */+ --breakpoint-xms: 25rem; /* 400px */+ --breakpoint-3xl: 125rem; /* 2000px */++ /* Container */+ --container-center: true;+ --container-padding: 2rem;+ --container-2xl: 1536px;++ /* Surfaces (0 is page) */+ --color-surface-i: oklch(0.1749 0.0082 285.52); /* primary-dark-950 #101014 */+ --color-surface-0: oklch(0.9841 0.0035 39.48); /* primary-950 #fcf9f8 */+ --color-surface-1: oklch(0.9851 0 129.63); /* primary-900 #fafafa */+ --color-surface-2: var(--color-white); /* white */+ --color-surface-3: oklch(0.9674 0.0013 286.35); /* primary-800 #f4f4f5 */+ --color-surface-4: oklch(0.9841 0.0035 39.48);++ /* Toasts Menus Popovers Dropdowns */+ --color-overlay: var(--color-white);+ --color-overlay-t: var(--color-overlay);+ --color-overlay-2: var(--color-white);+ --color-overlay-2-t: var(--color-overlay-2);+ --color-overlay-border: var(--color-neutral-200);+ --color-overlay-accent: var(--color-neutral-100);++ /* Text (0 is brightest) */+ --foreground-0: oklch(0.1405 0.0044 285.82); /* this is zinc-950 */+ --color-foreground-i: var(--color-white); /* white inverse of dark-0 */+ --color-foreground-0: var(--color-gray-900); /* In my code I used gray-900 which is oklch(21% 0.034 264.665) = #101828 */+ --color-foreground-1: var(--color-neutral-600); /* neutral-600 (to 400) */+ --color-foreground-2: var(--color-neutral-500); /* neutral-500 (to 400)*/+ --color-foreground-3: var(--color-neutral-400); /* neutral-400 (to 500)*/+ --color-foreground-4: var(--color-neutral-100); /* neutral-100 (to 300) #f5f5f5 */+ --color-foreground-4-hover: var(--color-neutral-100); /* neutral-100 (to 400) #f5f5f5 */+ --color-foreground-6: var(--color-neutral-700); /* to neutral-300 */+ --color-foreground-7: var(--color-neutral-500); /* to neutral-300 */++ /* Main Colours */+ --color-primary: var(--color-purple-600); /* purple-600 */+ --color-primary-muted: var(--color-purple-500); /* purple-500 */+ --color-primary-active: var(--color-purple-700); /* purple-700 */+ --color-primary-dark: var(--color-purple-900); /* purple-900 */+ --color-primary-foreground: var(--color-white); /* purple-600 */++ /* Ring */+ --color-r-disabled: var(--color-neutral-200) /* neutral-200 #e5e5e5 */;+ --color-r-button: var(--color-neutral-200) /* neutral-200 #e5e5e5 */;+ --color-r-input: var(--color-neutral-200) /* to transparent */;+ --color-r-default: var(--color-gray-900) /* gray-900 #101828 */;+ --color-r-card: color-mix(in oklab, oklch(21% 0.034 264.665) 5%, transparent) /* gray-900/70 #101828 */;+ --color-r-inverse: var(--color-neutral-100); /* neutral-100 inverse (toasts) */++ /* Border Divide */+ --color-b: var(--color-gray-200); /* gray-200 #e5e7eb */+ --color-border-1: oklch(92% 0.004 286.32); /*zinc-200 or oklch(92.2% 0 0); /* neutral-200 #e5e5e5 */+ --color-d: var(--color-gray-200); /* gray-200 #e5e7eb */+ --color-hr: var(--color-neutral-200);++ /* Primary dark shades */+ --color-primary-dark-600: #2a2a2d;+ --color-primary-dark-700: #26262a;+ --color-primary-dark-800: #27272a;+ --color-primary-dark-900: #18181b;+ --color-primary-dark-950: #101014;++ /* Indicator Colors */+ --color-success: oklch(72.3% 0.219 149.579); /* green-500 */+ --color-info: oklch(62.3% 0.214 259.815); /* blue-500 */+ --color-warning: oklch(75% 0.183 55.934); /* orange-500 */+ --color-danger: oklch(64.5% 0.246 16.439); /* rose-500 */+ --color-danger-2: oklch(58.6% 0.253 17.585); /* rose-600 */+ --color-danger-3: oklch(51.4% 0.222 16.935); /* rose-700 */++ /* Opacity */+ --opacity-disabled: 0.6;++ /* Scrollbar */+ --color-scrollbar-thumb: var(--color-surface-2); /* Window */+ --color-scrollbar-track: transparent;+ --color-scrollbar-thumb-2: var(--color-foreground-3); /* Components */+ --color-scrollbar-track-2: transparent;+ --radius-scrollbar-thumb: 5px;+ --default-scrollbar-width: 0.35rem;+ }++ .dark {+ /* Surfaces (0 is page) */+ --color-surface-i: oklch(0.9841 0.0035 39.48); /* primary-950 #fcf9f8 */+ --color-surface-0: oklch(0.1749 0.0082 285.52); /* primary-dark-950 #101014 */+ --color-surface-1: oklch(0.2103 0.0059 285.89); /* primary-dark-900 zinc-900 #18181b */+ --color-surface-2: oklch(0.2739 0.0055 286.03); /* primary-dark-800 zinc-800 #27272a */+ --color-surface-3: #26262a; /* primary-dark-700 #26262a */+ --color-surface-4: #2a2a2d; /* primary-dark-600 #2a2a2d ?? this is darker */++ /* Text (0 is brightest) This is a mess */+ --foreground-0: hsl(0 0% 98%); /* zinc-50 and neutral-50 */+ --color-foreground-i: var(--color-gray-900); /* gray-900 inverse of light-0 */+ --color-foreground-0: var(--color-white); /* white */+ --color-foreground-1: var(--color-neutral-400); /* neutral-400 */+ --color-foreground-2: var(--color-neutral-400); /* neutral-400 */+ --color-foreground-3: var(--color-neutral-500); /* neutral-500 */+ --color-foreground-4: var(--color-neutral-300); /* neutral-300 #d4d4d4 */+ --color-foreground-4-hover: var(--color-neutral-400); /* neutral-400 #a1a1a1 */+ --color-foreground-5: var(--color-neutral-100); /* neutral-100 */+ --color-foreground-6: var(--color-neutral-300); /* from neutral-700 */+ --color-foreground-7: var(--color-neutral-300); /* from neutral-500 */++ /* Ring */+ --color-r-disabled: var(--color-neutral-700) /* neutral-700 #404040 */;+ --color-r-button: var(--color-neutral-600); /* neutral-600 #525252 */+ --color-r-input: transparent /* to transparent */;+ --color-r-default: var(--color-gray-900) /* gray-900 #101828 */;+ --color-r-inverse: color-mix(in oklab, oklch(26.9% 0 0) 50%, transparent); /* neutral-800/50 */++ /* Border Divide */+ --color-b: oklch(92.8% 0.006 264.531); /* gray-200 #e5e7eb */+ --color-border-1: oklch(43.9% 0 0); /* neutral-600 #525252 */+ --color-d: oklch(37.1% 0 0); /* neutral-700 #404040 */+ --color-hr: var(--color-neutral-500);++ /* Indicator Colors */+ --color-success: oklch(62.7% 0.194 149.214); /* green-600 */+ --color-danger: oklch(58.6% 0.253 17.585); /* rose-600 */++ /* Toasts Menus Popovers Dropdowns */+ --color-overlay: oklch(0.2739 0.0055 286.03) /* #26262a */; /* surface-3/70 */+ --color-overlay-t: color-mix(in oklab, var(--color-overlay) 70%, transparent); /* surface-3/70 */+ --color-overlay-2: var(--color-neutral-800);+ --color-overlay-2-t: color-mix(in oklab, var(--color-neutral-800) 90%, transparent); /* neutral-800/90 */+ --color-overlay-border: var(--color-neutral-700);+ --color-overlay-accent: var(--color-neutral-900);+ }+}diff --git a/resources/js/components/cedar-ui/button/ButtonBase.vue b/resources/js/components/cedar-ui/button/ButtonBase.vuenew file mode 100644index 00000000..b7934518--- /dev/null+++ b/resources/js/components/cedar-ui/button/ButtonBase.vue@@ -0,0 +1,73 @@+<script setup lang="ts">+import type { ButtonComponent, ButtonType } from '@aminnausin/cedar-ui';+import type { ComponentPublicInstance } from 'vue';++import { computed, useTemplateRef } from 'vue';+import { RouterLink } from 'vue-router';+import { cn } from '@aminnausin/cedar-ui';++const el = useTemplateRef<HTMLElement | ComponentPublicInstance | null>('el');++const props = withDefaults(+ defineProps<{+ disabled?: boolean;+ as?: ButtonComponent;+ to?: string;+ href?: string;+ ariaLabel?: string;+ class?: any;+ useSize?: boolean;+ target?: string;+ type?: ButtonType;+ }>(),+ {+ useSize: true,+ disabled: false,+ type: 'button',+ },+);++const wrapper = computed(() => props.as ?? (props.to ? RouterLink : props.href ? 'a' : 'button')); // Component is set here but props are set 1 level above++defineExpose({+ $el: () => {+ const value = el.value;++ if (!value) return null;++ if (value instanceof HTMLElement) {+ return value;+ }++ return value.$el as HTMLElement | null;+ },+});+</script>+<template>+ <component+ ref="el"+ :is="wrapper"+ :class="+ cn(+ 'transition duration-200 ease-in-out focus:outline-hidden', // Animation+ { 'button-disabled-pointer': wrapper === 'button' && disabled }, // Disabled Button+ { 'button-disabled': disabled }, // Disabled+ 'flex items-center justify-center gap-2', // Layout+ 'cursor-pointer', // Style+ { 'h-8 max-h-full p-2': useSize }, // Size+ 'rounded-md', // Shape+ props.class,+ )+ "+ :target="wrapper !== 'button' ? target : undefined"+ :disabled="wrapper === 'button' ? disabled : undefined"+ :aria-disabled="wrapper !== 'button' ? disabled : undefined"+ :data-disabled="disabled"+ :aria-label="ariaLabel"+ :to="to"+ :href="href"+ :type="type"+ >+ <slot />+ </component>+</template>diff --git a/resources/js/components/cedar-ui/button/ButtonCorner.vue b/resources/js/components/cedar-ui/button/ButtonCorner.vuenew file mode 100644index 00000000..2d267068--- /dev/null+++ b/resources/js/components/cedar-ui/button/ButtonCorner.vue@@ -0,0 +1,60 @@+<script setup lang="ts">+import { CedarDelete2 } from '../icons';+import { ButtonBase } from '.';+import { computed } from 'vue';+import { cn } from '@aminnausin/cedar-ui';++const props = withDefaults(+ defineProps<{+ to?: string;+ label?: string;+ disabled?: boolean;+ positionClasses?: string; // legacy+ colourClasses?: string; // legacy+ textClasses?: string; // legacy+ useDefaultStyle?: boolean;+ }>(),+ {+ useDefaultStyle: true,+ },+);++const wrapperProps = computed(() => {+ return props.to+ ? { to: props.to, title: props.label ?? 'Link', 'aria-label': props.label ?? 'Link' }+ : {+ 'aria-label': props.label ?? 'Close Modal',+ title: props?.label ?? 'Close Modal',+ };+});++const defaultClasses = computed(() => {+ return props.useDefaultStyle+ ? {+ position: 'absolute top-0 right-0 size-8 mt-5 mr-5',+ colour: 'focus-visible:bg-surface-1 hover:bg-surface-1',+ text: 'text-foreground-1 hover:text-foreground-0',+ }+ : { position: '', colour: '', text: '' };+});+</script>++<template>+ <ButtonBase+ :disabled="disabled"+ :use-size="false"+ :class="+ cn(+ 'rounded-full p-0',+ positionClasses ?? defaultClasses.position,+ colourClasses ?? defaultClasses.colour,+ textClasses ?? defaultClasses.text,+ )+ "+ v-bind="wrapperProps"+ >+ <slot name="icon">+ <CedarDelete2 />+ </slot>+ </ButtonBase>+</template>diff --git a/resources/js/components/cedar-ui/button/ButtonForm.vue b/resources/js/components/cedar-ui/button/ButtonForm.vuenew file mode 100644index 00000000..0d605b1d--- /dev/null+++ b/resources/js/components/cedar-ui/button/ButtonForm.vue@@ -0,0 +1,54 @@+<script setup lang="ts">+import type { ButtonType, FormButtonVariant } from '@aminnausin/cedar-ui';++import { ButtonBase } from '.';+import { computed } from 'vue';+import { cn } from '@aminnausin/cedar-ui';++const props = withDefaults(+ defineProps<{+ disabled?: boolean;+ type?: ButtonType;+ variant?: FormButtonVariant;+ label?: string;+ }>(),+ {+ disabled: false,+ type: 'button',+ },+);+const variantClass = computed(() => {+ switch (props.variant) {+ case 'submit':+ return [+ 'text-foreground-i font-medium border-transparent',+ 'focus:ring-primary bg-surface-i hocus:bg-surface-i/90 dark:hover:bg-foreground-4',+ ];+ case 'reset':+ return ['font-medium', 'hocus:ring-foreground-4-hover', 'hocus:bg-surface-3'];+ case 'auth': // This one is styled from Laravel+ return [+ 'bg-gray-800 dark:bg-gray-200 hover:dark:bg-gray-300',+ 'border-transparent font-semibold text-xs uppercase tracking-widest',+ 'text-foreground-i hover:bg-gray-700 dark:hover:foreground-0',+ 'focus:bg-gray-700 dark:focus:bg-foreground-0 active:bg-gray-900 dark:active:bg-gray-300',+ 'focus:ring-2 focus:ring-purple-500 focus:ring-offset-2 dark:focus:ring-offset-gray-800',+ ];+ default:+ return ['focus:ring-r-button dark:focus:ring-r-disabled hocus:bg-surface-3'];+ }+});+</script>+<template>+ <ButtonBase+ :type="type"+ :class="+ cn('px-4', 'border-r-button ring-offset-surface-0 border', 'inline-flex', 'focus:ring-1 focus:ring-offset-1', ...variantClass)+ "+ :disabled="disabled"+ :aria-label="label"+ >+ <slot name="text"></slot>+ <slot></slot>+ </ButtonBase>+</template>diff --git a/resources/js/components/cedar-ui/button/ButtonIcon.vue b/resources/js/components/cedar-ui/button/ButtonIcon.vuenew file mode 100644index 00000000..29ee1dc1--- /dev/null+++ b/resources/js/components/cedar-ui/button/ButtonIcon.vue@@ -0,0 +1,61 @@+<script setup lang="ts">+import { ButtonBase } from '.';+import { computed } from 'vue';++const props = withDefaults(+ defineProps<{+ type?: 'reset' | 'submit' | 'button' | undefined;+ disabled?: boolean;+ title?: string;+ variant?: 'default' | 'ghost' | 'transparent';+ to?: string;+ href?: string;+ target?: string;+ }>(),+ {+ variant: 'default',+ target: '_self',+ type: 'button',+ },+);++const variantClass = computed(() => {+ switch (props.variant) {+ case 'ghost':+ return [];+ case 'transparent':+ return ['hover:ring-1 focus:ring-1 hover:ring-surface-1 focus:ring-surface-1 focus:bg-transparent hover:bg-transparent'];+ default:+ return ['shadow-xs', 'ring-1 ring-r-button hover:ring-primary-active focus:ring-primary hocus:ring-2', 'bg-surface-2'];+ }+});++const wrapperProps = computed(() => {+ let wProps = {};++ if (props.to || props.href) wProps = { title: props.title ?? 'Link' };++ return {+ title: props.title ?? 'Button',+ to: props.to,+ href: props.href,+ target: props.target ?? '_blank',+ type: props.type,+ ...wProps,+ };+});+</script>++<template>+ <ButtonBase+ v-bind="wrapperProps"+ :class="['focus:bg-surface-3 hover:bg-surface-3 aspect-square', ...variantClass]"+ :aria-label="$slots.text ? undefined : title"+ :disabled="disabled"+ >+ <!-- Should remove (only have icon but that should be the default not named) -->+ <slot name="text"> </slot>+ <slot name="icon"> </slot>+ <slot></slot>+ </ButtonBase>+</template>diff --git a/resources/js/components/cedar-ui/button/ButtonText.vue b/resources/js/components/cedar-ui/button/ButtonText.vuenew file mode 100644index 00000000..bcb663c7--- /dev/null+++ b/resources/js/components/cedar-ui/button/ButtonText.vue@@ -0,0 +1,57 @@+<script setup lang="ts">+import type { ButtonType, TextButtonVariant } from '@aminnausin/cedar-ui';++import { ButtonBase } from '.';+import { computed } from 'vue';+import { cn } from '@aminnausin/cedar-ui';++const props = withDefaults(+ defineProps<{+ type?: ButtonType;+ disabled?: boolean;+ title?: string;+ variant?: TextButtonVariant;+ to?: string;+ href?: string;+ target?: string;+ text?: string;+ }>(),+ {+ title: '',+ type: 'button',+ variant: 'default',+ target: '_blank',+ },+);++const wrapperProps = computed(() => {+ let wProps = {};++ if (props.to) wProps = { to: props.to, title: props.title ?? 'Link' };+ else if (props.href) wProps = { href: props.href, title: props.title ?? 'External Link' };++ return { title: props.title ?? 'Button', target: props.target ?? '_blank', type: props.type, ...wProps };+});++const variantClass = computed(() => {+ switch (props.variant) {+ case 'ghost':+ return [];+ case 'transparent':+ return ['hocus:ring-1 hocus:ring-surface-1 hocus:bg-transparent'];+ case 'form':+ return ['inline-flex px-4', 'border border-r-button', 'focus:ring-primary focus:ring-1 focus:ring-offset-1'];+ default:+ return ['shadow-xs', 'ring-1 ring-r-button hover:ring-primary-active focus:ring-primary hocus:ring-2', 'bg-surface-2'];+ }+});+</script>++<template>+ <button-base :class="[cn('ring-offset-surface-0 hocus:bg-surface-3', ...variantClass)]" v-bind="wrapperProps">+ <slot>+ <p class="line-clamp-1 flex-1 text-left" v-if="text">{{ text }}</p>+ </slot>+ <slot name="icon"> </slot>+ </button-base>+</template>diff --git a/resources/js/components/cedar-ui/button/index.ts b/resources/js/components/cedar-ui/button/index.tsnew file mode 100644index 00000000..fa583f3c--- /dev/null+++ b/resources/js/components/cedar-ui/button/index.ts@@ -0,0 +1,5 @@+export { default as ButtonCorner } from './ButtonCorner.vue';+export { default as ButtonForm } from './ButtonForm.vue';+export { default as ButtonIcon } from './ButtonIcon.vue';+export { default as ButtonText } from './ButtonText.vue';+export { default as ButtonBase } from './ButtonBase.vue';diff --git a/resources/js/components/cedar-ui/drawer/BaseDrawer.vue b/resources/js/components/cedar-ui/drawer/BaseDrawer.vuenew file mode 100644index 00000000..724ec463--- /dev/null+++ b/resources/js/components/cedar-ui/drawer/BaseDrawer.vue@@ -0,0 +1,93 @@+<script setup lang="ts">+import type { DrawerProps, SwipeDirection } from '@aminnausin/cedar-ui';++import { cn, useSwipeHandler, SWIPE_THRESHOLD, VELOCITY_THRESHOLD, useDrawer } from '@aminnausin/cedar-ui';+import { ButtonText } from '../button';+import { RootDrawer } from '.';+import { ref } from 'vue';++import DrawerHandle from './DrawerHandle.vue';++const drawer = useDrawer();++const props = withDefaults(defineProps<DrawerProps>(), { direction: 'bottom' });+const swipeDirections = ref<SwipeDirection[]>([props.direction]);++const { offset, isSwiping, onPointerDown, onPointerMove, onPointerUp, onPointerCancel, isTapGesture } = useSwipeHandler({+ directions: swipeDirections,+ swipeThreshold: { px: SWIPE_THRESHOLD },+ velocityThreshold: VELOCITY_THRESHOLD,+ onSwipeOut: drawer.close,+});+</script>+<template>+ <RootDrawer+ @keydown.esc="drawer.close"+ @pointerdown="onPointerDown"+ @pointermove="onPointerMove"+ @pointerup="onPointerUp"+ @dragend="onPointerUp"+ @pointercancel="onPointerCancel"+ :class="cn(drawer.props.value?.rootClass, 'drawer transition-all duration-300 ease-out')"+ :data-isSwiping="isSwiping"+ :style="{+ '--offset-y': `${Math.max(-10, offset.y)}px`,+ }"+ id="drawer"+ >+ <div class="flex flex-col items-center justify-center">+ <div class="group flex w-full cursor-pointer pt-4">+ <slot name="handle">+ <DrawerHandle+ :aria-expanded="drawer.isOpen.value"+ @keydown.enter.prevent="drawer.close"+ @keydown.space.prevent="drawer.close"+ @pointerup="+ () => {+ onPointerUp();+ if (isTapGesture()) drawer.close();+ }+ "+ />+ </slot>+ </div>+ <div class="flex w-full flex-col gap-3 p-3">+ <slot name="header">+ <div class="flex w-full flex-col gap-1.5">+ <h2 id="drawerTitle" class="text-foreground flex-1 text-xl font-semibold">+ <slot name="title">+ {{ drawer.props.value.title ?? title ?? 'Title' }}+ </slot>+ </h2>+ <p class="text-foreground-1 w-full text-sm" v-if="$slots.description || drawer.props.value.description || description" id="drawerDescription">+ <slot name="description">{{ drawer.props.value.description ?? description ?? 'Description' }}</slot>+ </p>+ </div>+ </slot>+ </div>+ <div v-if="$slots.default" class="scrollbar-hide flex max-h-[60vh] w-full flex-col gap-3 overflow-y-scroll p-3">+ <slot> </slot>+ </div>+ <div v-if="$slots.footer || !$slots.default" class="flex w-full flex-col gap-3 p-3">+ <slot name="footer">+ <ButtonText :class="'h-8 w-full text-sm capitalize ring-1'" :variant="'default'" @click="drawer.close()"> Close Drawer </ButtonText>+ </slot>+ </div>+ </div>+ </RootDrawer>+</template>+<style lang="css" scoped>+.drawer {+ transform: translateY(var(--offset-y, 0px)) translateX(var(--offset-x, 0px));+}++@media (prefers-reduced-motion: reduce) {+ .drawer {+ transition: none !important;+ }+}++[data-isSwiping='true'] {+ transition-property: none !important;+}+</style>diff --git a/resources/js/components/cedar-ui/drawer/DrawerController.vue b/resources/js/components/cedar-ui/drawer/DrawerController.vuenew file mode 100644index 00000000..75d60aa0--- /dev/null+++ b/resources/js/components/cedar-ui/drawer/DrawerController.vue@@ -0,0 +1,57 @@+<script setup lang="ts">+import type { DrawerControllerProps } from '@aminnausin/cedar-ui';++import { UseFocusTrap } from '@vueuse/integrations/useFocusTrap/component';+import { useDrawer } from '@aminnausin/cedar-ui';++const props = withDefaults(defineProps<DrawerControllerProps>(), {+ teleportTarget: 'body',+});++const drawerStore = useDrawer();+</script>+<template>+ <Teleport :to="teleportTarget">+ <div+ role="dialog"+ aria-modal="true"+ :aria-labelledby="drawerStore.props.value?.title ? 'drawerTitle' : undefined"+ :aria-describedby="drawerStore.props.value?.description ? 'drawerDescription' : undefined"+ class="fixed top-0 left-0 z-50 flex h-screen w-screen items-center justify-center bg-transparent text-gray-900 dark:text-neutral-200"+ v-show="drawerStore.isOpen.value || drawerStore.isAnimating.value"+ v-cloak+ >+ <Transition+ enter-active-class="transition-opacity ease-out duration-200"+ enter-from-class="opacity-0"+ enter-to-class="opacity-100"+ leave-active-class="transition-opacity ease-in duration-200"+ leave-from-class="opacity-100"+ leave-to-class="opacity-0"+ >+ <div+ v-if="drawerStore.isOpen.value"+ :class="['absolute inset-0 h-full w-full backdrop-blur-xs bg-black/50']"+ @click="drawerStore.close()"+ ></div>+ </Transition>++ <Transition+ enter-active-class="transition-all ease-out duration-200"+ enter-from-class="opacity-0 translate-y-full"+ enter-to-class="opacity-100 translate-y-0"+ leave-active-class="transition-all ease-in duration-200"+ leave-from-class="opacity-100 translate-y-0"+ leave-to-class="opacity-0 translate-y-full"+ >+ <UseFocusTrap+ v-if="drawerStore.isOpen.value && drawerStore.component.value"+ class="scrollbar-hide fixed bottom-0 left-0 flex items-center"+ :options="{ allowOutsideClick: true }"+ >+ <component :is="drawerStore.component.value" />+ </UseFocusTrap>+ </Transition>+ </div>+ </Teleport>+</template>diff --git a/resources/js/components/cedar-ui/drawer/DrawerHandle.vue b/resources/js/components/cedar-ui/drawer/DrawerHandle.vuenew file mode 100644index 00000000..e2a22934--- /dev/null+++ b/resources/js/components/cedar-ui/drawer/DrawerHandle.vue@@ -0,0 +1,8 @@+<template>+ <button+ type="button"+ title="Close Drawer"+ class="mx-auto w-1/8 sm:w-1/12 h-1.5 rounded-full bg-foreground-2 cursor-pointer group-hover:bg-foreground-1 transition-colors focus:outline-0 focus:bg-foreground-1"+ aria-controls="drawer"+ ></button>+</template>diff --git a/resources/js/components/cedar-ui/drawer/RootDrawer.vue b/resources/js/components/cedar-ui/drawer/RootDrawer.vuenew file mode 100644index 00000000..d6d0750e--- /dev/null+++ b/resources/js/components/cedar-ui/drawer/RootDrawer.vue@@ -0,0 +1,8 @@+<script setup lang="ts">+import { cn } from '@aminnausin/cedar-ui';+</script>+<template>+ <div :class="cn('bg-surface-1 w-screen rounded-t-lg backdrop-blur-lg')">+ <slot></slot>+ </div>+</template>diff --git a/resources/js/components/cedar-ui/drawer/index.ts b/resources/js/components/cedar-ui/drawer/index.tsnew file mode 100644index 00000000..da8a8b13--- /dev/null+++ b/resources/js/components/cedar-ui/drawer/index.ts@@ -0,0 +1,3 @@+export { default as DrawerController } from './DrawerController.vue';+export { default as BaseDrawer } from './BaseDrawer.vue';+export { default as RootDrawer } from './RootDrawer.vue';diff --git a/resources/js/components/cedar-ui/icons/CedarCalendar.vue b/resources/js/components/cedar-ui/icons/CedarCalendar.vuenew file mode 100644index 00000000..13f173dc--- /dev/null+++ b/resources/js/components/cedar-ui/icons/CedarCalendar.vue@@ -0,0 +1,10 @@+<template>+ <svg fill="none" viewBox="0 0 24 24" stroke="currentColor">+ <path+ stroke-linecap="round"+ stroke-linejoin="round"+ stroke-width="2"+ d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"+ />+ </svg>+</template>diff --git a/resources/js/components/cedar-ui/icons/CedarCheckMark.vue b/resources/js/components/cedar-ui/icons/CedarCheckMark.vuenew file mode 100644index 00000000..f9728841--- /dev/null+++ b/resources/js/components/cedar-ui/icons/CedarCheckMark.vue@@ -0,0 +1,13 @@+<template>+ <svg+ xmlns="http://www.w3.org/2000/svg"+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ stroke-width="2"+ stroke-linecap="round"+ stroke-linejoin="round"+ >+ <polyline points="20 6 9 17 4 12"></polyline>+ </svg>+</template>diff --git a/resources/js/components/cedar-ui/icons/CedarChevronLeft.vue b/resources/js/components/cedar-ui/icons/CedarChevronLeft.vuenew file mode 100644index 00000000..0ea2b694--- /dev/null+++ b/resources/js/components/cedar-ui/icons/CedarChevronLeft.vue@@ -0,0 +1,5 @@+<template>+ <svg fill="none" viewBox="0 0 24 24" stroke="currentColor">+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7" />+ </svg>+</template>diff --git a/resources/js/components/cedar-ui/icons/CedarChevronRight.vue b/resources/js/components/cedar-ui/icons/CedarChevronRight.vuenew file mode 100644index 00000000..db28fd26--- /dev/null+++ b/resources/js/components/cedar-ui/icons/CedarChevronRight.vue@@ -0,0 +1,5 @@+<template>+ <svg fill="none" viewBox="0 0 24 24" stroke="currentColor">+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" />+ </svg>+</template>diff --git a/resources/js/components/cedar-ui/icons/CedarChevronUpDown.vue b/resources/js/components/cedar-ui/icons/CedarChevronUpDown.vuenew file mode 100644index 00000000..342ce865--- /dev/null+++ b/resources/js/components/cedar-ui/icons/CedarChevronUpDown.vue@@ -0,0 +1,9 @@+<template>+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">+ <path+ fill-rule="evenodd"+ d="M10 3a.75.75 0 01.55.24l3.25 3.5a.75.75 0 11-1.1 1.02L10 4.852 7.3 7.76a.75.75 0 01-1.1-1.02l3.25-3.5A.75.75 0 0110 3zm-3.76 9.2a.75.75 0 011.06.04l2.7 2.908 2.7-2.908a.75.75 0 111.1 1.02l-3.25 3.5a.75.75 0 01-1.1 0l-3.25-3.5a.75.75 0 01.04-1.06z"+ clip-rule="evenodd"+ ></path>+ </svg>+</template>diff --git a/resources/js/components/cedar-ui/icons/CedarDanger.vue b/resources/js/components/cedar-ui/icons/CedarDanger.vuenew file mode 100644index 00000000..7091a84f--- /dev/null+++ b/resources/js/components/cedar-ui/icons/CedarDanger.vue@@ -0,0 +1,10 @@+<template>+ <svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">+ <path+ fill-rule="evenodd"+ clip-rule="evenodd"+ d="M2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12ZM11.9996 7C12.5519 7 12.9996 7.44772 12.9996 8V12C12.9996 12.5523 12.5519 13 11.9996 13C11.4474 13 10.9996 12.5523 10.9996 12V8C10.9996 7.44772 11.4474 7 11.9996 7ZM12.001 14.99C11.4488 14.9892 11.0004 15.4363 10.9997 15.9886L10.9996 15.9986C10.9989 16.5509 11.446 16.9992 11.9982 17C12.5505 17.0008 12.9989 16.5537 12.9996 16.0014L12.9996 15.9914C13.0004 15.4391 12.5533 14.9908 12.001 14.99Z"+ fill="currentColor"+ ></path>+ </svg>+</template>diff --git a/resources/js/components/cedar-ui/icons/CedarDelete.vue b/resources/js/components/cedar-ui/icons/CedarDelete.vuenew file mode 100644index 00000000..2006caf1--- /dev/null+++ b/resources/js/components/cedar-ui/icons/CedarDelete.vue@@ -0,0 +1,5 @@+<template>+ <svg class="w-5 h-5" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">+ <path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12" />+ </svg>+</template>diff --git a/resources/js/components/cedar-ui/icons/CedarDelete2.vue b/resources/js/components/cedar-ui/icons/CedarDelete2.vuenew file mode 100644index 00000000..d8ba3d96--- /dev/null+++ b/resources/js/components/cedar-ui/icons/CedarDelete2.vue@@ -0,0 +1,9 @@+<template>+ <svg class="w-3 h-3" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">+ <path+ fill-rule="evenodd"+ d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z"+ clip-rule="evenodd"+ ></path>+ </svg>+</template>diff --git a/resources/js/components/cedar-ui/icons/CedarInfo.vue b/resources/js/components/cedar-ui/icons/CedarInfo.vuenew file mode 100644index 00000000..bae0f859--- /dev/null+++ b/resources/js/components/cedar-ui/icons/CedarInfo.vue@@ -0,0 +1,10 @@+<template>+ <svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">+ <path+ fill-rule="evenodd"+ clip-rule="evenodd"+ d="M12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2ZM12 9C12.5523 9 13 8.55228 13 8C13 7.44772 12.5523 7 12 7C11.4477 7 11 7.44772 11 8C11 8.55228 11.4477 9 12 9ZM13 12C13 11.4477 12.5523 11 12 11C11.4477 11 11 11.4477 11 12V16C11 16.5523 11.4477 17 12 17C12.5523 17 13 16.5523 13 16V12Z"+ fill="currentColor"+ ></path>+ </svg>+</template>diff --git a/resources/js/components/cedar-ui/icons/CedarOptions.vue b/resources/js/components/cedar-ui/icons/CedarOptions.vuenew file mode 100644index 00000000..a9ebaae7--- /dev/null+++ b/resources/js/components/cedar-ui/icons/CedarOptions.vue@@ -0,0 +1,10 @@+<template>+ <svg viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg">+ <path+ d="M5.5 3C4.67157 3 4 3.67157 4 4.5C4 5.32843 4.67157 6 5.5 6C6.32843 6 7 5.32843 7 4.5C7 3.67157 6.32843 3 5.5 3ZM3 5C3.01671 5 3.03323 4.99918 3.04952 4.99758C3.28022 6.1399 4.28967 7 5.5 7C6.71033 7 7.71978 6.1399 7.95048 4.99758C7.96677 4.99918 7.98329 5 8 5H13.5C13.7761 5 14 4.77614 14 4.5C14 4.22386 13.7761 4 13.5 4H8C7.98329 4 7.96677 4.00082 7.95048 4.00242C7.71978 2.86009 6.71033 2 5.5 2C4.28967 2 3.28022 2.86009 3.04952 4.00242C3.03323 4.00082 3.01671 4 3 4H1.5C1.22386 4 1 4.22386 1 4.5C1 4.77614 1.22386 5 1.5 5H3ZM11.9505 10.9976C11.7198 12.1399 10.7103 13 9.5 13C8.28967 13 7.28022 12.1399 7.04952 10.9976C7.03323 10.9992 7.01671 11 7 11H1.5C1.22386 11 1 10.7761 1 10.5C1 10.2239 1.22386 10 1.5 10H7C7.01671 10 7.03323 10.0008 7.04952 10.0024C7.28022 8.8601 8.28967 8 9.5 8C10.7103 8 11.7198 8.8601 11.9505 10.0024C11.9668 10.0008 11.9833 10 12 10H13.5C13.7761 10 14 10.2239 14 10.5C14 10.7761 13.7761 11 13.5 11H12C11.9833 11 11.9668 10.9992 11.9505 10.9976ZM8 10.5C8 9.67157 8.67157 9 9.5 9C10.3284 9 11 9.67157 11 10.5C11 11.3284 10.3284 12 9.5 12C8.67157 12 8 11.3284 8 10.5Z"+ fill="currentColor"+ fill-rule="evenodd"+ clip-rule="evenodd"+ ></path>+ </svg>+</template>diff --git a/resources/js/components/cedar-ui/icons/CedarSuccess.vue b/resources/js/components/cedar-ui/icons/CedarSuccess.vuenew file mode 100644index 00000000..12201b0c--- /dev/null+++ b/resources/js/components/cedar-ui/icons/CedarSuccess.vue@@ -0,0 +1,10 @@+<template>+ <svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">+ <path+ fill-rule="evenodd"+ clip-rule="evenodd"+ d="M12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2ZM16.7744 9.63269C17.1238 9.20501 17.0604 8.57503 16.6327 8.22559C16.2051 7.87615 15.5751 7.93957 15.2256 8.36725L10.6321 13.9892L8.65936 12.2524C8.24484 11.8874 7.61295 11.9276 7.248 12.3421C6.88304 12.7566 6.92322 13.3885 7.33774 13.7535L9.31046 15.4903C10.1612 16.2393 11.4637 16.1324 12.1808 15.2547L16.7744 9.63269Z"+ fill="currentColor"+ ></path>+ </svg>+</template>diff --git a/resources/js/components/cedar-ui/icons/CedarWarning.vue b/resources/js/components/cedar-ui/icons/CedarWarning.vuenew file mode 100644index 00000000..5e17d738--- /dev/null+++ b/resources/js/components/cedar-ui/icons/CedarWarning.vue@@ -0,0 +1,10 @@+<template>+ <svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">+ <path+ fill-rule="evenodd"+ clip-rule="evenodd"+ d="M9.44829 4.46472C10.5836 2.51208 13.4105 2.51168 14.5464 4.46401L21.5988 16.5855C22.7423 18.5509 21.3145 21 19.05 21L4.94967 21C2.68547 21 1.25762 18.5516 2.4004 16.5862L9.44829 4.46472ZM11.9995 8C12.5518 8 12.9995 8.44772 12.9995 9V13C12.9995 13.5523 12.5518 14 11.9995 14C11.4473 14 10.9995 13.5523 10.9995 13V9C10.9995 8.44772 11.4473 8 11.9995 8ZM12.0009 15.99C11.4486 15.9892 11.0003 16.4363 10.9995 16.9886L10.9995 16.9986C10.9987 17.5509 11.4458 17.9992 11.9981 18C12.5504 18.0008 12.9987 17.5537 12.9995 17.0014L12.9995 16.9914C13.0003 16.4391 12.5532 15.9908 12.0009 15.99Z"+ fill="currentColor"+ ></path>+ </svg>+</template>diff --git a/resources/js/components/cedar-ui/icons/LucideChevronDown.vue b/resources/js/components/cedar-ui/icons/LucideChevronDown.vuenew file mode 100644index 00000000..065830ed--- /dev/null+++ b/resources/js/components/cedar-ui/icons/LucideChevronDown.vue@@ -0,0 +1,5 @@+<template>+ <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">+ <path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m6 9l6 6l6-6" />+ </svg>+</template>diff --git a/resources/js/components/cedar-ui/icons/LucideChevronUp.vue b/resources/js/components/cedar-ui/icons/LucideChevronUp.vuenew file mode 100644index 00000000..ef185ecb--- /dev/null+++ b/resources/js/components/cedar-ui/icons/LucideChevronUp.vue@@ -0,0 +1,5 @@+<template>+ <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">+ <path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m18 15l-6-6l-6 6" />+ </svg>+</template>diff --git a/resources/js/components/cedar-ui/icons/LucideLogIn.vue b/resources/js/components/cedar-ui/icons/LucideLogIn.vuenew file mode 100644index 00000000..48ef8a0a--- /dev/null+++ b/resources/js/components/cedar-ui/icons/LucideLogIn.vue@@ -0,0 +1,12 @@+<template>+ <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">+ <path+ fill="none"+ stroke="currentColor"+ stroke-linecap="round"+ stroke-linejoin="round"+ stroke-width="2"+ d="m10 17l5-5l-5-5m5 5H3m12-9h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4"+ />+ </svg>+</template>diff --git a/resources/js/components/cedar-ui/icons/LucideLogOut.vue b/resources/js/components/cedar-ui/icons/LucideLogOut.vuenew file mode 100644index 00000000..a0ab6525--- /dev/null+++ b/resources/js/components/cedar-ui/icons/LucideLogOut.vue@@ -0,0 +1,12 @@+<template>+ <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">+ <path+ fill="none"+ stroke="currentColor"+ stroke-linecap="round"+ stroke-linejoin="round"+ stroke-width="2"+ d="m16 17l5-5l-5-5m5 5H9m0 9H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"+ />+ </svg>+</template>diff --git a/resources/js/components/cedar-ui/icons/LucideUserPlus.vue b/resources/js/components/cedar-ui/icons/LucideUserPlus.vuenew file mode 100644index 00000000..e1fa2d0f--- /dev/null+++ b/resources/js/components/cedar-ui/icons/LucideUserPlus.vue@@ -0,0 +1,9 @@+<template>+ <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">+ <g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2">+ <path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2" />+ <circle cx="9" cy="7" r="4" />+ <path d="M19 8v6m3-3h-6" />+ </g>+ </svg>+</template>diff --git a/resources/js/components/cedar-ui/icons/MdiLightPlus.vue b/resources/js/components/cedar-ui/icons/MdiLightPlus.vuenew file mode 100644index 00000000..f220391e--- /dev/null+++ b/resources/js/components/cedar-ui/icons/MdiLightPlus.vue@@ -0,0 +1,5 @@+<template>+ <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">+ <path fill="currentColor" d="M5 13v-1h6V6h1v6h6v1h-6v6h-1v-6z" />+ </svg>+</template>diff --git a/resources/js/components/cedar-ui/icons/PhSortAscendingLight.vue b/resources/js/components/cedar-ui/icons/PhSortAscendingLight.vuenew file mode 100644index 00000000..aff97c41--- /dev/null+++ b/resources/js/components/cedar-ui/icons/PhSortAscendingLight.vue@@ -0,0 +1,8 @@+<template>+ <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 256 256">+ <path+ fill="currentColor"+ d="M126 128a6 6 0 0 1-6 6H48a6 6 0 0 1 0-12h72a6 6 0 0 1 6 6M48 70h136a6 6 0 0 0 0-12H48a6 6 0 0 0 0 12m56 116H48a6 6 0 0 0 0 12h56a6 6 0 0 0 0-12m124.24-22.24a6 6 0 0 0-8.48 0L190 193.51V112a6 6 0 0 0-12 0v81.51l-29.76-29.75a6 6 0 0 0-8.48 8.48l40 40a6 6 0 0 0 8.48 0l40-40a6 6 0 0 0 0-8.48"+ />+ </svg>+</template>diff --git a/resources/js/components/cedar-ui/icons/PhSortDescendingLight.vue b/resources/js/components/cedar-ui/icons/PhSortDescendingLight.vuenew file mode 100644index 00000000..d28bd99b--- /dev/null+++ b/resources/js/components/cedar-ui/icons/PhSortDescendingLight.vue@@ -0,0 +1,8 @@+<template>+ <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 256 256">+ <path+ fill="currentColor"+ d="M42 128a6 6 0 0 1 6-6h72a6 6 0 0 1 0 12H48a6 6 0 0 1-6-6m6-58h56a6 6 0 0 0 0-12H48a6 6 0 0 0 0 12m136 116H48a6 6 0 0 0 0 12h136a6 6 0 0 0 0-12m44.24-102.24l-40-40a6 6 0 0 0-8.48 0l-40 40a6 6 0 0 0 8.48 8.48L178 62.49V144a6 6 0 0 0 12 0V62.49l29.76 29.75a6 6 0 0 0 8.48-8.48"+ />+ </svg>+</template>diff --git a/resources/js/components/cedar-ui/icons/ProiconsChevronLeft.vue b/resources/js/components/cedar-ui/icons/ProiconsChevronLeft.vuenew file mode 100644index 00000000..e87b3c43--- /dev/null+++ b/resources/js/components/cedar-ui/icons/ProiconsChevronLeft.vue@@ -0,0 +1,12 @@+<template>+ <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">+ <path+ fill="none"+ stroke="currentColor"+ stroke-linecap="round"+ stroke-linejoin="round"+ stroke-width="1.5"+ d="m14.25 4.75l-6.19 6.19a1.5 1.5 0 0 0 0 2.12l6.19 6.19"+ />+ </svg>+</template>diff --git a/resources/js/components/cedar-ui/icons/ProiconsChevronRight.vue b/resources/js/components/cedar-ui/icons/ProiconsChevronRight.vuenew file mode 100644index 00000000..051c6502--- /dev/null+++ b/resources/js/components/cedar-ui/icons/ProiconsChevronRight.vue@@ -0,0 +1,12 @@+<template>+ <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">+ <path+ fill="none"+ stroke="currentColor"+ stroke-linecap="round"+ stroke-linejoin="round"+ stroke-width="1.5"+ d="m9.75 4.75l6.19 6.19a1.5 1.5 0 0 1 0 2.12l-6.19 6.19"+ />+ </svg>+</template>diff --git a/resources/js/components/cedar-ui/icons/ProiconsCommentExclamation.vue b/resources/js/components/cedar-ui/icons/ProiconsCommentExclamation.vuenew file mode 100644index 00000000..2aacba8d--- /dev/null+++ b/resources/js/components/cedar-ui/icons/ProiconsCommentExclamation.vue@@ -0,0 +1,15 @@+<template>+ <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">+ <g fill="none">+ <path+ stroke="currentColor"+ stroke-linecap="round"+ stroke-linejoin="round"+ stroke-width="1.5"+ d="M7.09 2.75a4 4 0 0 0-4 4v6.208a4 4 0 0 0 4 4h.093v3.792a.5.5 0 0 0 .839.368l4.52-4.16h4.369a4 4 0 0 0 4-4V6.75a4 4 0 0 0-4-4z"+ />+ <path stroke="currentColor" stroke-linecap="round" stroke-width="1.5" d="M12 6.25v4" />+ <circle cx="12" cy="13.25" r="1" fill="currentColor" />+ </g>+ </svg>+</template>diff --git a/resources/js/components/cedar-ui/icons/ProiconsSettings.vue b/resources/js/components/cedar-ui/icons/ProiconsSettings.vuenew file mode 100644index 00000000..2ac653b2--- /dev/null+++ b/resources/js/components/cedar-ui/icons/ProiconsSettings.vue@@ -0,0 +1,13 @@+<template>+ <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">+ <path+ fill="none"+ stroke="currentColor"+ stroke-linecap="round"+ stroke-linejoin="round"+ stroke-width="1.5"+ d="M7.05 6.462a2 2 0 0 0 2.63-1.519l.32-1.72a9 9 0 0 1 3.998 0l.322 1.72a2 2 0 0 0 2.63 1.519l1.649-.58a9 9 0 0 1 2.001 3.46l-1.33 1.14a2 2 0 0 0 0 3.037l1.33 1.139a9 9 0 0 1-2.001 3.46l-1.65-.58a2 2 0 0 0-2.63 1.519L14 20.777a9 9 0 0 1-3.998 0l-.322-1.72a2 2 0 0 0-2.63-1.519l-1.649.58a9 9 0 0 1-2.001-3.46l1.33-1.14a2 2 0 0 0 0-3.036L3.4 9.342a9 9 0 0 1 2-3.46zM12 9a3 3 0 1 1 0 6a3 3 0 0 1 0-6"+ clip-rule="evenodd"+ />+ </svg>+</template>diff --git a/resources/js/components/cedar-ui/icons/SvgSpinners90RingWithBg.vue b/resources/js/components/cedar-ui/icons/SvgSpinners90RingWithBg.vuenew file mode 100644index 00000000..e04506de--- /dev/null+++ b/resources/js/components/cedar-ui/icons/SvgSpinners90RingWithBg.vue@@ -0,0 +1,11 @@+<template>+ <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">+ <path fill="currentColor" d="M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z" opacity="0.25" />+ <path+ fill="currentColor"+ d="M10.14,1.16a11,11,0,0,0-9,8.92A1.59,1.59,0,0,0,2.46,12,1.52,1.52,0,0,0,4.11,10.7a8,8,0,0,1,6.66-6.61A1.42,1.42,0,0,0,12,2.69h0A1.57,1.57,0,0,0,10.14,1.16Z"+ >+ <animateTransform attributeName="transform" dur="0.75s" repeatCount="indefinite" type="rotate" values="0 12 12;360 12 12" />+ </path>+ </svg>+</template>diff --git a/resources/js/components/cedar-ui/icons/index.ts b/resources/js/components/cedar-ui/icons/index.tsnew file mode 100644index 00000000..395a8ec6--- /dev/null+++ b/resources/js/components/cedar-ui/icons/index.ts@@ -0,0 +1,43 @@+export { default as CedarDelete } from './CedarDelete.vue';++// Source: https://devdojo.com/pines/docs/toast+export { default as CedarDelete2 } from './CedarDelete2.vue';+export { default as CedarSuccess } from './CedarSuccess.vue';+export { default as CedarWarning } from './CedarWarning.vue';+export { default as CedarDanger } from './CedarDanger.vue';+export { default as CedarInfo } from './CedarInfo.vue';++// Source: https://devdojo.com/pines/docs/date-picker+export { default as CedarCalendar } from './CedarCalendar.vue';+export { default as CedarChevronLeft } from './CedarChevronLeft.vue';+export { default as CedarChevronRight } from './CedarChevronRight.vue';++// Source: https://devdojo.com/pines/docs/select+export { default as CedarChevronUpDown } from './CedarChevronUpDown.vue';+export { default as CedarCheckMark } from './CedarCheckMark.vue';++// Source: https://devdojo.com/pines/docs/popover+export { default as CedarOptions } from './CedarOptions.vue';++// Source: https://icon-sets.iconify.design/mdi-light+export { default as MdiLightPlus } from './MdiLightPlus.vue';++// Source: https://icon-sets.iconify.design/lucide/+export { default as LucideChevronDown } from './LucideChevronDown.vue';+export { default as LucideChevronUp } from './LucideChevronUp.vue';+export { default as LucideUserPlus } from './LucideUserPlus.vue';+export { default as LucideLogOut } from './LucideLogOut.vue';+export { default as LucideLogIn } from './LucideLogIn.vue';++// Source: https://icon-sets.iconify.design/proicons/+export { default as ProiconsCommentExclamation } from './ProiconsCommentExclamation.vue';+export { default as ProiconsChevronRight } from './ProiconsChevronRight.vue';+export { default as ProiconsChevronLeft } from './ProiconsChevronLeft.vue';+export { default as ProiconsSettings } from './ProiconsSettings.vue';++// Source: https://icon-sets.iconify.design/ph/+export { default as PhSortDescendingLight } from './PhSortDescendingLight.vue';+export { default as PhSortAscendingLight } from './PhSortAscendingLight.vue';++// Source: https://icon-sets.iconify.design/svg-spinners/+export { default as SvgSpinners90RingWithBg } from './SvgSpinners90RingWithBg.vue';diff --git a/resources/js/components/cedar-ui/toast/ToastController.vue b/resources/js/components/cedar-ui/toast/ToastController.vuenew file mode 100644index 00000000..1c006d01--- /dev/null+++ b/resources/js/components/cedar-ui/toast/ToastController.vue@@ -0,0 +1,270 @@+<script setup lang="ts">+// This is so bad lol pls fix+import type { Message, ToastControllerProps, ToastLayout, ToastPostion, ToastToDismiss } from '@aminnausin/cedar-ui';++import { nextTick, onMounted, ref, watch, watchEffect } from 'vue';++import {+ ToastState,+ DEFAULT_GAP,+ MOBILE_VIEWPORT_OFFSET,+ SCALE_STEP,+ TOAST_WIDTH,+ VIEWPORT_OFFSET,+ VISIBLE_TOASTS_AMOUNT,+ Y_OFFSET_STEP,+ Z_STEP,+} from '@aminnausin/cedar-ui';++import ToastNotification from './ToastNotification.vue';++const props = withDefaults(defineProps<ToastControllerProps>(), {+ layout: 'default',+ position: 'bottom-right',+ defaultLife: 3000,+ maxVisibleToasts: VISIBLE_TOASTS_AMOUNT,+ viewportOffset: VIEWPORT_OFFSET,+ mobileViewportOffset: MOBILE_VIEWPORT_OFFSET,+ paddingBetweenToasts: DEFAULT_GAP,+});++const container = ref<HTMLElement>();++const messages = ref<Message[]>([]);+const position = ref<ToastPostion>(props.position);+const layout = ref<ToastLayout>(props.layout);++const toastsHovered = ref(false);+const expanded = ref(props.layout === 'expanded');+const paddingBetweenToasts = ref(props.paddingBetweenToasts);+const heightRecalculateTimeout = ref<null | number>(null);++function deleteToastWithId(id: string) {+ messages.value = messages.value.filter((msg) => msg.id !== id);+ ToastState.dismiss(id);+ stackToasts('DELETE');+}++function stackToasts(_?: any) {+ if (messages.value.length > 0) {+ positionToasts(_);+ }++ calculateHeightOfToastsContainer();++ if (heightRecalculateTimeout.value) clearTimeout(heightRecalculateTimeout.value);++ // This calculates container height after the toasts are positioned+ if (!expanded.value) return;++ heightRecalculateTimeout.value = window.setTimeout(() => {+ calculateHeightOfToastsContainer();+ }, 100);+}++function positionToasts(_?: any) {+ try {+ const isBottom = position.value.includes('bottom');+ const toastElements: HTMLElement[] = [];++ let totalHeight = 0;+ let scaleBuffer = 1 + SCALE_STEP;+ let yBuffer = -Y_OFFSET_STEP;+ let zBuffer = 200 + Z_STEP;++ for (const msg of messages.value) {+ const toastEl = document.getElementById(msg.id);+ if (!toastEl) return;++ zBuffer -= Z_STEP;+ scaleBuffer -= SCALE_STEP;+ yBuffer += Y_OFFSET_STEP;++ msg.scale = scaleBuffer;+ msg.offsetY = yBuffer;+ msg.zIndex = zBuffer;++ toastElements.push(toastEl);++ if (expanded.value) {+ totalHeight = totalHeight + (totalHeight ? paddingBetweenToasts.value : 0);++ msg.positionY = totalHeight + 'px';+ msg.scale = 1;+ msg.offsetY = 0;++ totalHeight += toastEl.offsetHeight;+ continue;+ }++ msg.scale = scaleBuffer;++ if (isBottom) {+ msg.offsetY *= -1;+ } else {+ alignBottom(toastElements[0], msg);+ }+ }++ // Don't handle overflow anymore. All toasts must adhere to their lifecycle and dismissing a newer toast will reveal an older one+ } catch (error) {+ console.log(error);+ }+}++function calculateHeightOfToastsContainer() {+ if (!container.value) return;++ if (messages.value.length == 0) {+ container.value.style.height = '0px';+ return;+ }++ const lastToast = messages.value[Math.max(Math.min(messages.value.length - 1, props.maxVisibleToasts - 1), 0)];+ const lastToastRectangle = document.getElementById(`${lastToast?.id}`)?.getBoundingClientRect();++ const firstToast = messages.value[0];+ const firstToastRectangle = document.getElementById(`${firstToast?.id}`)?.getBoundingClientRect();++ if (!firstToastRectangle || !lastToastRectangle) return;++ if (!toastsHovered.value) {+ container.value.style.height = firstToastRectangle.height + 'px';+ return;+ }++ if (position.value.includes('bottom')) {+ container.value.style.height = firstToastRectangle.top + firstToastRectangle.height - lastToastRectangle.top + 'px';+ return;+ }++ container.value.style.height = lastToastRectangle.top + lastToastRectangle.height - firstToastRectangle.top + 'px';+}++function alignBottom(element1: HTMLElement, toast: Message) {+ const element2 = document.getElementById(toast.id);++ if (!element2) return;++ // Get the top position and height of the first element+ const top1 = element1.offsetTop;+ const height1 = element1.offsetHeight;++ // Get the height of the second element+ const height2 = element2.offsetHeight;++ // Calculate the top position for the second element+ const top2 = top1 + (height1 - height2);++ // Apply the calculated top position to the second element+ toast.positionY = top2 + 'px';+}++onMounted(() => {+ stackToasts('MOUNT');+});++watch(+ () => toastsHovered.value,+ (value) => {+ if (layout.value !== 'default') return;++ if (value) {+ // calculate the new positions+ expanded.value = true;+ stackToasts('HOVER');+ return;+ }++ expanded.value = false;+ // this used to get call after 10 ms and then again after 10 ms but idk if that is needed anymore+ stackToasts('HOVER CLOSE');+ },+);++watch(+ () => messages.value,+ () => {+ // Ensure expanded is always false when no toasts are present / only one left+ if (messages.value.length <= 1) {+ expanded.value = false;+ }+ },+);++watchEffect((onInvalidate) => {+ const unsubscribe = ToastState.subscribe((newToast) => {+ if ((newToast as ToastToDismiss).dismiss) {+ // ? toast is deleted locally already why is there an extra step -> messages.value = messages.value.map((t) => (t.id === toast.id ? { ...t, delete: true } : t));+ return;+ }++ nextTick(() => {+ const indexOfExistingToast = messages.value.findIndex((t) => t.id === newToast.id);++ // Update the toast if it already exists+ if (indexOfExistingToast !== -1) {+ messages.value = [+ ...messages.value.slice(0, indexOfExistingToast),+ { ...messages.value[indexOfExistingToast], ...newToast },+ ...messages.value.slice(indexOfExistingToast + 1),+ ];++ return;+ }+ const toast = newToast as Message;++ if (toast.position) position.value = toast.position;++ messages.value.unshift({+ ...toast,+ id: toast.id,+ type: toast.type ?? 'default',+ position: toast.position ?? position.value,+ life: toast.life ?? props.defaultLife,+ title: toast.title,+ });+ });+ });++ onInvalidate(unsubscribe);+});+</script>++<template>+ <teleport to="body">+ <ol+ v-cloak+ ref="container"+ :class="[+ `group fixed z-500 w-full *:px-4 [&>*]:px-[${mobileViewportOffset ?? viewportOffset}] sm:*:px-6 [&>*]:sm:px-[${viewportOffset}] my-4 sm:my-6 my-[${mobileViewportOffset ?? viewportOffset}] sm:my-[${viewportOffset}]`,+ `${TOAST_WIDTH ? `sm:w-[${TOAST_WIDTH}px]` : 'sm:max-w-sm'}`,+ `${position == 'top-right' ? 'top-0 right-0' : ''}`,+ `${position == 'top-left' ? 'top-0 left-0' : ''}`,+ `${position == 'top-center' ? 'top-0 left-1/2 -translate-x-1/2' : ''}`,+ `${position == 'bottom-right' ? 'right-0 bottom-0' : ''}`,+ `${position == 'bottom-left' ? 'bottom-0 left-0' : ''}`,+ `${position == 'bottom-center' ? 'bottom-0 left-1/2 -translate-x-1/2' : ''}`,+ ]"+ @mouseenter="toastsHovered = true"+ @mouseleave="toastsHovered = false"+ >+ <ToastNotification+ v-for="(toast, index) in messages"+ v-bind="toast"+ :key="toast.id"+ :stack="+ () => {+ stackToasts('TOAST');+ }+ "+ :toastCount="messages.length"+ :position="position"+ :expanded="expanded"+ :index="index"+ :maxVisibleToasts="maxVisibleToasts"+ @close="deleteToastWithId"+ />+ </ol>+ </teleport>+</template>diff --git a/resources/js/components/cedar-ui/toast/ToastNotification.vue b/resources/js/components/cedar-ui/toast/ToastNotification.vuenew file mode 100644index 00000000..987d7009--- /dev/null+++ b/resources/js/components/cedar-ui/toast/ToastNotification.vue@@ -0,0 +1,227 @@+<script setup lang="ts">+import type { SwipeDirection, ToastProps } from '@aminnausin/cedar-ui';++import { useToastTimer, useSwipeHandler, SWIPE_THRESHOLD, TOAST_LIFE, VISIBLE_TOASTS_AMOUNT } from '@aminnausin/cedar-ui';+import { CedarDanger, CedarInfo, CedarSuccess, CedarWarning } from '../icons';+import { computed, onBeforeUnmount, onMounted, ref } from 'vue';+import { ButtonCorner } from '../button';++const emit = defineEmits<(e: 'close', id: string) => void>(); // removeToast++const props = withDefaults(defineProps<ToastProps>(), {+ type: 'default',+ position: 'bottom-center',+ life: TOAST_LIFE,+ maxVisibleToasts: VISIBLE_TOASTS_AMOUNT,+ title: 'Title',+ html: '',+ style: '', // can be used since toast is instantiated with a function+ swipeDirections: () => [],+});++const leaveDirection = ref('translate-y-0');+const swipeDirections = computed(() => {+ if (props.swipeDirections.length > 0) return props.swipeDirections;++ const [y, x] = props.position.split('-');+ const directions: Array<SwipeDirection> = [];++ if (isSwipeDirection(y)) {+ directions.push(y);+ }++ if (isSwipeDirection(x)) {+ directions.push(x);+ }++ if (x === 'center') {+ directions.push('left', 'right');+ }++ return directions;+});++const isBottom = computed(() => {+ return props.position.includes('bottom');+});++const closeTimeout = ref<null | number>(null);+const stackTimeout = ref<null | number>(null);++const toastHovered = ref(false);+const isMounted = ref(false);++const { offset, isSwiping, onPointerDown, onPointerMove, onPointerUp } = useSwipeHandler({+ directions: swipeDirections,+ swipeThreshold: { px: SWIPE_THRESHOLD },+ onSwipeOut: onClose,+});++const { cancel: cancelToastTimer } = useToastTimer({+ duration: props.life || TOAST_LIFE,+ isPaused: () => props.expanded || props.type === 'loading' || !props.life || props.life === Infinity || toastHovered.value,+ onTimeout: onClose,+});++function getLeaveDirection() {+ const yDir = isBottom.value ? 'translate-y-full' : '-translate-y-full';++ if (isSwiping.value) {+ const xDir = offset.value.x > 0 ? 'translate-x-full' : '-translate-x-full';+ return Math.abs(offset.value.y) > 0 ? yDir : xDir;+ }++ if (props.toastCount === 1) {+ return yDir;+ }++ return 'translate-y-0';+}++function onClose() {+ if (closeTimeout.value) return;++ leaveDirection.value = getLeaveDirection();+ isMounted.value = false;+ cancelToastTimer();+ closeTimeout.value = window.setTimeout(() => {+ emit('close', props.id);+ }, 350);+}++function clearCloseTimeout() {+ if (stackTimeout.value) {+ clearTimeout(stackTimeout.value);+ stackTimeout.value = null;+ }+ if (closeTimeout.value) {+ clearTimeout(closeTimeout.value);+ closeTimeout.value = null;+ }+}++function isSwipeDirection(val: string): val is SwipeDirection {+ return ['top', 'right', 'bottom', 'left'].includes(val);+}++onMounted(() => {+ isMounted.value = true;++ if (stackTimeout.value) clearTimeout(stackTimeout.value);++ stackTimeout.value = window.setTimeout(() => {+ props.stack();+ });+});++onBeforeUnmount(() => {+ clearCloseTimeout();+});+</script>++<template>+ <li+ ref="toastEl"+ :id="props.id"+ :class="[+ `toast absolute w-full transition-all duration-300 ease-out`,+ { 'pointer-events-none opacity-0': index >= maxVisibleToasts },+ style,+ ]"+ :style="{+ '--offset-x': `${offset.x}px`,+ '--offset-y': `${offsetY}px`,+ '--scale': scale,+ '--z-index': zIndex,+ '--position-top': `${expanded ? (isBottom ? 'auto' : positionY) : 'inherit'}`,+ '--position-bottom': `${isBottom && expanded ? positionY : 'inherit'}`,+ }"+ :data-isSwiping="isSwiping"+ @mouseover="toastHovered = true"+ @mouseout="toastHovered = false"+ @dragend="onPointerUp"+ @pointerdown="onPointerDown"+ @pointermove="onPointerMove"+ @pointerup="onPointerUp"+ role="alert"+ >+ <Transition+ :enter-from-class="`opacity-0 ${isBottom ? 'translate-y-full' : '-translate-y-full'}`"+ :enter-to-class="`opacity-100 translate-y-0`"+ :leave-from-class="`opacity-100 translate-y-0`"+ :leave-to-class="`opacity-0 ${leaveDirection}`"+ >+ <span+ :class="[+ { 'p-4': !html, 'p-0': html },+ 'flex flex-col items-start rounded-md backdrop-blur-lg',+ 'group relative select-text',+ 'transition-all duration-300 ease-out',+ 'bg-overlay-t text-foreground-0 shadow-[0_5px_15px_-3px_rgb(0_0_0/0.08)]',+ 'ring-r-inverse ring-1 ring-inset',+ ]"+ v-show="isMounted"+ >+ <div+ v-if="!html"+ class="flex items-center"+ :class="{+ 'text-success': type === 'success',+ 'text-info': type === 'info',+ 'text-warning': type === 'warning',+ 'text-danger': type === 'danger',+ 'text-foreground-0': type === 'default',+ }"+ >+ <CedarSuccess v-show="type === 'success'" class="mr-1 -ml-1 size-4" />+ <CedarInfo v-show="type === 'info'" class="mr-1 -ml-1 size-4" />+ <CedarWarning v-show="type === 'warning'" class="mr-1 -ml-1 size-4" />+ <CedarDanger v-show="type === 'danger'" class="mr-1 -ml-1 size-4" />+ <p class="text-[13px] leading-none font-medium" :title="title">{{ title }}</p>+ </div>+ <p+ v-show="description"+ :class="{ 'pl-5': type !== 'default' }"+ class="scrollbar-minimal mt-1.5 max-h-32 min-h-3 w-full overflow-y-auto pe-2 text-xs leading-tight wrap-break-word whitespace-pre-wrap opacity-70"+ >+ {{ description }}+ </p>+ <template v-if="!html">+ <ButtonCorner+ @click="onClose"+ class="text-foreground-2 hover:text-foreground-1 dark:text-danger-3 hover:bg-surface-1 dark:bg-surface-1/50 dark:hover:bg-surface-1 dark:hover:text-danger absolute right-0 mr-2.5 p-1.5"+ label="Close Toast"+ :class="[+ 'cursor-pointer rounded-full opacity-0',+ {+ 'top-1/2 -translate-y-1/2': !description && !html,+ 'top-0 mt-2.5': description || html,+ 'opacity-100': toastHovered,+ 'opacity-0': !toastHovered,+ },+ ]"+ :use-default-style="false"+ />+ </template>+ </span>+ </Transition>+ </li>+</template>+<style lang="css" scoped>+.toast {+ transform: translateY(var(--offset-y, 0px)) translateX(var(--offset-x, 0px)) scale(var(--scale, 1));+ z-index: var(--z-index, 200);+ top: var(--position-top, inherit);+ bottom: var(--position-bottom, inherit);+}++@media (prefers-reduced-motion: reduce) {+ .toast {+ transition: none !important;+ }+}++[data-isSwiping='true'] {+ transition-property: none !important;+}+</style>diff --git a/resources/js/components/cedar-ui/toast/index.ts b/resources/js/components/cedar-ui/toast/index.tsnew file mode 100644index 00000000..6e5a5b61--- /dev/null+++ b/resources/js/components/cedar-ui/toast/index.ts@@ -0,0 +1,2 @@+export { default as ToastNotification } from './ToastNotification.vue';+export { default as ToastController } from './ToastController.vue';