0.0.12 • Published 7 months ago

baran-component v0.0.12

Weekly downloads
-
License
MIT
Repository
-
Last release
7 months ago

Baran Component Library

A Vue 3 component library built with Vite and Vuetify.

Introduction

Baran Component is a collection of reusable Vue 3 components, styled with Vuetify, and optimized for performance using Vite. This library aims to provide a set of commonly used components to speed up the development process of your Vue.js applications.

❗️ Important Links

💿 Install

Before you can use this project, make sure you have the following prerequisites installed:

Set up your project using NPM. Use the corresponding command to install the dependencies:

Package ManagerCommand
npmnpm install baran-component

💡 Usage

After successfully installing dependencies, register component globally.

import vuetify from './vuetify' import BaranComponent from 'baran-component'
import 'baran-component/dist/style.css'

export function registerPlugins (app) {
	app.use(vuetify) app.use(BaranComponent)
}

Button Component

The BaranButton component is a customizable button with various props and events. Extended from Vuetify.

Props

PropTypeDefaultDescription
colorStringprimaryThe color of the button (e.g., primary, secondary).
disabledBooleanfalseWhether the button is disabled.
variantString''The variant of the button (outlined, tonal, text, plain).
iconString''The icon for a single icon button, using MDI icons.
prependIconString''The icon to prepend to the button text, using MDI icons.
appendIconString''The icon to append to the button text, using MDI icons.
densityString''The density of the button ('default', comfortable, compact).
sizeStringmediumThe size of the button (x-small, small, medium, large, x-large).
blockBooleanfalseWhether the button should take the full width of its container.
roundedString0The border radius of the button (e.g., 0, xs, sm, md, lg, xl).
elevationNumber2The elevation (shadow) level of the button.
rippleBooleantrueWhether the button has a ripple effect when clicked.
loadingBooleanfalseWhether the button shows a loading indicator.
widthString''The width of the button.
maxWidthString''The maximum width of the button.
minWidthString''The minimum width of the button.
heightString''The height of the button.
maxHeightString''The maximum height of the button.
minHeightString''The minimum height of the button.

Slots

Slot NameDescription
prependSlot for custom prepend content.
appendSlot for custom append content.
loaderSlot for custom loader content.

Events

EventDescription
@clickEvent emitted when the button is clicked

Example Usage

<template>
	<BaranButton @click="onClick" elevation="4" color="#1814F3" class="mt-1" :disabled="!terms"> Add Card </BaranButton>
</template>

<script setup>
import { ref } from 'vue'
const terms = ref(false)
function onClick() {
    alert('Button clicked!');
},
</script>

Card Component

The BaranCard component is a versatile card component with a customizable button. It is built using Vuetify's card and button components and offers various customization options for appearance and behavior.

Props

PropTypeDefaultDescription
textString''The main text content of the card.
buttonTextStringClickThe text displayed on the button.
buttonBackgroundString#7367f0The background color of the button.
buttonColorString#fffThe text color of the button.
showButtonBooleanfalseWhether to show the button.
titleString''The title of the card.
targetString''The target attribute for the link, if href is provided.
subtitleString''The subtitle of the card.
variantString''The variant of the card (outlined, tonal, elevated, flat, text, plain).
loadingBooleanfalseWhether the card shows a loading state.
hoverBooleanfalseWhether the card has a hover effect.
hrefString''The link URL for the card.
roundedStringxsThe border radius of the card (e.g., xs, sm, md, lg, xl).
elevationNumber1The elevation (shadow) level of the card.
imageString''The image URL for the card.
colorString''The color of the card.
disabledBooleanfalseWhether the card is disabled.
prependIconString''The icon to prepend to the card content.
appendIconString''The icon to append to the card content.
densityString'comfortable'The density of the card (comfortable, compact).
widthString''The width of the card.
maxWidthString''The maximum width of the card.
minWidthString''The minimum width of the card.
heightString''The height of the card.
maxHeightString''The maximum height of the card.
minHeightString''The minimum height of the card

Slots

Slot NameDescription
prependSlot for custom prepend content.
appendSlot for custom append content.
actionsSlot for actions loader content.

Events

EventDescription
@clickEvent emitted when the button is clicked.

