Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 52 additions & 51 deletions src/App.vue
Original file line number Diff line number Diff line change
@@ -1,61 +1,62 @@
<script setup lang="ts">
import { type Component, computed, ref } from 'vue';
import RDropdownVue from './components/Dropdown/RDropdown.vue';
import RTooltip from './components/Tooltip/RTooltip.vue';

const RDropdown = RDropdownVue as Component;

interface City {
value: number;
label: string;
}

const options = ref<City[]>([
{ value: 1, label: 'İstanbul' },
{ value: 2, label: 'Ankara' },
{ value: 3, label: 'İzmir' },
{ value: 4, label: 'Bursa' },
{ value: 5, label: 'Antalya' },
]);

const selectedCities = ref<City[]>([]);

const showPlaceholder = computed(() => {
return selectedCities.value.length === 0;
});
import RButton from './components/Button/RButton.vue'
</script>

<template>
<div class="p-4">
<h1 class="mb-4 text-2xl">Şehir Seçimi</h1>
<h1 class="mb-4 text-2xl">
Button Variants
</h1>

<div class="flex flex-col gap-4">
<div class="flex gap-2">
<RButton color="primary" variant="default">
Primary Default
</RButton>
<RButton color="secondary" variant="default">
Secondary Default
</RButton>
<RButton color="danger" variant="default">
Danger Default
</RButton>
</div>

<div class="flex gap-2">
<RButton color="primary" variant="outline">
Primary Outline
</RButton>
<RButton color="secondary" variant="outline">
Secondary Outline
</RButton>
<RButton color="danger" variant="outline">
Danger Outline
</RButton>
</div>

<RDropdown
v-model="selectedCities"
chips
class="w-96"
multiple
:options="options"
:placeholder="showPlaceholder ? 'Şehir seçiniz' : ''"
/>
<div class="flex gap-2">
<RButton color="primary" variant="text">
Primary Text
</RButton>
<RButton color="secondary" variant="text">
Secondary Text
</RButton>
<RButton color="danger" variant="text">
Danger Text
</RButton>
</div>

<RTooltip :auto-hide="false" persistent text="test" triggers="click">
<span class="text-blue-500">test</span>
<template #content>
<div class="p-2 bg-red-500 text-white rounded">
<p class="text-sm">Bu bir tooltip içeriğidir.</p>
<p class="text-sm">Daha fazla bilgi için tıklayın.</p>
<RTooltip :auto-hide="false" text="test 2" triggers="click">
<span class="text-blue-500">test 2</span>
</RTooltip>
</div>
</template>
</RTooltip>
<RTooltip :auto-hide="false" text="test 2" triggers="click" outsideClick>
<span class="text-blue-500">test 2</span>
</RTooltip>
<RTooltip :auto-hide="false" text="test 3" triggers="click">
<span class="text-blue-500">test 3</span>
</RTooltip>
<div class="flex gap-2">
<RButton color="primary" variant="link">
Primary Link
</RButton>
<RButton color="secondary" variant="link">
Secondary Link
</RButton>
<RButton color="danger" variant="link">
Danger Link
</RButton>
</div>
</div>
</div>
</template>

Expand Down
2 changes: 1 addition & 1 deletion src/components/Button/Button.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Button from './RButton.vue'
const DefaultArgTypes = {
variant: {
type: 'select',
options: ['default', 'text', 'outline'],
options: ['default', 'text', 'link', 'outline'],
},
color: {
type: 'select',
Expand Down
4 changes: 3 additions & 1 deletion src/components/Button/RButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ export type ButtonType =
| 'default'
| 'text'
| 'outline'
| 'link'
| 'ghost'

export type ButtonColor = | 'primary' | 'secondary' | 'danger' | 'success' | 'warning' | 'info'
export type ButtonSize = | 'small' | 'medium' | 'large'
export interface Props {
/**
* Variant of the Button
* @type { 'default' | 'text' | 'outline' | 'ghost'}
* @type { 'default' | 'text' | 'outline' | 'link' | 'ghost'}
* @default 'default'
* @example
* <Button variant="default" />
Expand Down
98 changes: 98 additions & 0 deletions src/components/Button/button.css
Original file line number Diff line number Diff line change
Expand Up @@ -337,4 +337,102 @@
}
}
}

&__link {
@apply bg-transparent text-[var(--neutral-900)] border-transparent underline;

&:hover {
@apply text-[var(--neutral-700)];
}
&:active {
@apply ring-[var(--neutral-100)] bg-transparent text-[var(--neutral-900)];
}
&:disabled {
@apply text-[var(--neutral-200)];
}

&--primary {
@apply text-[var(--primary-500)];

&:hover {
@apply text-[var(--primary-700)];
}
&:active {
@apply ring-[var(--primary-100)] bg-transparent text-[var(--primary-500)];
}
&:disabled {
@apply text-[var(--primary-200)];
}
}

&--secondary {
@apply text-[var(--secondary-500)];

&:hover {
@apply text-[var(--secondary-700)];
}
&:active {
@apply ring-[var(--secondary-100)] bg-transparent text-[var(--secondary-500)];
}
&:disabled {
@apply text-[var(--secondary-200)];
}
}

&--danger {
@apply text-[var(--error-500)];

&:hover {
@apply text-[var(--error-700)];
}
&:active {
@apply ring-[var(--error-100)] bg-transparent text-[var(--error-500)];
}
&:disabled {
@apply text-[var(--error-200)];
}
}

&--success {
@apply text-[var(--success-500)];

&:hover {
@apply text-[var(--success-700)];
}
&:active {
@apply ring-[var(--success-100)] bg-transparent text-[var(--success-500)];
}
&:disabled {
@apply text-[var(--success-200)];
}
}

&--warning {
@apply text-[var(--warning-500)];

&:hover {
@apply text-[var(--warning-700)];
}
&:active {
@apply ring-[var(--warning-100)] bg-transparent text-[var(--warning-500)];
}
&:disabled {
@apply text-[var(--warning-200)];
}
}

&--info {
@apply text-[var(--info-500)];

&:hover {
@apply text-[var(--info-700)];
}
&:active {
@apply ring-[var(--info-100)] bg-transparent text-[var(--info-500)];
}
&:disabled {
@apply text-[var(--info-200)];
}
}
}
}