@kala-ui/react 0.0.1-beta.6 → 0.0.1-beta.7

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 (47) hide show
  1. package/CHANGELOG.md +110 -110
  2. package/LICENSE +21 -21
  3. package/README.md +366 -366
  4. package/dist/components/container/container.d.ts +11 -0
  5. package/dist/components/container/container.js +29 -0
  6. package/dist/components/container/container.stories.d.ts +8 -0
  7. package/dist/components/container/container.stories.js +34 -0
  8. package/dist/components/container/index.d.ts +1 -0
  9. package/dist/components/container/index.js +1 -0
  10. package/dist/components/dnd/dnd.stories.js +35 -35
  11. package/dist/components/flex/flex.d.ts +16 -0
  12. package/dist/components/flex/flex.js +78 -0
  13. package/dist/components/flex/flex.stories.d.ts +8 -0
  14. package/dist/components/flex/flex.stories.js +51 -0
  15. package/dist/components/flex/index.d.ts +1 -0
  16. package/dist/components/flex/index.js +1 -0
  17. package/dist/components/group/group.d.ts +7 -0
  18. package/dist/components/group/group.js +9 -0
  19. package/dist/components/group/group.stories.d.ts +7 -0
  20. package/dist/components/group/group.stories.js +34 -0
  21. package/dist/components/group/index.d.ts +1 -0
  22. package/dist/components/group/index.js +1 -0
  23. package/dist/components/heading/heading.d.ts +12 -0
  24. package/dist/components/heading/heading.js +44 -0
  25. package/dist/components/heading/heading.stories.d.ts +9 -0
  26. package/dist/components/heading/heading.stories.js +45 -0
  27. package/dist/components/heading/index.d.ts +1 -0
  28. package/dist/components/heading/index.js +1 -0
  29. package/dist/components/resizable/resizable.stories.js +8 -8
  30. package/dist/components/scroll-area/scroll-area.stories.js +25 -25
  31. package/dist/components/stack/index.d.ts +1 -0
  32. package/dist/components/stack/index.js +1 -0
  33. package/dist/components/stack/stack.d.ts +7 -0
  34. package/dist/components/stack/stack.js +9 -0
  35. package/dist/components/stack/stack.stories.d.ts +8 -0
  36. package/dist/components/stack/stack.stories.js +44 -0
  37. package/dist/components/text/index.d.ts +1 -0
  38. package/dist/components/text/index.js +1 -0
  39. package/dist/components/text/text.d.ts +14 -0
  40. package/dist/components/text/text.js +66 -0
  41. package/dist/components/text/text.stories.d.ts +8 -0
  42. package/dist/components/text/text.stories.js +40 -0
  43. package/dist/index.d.ts +6 -0
  44. package/dist/index.js +6 -0
  45. package/dist/lib/animations.js +94 -94
  46. package/dist/styles/globals.css +171 -20
  47. package/package.json +446 -418
