@rovula/ui 0.0.8 → 0.0.10

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 (129) hide show
  1. package/dist/cjs/bundle.css +497 -4
  2. package/dist/cjs/bundle.js +1 -1
  3. package/dist/cjs/bundle.js.map +1 -1
  4. package/dist/cjs/types/components/AlertDialog/Alert.stories.d.ts +20 -0
  5. package/dist/cjs/types/components/AlertDialog/AlertDialog.d.ts +20 -0
  6. package/dist/cjs/types/components/Button/Button.styles.d.ts +1 -1
  7. package/dist/cjs/types/components/Checkbox/Checkbox.d.ts +4 -0
  8. package/dist/cjs/types/components/Checkbox/Checkbox.stories.d.ts +308 -0
  9. package/dist/cjs/types/components/Dialog/Dialog.d.ts +19 -0
  10. package/dist/cjs/types/components/Dialog/Dialog.stories.d.ts +25 -0
  11. package/dist/cjs/types/components/Dropdown/Dropdown.d.ts +26 -0
  12. package/dist/cjs/types/components/Dropdown/Dropdown.stories.d.ts +367 -0
  13. package/dist/cjs/types/components/Dropdown/Dropdown.styles.d.ts +11 -0
  14. package/dist/cjs/types/components/Input/Input.d.ts +5 -0
  15. package/dist/cjs/types/components/Input/Input.stories.d.ts +314 -0
  16. package/dist/cjs/types/components/Label/Label.d.ts +5 -0
  17. package/dist/cjs/types/components/Label/Label.stories.d.ts +286 -0
  18. package/dist/cjs/types/components/RadioGroup/RadioGroup.d.ts +5 -0
  19. package/dist/cjs/types/components/RadioGroup/RadioGroup.stories.d.ts +299 -0
  20. package/dist/cjs/types/components/Table/Datagrid.d.ts +11 -0
  21. package/dist/cjs/types/components/Table/Table.d.ts +10 -11
  22. package/dist/cjs/types/components/Table/Table.stories.d.ts +283 -0
  23. package/dist/cjs/types/components/Tabs/Tabs.d.ts +7 -5
  24. package/dist/cjs/types/components/Tabs/Tabs.stories.d.ts +49 -0
  25. package/dist/cjs/types/components/TextInput/TextInput.d.ts +3 -2
  26. package/dist/cjs/types/components/TextInput/TextInput.stories.d.ts +2 -16
  27. package/dist/cjs/types/index.d.ts +8 -2
  28. package/dist/cjs/types/utils/cn.d.ts +2 -0
  29. package/dist/components/AlertDialog/Alert.stories.js +39 -0
  30. package/dist/components/AlertDialog/AlertDialog.js +73 -0
  31. package/dist/components/Button/Button.js +3 -3
  32. package/dist/components/Button/Button.styles.js +1 -1
  33. package/dist/components/Checkbox/Checkbox.js +37 -0
  34. package/dist/components/Checkbox/Checkbox.stories.js +49 -0
  35. package/dist/components/Dialog/Dialog.js +63 -0
  36. package/dist/components/Dialog/Dialog.stories.js +52 -0
  37. package/dist/components/Dropdown/Dropdown.js +58 -0
  38. package/dist/components/{Select/Select.stories.js → Dropdown/Dropdown.stories.js} +8 -11
  39. package/dist/components/Dropdown/Dropdown.styles.js +47 -0
  40. package/dist/components/Input/Input.js +31 -0
  41. package/dist/components/Input/Input.stories.js +37 -0
  42. package/dist/components/Label/Label.js +35 -0
  43. package/dist/components/Label/Label.stories.js +38 -0
  44. package/dist/components/RadioGroup/RadioGroup.js +41 -0
  45. package/dist/components/RadioGroup/RadioGroup.stories.js +44 -0
  46. package/dist/components/Table/Datagrid.js +6 -0
  47. package/dist/components/Table/Table.js +65 -5
  48. package/dist/components/Table/Table.stories.js +32 -0
  49. package/dist/components/Tabs/Tabs.js +10 -4
  50. package/dist/components/Tabs/Tabs.stories.js +60 -0
  51. package/dist/components/TextInput/TextInput.js +3 -3
  52. package/dist/esm/bundle.css +497 -4
  53. package/dist/esm/bundle.js +1 -1
  54. package/dist/esm/bundle.js.map +1 -1
  55. package/dist/esm/types/components/AlertDialog/Alert.stories.d.ts +20 -0
  56. package/dist/esm/types/components/AlertDialog/AlertDialog.d.ts +20 -0
  57. package/dist/esm/types/components/Button/Button.styles.d.ts +1 -1
  58. package/dist/esm/types/components/Checkbox/Checkbox.d.ts +4 -0
  59. package/dist/esm/types/components/Checkbox/Checkbox.stories.d.ts +308 -0
  60. package/dist/esm/types/components/Dialog/Dialog.d.ts +19 -0
  61. package/dist/esm/types/components/Dialog/Dialog.stories.d.ts +25 -0
  62. package/dist/esm/types/components/Dropdown/Dropdown.d.ts +26 -0
  63. package/dist/esm/types/components/Dropdown/Dropdown.stories.d.ts +367 -0
  64. package/dist/esm/types/components/Dropdown/Dropdown.styles.d.ts +11 -0
  65. package/dist/esm/types/components/Input/Input.d.ts +5 -0
  66. package/dist/esm/types/components/Input/Input.stories.d.ts +314 -0
  67. package/dist/esm/types/components/Label/Label.d.ts +5 -0
  68. package/dist/esm/types/components/Label/Label.stories.d.ts +286 -0
  69. package/dist/esm/types/components/RadioGroup/RadioGroup.d.ts +5 -0
  70. package/dist/esm/types/components/RadioGroup/RadioGroup.stories.d.ts +299 -0
  71. package/dist/esm/types/components/Table/Datagrid.d.ts +11 -0
  72. package/dist/esm/types/components/Table/Table.d.ts +10 -11
  73. package/dist/esm/types/components/Table/Table.stories.d.ts +283 -0
  74. package/dist/esm/types/components/Tabs/Tabs.d.ts +7 -5
  75. package/dist/esm/types/components/Tabs/Tabs.stories.d.ts +49 -0
  76. package/dist/esm/types/components/TextInput/TextInput.d.ts +3 -2
  77. package/dist/esm/types/components/TextInput/TextInput.stories.d.ts +2 -16
  78. package/dist/esm/types/index.d.ts +8 -2
  79. package/dist/esm/types/utils/cn.d.ts +2 -0
  80. package/dist/index.d.ts +88 -30
  81. package/dist/index.js +8 -2
  82. package/dist/src/theme/global.css +598 -4
  83. package/dist/theme/global.css +57 -0
  84. package/dist/theme/main-preset.js +29 -1
  85. package/dist/theme/presets/colors.js +19 -0
  86. package/dist/utils/cn.js +9 -0
  87. package/package.json +9 -1
  88. package/src/components/AlertDialog/Alert.stories.tsx +67 -0
  89. package/src/components/AlertDialog/AlertDialog.tsx +142 -0
  90. package/src/components/Button/Button.styles.ts +1 -1
  91. package/src/components/Button/Button.tsx +4 -4
  92. package/src/components/Checkbox/Checkbox.stories.tsx +91 -0
  93. package/src/components/Checkbox/Checkbox.tsx +36 -0
  94. package/src/components/Dialog/Dialog.stories.tsx +118 -0
  95. package/src/components/Dialog/Dialog.tsx +119 -0
  96. package/src/components/{Select/Select.stories.tsx → Dropdown/Dropdown.stories.tsx} +11 -14
  97. package/src/components/Dropdown/Dropdown.styles.ts +54 -0
  98. package/src/components/Dropdown/Dropdown.tsx +151 -0
  99. package/src/components/Input/Input.stories.tsx +40 -0
  100. package/src/components/Input/Input.tsx +25 -0
  101. package/src/components/Label/Label.stories.tsx +45 -0
  102. package/src/components/Label/Label.tsx +26 -0
  103. package/src/components/RadioGroup/RadioGroup.stories.tsx +71 -0
  104. package/src/components/RadioGroup/RadioGroup.tsx +59 -0
  105. package/src/components/Table/Datagrid.tsx +36 -0
  106. package/src/components/Table/Table.stories.tsx +79 -0
  107. package/src/components/Table/Table.tsx +116 -35
  108. package/src/components/Tabs/Tabs.stories.tsx +75 -0
  109. package/src/components/Tabs/Tabs.tsx +39 -10
  110. package/src/components/TextInput/TextInput.tsx +11 -2
  111. package/src/index.ts +9 -2
  112. package/src/theme/global.css +57 -0
  113. package/src/theme/main-preset.js +29 -1
  114. package/src/theme/presets/colors.js +19 -0
  115. package/src/utils/cn.ts +6 -0
  116. package/dist/cjs/types/components/Select/Select copy.d.ts +0 -23
  117. package/dist/cjs/types/components/Select/Select.d.ts +0 -23
  118. package/dist/cjs/types/components/Select/Select.stories.d.ts +0 -348
  119. package/dist/cjs/types/components/Select/Select.styles.d.ts +0 -14
  120. package/dist/components/Select/Select copy.js +0 -42
  121. package/dist/components/Select/Select.js +0 -21
  122. package/dist/components/Select/Select.styles.js +0 -100
  123. package/dist/esm/types/components/Select/Select copy.d.ts +0 -23
  124. package/dist/esm/types/components/Select/Select.d.ts +0 -23
  125. package/dist/esm/types/components/Select/Select.stories.d.ts +0 -348
  126. package/dist/esm/types/components/Select/Select.styles.d.ts +0 -14
  127. package/src/components/Select/Select copy.tsx +0 -103
  128. package/src/components/Select/Select.styles.ts +0 -111
  129. package/src/components/Select/Select.tsx +0 -54