Example Usage

<template>
	<BaranCard
		title="Card Title"
		subtitle="Card Subtitle"
		text="This is some example text content for the card."
		:show-button="true"
		button-text="Learn More"
		button-background="#ff5722"
		button-color="#ffffff"
		:hover="true"
		:elevation="4"
		href="https://example.com"
		target="_blank"
		class="my-custom-class"
		:rounded="'md'"
	>
		<template #prepend>
			<BaranAvatar size="56">
				<img src="https://example.com/avatar.jpg" alt="Avatar" />
			</BaranAvatar>
		</template>
		<template #append>
			<v-icon>mdi-heart</v-icon>
		</template>
	</BaranCard>
</template>

<script setup></script>

Chip Component

The BaranChips component represents a small interactive element used to represent information such as tags, categories, or actions.

Props

PropTypeDefaultDescription
titleString'Chip'The text content displayed within the chip.
colorString'#7367f0'The background color of the chip.
elevationNumber0Elevation level of the chip.
sizeString'default'Size of the chip (small, default, large).
variantString'tonal'Visual variant of the chip (outlined, elevated, text, plain).
prependIconString''Icon to prepend before the chip text.
appendIconString''Icon to append after the chip text.
closableBooleanfalseIf true, displays a close icon for removing the chip.
labelBooleanfalseIf true, renders the chip as a label style.
disabledBooleanfalseIf true, disables interactions with the chip.
densityString''Density of the chip (comfortable, compact).

Slots

Slot NameDescription
prependSlot for custom prepend content.
appendSlot for custom append content.

Events

Event NameDescriptionPayload
clickTriggered when the chip is clicked.MouseEvent

Example Usage

<template>
	<BaranChips title="Example Chip" color="#ff9800" elevation="2" size="default" variant="outlined" prependIcon="mdi-check" appendIcon="mdi-close" closable label disabled class="custom-chip" density="compact" @click="handleChipClick">
		<template #prepend>
			<v-icon>mdi-tag</v-icon>
		</template>
	</BaranChips>
</template>

<script setup>
import Chip from "baran-component/Chip.vue";

const handleChipClick = (event) => {
	console.log("Chip clicked!", event);
};
</script>

<style>
.custom-chip {
	font-size: 14px;
}
</style>

Expansion Panels Component

The BaranExpansionPanels component allows for displaying collapsible panels with customizable options.

Props

PropTypeDefaultDescription
bg-colorStringundefinedRestricted
collapse-iconAny'$collapse'Icon used when the expansion panel is in a collapsable state.
colorStringundefinedApplies specified color to the control - supports utility colors or CSS color values.
disabledBooleanfalsePuts all children components into a disabled state.
eagerBooleanfalseForces the component’s content to render when it mounts - useful for SEO.
elevationString | NumberundefinedDesignates an elevation applied to the component between 0 and 24.
expand-iconAny'$expand'Icon used when the expansion panel is in an expandable state.
flatBooleanfalseRemoves the expansion-panel’s elevation and borders.
focusableBooleanfalseMakes the expansion-panel headers focusable.
hide-actionsBooleanfalseHide the expand icon in the content title.
mandatoryBoolean | 'force'falseForces at least one item to always be selected (if available).
maxNumberundefinedSets a maximum number of selections that can be made.
model-valueAnyundefinedThe v-model value of the component - if component supports the multiple prop, this defaults to an array.
multipleBooleanfalseAllows one to select multiple items.
readonlyBooleanfalseMakes the entire expansion-panel read only.
rippleBoolean | { class: string }falseApplies the v-ripple directive.
roundedString | Number | BooleanundefinedDesignates the border-radius applied to the component - can be 0, xs, sm, true, lg, xl, pill, circle, and shaped.
selected-classStringundefinedConfigure the active CSS class applied when an item is selected.
staticBooleanfalseRemove title size expansion when selected.
tagString'div'Specify a custom tag used on the root element.
themeStringundefinedSpecify a theme for this component and all of its children.
tileBooleanfalseRemoves the border-radius.
variant'default' | 'accordion' | 'inset' | 'popout''default'Applies a distinct style to the component.

Example Usage

