@faskai/ui-commons 0.0.0-alpha.26 → 0.0.0-alpha.28

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,10 @@
1
+ import * as React from 'react';
2
+ declare const GRID_STYLES: {
3
+ readonly 2: "grid-cols-1 gap-4 sm:grid-cols-2";
4
+ readonly 3: "grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-6 lg:grid-cols-3";
5
+ readonly 4: "grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-6 lg:grid-cols-3 xl:grid-cols-4";
6
+ };
7
+ declare function Grid({ columns, className, ...props }: React.ComponentProps<'div'> & {
8
+ columns: keyof typeof GRID_STYLES;
9
+ }): import("react/jsx-runtime").JSX.Element;
10
+ export { Grid };
@@ -0,0 +1,11 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cn } from '../../lib/utils';
3
+ const GRID_STYLES = {
4
+ 2: 'grid-cols-1 gap-4 sm:grid-cols-2',
5
+ 3: 'grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-6 lg:grid-cols-3',
6
+ 4: 'grid-cols-1 gap-3 sm:grid-cols-2 sm:gap-6 lg:grid-cols-3 xl:grid-cols-4',
7
+ };
8
+ function Grid({ columns, className, ...props }) {
9
+ return (_jsx("div", { "data-slot": "grid", className: cn('grid', GRID_STYLES[columns], className), ...props }));
10
+ }
11
+ export { Grid };
@@ -0,0 +1,7 @@
1
+ import * as React from 'react';
2
+ declare function Row({ gap, fill, wrap, className, ...props }: React.ComponentProps<'div'> & {
3
+ gap?: 0 | 1 | 1.5 | 2 | 3 | 4 | 6 | 8;
4
+ fill?: boolean;
5
+ wrap?: boolean;
6
+ }): import("react/jsx-runtime").JSX.Element;
7
+ export { Row };
@@ -0,0 +1,16 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cn } from '../../lib/utils';
3
+ const GAP_MAP = {
4
+ 0: 'gap-0',
5
+ 1: 'gap-1',
6
+ 1.5: 'gap-1.5',
7
+ 2: 'gap-2',
8
+ 3: 'gap-3',
9
+ 4: 'gap-4',
10
+ 6: 'gap-6',
11
+ 8: 'gap-8',
12
+ };
13
+ function Row({ gap = 2, fill = false, wrap = false, className, ...props }) {
14
+ return (_jsx("div", { "data-slot": "row", className: cn('flex flex-row min-w-0 overflow-hidden items-center', GAP_MAP[gap], fill && 'flex-1', wrap && 'flex-wrap', className), ...props }));
15
+ }
16
+ export { Row };
@@ -0,0 +1,6 @@
1
+ import * as React from 'react';
2
+ declare function SplitView({ desktop, mobile, className, ...props }: Omit<React.ComponentProps<'div'>, 'children'> & {
3
+ desktop: React.ReactNode;
4
+ mobile: React.ReactNode;
5
+ }): import("react/jsx-runtime").JSX.Element;
6
+ export { SplitView };
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { cn } from '../../lib/utils';
3
+ function SplitView({ desktop, mobile, className, ...props }) {
4
+ return (_jsxs("div", { "data-slot": "split-view", className: cn('flex min-h-0 flex-1 flex-col', className), ...props, children: [_jsx("div", { className: "hidden min-h-0 min-w-0 flex-1 overflow-hidden lg:flex", children: desktop }), _jsx("div", { className: "flex min-h-0 flex-1 flex-col lg:hidden", children: mobile })] }));
5
+ }
6
+ export { SplitView };
@@ -0,0 +1,6 @@
1
+ import * as React from 'react';
2
+ declare function Stack({ gap, fill, className, ...props }: React.ComponentProps<'div'> & {
3
+ gap?: 0 | 1 | 1.5 | 2 | 3 | 4 | 6 | 8;
4
+ fill?: boolean;
5
+ }): import("react/jsx-runtime").JSX.Element;
6
+ export { Stack };
@@ -0,0 +1,16 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cn } from '../../lib/utils';
3
+ const GAP_MAP = {
4
+ 0: 'gap-0',
5
+ 1: 'gap-1',
6
+ 1.5: 'gap-1.5',
7
+ 2: 'gap-2',
8
+ 3: 'gap-3',
9
+ 4: 'gap-4',
10
+ 6: 'gap-6',
11
+ 8: 'gap-8',
12
+ };
13
+ function Stack({ gap = 4, fill = false, className, ...props }) {
14
+ return (_jsx("div", { "data-slot": "stack", className: cn('flex flex-col min-h-0 overflow-hidden', GAP_MAP[gap], fill && 'flex-1', className), ...props }));
15
+ }
16
+ export { Stack };
package/dist/index.d.ts CHANGED
@@ -11,4 +11,8 @@ export type { ConnectionsApi } from './types/connections-api';
11
11
  export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent, } from './components/ui/card';
12
12
  export { Badge, badgeVariants } from './components/ui/badge';
13
13
  export { Button, buttonVariants } from './components/ui/button';
14
+ export { Stack } from './components/layout/stack';
15
+ export { Row } from './components/layout/row';
16
+ export { Grid } from './components/layout/grid';
17
+ export { SplitView } from './components/layout/split-view';
14
18
  export { cn } from './lib/utils';
package/dist/index.js CHANGED
@@ -11,5 +11,10 @@ export { ConnectionsPanel } from './components/connections/connections-panel';
11
11
  export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent, } from './components/ui/card';
12
12
  export { Badge, badgeVariants } from './components/ui/badge';
13
13
  export { Button, buttonVariants } from './components/ui/button';
14
+ // Layout primitives
15
+ export { Stack } from './components/layout/stack';
16
+ export { Row } from './components/layout/row';
17
+ export { Grid } from './components/layout/grid';
18
+ export { SplitView } from './components/layout/split-view';
14
19
  // Utilities
15
20
  export { cn } from './lib/utils';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@faskai/ui-commons",
3
3
  "author": "Fask AI <arko@fask.ai>",
4
- "version": "0.0.0-alpha.26",
4
+ "version": "0.0.0-alpha.28",
5
5
  "description": "Common UI components for Fask applications.",
6
6
  "private": false,
7
7
  "main": "dist/index.js",