@gusarov-studio/rubik-ui 0.1.0-rc.1

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.
Files changed (52) hide show
  1. package/README.md +24 -0
  2. package/dist/Accordion/AccordionChevron.d.ts +7 -0
  3. package/dist/Accordion/AccordionContent.d.ts +4 -0
  4. package/dist/Accordion/AccordionItem.d.ts +4 -0
  5. package/dist/Accordion/AccordionTrigger.d.ts +5 -0
  6. package/dist/Accordion/Root.d.ts +3 -0
  7. package/dist/Accordion/index.d.ts +5 -0
  8. package/dist/Alert/Alert.d.ts +6 -0
  9. package/dist/Alert/index.d.ts +1 -0
  10. package/dist/Box/Box.d.ts +28 -0
  11. package/dist/Box/generateBreakpointClass.d.ts +2 -0
  12. package/dist/Box/index.d.ts +1 -0
  13. package/dist/BrandIcon/BrandIcon.d.ts +8 -0
  14. package/dist/BrandIcon/brands/Gemini.d.ts +4 -0
  15. package/dist/BrandIcon/brands/Google.d.ts +4 -0
  16. package/dist/BrandIcon/brands/OpenAI.d.ts +4 -0
  17. package/dist/BrandIcon/brands/index.d.ts +2 -0
  18. package/dist/BrandIcon/index.d.ts +1 -0
  19. package/dist/BrandIcon/types.d.ts +4 -0
  20. package/dist/Button/Button.d.ts +11 -0
  21. package/dist/Button/index.d.ts +1 -0
  22. package/dist/Icon/Icon.d.ts +8 -0
  23. package/dist/Icon/glyphs/Close.d.ts +4 -0
  24. package/dist/Icon/glyphs/CopyCheck.d.ts +4 -0
  25. package/dist/Icon/glyphs/Database.d.ts +4 -0
  26. package/dist/Icon/glyphs/Folder.d.ts +4 -0
  27. package/dist/Icon/glyphs/FolderTs.d.ts +4 -0
  28. package/dist/Icon/glyphs/Magnify.d.ts +4 -0
  29. package/dist/Icon/glyphs/PleChart.d.ts +4 -0
  30. package/dist/Icon/glyphs/Plus.d.ts +4 -0
  31. package/dist/Icon/glyphs/Prompt.d.ts +4 -0
  32. package/dist/Icon/glyphs/SidebarCollapse.d.ts +4 -0
  33. package/dist/Icon/glyphs/SidebarExpand.d.ts +4 -0
  34. package/dist/Icon/glyphs/index.d.ts +15 -0
  35. package/dist/Icon/index.d.ts +1 -0
  36. package/dist/Icon/types.d.ts +7 -0
  37. package/dist/Input/Input.d.ts +16 -0
  38. package/dist/Input/index.d.ts +1 -0
  39. package/dist/Stack/Stack.d.ts +11 -0
  40. package/dist/Stack/index.d.ts +1 -0
  41. package/dist/Text/Text.d.ts +15 -0
  42. package/dist/Text/index.d.ts +1 -0
  43. package/dist/ThemesProvider/ThemesProvider.d.ts +18 -0
  44. package/dist/ThemesProvider/index.d.ts +1 -0
  45. package/dist/index.d.ts +12 -0
  46. package/dist/index.js +3 -0
  47. package/dist/index.js.LICENSE.txt +9 -0
  48. package/dist/index.js.map +1 -0
  49. package/dist/tsconfig.declarations.tsbuildinfo +1 -0
  50. package/dist/utils/cn.d.ts +3 -0
  51. package/dist/utils/index.d.ts +2 -0
  52. package/package.json +69 -0