<template>
	<BaranExpansionPanels variant="accordion" rounded="md" :elevation="3">
		<BaranExpansionPanel>
			<template v-slot:title> Title Slot </template>
			<template v-slot:text> Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. </template>
		</BaranExpansionPanel>
		<BaranExpansionPanel title="Title" text="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.">
		</BaranExpansionPanel>
	</BaranExpansionPanels>
</template>

<script setup></script>

<style></style>

Expansion Panel Component

The BaranExpansionPanel is sub-component used to display a single expansion panel item.

Props

PropTypeDefaultDescription
bg-colorStringundefinedApplies specified color to the control’s background - supports utility colors or CSS color values.
collapse-iconAny'$collapse'Icon used when the expansion panel is in a collapsable state.
colorStringundefinedApplies specified color to the control - supports utility colors or CSS color values.
disabledBooleanfalseDisables the expansion-panel content.
eagerBooleanfalseForces the component’s content to render when it mounts - useful for SEO.
elevationString | NumberundefinedDesignates an elevation applied to the component between 0 and 24.
expand-iconAny'$expand'Icon used when the expansion panel is in an expandable state.
focusableBooleanfalseMISSING DESCRIPTION (edit in github).
hide-actionsBooleanfalseHide the expand icon in the content title.
readonlyBooleanfalseMakes the expansion-panel content read only.
rippleBoolean | { class: string }falseApplies the v-ripple directive.
roundedString | Number | BooleanundefinedDesignates the border-radius applied to the component - can be 0, xs, sm, true, lg, xl, pill, circle, and shaped.
selected-classStringundefinedConfigure the active CSS class applied when an item is selected.
staticBooleanfalseRemove title size expansion when selected.
tagString'div'Specify a custom tag used on the root element.
textStringundefinedSpecify content text for the component.
tileBooleanfalseRemoves any applied border-radius from the component.
titleStringundefinedSpecify a title text for the component.
valueAnyundefinedControls the opened/closed state of content.

Slots

Slot NameDescription
defaultThe default Vue slot.
titleSlot for title.
textSlot for text.

Example Usage

<template>
	<BaranExpansionPanels variant="accordion" rounded="md" :elevation="3">
		<BaranExpansionPanel>
			<template v-slot:title> Title Slot </template>
			<template v-slot:text> Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. </template>
		</BaranExpansionPanel>
		<BaranExpansionPanel title="Title" text="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.">
		</BaranExpansionPanel>
	</BaranExpansionPanels>
</template>

<script setup></script>

<style></style>

Dialog Component

The BaranDialog component provides a dialog with an activator slot for flexibility in triggering the dialog.

Props

PropTypeDefaultDescription
titleString'Title'Title of the dialog.
textString'Lorem ipsum...'Text content displayed within the dialog.
closeButtonTextString'Close'Text for the close button inside the dialog.
roundedString'xs'Rounded corner size of the dialog.
buttonTextString'Open Modal'Text displayed on the activator button triggering the dialog.
buttonColorString'#7367f0'Color of the activator button.
buttonElevationNumber2Elevation level of the activator button.
persistentBooleanfalseWhether the dialog persists after being closed.
transitionString''Transition name for dialog animation.
scrollableBooleanfalseWhether the dialog content is scrollable.
fullscreenBooleanfalseWhether the dialog should occupy the full screen.
widthString''Width of the dialog.
maxWidthString''Maximum width of the dialog.
minWidthString''Minimum width of the dialog.
heightString''Height of the dialog.
maxHeightString''Maximum height of the dialog.
minHeightString''Minimum height of the dialog.
buttonVariantString''Variant style of the activator button.
buttonDisabledBooleanfalseWhether the activator button is disabled.
buttonDensityString'comfortable'Density of the activator button.
buttonClassString''Custom CSS classes for the activator button.
buttonSizeString'default'Size of the activator button.
buttonBlockBooleanfalseWhether the activator button spans full width.
buttonRoundedString'xs'Rounded corner size of the activator button.
buttonLoadingBooleanfalseWhether the activator button is in a loading state.
buttonWidthString''Width of the activator button.
buttonMaxWidthString''Maximum width of the activator button.
buttonMinWidthString''Minimum width of the activator button.
buttonHeightString''Height of the activator button.
buttonMaxHeightString''Maximum height of the activator button.
buttonMinHeightString''Minimum height of the activator button.