@@ -81,31 +81,31 @@ export const Styled = {
81
81
  */
82
82
  export const CodeBlock = {
83
83
  args: {},
84
- render: () => (_jsxs(ScrollArea, { className: "h-[300px] w-[500px] rounded-md border", children: [_jsx("div", { className: "bg-muted/50 p-4", children: _jsx("pre", { className: "text-sm", children: _jsx("code", { children: `import { ScrollArea } from '@repo/ui/scroll-area';
85
-
86
- export function Example() {
87
- return (
88
- <ScrollArea className="h-72 w-48 rounded-md border">
89
- <div className="p-4">
90
- <h4>Title</h4>
91
- {/* Your scrollable content */}
92
- </div>
93
- </ScrollArea>
94
- );
95
- }
96
-
97
- // Advanced usage with horizontal scrolling
98
- export function HorizontalExample() {
99
- return (
100
- <ScrollArea className="w-96 whitespace-nowrap">
101
- <div className="flex w-max space-x-4 p-4">
102
- {items.map((item) => (
103
- <div key={item.id}>{item.content}</div>
104
- ))}
105
- </div>
106
- <ScrollBar orientation="horizontal" />
107
- </ScrollArea>
108
- );
84
+ render: () => (_jsxs(ScrollArea, { className: "h-[300px] w-[500px] rounded-md border", children: [_jsx("div", { className: "bg-muted/50 p-4", children: _jsx("pre", { className: "text-sm", children: _jsx("code", { children: `import { ScrollArea } from '@repo/ui/scroll-area';
85
+
86
+ export function Example() {
87
+ return (
88
+ <ScrollArea className="h-72 w-48 rounded-md border">
89
+ <div className="p-4">
90
+ <h4>Title</h4>
91
+ {/* Your scrollable content */}
92
+ </div>
93
+ </ScrollArea>
94
+ );
95
+ }
96
+
97
+ // Advanced usage with horizontal scrolling
98
+ export function HorizontalExample() {
99
+ return (
100
+ <ScrollArea className="w-96 whitespace-nowrap">
101
+ <div className="flex w-max space-x-4 p-4">
102
+ {items.map((item) => (
103
+ <div key={item.id}>{item.content}</div>
104
+ ))}
105
+ </div>
106
+ <ScrollBar orientation="horizontal" />
107
+ </ScrollArea>
108
+ );
109
109
  }` }) }) }), _jsx(ScrollBar, { orientation: "horizontal" })] })),
110
110
  };
111
111
  /**
@@ -0,0 +1 @@
1
+ export * from './stack';
@@ -0,0 +1 @@
1
+ export * from './stack';
@@ -0,0 +1,7 @@
1
+ import * as React from "react";
2
+ import { type FlexProps } from "../flex/flex";
3
+ export interface StackProps extends Omit<FlexProps, "direction"> {
4
+ direction?: "column" | "columnReverse";
5
+ }
6
+ declare const Stack: React.ForwardRefExoticComponent<StackProps & React.RefAttributes<HTMLDivElement>>;
7
+ export { Stack };
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import { cn } from "../../lib/utils";
4
+ import { Flex } from "../flex/flex";
5
+ const Stack = React.forwardRef(({ className, direction = "column", gap = 4, align = "stretch", ...props }, ref) => {
6
+ return (_jsx(Flex, { ref: ref, direction: direction, gap: gap, align: align, className: cn("w-full", className), ...props }));
7
+ });
8
+ Stack.displayName = "Stack";
9
+ export { Stack };
@@ -0,0 +1,8 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { Stack } from "./stack";
3
+ declare const meta: Meta<typeof Stack>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof Stack>;
6
+ export declare const Default: Story;
7
+ export declare const Reverse: Story;
8
+ export declare const Vertical: Story;
@@ -0,0 +1,44 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Stack } from "./stack";
3
+ const meta = {
4
+ title: "Components/Stack",
5
+ component: Stack,
6
+ tags: ["autodocs"],
7
+ argTypes: {
8
+ direction: {
9
+ control: "select",
10
+ options: ["column", "columnReverse"],
11
+ },
12
+ gap: {
13
+ control: "select",
14
+ options: [0, 1, 2, 3, 4, 5, 6, 8, 10, 12, 16],
15
+ },
16
+ align: {
17
+ control: "select",
18
+ options: ["start", "center", "end", "baseline", "stretch"],
19
+ },
20
+ justify: {
21
+ control: "select",
22
+ options: ["start", "center", "end", "between", "around", "evenly"],
23
+ },
24
+ },
25
+ };
26
+ export default meta;
27
+ export const Default = {
28
+ args: {
29
+ children: (_jsxs(_Fragment, { children: [_jsx("div", { className: "w-20 h-20 bg-primary rounded" }), _jsx("div", { className: "w-20 h-20 bg-secondary rounded" }), _jsx("div", { className: "w-20 h-20 bg-accent rounded" })] })),
30
+ gap: 4,
31
+ },
32
+ };
33
+ export const Reverse = {
34
+ args: {
35
+ ...Default.args,
36
+ direction: "columnReverse",
37
+ },
38
+ };
39
+ export const Vertical = {
40
+ args: {
41
+ ...Default.args,
42
+ direction: "column",
43
+ },
44
+ };
@@ -0,0 +1 @@
1
+ export * from './text';
@@ -0,0 +1 @@
1
+ export * from './text';
@@ -0,0 +1,14 @@
1
+ import { type VariantProps } from "class-variance-authority";
2
+ import * as React from "react";
3
+ declare const textVariants: (props?: ({
4
+ size?: "base" | "sm" | "lg" | "xl" | "xs" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "7xl" | "8xl" | "9xl" | null | undefined;
5
+ weight?: "bold" | "black" | "normal" | "medium" | "thin" | "light" | "semibold" | "extrabold" | "extralight" | null | undefined;
6
+ align?: "center" | "end" | "start" | "left" | "right" | "justify" | null | undefined;
7
+ color?: "default" | "primary" | "secondary" | "destructive" | "muted" | "accent" | null | undefined;
8
+ truncate?: boolean | null | undefined;
9
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
10
+ export interface TextProps extends Omit<React.HTMLAttributes<HTMLParagraphElement>, "color">, VariantProps<typeof textVariants> {
11
+ asChild?: boolean;
12
+ }
13
+ declare const Text: React.ForwardRefExoticComponent<TextProps & React.RefAttributes<HTMLParagraphElement>>;
14
+ export { Text, textVariants };
@@ -0,0 +1,66 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Slot } from "@radix-ui/react-slot";
3
+ import { cva } from "class-variance-authority";
4
+ import * as React from "react";
5
+ import { cn } from "../../lib/utils";
6
+ const textVariants = cva("text-foreground", {
7
+ variants: {
8
+ size: {
9
+ xs: "text-xs",
10
+ sm: "text-sm",
11
+ base: "text-base",
12
+ lg: "text-lg",
13
+ xl: "text-xl",
14
+ "2xl": "text-2xl",
15
+ "3xl": "text-3xl",
16
+ "4xl": "text-4xl",
17
+ "5xl": "text-5xl",
18
+ "6xl": "text-6xl",
19
+ "7xl": "text-7xl",
20
+ "8xl": "text-8xl",
21
+ "9xl": "text-9xl",
22
+ },
23
+ weight: {
24
+ thin: "font-thin",
25
+ extralight: "font-extralight",
26
+ light: "font-light",
27
+ normal: "font-normal",
28
+ medium: "font-medium",
29
+ semibold: "font-semibold",
30
+ bold: "font-bold",
31
+ extrabold: "font-extrabold",
32
+ black: "font-black",
33
+ },
34
+ align: {
35
+ left: "text-left",
36
+ center: "text-center",
37
+ right: "text-right",
38
+ justify: "text-justify",
39
+ start: "text-start",
40
+ end: "text-end",
41
+ },
42
+ color: {
43
+ default: "text-foreground",
44
+ muted: "text-muted-foreground",
45
+ primary: "text-primary",
46
+ secondary: "text-secondary-foreground",
47
+ destructive: "text-destructive",
48
+ accent: "text-accent-foreground",
49
+ },
50
+ truncate: {
51
+ true: "truncate",
52
+ },
53
+ },
54
+ defaultVariants: {
55
+ size: "base",
56
+ weight: "normal",
57
+ align: "left",
58
+ color: "default",
59
+ },
60
+ });
61
+ const Text = React.forwardRef(({ className, size, weight, align, color, truncate, asChild = false, ...props }, ref) => {
62
+ const Comp = asChild ? Slot : "p";
63
+ return (_jsx(Comp, { className: cn(textVariants({ size, weight, align, color, truncate, className })), ref: ref, ...props }));
64
+ });
65
+ Text.displayName = "Text";
66
+ export { Text, textVariants };
@@ -0,0 +1,8 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { Text } from "./text";
3
+ declare const meta: Meta<typeof Text>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof Text>;
6
+ export declare const Default: Story;
7
+ export declare const Sizes: Story;
8
+ export declare const Colors: Story;
@@ -0,0 +1,40 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Text } from "./text";
3
+ const meta = {
4
+ title: "Components/Text",
5
+ component: Text,
6
+ tags: ["autodocs"],
7
+ argTypes: {
8
+ size: {
9
+ control: "select",
10
+ options: ["xs", "sm", "base", "lg", "xl", "2xl", "3xl", "4xl", "5xl", "6xl", "7xl", "8xl", "9xl"],
11
+ },
12
+ weight: {
13
+ control: "select",
14
+ options: ["thin", "extralight", "light", "normal", "medium", "semibold", "bold", "extrabold", "black"],
15
+ },
16
+ align: {
17
+ control: "select",
18
+ options: ["left", "center", "right", "justify", "start", "end"],
19
+ },
20
+ color: {
21
+ control: "select",
22
+ options: ["default", "muted", "primary", "secondary", "destructive", "accent"],
23
+ },
24
+ truncate: {
25
+ control: "boolean",
26
+ },
27
+ },
28
+ };
29
+ export default meta;
30
+ export const Default = {
31
+ args: {
32
+ children: "The quick brown fox jumps over the lazy dog",
33
+ },
34
+ };
35
+ export const Sizes = {
36
+ render: () => (_jsxs("div", { className: "flex flex-col gap-4", children: [_jsx(Text, { size: "xs", children: "Extra Small Text" }), _jsx(Text, { size: "sm", children: "Small Text" }), _jsx(Text, { size: "base", children: "Base Text" }), _jsx(Text, { size: "lg", children: "Large Text" }), _jsx(Text, { size: "xl", children: "Extra Large Text" }), _jsx(Text, { size: "2xl", children: "2XL Text" })] })),
37
+ };
38
+ export const Colors = {
39
+ render: () => (_jsxs("div", { className: "flex flex-col gap-4", children: [_jsx(Text, { color: "default", children: "Default Color" }), _jsx(Text, { color: "muted", children: "Muted Color" }), _jsx(Text, { color: "primary", children: "Primary Color" }), _jsx(Text, { color: "secondary", children: "Secondary Color" }), _jsx(Text, { color: "destructive", children: "Destructive Color" })] })),
40
+ };
package/dist/index.d.ts CHANGED
@@ -14,6 +14,7 @@ export * from "./components/charts";
14
14
  export * from "./components/checkbox";
15
15
  export * from "./components/combobox";
16
16
  export * from "./components/command";
17
+ export * from "./components/container";
17
18
  export * from "./components/data-table";
18
19
  export * from "./components/date-picker";
19
20
  export * from "./components/dialog";
@@ -24,8 +25,11 @@ export * from "./components/empty-state";
24
25
  export * from "./components/error-boundary";
25
26
  export * from "./components/field";
26
27
  export * from "./components/file-upload";
28
+ export * from "./components/flex";
27
29
  export * from "./components/footer";
30
+ export * from "./components/group";
28
31
  export * from "./components/header";
32
+ export * from "./components/heading";
29
33
  export * from "./components/input";
30
34
  export * from "./components/input-group";
31
35
  export * from "./components/input-otp";
@@ -52,10 +56,12 @@ export * from "./components/sidebar";
52
56
  export * from "./components/slider";
53
57
  export * from "./components/social-login-button";
54
58
  export * from "./components/sparkline-chart";
59
+ export * from "./components/stack";
55
60
  export * from "./components/switch";
56
61
  export * from "./components/table";
57
62
  export * from "./components/tabs";
58
63
  export * from "./components/tag-input";
64
+ export * from "./components/text";
59
65
  export * from "./components/textarea";
60
66
  export * from "./components/toast";
61
67
  export * from "./components/tooltip";
package/dist/index.js CHANGED
@@ -16,6 +16,7 @@ export * from "./components/charts";
16
16
  export * from "./components/checkbox";
17
17
  export * from "./components/combobox";
18
18
  export * from "./components/command";
19
+ export * from "./components/container";
19
20
  export * from "./components/data-table";
20
21
  export * from "./components/date-picker";
21
22
  // export * from "./components/design-system"; // No index
@@ -27,8 +28,11 @@ export * from "./components/empty-state";
27
28
  export * from "./components/error-boundary";
28
29
  export * from "./components/field";
29
30
  export * from "./components/file-upload";
31
+ export * from "./components/flex";
30
32
  export * from "./components/footer";
33
+ export * from "./components/group";
31
34
  export * from "./components/header";
35
+ export * from "./components/heading";
32
36
  export * from "./components/input";
33
37
  export * from "./components/input-group";
34
38
  export * from "./components/input-otp";
@@ -56,10 +60,12 @@ export * from "./components/sidebar";
56
60
  export * from "./components/slider";
57
61
  export * from "./components/social-login-button";
58
62
  export * from "./components/sparkline-chart";
63
+ export * from "./components/stack";
59
64
  export * from "./components/switch";
60
65
  export * from "./components/table";
61
66
  export * from "./components/tabs";
62
67
  export * from "./components/tag-input";
68
+ export * from "./components/text";
63
69
  export * from "./components/textarea";
64
70
  export * from "./components/toast";
65
71
  export * from "./components/tooltip";
@@ -94,100 +94,100 @@ export const transitionClasses = {
94
94
  * Define the actual CSS keyframes in your global styles or Tailwind config.
95
95
  * These values match the keyframes from design tokens.
96
96
  */
97
- export const keyframesCSS = `
98
- @keyframes fade-in {
99
- from { opacity: 0; }
100
- to { opacity: 1; }
101
- }
102
-
103
- @keyframes fade-out {
104
- from { opacity: 1; }
105
- to { opacity: 0; }
106
- }
107
-
108
- @keyframes slide-in-from-top {
109
- from { transform: translateY(-100%); }
110
- to { transform: translateY(0); }
111
- }
112
-
113
- @keyframes slide-in-from-bottom {
114
- from { transform: translateY(100%); }
115
- to { transform: translateY(0); }
116
- }
117
-
118
- @keyframes slide-in-from-left {
119
- from { transform: translateX(-100%); }
120
- to { transform: translateX(0); }
121
- }
122
-
123
- @keyframes slide-in-from-right {
124
- from { transform: translateX(100%); }
125
- to { transform: translateX(0); }
126
- }
127
-
128
- @keyframes slide-out-to-top {
129
- from { transform: translateY(0); }
130
- to { transform: translateY(-100%); }
131
- }
132
-
133
- @keyframes slide-out-to-bottom {
134
- from { transform: translateY(0); }
135
- to { transform: translateY(100%); }
136
- }
137
-
138
- @keyframes slide-out-to-left {
139
- from { transform: translateX(0); }
140
- to { transform: translateX(-100%); }
141
- }
142
-
143
- @keyframes slide-out-to-right {
144
- from { transform: translateX(0); }
145
- to { transform: translateX(100%); }
146
- }
147
-
148
- @keyframes scale-in {
149
- from { transform: scale(0.95); opacity: 0; }
150
- to { transform: scale(1); opacity: 1; }
151
- }
152
-
153
- @keyframes scale-out {
154
- from { transform: scale(1); opacity: 1; }
155
- to { transform: scale(0.95); opacity: 0; }
156
- }
157
-
158
- @keyframes expand-vertical {
159
- from {
160
- max-height: 0;
161
- opacity: 0;
162
- }
163
- to {
164
- max-height: var(--max-height, 1000px);
165
- opacity: 1;
166
- }
167
- }
168
-
169
- @keyframes collapse-vertical {
170
- from {
171
- max-height: var(--max-height, 1000px);
172
- opacity: 1;
173
- }
174
- to {
175
- max-height: 0;
176
- opacity: 0;
177
- }
178
- }
179
-
180
- /* Respect prefers-reduced-motion */
181
- @media (prefers-reduced-motion: reduce) {
182
- *,
183
- *::before,
184
- *::after {
185
- animation-duration: 0.01ms !important;
186
- animation-iteration-count: 1 !important;
187
- transition-duration: 0.01ms !important;
188
- scroll-behavior: auto !important;
189
- }
190
- }
97
+ export const keyframesCSS = `
98
+ @keyframes fade-in {
99
+ from { opacity: 0; }
100
+ to { opacity: 1; }
101
+ }
102
+
103
+ @keyframes fade-out {
104
+ from { opacity: 1; }
105
+ to { opacity: 0; }
106
+ }
107
+
108
+ @keyframes slide-in-from-top {
109
+ from { transform: translateY(-100%); }
110
+ to { transform: translateY(0); }
111
+ }
112
+
113
+ @keyframes slide-in-from-bottom {
114
+ from { transform: translateY(100%); }
115
+ to { transform: translateY(0); }
116
+ }
117
+
118
+ @keyframes slide-in-from-left {
119
+ from { transform: translateX(-100%); }
120
+ to { transform: translateX(0); }
121
+ }
122
+
123
+ @keyframes slide-in-from-right {
124
+ from { transform: translateX(100%); }
125
+ to { transform: translateX(0); }
126
+ }
127
+
128
+ @keyframes slide-out-to-top {
129
+ from { transform: translateY(0); }
130
+ to { transform: translateY(-100%); }
131
+ }
132
+
133
+ @keyframes slide-out-to-bottom {
134
+ from { transform: translateY(0); }
135
+ to { transform: translateY(100%); }
136
+ }
137
+
138
+ @keyframes slide-out-to-left {
139
+ from { transform: translateX(0); }
140
+ to { transform: translateX(-100%); }
141
+ }
142
+
143
+ @keyframes slide-out-to-right {
144
+ from { transform: translateX(0); }
145
+ to { transform: translateX(100%); }
146
+ }
147
+
148
+ @keyframes scale-in {
149
+ from { transform: scale(0.95); opacity: 0; }
150
+ to { transform: scale(1); opacity: 1; }
151
+ }
152
+
153
+ @keyframes scale-out {
154
+ from { transform: scale(1); opacity: 1; }
155
+ to { transform: scale(0.95); opacity: 0; }
156
+ }
157
+
158
+ @keyframes expand-vertical {
159
+ from {
160
+ max-height: 0;
161
+ opacity: 0;
162
+ }
163
+ to {
164
+ max-height: var(--max-height, 1000px);
165
+ opacity: 1;
166
+ }
167
+ }
168
+
169
+ @keyframes collapse-vertical {
170
+ from {
171
+ max-height: var(--max-height, 1000px);
172
+ opacity: 1;
173
+ }
174
+ to {
175
+ max-height: 0;
176
+ opacity: 0;
177
+ }
178
+ }
179
+
180
+ /* Respect prefers-reduced-motion */
181
+ @media (prefers-reduced-motion: reduce) {
182
+ *,
183
+ *::before,
184
+ *::after {
185
+ animation-duration: 0.01ms !important;
186
+ animation-iteration-count: 1 !important;
187
+ transition-duration: 0.01ms !important;
188
+ scroll-behavior: auto !important;
189
+ }
190
+ }
191
191
  `;
192
192
  /**
193
193
  * Utility function to build animation class string