@rovula/ui 0.0.9 → 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 +429 -3
- 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/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/index.d.ts +7 -1
- 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/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/esm/bundle.css +429 -3
- 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/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/index.d.ts +7 -1
- package/dist/esm/types/utils/cn.d.ts +2 -0
- package/dist/index.d.ts +82 -28
- package/dist/index.js +7 -1
- package/dist/src/theme/global.css +511 -3
- 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/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/index.ts +8 -1
- 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
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: React.FC<{
|
|
5
|
+
tabs: {
|
|
6
|
+
label: string;
|
|
7
|
+
startTabContent?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
|
|
8
|
+
endTabContent?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
|
|
9
|
+
content: React.ReactNode;
|
|
10
|
+
}[];
|
|
11
|
+
initialTab?: number | undefined;
|
|
12
|
+
}>;
|
|
13
|
+
tags: string[];
|
|
14
|
+
parameters: {
|
|
15
|
+
layout: string;
|
|
16
|
+
};
|
|
17
|
+
decorators: ((Story: import("@storybook/types").PartialStoryFn<import("@storybook/react").ReactRenderer, {
|
|
18
|
+
tabs: {
|
|
19
|
+
label: string;
|
|
20
|
+
startTabContent?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
|
|
21
|
+
endTabContent?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
|
|
22
|
+
content: React.ReactNode;
|
|
23
|
+
}[];
|
|
24
|
+
initialTab?: number | undefined;
|
|
25
|
+
}>) => import("react/jsx-runtime").JSX.Element)[];
|
|
26
|
+
};
|
|
27
|
+
export default meta;
|
|
28
|
+
export declare const Default: {
|
|
29
|
+
args: {
|
|
30
|
+
initialTab: number;
|
|
31
|
+
tabs: {
|
|
32
|
+
label: string;
|
|
33
|
+
content: import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
}[];
|
|
35
|
+
};
|
|
36
|
+
render: (args: {}) => import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
};
|
|
38
|
+
export declare const CustomTab: {
|
|
39
|
+
args: {
|
|
40
|
+
initialTab: number;
|
|
41
|
+
tabs: {
|
|
42
|
+
startTabContent: import("react/jsx-runtime").JSX.Element;
|
|
43
|
+
endTabContent: import("react/jsx-runtime").JSX.Element;
|
|
44
|
+
label: string;
|
|
45
|
+
content: import("react/jsx-runtime").JSX.Element;
|
|
46
|
+
}[];
|
|
47
|
+
};
|
|
48
|
+
render: (args: {}) => import("react/jsx-runtime").JSX.Element;
|
|
49
|
+
};
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import "./theme/global.css";
|
|
2
2
|
export { default as Button } from "./components/Button/Button";
|
|
3
|
-
export { default as Table } from "./components/Table/Table";
|
|
4
3
|
export { default as TextInput } from "./components/TextInput/TextInput";
|
|
5
4
|
export { default as Text } from "./components/Text/Text";
|
|
6
5
|
export { default as Tabs } from "./components/Tabs/Tabs";
|
|
7
6
|
export { default as Dropdown } from "./components/Dropdown/Dropdown";
|
|
7
|
+
export { Checkbox } from "./components/Checkbox/Checkbox";
|
|
8
|
+
export { Label } from "./components/Label/Label";
|
|
9
|
+
export { Input } from "./components/Input/Input";
|
|
10
|
+
export * from "./components/Table/Table";
|
|
11
|
+
export * from "./components/Dialog/Dialog";
|
|
12
|
+
export * from "./components/AlertDialog/AlertDialog";
|
|
8
13
|
export { resloveTimestamp, getStartDateOfDay, getEndDateOfDay, getStartEndTimestampOfDay, getTimestampUTC, } from "./utils/datetime";
|
|
14
|
+
export { cn } from "./utils/cn";
|
|
@@ -0,0 +1,39 @@
|
|
|
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 { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, } from "./AlertDialog";
|
|
14
|
+
// More on how to set up stories at: https://storybook.js.org/docs/7.0/react/writing-stories/introduction
|
|
15
|
+
var meta = {
|
|
16
|
+
title: "Components/Alert",
|
|
17
|
+
component: AlertDialog,
|
|
18
|
+
tags: ["autodocs"],
|
|
19
|
+
parameters: {
|
|
20
|
+
// More on how to position stories at: https://storybook.js.org/docs/7.0/react/configure/story-layout
|
|
21
|
+
layout: "fullscreen",
|
|
22
|
+
},
|
|
23
|
+
decorators: [
|
|
24
|
+
function (Story) { return (_jsx("div", { className: "p-5 flex w-full", children: _jsx(Story, {}) })); },
|
|
25
|
+
],
|
|
26
|
+
};
|
|
27
|
+
export default meta;
|
|
28
|
+
export var Default = {
|
|
29
|
+
args: {
|
|
30
|
+
// label: "Lorem Ipsum",
|
|
31
|
+
// value: "Lorem Ipsum",
|
|
32
|
+
// fullwidth: true,
|
|
33
|
+
},
|
|
34
|
+
render: function (args) {
|
|
35
|
+
console.log("args ", args);
|
|
36
|
+
var props = __assign({}, args);
|
|
37
|
+
return (_jsx("div", { className: "flex flex-row gap-4 w-full", children: _jsxs(AlertDialog, { children: [_jsx(AlertDialogTrigger, { children: "Open" }), _jsxs(AlertDialogContent, { children: [_jsxs(AlertDialogHeader, { children: [_jsx(AlertDialogTitle, { children: "Are you absolutely sure?" }), _jsx(AlertDialogDescription, { children: "This action cannot be undone. This will permanently delete your account and remove your data from our servers." })] }), _jsxs(AlertDialogFooter, { children: [_jsx(AlertDialogCancel, { children: "Cancel" }), _jsx(AlertDialogAction, { children: "Continue" })] })] })] }) }));
|
|
38
|
+
},
|
|
39
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
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, jsxs as _jsxs } from "react/jsx-runtime";
|
|
25
|
+
import * as React from "react";
|
|
26
|
+
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
|
|
27
|
+
import { cn } from "@/utils/cn";
|
|
28
|
+
import { buttonVariants } from "../Button/Button.styles";
|
|
29
|
+
var AlertDialog = AlertDialogPrimitive.Root;
|
|
30
|
+
var AlertDialogTrigger = AlertDialogPrimitive.Trigger;
|
|
31
|
+
var AlertDialogPortal = AlertDialogPrimitive.Portal;
|
|
32
|
+
var AlertDialogOverlay = React.forwardRef(function (_a, ref) {
|
|
33
|
+
var className = _a.className, props = __rest(_a, ["className"]);
|
|
34
|
+
return (_jsx(AlertDialogPrimitive.Overlay, __assign({ className: cn("fixed inset-0 bg-popup-overlay z-50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", className) }, props, { ref: ref })));
|
|
35
|
+
});
|
|
36
|
+
AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;
|
|
37
|
+
var AlertDialogContent = React.forwardRef(function (_a, ref) {
|
|
38
|
+
var className = _a.className, props = __rest(_a, ["className"]);
|
|
39
|
+
return (_jsxs(AlertDialogPortal, { children: [_jsx(AlertDialogOverlay, {}), _jsx(AlertDialogPrimitive.Content, __assign({ ref: ref, className: cn("fixed text-textcolor-grey-dark left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-6 border bg-popup-background p-8 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-[var(--popup-rounded)]", className) }, props))] }));
|
|
40
|
+
});
|
|
41
|
+
AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;
|
|
42
|
+
var AlertDialogHeader = function (_a) {
|
|
43
|
+
var className = _a.className, props = __rest(_a, ["className"]);
|
|
44
|
+
return (_jsx("div", __assign({ className: cn("flex flex-col space-y-2 text-center sm:text-left", className) }, props)));
|
|
45
|
+
};
|
|
46
|
+
AlertDialogHeader.displayName = "AlertDialogHeader";
|
|
47
|
+
var AlertDialogFooter = function (_a) {
|
|
48
|
+
var className = _a.className, props = __rest(_a, ["className"]);
|
|
49
|
+
return (_jsx("div", __assign({ className: cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className) }, props)));
|
|
50
|
+
};
|
|
51
|
+
AlertDialogFooter.displayName = "AlertDialogFooter";
|
|
52
|
+
var AlertDialogTitle = React.forwardRef(function (_a, ref) {
|
|
53
|
+
var className = _a.className, props = __rest(_a, ["className"]);
|
|
54
|
+
return (_jsx(AlertDialogPrimitive.Title, __assign({ ref: ref, className: cn("typography-h5", className) }, props)));
|
|
55
|
+
});
|
|
56
|
+
AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;
|
|
57
|
+
var AlertDialogDescription = React.forwardRef(function (_a, ref) {
|
|
58
|
+
var className = _a.className, props = __rest(_a, ["className"]);
|
|
59
|
+
return (_jsx(AlertDialogPrimitive.Description, __assign({ ref: ref, className: cn("text-sm", className) }, props)));
|
|
60
|
+
});
|
|
61
|
+
AlertDialogDescription.displayName =
|
|
62
|
+
AlertDialogPrimitive.Description.displayName;
|
|
63
|
+
var AlertDialogAction = React.forwardRef(function (_a, ref) {
|
|
64
|
+
var className = _a.className, props = __rest(_a, ["className"]);
|
|
65
|
+
return (_jsx(AlertDialogPrimitive.Action, __assign({ ref: ref, className: cn(buttonVariants({ fullwidth: false }), className) }, props)));
|
|
66
|
+
});
|
|
67
|
+
AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;
|
|
68
|
+
var AlertDialogCancel = React.forwardRef(function (_a, ref) {
|
|
69
|
+
var className = _a.className, props = __rest(_a, ["className"]);
|
|
70
|
+
return (_jsx(AlertDialogPrimitive.Cancel, __assign({ ref: ref, className: cn(buttonVariants({ fullwidth: false, variant: "outline" }), "mt-2 sm:mt-0", className) }, props)));
|
|
71
|
+
});
|
|
72
|
+
AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;
|
|
73
|
+
export { AlertDialog, AlertDialogPortal, AlertDialogOverlay, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel, };
|
|
@@ -21,11 +21,11 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
23
|
import { Fragment as _Fragment, jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
24
|
+
import { buttonVariants } from "./Button.styles";
|
|
25
|
+
import { cn } from "@/utils/cn";
|
|
26
26
|
var Button = function (_a) {
|
|
27
27
|
var _b = _a.size, size = _b === void 0 ? "md" : _b, _c = _a.color, color = _c === void 0 ? "primary" : _c, _d = _a.variant, variant = _d === void 0 ? "solid" : _d, title = _a.title, children = _a.children, startIcon = _a.startIcon, endIcon = _a.endIcon, _e = _a.disabled, disabled = _e === void 0 ? false : _e, _f = _a.fullwidth, fullwidth = _f === void 0 ? false : _f, _g = _a.isLoading, isLoading = _g === void 0 ? false : _g, className = _a.className, props = __rest(_a, ["size", "color", "variant", "title", "children", "startIcon", "endIcon", "disabled", "fullwidth", "isLoading", "className"]);
|
|
28
28
|
var isDisabled = disabled || isLoading;
|
|
29
|
-
return (_jsx("button", __assign({ type: "button" }, props, { "aria-disabled": isDisabled || undefined, tabIndex: isDisabled ? -1 : 0, className:
|
|
29
|
+
return (_jsx("button", __assign({ type: "button" }, props, { "aria-disabled": isDisabled || undefined, tabIndex: isDisabled ? -1 : 0, className: cn(buttonVariants({ size: size, color: color, variant: variant, disabled: disabled, fullwidth: fullwidth }), className), disabled: isDisabled, children: _jsxs(_Fragment, { children: [startIcon, children || title, endIcon] }) })));
|
|
30
30
|
};
|
|
31
31
|
export default Button;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { cva } from "class-variance-authority";
|
|
2
|
-
export var
|
|
2
|
+
export var buttonVariants = cva([
|
|
3
3
|
// "inline-flex items-center justify-center align-middle no-underline transition-colors ease-in-out duration-300",
|
|
4
4
|
// "font-sans appearance-none select-none rounded-sm border font-medium tracking-[.02857em]",
|
|
5
5
|
// "aria-disabled:pointer-events-none aria-disabled:opacity-50 aria-disabled:cursor-not-allowed",
|
|
@@ -0,0 +1,37 @@
|
|
|
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 CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
27
|
+
import { CheckIcon } from "@heroicons/react/16/solid";
|
|
28
|
+
import { cn } from "@/utils/cn";
|
|
29
|
+
var Checkbox = React.forwardRef(function (_a, ref) {
|
|
30
|
+
var className = _a.className, props = __rest(_a, ["className"]);
|
|
31
|
+
return (_jsx(CheckboxPrimitive.Root, __assign({ ref: ref, className: cn("peer h-4 w-4 shrink-0 rounded-sm border border-primary-30 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:border-socondary-120 disabled:border-socondary-110", {
|
|
32
|
+
"data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground": !props.disabled,
|
|
33
|
+
"bg-grey2-300": props.checked && props.disabled,
|
|
34
|
+
}, className) }, props, { children: _jsx(CheckboxPrimitive.Indicator, { className: cn("flex items-center justify-center text-current"), children: _jsx(CheckIcon, { className: "h-4 w-4" }) }) })));
|
|
35
|
+
});
|
|
36
|
+
Checkbox.displayName = CheckboxPrimitive.Root.displayName;
|
|
37
|
+
export { Checkbox };
|
|
@@ -0,0 +1,49 @@
|
|
|
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";
|
|
14
|
+
var meta = {
|
|
15
|
+
title: "Components/Checkbox",
|
|
16
|
+
component: Checkbox,
|
|
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
|
+
checked: false,
|
|
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("div", { className: "flex items-center space-x-2", children: [_jsx(Checkbox, __assign({ id: "terms" }, props)), _jsx("label", { htmlFor: "terms", className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", children: "Accept terms and conditions" })] }) }));
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
export var WithText = {
|
|
37
|
+
args: {},
|
|
38
|
+
render: function (args) {
|
|
39
|
+
var props = __assign({}, args);
|
|
40
|
+
return (_jsxs("div", { className: "items-top flex space-x-2", children: [_jsx(Checkbox, { id: "terms1" }), _jsxs("div", { className: "grid gap-1.5 leading-none", children: [_jsx("label", { htmlFor: "terms1", className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", children: "Accept terms and conditions" }), _jsx("p", { className: "text-sm text-muted-foreground", children: "You agree to our Terms of Service and Privacy Policy." })] })] }));
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
export var Diabled = {
|
|
44
|
+
args: {},
|
|
45
|
+
render: function (args) {
|
|
46
|
+
var props = __assign({}, args);
|
|
47
|
+
return (_jsxs("div", { className: "flex items-center space-x-2", children: [_jsx(Checkbox, { id: "terms2", disabled: true }), _jsx("label", { htmlFor: "terms2", className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", children: "Accept terms and conditions" })] }));
|
|
48
|
+
},
|
|
49
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
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, jsxs as _jsxs } from "react/jsx-runtime";
|
|
25
|
+
import * as React from "react";
|
|
26
|
+
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
27
|
+
import { XMarkIcon } from "@heroicons/react/16/solid";
|
|
28
|
+
import { cn } from "@/utils/cn";
|
|
29
|
+
var Dialog = DialogPrimitive.Root;
|
|
30
|
+
var DialogTrigger = DialogPrimitive.Trigger;
|
|
31
|
+
var DialogPortal = DialogPrimitive.Portal;
|
|
32
|
+
var DialogClose = DialogPrimitive.Close;
|
|
33
|
+
var DialogOverlay = React.forwardRef(function (_a, ref) {
|
|
34
|
+
var className = _a.className, props = __rest(_a, ["className"]);
|
|
35
|
+
return (_jsx(DialogPrimitive.Overlay, __assign({ ref: ref, className: cn("fixed inset-0 z-50 bg-popup-overlay data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0", className) }, props)));
|
|
36
|
+
});
|
|
37
|
+
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
38
|
+
var DialogContent = React.forwardRef(function (_a, ref) {
|
|
39
|
+
var className = _a.className, children = _a.children, props = __rest(_a, ["className", "children"]);
|
|
40
|
+
return (_jsxs(DialogPortal, { children: [_jsx(DialogOverlay, {}), _jsxs(DialogPrimitive.Content, __assign({ ref: ref, className: cn("fixed text-textcolor-grey-dark left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-[var(--popup-rounded)]", className) }, props, { children: [children, _jsxs(DialogPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [_jsx(XMarkIcon, { className: "h-4 w-4" }), _jsx("span", { className: "sr-only", children: "Close" })] })] }))] }));
|
|
41
|
+
});
|
|
42
|
+
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
43
|
+
var DialogHeader = function (_a) {
|
|
44
|
+
var className = _a.className, props = __rest(_a, ["className"]);
|
|
45
|
+
return (_jsx("div", __assign({ className: cn("flex flex-col space-y-2 text-center sm:text-left", className) }, props)));
|
|
46
|
+
};
|
|
47
|
+
DialogHeader.displayName = "DialogHeader";
|
|
48
|
+
var DialogFooter = function (_a) {
|
|
49
|
+
var className = _a.className, props = __rest(_a, ["className"]);
|
|
50
|
+
return (_jsx("div", __assign({ className: cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className) }, props)));
|
|
51
|
+
};
|
|
52
|
+
DialogFooter.displayName = "DialogFooter";
|
|
53
|
+
var DialogTitle = React.forwardRef(function (_a, ref) {
|
|
54
|
+
var className = _a.className, props = __rest(_a, ["className"]);
|
|
55
|
+
return (_jsx(DialogPrimitive.Title, __assign({ ref: ref, className: cn("typography-h5 tracking-tight", className) }, props)));
|
|
56
|
+
});
|
|
57
|
+
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
58
|
+
var DialogDescription = React.forwardRef(function (_a, ref) {
|
|
59
|
+
var className = _a.className, props = __rest(_a, ["className"]);
|
|
60
|
+
return (_jsx(DialogPrimitive.Description, __assign({ ref: ref, className: cn("text-sm", className) }, props)));
|
|
61
|
+
});
|
|
62
|
+
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
63
|
+
export { Dialog, DialogPortal, DialogOverlay, DialogClose, DialogTrigger, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription, };
|
|
@@ -0,0 +1,52 @@
|
|
|
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 { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, } from "./Dialog";
|
|
14
|
+
import Button from "../Button/Button";
|
|
15
|
+
import { Label } from "../Label/Label";
|
|
16
|
+
import { Input } from "../Input/Input";
|
|
17
|
+
var meta = {
|
|
18
|
+
title: "Components/Dialog",
|
|
19
|
+
component: Dialog,
|
|
20
|
+
tags: ["autodocs"],
|
|
21
|
+
parameters: {
|
|
22
|
+
layout: "fullscreen",
|
|
23
|
+
},
|
|
24
|
+
decorators: [
|
|
25
|
+
function (Story) { return (_jsx("div", { className: "p-5 flex w-full", children: _jsx(Story, {}) })); },
|
|
26
|
+
],
|
|
27
|
+
};
|
|
28
|
+
export default meta;
|
|
29
|
+
export var Default = {
|
|
30
|
+
args: {
|
|
31
|
+
// label: "Lorem Ipsum",
|
|
32
|
+
// value: "Lorem Ipsum",
|
|
33
|
+
// fullwidth: true,
|
|
34
|
+
},
|
|
35
|
+
render: function (args) {
|
|
36
|
+
console.log("args ", args);
|
|
37
|
+
var props = __assign({}, args);
|
|
38
|
+
return (_jsx("div", { className: "flex flex-row gap-4 w-full", children: _jsxs(Dialog, { children: [_jsx(DialogTrigger, { children: "Open" }), _jsx(DialogContent, { children: _jsxs(DialogHeader, { children: [_jsx(DialogTitle, { children: "Are you absolutely sure?" }), _jsx(DialogDescription, { children: "This action cannot be undone. This will permanently delete your account and remove your data from our servers." })] }) })] }) }));
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
export var Demo = {
|
|
42
|
+
args: {
|
|
43
|
+
// label: "Lorem Ipsum",
|
|
44
|
+
// value: "Lorem Ipsum",
|
|
45
|
+
// fullwidth: true,
|
|
46
|
+
},
|
|
47
|
+
render: function (args) {
|
|
48
|
+
console.log("args ", args);
|
|
49
|
+
var props = __assign({}, args);
|
|
50
|
+
return (_jsx("div", { className: "flex flex-row gap-4 w-full", children: _jsxs(Dialog, { children: [_jsx(DialogTrigger, { asChild: true, children: _jsx(Button, { variant: "outline", children: "Edit Profile" }) }), _jsxs(DialogContent, { className: "sm:max-w-[425px]", children: [_jsxs(DialogHeader, { children: [_jsx(DialogTitle, { children: "Edit profile" }), _jsx(DialogDescription, { children: "Make changes to your profile here. Click save when you're done." })] }), _jsxs("div", { className: "grid gap-4 py-4", children: [_jsxs("div", { className: "grid grid-cols-4 items-center gap-4", children: [_jsx(Label, { htmlFor: "name", className: "text-right", children: "Name" }), _jsx(Input, { id: "name", defaultValue: "Pedro Duarte", className: "col-span-3" })] }), _jsxs("div", { className: "grid grid-cols-4 items-center gap-4", children: [_jsx(Label, { htmlFor: "username", className: "text-right", children: "Username" }), _jsx(Input, { id: "username", defaultValue: "@peduarte", className: "col-span-3" })] })] }), _jsx(DialogFooter, { children: _jsx(Button, { type: "submit", children: "Save changes" }) })] })] }) }));
|
|
51
|
+
},
|
|
52
|
+
};
|
|
@@ -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 };
|