Slots

Slot NameDescription
activatorSlot for replacing the default activator button. Provides props (activatorProps) to customize the activator button.
defaultSlot for customizing the content inside the dialog. Receives the isActive prop indicating whether the dialog is currently active.

Example Usage

<template>
	<BaranDialog width="auto" scrollable :title="dialogTitle" :text="dialogText">
		<template v-slot:activator="{ props: activatorProps }">
			<BaranButton color="brown" prepend-icon="mdi-earth" text="Custom Modal Activator" variant="outlined" v-bind="activatorProps"></BaranButton>
		</template>
	</BaranDialog>
</template>

<script setup>
const dialogTitle = "Example Dialog";
const dialogText = "This is an example of a dialog component with custom slots and props.";
</script>

List Component

The BaranList component renders a list of items with optional sub-groups, allowing customization of each list item.

Props

PropTypeDefaultDescription
activatableBooleanfalseMISSING DESCRIPTION (edit in github).
activatedAnyundefinedArray of ids of activated nodes.
active-classStringundefinedThe class applied to the component when it is in an active state.
active-colorStringundefinedThe applied color when the component is in an active state.
base-colorStringundefinedSets the color of component when not focused.
bg-colorStringundefinedApplies specified color to the control’s background - supports utility colors or CSS color values.
borderString | Number | BooleanfalseDesignates the border-radius applied to the component - can be xs, sm, md, lg, xl.
collapse-iconStringundefinedMISSING DESCRIPTION (edit in github).
colorStringundefinedApplies specified color to the control - supports utility colors or CSS color values.
density'default' | 'comfortable' | 'compact''comfortable'Adjusts the vertical height used by the component.
disabledBooleanfalsePuts all children inputs into a disabled state.
elevationString | NumberundefinedDesignates an elevation applied to the component between 0 and 24.
expand-iconStringundefinedMISSING DESCRIPTION (edit in github).
heightString | NumberundefinedSets the height for the component.
item-childrenSelectItemKey\'children'Property on supplied items that contains its children.
item-propsSelectItemKey\'props'Props object that will be applied to each item component.
itemsAny[][]Can be an array of objects or strings.
item-titleSelectItemKey\'title'Property on supplied items that contains its title.
item-typeString'type'Designates the key on the supplied items that is used for determining the nodes type.
item-valueSelectItemKey\'value'Property on supplied items that contains its value.
linesBoolean | 'one' | 'two' | 'three''one'Designates a minimum-height for all children v-list-item components.
mandatoryBooleanfalseForces at least one item to always be selected (if available).
max-heightString | NumberundefinedSets the maximum height for the component.
max-widthString | NumberundefinedSets the maximum width for the component.
min-heightString | NumberundefinedSets the minimum height for the component.
min-widthString | NumberundefinedSets the minimum width for the component.
navBooleanfalseAn alternative styling that reduces v-list-item width and rounds the corners.
openedUnknownundefinedAn array containing the values of currently opened groups.
open-strategy'single' | 'multiple' | 'list' | OpenStrategy'list'Affects how items with children behave when expanded.
return-objectBooleanfalseChanges the selection behavior to return the object directly rather than the value specified with item-value.
roundedString | Number | BooleanundefinedDesignates the border-radius applied to the component - can be 0, xs, sm, true, lg, xl, pill, circle, and shaped.
selectableBooleanfalseMISSING DESCRIPTION (edit in github).
selectedUnknownundefinedAn array containing the values of currently selected items.
slimBooleanfalseReduces horizontal spacing for badges, icons, tooltips, and avatars within slim list items.
tagString'div'Specify a custom tag used on the root element.
themeStringundefinedSpecify a theme for this component and all of its children.
tileBooleanfalseRemoves any applied border-radius from the component.
value-comparator(a: any, b: any) => BooleanundefinedApply a custom comparison algorithm to compare model-value and values contains in the items prop.
variant'flat' | 'elevated' | 'tonal' | 'outlined' | 'text' | 'plain''text'Applies a distinct style to the component.
widthString | NumberundefinedSets the width for the component.

