elseware-ui 2.22.1 → 2.22.3

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 (40) hide show
  1. package/README.md +35 -0
  2. package/build/components/data-display/avatar/Avatar.d.ts +7 -9
  3. package/build/components/data-display/badge/Badge.d.ts +8 -10
  4. package/build/components/data-display/banners/TitleBanner.d.ts +6 -13
  5. package/build/components/data-display/banners/index.d.ts +1 -2
  6. package/build/components/data-display/brand/Brand.d.ts +4 -5
  7. package/build/components/data-display/charts/bar-chart/BarChart.d.ts +2 -2
  8. package/build/components/data-display/charts/line-chart/LineChart.d.ts +6 -5
  9. package/build/components/data-display/charts/pie-chart/PieChart.d.ts +2 -2
  10. package/build/components/data-display/chip/Chip.d.ts +7 -7
  11. package/build/components/data-display/flag/Flag.d.ts +4 -6
  12. package/build/components/data-display/flag/index.d.ts +1 -1
  13. package/build/components/data-display/graphs/Graph.d.ts +4 -3
  14. package/build/components/data-display/graphs/com/GraphEdge.d.ts +8 -0
  15. package/build/components/data-display/graphs/com/GraphNode.d.ts +8 -0
  16. package/build/components/data-display/graphs/com/GraphRenderer.d.ts +11 -0
  17. package/build/components/data-display/graphs/index.d.ts +3 -3
  18. package/build/components/data-display/graphs/layouts/gridLayout.d.ts +15 -1
  19. package/build/components/data-display/graphs/layouts/index.d.ts +1 -0
  20. package/build/components/data-display/graphs/layouts/registry.d.ts +14 -0
  21. package/build/components/data-display/graphs/layouts/treeLayout.d.ts +2 -1
  22. package/build/components/data-display/graphs/types.d.ts +1 -1
  23. package/build/components/data-display/image/cloudinary-image/CloudinaryImage.d.ts +3 -3
  24. package/build/components/data-display/image/image/Image.d.ts +3 -3
  25. package/build/components/data-display/info/Info.d.ts +7 -5
  26. package/build/components/data-display/lists/List.d.ts +19 -4
  27. package/build/components/data-display/lists/ListItem.d.ts +10 -10
  28. package/build/components/data-display/lists/index.d.ts +2 -1
  29. package/build/data/enums.d.ts +3 -0
  30. package/build/data/styles.d.ts +70 -0
  31. package/build/index.d.ts +2 -0
  32. package/build/index.es.js +3803 -520
  33. package/build/index.js +3778 -492
  34. package/build/interfaces/components.d.ts +4 -0
  35. package/build/interfaces/index.d.ts +1 -0
  36. package/build/types/components.d.ts +16 -0
  37. package/build/types/index.d.ts +1 -0
  38. package/build/utils/cn.d.ts +2 -0
  39. package/build/utils/index.d.ts +1 -0
  40. package/package.json +2 -1
package/README.md CHANGED
@@ -1,5 +1,40 @@
1
1
  # elseware UI
2
2
 
3
+ ## Component Imports Structure
4
+
5
+ ```javascript
6
+ // External
7
+ import { ReactNode } from "react";
8
+
9
+ // Internal
10
+ import { cn } from "@/utils";
11
+
12
+ // Types
13
+ import { BaseComponentProps } from "@/interfaces";
14
+ import { Variant, Shape, Size } from "@/types";
15
+
16
+ // Data
17
+ import {
18
+ shapes,
19
+ variants,
20
+ borderVariants,
21
+ avatarSizes,
22
+ } from "@/data/styles";
23
+ ```
24
+
25
+ Copy the following and define the component imports accordingly
26
+
27
+ ```javascript
28
+ // External
29
+
30
+ // Internal
31
+
32
+ // Types
33
+
34
+ // Data
35
+ ```
36
+
37
+
3
38
  ## Folder Hierarchy
4
39
  - components: Base UI primitives (buttons, inputs, modals, etc.)
