@appcorp/shadcn 1.0.16 → 1.0.18

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.
@@ -0,0 +1,25 @@
1
+ import React from "react";
2
+ import { type VariantProps } from "class-variance-authority";
3
+ import { Label } from "./label";
4
+ declare function FieldSet({ className, ...props }: React.ComponentProps<"fieldset">): React.JSX.Element;
5
+ declare function FieldLegend({ className, variant, ...props }: React.ComponentProps<"legend"> & {
6
+ variant?: "legend" | "label";
7
+ }): React.JSX.Element;
8
+ declare function FieldGroup({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
9
+ declare const fieldVariants: (props?: ({
10
+ orientation?: "horizontal" | "vertical" | "responsive" | null | undefined;
11
+ } & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
12
+ declare function Field({ className, orientation, ...props }: React.ComponentProps<"div"> & VariantProps<typeof fieldVariants>): React.JSX.Element;
13
+ declare function FieldContent({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
14
+ declare function FieldLabel({ className, ...props }: React.ComponentProps<typeof Label>): React.JSX.Element;
15
+ declare function FieldTitle({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
16
+ declare function FieldDescription({ className, ...props }: React.ComponentProps<"p">): React.JSX.Element;
17
+ declare function FieldSeparator({ children, className, ...props }: React.ComponentProps<"div"> & {
18
+ children?: React.ReactNode;
19
+ }): React.JSX.Element;
20
+ declare function FieldError({ className, children, errors, ...props }: React.ComponentProps<"div"> & {
21
+ errors?: Array<{
22
+ message?: string;
23
+ } | undefined>;
24
+ }): React.JSX.Element | null;
25
+ export { Field, FieldLabel, FieldDescription, FieldError, FieldGroup, FieldLegend, FieldSeparator, FieldSet, FieldContent, FieldTitle, };
@@ -0,0 +1,153 @@
1
+ "use client";
2
+ "use strict";
3
+ var __assign = (this && this.__assign) || function () {
4
+ __assign = Object.assign || function(t) {
5
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
6
+ s = arguments[i];
7
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
8
+ t[p] = s[p];
9
+ }
10
+ return t;
11
+ };
12
+ return __assign.apply(this, arguments);
13
+ };
14
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
15
+ if (k2 === undefined) k2 = k;
16
+ var desc = Object.getOwnPropertyDescriptor(m, k);
17
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
18
+ desc = { enumerable: true, get: function() { return m[k]; } };
19
+ }
20
+ Object.defineProperty(o, k2, desc);
21
+ }) : (function(o, m, k, k2) {
22
+ if (k2 === undefined) k2 = k;
23
+ o[k2] = m[k];
24
+ }));
25
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
26
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
27
+ }) : function(o, v) {
28
+ o["default"] = v;
29
+ });
30
+ var __importStar = (this && this.__importStar) || (function () {
31
+ var ownKeys = function(o) {
32
+ ownKeys = Object.getOwnPropertyNames || function (o) {
33
+ var ar = [];
34
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
35
+ return ar;
36
+ };
37
+ return ownKeys(o);
38
+ };
39
+ return function (mod) {
40
+ if (mod && mod.__esModule) return mod;
41
+ var result = {};
42
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
43
+ __setModuleDefault(result, mod);
44
+ return result;
45
+ };
46
+ })();
47
+ var __rest = (this && this.__rest) || function (s, e) {
48
+ var t = {};
49
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
50
+ t[p] = s[p];
51
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
52
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
53
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
54
+ t[p[i]] = s[p[i]];
55
+ }
56
+ return t;
57
+ };
58
+ Object.defineProperty(exports, "__esModule", { value: true });
59
+ exports.Field = Field;
60
+ exports.FieldLabel = FieldLabel;
61
+ exports.FieldDescription = FieldDescription;
62
+ exports.FieldError = FieldError;
63
+ exports.FieldGroup = FieldGroup;
64
+ exports.FieldLegend = FieldLegend;
65
+ exports.FieldSeparator = FieldSeparator;
66
+ exports.FieldSet = FieldSet;
67
+ exports.FieldContent = FieldContent;
68
+ exports.FieldTitle = FieldTitle;
69
+ var react_1 = __importStar(require("react"));
70
+ var class_variance_authority_1 = require("class-variance-authority");
71
+ var utils_1 = require("../lib/utils");
72
+ var label_1 = require("./label");
73
+ var separator_1 = require("./separator");
74
+ function FieldSet(_a) {
75
+ var className = _a.className, props = __rest(_a, ["className"]);
76
+ return (react_1.default.createElement("fieldset", __assign({ "data-slot": "field-set", className: (0, utils_1.cn)("flex flex-col gap-6", "has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3", className) }, props)));
77
+ }
78
+ function FieldLegend(_a) {
79
+ var className = _a.className, _b = _a.variant, variant = _b === void 0 ? "legend" : _b, props = __rest(_a, ["className", "variant"]);
80
+ return (react_1.default.createElement("legend", __assign({ "data-slot": "field-legend", "data-variant": variant, className: (0, utils_1.cn)("mb-3 font-medium", "data-[variant=legend]:text-base", "data-[variant=label]:text-sm", className) }, props)));
81
+ }
82
+ function FieldGroup(_a) {
83
+ var className = _a.className, props = __rest(_a, ["className"]);
84
+ return (react_1.default.createElement("div", __assign({ "data-slot": "field-group", className: (0, utils_1.cn)("group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4", className) }, props)));
85
+ }
86
+ var fieldVariants = (0, class_variance_authority_1.cva)("group/field data-[invalid=true]:text-destructive flex w-full gap-3", {
87
+ variants: {
88
+ orientation: {
89
+ vertical: ["flex-col [&>*]:w-full [&>.sr-only]:w-auto"],
90
+ horizontal: [
91
+ "flex-row items-center",
92
+ "[&>[data-slot=field-label]]:flex-auto",
93
+ "has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px has-[>[data-slot=field-content]]:items-start",
94
+ ],
95
+ responsive: [
96
+ "@md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto flex-col [&>*]:w-full [&>.sr-only]:w-auto",
97
+ "@md/field-group:[&>[data-slot=field-label]]:flex-auto",
98
+ "@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
99
+ ],
100
+ },
101
+ },
102
+ defaultVariants: {
103
+ orientation: "vertical",
104
+ },
105
+ });
106
+ function Field(_a) {
107
+ var className = _a.className, _b = _a.orientation, orientation = _b === void 0 ? "vertical" : _b, props = __rest(_a, ["className", "orientation"]);
108
+ return (react_1.default.createElement("div", __assign({ role: "group", "data-slot": "field", "data-orientation": orientation, className: (0, utils_1.cn)(fieldVariants({ orientation: orientation }), className) }, props)));
109
+ }
110
+ function FieldContent(_a) {
111
+ var className = _a.className, props = __rest(_a, ["className"]);
112
+ return (react_1.default.createElement("div", __assign({ "data-slot": "field-content", className: (0, utils_1.cn)("group/field-content flex flex-1 flex-col gap-1.5 leading-snug", className) }, props)));
113
+ }
114
+ function FieldLabel(_a) {
115
+ var className = _a.className, props = __rest(_a, ["className"]);
116
+ return (react_1.default.createElement(label_1.Label, __assign({ "data-slot": "field-label", className: (0, utils_1.cn)("group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50", "has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>[data-slot=field]]:p-4", "has-data-[state=checked]:bg-primary/5 has-data-[state=checked]:border-primary dark:has-data-[state=checked]:bg-primary/10", className) }, props)));
117
+ }
118
+ function FieldTitle(_a) {
119
+ var className = _a.className, props = __rest(_a, ["className"]);
120
+ return (react_1.default.createElement("div", __assign({ "data-slot": "field-label", className: (0, utils_1.cn)("flex w-fit items-center gap-2 text-sm font-medium leading-snug group-data-[disabled=true]/field:opacity-50", className) }, props)));
121
+ }
122
+ function FieldDescription(_a) {
123
+ var className = _a.className, props = __rest(_a, ["className"]);
124
+ return (react_1.default.createElement("p", __assign({ "data-slot": "field-description", className: (0, utils_1.cn)("text-muted-foreground text-sm font-normal leading-normal group-has-[[data-orientation=horizontal]]/field:text-balance", "nth-last-2:-mt-1 last:mt-0 [[data-variant=legend]+&]:-mt-1.5", "[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4", className) }, props)));
125
+ }
126
+ function FieldSeparator(_a) {
127
+ var children = _a.children, className = _a.className, props = __rest(_a, ["children", "className"]);
128
+ return (react_1.default.createElement("div", __assign({ "data-slot": "field-separator", "data-content": !!children, className: (0, utils_1.cn)("relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2", className) }, props),
129
+ react_1.default.createElement(separator_1.Separator, { className: "absolute inset-0 top-1/2" }),
130
+ children && (react_1.default.createElement("span", { className: "bg-background text-muted-foreground relative mx-auto block w-fit px-2", "data-slot": "field-separator-content" }, children))));
131
+ }
132
+ function FieldError(_a) {
133
+ var className = _a.className, children = _a.children, errors = _a.errors, props = __rest(_a, ["className", "children", "errors"]);
134
+ var content = (0, react_1.useMemo)(function () {
135
+ var _a;
136
+ if (children) {
137
+ return children;
138
+ }
139
+ if (!errors) {
140
+ return null;
141
+ }
142
+ if ((errors === null || errors === void 0 ? void 0 : errors.length) === 1 && ((_a = errors[0]) === null || _a === void 0 ? void 0 : _a.message)) {
143
+ return errors[0].message;
144
+ }
145
+ return (react_1.default.createElement("ul", { className: "ml-4 flex list-disc flex-col gap-1" }, errors.map(function (error, index) {
146
+ return (error === null || error === void 0 ? void 0 : error.message) && react_1.default.createElement("li", { key: index }, error.message);
147
+ })));
148
+ }, [children, errors]);
149
+ if (!content) {
150
+ return null;
151
+ }
152
+ return (react_1.default.createElement("div", __assign({ role: "alert", "data-slot": "field-error", className: (0, utils_1.cn)("text-destructive text-sm font-normal", className) }, props), content));
153
+ }
@@ -9,6 +9,7 @@ export declare function NavMain({ items, }: {
9
9
  subItems?: {
10
10
  title: string;
11
11
  url: string;
12
+ isActive: boolean;
12
13
  }[];
13
14
  }[];
14
15
  }): React.JSX.Element;