Slots

Slot NameDescription
defaultThe default Vue slot.

Example Usage

<template>
	<BaranList :items="items"></BaranList>
</template>

<script setup>
const items = [
	{ type: "subheader", title: "Group #1" },
	{
		title: "Item #1",
		value: 1,
	},
	{
		title: "Item #2",
		value: 2,
	},
	{
		title: "Item #3",
		value: 3,
	},
	{ type: "divider" },
	{ type: "subheader", title: "Group #2" },
	{
		title: "Item #4",
		value: 4,
	},
	{
		title: "Item #5",
		value: 5,
	},
	{
		title: "Item #6",
		value: 6,
	},
];
</script>

List Item Component

The BaranListItem is sub-component used to display a single list item.

Props

PropTypeDefaultDescription
activatableBooleanfalseMISSING DESCRIPTION (edit in github).
activatedAnyundefinedArray of ids of activated nodes.
active-classStringundefinedThe class applied to the component when it is in an active state.
active-colorStringundefinedThe applied color when the component is in an active state.
base-colorStringundefinedSets the color of component when not focused.
bg-colorStringundefinedApplies specified color to the control’s background - supports utility colors or CSS color values.
borderString | Number | BooleanfalseDesignates the border-radius applied to the component - can be xs, sm, md, lg, xl.
collapse-iconStringundefinedMISSING DESCRIPTION (edit in github).
colorStringundefinedApplies specified color to the control - supports utility colors or CSS color values.
density'default' | 'comfortable' | 'compact''comfortable'Adjusts the vertical height used by the component.
disabledBooleanfalsePuts all children inputs into a disabled state.
elevationString | NumberundefinedDesignates an elevation applied to the component between 0 and 24.
expand-iconStringundefinedMISSING DESCRIPTION (edit in github).
heightString | NumberundefinedSets the height for the component.
item-childrenSelectItemKey\'children'Property on supplied items that contains its children.
item-propsSelectItemKey\'props'Props object that will be applied to each item component.
itemsAny[][]Can be an array of objects or strings.
item-titleSelectItemKey\'title'Property on supplied items that contains its title.
item-typeString'type'Designates the key on the supplied items that is used for determining the nodes type.
item-valueSelectItemKey\'value'Property on supplied items that contains its value.
linesBoolean | 'one' | 'two' | 'three''one'Designates a minimum-height for all children v-list-item components.
mandatoryBooleanfalseForces at least one item to always be selected (if available).
max-heightString | NumberundefinedSets the maximum height for the component.
max-widthString | NumberundefinedSets the maximum width for the component.
min-heightString | NumberundefinedSets the minimum height for the component.
min-widthString | NumberundefinedSets the minimum width for the component.
navBooleanfalseAn alternative styling that reduces v-list-item width and rounds the corners.
openedUnknownundefinedAn array containing the values of currently opened groups.
open-strategy'single' | 'multiple' | 'list' | OpenStrategy'list'Affects how items with children behave when expanded.
return-objectBooleanfalseChanges the selection behavior to return the object directly rather than the value specified with item-value.
roundedString | Number | BooleanundefinedDesignates the border-radius applied to the component - can be 0, xs, sm, true, lg, xl, pill, circle, and shaped.
selectableBooleanfalseMISSING DESCRIPTION (edit in github).
selectedUnknownundefinedAn array containing the values of currently selected items.
slimBooleanfalseReduces horizontal spacing for badges, icons, tooltips, and avatars within slim list items.
tagString'div'Specify a custom tag used on the root element.
themeStringundefinedSpecify a theme for this component and all of its children.
tileBooleanfalseRemoves any applied border-radius from the component.
value-comparator(a: any, b: any) => BooleanundefinedApply a custom comparison algorithm to compare model-value and values contains in the items prop.
variant'flat' | 'elevated' | 'tonal' | 'outlined' | 'text' | 'plain''text'Applies a distinct style to the component.
widthString | NumberundefinedSets the width for the component.

Slots

Slot NameDescription
| The default Vue slot.
prependSlot for customizing the prepend icon.
appendSlot for customizing the append icon.
titleSlot for customizing the title.
subtitleSlot for customizing the subtitle.

