@rovula/ui 0.0.13 → 0.0.14

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 (95) hide show
  1. package/dist/cjs/bundle.css +227 -16
  2. package/dist/cjs/bundle.js +3 -3
  3. package/dist/cjs/bundle.js.map +1 -1
  4. package/dist/cjs/types/components/ActionButton/ActionButton.d.ts +20 -0
  5. package/dist/cjs/types/components/ActionButton/ActionButton.stories.d.ts +311 -0
  6. package/dist/cjs/types/components/ActionButton/ActionButton.styles.d.ts +6 -0
  7. package/dist/cjs/types/components/Avatar/Avatar.d.ts +32 -0
  8. package/dist/cjs/types/components/Avatar/Avatar.stories.d.ts +64 -0
  9. package/dist/cjs/types/components/Avatar/Avatar.styles.d.ts +4 -0
  10. package/dist/cjs/types/components/Avatar/AvatarBase.d.ts +6 -0
  11. package/dist/cjs/types/components/Avatar/AvatarGroup.d.ts +11 -0
  12. package/dist/cjs/types/components/Avatar/AvatarGroup.stories.d.ts +31 -0
  13. package/dist/cjs/types/components/Input/Input.d.ts +21 -4
  14. package/dist/cjs/types/components/Input/Input.stories.d.ts +340 -22
  15. package/dist/cjs/types/components/Input/Input.styles.d.ts +9 -0
  16. package/dist/cjs/types/components/Label/Label.d.ts +6 -1
  17. package/dist/cjs/types/components/Label/Label.stories.d.ts +10 -1
  18. package/dist/cjs/types/components/Label/Label.styles.d.ts +6 -0
  19. package/dist/cjs/types/components/Navbar/Navbar.d.ts +12 -0
  20. package/dist/cjs/types/components/Navbar/Navbar.stories.d.ts +35 -0
  21. package/dist/cjs/types/components/Search/Search.d.ts +2 -0
  22. package/dist/cjs/types/components/Search/Search.stories.d.ts +21 -0
  23. package/dist/cjs/types/components/ThemeToggle.d.ts +2 -0
  24. package/dist/components/ActionButton/ActionButton.js +38 -0
  25. package/dist/components/ActionButton/ActionButton.stories.js +45 -0
  26. package/dist/components/ActionButton/ActionButton.styles.js +71 -0
  27. package/dist/components/Avatar/Avatar.js +22 -0
  28. package/dist/components/Avatar/Avatar.stories.js +47 -0
  29. package/dist/components/Avatar/Avatar.styles.js +23 -0
  30. package/dist/components/Avatar/AvatarBase.js +43 -0
  31. package/dist/components/Avatar/AvatarGroup.js +21 -0
  32. package/dist/components/Avatar/AvatarGroup.stories.js +47 -0
  33. package/dist/components/Button/Button.styles.js +6 -6
  34. package/dist/components/Input/Input.js +5 -4
  35. package/dist/components/Input/Input.stories.js +2 -4
  36. package/dist/components/Input/Input.styles.js +45 -0
  37. package/dist/components/Label/Label.js +7 -3
  38. package/dist/components/Label/Label.styles.js +57 -0
  39. package/dist/components/Navbar/Navbar.js +9 -0
  40. package/dist/components/Navbar/Navbar.stories.js +41 -0
  41. package/dist/components/Search/Search.js +19 -0
  42. package/dist/components/Search/Search.stories.js +36 -0
  43. package/dist/components/Text/Text.js +2 -1
  44. package/dist/components/ThemeToggle.js +17 -0
  45. package/dist/esm/bundle.css +227 -16
  46. package/dist/esm/bundle.js +3 -3
  47. package/dist/esm/bundle.js.map +1 -1
  48. package/dist/esm/types/components/ActionButton/ActionButton.d.ts +20 -0
  49. package/dist/esm/types/components/ActionButton/ActionButton.stories.d.ts +311 -0
  50. package/dist/esm/types/components/ActionButton/ActionButton.styles.d.ts +6 -0
  51. package/dist/esm/types/components/Avatar/Avatar.d.ts +32 -0
  52. package/dist/esm/types/components/Avatar/Avatar.stories.d.ts +64 -0
  53. package/dist/esm/types/components/Avatar/Avatar.styles.d.ts +4 -0
  54. package/dist/esm/types/components/Avatar/AvatarBase.d.ts +6 -0
  55. package/dist/esm/types/components/Avatar/AvatarGroup.d.ts +11 -0
  56. package/dist/esm/types/components/Avatar/AvatarGroup.stories.d.ts +31 -0
  57. package/dist/esm/types/components/Input/Input.d.ts +21 -4
  58. package/dist/esm/types/components/Input/Input.stories.d.ts +340 -22
  59. package/dist/esm/types/components/Input/Input.styles.d.ts +9 -0
  60. package/dist/esm/types/components/Label/Label.d.ts +6 -1
  61. package/dist/esm/types/components/Label/Label.stories.d.ts +10 -1
  62. package/dist/esm/types/components/Label/Label.styles.d.ts +6 -0
  63. package/dist/esm/types/components/Navbar/Navbar.d.ts +12 -0
  64. package/dist/esm/types/components/Navbar/Navbar.stories.d.ts +35 -0
  65. package/dist/esm/types/components/Search/Search.d.ts +2 -0
  66. package/dist/esm/types/components/Search/Search.stories.d.ts +21 -0
  67. package/dist/esm/types/components/ThemeToggle.d.ts +2 -0
  68. package/dist/index.d.ts +22 -10
  69. package/dist/src/theme/global.css +290 -21
  70. package/dist/theme/global.css +11 -0
  71. package/dist/theme/presets/colors.js +28 -0
  72. package/package.json +2 -1
  73. package/src/components/ActionButton/ActionButton.stories.tsx +176 -0
  74. package/src/components/ActionButton/ActionButton.styles.ts +79 -0
  75. package/src/components/ActionButton/ActionButton.tsx +42 -0
  76. package/src/components/Avatar/Avatar.stories.tsx +107 -0
  77. package/src/components/Avatar/Avatar.styles.ts +28 -0
  78. package/src/components/Avatar/Avatar.tsx +88 -0
  79. package/src/components/Avatar/AvatarBase.tsx +50 -0
  80. package/src/components/Avatar/AvatarGroup.stories.tsx +77 -0
  81. package/src/components/Avatar/AvatarGroup.tsx +55 -0
  82. package/src/components/Button/Button.styles.ts +6 -6
  83. package/src/components/Input/Input.stories.tsx +8 -6
  84. package/src/components/Input/Input.styles.tsx +51 -0
  85. package/src/components/Input/Input.tsx +30 -6
  86. package/src/components/Label/Label.styles.ts +61 -0
  87. package/src/components/Label/Label.tsx +13 -7
  88. package/src/components/Navbar/Navbar.stories.tsx +86 -0
  89. package/src/components/Navbar/Navbar.tsx +56 -0
  90. package/src/components/Search/Search.stories.tsx +44 -0
  91. package/src/components/Search/Search.tsx +25 -0
  92. package/src/components/Text/Text.tsx +2 -1
  93. package/src/components/ThemeToggle.tsx +19 -0
  94. package/src/theme/global.css +11 -0
  95. package/src/theme/presets/colors.js +28 -0
