@grasp-labs/ds-react-components 0.18.0 → 0.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,20 @@
1
+ export type Variant = "contained" | "outlined" | "text";
2
+ export type Color = "primary" | "secondary" | "danger";
3
+ export declare const colorVariantClasses: {
4
+ readonly contained: {
5
+ readonly primary: "border-2 border-primary bg-primary text-contrast disabled:hover:bg-primary disabled:hover:text-contrast hover:bg-contrast hover:text-text ";
6
+ readonly secondary: "border-2 border-secondary bg-secondary text-text disabled:hover:bg-secondary disabled:hover:text-text hover:bg-contrast hover:text-text";
7
+ readonly danger: "border-2 border-error bg-error text-contrast disabled:hover:bg-error disabled:hover:text-contrast hover:bg-contrast hover:text-error";
8
+ };
9
+ readonly outlined: {
10
+ readonly primary: "border-2 border-primary bg-contrast text-text disabled:hover:bg-contrast disabled:hover:text-text hover:bg-primary hover:text-contrast";
11
+ readonly secondary: "border-2 border-secondary bg-contrast text-text disabled:hover:bg-contrast disabled:hover:text-text hover:bg-secondary hover:text-text";
12
+ readonly danger: "border-2 border-error bg-contrast text-error disabled:hover:bg-contrast disabled:hover:text-error hover:bg-error hover:text-contrast";
13
+ };
14
+ readonly text: {
15
+ readonly primary: "text-primary hover:text-primary-light";
16
+ readonly secondary: "text-text";
17
+ readonly danger: "text-error";
18
+ };
19
+ };
20
+ export declare function getBaseButtonClassName(variant: Variant, color: Color, className?: string): string;
@@ -1 +1,2 @@
1
1
  export * from './BaseButton';