Example Usage

<template>
	<BaranList>
		<BaranListItem v-for="(item, i) in items" :key="i" :value="item" color="primary" rounded="xl">
			<template v-slot:prepend>
				<v-icon :icon="item.icon"></v-icon>
			</template>
			<template v-slot:title>
				{{ item.text }}
			</template>
			<template v-slot:subtitle>
				{{ item.text }}
			</template>
		</BaranListItem>
	</BaranList>
</template>

<script setup>
const items = [
	{ text: "Real-Time", icon: "mdi-clock" },
	{ text: "Audience", icon: "mdi-account" },
	{ text: "Conversions", icon: "mdi-flag" },
];
</script>

Tabs Component

The BaranTabs component is a customizable tab component with support for icons, dynamic tab content, and various styling options. It allows for flexible props, slots, and a simple API to manage the tabs.

Props

PropTypeDefaultDescription
itemsArray[{ id: 1, tabText: "1st Tab", tabContent: "Content for 1st Tab" }, { id: 2, tabText: "2nd Tab", tabContent: "Content for 2nd Tab", icon: "$vuetify" }]Array of tab items, each containing an id, tabText, tabContent, and optionally an icon.
bgColorString#7367f0Background color for the tab component.
alignTabsStringstartAlignment of the tabs (start, center, end).
roundedStringxsBorder radius for the tab component (xs, sm, md, lg, xl).
elevationNumber2Elevation for the tab component (range from 0 to 24).
densityStringcomfortableDensity of the tabs (comfortable, compact).
disabledBooleanfalseWhether the tabs are disabled.
widthStringundefinedThe width of the tabs wrapper.
maxWidthStringundefinedThe maximum width of the tabs wrapper.
minWidthStringundefinedThe minimum width of the tabs wrapper.
heightStringundefinedThe height of the tabs wrapper.
maxHeightStringundefinedThe maximum height of the tabs wrapper.
minHeightStringundefinedThe minimum height of the tabs wrapper.

Slots

Slot NameDescription
tab-{id}Slot for customizing the tab with the specific id. Receives item as a scoped slot prop.
tabContent-{id}Slot for customizing the tab content with the specific id. Receives item as a scoped slot prop.

Example Usage

<template>
	<BaranTabs :items="tabs" bgColor="#4caf50" alignTabs="center" rounded="md" elevation="4" density="compact">
		<template #tab-1="{ item }">
			<span>Custom Tab Content for {{ item.tabText }}</span>
		</template>
		<template #tabContent-1="{ item }">
			<div>Custom Content for {{ item.tabContent }}</div>
		</template>
	</BaranTabs>
</template>

<script setup>
import { ref } from "vue";

const tabs = ref([
	{ id: 1, tabText: "1st Tab", tabContent: "Content for 1st Tab" },
	{ id: 2, tabText: "2nd Tab", tabContent: "Content for 2nd Tab", icon: "$vuetify" },
]);
</script>

Speed Dial Component

The BaranSpeedDial component provides a customizable speed dial menu with various items. Extended from Vuetify.

Props

PropTypeDefaultDescription
itemsArraySee ExampleAn array of objects, each representing an item in the speed dial menu.
positionArray['bottom', 'center']The position of the speed dial menu (horizontal and vertical alignment).
iconString'mdi-translate'The icon for the speed dial activator button.
colorString'#7367f0'The color of the speed dial activator button.
variantString'tonal'The variant style of the activator button.
densityString'comfortable'The density of the activator button.

Slots

Slot NameDescription
activatorSlot for customizing the activator button.

Events

The BaranSpeedDial component emits a 'click' event when any item in the speed dial menu is clicked. The clicked item object is passed as the event payload.

Example Usage

<template>
	<BaranSpeedDial :items="speedDialItems" :position="['bottom', 'center']" icon="mdi-plus" color="#42b983" @click="handleSpeedDialClick">
		<template v-slot:activator="{ props }">
			<!-- Custom activator button -->
			<v-btn v-bind="{ ...props, color: 'secondary', dark: true }"> Custom Activator </v-btn>
		</template>
	</BaranSpeedDial>
</template>

