@gusarov-studio/rubik-ui 31.0.0 → 31.2.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.
@@ -1,11 +1,13 @@
1
1
  import React from "react";
2
2
  import type { Color } from "../types/Color";
3
+ import type { ResponsiveValue } from "../foundation/breakpoints";
3
4
  import type { BrandIconGlyphProps, NamedColor } from "./types";
4
5
  import { type BrandIconGlyph } from "./glyphs";
5
6
  import "./BrandIcon.scss";
6
- export interface BrandIconProps extends BrandIconGlyphProps {
7
+ export interface BrandIconProps extends Omit<BrandIconGlyphProps, "size"> {
7
8
  glyph: BrandIconGlyph;
8
9
  color?: NamedColor | Color;
10
+ size?: ResponsiveValue<string | number>;
9
11
  }
10
12
  declare const BrandIcon: React.ForwardRefExoticComponent<BrandIconProps & React.RefAttributes<SVGSVGElement>>;
11
13
  export { BrandIcon, type BrandIconGlyph };
@@ -1,13 +1,16 @@
1
1
  import React from "react";
2
2
  import type { NamedColor } from "./types";
3
3
  import type { Color } from "../types/Color";
4
+ import type { ResponsiveValue } from "../foundation/breakpoints";
4
5
  import "./Text.scss";
5
6
  type TextSize = 8 | 10 | 12 | 13 | 14 | 16 | 18 | 20 | 22 | 24 | 26 | 28 | 30 | 32 | 36 | 40 | 48 | 56 | 60 | 64 | 72;
6
7
  type TextElement = HTMLSpanElement | HTMLHeadingElement | HTMLLabelElement;
8
+ type TextWeight = "inherit" | "thin" | "extra-light" | "light" | "regular" | "medium" | "semibold" | "bold" | "extra-bold" | "black" | "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900";
9
+ type TextAlign = "inherit" | "start" | "center" | "end" | "justify";
7
10
  interface TextProps extends React.HTMLAttributes<TextElement> {
8
- size?: TextSize | `${TextSize}`;
9
- weight?: "inherit" | "thin" | "extra-light" | "light" | "regular" | "medium" | "semibold" | "bold" | "extra-bold" | "black" | "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900";
10
- align?: "inherit" | "start" | "center" | "end" | "justify";
11
+ size?: ResponsiveValue<TextSize | `${TextSize}`>;
12
+ weight?: ResponsiveValue<TextWeight>;
13
+ align?: ResponsiveValue<TextAlign>;
11
14
  color?: NamedColor | Color;
12
15
  block?: boolean;
13
16
  truncate?: boolean;
@@ -0,0 +1,3 @@
1
+ export { BREAKPOINTS } from "./types";
2
+ export type { Breakpoint, ResponsiveValue } from "./types";
3
+ export { getResponsiveClasses } from "./utils";
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Available breakpoint keys for responsive design
3
+ */
4
+ export type Breakpoint = "xs" | "sm" | "md" | "lg" | "xl" | "xxl";
5
+ /**
6
+ * Responsive value type that supports both primitive values and breakpoint objects
7
+ */
8
+ export type ResponsiveValue<T> = T | (Partial<Record<Breakpoint, T>> & {
9
+ base?: T;
10
+ });
11
+ /**
12
+ * Breakpoint pixel values
13
+ */
14
+ export declare const BREAKPOINTS: Record<Breakpoint, number>;
@@ -0,0 +1,20 @@
1
+ import type { ResponsiveValue } from "./types";
2
+ /**
3
+ * Helper function to generate responsive class names from a ResponsiveValue
4
+ *
5
+ * @param value - The responsive value (primitive or breakpoint object)
6
+ * @param prefix - The CSS class prefix (e.g., "r-text--size")
7
+ * @param defaultValue - Optional default value if value is undefined
8
+ * @returns Array of CSS class names
9
+ *
10
+ * @example
11
+ * // Simple value
12
+ * getResponsiveClasses("16", "r-text--size")
13
+ * // Returns: ["r-text--size-16"]
14
+ *
15
+ * @example
16
+ * // Responsive object
17
+ * getResponsiveClasses({ base: "16", md: "20", lg: "24" }, "r-text--size")
18
+ * // Returns: ["r-text--size-16", "r-text--size-md-20", "r-text--size-lg-24"]
19
+ */
20
+ export declare function getResponsiveClasses<T extends string | number>(value: ResponsiveValue<T> | undefined, prefix: string, defaultValue?: T): string[];