2
+ export * from './BaseButton.styles';
@@ -0,0 +1,10 @@
1
+ export declare const buttonSizeClasses: {
2
+ readonly small: "rounded-lg px-3 py-1 text-xs gap-1";
3
+ readonly medium: "rounded-xl px-5 py-2 text-xs gap-2";
4
+ readonly large: "rounded-xl px-7 py-3 text-sm gap-2";
5
+ };
6
+ export declare const buttonContentClasses: {
7
+ readonly small: "h-4";
8
+ readonly medium: "h-5";
9
+ readonly large: "h-5";
10
+ };
@@ -0,0 +1 @@
1
+ export declare const DEFAULT_MASK_PLACEHOLDER = "_";
@@ -4,8 +4,6 @@ type DayPickerClassNamesConfig = Pick<ComponentProps<typeof DayPicker>, "classNa
4
4
  export type DatePickerProps = {
5
5
  /** Label text displayed nex to the trigger button */
6
6
  labelText: string;
7
- /** Text displayed in trigger button, when date is not selected */
8
- placeholderText: string;
9
7
  /** Date displayed in trigger button, when date is selected */
10
8
  selectedDate: Date | null;
11
9
  /** Locale used to display texts of date-picker in correct language and present date with correct format */
@@ -20,8 +18,6 @@ export type DatePickerProps = {
20
18
  className?: string;
21
19
  /** Config for class names used to override default styles of calendar */
22
20
  dayPickerClassNames?: DayPickerClassNamesConfig;
23
- /** Aria label added to the button, when date is selected */
24
- nonEmptyButtonAriaLabel: string;
25
21
  /** Callback function called when the date is changed */
26
22
  onSelectedDateChange: (selectedDate: Date | null) => void;
27
23
  };
@@ -31,5 +27,5 @@ export type DatePickerProps = {
31
27
  * @param props - The props for the DatePicker component
32
28
  * @returns The rendered date-picker
33
29
  */
34
- export declare const DatePicker: ({ labelText, placeholderText, selectedDate, locale, minDate, maxDate, defaultMonth, className, dayPickerClassNames, nonEmptyButtonAriaLabel, onSelectedDateChange, }: DatePickerProps) => import("react/jsx-runtime").JSX.Element;
30
+ export declare const DatePicker: ({ labelText, selectedDate, locale, minDate, maxDate, defaultMonth, className, dayPickerClassNames, onSelectedDateChange, }: DatePickerProps) => import("react/jsx-runtime").JSX.Element;
35
31
  export {};
@@ -0,0 +1,3 @@
1
+ export declare const getDatePickerPlaceholder: (locale: string) => string;
2
+ export declare const getDatePickerMask: (locale: string) => string;
3
+ export declare const getDateFnsFormat: (locale: string) => string;
@@ -0,0 +1,15 @@
1
+ export declare const DatePickerTextBox: import('react').ForwardRefExoticComponent<Omit<Omit<import('react').InputHTMLAttributes<HTMLInputElement>, "children"> & {
2
+ prefixContent?: import('react').ReactNode;
3
+ suffixContent?: import('react').ReactNode;
4
+ error?: boolean;
5
+ disabled?: boolean;
6
+ id?: string;
7
+ name?: string;
8
+ className?: string;
9
+ rootClassName?: string;
10
+ placeholder?: string;
11
+ ref?: React.Ref<HTMLInputElement>;
12
+ acceptOnly?: import('../baseTextBox').AcceptOnlyPattern | ((value: string) => string);
13
+ } & {
14
+ onCalendarToggle: () => void;
15
+ }, "ref"> & import('react').RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,18 @@
1
+ import { JSX } from 'react';
2
+ export type DropdownProps = {
3
+ /** Element that will trigger the dropdown, e.g. button */
4
+ triggerElement: JSX.Element;
5
+ /** Determines if dropdown is open, when passed - default open/close behavior of component is disabled */
6
+ isOpen?: boolean;
7
+ /** Optional className for popup, that allows to add custom styles */
8
+ popupClassName?: string;
9
+ /** Dropdown options, that will be shown when dropdown is open. */
10
+ children: JSX.Element | JSX.Element[];
11
+ };
12
+ /**
13
+ * A flexible Dropdown component
14
+ *
15
+ * @param props - The props for the Dropdown component
16
+ * @returns The rendered dropdown
17
+ */
18
+ export declare const Dropdown: ({ triggerElement, popupClassName, children, ...props }: DropdownProps) => JSX.Element;
@@ -0,0 +1,7 @@
1
+ export type DropdownItemProps = {
2
+ isDisabled?: boolean;
3
+ className?: string;
4
+ children: React.ReactNode;
5
+ onClick?: () => void;
6
+ };
7
+ export declare const DropdownItem: ({ isDisabled, className, children, onClick, }: DropdownItemProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ export { Dropdown } from './Dropdown';
2
+ export { DropdownItem } from './DropdownItem';
3
+ export type { DropdownProps } from './Dropdown';
@@ -0,0 +1,21 @@
1
+ import { ElementType } from 'react';
2
+ import { Variant } from '../baseButton';
3
+ import { Button } from '../button';
4
+ import * as React from "react";
5
+ type BaseButtonProps = Pick<React.ComponentProps<typeof Button>, "color" | "size" | "className" | "children" | "prefixContent" | "suffixContent">;
6
+ type VisualConfigProps = BaseButtonProps & {
7
+ variant?: Variant | "generic";
8
+ };
9
+ type PassedComponentProps<Props extends ElementType> = React.ComponentPropsWithoutRef<Props>;
10
+ export type LinkProps<Component extends ElementType = "a"> = VisualConfigProps & {
11
+ as?: Component;
12
+ } & Omit<PassedComponentProps<Component>, keyof VisualConfigProps | "as" | "className" | "children">;
13
+ /**
14
+ * A foundational link component with configurable variants and color schemes.
15
+ * Provides consistent styling, behavior and children rendering.
16
+ *
17
+ * @param props - The props for the Link component.
18
+ * @returns The rendered link element.
19
+ */
20
+ export declare function Link<ComponentType extends ElementType = "a">({ as, variant, color, size, className, prefixContent, suffixContent, children, ...props }: LinkProps<ComponentType>): import("react/jsx-runtime").JSX.Element;
21
+ export {};
@@ -0,0 +1 @@
1
+ export * from './Link';
@@ -0,0 +1,15 @@
1
+ import { BaseTextBoxProps } from '../baseTextBox';
2
+ export type PasswordTextBoxProps = Omit<BaseTextBoxProps, "type"> & {
3
+ /** Tooltip text shown when password is hidden (hovering over the show button) */
4
+ showPasswordLabel?: string;
5
+ /** Tooltip text shown when password is visible (hovering over the hide button) */
6
+ hidePasswordLabel?: string;
7
+ };
8
+ /**
9
+ * A password input field with visibility toggle button.
10
+ * Extends TextBox with eye icon to show/hide password and optional tooltip.
11
+ *
12
+ * @param props - The props for the PasswordTextBox component.
13
+ * @returns The rendered password input with toggle button.
14
+ */
15
+ export declare const PasswordTextBox: ({ showPasswordLabel, hidePasswordLabel, disabled, ...props }: PasswordTextBoxProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { PasswordTextBox } from './PasswordTextBox';
2
+ export type { PasswordTextBoxProps } from './PasswordTextBox';
@@ -0,0 +1,20 @@
1
+ import { ReactNode } from 'react';
2
+ import { PopoverPlacement } from '../popover';
3
+ export type TooltipProps = {
4
+ /** The element that triggers the tooltip on hover */
5
+ children: ReactNode;
6
+ /** The text or content to display in the tooltip */
7
+ content: ReactNode;
8
+ /** Preferred placement of the tooltip */
9
+ placement?: PopoverPlacement;
10
+ /** Additional CSS classes for the tooltip content */
11
+ className?: string;
12
+ };
13
+ /**
14
+ * A tooltip component that displays contextual information on hover.
15
+ * Wraps Popover with automatic show/hide state management.
16
+ *
17
+ * @param props - The props for the Tooltip component.
18
+ * @returns The rendered tooltip with trigger element.
19
+ */
20
+ export declare const Tooltip: ({ children, content, placement, className, }: TooltipProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { Tooltip } from './Tooltip';
2
+ export type { TooltipProps } from './Tooltip';
@@ -96,6 +96,18 @@ export declare const icons: {
96
96
  desc?: string;
97
97
  descId?: string;
98
98
  }>>;
99
+ readonly eye: import('react').LazyExoticComponent<import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement> & {
100
+ title?: string;
101
+ titleId?: string;
102
+ desc?: string;
103
+ descId?: string;
104
+ }>>;
105
+ readonly eyeOff: import('react').LazyExoticComponent<import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement> & {
106
+ title?: string;
107
+ titleId?: string;
108
+ desc?: string;
109
+ descId?: string;
110
+ }>>;
99
111
  readonly expandDown: import('react').LazyExoticComponent<import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement> & {
100
112
  title?: string;
101
113
  titleId?: string;
@@ -233,6 +245,8 @@ export declare const DetailsIcon: IconComponent;
233
245
  export declare const EarthIcon: IconComponent;
234
246
  export declare const ErrorFilledIcon: IconComponent;
235
247
  export declare const ErrorOutlinedIcon: IconComponent;
248
+ export declare const EyeIcon: IconComponent;
249
+ export declare const EyeOffIcon: IconComponent;
236
250
  export declare const ExpandDownIcon: IconComponent;
237
251
  export declare const ExpandRightIcon: IconComponent;
238
252
  export declare const ExpandIcon: IconComponent;