diff --git a/src/App.vue b/src/App.vue index e48e3c752edab69ba8a30efca5a41a107111b169..6b6fa05bbb7ef90665dbbf0c194d59d910e29828 100644 --- a/src/App.vue +++ b/src/App.vue @@ -109,6 +109,7 @@ import ArrowsVerticalIcon from '@stories/icons/Mono/ArrowsVerticalIcon.vue'; import TriangleIcon from '@stories/icons/Mono/TriangleIcon.vue'; import Playground from '@/Playground.vue'; import ArrowShortDownIcon from '@stories/icons/Mono/ArrowShortDownIcon.vue'; +import StarIcon from '@stories/icons/Mono/StarIcon.vue'; const gentleIcons = { Age18Icon, @@ -212,6 +213,7 @@ const gentleIcons = { SaveIcon, SearchIcon, SettingsIcon, + StarIcon, SortDownIcon, SortHorizontalIcon, SortUpIcon, diff --git a/src/Playground.vue b/src/Playground.vue index 70a79cdc6e5fa13381e18f309a8af151d4f3e8bf..64a17e42e71b1c1757ef028128f1079829a6cb2b 100644 --- a/src/Playground.vue +++ b/src/Playground.vue @@ -216,7 +216,7 @@ const knob = ref(0); show-all-lines :columns="tableColumns" darknessTextColor="500" - :data="tableData" + v-model="tableData" fontSize="36px" theme="black" stripedRows @@ -225,7 +225,7 @@ const knob = ref(0); show-all-lines :columns="tableColumns" darknessTextColor="500" - :data="tableData" + v-model="tableData" fontSize="20px" theme="black" stripedRows diff --git a/src/common/constants/icons.ts b/src/common/constants/icons.ts index 41c5605d90d6a8359dfb517fbc6148dfe8b8a3e4..1b4478448997e6b715fb4bcf395fa61c9a3ec694 100644 --- a/src/common/constants/icons.ts +++ b/src/common/constants/icons.ts @@ -109,6 +109,7 @@ import SortUpIcon from '@stories/icons/Mono/SortUpIcon.vue'; import SortVerticalIcon from '@stories/icons/Mono/SortVerticalIcon.vue'; import ArrowShortDownIcon from '@stories/icons/Mono/ArrowShortDownIcon.vue'; import SearchIcon from '@stories/icons/Mono/SearchIcon.vue'; +import StarIcon from '@stories/icons/Mono/StarIcon.vue'; export const iconsSet: Record = { Age18: Age18Icon, @@ -210,12 +211,13 @@ export const iconsSet: Record = { Plus: PlusIcon, Pointer: PointerIcon, Save: SaveIcon, - SearchIcon, + Search: SearchIcon, Settings: SettingsIcon, - SortDownIcon, - SortHorizontalIcon, - SortUpIcon, - SortVerticalIcon, + Star: StarIcon, + SortDown: SortDownIcon, + SortHorizontal: SortHorizontalIcon, + SortUp: SortUpIcon, + SortVertical: SortVerticalIcon, Table: TableIcon, Trash: TrashIcon, Triangle: TriangleIcon, diff --git a/src/common/interfaces/common.ts b/src/common/interfaces/common.ts index cb8b4722869060f1ece1258a6894e4e4e50be7a2..cd3723629357a19406b4cae9cd1a10817bd35dc4 100644 --- a/src/common/interfaces/common.ts +++ b/src/common/interfaces/common.ts @@ -1,6 +1,6 @@ import type { iconsSet } from '@/common/constants/icons'; -export type TIcons = keyof typeof iconsSet; +export type TIcon = keyof typeof iconsSet; export type TThemeColor = | 'white' diff --git a/src/common/interfaces/componentsProp.ts b/src/common/interfaces/componentsProp.ts index 3b7b90a1a0febd3d52de2597fcfcc7acadd0935d..0b549ea70b274680b69feb16707b92d7e3183a46 100644 --- a/src/common/interfaces/componentsProp.ts +++ b/src/common/interfaces/componentsProp.ts @@ -1,4 +1,4 @@ -import type { TDarkness, TIcons, TPosition, TTextStyle, TThemeColor } from '@interfaces/common'; +import type { TDarkness, TIcon, TPosition, TTextStyle, TThemeColor } from '@interfaces/common'; export interface ITableColumn { name: string; @@ -34,8 +34,8 @@ export interface ITreeItem { color?: TThemeColor; textStyle?: TTextStyle; isTriangleToColor?: boolean; - iconBefore?: TIcons; - iconAfter?: TIcons; + iconBefore?: TIcon; + iconAfter?: TIcon; iconColor?: TThemeColor; children?: ITreeItem[]; darknessColor?: TDarkness; @@ -66,8 +66,8 @@ export interface ISelectOption { value: string; label?: string; group?: string; - iconLeft?: TIcons; - iconRight?: TIcons; + iconLeft?: TIcon; + iconRight?: TIcon; iconLeftColor?: TThemeColor; iconRightColor?: TThemeColor; color?: TThemeColor; @@ -81,8 +81,8 @@ export interface ISelectGroup { nameColor?: TThemeColor; background?: TThemeColor; items?: ISelectOption[]; - iconLeft?: TIcons; - iconRight?: TIcons; + iconLeft?: TIcon; + iconRight?: TIcon; iconLeftColor?: TThemeColor; iconRightColor?: TThemeColor; } diff --git a/src/common/interfaces/componentsProps.ts b/src/common/interfaces/componentsProps.ts index aa35d26ba6f1de39a9ee239ac87f6595e00dca33..026ef573bc36712d335b93754ad51c0cc0006e8b 100644 --- a/src/common/interfaces/componentsProps.ts +++ b/src/common/interfaces/componentsProps.ts @@ -3,7 +3,7 @@ import type { TDarkness, TDirection, TExpandedPosition, - TIcons, + TIcon, TPosition, TSize, TTextStyle, @@ -115,7 +115,7 @@ export interface IDrawerProps { darknessTextColor?: TDarkness; modal?: boolean; dismissible?: boolean; - closeIcon?: TIcons; + closeIcon?: TIcon; headerDivider?: boolean; footerDivider?: boolean; } @@ -129,7 +129,7 @@ export interface IModalProps { height?: string; position?: TExpandedPosition; dismissible?: boolean; - closeIcon?: TIcons; + closeIcon?: TIcon; headerDivider?: boolean; } @@ -152,7 +152,7 @@ export interface ISelectProps { groups?: ISelectGroup[]; width?: string; placeholder?: string; - openIcon?: TIcons; + openIcon?: TIcon; size?: TSize; name?: string; theme?: TThemeColor; @@ -195,6 +195,7 @@ export interface IButtonProps { export interface IRatingProps { count?: number; + icon?: TIcon; theme?: TThemeColor; darknessTheme?: TDarkness; } @@ -212,8 +213,8 @@ export interface ITagProps { value?: string; size?: TSize; rounded?: boolean; - iconLeft?: TIcons; - iconRight?: TIcons; + iconLeft?: TIcon; + iconRight?: TIcon; theme?: TThemeColor; background?: TThemeColor; border?: TThemeColor; diff --git a/src/stories/components/Rating/Rating.stories.ts b/src/stories/components/Rating/Rating.stories.ts new file mode 100644 index 0000000000000000000000000000000000000000..2efc991b7faaafa536d83d445509e21e2f4d91cc --- /dev/null +++ b/src/stories/components/Rating/Rating.stories.ts @@ -0,0 +1,78 @@ +import type { Meta, StoryObj } from '@storybook/vue3'; + +import Rating from './Rating.vue'; + +const meta: Meta = { + title: 'Components/Rating', + component: Rating, + tags: ['autodocs'], + parameters: { + docs: { + description: { + component: 'A component that is used as a rating.', + }, + }, + }, + argTypes: { + label: { control: 'text' }, + padding: { control: 'text' }, + size: { control: 'select', options: ['small', 'normal', 'large', 'huge'] }, + textStyle: { control: 'select', options: ['bold', 'italic'] }, + iconPos: { control: 'select', options: ['left', 'top', 'right', 'bottom'] }, + width: { control: 'text' }, + darknessTheme: { control: 'select', options: ['100', '200', '300', '400', '500', '600', '700', '800', '900'] }, + darknessTextColor: { + control: 'select', + options: ['100', '200', '300', '400', '500', '600', '700', '800', '900'], + }, + theme: { + control: 'select', + options: [ + 'white', + 'blue', + 'sky', + 'cyan', + 'teal', + 'green', + 'yellow', + 'orange', + 'pink', + 'fuchsia', + 'purple', + 'indigo', + 'rose', + 'red', + 'black', + ], + }, + textColor: { + control: 'select', + options: [ + 'white', + 'blue', + 'sky', + 'cyan', + 'teal', + 'green', + 'yellow', + 'orange', + 'pink', + 'fuchsia', + 'purple', + 'indigo', + 'rose', + 'red', + 'black', + ], + }, + }, + args: {}, +} satisfies Meta; + +export default meta; + +type Story = StoryObj; + +export const Simple: Story = { + args: {}, +}; diff --git a/src/stories/components/Rating/Rating.vue b/src/stories/components/Rating/Rating.vue new file mode 100644 index 0000000000000000000000000000000000000000..a97b83053cde778e2bcc6fe95dd23de13d826936 --- /dev/null +++ b/src/stories/components/Rating/Rating.vue @@ -0,0 +1,71 @@ + + + + + diff --git a/src/stories/components/SelectButton/SelectButton.vue b/src/stories/components/SelectButton/SelectButton.vue index 3d491f3e81abe5a2c7f3ac37fb34ab865bb206d9..1d1f1b61977cc4073ec1c9a5a8498ef83dbab81c 100644 --- a/src/stories/components/SelectButton/SelectButton.vue +++ b/src/stories/components/SelectButton/SelectButton.vue @@ -1,5 +1,5 @@ + + + +