@@ -18,12 +18,12 @@ function NavMain(_a) {
18
18
  return (react_1.default.createElement(collapsible_1.Collapsible, { key: item.title, asChild: true, defaultOpen: item.isActive, className: "group/collapsible" },
19
19
  react_1.default.createElement(sidebar_1.SidebarMenuItem, null,
20
20
  react_1.default.createElement(collapsible_1.CollapsibleTrigger, { asChild: true },
21
- react_1.default.createElement(sidebar_1.SidebarMenuButton, { tooltip: item.title, className: item.isActive ? "bg-gray-200" : "" },
21
+ react_1.default.createElement(sidebar_1.SidebarMenuButton, { tooltip: item.title, className: item.isActive ? "bg-gray-300" : "" },
22
22
  item.icon && react_1.default.createElement(item.icon, null),
23
23
  react_1.default.createElement("span", null, item.title),
24
24
  (item === null || item === void 0 ? void 0 : item.subItems) && ((_a = item === null || item === void 0 ? void 0 : item.subItems) === null || _a === void 0 ? void 0 : _a.length) > 0 && (react_1.default.createElement(lucide_react_1.ChevronRight, { className: "ml-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90" })))),
25
25
  (item === null || item === void 0 ? void 0 : item.subItems) && ((_b = item === null || item === void 0 ? void 0 : item.subItems) === null || _b === void 0 ? void 0 : _b.length) > 0 && (react_1.default.createElement(collapsible_1.CollapsibleContent, null,
26
- react_1.default.createElement(sidebar_1.SidebarMenuSub, null, (_c = item.subItems) === null || _c === void 0 ? void 0 : _c.map(function (subItem) { return (react_1.default.createElement(sidebar_1.SidebarMenuSubItem, { key: subItem.title },
26
+ react_1.default.createElement(sidebar_1.SidebarMenuSub, null, (_c = item.subItems) === null || _c === void 0 ? void 0 : _c.map(function (subItem) { return (react_1.default.createElement(sidebar_1.SidebarMenuSubItem, { key: subItem.title, className: "rounded-md ".concat(subItem.isActive ? "bg-gray-200" : "") },
27
27
  react_1.default.createElement(sidebar_1.SidebarMenuSubButton, { asChild: true },
28
28
  react_1.default.createElement("a", { href: subItem.url },
29
29
  react_1.default.createElement("span", null, subItem.title))))); })))))));
@@ -13,6 +13,7 @@ export interface DashboardNavItem {
13
13
  subItems: Array<{
14
14
  title: string;
15
15
  url: string;
16
+ isActive: boolean;
16
17
  }>;
17
18
  }
18
19
  export interface AppItem {
@@ -35,50 +35,59 @@ exports.adminDashboardData = {
35
35
  title: "Dashboard",
36
36
  url: "",
37
37
  icon: lucide_react_1.SquareTerminal,
38
- isActive: true,
38
+ isActive: false,
39
39
  subItems: [],
40
40
  },
41
41
  {
42
42
  title: "Flashcard Category",
43
43
  url: "#",
44
44
  icon: lucide_react_1.Bot,
45
- isActive: false,
45
+ isActive: true,
46
46
  subItems: [
47
47
  {
48
48
  title: "Manage",
49
49
  url: "",
50
+ isActive: true,
50
51
  },
51
52
  {
52
53
  title: "Toddler / Early childhood",
53
54
  url: "#",
55
+ isActive: false,
54
56
  },
55
57
  {
56
58
  title: "Preschool / Pre-kindergarten",
57
59
  url: "#",
60
+ isActive: false,
58
61
  },
59
62
  {
60
63
  title: "Kindergarten",
61
64
  url: "#",
65
+ isActive: false,
62
66
  },
63
67
  {
64
68
  title: "Grade / Standard 1",
65
69
  url: "#",
70
+ isActive: false,
66
71
  },
67
72
  {
68
73
  title: "Grade / Standard 2",
69
74
  url: "#",
75
+ isActive: false,
70
76
  },
71
77
  {
72
78
  title: "Grade / Standard 3",
73
79
  url: "#",
80
+ isActive: false,
74
81
  },
75
82
  {
76
83
  title: "Grade / Standard 4",
77
84
  url: "#",
85
+ isActive: false,
78
86
  },
79
87
  {
80
88
  title: "Grade / Standard 5",
81
89
  url: "#",
90
+ isActive: false,
82
91
  },
83
92
  ],
84
93
  },
@@ -91,34 +100,42 @@ exports.adminDashboardData = {
91
100
  {
92
101
  title: "Toddler / Early childhood",
93
102
  url: "#",
103
+ isActive: false,
94
104
  },
95
105
  {
96
106
  title: "Preschool / Pre-kindergarten",
97
107
  url: "#",
108
+ isActive: false,
98
109
  },
99
110
  {
100
111
  title: "Kindergarten",
101
112
  url: "#",
113
+ isActive: false,
102
114
  },
103
115
  {
104
116
  title: "Grade / Standard 1",
105
117
  url: "#",
118
+ isActive: false,
106
119
  },
107
120
  {
108
121
  title: "Grade / Standard 2",
109
122
  url: "#",
123
+ isActive: false,
110
124
  },
111
125
  {
112
126
  title: "Grade / Standard 3",
113
127
  url: "#",
128
+ isActive: false,
114
129
  },
115
130
  {
116
131
  title: "Grade / Standard 4",
117
132
  url: "#",
133
+ isActive: false,
118
134
  },
119
135
  {
120
136
  title: "Grade / Standard 5",
121
137
  url: "#",
138
+ isActive: false,
122
139
  },
123
140
  ],
124
141
  },
@@ -131,18 +148,22 @@ exports.adminDashboardData = {
131
148
  {
132
149
  title: "Introduction",
133
150
  url: "#",
151
+ isActive: false,
134
152
  },
135
153
  {
136
154
  title: "Get Started",
137
155
  url: "#",
156
+ isActive: false,
138
157
  },
139
158
  {
140
159
  title: "Tutorials",
141
160
  url: "#",
161
+ isActive: false,
142
162
  },
143
163
  {
144
164
  title: "Changelog",
145
165
  url: "#",
166
+ isActive: false,
146
167
  },
147
168
  ],
148
169
  },
@@ -155,10 +176,12 @@ exports.adminDashboardData = {
155
176
  {
156
177
  title: "General",
157
178
  url: "#",
179
+ isActive: false,
158
180
  },
159
181
  {
160
182
  title: "Kids",
161
183
  url: "#",
184
+ isActive: false,
162
185
  },
163
186
  ],
164
187
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appcorp/shadcn",
3
- "version": "1.0.16",
3
+ "version": "1.0.18",
4
4
  "scripts": {
5
5
  "build:next": "next build",
6
6
  "build:storybook": "storybook build -c .storybook -o .out",