@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.
- package/dist/cjs/bundle.css +497 -4
- package/dist/cjs/bundle.js +1 -1
- package/dist/cjs/bundle.js.map +1 -1
- package/dist/cjs/types/components/AlertDialog/Alert.stories.d.ts +20 -0
- package/dist/cjs/types/components/AlertDialog/AlertDialog.d.ts +20 -0
- package/dist/cjs/types/components/Button/Button.styles.d.ts +1 -1
- package/dist/cjs/types/components/Checkbox/Checkbox.d.ts +4 -0
- package/dist/cjs/types/components/Checkbox/Checkbox.stories.d.ts +308 -0
- package/dist/cjs/types/components/Dialog/Dialog.d.ts +19 -0
- package/dist/cjs/types/components/Dialog/Dialog.stories.d.ts +25 -0
- package/dist/cjs/types/components/Dropdown/Dropdown.d.ts +26 -0
- package/dist/cjs/types/components/Dropdown/Dropdown.stories.d.ts +367 -0
- package/dist/cjs/types/components/Dropdown/Dropdown.styles.d.ts +11 -0
- package/dist/cjs/types/components/Input/Input.d.ts +5 -0
- package/dist/cjs/types/components/Input/Input.stories.d.ts +314 -0
- package/dist/cjs/types/components/Label/Label.d.ts +5 -0
- package/dist/cjs/types/components/Label/Label.stories.d.ts +286 -0
- package/dist/cjs/types/components/RadioGroup/RadioGroup.d.ts +5 -0
- package/dist/cjs/types/components/RadioGroup/RadioGroup.stories.d.ts +299 -0
- package/dist/cjs/types/components/Table/Datagrid.d.ts +11 -0
- package/dist/cjs/types/components/Table/Table.d.ts +10 -11
- package/dist/cjs/types/components/Table/Table.stories.d.ts +283 -0
- package/dist/cjs/types/components/Tabs/Tabs.d.ts +7 -5
- package/dist/cjs/types/components/Tabs/Tabs.stories.d.ts +49 -0
- package/dist/cjs/types/components/TextInput/TextInput.d.ts +3 -2
- package/dist/cjs/types/components/TextInput/TextInput.stories.d.ts +2 -16
- package/dist/cjs/types/index.d.ts +8 -2
- package/dist/cjs/types/utils/cn.d.ts +2 -0
- package/dist/components/AlertDialog/Alert.stories.js +39 -0
- package/dist/components/AlertDialog/AlertDialog.js +73 -0
- package/dist/components/Button/Button.js +3 -3
- package/dist/components/Button/Button.styles.js +1 -1
- package/dist/components/Checkbox/Checkbox.js +37 -0
- package/dist/components/Checkbox/Checkbox.stories.js +49 -0
- package/dist/components/Dialog/Dialog.js +63 -0
- package/dist/components/Dialog/Dialog.stories.js +52 -0
- package/dist/components/Dropdown/Dropdown.js +58 -0
- package/dist/components/{Select/Select.stories.js → Dropdown/Dropdown.stories.js} +8 -11
- package/dist/components/Dropdown/Dropdown.styles.js +47 -0
- package/dist/components/Input/Input.js +31 -0
- package/dist/components/Input/Input.stories.js +37 -0
- package/dist/components/Label/Label.js +35 -0
- package/dist/components/Label/Label.stories.js +38 -0
- package/dist/components/RadioGroup/RadioGroup.js +41 -0
- package/dist/components/RadioGroup/RadioGroup.stories.js +44 -0
- package/dist/components/Table/Datagrid.js +6 -0
- package/dist/components/Table/Table.js +65 -5
- package/dist/components/Table/Table.stories.js +32 -0
- package/dist/components/Tabs/Tabs.js +10 -4
- package/dist/components/Tabs/Tabs.stories.js +60 -0
- package/dist/components/TextInput/TextInput.js +3 -3
- package/dist/esm/bundle.css +497 -4
- package/dist/esm/bundle.js +1 -1
- package/dist/esm/bundle.js.map +1 -1
- package/dist/esm/types/components/AlertDialog/Alert.stories.d.ts +20 -0
- package/dist/esm/types/components/AlertDialog/AlertDialog.d.ts +20 -0
- package/dist/esm/types/components/Button/Button.styles.d.ts +1 -1
- package/dist/esm/types/components/Checkbox/Checkbox.d.ts +4 -0
- package/dist/esm/types/components/Checkbox/Checkbox.stories.d.ts +308 -0
- package/dist/esm/types/components/Dialog/Dialog.d.ts +19 -0
- package/dist/esm/types/components/Dialog/Dialog.stories.d.ts +25 -0
- package/dist/esm/types/components/Dropdown/Dropdown.d.ts +26 -0
- package/dist/esm/types/components/Dropdown/Dropdown.stories.d.ts +367 -0
- package/dist/esm/types/components/Dropdown/Dropdown.styles.d.ts +11 -0
- package/dist/esm/types/components/Input/Input.d.ts +5 -0
- package/dist/esm/types/components/Input/Input.stories.d.ts +314 -0
- package/dist/esm/types/components/Label/Label.d.ts +5 -0
- package/dist/esm/types/components/Label/Label.stories.d.ts +286 -0
- package/dist/esm/types/components/RadioGroup/RadioGroup.d.ts +5 -0
- package/dist/esm/types/components/RadioGroup/RadioGroup.stories.d.ts +299 -0
- package/dist/esm/types/components/Table/Datagrid.d.ts +11 -0
- package/dist/esm/types/components/Table/Table.d.ts +10 -11
- package/dist/esm/types/components/Table/Table.stories.d.ts +283 -0
- package/dist/esm/types/components/Tabs/Tabs.d.ts +7 -5
- package/dist/esm/types/components/Tabs/Tabs.stories.d.ts +49 -0
- package/dist/esm/types/components/TextInput/TextInput.d.ts +3 -2
- package/dist/esm/types/components/TextInput/TextInput.stories.d.ts +2 -16
- package/dist/esm/types/index.d.ts +8 -2
- package/dist/esm/types/utils/cn.d.ts +2 -0
- package/dist/index.d.ts +88 -30
- package/dist/index.js +8 -2
- package/dist/src/theme/global.css +598 -4
- package/dist/theme/global.css +57 -0
- package/dist/theme/main-preset.js +29 -1
- package/dist/theme/presets/colors.js +19 -0
- package/dist/utils/cn.js +9 -0
- package/package.json +9 -1
- package/src/components/AlertDialog/Alert.stories.tsx +67 -0
- package/src/components/AlertDialog/AlertDialog.tsx +142 -0
- package/src/components/Button/Button.styles.ts +1 -1
- package/src/components/Button/Button.tsx +4 -4
- package/src/components/Checkbox/Checkbox.stories.tsx +91 -0
- package/src/components/Checkbox/Checkbox.tsx +36 -0
- package/src/components/Dialog/Dialog.stories.tsx +118 -0
- package/src/components/Dialog/Dialog.tsx +119 -0
- package/src/components/{Select/Select.stories.tsx → Dropdown/Dropdown.stories.tsx} +11 -14
- package/src/components/Dropdown/Dropdown.styles.ts +54 -0
- package/src/components/Dropdown/Dropdown.tsx +151 -0
- package/src/components/Input/Input.stories.tsx +40 -0
- package/src/components/Input/Input.tsx +25 -0
- package/src/components/Label/Label.stories.tsx +45 -0
- package/src/components/Label/Label.tsx +26 -0
- package/src/components/RadioGroup/RadioGroup.stories.tsx +71 -0
- package/src/components/RadioGroup/RadioGroup.tsx +59 -0
- package/src/components/Table/Datagrid.tsx +36 -0
- package/src/components/Table/Table.stories.tsx +79 -0
- package/src/components/Table/Table.tsx +116 -35
- package/src/components/Tabs/Tabs.stories.tsx +75 -0
- package/src/components/Tabs/Tabs.tsx +39 -10
- package/src/components/TextInput/TextInput.tsx +11 -2
- package/src/index.ts +9 -2
- package/src/theme/global.css +57 -0
- package/src/theme/main-preset.js +29 -1
- package/src/theme/presets/colors.js +19 -0
- package/src/utils/cn.ts +6 -0
- package/dist/cjs/types/components/Select/Select copy.d.ts +0 -23
- package/dist/cjs/types/components/Select/Select.d.ts +0 -23
- package/dist/cjs/types/components/Select/Select.stories.d.ts +0 -348
- package/dist/cjs/types/components/Select/Select.styles.d.ts +0 -14
- package/dist/components/Select/Select copy.js +0 -42
- package/dist/components/Select/Select.js +0 -21
- package/dist/components/Select/Select.styles.js +0 -100
- package/dist/esm/types/components/Select/Select copy.d.ts +0 -23
- package/dist/esm/types/components/Select/Select.d.ts +0 -23
- package/dist/esm/types/components/Select/Select.stories.d.ts +0 -348
- package/dist/esm/types/components/Select/Select.styles.d.ts +0 -14
- package/src/components/Select/Select copy.tsx +0 -103
- package/src/components/Select/Select.styles.ts +0 -111
- package/src/components/Select/Select.tsx +0 -54
|
@@ -0,0 +1,31 @@
|
|
|
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
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
+
import * as React from "react";
|
|
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)));
|
|
29
|
+
});
|
|
30
|
+
Input.displayName = "Input";
|
|
31
|
+
export { Input };
|
|
@@ -0,0 +1,37 @@
|
|
|
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 } from "react/jsx-runtime";
|
|
13
|
+
import { Input } from "./Input";
|
|
14
|
+
var meta = {
|
|
15
|
+
title: "Components/Input",
|
|
16
|
+
component: Input,
|
|
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
|
+
// label: "Lorem Ipsum",
|
|
29
|
+
// value: "Lorem Ipsum",
|
|
30
|
+
// fullwidth: true,
|
|
31
|
+
},
|
|
32
|
+
render: function (args) {
|
|
33
|
+
console.log("args ", args);
|
|
34
|
+
var props = __assign({}, args);
|
|
35
|
+
return (_jsx("div", { className: "flex flex-row gap-4 w-full", children: _jsx(Input, { type: "email", placeholder: "Email" }) }));
|
|
36
|
+
},
|
|
37
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
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 LabelPrimitive from "@radix-ui/react-label";
|
|
27
|
+
import { cva } from "class-variance-authority";
|
|
28
|
+
import { cn } from "@/utils/cn";
|
|
29
|
+
var labelVariants = cva("typography-label1 peer-disabled:cursor-not-allowed peer-disabled:opacity-70");
|
|
30
|
+
var Label = React.forwardRef(function (_a, ref) {
|
|
31
|
+
var className = _a.className, props = __rest(_a, ["className"]);
|
|
32
|
+
return (_jsx(LabelPrimitive.Root, __assign({ ref: ref, className: cn(labelVariants(), className) }, props)));
|
|
33
|
+
});
|
|
34
|
+
Label.displayName = LabelPrimitive.Root.displayName;
|
|
35
|
+
export { Label };
|
|
@@ -0,0 +1,38 @@
|
|
|
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 { Checkbox } from "../Checkbox/Checkbox";
|
|
14
|
+
import { Label } from "./Label";
|
|
15
|
+
var meta = {
|
|
16
|
+
title: "Components/Label",
|
|
17
|
+
component: Label,
|
|
18
|
+
tags: ["autodocs"],
|
|
19
|
+
parameters: {
|
|
20
|
+
layout: "fullscreen",
|
|
21
|
+
},
|
|
22
|
+
decorators: [
|
|
23
|
+
function (Story) { return (_jsx("div", { className: "p-5 flex w-full", children: _jsx(Story, {}) })); },
|
|
24
|
+
],
|
|
25
|
+
};
|
|
26
|
+
export default meta;
|
|
27
|
+
export var Default = {
|
|
28
|
+
args: {
|
|
29
|
+
// label: "Lorem Ipsum",
|
|
30
|
+
// value: "Lorem Ipsum",
|
|
31
|
+
// fullwidth: true,
|
|
32
|
+
},
|
|
33
|
+
render: function (args) {
|
|
34
|
+
console.log("args ", args);
|
|
35
|
+
var props = __assign({}, args);
|
|
36
|
+
return (_jsx("div", { className: "flex flex-row gap-4 w-full", children: _jsxs("div", { className: "flex items-center space-x-2", children: [_jsx(Checkbox, { id: "terms" }), _jsx(Label, { htmlFor: "terms", children: "Accept terms and conditions" })] }) }));
|
|
37
|
+
},
|
|
38
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
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 RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
27
|
+
import { cn } from "@/utils/cn";
|
|
28
|
+
var RadioGroup = React.forwardRef(function (_a, ref) {
|
|
29
|
+
var className = _a.className, props = __rest(_a, ["className"]);
|
|
30
|
+
return (_jsx(RadioGroupPrimitive.Root, __assign({ className: cn("grid gap-2", className) }, props, { ref: ref })));
|
|
31
|
+
});
|
|
32
|
+
RadioGroup.displayName = RadioGroupPrimitive.Root.displayName;
|
|
33
|
+
var RadioGroupItem = React.forwardRef(function (_a, ref) {
|
|
34
|
+
var className = _a.className, props = __rest(_a, ["className"]);
|
|
35
|
+
return (_jsx(RadioGroupPrimitive.Item, __assign({ ref: ref, className: cn("aspect-square h-4 w-4 rounded-full border text-primary disabled:fill-secondary-110 ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:border-secondary-110", {
|
|
36
|
+
"border-primary-30 data-[state=checked]:border-primary": !props.disabled,
|
|
37
|
+
"border-secondary-110 data-disabled:border-secondary-110 text-secondary-110 fill-secondary-110": props.disabled,
|
|
38
|
+
}, className) }, props, { children: _jsx(RadioGroupPrimitive.Indicator, { className: "flex items-center justify-center", children: _jsx("svg", { width: "10", height: "10", viewBox: "0 0 10 10", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: "fill-current text-current", children: _jsx("circle", { cx: "5", cy: "5", r: "5", fill: "current" }) }) }) })));
|
|
39
|
+
});
|
|
40
|
+
RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;
|
|
41
|
+
export { RadioGroup, RadioGroupItem };
|
|
@@ -0,0 +1,44 @@
|
|
|
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 { RadioGroup, RadioGroupItem } from "./RadioGroup";
|
|
14
|
+
import { Label } from "../Label/Label";
|
|
15
|
+
var meta = {
|
|
16
|
+
title: "Components/RadioGroup",
|
|
17
|
+
component: RadioGroup,
|
|
18
|
+
tags: ["autodocs"],
|
|
19
|
+
parameters: {
|
|
20
|
+
layout: "fullscreen",
|
|
21
|
+
},
|
|
22
|
+
decorators: [
|
|
23
|
+
function (Story) { return (_jsx("div", { className: "p-5 flex w-full", children: _jsx(Story, {}) })); },
|
|
24
|
+
],
|
|
25
|
+
};
|
|
26
|
+
export default meta;
|
|
27
|
+
export var Default = {
|
|
28
|
+
args: {
|
|
29
|
+
disabled: false,
|
|
30
|
+
},
|
|
31
|
+
render: function (args) {
|
|
32
|
+
var props = __assign({}, args);
|
|
33
|
+
return (_jsx("div", { className: "flex flex-row gap-4 w-full", children: _jsxs(RadioGroup, __assign({ defaultValue: "option-one" }, props, { children: [_jsxs("div", { className: "flex items-center space-x-2", children: [_jsx(RadioGroupItem, { value: "option-one", id: "option-one" }), _jsx(Label, { htmlFor: "option-one", children: "Option One" })] }), _jsxs("div", { className: "flex items-center space-x-2", children: [_jsx(RadioGroupItem, { value: "option-two", id: "option-two" }), _jsx(Label, { htmlFor: "option-two", children: "Option Two" })] })] })) }));
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
export var Diabled = {
|
|
37
|
+
args: {
|
|
38
|
+
disabled: true,
|
|
39
|
+
},
|
|
40
|
+
render: function (args) {
|
|
41
|
+
var props = __assign({}, args);
|
|
42
|
+
return (_jsx("div", { className: "flex items-center space-x-2", children: _jsxs(RadioGroup, { defaultValue: "option-one", disabled: true, children: [_jsxs("div", { className: "flex items-center space-x-2", children: [_jsx(RadioGroupItem, { value: "option-one", id: "option-one" }), _jsx(Label, { htmlFor: "option-one", children: "Option One" })] }), _jsxs("div", { className: "flex items-center space-x-2", children: [_jsx(RadioGroupItem, { value: "option-two", id: "option-two" }), _jsx(Label, { htmlFor: "option-two", children: "Option Two" })] })] }) }));
|
|
43
|
+
},
|
|
44
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
var Table = function (_a) {
|
|
3
|
+
var columns = _a.columns, data = _a.data;
|
|
4
|
+
return (_jsxs("table", { className: "table", children: [_jsx("thead", { children: _jsx("tr", { children: columns.map(function (column, index) { return (_jsx("th", { children: column.header }, index)); }) }) }), _jsx("tbody", { children: data.map(function (row, rowIndex) { return (_jsx("tr", { children: columns.map(function (column, colIndex) { return (_jsx("td", { children: row[column.accessor] }, colIndex)); }) }, rowIndex)); }) })] }));
|
|
5
|
+
};
|
|
6
|
+
export default Table;
|
|
@@ -1,6 +1,66 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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);
|
|
5
11
|
};
|
|
6
|
-
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
23
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
+
import * as React from "react";
|
|
25
|
+
import { cn } from "@/utils/cn";
|
|
26
|
+
var Table = React.forwardRef(function (_a, ref) {
|
|
27
|
+
var className = _a.className, props = __rest(_a, ["className"]);
|
|
28
|
+
return (_jsx("div", { className: "relative w-full overflow-auto", children: _jsx("table", __assign({ ref: ref, className: cn("w-full caption-bottom text-sm", className) }, props)) }));
|
|
29
|
+
});
|
|
30
|
+
Table.displayName = "Table";
|
|
31
|
+
var TableHeader = React.forwardRef(function (_a, ref) {
|
|
32
|
+
var className = _a.className, props = __rest(_a, ["className"]);
|
|
33
|
+
return (_jsx("thead", __assign({ ref: ref, className: cn("[&_tr]:border-b", className) }, props)));
|
|
34
|
+
});
|
|
35
|
+
TableHeader.displayName = "TableHeader";
|
|
36
|
+
var TableBody = React.forwardRef(function (_a, ref) {
|
|
37
|
+
var className = _a.className, props = __rest(_a, ["className"]);
|
|
38
|
+
return (_jsx("tbody", __assign({ ref: ref, className: cn("[&_tr:last-child]:border-0", className) }, props)));
|
|
39
|
+
});
|
|
40
|
+
TableBody.displayName = "TableBody";
|
|
41
|
+
var TableFooter = React.forwardRef(function (_a, ref) {
|
|
42
|
+
var className = _a.className, props = __rest(_a, ["className"]);
|
|
43
|
+
return (_jsx("tfoot", __assign({ ref: ref, className: cn("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0", className) }, props)));
|
|
44
|
+
});
|
|
45
|
+
TableFooter.displayName = "TableFooter";
|
|
46
|
+
var TableRow = React.forwardRef(function (_a, ref) {
|
|
47
|
+
var className = _a.className, props = __rest(_a, ["className"]);
|
|
48
|
+
return (_jsx("tr", __assign({ ref: ref, className: cn("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted", className) }, props)));
|
|
49
|
+
});
|
|
50
|
+
TableRow.displayName = "TableRow";
|
|
51
|
+
var TableHead = React.forwardRef(function (_a, ref) {
|
|
52
|
+
var className = _a.className, props = __rest(_a, ["className"]);
|
|
53
|
+
return (_jsx("th", __assign({ ref: ref, className: cn("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0", className) }, props)));
|
|
54
|
+
});
|
|
55
|
+
TableHead.displayName = "TableHead";
|
|
56
|
+
var TableCell = React.forwardRef(function (_a, ref) {
|
|
57
|
+
var className = _a.className, props = __rest(_a, ["className"]);
|
|
58
|
+
return (_jsx("td", __assign({ ref: ref, className: cn("p-4 align-middle [&:has([role=checkbox])]:pr-0", className) }, props)));
|
|
59
|
+
});
|
|
60
|
+
TableCell.displayName = "TableCell";
|
|
61
|
+
var TableCaption = React.forwardRef(function (_a, ref) {
|
|
62
|
+
var className = _a.className, props = __rest(_a, ["className"]);
|
|
63
|
+
return (_jsx("caption", __assign({ ref: ref, className: cn("mt-4 text-sm text-muted-foreground", className) }, props)));
|
|
64
|
+
});
|
|
65
|
+
TableCaption.displayName = "TableCaption";
|
|
66
|
+
export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption, };
|
|
@@ -0,0 +1,32 @@
|
|
|
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 { Table, TableBody, TableCaption, TableCell, TableHead, TableHeader, TableRow, } from "./Table";
|
|
14
|
+
var meta = {
|
|
15
|
+
title: "Components/Table",
|
|
16
|
+
component: Table,
|
|
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
|
+
render: function (args) {
|
|
29
|
+
var props = __assign({}, args);
|
|
30
|
+
return (_jsx("div", { className: "flex flex-row gap-4 w-full", children: _jsxs(Table, { children: [_jsx(TableCaption, { children: "A list of your recent invoices." }), _jsx(TableHeader, { children: _jsxs(TableRow, { children: [_jsx(TableHead, { className: "w-[100px]", children: "Invoice" }), _jsx(TableHead, { children: "Status" }), _jsx(TableHead, { children: "Method" }), _jsx(TableHead, { className: "text-right", children: "Amount" })] }) }), _jsxs(TableBody, { children: [_jsxs(TableRow, { children: [_jsx(TableCell, { className: "font-medium", children: "INV001" }), _jsx(TableCell, { children: "Paid" }), _jsx(TableCell, { children: "Credit Card" }), _jsx(TableCell, { className: "text-right", children: "$250.00" })] }), _jsxs(TableRow, { children: [_jsx(TableCell, { className: "font-medium", children: "INV001" }), _jsx(TableCell, { children: "Paid" }), _jsx(TableCell, { children: "Credit Card" }), _jsx(TableCell, { className: "text-right", children: "$250.00" })] }), _jsxs(TableRow, { children: [_jsx(TableCell, { className: "font-medium", children: "INV001" }), _jsx(TableCell, { children: "Paid" }), _jsx(TableCell, { children: "Credit Card" }), _jsx(TableCell, { className: "text-right", children: "$250.00" })] }), _jsxs(TableRow, { children: [_jsx(TableCell, { className: "font-medium", children: "INV001" }), _jsx(TableCell, { children: "Paid" }), _jsx(TableCell, { children: "Credit Card" }), _jsx(TableCell, { className: "text-right", children: "$250.00" })] })] })] }) }));
|
|
31
|
+
},
|
|
32
|
+
};
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "@/utils/cn";
|
|
2
4
|
import { useState } from "react";
|
|
3
5
|
var Tabs = function (_a) {
|
|
4
|
-
var
|
|
5
|
-
var _c =
|
|
6
|
-
|
|
6
|
+
var _b;
|
|
7
|
+
var _c = _a.tabs, tabs = _c === void 0 ? [] : _c, _d = _a.initialTab, initialTab = _d === void 0 ? 0 : _d;
|
|
8
|
+
var _e = useState(initialTab), activeTab = _e[0], setActiveTab = _e[1];
|
|
9
|
+
return (_jsxs("div", { className: "w-full space-y-4", children: [_jsx("div", { className: "flex border-b border-primary-10 gap-6 h-[54px] box-border", role: "tablist", children: tabs.map(function (tab, index) { return (_jsxs("button", { role: "tab", "aria-selected": index === activeTab, "aria-controls": "tab-content-".concat(index), id: "tab-".concat(index), className: cn("flex flex-row items-center py-4 px-1 cursor-pointer transition-colors duration-300 box-border gap-3", {
|
|
10
|
+
"typography-body2 text-textcolor-dark border-b-[3px] border-textcolor-dark": index === activeTab,
|
|
11
|
+
"typography-body1 text-textcolor-grey-light border-b-[3px] border-transparent hover:text-textcolor-dark ": index !== activeTab,
|
|
12
|
+
}), onClick: function () { return setActiveTab(index); }, children: [tab.startTabContent, tab.label, tab.endTabContent] }, index)); }) }), _jsx("div", { className: "", role: "tabpanel", id: "tab-content-".concat(activeTab), "aria-labelledby": "tab-".concat(activeTab), children: (_b = tabs[activeTab]) === null || _b === void 0 ? void 0 : _b.content })] }));
|
|
7
13
|
};
|
|
8
14
|
export default Tabs;
|
|
@@ -0,0 +1,60 @@
|
|
|
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 } from "react/jsx-runtime";
|
|
13
|
+
import Tabs from "./Tabs";
|
|
14
|
+
import { ChevronDownIcon, ArchiveBoxIcon } from "@heroicons/react/16/solid";
|
|
15
|
+
var meta = {
|
|
16
|
+
title: "Components/Tabs",
|
|
17
|
+
component: Tabs,
|
|
18
|
+
tags: ["autodocs"],
|
|
19
|
+
parameters: {
|
|
20
|
+
layout: "fullscreen",
|
|
21
|
+
},
|
|
22
|
+
decorators: [
|
|
23
|
+
function (Story) { return (_jsx("div", { className: "p-5 flex w-full", children: _jsx(Story, {}) })); },
|
|
24
|
+
],
|
|
25
|
+
};
|
|
26
|
+
export default meta;
|
|
27
|
+
var tabs = [
|
|
28
|
+
{
|
|
29
|
+
label: "Tab1",
|
|
30
|
+
content: _jsx("p", { children: "Tab 1 content" }),
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
label: "Tab2",
|
|
34
|
+
content: _jsx("p", { children: "Tab 2 content" }),
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
label: "Tab3",
|
|
38
|
+
content: _jsx("p", { children: "Tab 3 content" }),
|
|
39
|
+
},
|
|
40
|
+
];
|
|
41
|
+
export var Default = {
|
|
42
|
+
args: {
|
|
43
|
+
initialTab: 0,
|
|
44
|
+
tabs: tabs,
|
|
45
|
+
},
|
|
46
|
+
render: function (args) {
|
|
47
|
+
var props = __assign({}, args);
|
|
48
|
+
return (_jsx("div", { className: "flex flex-row gap-4 w-full", children: _jsx(Tabs, __assign({ tabs: tabs }, props)) }));
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
export var CustomTab = {
|
|
52
|
+
args: {
|
|
53
|
+
initialTab: 0,
|
|
54
|
+
tabs: tabs.map(function (tab) { return (__assign(__assign({}, tab), { startTabContent: _jsx(ArchiveBoxIcon, { className: "size-3 " }), endTabContent: _jsx(ChevronDownIcon, { className: "size-3" }) })); }),
|
|
55
|
+
},
|
|
56
|
+
render: function (args) {
|
|
57
|
+
var props = __assign({}, args);
|
|
58
|
+
return (_jsx("div", { className: "flex flex-row gap-4 w-full", children: _jsx(Tabs, __assign({ tabs: tabs }, props)) }));
|
|
59
|
+
},
|
|
60
|
+
};
|
|
@@ -21,12 +21,12 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
23
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
|
-
import { forwardRef, useImperativeHandle, useRef } from "react";
|
|
24
|
+
import { forwardRef, useImperativeHandle, useRef, } from "react";
|
|
25
25
|
import { helperTextVariant, iconVariant, iconWrapperVariant, inputVariant, labelVariant, } from "./TextInput.styles";
|
|
26
26
|
import { twMerge } from "tailwind-merge";
|
|
27
27
|
import { XCircleIcon, ExclamationCircleIcon } from "@heroicons/react/16/solid";
|
|
28
28
|
var TextInput = forwardRef(function (_a, ref) {
|
|
29
|
-
var id = _a.id, label = _a.label, _b = _a.size, size = _b === void 0 ? "md" : _b, _c = _a.rounded, rounded = _c === void 0 ? "normal" : _c, _d = _a.variant, variant = _d === void 0 ? "outline" : _d, _e = _a.type, type = _e === void 0 ? "text" : _e, helperText = _a.helperText, errorMessage = _a.errorMessage, _f = _a.fullwidth, fullwidth = _f === void 0 ? true : _f, _g = _a.disabled, disabled = _g === void 0 ? false : _g, _h = _a.error, error = _h === void 0 ? false : _h, _j = _a.required, required = _j === void 0 ? true : _j, _k = _a.hasClearIcon, hasClearIcon = _k === void 0 ? true : _k, props = __rest(_a, ["id", "label", "size", "rounded", "variant", "type", "helperText", "errorMessage", "fullwidth", "disabled", "error", "required", "hasClearIcon"]);
|
|
29
|
+
var id = _a.id, label = _a.label, _b = _a.size, size = _b === void 0 ? "md" : _b, _c = _a.rounded, rounded = _c === void 0 ? "normal" : _c, _d = _a.variant, variant = _d === void 0 ? "outline" : _d, _e = _a.type, type = _e === void 0 ? "text" : _e, helperText = _a.helperText, errorMessage = _a.errorMessage, _f = _a.fullwidth, fullwidth = _f === void 0 ? true : _f, _g = _a.disabled, disabled = _g === void 0 ? false : _g, _h = _a.error, error = _h === void 0 ? false : _h, _j = _a.required, required = _j === void 0 ? true : _j, _k = _a.hasClearIcon, hasClearIcon = _k === void 0 ? true : _k, endIcon = _a.endIcon, props = __rest(_a, ["id", "label", "size", "rounded", "variant", "type", "helperText", "errorMessage", "fullwidth", "disabled", "error", "required", "hasClearIcon", "endIcon"]);
|
|
30
30
|
var inputRef = useRef(null);
|
|
31
31
|
var _id = id || "".concat(type, "-").concat(label, "-input");
|
|
32
32
|
var inputClassname = inputVariant({
|
|
@@ -54,6 +54,6 @@ var TextInput = forwardRef(function (_a, ref) {
|
|
|
54
54
|
inputRef.current.value = "";
|
|
55
55
|
}
|
|
56
56
|
};
|
|
57
|
-
return (_jsxs("div", { className: "inline-flex flex-col ".concat(fullwidth ? "w-full" : ""), children: [_jsxs("div", { className: "relative", children: [_jsx("input", __assign({}, props, { placeholder: " ", ref: inputRef, type: type, id: _id, disabled: disabled, className: twMerge(inputClassname, props.className) })), hasClearIcon && (_jsx("div", { className: iconWrapperClassname, children: _jsx(XCircleIcon, { type: "button", className: iconClassname, onMouseDown: handleClearInput }) })), _jsxs("label", { htmlFor: _id, className: labelClassname, children: [label, " ", required && _jsx("span", { className: "text-error", children: "*" })] })] }), (errorMessage || helperText) && (_jsxs("span", { className: helperTextClassname, children: [_jsx(ExclamationCircleIcon, { width: 16, height: 16, className: error ? "fill-error" : "" }), " ", errorMessage || helperText] }))] }));
|
|
57
|
+
return (_jsxs("div", { className: "inline-flex flex-col ".concat(fullwidth ? "w-full" : ""), children: [_jsxs("div", { className: "relative", children: [_jsx("input", __assign({}, props, { placeholder: " ", ref: inputRef, type: type, id: _id, disabled: disabled, className: twMerge(inputClassname, props.className) })), hasClearIcon && (_jsx("div", { className: iconWrapperClassname, children: _jsx(XCircleIcon, { type: "button", className: iconClassname, onMouseDown: handleClearInput }) })), endIcon, _jsxs("label", { htmlFor: _id, className: labelClassname, children: [label, " ", required && _jsx("span", { className: "text-error", children: "*" })] })] }), (errorMessage || helperText) && (_jsxs("span", { className: helperTextClassname, children: [_jsx(ExclamationCircleIcon, { width: 16, height: 16, className: error ? "fill-error" : "" }), " ", errorMessage || helperText] }))] }));
|
|
58
58
|
});
|
|
59
59
|
export default TextInput;
|