<script setup>
import { ref } from "vue";
import BaranSpeedDial from "./components/BaranSpeedDial.vue";

const speedDialItems = ref([
	{
		icon: "mdi-pencil",
		variant: "tonal",
		color: "#7367f0",
		onClick: () => console.log("Edit clicked"),
	},
	{
		icon: "mdi-delete",
		variant: "tonal",
		color: "#f04e54",
		onClick: () => console.log("Delete clicked"),
	},
]);

const handleSpeedDialClick = (item) => {
	console.log("Clicked item:", item);
};
</script>

Textbox Component

The BaranTextbox component is a customizable text field component with various props, computed properties, and reactive data bindings. This component leverages Vuetify's v-text-field and offers additional flexibility through props and slots.

Props

PropTypeDefaultDescription
labelString'Text'The label of the text field.
valueString, Number''The value of the text field.
variantString'outlined'The variant of the text field (e.g., outlined, underlined, solo, etc.).
densityString'compact'The density of the text field (e.g., comfortable, compact).
prependIconString''The icon to prepend to the text field.
appendIconString''The icon to append to the text field.
appendInnerIconString''The inner icon to append to the text field.
clearableBooleanfalseWhether the text field is clearable.
typeString'text'The type of the input (e.g., text, password, email).
placeholderString'Type something'The placeholder text.
hintString''Hint text to display.
persistentHintBooleanfalseWhether the hint text should always be visible.
disabledBooleanfalseWhether the text field is disabled.
readonlyBooleanfalseWhether the text field is read-only.
rulesArray[]Array of validation rules.
prefixString''Prefix text to display inside the text field.
suffixString''Suffix text to display inside the text field.
maxlengthString, Number''Maximum length of the input.
counterBooleanfalseWhether to display the character counter.
singleLineBooleanfalseWhether the text field is single-line.
moneyObject{}Input mask rules.
moneyCurrencyString''Pre-defined input mask rules for money currencies. EUR, TRY, USD, GBP
customMoneyCurrencyBooleanfalseWhether the use pre-defined input mask or custom input mask.

Slots

Slot NameDescription
prepend-innerSlot for customizing the inner prepend-inner icon.
prependSlot for customizing the prepend icon.
appendSlot for customizing the appended icon.
append-innerSlot for customizing the inner appended-inner icon.
detailsSlot for customizing the details. Used for displaying messages, hint, error-messages, and more.
labelSlot for customizing the label.

Example Usage

<template>
	<BaranTextbox v-model="inputValue" label="Enter your name" variant="underlined" prependIcon="mdi-account" appendIcon="mdi-check" appendInnerIcon="mdi-information" clearable :rules="[(v) => !!v || 'Name is required']" hint="Enter your full name" persistentHint counter maxlength="50">
		<template #prepend-inner>
			<v-icon>mdi-account</v-icon>
		</template>
		<template #append>
			<v-icon>mdi-check</v-icon>
		</template>
		<template #append-inner>
			<v-icon>mdi-information</v-icon>
		</template>
	</BaranTextbox>

	<!-- Pre-defined input mask -->
	<BaranTextbox moneyCurrency="EUR"></BaranTextbox>

	<!-- Custom input mask -->
	<BaranTextbox :money="jpyMask" :customMoneyCurrency="true"></BaranTextbox>
</template>

<script setup>
import { ref } from "vue";

const inputValue = ref("");

const jpyMask = ref({
	decimal: "",
	thousands: ",",
	prefix: "¥ ",
	suffix: " ",
	precision: 0,
	masked: false,
});
</script>

Combobox Component

The BaranCombobox component provides a customizable combobox interface for selecting items with various configurations.

Props

PropTypeDefaultDescription
itemsArray['Item 1', 'Item 2', 'Item 3']Array of items to display in the combobox.
labelString'Select'Label displayed above the combobox.
placeholderString'Select an item'Placeholder t
0.0.12

7 months ago

0.0.11

10 months ago

0.0.10

10 months ago

0.0.9

10 months ago

0.0.8

10 months ago

0.0.7

10 months ago

0.0.6

10 months ago

0.0.5

10 months ago

0.0.4

10 months ago

0.0.3

10 months ago

0.0.2

10 months ago