@@ -0,0 +1,79 @@
1
+ import React from "react";
2
+ import type { Meta, StoryObj } from "@storybook/react";
3
+ import {
4
+ Table,
5
+ TableBody,
6
+ TableCaption,
7
+ TableCell,
8
+ TableHead,
9
+ TableHeader,
10
+ TableRow,
11
+ } from "./Table";
12
+
13
+ const meta = {
14
+ title: "Components/Table",
15
+ component: Table,
16
+ tags: ["autodocs"],
17
+ parameters: {
18
+ layout: "fullscreen",
19
+ },
20
+ decorators: [
21
+ (Story) => (
22
+ <div className="p-5 flex w-full">
23
+ <Story />
24
+ </div>
25
+ ),
26
+ ],
27
+ } satisfies Meta<typeof Table>;
28
+
29
+ export default meta;
30
+
31
+ export const Default = {
32
+ args: {},
33
+ render: (args) => {
34
+ const props: typeof args = {
35
+ ...args,
36
+ };
37
+ return (
38
+ <div className="flex flex-row gap-4 w-full">
39
+ <Table>
40
+ <TableCaption>A list of your recent invoices.</TableCaption>
41
+ <TableHeader>
42
+ <TableRow>
43
+ <TableHead className="w-[100px]">Invoice</TableHead>
44
+ <TableHead>Status</TableHead>
45
+ <TableHead>Method</TableHead>
46
+ <TableHead className="text-right">Amount</TableHead>
47
+ </TableRow>
48
+ </TableHeader>
49
+ <TableBody>
50
+ <TableRow>
51
+ <TableCell className="font-medium">INV001</TableCell>
52
+ <TableCell>Paid</TableCell>
53
+ <TableCell>Credit Card</TableCell>
54
+ <TableCell className="text-right">$250.00</TableCell>
55
+ </TableRow>
56
+ <TableRow>
57
+ <TableCell className="font-medium">INV001</TableCell>
58
+ <TableCell>Paid</TableCell>
59
+ <TableCell>Credit Card</TableCell>
60
+ <TableCell className="text-right">$250.00</TableCell>
61
+ </TableRow>
62
+ <TableRow>
63
+ <TableCell className="font-medium">INV001</TableCell>
64
+ <TableCell>Paid</TableCell>
65
+ <TableCell>Credit Card</TableCell>
66
+ <TableCell className="text-right">$250.00</TableCell>
67
+ </TableRow>
68
+ <TableRow>
69
+ <TableCell className="font-medium">INV001</TableCell>
70
+ <TableCell>Paid</TableCell>
71
+ <TableCell>Credit Card</TableCell>
72
+ <TableCell className="text-right">$250.00</TableCell>
73
+ </TableRow>
74
+ </TableBody>
75
+ </Table>
76
+ </div>
77
+ );
78
+ },
79
+ } satisfies StoryObj;
@@ -1,36 +1,117 @@
1
- import React from "react";
2
-
3
- interface Column {
4
- header: string;
5
- accessor: string;
6
- }
7
-
8
- interface TableProps {
9
- columns: Column[];
10
- data: Record<string, any>[];
11
- }
12
-
13
- const Table: React.FC<TableProps> = ({ columns, data }) => {
14
- return (
15
- <table className="table">
16
- <thead>
17
- <tr>
18
- {columns.map((column, index) => (
19
- <th key={index}>{column.header}</th>
20
- ))}
21
- </tr>
22
- </thead>
23
- <tbody>
24
- {data.map((row, rowIndex) => (
25
- <tr key={rowIndex}>
26
- {columns.map((column, colIndex) => (
27
- <td key={colIndex}>{row[column.accessor]}</td>
28
- ))}
29
- </tr>
30
- ))}
31
- </tbody>
32
- </table>
33
- );
34
- };
1
+ import * as React from "react";
2
+
3
+ import { cn } from "@/utils/cn";
4
+
5
+ const Table = React.forwardRef<
6
+ HTMLTableElement,
7
+ React.HTMLAttributes<HTMLTableElement>
8
+ >(({ className, ...props }, ref) => (
9
+ <div className="relative w-full overflow-auto">
10
+ <table
11
+ ref={ref}
12
+ className={cn("w-full caption-bottom text-sm", className)}
13
+ {...props}
14
+ />
15
+ </div>
16
+ ));
17
+ Table.displayName = "Table";
18
+
19
+ const TableHeader = React.forwardRef<
20
+ HTMLTableSectionElement,
21
+ React.HTMLAttributes<HTMLTableSectionElement>
22
+ >(({ className, ...props }, ref) => (
23
+ <thead ref={ref} className={cn("[&_tr]:border-b", className)} {...props} />
24
+ ));
25
+ TableHeader.displayName = "TableHeader";
26
+
27
+ const TableBody = React.forwardRef<
28
+ HTMLTableSectionElement,
29
+ React.HTMLAttributes<HTMLTableSectionElement>
30
+ >(({ className, ...props }, ref) => (
31
+ <tbody
32
+ ref={ref}
33
+ className={cn("[&_tr:last-child]:border-0", className)}
34
+ {...props}
35
+ />
36
+ ));
37
+ TableBody.displayName = "TableBody";
38
+
39
+ const TableFooter = React.forwardRef<
40
+ HTMLTableSectionElement,
41
+ React.HTMLAttributes<HTMLTableSectionElement>
42
+ >(({ className, ...props }, ref) => (
43
+ <tfoot
44
+ ref={ref}
45
+ className={cn(
46
+ "border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",
47
+ className
48
+ )}
49
+ {...props}
50
+ />
51
+ ));
52
+ TableFooter.displayName = "TableFooter";
35
53
 