package/README.md ADDED
@@ -0,0 +1,24 @@
1
+ # rubik-ui
2
+
3
+
4
+ ## Getting started
5
+
6
+ Project requires at least `18.20.3` Node.js version.
7
+
8
+ Install project dependencies
9
+
10
+ ```shell
11
+ npm install
12
+ ```
13
+
14
+ Run local development
15
+
16
+ ```shell
17
+ npm run storybook
18
+ ```
19
+
20
+ To build library for publishing on npm
21
+
22
+ ```shell
23
+ npm run build
24
+ ```
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ import "./AccordionChevron.scss";
3
+ interface ChevronProps extends React.HTMLAttributes<HTMLSpanElement> {
4
+ position?: "left" | "right";
5
+ }
6
+ declare const AccordionChevron: React.ForwardRefExoticComponent<ChevronProps & React.RefAttributes<HTMLSpanElement>>;
7
+ export { AccordionChevron };
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import * as AccordionPrimitive from "@radix-ui/react-accordion";
3
+ declare const AccordionContent: React.ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
4
+ export { AccordionContent };
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import * as AccordionPrimitive from "@radix-ui/react-accordion";
3
+ declare const AccordionItem: React.ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
4
+ export { AccordionItem };
@@ -0,0 +1,5 @@
1
+ import React from "react";
2
+ import * as AccordionPrimitive from "@radix-ui/react-accordion";
3
+ import "./AccordionTrigger.scss";
4
+ declare const AccordionTrigger: React.ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
5
+ export { AccordionTrigger };
@@ -0,0 +1,3 @@
1
+ import * as AccordionPrimitive from "@radix-ui/react-accordion";
2
+ declare const Root: import("react").ForwardRefExoticComponent<(AccordionPrimitive.AccordionSingleProps | AccordionPrimitive.AccordionMultipleProps) & import("react").RefAttributes<HTMLDivElement>>;
3
+ export { Root };
@@ -0,0 +1,5 @@
1
+ export * from "./Root";
2
+ export * from "./AccordionItem";
3
+ export * from "./AccordionTrigger";
4
+ export * from "./AccordionChevron";
5
+ export * from "./AccordionContent";
@@ -0,0 +1,6 @@
1
+ import React from "react";
2
+ interface AlertProps extends React.HTMLAttributes<HTMLDivElement> {
3
+ variant: "danger" | "default";
4
+ }
5
+ declare const Alert: React.ForwardRefExoticComponent<AlertProps & React.RefAttributes<HTMLDivElement>>;
6
+ export { Alert };
@@ -0,0 +1 @@
1
+ export * from "./Alert";
@@ -0,0 +1,28 @@
1
+ import React from "react";
2
+ import "./Box.scss";
3
+ type SpacingValue = "spacing-none" | "spacing-xxs" | "spacing-xs" | "spacing-sm" | "spacing-md" | "spacing-lg" | "spacing-xl" | "spacing-2xl" | "spacing-3xl" | "spacing-4xl" | "spacing-5xl" | "spacing-6xl" | "spacing-7xl" | "spacing-8xl" | "spacing-9xl" | "spacing-10xl" | "spacing-11xl";
4
+ interface SpacingProps {
5
+ margin?: SpacingValue;
6
+ marginTop?: SpacingValue;
7
+ marginRight?: SpacingValue;
8
+ marginBottom?: SpacingValue;
9
+ marginLeft?: SpacingValue;
10
+ padding?: SpacingValue;
11
+ paddingTop?: SpacingValue;
12
+ paddingRight?: SpacingValue;
13
+ paddingBottom?: SpacingValue;
14
+ paddingLeft?: SpacingValue;
15
+ }
16
+ interface BoxProps extends React.PropsWithChildren, SpacingProps {
17
+ className?: string;
18
+ breakpoints?: {
19
+ xs?: SpacingProps;
20
+ sm?: SpacingProps;
21
+ md?: SpacingProps;
22
+ lg?: SpacingProps;
23
+ xl?: SpacingProps;
24
+ xxl?: SpacingProps;
25
+ };
26
+ }
27
+ declare const Box: React.ForwardRefExoticComponent<BoxProps & React.RefAttributes<HTMLDivElement>>;
28
+ export { Box };
@@ -0,0 +1,2 @@
1
+ declare const generateBreakpointClass: (initialClass: string, modifier: Record<string, string>, breakpoint?: string) => string[];
2
+ export default generateBreakpointClass;
@@ -0,0 +1 @@
1
+ export * from "./Box";
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ import type { BrandGlyph } from "./types";
3
+ interface BrandIconProps extends Omit<BrandGlyph, "size"> {
4
+ glyph: string;
5
+ size?: number | string;
6
+ }
7
+ declare const BrandIcon: React.ForwardRefExoticComponent<BrandIconProps & React.RefAttributes<SVGSVGElement>>;
8
+ export { BrandIcon };
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import type { BrandGlyph } from "../types";
3
+ declare const Gemini: React.ForwardRefExoticComponent<BrandGlyph & React.RefAttributes<SVGSVGElement>>;
4
+ export { Gemini };
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import type { BrandGlyph } from "../types";
3
+ declare const Google: React.ForwardRefExoticComponent<BrandGlyph & React.RefAttributes<SVGSVGElement>>;
4
+ export { Google };
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import type { BrandGlyph } from "../types";
3
+ declare const OpenAI: React.ForwardRefExoticComponent<BrandGlyph & React.RefAttributes<SVGSVGElement>>;
4
+ export { OpenAI };
@@ -0,0 +1,2 @@
1
+ declare function getBrand(glyph: string): import("react").ForwardRefExoticComponent<import("../types").BrandGlyph & import("react").RefAttributes<SVGSVGElement>>;
2
+ export { getBrand };
@@ -0,0 +1 @@
1
+ export * from "./BrandIcon";
@@ -0,0 +1,4 @@
1
+ import type React from "react";
2
+ export interface BrandGlyph extends React.SVGAttributes<SVGElement> {
3
+ size: number | string;
4
+ }
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ import "./Button.scss";
3
+ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
4
+ variant?: "accent" | "primary" | "danger" | "outline-accent" | "outline-primary" | "outline-danger" | "ghost-accent" | "ghost-primary" | "ghost-danger" | "text-accent" | "text-primary" | "text-danger";
5
+ size?: "32" | "36" | "40" | "44" | "48" | "56";
6
+ fullWidth?: boolean;
7
+ asChild?: boolean;
8
+ disabled?: boolean;
9
+ }
10
+ declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
11
+ export { Button };
@@ -0,0 +1 @@
1
+ export * from "./Button";
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ import type { GlyphProps } from "./types";
3
+ interface IconProps extends Omit<GlyphProps, "size"> {
4
+ glyph: string;
5
+ size?: string | number;
6
+ }
7
+ declare const Icon: React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>;
8
+ export { Icon };
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import type { GlyphProps } from "../types";
3
+ declare const Close: React.ForwardRefExoticComponent<GlyphProps & React.RefAttributes<SVGSVGElement>>;
4
+ export { Close };
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import type { GlyphProps } from "../types";
3
+ declare const CopyCheck: React.ForwardRefExoticComponent<GlyphProps & React.RefAttributes<SVGSVGElement>>;
4
+ export { CopyCheck };
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import type { GlyphProps } from "../types";
3
+ declare const Database: React.ForwardRefExoticComponent<GlyphProps & React.RefAttributes<SVGSVGElement>>;
4
+ export { Database };
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import type { GlyphProps } from "../types";
3
+ declare const Folder: React.ForwardRefExoticComponent<GlyphProps & React.RefAttributes<SVGSVGElement>>;
4
+ export { Folder };
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import type { GlyphProps } from "../types";
3
+ declare const FolderTs: React.ForwardRefExoticComponent<GlyphProps & React.RefAttributes<SVGSVGElement>>;
4
+ export { FolderTs };
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import type { GlyphProps } from "../types";
3
+ declare const Magnify: React.ForwardRefExoticComponent<GlyphProps & React.RefAttributes<SVGSVGElement>>;
4
+ export { Magnify };
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import type { GlyphProps } from "../types";
3
+ declare const PleChart: React.ForwardRefExoticComponent<GlyphProps & React.RefAttributes<SVGSVGElement>>;
4
+ export { PleChart };
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import type { GlyphProps } from "../types";
3
+ declare const Plus: React.ForwardRefExoticComponent<GlyphProps & React.RefAttributes<SVGSVGElement>>;
4
+ export { Plus };
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import type { GlyphProps } from "../types";
3
+ declare const Prompt: React.ForwardRefExoticComponent<GlyphProps & React.RefAttributes<SVGSVGElement>>;
4
+ export { Prompt };
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import type { GlyphProps } from "../types";
3
+ declare const SidebarCollapse: React.ForwardRefExoticComponent<GlyphProps & React.RefAttributes<SVGSVGElement>>;
4
+ export { SidebarCollapse };
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import type { GlyphProps } from "../types";
3
+ declare const SidebarExpand: React.ForwardRefExoticComponent<GlyphProps & React.RefAttributes<SVGSVGElement>>;
4
+ export { SidebarExpand };
@@ -0,0 +1,15 @@
1
+ export declare const glyphs: {
2
+ prompt: import("react").ForwardRefExoticComponent<import("../types").GlyphProps & import("react").RefAttributes<SVGSVGElement>>;
3
+ folder: import("react").ForwardRefExoticComponent<import("../types").GlyphProps & import("react").RefAttributes<SVGSVGElement>>;
4
+ "sidebar-collapse": import("react").ForwardRefExoticComponent<import("../types").GlyphProps & import("react").RefAttributes<SVGSVGElement>>;
5
+ "sidebar-expand": import("react").ForwardRefExoticComponent<import("../types").GlyphProps & import("react").RefAttributes<SVGSVGElement>>;
6
+ "ple-chart": import("react").ForwardRefExoticComponent<import("../types").GlyphProps & import("react").RefAttributes<SVGSVGElement>>;
7
+ close: import("react").ForwardRefExoticComponent<import("../types").GlyphProps & import("react").RefAttributes<SVGSVGElement>>;
8
+ magnify: import("react").ForwardRefExoticComponent<import("../types").GlyphProps & import("react").RefAttributes<SVGSVGElement>>;
9
+ plus: import("react").ForwardRefExoticComponent<import("../types").GlyphProps & import("react").RefAttributes<SVGSVGElement>>;
10
+ database: import("react").ForwardRefExoticComponent<import("../types").GlyphProps & import("react").RefAttributes<SVGSVGElement>>;
11
+ "folder-ts": import("react").ForwardRefExoticComponent<import("../types").GlyphProps & import("react").RefAttributes<SVGSVGElement>>;
12
+ "copy-check": import("react").ForwardRefExoticComponent<import("../types").GlyphProps & import("react").RefAttributes<SVGSVGElement>>;
13
+ };
14
+ declare function getGlyph(glyph: string): import("react").ForwardRefExoticComponent<import("../types").GlyphProps & import("react").RefAttributes<SVGSVGElement>>;
15
+ export { getGlyph };
@@ -0,0 +1 @@
1
+ export * from "./Icon";
@@ -0,0 +1,7 @@
1
+ import type React from "react";
2
+ export interface GlyphProps extends React.SVGAttributes<SVGElement> {
3
+ children?: never;
4
+ color?: string;
5
+ strokeWidth?: string | number;
6
+ size: number | string;
7
+ }
@@ -0,0 +1,16 @@
1
+ import React from "react";
2
+ import "./Input.scss";
3
+ declare const Input: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLInputElement> & {
4
+ size?: "xd" | "sm" | "lg" | "xl";
5
+ className?: string;
6
+ placeholder?: string;
7
+ disabled?: boolean;
8
+ invalid?: boolean;
9
+ prefix?: React.ReactNode;
10
+ suffix?: React.ReactNode;
11
+ internalPrefix?: React.ReactNode;
12
+ internalSuffix?: React.ReactNode;
13
+ id?: string;
14
+ type?: React.HTMLInputTypeAttribute;
15
+ } & React.RefAttributes<HTMLInputElement>>;
16
+ export { Input };
@@ -0,0 +1 @@
1
+ export * from "./Input";
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ import "./index.scss";
3
+ type Gap = "none" | "xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | "10xl" | "11xl";
4
+ interface StackProps extends React.HTMLAttributes<HTMLDivElement> {
5
+ gap: Gap;
6
+ direction?: "horizontal" | "vertical";
7
+ as?: React.ElementType;
8
+ className?: string;
9
+ }
10
+ declare const Stack: React.ForwardRefExoticComponent<StackProps & React.RefAttributes<HTMLDivElement>>;
11
+ export { Stack };
@@ -0,0 +1 @@
1
+ export * from "./Stack";
@@ -0,0 +1,15 @@
1
+ import React from "react";
2
+ import "./Text.scss";
3
+ type TextElement = HTMLSpanElement | HTMLHeadingElement | HTMLLabelElement;
4
+ interface TextProps extends React.HTMLAttributes<TextElement> {
5
+ as?: React.ElementType;
6
+ className?: string;
7
+ htmlFor?: string;
8
+ block?: boolean;
9
+ truncate?: boolean;
10
+ size?: "regular-xxs" | "regular-xs" | "regular-sm" | "regular-md" | "regular-lg" | "regular-xl";
11
+ weight?: "regular" | "medium" | "semibold" | "bold";
12
+ appearance?: "default" | "error" | "inherit" | "white";
13
+ }
14
+ declare const Text: React.ForwardRefExoticComponent<TextProps & React.RefAttributes<TextElement>>;
15
+ export { Text };
@@ -0,0 +1 @@
1
+ export * from "./Text";
@@ -0,0 +1,18 @@
1
+ import React from "react";
2
+ export declare const defaultThemes: {
3
+ light: string;
4
+ dark: string;
5
+ };
6
+ interface ThemesContext {
7
+ currentTheme: string;
8
+ invertedTheme: string;
9
+ toggleTheme: () => void;
10
+ setTheme: (newTheme: string) => void;
11
+ themes: typeof defaultThemes;
12
+ }
13
+ type ThemesProviderProps = React.PropsWithChildren<{
14
+ defaultTheme?: string;
15
+ }>;
16
+ declare const ThemesContext: React.Context<ThemesContext>;
17
+ declare function ThemesProvider(props: ThemesProviderProps): React.JSX.Element;
18
+ export { ThemesContext, ThemesProvider };
@@ -0,0 +1 @@
1
+ export * from "./ThemesProvider";
@@ -0,0 +1,12 @@
1
+ import "./styles.scss";
2
+ export * as Accordion from "./Accordion";
3
+ export * from "./Alert";
4
+ export * from "./Box";
5
+ export * from "./BrandIcon";
6
+ export * from "./Button";
7
+ export * from "./Icon";
8
+ export * from "./Input";
9
+ export * from "./Stack";
10
+ export * from "./Text";
11
+ export * from "./ThemesProvider";
12
+ export * from "./utils";