@@ -0,0 +1,45 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import ActionButton from "./ActionButton";
14
+ import { ArrowsUpDownIcon } from "@heroicons/react/16/solid";
15
+ var meta = {
16
+ title: "Components/ActionButton",
17
+ component: ActionButton,
18
+ tags: ["autodocs"],
19
+ parameters: {
20
+ layout: "fullscreen",
21
+ },
22
+ decorators: [
23
+ function (Story) { return (_jsx("div", { className: "p-5", children: _jsx(Story, {}) })); },
24
+ ],
25
+ };
26
+ export default meta;
27
+ export var Default = {
28
+ args: {
29
+ variant: "solid",
30
+ size: "lg",
31
+ },
32
+ render: function (args) {
33
+ console.log("args ", args);
34
+ var props = __assign({}, args);
35
+ return (_jsx("div", { className: "flex flex-row justify-between", children: _jsx(ActionButton, __assign({}, props, { children: _jsx(ArrowsUpDownIcon, {}) })) }));
36
+ },
37
+ };
38
+ export var Preview = {
39
+ args: {},
40
+ render: function (args) {
41
+ console.log("args ", args);
42
+ var props = __assign({}, args);
43
+ return (_jsxs("div", { className: "flex flex-col gap-2 w-full bg-black p-20", children: [_jsxs("div", { className: "flex flex-row justify-between items-center", children: [_jsx("h6", { className: "w-[20px] text-white", children: "Default:" }), _jsxs("div", { className: "flex flex-row gap-2 ", children: [_jsx(ActionButton, { variant: "solid", size: "lg", children: _jsx(ArrowsUpDownIcon, {}) }), _jsx(ActionButton, { variant: "solid", size: "md", children: _jsx(ArrowsUpDownIcon, {}) }), _jsx(ActionButton, { variant: "solid", size: "sm", children: _jsx(ArrowsUpDownIcon, {}) })] }), _jsxs("div", { className: "flex flex-row gap-2", children: [_jsx(ActionButton, { variant: "outline", size: "lg", children: _jsx(ArrowsUpDownIcon, {}) }), _jsx(ActionButton, { variant: "outline", size: "md", children: _jsx(ArrowsUpDownIcon, {}) }), _jsx(ActionButton, { variant: "outline", size: "sm", children: _jsx(ArrowsUpDownIcon, {}) })] }), _jsxs("div", { className: "flex flex-row gap-2", children: [_jsx(ActionButton, { variant: "icon", size: "lg", children: _jsx(ArrowsUpDownIcon, {}) }), _jsx(ActionButton, { variant: "icon", size: "md", children: _jsx(ArrowsUpDownIcon, {}) }), _jsx(ActionButton, { variant: "icon", size: "sm", children: _jsx(ArrowsUpDownIcon, {}) }), _jsx(ActionButton, { variant: "icon", size: "xs", children: _jsx(ArrowsUpDownIcon, {}) })] })] }), _jsxs("div", { className: "flex flex-row justify-between", children: [_jsx("h6", { className: "w-[20px] text-white", children: "Active:" }), _jsxs("div", { className: "flex flex-row gap-2", children: [_jsx(ActionButton, { variant: "solid", size: "lg", active: true, children: _jsx(ArrowsUpDownIcon, {}) }), _jsx(ActionButton, { variant: "solid", size: "md", active: true, children: _jsx(ArrowsUpDownIcon, {}) }), _jsx(ActionButton, { variant: "solid", size: "sm", active: true, children: _jsx(ArrowsUpDownIcon, {}) })] }), _jsxs("div", { className: "flex flex-row gap-2", children: [_jsx(ActionButton, { variant: "outline", size: "lg", active: true, children: _jsx(ArrowsUpDownIcon, {}) }), _jsx(ActionButton, { variant: "outline", size: "md", active: true, children: _jsx(ArrowsUpDownIcon, {}) }), _jsx(ActionButton, { variant: "outline", size: "sm", active: true, children: _jsx(ArrowsUpDownIcon, {}) })] }), _jsxs("div", { className: "flex flex-row gap-2", children: [_jsx(ActionButton, { variant: "icon", size: "lg", active: true, children: _jsx(ArrowsUpDownIcon, {}) }), _jsx(ActionButton, { variant: "icon", size: "md", active: true, children: _jsx(ArrowsUpDownIcon, {}) }), _jsx(ActionButton, { variant: "icon", size: "sm", active: true, children: _jsx(ArrowsUpDownIcon, {}) }), _jsx(ActionButton, { variant: "icon", size: "xs", active: true, children: _jsx(ArrowsUpDownIcon, {}) })] })] }), _jsxs("div", { className: "flex flex-row justify-between", children: [_jsx("h6", { className: "w-[20px] text-white", children: "Disabled:" }), _jsxs("div", { className: "flex flex-row gap-2", children: [_jsx(ActionButton, { variant: "solid", size: "lg", disabled: true, children: _jsx(ArrowsUpDownIcon, {}) }), _jsx(ActionButton, { variant: "solid", size: "md", disabled: true, children: _jsx(ArrowsUpDownIcon, {}) }), _jsx(ActionButton, { variant: "solid", size: "sm", disabled: true, children: _jsx(ArrowsUpDownIcon, {}) })] }), _jsxs("div", { className: "flex flex-row gap-2", children: [_jsx(ActionButton, { variant: "outline", size: "lg", disabled: true, children: _jsx(ArrowsUpDownIcon, {}) }), _jsx(ActionButton, { variant: "outline", size: "md", disabled: true, children: _jsx(ArrowsUpDownIcon, {}) }), _jsx(ActionButton, { variant: "outline", size: "sm", disabled: true, children: _jsx(ArrowsUpDownIcon, {}) })] }), _jsxs("div", { className: "flex flex-row gap-2", children: [_jsx(ActionButton, { variant: "icon", size: "lg", disabled: true, children: _jsx(ArrowsUpDownIcon, {}) }), _jsx(ActionButton, { variant: "icon", size: "md", disabled: true, children: _jsx(ArrowsUpDownIcon, {}) }), _jsx(ActionButton, { variant: "icon", size: "sm", disabled: true, children: _jsx(ArrowsUpDownIcon, {}) }), _jsx(ActionButton, { variant: "icon", size: "xs", disabled: true, children: _jsx(ArrowsUpDownIcon, {}) })] })] })] }));
44
+ },
45
+ };
@@ -0,0 +1,71 @@
1
+ import { cva } from "class-variance-authority";
2
+ export var actionButtonVariants = cva(["bg-primary rounded box-border flex items-center justify-center"], {
3
+ variants: {
4
+ variant: {
5
+ solid: " bg-secondary-20 hover:bg-secondary-5 fill-secondary-foreground text-secondary-foreground",
6
+ outline: [
7
+ "bg-transparent border border-main-transparent-secondary-32 fill-secondary-70 text-secondary-70",
8
+ "hover:bg-main-transparent-secondary-8 hover:border-main-secondary-48 hover:fill-secondary-5 hover:text-secondary-5",
9
+ ],
10
+ icon: [
11
+ "rounded-full bg-transparent fill-secondary-70 text-secondary-70",
12
+ "hover:bg-main-transparent-secondary-8 hover:fill-secondary-5 hover:text-secondary-5",
13
+ ],
14
+ },
15
+ size: {
16
+ xs: "p-[2px] w-[18px] h-[18px]",
17
+ sm: "px-2 py-1 w-[38px] h-[30px]",
18
+ md: "px-3 py-2 w-[46px] h-[38px]",
19
+ lg: "px-4 py-3 w-[64px] h-[56px]",
20
+ },
21
+ disabled: {
22
+ true: "pointer-events-none border-grey2-500/[.32] text-grey2-500/[.32] fill-red-500",
23
+ },
24
+ active: {
25
+ false: "",
26
+ },
27
+ },
28
+ compoundVariants: [
29
+ {
30
+ variant: "solid",
31
+ disabled: true,
32
+ className: "bg-grey2-500 text-textcolor-medium fill-textcolor-medium",
33
+ },
34
+ {
35
+ variant: "solid",
36
+ active: true,
37
+ className: "bg-primary-120 hover:bg-primary-100 text-primary-foreground",
38
+ },
39
+ {
40
+ variant: "outline",
41
+ active: true,
42
+ className: "border-main-transparent-primary-48 hover:bg-main-transparent-primary-8 hover:text-primary text-primary",
43
+ },
44
+ {
45
+ variant: "icon",
46
+ active: true,
47
+ className: "border-main-transparent-primary-48 hover:bg-main-transparent-primary-8 hover:text-primary text-primary",
48
+ },
49
+ {
50
+ size: "lg",
51
+ variant: "icon",
52
+ className: "w-[56px] h-[56px]",
53
+ },
54
+ {
55
+ size: "md",
56
+ variant: "icon",
57
+ className: "w-[38px] h-[38px]",
58
+ },
59
+ {
60
+ size: "sm",
61
+ variant: "icon",
62
+ className: "w-[30px] h-[30px]",
63
+ },
64
+ ],
65
+ defaultVariants: {
66
+ size: "md",
67
+ variant: "solid",
68
+ disabled: false,
69
+ active: false,
70
+ },
71
+ });
@@ -0,0 +1,22 @@
1
+ "use client";
2
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { cn } from "@/utils/cn";
4
+ import { AvatarBase, AvatarFallback, AvatarImage } from "./AvatarBase";
5
+ import { avatarVariants } from "./Avatar.styles";
6
+ export var formatAvatarName = function (text) {
7
+ var _a, _b, _c;
8
+ if (!text.length)
9
+ return "-";
10
+ var spitWithSpace = text.split(" ");
11
+ var first = text === null || text === void 0 ? void 0 : text.charAt(0);
12
+ var last = (_c = (_b = (_a = spitWithSpace === null || spitWithSpace === void 0 ? void 0 : spitWithSpace[1]) === null || _a === void 0 ? void 0 : _a.charAt(0)) !== null && _b !== void 0 ? _b : text === null || text === void 0 ? void 0 : text.charAt(1)) !== null && _c !== void 0 ? _c : "";
13
+ return "".concat(first).concat(last);
14
+ };
15
+ var Avatar = function (_a) {
16
+ var text = _a.text, imageUrl = _a.imageUrl, icon = _a.icon, fallback = _a.fallback, size = _a.size, rounded = _a.rounded, className = _a.className, imageClassName = _a.imageClassName, fallbackClassName = _a.fallbackClassName, _b = _a.type, type = _b === void 0 ? "text" : _b, children = _a.children, style = _a.style;
17
+ var avatarClassname = avatarVariants({ size: size, rounded: rounded });
18
+ return (_jsx(AvatarBase, { className: cn(avatarClassname, className), style: style, children: children || (_jsxs(_Fragment, { children: [type === "image" && (_jsxs(_Fragment, { children: [_jsx(AvatarImage, { src: imageUrl, className: cn(imageClassName) }), _jsx(AvatarFallback, { className: cn(fallbackClassName), children: typeof fallback === "string"
19
+ ? formatAvatarName(fallback)
20
+ : fallback })] })), type === "text" && formatAvatarName(text !== null && text !== void 0 ? text : ""), type === "icon" && icon] })) }));
21
+ };
22
+ export default Avatar;
@@ -0,0 +1,47 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import Avatar from "./Avatar";
14
+ var meta = {
15
+ title: "Components/Avatar/Avatar",
16
+ component: Avatar,
17
+ tags: ["autodocs"],
18
+ parameters: {
19
+ layout: "fullscreen",
20
+ },
21
+ decorators: [
22
+ function (Story) { return (_jsx("div", { className: "p-5", children: _jsx(Story, {}) })); },
23
+ ],
24
+ };
25
+ export default meta;
26
+ export var Default = {
27
+ args: {
28
+ imageUrl: "",
29
+ text: "AN",
30
+ size: "lg",
31
+ rounded: "full",
32
+ },
33
+ render: function (args) {
34
+ console.log("args ", args);
35
+ var props = __assign({}, args);
36
+ return (_jsx("div", { className: "flex flex-row justify-between", children: _jsx(Avatar, __assign({}, props)) }));
37
+ },
38
+ };
39
+ export var Preview = {
40
+ args: {},
41
+ render: function (args) {
42
+ console.log("args ", args);
43
+ var props = __assign({}, args);
44
+ var BORDER = ["full", "normal", "none"];
45
+ return (_jsxs("div", { className: "flex flex-col gap-2 w-full bg-black p-20", children: [BORDER.map(function (rounded) { return (_jsxs("div", { className: "flex flex-row items-center gap-3", children: [_jsx(Avatar, { size: "xxs", rounded: rounded, type: "image", imageUrl: "https://i.pravatar.cc/300?img=59", fallback: "AS" }), _jsx(Avatar, { size: "xs", rounded: rounded, type: "image", imageUrl: "https://i.pravatar.cc/300?img=59", fallback: "AS" }), _jsx(Avatar, { size: "sm", rounded: rounded, type: "image", imageUrl: "https://i.pravatar.cc/300?img=59", fallback: "AS" }), _jsx(Avatar, { size: "md", rounded: rounded, type: "image", imageUrl: "https://i.pravatar.cc/300?img=59", fallback: "AS" }), _jsx(Avatar, { size: "lg", rounded: rounded, type: "image", imageUrl: "https://i.pravatar.cc/300?img=59", fallback: "AS" })] }, rounded)); }), BORDER.map(function (rounded) { return (_jsxs("div", { className: "flex flex-row items-center gap-3", children: [_jsx(Avatar, { size: "xxs", rounded: rounded, type: "text", text: "AS" }), _jsx(Avatar, { size: "xs", rounded: rounded, type: "text", text: "AS" }), _jsx(Avatar, { size: "sm", rounded: rounded, type: "text", text: "AS" }), _jsx(Avatar, { size: "md", rounded: rounded, type: "text", text: "AS" }), _jsx(Avatar, { size: "lg", rounded: rounded, type: "text", text: "AS" })] }, rounded)); })] }));
46
+ },
47
+ };
@@ -0,0 +1,23 @@
1
+ import { cva } from "class-variance-authority";
2
+ export var avatarVariants = cva([
3
+ "flex items-center justify-center bg-grey2-700 text-white typography-subtitile2 truncate",
4
+ ], {
5
+ variants: {
6
+ size: {
7
+ xxs: "w-[24px] h-[24px] typography-subtitile3",
8
+ xs: "w-[32px] h-[32px]",
9
+ sm: "w-[40px] h-[40px]",
10
+ md: "w-[48px] h-[48px]",
11
+ lg: "w-[64px] h-[64px]",
12
+ },
13
+ rounded: {
14
+ normal: "rounded",
15
+ full: "rounded-full",
16
+ none: "rounded-none",
17
+ },
18
+ },
19
+ defaultVariants: {
20
+ size: "md",
21
+ rounded: "normal",
22
+ },
23
+ });
@@ -0,0 +1,43 @@
1
+ "use client";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __rest = (this && this.__rest) || function (s, e) {
14
+ var t = {};
15
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
16
+ t[p] = s[p];
17
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
18
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
19
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
20
+ t[p[i]] = s[p[i]];
21
+ }
22
+ return t;
23
+ };
24
+ import { jsx as _jsx } from "react/jsx-runtime";
25
+ import * as React from "react";
26
+ import * as AvatarPrimitive from "@radix-ui/react-avatar";
27
+ import { cn } from "@/utils/cn";
28
+ var AvatarBase = React.forwardRef(function (_a, ref) {
29
+ var className = _a.className, props = __rest(_a, ["className"]);
30
+ return (_jsx(AvatarPrimitive.Root, __assign({ ref: ref, className: cn("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full", className) }, props)));
31
+ });
32
+ AvatarBase.displayName = AvatarPrimitive.Root.displayName;
33
+ var AvatarImage = React.forwardRef(function (_a, ref) {
34
+ var className = _a.className, props = __rest(_a, ["className"]);
35
+ return (_jsx(AvatarPrimitive.Image, __assign({ ref: ref, className: cn("aspect-square h-full w-full", className) }, props)));
36
+ });
37
+ AvatarImage.displayName = AvatarPrimitive.Image.displayName;
38
+ var AvatarFallback = React.forwardRef(function (_a, ref) {
39
+ var className = _a.className, props = __rest(_a, ["className"]);
40
+ return (_jsx(AvatarPrimitive.Fallback, __assign({ ref: ref, className: cn("flex h-full w-full items-center justify-center rounded-full bg-muted", className) }, props)));
41
+ });
42
+ AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName;
43
+ export { AvatarBase, AvatarImage, AvatarFallback };
@@ -0,0 +1,21 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { Children, cloneElement } from "react";
4
+ var AvatarGroup = function (_a) {
5
+ var _b = _a.borderWidth, borderWidth = _b === void 0 ? 2 : _b, _c = _a.borderColor, borderColor = _c === void 0 ? "white" : _c, _d = _a.maxDisplay, maxDisplay = _d === void 0 ? 4 : _d, children = _a.children, remainingText = _a.remainingText, remainingAvatar = _a.remainingAvatar;
6
+ var avatars = Children.toArray(children);
7
+ var displayAvatars = avatars.slice(0, maxDisplay);
8
+ var remainingCount = Math.max(0, avatars.length - maxDisplay);
9
+ var remainingComp = remainingAvatar ||
10
+ cloneElement(displayAvatars[0], {
11
+ style: { borderWidth: borderWidth, borderColor: borderColor },
12
+ className: "relative z-0",
13
+ children: remainingText || "+".concat(remainingCount),
14
+ });
15
+ return (_jsxs("div", { className: "flex items-center -space-x-2", children: [displayAvatars.map(function (avatar, index) {
16
+ return (_jsx("div", { className: "relative", style: { zIndex: avatars.length - index }, children: cloneElement(avatar, {
17
+ style: { borderWidth: borderWidth, borderColor: borderColor },
18
+ }) }, index));
19
+ }), remainingCount > 0 && remainingComp] }));
20
+ };
21
+ export default AvatarGroup;
@@ -0,0 +1,47 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import AvatarGroup from "./AvatarGroup";
14
+ import Avatar from "./Avatar";
15
+ var meta = {
16
+ title: "Components/Avatar/AvatarGroup",
17
+ component: AvatarGroup,
18
+ tags: ["autodocs"],
19
+ parameters: {
20
+ layout: "fullscreen",
21
+ },
22
+ decorators: [
23
+ function (Story) { return (_jsx("div", { className: "p-5", children: _jsx(Story, {}) })); },
24
+ ],
25
+ };
26
+ export default meta;
27
+ export var Default = {
28
+ args: {
29
+ imageUrl: "",
30
+ text: "AN",
31
+ size: "lg",
32
+ rounded: "full",
33
+ },
34
+ render: function (args) {
35
+ console.log("args ", args);
36
+ var props = __assign({}, args);
37
+ return (_jsx("div", { className: "flex flex-row justify-between", children: _jsxs(AvatarGroup, __assign({}, props, { children: [_jsx(Avatar, { size: "lg", rounded: "full", type: "text", text: "AS" }), _jsx(Avatar, { size: "lg", rounded: "full", type: "text", text: "AS" }), _jsx(Avatar, { size: "lg", rounded: "full", type: "text", text: "AS" })] })) }));
38
+ },
39
+ };
40
+ export var Preview = {
41
+ args: {},
42
+ render: function (args) {
43
+ console.log("args ", args);
44
+ var props = __assign({}, args);
45
+ return (_jsx("div", { className: "flex flex-col gap-2 w-full bg-black p-20", children: _jsx("div", { className: "flex flex-row items-center gap-3", children: _jsxs(AvatarGroup, { children: [_jsx(Avatar, { size: "lg", rounded: "full", type: "text", text: "AS" }), _jsx(Avatar, { size: "lg", rounded: "full", type: "text", text: "AS" }), _jsx(Avatar, { size: "lg", rounded: "full", type: "image", imageUrl: "https://i.pravatar.cc/300?img=59", fallback: "AS" }), _jsx(Avatar, { size: "lg", rounded: "full", type: "text", text: "AS" }), _jsx(Avatar, { size: "lg", rounded: "full", type: "text", text: "AS" })] }) }) }));
46
+ },
47
+ };
@@ -49,12 +49,12 @@ export var buttonVariants = cva([
49
49
  color: "secondary",
50
50
  class: "text-secondary-foreground",
51
51
  },
52
- {
53
- variant: "solid",
54
- disabled: true,
55
- color: "secondary",
56
- class: "text-white",
57
- },
52
+ // {
53
+ // variant: "solid",
54
+ // disabled: true,
55
+ // color: "secondary",
56
+ // class: "text-white",
57
+ // },
58
58
  {
59
59
  variant: "solid",
60
60
  color: "tertiary",
@@ -21,11 +21,12 @@ var __rest = (this && this.__rest) || function (s, e) {
21
21
  return t;
22
22
  };
23
23
  import { jsx as _jsx } from "react/jsx-runtime";
24
- import * as React from "react";
24
+ import { forwardRef } from "react";
25
25
  import { cn } from "@/utils/cn";
26
- var Input = React.forwardRef(function (_a, ref) {
27
- var className = _a.className, type = _a.type, props = __rest(_a, ["className", "type"]);
28
- return (_jsx("input", __assign({ type: type, className: cn("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50", className), ref: ref }, props)));
26
+ import { inputVariants } from "./Input.styles";
27
+ var Input = forwardRef(function (_a, ref) {
28
+ var className = _a.className, _b = _a.type, type = _b === void 0 ? "text" : _b, _c = _a.size, size = _c === void 0 ? "md" : _c, _d = _a.variant, variant = _d === void 0 ? "outline" : _d, _e = _a.fullwidth, fullwidth = _e === void 0 ? false : _e, _f = _a.disabled, disabled = _f === void 0 ? false : _f, _g = _a.error, error = _g === void 0 ? false : _g, _h = _a.required, required = _h === void 0 ? false : _h, _j = _a.hiddenPlaceholder, hiddenPlaceholder = _j === void 0 ? false : _j, props = __rest(_a, ["className", "type", "size", "variant", "fullwidth", "disabled", "error", "required", "hiddenPlaceholder"]);
29
+ return (_jsx("input", __assign({ type: type, className: cn(inputVariants({ size: size, variant: variant, fullwidth: fullwidth, error: error, hiddenPlaceholder: hiddenPlaceholder }), className), ref: ref, disabled: disabled }, props)));
29
30
  });
30
31
  Input.displayName = "Input";
31
32
  export { Input };
@@ -9,7 +9,7 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
- import { jsx as _jsx } from "react/jsx-runtime";
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import { Input } from "./Input";
14
14
  var meta = {
15
15
  title: "Components/Input",
@@ -25,13 +25,11 @@ var meta = {
25
25
  export default meta;
26
26
  export var Default = {
27
27
  args: {
28
- // label: "Lorem Ipsum",
29
- // value: "Lorem Ipsum",
30
28
  // fullwidth: true,
31
29
  },
32
30
  render: function (args) {
33
31
  console.log("args ", args);
34
32
  var props = __assign({}, args);
35
- return (_jsx("div", { className: "flex flex-row gap-4 w-full", children: _jsx(Input, { type: "email", placeholder: "Email" }) }));
33
+ return (_jsxs("div", { className: "flex flex-row gap-4", children: [_jsx(Input, __assign({ id: "1", size: "lg", placeholder: "Email" }, args)), _jsx(Input, __assign({ id: "2", size: "md", placeholder: "Email" }, args)), _jsx(Input, __assign({ id: "3", size: "sm", placeholder: "Email" }, args))] }));
36
34
  },
37
35
  };
@@ -0,0 +1,45 @@
1
+ import { cva } from "class-variance-authority";
2
+ export var inputVariants = cva([
3
+ "border-0 outline-none",
4
+ "p-1 flex w-auto h-fit box-border",
5
+ "peer text-black",
6
+ ], {
7
+ variants: {
8
+ size: {
9
+ sm: "p-2 px-3 typography-small1",
10
+ md: "py-2 px-3 typography-subtitile4",
11
+ lg: "p-4 typography-subtitile1",
12
+ },
13
+ rounded: {
14
+ none: "rounded-none",
15
+ normal: "rounded-xl",
16
+ full: "rounded-full",
17
+ },
18
+ variant: {
19
+ flat: "",
20
+ outline: "ring-1 ring-inset ring-input-stroke hover:ring-input-active focus:ring-1 focus:ring-inset focus:ring-input-stroke-active",
21
+ underline: "border-b-2 border-input-stroke transition-colors hover:border-input-stroke-active focus:border-input-stroke",
22
+ },
23
+ hiddenPlaceholder: {
24
+ true: "placeholder:text-transparent",
25
+ },
26
+ fullwidth: {
27
+ true: "w-full",
28
+ },
29
+ disabled: {
30
+ true: "text-input-text-disabled ring-input-stroke-disabled placeholder:text-input-text-disabled",
31
+ },
32
+ error: {
33
+ true: "ring-error focus:ring-error",
34
+ },
35
+ },
36
+ defaultVariants: {
37
+ size: "md",
38
+ variant: "outline",
39
+ rounded: "normal",
40
+ fullwidth: false,
41
+ disabled: false,
42
+ error: false,
43
+ hiddenPlaceholder: true,
44
+ },
45
+ });
@@ -24,12 +24,16 @@ var __rest = (this && this.__rest) || function (s, e) {
24
24
  import { jsx as _jsx } from "react/jsx-runtime";
25
25
  import * as React from "react";
26
26
  import * as LabelPrimitive from "@radix-ui/react-label";
27
- import { cva } from "class-variance-authority";
28
27
  import { cn } from "@/utils/cn";
29
- var labelVariants = cva("typography-label1 peer-disabled:cursor-not-allowed peer-disabled:opacity-70");
28
+ import { labelVariant } from "./Label.styles";
30
29
  var Label = React.forwardRef(function (_a, ref) {
31
30
  var className = _a.className, props = __rest(_a, ["className"]);
32
- return (_jsx(LabelPrimitive.Root, __assign({ ref: ref, className: cn(labelVariants(), className) }, props)));
31
+ return (_jsx(LabelPrimitive.Root, __assign({ ref: ref, className: cn(labelVariant({
32
+ size: props.size,
33
+ disabled: props.disabled,
34
+ error: props.error,
35
+ isFloatable: props.isFloatable,
36
+ }), className) }, props)));
33
37
  });
34
38
  Label.displayName = LabelPrimitive.Root.displayName;
35
39
  export { Label };
@@ -0,0 +1,57 @@
1
+ import { cva } from "class-variance-authority";
2
+ export var labelVariant = cva([
3
+ "block duration-450 transition-all px-[2px] text-input-text peer-focus:text-input-text-active",
4
+ ], {
5
+ variants: {
6
+ size: {
7
+ sm: "typography-small1",
8
+ md: "typography-subtitile4",
9
+ lg: "typography-subtitile1",
10
+ },
11
+ disabled: {
12
+ true: "text-input-text-disabled ring-input-stroke-disabled placeholder:text-input-text-disabled peer-disabled:cursor-not-allowed",
13
+ },
14
+ error: {
15
+ true: "ring-error",
16
+ },
17
+ isFloatable: {
18
+ true: "absolute peer-focus:text-input-text-active peer-focus:bg-input-label-background",
19
+ false: "",
20
+ },
21
+ },
22
+ compoundVariants: [
23
+ {
24
+ size: "sm",
25
+ isFloatable: true,
26
+ className: [
27
+ "left-3 -top-1.5 typography-label2 bg-input-label-background",
28
+ "peer-placeholder-shown:top-2 peer-placeholder-shown:typography-small1 peer-placeholder-shown:bg-transparent",
29
+ "peer-focus:-top-1.5 peer-focus:typography-label2",
30
+ ],
31
+ },
32
+ {
33
+ size: "md",
34
+ isFloatable: true,
35
+ className: [
36
+ "left-3 -top-1.5 typography-label1 bg-input-label-background",
37
+ "peer-placeholder-shown:top-2 peer-placeholder-shown:typography-subtitile4 peer-placeholder-shown:bg-transparent",
38
+ "peer-focus:-top-1.5 peer-focus:typography-label1",
39
+ ],
40
+ },
41
+ {
42
+ size: "lg",
43
+ isFloatable: true,
44
+ className: [
45
+ "left-4 -top-1.5 typography-label1 bg-input-label-background",
46
+ "peer-placeholder-shown:top-4 peer-placeholder-shown:typography-subtitile1 peer-placeholder-shown:bg-transparent",
47
+ "peer-focus:-top-1.5 peer-focus:typography-label1",
48
+ ],
49
+ },
50
+ ],
51
+ defaultVariants: {
52
+ size: "md",
53
+ disabled: false,
54
+ error: false,
55
+ isFloatable: false,
56
+ },
57
+ });
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { cn } from "@/utils/cn";
3
+ var Navbar = function (_a) {
4
+ var children = _a.children, className = _a.className, center = _a.center, leftNav = _a.leftNav, rightNav = _a.rightNav, position = _a.position, _b = _a.container, container = _b === void 0 ? false : _b;
5
+ return (_jsx("header", { className: cn("w-full px-4 py-6 h-[var(--navbar-height)] box-border overflow-hidden typography-subtitile2 border-solid border-b-2 bg-[rgb(var(--navbar-bg-color))] text-[rgb(var(--navbar-text-color))] border-b-[rgb(var(--navbar-border-color))]", { position: position }, className), children: _jsx("div", { className: cn("mx-auto flex h-full justify-between items-center", {
6
+ container: container,
7
+ }), children: children || (_jsxs(_Fragment, { children: [_jsx("nav", { className: "flex w-1/2 gap-x-[var(--navbar-gap)] text-xl", children: leftNav }), _jsx("div", { className: "flex flex-shrink-0 flex-wrap justify-center", children: center }), _jsx("nav", { className: "flex w-1/2 justify-end gap-x-[var(--navbar-gap)] text-xl", children: rightNav })] })) }) }));
8
+ };
9
+ export default Navbar;
@@ -0,0 +1,41 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
13
+ import Navbar from "./Navbar";
14
+ var meta = {
15
+ title: "Components/Navbar",
16
+ component: Navbar,
17
+ tags: ["autodocs"],
18
+ parameters: {
19
+ layout: "fullscreen",
20
+ },
21
+ decorators: [
22
+ function (Story) { return (_jsx("div", { className: "p-5 w-full h-screen", children: _jsx(Story, {}) })); },
23
+ ],
24
+ };
25
+ export default meta;
26
+ export var Default = {
27
+ args: {},
28
+ render: function (args) {
29
+ console.log("args ", args);
30
+ var props = __assign({}, args);
31
+ return (_jsx("div", { className: "flex flex-row gap-4 w-full", children: _jsx(Navbar, { leftNav: _jsxs("ul", { className: "flex gap-2", children: [_jsx("li", { children: "link 1" }), _jsx("li", { children: "link 2" }), _jsx("li", { children: "link 3" })] }), center: _jsx(_Fragment, { children: "Center text" }), rightNav: _jsxs("ul", { className: "flex gap-2", children: [_jsx("li", { children: "sss 1" }), _jsx("li", { children: "ddd 2" }), _jsx("li", { children: "vvvv 3" })] }) }) }));
32
+ },
33
+ };
34
+ export var Custom = {
35
+ args: {},
36
+ render: function (args) {
37
+ console.log("args ", args);
38
+ var props = __assign({}, args);
39
+ return (_jsx("div", { className: "flex flex-row gap-4 w-full", children: _jsx(Navbar, { className: "px-8", leftNav: _jsxs("ul", { className: "flex gap-2", children: [_jsx("li", { children: "link 1" }), _jsx("li", { children: "link 2" }), _jsx("li", { children: "link 3" })] }), center: _jsx(_Fragment, { children: "Center text" }), rightNav: _jsxs("ul", { className: "flex gap-2", children: [_jsx("li", { children: "sss 1" }), _jsx("li", { children: "ddd 2" }), _jsx("li", { children: "vvvv 3" })] }) }) }));
40
+ },
41
+ };
@@ -0,0 +1,19 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import { Input } from "../Input/Input";
14
+ import { Label } from "../Label/Label";
15
+ function Search(props) {
16
+ var _a;
17
+ return (_jsxs("div", { className: " relative", children: [_jsx(Input, __assign({}, props, { hiddenPlaceholder: true })), _jsx(Label, { htmlFor: props.id, size: props.size, disabled: props.disabled, error: props.error, className: (_a = props.labelClassname) !== null && _a !== void 0 ? _a : "", isFloatable: true, children: "Search" })] }));
18
+ }
19
+ export { Search };
@@ -0,0 +1,36 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import { Search } from "./Search";
14
+ var meta = {
15
+ title: "Components/Search",
16
+ component: Search,
17
+ tags: ["autodocs"],
18
+ parameters: {
19
+ layout: "fullscreen",
20
+ },
21
+ decorators: [
22
+ function (Story) { return (_jsx("div", { className: "p-5 flex w-full", children: _jsx(Story, {}) })); },
23
+ ],
24
+ };
25
+ export default meta;
26
+ export var Default = {
27
+ args: {
28
+ error: false,
29
+ // fullwidth: true,
30
+ },
31
+ render: function (args) {
32
+ console.log("args ", args);
33
+ var props = __assign({}, args);
34
+ return (_jsxs("div", { className: "flex flex-row gap-4", children: [_jsx(Search, __assign({ id: "1", size: "lg", placeholder: "Search" }, args)), _jsx(Search, __assign({ id: "2", size: "md", placeholder: "Search" }, args)), _jsx(Search, __assign({ id: "3", size: "sm", placeholder: "Search" }, args))] }));
35
+ },
36
+ };