36
- export default Table;
54
+ const TableRow = React.forwardRef<
55
+ HTMLTableRowElement,
56
+ React.HTMLAttributes<HTMLTableRowElement>
57
+ >(({ className, ...props }, ref) => (
58
+ <tr
59
+ ref={ref}
60
+ className={cn(
61
+ "border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",
62
+ className
63
+ )}
64
+ {...props}
65
+ />
66
+ ));
67
+ TableRow.displayName = "TableRow";
68
+
69
+ const TableHead = React.forwardRef<
70
+ HTMLTableCellElement,
71
+ React.ThHTMLAttributes<HTMLTableCellElement>
72
+ >(({ className, ...props }, ref) => (
73
+ <th
74
+ ref={ref}
75
+ className={cn(
76
+ "h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",
77
+ className
78
+ )}
79
+ {...props}
80
+ />
81
+ ));
82
+ TableHead.displayName = "TableHead";
83
+
84
+ const TableCell = React.forwardRef<
85
+ HTMLTableCellElement,
86
+ React.TdHTMLAttributes<HTMLTableCellElement>
87
+ >(({ className, ...props }, ref) => (
88
+ <td
89
+ ref={ref}
90
+ className={cn("p-4 align-middle [&:has([role=checkbox])]:pr-0", className)}
91
+ {...props}
92
+ />
93
+ ));
94
+ TableCell.displayName = "TableCell";
95
+
96
+ const TableCaption = React.forwardRef<
97
+ HTMLTableCaptionElement,
98
+ React.HTMLAttributes<HTMLTableCaptionElement>
99
+ >(({ className, ...props }, ref) => (
100
+ <caption
101
+ ref={ref}
102
+ className={cn("mt-4 text-sm text-muted-foreground", className)}
103
+ {...props}
104
+ />
105
+ ));
106
+ TableCaption.displayName = "TableCaption";
107
+
108
+ export {
109
+ Table,
110
+ TableHeader,
111
+ TableBody,
112
+ TableFooter,
113
+ TableHead,
114
+ TableRow,
115
+ TableCell,
116
+ TableCaption,
117
+ };
@@ -0,0 +1,75 @@
1
+ import React from "react";
2
+ import type { Meta, StoryObj } from "@storybook/react";
3
+ import Tabs from "./Tabs";
4
+ import { ChevronDownIcon, ArchiveBoxIcon } from "@heroicons/react/16/solid";
5
+
6
+ const meta = {
7
+ title: "Components/Tabs",
8
+ component: Tabs,
9
+ tags: ["autodocs"],
10
+ parameters: {
11
+ layout: "fullscreen",
12
+ },
13
+ decorators: [
14
+ (Story) => (
15
+ <div className="p-5 flex w-full">
16
+ <Story />
17
+ </div>
18
+ ),
19
+ ],
20
+ } satisfies Meta<typeof Tabs>;
21
+
22
+ export default meta;
23
+
24
+ const tabs = [
25
+ {
26
+ label: "Tab1",
27
+ content: <p>Tab 1 content</p>,
28
+ },
29
+ {
30
+ label: "Tab2",
31
+ content: <p>Tab 2 content</p>,
32
+ },
33
+ {
34
+ label: "Tab3",
35
+ content: <p>Tab 3 content</p>,
36
+ },
37
+ ];
38
+
39
+ export const Default = {
40
+ args: {
41
+ initialTab: 0,
42
+ tabs,
43
+ },
44
+ render: (args) => {
45
+ const props: typeof args = {
46
+ ...args,
47
+ };
48
+ return (
49
+ <div className="flex flex-row gap-4 w-full">
50
+ <Tabs tabs={tabs} {...props} />
51
+ </div>
52
+ );
53
+ },
54
+ } satisfies StoryObj;
55
+
56
+ export const CustomTab = {
57
+ args: {
58
+ initialTab: 0,
59
+ tabs: tabs.map((tab) => ({
60
+ ...tab,
61
+ startTabContent: <ArchiveBoxIcon className="size-3 " />,
62
+ endTabContent: <ChevronDownIcon className="size-3" />,
63
+ })),
64
+ },
65
+ render: (args) => {
66
+ const props: typeof args = {
67
+ ...args,
68
+ };
69
+ return (
70
+ <div className="flex flex-row gap-4 w-full">
71
+ <Tabs tabs={tabs} {...props} />
72
+ </div>
73
+ );
74
+ },
75
+ } satisfies StoryObj;
@@ -1,32 +1,61 @@
1
- import React, { useState } from "react";
1
+ "use client";
2
2
 