5
40
  - compositions: Composite reusable structures built from primitives
@@ -1,15 +1,13 @@
1
1
  import { ReactNode } from "react";
2
- import { Variant, Shape, Size } from "../../../data/enums";
3
- export interface AvatarProps {
2
+ import { BaseComponentProps } from "../../../interfaces";
3
+ import { Variant, Shape, Size } from "../../../types";
4
+ export interface AvatarProps extends BaseComponentProps {
4
5
  alt?: string;
5
6
  icon?: ReactNode;
6
- children?: ReactNode;
7
- variant?: keyof typeof Variant;
8
- shape?: keyof typeof Shape;
9
- size?: keyof typeof Size;
7
+ variant?: Variant;
8
+ shape?: Shape;
9
+ size?: Size;
10
10
  src?: string;
11
- styles?: string;
12
- onClick?: () => void;
13
11
  borderVariant?: boolean;
14
12
  }
15
- export declare const Avatar: ({ alt, icon, children, variant, shape, size, src, styles, onClick, borderVariant, }: AvatarProps) => import("react/jsx-runtime").JSX.Element;
13
+ export declare const Avatar: ({ alt, icon, children, variant, shape, size, src, borderVariant, className, ...rest }: AvatarProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,15 +1,13 @@
1
- import { ReactNode } from "react";
2
- import { Variant, Shape, Size } from "../../../data/enums";
3
- export interface BadgeProps {
4
- children?: ReactNode;
1
+ import { BaseComponentProps } from "../../../interfaces";
2
+ import { Variant, Shape, Size, OctilePosition } from "../../../types";
3
+ export interface BadgeProps extends BaseComponentProps {
5
4
  offset?: [number, number];
6
5
  dot?: boolean;
7
6
  count?: number;
8
- variant?: keyof typeof Variant;
9
- shape?: keyof typeof Shape;
10
- size?: keyof typeof Size;
7
+ variant?: Variant;
8
+ shape?: Shape;
9
+ size?: Size;
11
10
  showZero?: boolean;
12
- position?: "top-right" | "top-left" | "bottom-right" | "bottom-left";
13
- styles?: string;
11
+ position?: OctilePosition;
14
12
  }
15
- export declare const Badge: ({ children, offset, dot, count, variant, shape, size, showZero, position, styles, }: BadgeProps) => import("react/jsx-runtime").JSX.Element;
13
+ export declare const Badge: ({ children, offset, dot, count, variant, shape, size, showZero, position, className, ...rest }: BadgeProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,16 +1,9 @@
1
1
  import { ReactNode } from "react";
2
- export interface TitleBannerLevel1Props {
2
+ import { BaseComponentProps } from "../../../interfaces";
3
+ import { TitleBannerLevel } from "../../../types";
4
+ export interface TitleBannerProps extends BaseComponentProps {
3
5
  title: string;
4
- children?: ReactNode;
6
+ level?: TitleBannerLevel;
7
+ rightSection?: ReactNode;
5
8
  }
6
- export interface TitleBannerLevel2Props {
7
- title: string;
8
- children?: ReactNode;
9
- }
10
- export interface TitleBannerProps {
11
- title: string;
12
- level?: 1 | 2;
13
- children?: ReactNode;
14
- }
15
- declare function TitleBanner({ title, level, children, }: TitleBannerProps): import("react/jsx-runtime").JSX.Element;
16
- export default TitleBanner;
9
+ export declare const TitleBanner: ({ title, level, rightSection, className, ...rest }: TitleBannerProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,2 +1 @@
1
- import TitleBanner from "./TitleBanner";
2
- export { TitleBanner };
1
+ export { TitleBanner } from "./TitleBanner";
@@ -1,8 +1,7 @@
1
- export interface BrandProps {
2
- imgSrc?: string;
1
+ import { BaseComponentProps } from "../../../interfaces";
2
+ export interface BrandProps extends BaseComponentProps {
3
+ src?: string;
3
4
  alt?: string;
4
- styles?: string;
5
- onClick?: () => void;
6
5
  }
7
- declare function Brand({ imgSrc, alt, styles, onClick }: BrandProps): import("react/jsx-runtime").JSX.Element;
6
+ declare function Brand({ src, alt, className, ...rest }: BrandProps): import("react/jsx-runtime").JSX.Element;
8
7
  export default Brand;
@@ -1,9 +1,9 @@
1
1
  import React from "react";
2
2
  import { ChartOptions, ChartData } from "chart.js";
3
- export interface BarChartProps {
3
+ import { BaseComponentProps } from "../../../../interfaces";
4
+ export interface BarChartProps extends BaseComponentProps {
4
5
  data: ChartData<"bar">;
5
6
  options: ChartOptions<"bar">;
6
- styles?: string;
7
7
  }
8
8
  declare const BarChart: React.FC<BarChartProps>;
9
9
  export default BarChart;
@@ -1,8 +1,9 @@
1
- import React from 'react';
2
- import { ChartData, ChartOptions } from 'chart.js';
3
- export interface LineChartProps {
4
- data: ChartData<'line'>;
5
- options?: ChartOptions<'line'>;
1
+ import React from "react";
2
+ import { ChartData, ChartOptions } from "chart.js";
3
+ import { BaseComponentProps } from "../../../../interfaces";
4
+ export interface LineChartProps extends BaseComponentProps {
5
+ data: ChartData<"line">;
6
+ options?: ChartOptions<"line">;
6
7
  }
7
8
  declare const LineChart: React.FC<LineChartProps>;
8
9
  export default LineChart;
@@ -1,9 +1,9 @@
1
1
  import React from "react";
2
2
  import { ChartData, ChartOptions } from "chart.js";
3
- export interface PieChartProps {
3
+ import { BaseComponentProps } from "../../../../interfaces";
4
+ export interface PieChartProps extends BaseComponentProps {
4
5
  data: ChartData<"pie">;
5
6
  options: ChartOptions<"pie">;
6
- styles?: string;
7
7
  }
8
8
  declare const PieChart: React.FC<PieChartProps>;
9
9
  export default PieChart;
@@ -1,10 +1,10 @@
1
- import { Variant, Shape, Size } from "../../../data/enums";
2
- export interface ChipProps {
1
+ import { BaseComponentProps } from "../../../interfaces";
2
+ import { Variant, Shape, Size } from "../../../types";
3
+ export interface ChipProps extends BaseComponentProps {
3
4
  label?: string;
4
- variant?: keyof typeof Variant;
5
- shape?: keyof typeof Shape;
5
+ variant?: Variant;
6
+ shape?: Shape;
6
7
  ghost?: boolean;
7
- size?: keyof typeof Size;
8
- styles?: string;
8
+ size?: Size;
9
9
  }
10
- export declare const Chip: ({ label, variant, shape, ghost, size, styles, }: ChipProps) => import("react/jsx-runtime").JSX.Element;
10
+ export declare const Chip: ({ label, variant, shape, ghost, size, className, ...rest }: ChipProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,9 +1,7 @@
1
- import React from "react";
2
- export type FlagProps = {
1
+ import { BaseComponentProps } from "../../../interfaces";
2
+ export interface FlagProps extends BaseComponentProps {
3
3
  code: string;
4
4
  width?: number | string;
5
5
  height?: number | string;
6
- className?: string;
7
- };
8
- declare const Flag: React.FC<FlagProps>;
9
- export default Flag;
6
+ }
7
+ export declare const Flag: ({ code, width, height, className, ...rest }: FlagProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,2 +1,2 @@
1
- import Flag from "./Flag";
1
+ import { Flag } from "./Flag";
2
2
  export { Flag };
@@ -1,10 +1,11 @@
1
1
  import React from "react";
2
2
  import { GraphData } from "./types";
3
- export interface GraphProps {
3
+ import { BaseComponentProps } from "../../../interfaces";
4
+ export interface GraphProps extends BaseComponentProps {
4
5
  data: GraphData;
5
- layout?: "force" | "grid" | "tree";
6
+ layout?: string;
6
7
  nodeRenderer?: (node: any) => React.ReactNode;
7
8
  width?: number;
8
9
  height?: number;
9
10
  }
10
- export declare const Graph: ({ data, layout, nodeRenderer, width, height, }: GraphProps) => import("react/jsx-runtime").JSX.Element;
11
+ export declare const Graph: ({ data, layout, nodeRenderer, width, height, className, ...rest }: GraphProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ import { GraphEdgeType, GraphNodeType } from "../types";
3
+ interface Props {
4
+ edge: GraphEdgeType;
5
+ nodeMap: Map<string, GraphNodeType>;
6
+ }
7
+ export declare const GraphEdge: React.FC<Props>;
8
+ export {};
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ import { GraphNodeType } from "../types";
3
+ interface Props {
4
+ node: GraphNodeType;
5
+ renderCustom?: (node: GraphNodeType) => React.ReactNode;
6
+ }
7
+ export declare const GraphNode: React.FC<Props>;
8
+ export {};
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ import { GraphData, GraphNodeType } from "../types";
3
+ interface Props {
4
+ data: GraphData;
5
+ layout?: string;
6
+ nodeRenderer?: (node: GraphNodeType) => React.ReactNode;
7
+ width?: number;
8
+ height?: number;
9
+ }
10
+ export declare const GraphRenderer: React.FC<Props>;
11
+ export {};
@@ -1,6 +1,6 @@
1
1
  export * from "./Graph";
2
- export * from "./GraphEdge";
3
- export * from "./GraphNode";
4
- export * from "./GraphRenderer";
2
+ export * from "./com/GraphEdge";
3
+ export * from "./com/GraphNode";
4
+ export * from "./com/GraphRenderer";
5
5
  export * from "./types";
6
6
  export * from "./layouts";
@@ -1 +1,15 @@
1
- export declare function createGridLayout(nodes: any[], width: number, height: number): any[];
1
+ import { GraphNodeType } from "../types";
2
+ export declare function createGridLayout(nodes: GraphNodeType[], width: number, height: number): {
3
+ x: number;
4
+ y: number;
5
+ id: string;
6
+ label?: string | undefined;
7
+ type?: "default" | "avatar" | "custom" | undefined;
8
+ data?: any;
9
+ vx?: number | undefined;
10
+ vy?: number | undefined;
11
+ fx?: number | null | undefined;
12
+ fy?: number | null | undefined;
13
+ size?: number | undefined;
14
+ color?: string | undefined;
15
+ }[];
@@ -1,3 +1,4 @@
1
1
  export * from "./forceLayout";
2
2
  export * from "./gridLayout";
3
3
  export * from "./treeLayout";
4
+ export * from "./registry";
@@ -0,0 +1,14 @@
1
+ import { GraphNodeType, GraphEdgeType, GraphLayoutType } from "../types";
2
+ export interface LayoutContext {
3
+ nodes: GraphNodeType[];
4
+ edges: GraphEdgeType[];
5
+ width: number;
6
+ height: number;
7
+ onTick?: (nodes: GraphNodeType[]) => void;
8
+ }
9
+ export type LayoutExecutor = (ctx: LayoutContext) => {
10
+ type: "static" | "simulation";
11
+ stop?: () => void;
12
+ };
13
+ export declare const registerLayout: (type: GraphLayoutType, executor: LayoutExecutor) => void;
14
+ export declare const getLayout: (type: GraphLayoutType) => LayoutExecutor;
@@ -1 +1,2 @@
1
- export declare function createTreeLayout(nodes: any[], edges: any[], width: number, height: number): any[];
1
+ import { GraphNodeType, GraphEdgeType } from "../types";
2
+ export declare function createTreeLayout(nodes: GraphNodeType[], edges: GraphEdgeType[], width: number, height: number): GraphNodeType[];
@@ -1,4 +1,4 @@
1
- export type GraphLayoutType = "force" | "grid" | "tree";
1
+ export type GraphLayoutType = "force" | "grid" | "tree" | (string & {});
2
2
  export interface GraphData {
3
3
  nodes: GraphNodeType[];
4
4
  edges: GraphEdgeType[];
@@ -1,9 +1,9 @@
1
- export interface CloudinaryImageProps {
1
+ import { BaseComponentProps } from "../../../../interfaces";
2
+ export interface CloudinaryImageProps extends BaseComponentProps {
2
3
  publicId?: string;
3
4
  cloudName?: string;
4
5
  secure?: boolean;
5
6
  alt?: string;
6
- styles?: string;
7
7
  }
8
- declare function CloudinaryImage({ publicId, cloudName, secure, alt, styles, }: CloudinaryImageProps): import("react/jsx-runtime").JSX.Element;
8
+ declare function CloudinaryImage({ publicId, cloudName, secure, alt, className, ...rest }: CloudinaryImageProps): import("react/jsx-runtime").JSX.Element;
9
9
  export default CloudinaryImage;
@@ -1,8 +1,8 @@
1
- export interface ImageProps {
1
+ import { BaseComponentProps } from "../../../../interfaces";
2
+ export interface ImageProps extends BaseComponentProps {
2
3
  alt?: string;
3
4
  src?: string;
4
5
  height?: number;
5
6
  width?: number;
6
- styles?: string;
7
7
  }
8
- export declare const Image: ({ alt, src, height, width, styles, }: ImageProps) => import("react/jsx-runtime").JSX.Element;
8
+ export declare const Image: ({ alt, src, height, width, className, ...rest }: ImageProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,9 @@
1
- import { ReactNode } from "react";
2
- export interface InfoProps {
3
- children?: ReactNode;
4
- styles?: string;
1
+ import { BaseComponentProps } from "../../../interfaces";
2
+ import { Variant, Shape, Appearance } from "../../../types";
3
+ export interface InfoProps extends BaseComponentProps {
4
+ variant?: Variant;
5
+ appearance?: Appearance;
6
+ shape?: Shape;
5
7
  }
6
- declare function Info({ children, styles }: InfoProps): import("react/jsx-runtime").JSX.Element;
8
+ declare function Info({ children, className, variant, appearance, shape, ...rest }: InfoProps): import("react/jsx-runtime").JSX.Element;
7
9
  export default Info;
@@ -1,7 +1,22 @@
1
- import { ReactNode } from "react";
2
- export interface ListProps {
1
+ import React from "react";
2
+ import { BaseComponentProps } from "../../../interfaces";
3
+ import { ListBulletType, ListAlign, ListDirection } from "../../../types";
4
+ export interface ListItemData {
5
+ content: React.ReactNode;
6
+ bulletType?: ListBulletType;
7
+ renderBullet?: (index?: number) => React.ReactNode;
8
+ TypographyComponent?: React.ReactNode;
9
+ className?: string;
10
+ }
11
+ export interface ListProps extends BaseComponentProps {
3
12
  title?: string;
4
- children: ReactNode;
13
+ items: (string | React.ReactNode | ListItemData)[];
14
+ direction?: ListDirection;
15
+ gap?: 1 | 2 | 3 | 4;
16
+ columns?: 1 | 2 | 3 | 4;
17
+ align?: ListAlign;
18
+ wrap?: boolean;
19
+ bulletType?: ListBulletType;
5
20
  }
6
- declare function List({ title, children }: ListProps): import("react/jsx-runtime").JSX.Element;
21
+ declare function List({ title, items, direction, gap, columns, align, wrap, bulletType, className, ...rest }: ListProps): import("react/jsx-runtime").JSX.Element;
7
22
  export default List;
@@ -1,13 +1,13 @@
1
- import { ReactNode } from "react";
2
- export interface ListItemWrapperProps {
3
- TypographyComponent: ReactNode;
4
- x: ReactNode;
5
- }
6
- export declare const ListItemWrapper: ({ TypographyComponent, x }: ListItemWrapperProps) => import("react/jsx-runtime").JSX.Element;
1
+ import React from "react";
2
+ import { ListBulletType, ListAlign } from "../../../types";
7
3
  export interface ListItemProps {
8
- TypographyComponent?: ReactNode;
9
- bulletVisible?: boolean;
10
- children: ReactNode;
4
+ content: React.ReactNode;
5
+ index?: number;
6
+ TypographyComponent?: React.ReactNode;
7
+ bulletType?: ListBulletType;
8
+ renderBullet?: (index?: number) => React.ReactNode;
9
+ align?: ListAlign;
10
+ className?: string;
11
11
  }
12
- declare const ListItem: ({ TypographyComponent, bulletVisible, children }: ListItemProps) => import("react/jsx-runtime").JSX.Element;
12
+ declare const ListItem: ({ content, TypographyComponent, bulletType, renderBullet, index, align, className, }: ListItemProps) => import("react/jsx-runtime").JSX.Element;
13
13
  export default ListItem;
@@ -1,3 +1,4 @@
1
1
  import List from "./List";
2
2
  import ListItem from "./ListItem";
3
- export { List, ListItem };
3
+ import { ListItemData } from "./List";
4
+ export { List, ListItem, ListItemData };
@@ -45,3 +45,6 @@ export declare enum Target {
45
45
  parent = "parent",
46
46
  top = "top"
47
47
  }
48
+ export declare enum CornerPositions {
49
+ "top-right" = "top-right"
50
+ }
@@ -104,3 +104,73 @@ export declare const cardBgVariants: {
104
104
  light: string;
105
105
  dark: string;
106
106
  };
107
+ export declare const avatarSizes: {
108
+ xs: string;
109
+ sm: string;
110
+ md: string;
111
+ lg: string;
112
+ xl: string;
113
+ };
114
+ export declare const badgeSizes: {
115
+ xs: string;
116
+ sm: string;
117
+ md: string;
118
+ lg: string;
119
+ xl: string;
120
+ };
121
+ export declare const badgePositions: {
122
+ top: string;
123
+ bottom: string;
124
+ left: string;
125
+ right: string;
126
+ "top-right": string;
127
+ "top-left": string;
128
+ "bottom-right": string;
129
+ "bottom-left": string;
130
+ };
131
+ export declare const chipSizes: {
132
+ xs: string;
133
+ sm: string;
134
+ md: string;
135
+ lg: string;
136
+ xl: string;
137
+ };
138
+ export declare const infoVariantsLite: {
139
+ default: string;
140
+ primary: string;
141
+ secondary: string;
142
+ success: string;
143
+ danger: string;
144
+ warning: string;
145
+ info: string;
146
+ light: string;
147
+ dark: string;
148
+ };
149
+ export declare const infoVariantsGhost: {
150
+ default: string;
151
+ primary: string;
152
+ secondary: string;
153
+ success: string;
154
+ danger: string;
155
+ warning: string;
156
+ info: string;
157
+ light: string;
158
+ dark: string;
159
+ };
160
+ export declare const infoVariantsSolid: {
161
+ default: string;
162
+ primary: string;
163
+ secondary: string;
164
+ success: string;
165
+ danger: string;
166
+ warning: string;
167
+ info: string;
168
+ light: string;
169
+ dark: string;
170
+ };
171
+ export declare const bulletTypes: {
172
+ dot: import("react/jsx-runtime").JSX.Element;
173
+ diamond: import("react/jsx-runtime").JSX.Element;
174
+ number: null;
175
+ none: null;
176
+ };
package/build/index.d.ts CHANGED
@@ -5,3 +5,5 @@ export * from "./compositions";
5
5
  export * from "./hooks";
6
6
  export * from "./layouts";
7
7
  export * from "./utils";
8
+ export * from "./interfaces";
9
+ export * from "./types";