From d71cc2c8ba0825a8d0416d923fb750f031fd9fa2 Mon Sep 17 00:00:00 2001 From: Rostyslav Nihrutsa Date: Thu, 12 Mar 2026 17:34:02 +0200 Subject: [PATCH 1/8] style: update styles for Button, TextArea, TextField, Tooltip --- src/components/Button/button.module.scss | 1 - src/components/TextArea/text-area.module.scss | 5 +++++ .../TextField/text-field.module.scss | 2 +- src/components/Tooltip/tooltip.module.scss | 1 + src/components/types.ts | 18 +++++++++--------- src/providers/ui/styles/default.scss | 4 ++++ 6 files changed, 20 insertions(+), 11 deletions(-) diff --git a/src/components/Button/button.module.scss b/src/components/Button/button.module.scss index 82575f9..a66e649 100644 --- a/src/components/Button/button.module.scss +++ b/src/components/Button/button.module.scss @@ -9,7 +9,6 @@ $root: button; height: var(--button-height, 34px); border-radius: var(--button-border-radius, 10px); padding: var(--button-padding, 0 16px); - will-change: background, color, transform; transition: color var(--button-speed-color, var(--speed-color)), background var(--button-speed-bg, var(--speed-color)), diff --git a/src/components/TextArea/text-area.module.scss b/src/components/TextArea/text-area.module.scss index af93d31..d45a06c 100644 --- a/src/components/TextArea/text-area.module.scss +++ b/src/components/TextArea/text-area.module.scss @@ -26,6 +26,11 @@ $root: text-area; cursor: not-allowed; } + &::placeholder { + color: var(--text-area-placeholder-color, var(--placeholder-color)); + transition: color var(--text-area-speed-color, var(--speed-color)); + } + &--full-width { width: 100% !important; } diff --git a/src/components/TextField/text-field.module.scss b/src/components/TextField/text-field.module.scss index 4f29653..17b15c5 100644 --- a/src/components/TextField/text-field.module.scss +++ b/src/components/TextField/text-field.module.scss @@ -54,7 +54,7 @@ $root: text-field; } &::placeholder { - color: var(--text-field-placeholder-color, var(--text-secondary-color)); + color: var(--text-field-placeholder-color, var(--placeholder-color)); transition: color var(--text-field-speed-color, var(--speed-color)); } diff --git a/src/components/Tooltip/tooltip.module.scss b/src/components/Tooltip/tooltip.module.scss index 8f4fa97..0e71661 100644 --- a/src/components/Tooltip/tooltip.module.scss +++ b/src/components/Tooltip/tooltip.module.scss @@ -20,6 +20,7 @@ $root: tooltip; animation-duration: var(--tooltip-speed-animation, var(--speed-md)); will-change: transform, opacity; box-shadow: var(--tooltip-box-shadow-offset, 0 0 5px 0) var(--tooltip-box-shadow-color, rgba(210, 208, 208, 0.47)); + z-index: var(--tooltip-z-index, 10000); transition: border-color var(--tooltip-speed-border-color, var(--speed-color)), box-shadow var(--tooltip-speed-box-shadow, var(--speed-color)), diff --git a/src/components/types.ts b/src/components/types.ts index d9d5f86..97d673b 100644 --- a/src/components/types.ts +++ b/src/components/types.ts @@ -7,34 +7,34 @@ import type { FooterProps, HeaderProps, HighlightProps, - IconProps, IconButtonProps, - ListProps, + IconProps, ListItemProps, + ListProps, ModalProps, OdometerProps, ScrollAreaProps, - SelectProps, - SelectItemProps, - SelectIconProps, - SelectValueProps, SelectContentProps, + SelectIconProps, + SelectItemProps, + SelectProps, SelectTriggerProps, + SelectValueProps, SwitchProps, - TabsProps, TabsContentProps, TabsListProps, + TabsProps, TabsTriggerProps, TagProps, TextAreaProps, TextFieldProps, ToastProps, TooltipProps, - TruncateProps, TruncateListProps, - ViewProps, + TruncateProps, ViewDrawerProps, ViewModalProps, + ViewProps, } from "../components"; export interface ComponentsProps { diff --git a/src/providers/ui/styles/default.scss b/src/providers/ui/styles/default.scss index b66708d..082021b 100644 --- a/src/providers/ui/styles/default.scss +++ b/src/providers/ui/styles/default.scss @@ -44,11 +44,14 @@ --bg-secondary-color: #e9ecef; --text-default-color: #000; + --text-revers-color: #fff; --text-primary-color: #2e4453; --text-secondary-color: #25282b; --text-accent-color: var(--accent-color); --text-disabled-color: #333337; + --placeholder-color: #a3a3a3; + --separator-color: #ccc; /* Components colors */ @@ -76,6 +79,7 @@ --bg-secondary-color: #3f404b; --text-default-color: #fff; + --text-revers-color: #000; --text-primary-color: #ededed; --text-secondary-color: #fbfbfb; --text-accent-color: var(--accent-color); From 307735071b1dfd831bbec300502e31b2e8ad5fe5 Mon Sep 17 00:00:00 2001 From: Rostyslav Nihrutsa Date: Thu, 12 Mar 2026 17:34:31 +0200 Subject: [PATCH 2/8] feat(Popover): add Popover component with subcomponents --- src/components/Popover/Popover.stories.tsx | 128 +++++++++++++++++++++ src/components/Popover/Popover.tsx | 15 +++ src/components/Popover/PopoverAnchor.tsx | 23 ++++ src/components/Popover/PopoverClose.tsx | 23 ++++ src/components/Popover/PopoverContent.tsx | 73 ++++++++++++ src/components/Popover/PopoverTrigger.tsx | 35 ++++++ src/components/Popover/index.ts | 5 + src/components/Popover/popover.module.scss | 77 +++++++++++++ src/components/index.ts | 1 + src/components/types.ts | 10 ++ 10 files changed, 390 insertions(+) create mode 100644 src/components/Popover/Popover.stories.tsx create mode 100644 src/components/Popover/Popover.tsx create mode 100644 src/components/Popover/PopoverAnchor.tsx create mode 100644 src/components/Popover/PopoverClose.tsx create mode 100644 src/components/Popover/PopoverContent.tsx create mode 100644 src/components/Popover/PopoverTrigger.tsx create mode 100644 src/components/Popover/index.ts create mode 100644 src/components/Popover/popover.module.scss diff --git a/src/components/Popover/Popover.stories.tsx b/src/components/Popover/Popover.stories.tsx new file mode 100644 index 0000000..be2137a --- /dev/null +++ b/src/components/Popover/Popover.stories.tsx @@ -0,0 +1,128 @@ +import React from "react"; +import {Meta, StoryObj} from "@storybook/react"; + +import { + Popover as PopoverComponent, + PopoverAnchor, + PopoverContent, + PopoverContentProps, + PopoverProps, + PopoverTrigger, + PopoverTriggerProps, +} from "./index"; + +import {TextArea, TextField} from "../index"; + +type Props = PopoverProps & + PopoverContentProps & + PopoverTriggerProps & { + withAnchor: boolean; + triggerWidth: number; + }; + +const meta: Meta = { + title: "Components/Popover", + component: PopoverComponent, + tags: ["autodocs"], + argTypes: { + // Root + modal: {table: {category: "Root"}}, + + // Trigger + center: {table: {category: "Trigger"}}, + + // Content + side: { + options: ["top", "right", "bottom", "left"], + control: {type: "select"}, + table: {category: "Content"}, + }, + align: { + options: ["start", "center", "end"], + control: {type: "select"}, + table: {category: "Content"}, + }, + sticky: { + options: ["partial", "always"], + control: {type: "select"}, + table: {category: "Content"}, + }, + alignOffset: {table: {category: "Content"}}, + sideOffset: {table: {category: "Content"}}, + minWidth: {table: {category: "Content"}, control: {type: "number"}}, + maxWidth: {table: {category: "Content"}, control: {type: "number"}}, + fullWidth: {table: {category: "Content"}}, + overlay: {table: {category: "Content"}}, + avoidCollisions: {table: {category: "Content"}}, + collisionPadding: {table: {category: "Content"}}, + hideWhenDetached: {table: {category: "Content"}}, + arrow: {table: {category: "Content"}}, + arrowWidth: {table: {category: "Content"}}, + arrowHeight: {table: {category: "Content"}}, + + // Storybook view + withAnchor: {table: {category: "Storybook_view"}}, + triggerWidth: {table: {category: "Storybook_view"}, control: {type: "number"}}, + }, +}; + +export default meta; + +export const Popover: StoryObj = { + args: { + modal: false, + + center: false, + + side: "bottom", + sideOffset: 10, + align: "center", + alignOffset: 0, + minWidth: undefined, + maxWidth: undefined, + fullWidth: false, + overlay: true, + avoidCollisions: true, + collisionPadding: 0, + sticky: "partial", + hideWhenDetached: false, + arrow: true, + arrowWidth: 10, + arrowHeight: 5, + + withAnchor: false, + triggerWidth: undefined, + }, + render: args => { + const {modal, center, withAnchor, triggerWidth, ...other} = args; + + return ( + + + Open Popover + {withAnchor && } + + + +
+ {["Name", "Surname", "Age"].map(item => ( +
+ +
+ +
+
+ ))} +