3
- interface Tab {
3
+ import { cn } from "@/utils/cn";
4
+ import React, { ReactElement, useState } from "react";
5
+
6
+ type Tab = {
4
7
  label: string;
8
+ startTabContent?: ReactElement;
9
+ endTabContent?: ReactElement;
5
10
  content: React.ReactNode;
6
- }
11
+ };
7
12
 
8
- interface TabsProps {
13
+ type TabsProps = {
9
14
  tabs: Tab[];
10
15
  initialTab?: number;
11
- }
16
+ };
12
17
 
13
- const Tabs: React.FC<TabsProps> = ({ tabs, initialTab = 0 }) => {
18
+ const Tabs: React.FC<TabsProps> = ({ tabs = [], initialTab = 0 }) => {
14
19
  const [activeTab, setActiveTab] = useState(initialTab);
15
20
 
16
21
  return (
17
- <div className="tabs">
18
- <div className="tab-buttons">
22
+ <div className="w-full space-y-4">
23
+ <div
24
+ className="flex border-b border-primary-10 gap-6 h-[54px] box-border"
25
+ role="tablist"
26
+ >
19
27
  {tabs.map((tab, index) => (
20
28
  <button
21
29
  key={index}
22
- className={index === activeTab ? "active" : ""}
30
+ role="tab"
31
+ aria-selected={index === activeTab}
32
+ aria-controls={`tab-content-${index}`}
33
+ id={`tab-${index}`}
34
+ className={cn(
35
+ "flex flex-row items-center py-4 px-1 cursor-pointer transition-colors duration-300 box-border gap-3",
36
+ {
37
+ "typography-body2 text-textcolor-dark border-b-[3px] border-textcolor-dark":
38
+ index === activeTab,
39
+ "typography-body1 text-textcolor-grey-light border-b-[3px] border-transparent hover:text-textcolor-dark ":
40
+ index !== activeTab,
41
+ }
42
+ )}
23
43
  onClick={() => setActiveTab(index)}
24
44
  >
45
+ {tab.startTabContent}
25
46
  {tab.label}
47
+ {tab.endTabContent}
26
48
  </button>
27
49
  ))}
28
50
  </div>
29
- <div className="tab-content">{tabs[activeTab].content}</div>
51
+ <div
52
+ className=""
53
+ role="tabpanel"
54
+ id={`tab-content-${activeTab}`}
55
+ aria-labelledby={`tab-${activeTab}`}
56
+ >
57
+ {tabs[activeTab]?.content}
58
+ </div>
30
59
  </div>
31
60
  );
32
61
  };
@@ -1,4 +1,10 @@
1
- import React, { FC, forwardRef, useImperativeHandle, useRef } from "react";
1
+ import React, {
2
+ FC,
3
+ ReactNode,
4
+ forwardRef,
5
+ useImperativeHandle,
6
+ useRef,
7
+ } from "react";
2
8
  import {
3
9
  helperTextVariant,
4
10
  iconVariant,
@@ -9,7 +15,7 @@ import {
9
15
  import { twMerge } from "tailwind-merge";
10
16
  import { XCircleIcon, ExclamationCircleIcon } from "@heroicons/react/16/solid";
11
17
 
12
- type InputProps = {
18
+ export type InputProps = {
13
19
  id?: string;
14
20
  label?: string;
15
21
  size?: "sm" | "md" | "lg";
@@ -23,6 +29,7 @@ type InputProps = {
23
29
  error?: boolean;
24
30
  required?: boolean;
25
31
  hasClearIcon?: boolean;
32
+ endIcon?: ReactNode;
26
33
  className?: string;
27
34
  } & Omit<React.InputHTMLAttributes<HTMLInputElement>, "size">;
28
35
 
@@ -42,6 +49,7 @@ const TextInput: FC<InputProps> = forwardRef(
42
49
  error = false,
43
50
  required = true,
44
51
  hasClearIcon = true,
52
+ endIcon,
45
53
  ...props
46
54
  },
47
55
  ref
@@ -97,6 +105,7 @@ const TextInput: FC<InputProps> = forwardRef(
97
105
  />
98
106
  </div>
99
107
  )}
108
+ {endIcon}
100
109
  <label htmlFor={_id} className={labelClassname}>
101
110
  {label} {required && <span className="text-error">*</span>}
102
111
  </label>
package/src/index.ts CHANGED
@@ -2,11 +2,16 @@
2
2
  // import "./src/styles/style.css";
3
3
  import "./theme/global.css";
4
4
  export { default as Button } from "./components/Button/Button";
5
- export { default as Table } from "./components/Table/Table";
6
5
  export { default as TextInput } from "./components/TextInput/TextInput";
7
6
  export { default as Text } from "./components/Text/Text";
8
7
  export { default as Tabs } from "./components/Tabs/Tabs";
9
- export { default as Select } from "./components/Select/Select";
8
+ export { default as Dropdown } from "./components/Dropdown/Dropdown";
9
+ export { Checkbox } from "./components/Checkbox/Checkbox";
10
+ export { Label } from "./components/Label/Label";
11
+ export { Input } from "./components/Input/Input";
12
+ export * from "./components/Table/Table";
13
+ export * from "./components/Dialog/Dialog";
14
+ export * from "./components/AlertDialog/AlertDialog";
10
15
 
11
16
  // UTILS
12
17
  export {
@@ -17,6 +22,8 @@ export {
17
22
  getTimestampUTC,
18
23
  } from "./utils/datetime";
19
24
 
25
+ export { cn } from "./utils/cn";
26
+
20
27
  // const mainPreset = require("./theme/main-preset");
21
28
 
22
29
  // export { mainPreset };
@@ -145,5 +145,62 @@
145
145
  --input-disabled-background-color: 247 247 247;
146
146
 
147
147
  --input-label-background-color: 249 251 255;
148
+
149
+ /* Text */
150
+ --text-default-dark: 1 1 68;
151
+ --text-default-medium: 47 78 255;
152
+ --text-default-light: 213 230 255;
153
+
154
+ --text-grey-dark: 29 30 39;
155
+ --text-grey-medium: 117 121 128;
156
+ --text-grey-light: 164 169 178;
157
+ --text-white: 255 255 255;
158
+
159
+ /* Other/Popup */
160
+ --popup-background: 249 251 255;
161
+ /* Other/Popup Curtain */
162
+ --popup-overlay: 0 0 0;
163
+ --popup-overlay-alpha: 0.48;
164
+ --popup-rounded: 24px;
165
+
166
+ /* TODO for shadcn, wait for refactor */
167
+ /* --background: 0 0% 100%; */
168
+ --background: 220 100% 99%;
169
+ --foreground: 222.2 47.4% 11.2%;
170
+
171
+ --muted: 210 40% 96.1%;
172
+ --muted-foreground: 215.4 16.3% 46.9%;
173
+
174
+ --popover: 0 0% 100%;
175
+ --popover-foreground: 222.2 47.4% 11.2%;
176
+
177
+ --border: 214.3 31.8% 91.4%;
178
+ --input: 214.3 31.8% 91.4%;
179
+
180
+ --card: 0 0% 100%;
181
+ --card-foreground: 222.2 47.4% 11.2%;
182
+
183
+ --primary: var(--primary-default);
184
+
185
+ --secondary: var(--secondary-default);
186
+
187
+ --accent: 210 40% 96.1%;
188
+ --accent-foreground: 222.2 47.4% 11.2%;
189
+
190
+ --destructive: 0 100% 50%;
191
+ --destructive-foreground: 210 40% 98%;
192
+
193
+ --ring: 215 20.2% 65.1%;
194
+
195
+ --radius: 0.5rem;
196
+ }
197
+ }
198
+
199
+ @layer base {
200
+ * {
201
+ @apply border-border;
202
+ }
203
+ body {
204
+ @apply bg-background text-foreground;
148
205
  }
149
206
  }
@@ -1,7 +1,16 @@
1
+ const { fontFamily } = require("tailwindcss/defaultTheme");
2
+
1
3
  /** @type {import('tailwindcss').Config} */
2
4
  module.exports = {
3
5
  darkMode: "class",
4
6
  theme: {
7
+ container: {
8
+ center: true,
9
+ padding: "2rem",
10
+ screens: {
11
+ "2xl": "1400px",
12
+ },
13
+ },
5
14
  extend: {
6
15
  fontSize: {
7
16
  h1: [
@@ -152,8 +161,27 @@ module.exports = {
152
161
  },
153
162
  ],
154
163
  },
164
+ borderRadius: {
165
+ lg: `var(--radius)`,
166
+ md: `calc(var(--radius) - 2px)`,
167
+ sm: "calc(var(--radius) - 4px)",
168
+ },
169
+ keyframes: {
170
+ "accordion-down": {
171
+ from: { height: "0" },
172
+ to: { height: "var(--radix-accordion-content-height)" },
173
+ },
174
+ "accordion-up": {
175
+ from: { height: "var(--radix-accordion-content-height)" },
176
+ to: { height: "0" },
177
+ },
178
+ },
179
+ animation: {
180
+ "accordion-down": "accordion-down 0.2s ease-out",
181
+ "accordion-up": "accordion-up 0.2s ease-out",
182
+ },
155
183
  },
156
184
  },
157
- presets: [require("./presets/colors")],
185
+ presets: [require("./presets/colors"), require("tailwindcss-animate")],
158
186
  plugins: [require("./plugins/utilities/typography")],
159
187
  };
@@ -5,6 +5,10 @@ module.exports = {
5
5
  theme: {
6
6
  extend: {
7
7
  colors: {
8
+ border: "hsl(var(--border))",
9
+ ring: "hsl(var(--ring))",
10
+ background: "hsl(var(--background))",
11
+ foreground: "hsl(var(--foreground))",
8
12
  // Palette colors
9
13
  themes: {
10
14
  50: "rgb(var(--themes-50) / <alpha-value>)",
@@ -160,6 +164,21 @@ module.exports = {
160
164
  "rgb(var(--input-label-background-color) / <alpha-value>)",
161
165
  },
162
166
  },
167
+ textcolor: {
168
+ dark: "rgb(var(--text-default-dark) / <alpha-value>)",
169
+ medium: "rgb(var(--text-default-medium) / <alpha-value>)",
170
+ light: "rgb(var(--text-default-light) / <alpha-value>)",
171
+ grey: {
172
+ dark: "rgb(var(--text-grey-dark) / <alpha-value>)",
173
+ medium: "rgb(var(--text-grey-medium) / <alpha-value>)",
174
+ light: "rgb(var(--text-grey-light) / <alpha-value>)",
175
+ },
176
+ white: "rgb(var(--text-white) / <alpha-value>)",
177
+ },
178
+ popup: {
179
+ background: "rgb(var(--popup-background) / <alpha-value>)",
180
+ overlay: "rgb(var(--popup-overlay) / var(--popup-overlay-alpha))",
181
+ },
163
182
  },
164
183
  },
165
184
  },
@@ -0,0 +1,6 @@
1
+ import { clsx, type ClassValue } from "clsx";
2
+ import { twMerge } from "tailwind-merge";
3
+
4
+ export function cn(...inputs: ClassValue[]) {
5
+ return twMerge(clsx(inputs));
6
+ }
@@ -1,23 +0,0 @@
1
- import React from "react";
2
- type Options = {
3
- value: string;
4
- label: string;
5
- };
6
- type SelectProps = {
7
- id?: string;
8
- label?: string;
9
- size?: "sm" | "md" | "lg";
10
- rounded?: "none" | "normal" | "full";
11
- variant?: "flat" | "outline" | "underline";
12
- type?: React.HTMLInputTypeAttribute;
13
- helperText?: string;
14
- errorMessage?: string;
15
- fullwidth?: boolean;
16
- disabled?: boolean;
17
- error?: boolean;
18
- required?: boolean;
19
- className?: string;
20
- options: Options[];
21
- } & Omit<React.InputHTMLAttributes<HTMLSelectElement>, "size">;
22
- declare const Select: ({ id, options, label, size, rounded, variant, type, helperText, errorMessage, fullwidth, disabled, error, required, ...props }: SelectProps) => import("react/jsx-runtime").JSX.Element;
23
- export default Select;
@@ -1,23 +0,0 @@
1
- import React from "react";
2
- type Options = {
3
- value: string;
4
- label: string;
5
- };
6
- type SelectProps = {
7
- id?: string;
8
- label?: string;
9
- size?: "sm" | "md" | "lg";
10
- rounded?: "none" | "normal" | "full";
11
- variant?: "flat" | "outline" | "underline";
12
- type?: React.HTMLInputTypeAttribute;
13
- helperText?: string;
14
- errorMessage?: string;
15
- fullwidth?: boolean;
16
- disabled?: boolean;
17
- error?: boolean;
18
- required?: boolean;
19
- className?: string;
20
- options: Options[];
21
- } & Omit<React.InputHTMLAttributes<HTMLSelectElement>, "size">;
22
- declare const Select: ({ id, options, label, size, rounded, variant, type, helperText, errorMessage, fullwidth, disabled, error, required, ...props }: SelectProps) => import("react/jsx-runtime").JSX.Element;
23
- export default Select;