@appcorp/shadcn 1.0.36 → 1.0.38
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/components/audio.d.ts +11 -0
- package/components/audio.js +21 -0
- package/components/switch.d.ts +1 -0
- package/components/switch.js +4 -2
- package/package.json +6 -6
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface AudioControlProps {
|
|
3
|
+
audioUrl: string | null;
|
|
4
|
+
id: string;
|
|
5
|
+
label?: string;
|
|
6
|
+
onDelete: () => void;
|
|
7
|
+
onGenerate: () => void;
|
|
8
|
+
required?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare const AudioControl: React.FC<AudioControlProps>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.AudioControl = void 0;
|
|
8
|
+
var react_1 = __importDefault(require("react"));
|
|
9
|
+
var button_1 = require("./button");
|
|
10
|
+
var label_1 = require("./label");
|
|
11
|
+
var AudioControl = function (_a) {
|
|
12
|
+
var audioUrl = _a.audioUrl, id = _a.id, label = _a.label, onDelete = _a.onDelete, onGenerate = _a.onGenerate, _b = _a.required, required = _b === void 0 ? false : _b;
|
|
13
|
+
return (react_1.default.createElement("div", { className: "space-y-2" },
|
|
14
|
+
label && (react_1.default.createElement(label_1.Label, { htmlFor: id, required: required }, label)),
|
|
15
|
+
!audioUrl && (react_1.default.createElement("div", { className: "flex gap-2" },
|
|
16
|
+
react_1.default.createElement(button_1.Button, { type: "button", onClick: onGenerate, variant: "outline", className: "flex-1" }, "Generate Audio"),
|
|
17
|
+
react_1.default.createElement(button_1.Button, { type: "button", onClick: onDelete, variant: "destructive", className: "flex-1" }, "Delete Audio"))),
|
|
18
|
+
audioUrl && (react_1.default.createElement("div", { className: "mt-2 rounded-md border border-gray-200 bg-gray-50 p-3" },
|
|
19
|
+
react_1.default.createElement("audio", { controls: true, className: "w-full", src: audioUrl }, "Your browser does not support the audio element.")))));
|
|
20
|
+
};
|
|
21
|
+
exports.AudioControl = AudioControl;
|
package/components/switch.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ interface SwitchProps extends React.ComponentProps<typeof SwitchPrimitive.Root>
|
|
|
4
4
|
error?: string;
|
|
5
5
|
info?: string;
|
|
6
6
|
label?: string;
|
|
7
|
+
description?: string;
|
|
7
8
|
}
|
|
8
9
|
declare const Switch: React.ForwardRefExoticComponent<Omit<SwitchProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
9
10
|
export { Switch };
|
package/components/switch.js
CHANGED
|
@@ -62,7 +62,7 @@ var SwitchPrimitive = __importStar(require("@radix-ui/react-switch"));
|
|
|
62
62
|
var utils_1 = require("../lib/utils");
|
|
63
63
|
var label_1 = require("./label");
|
|
64
64
|
var Switch = React.forwardRef(function (_a, ref) {
|
|
65
|
-
var className = _a.className, error = _a.error, info = _a.info, label = _a.label, required = _a.required, id = _a.id, props = __rest(_a, ["className", "error", "info", "label", "required", "id"]);
|
|
65
|
+
var className = _a.className, error = _a.error, info = _a.info, label = _a.label, required = _a.required, id = _a.id, description = _a.description, props = __rest(_a, ["className", "error", "info", "label", "required", "id", "description"]);
|
|
66
66
|
// Determine if there's an error (for aria-invalid and styling)
|
|
67
67
|
var hasError = Boolean(error);
|
|
68
68
|
var switchElement = (React.createElement(SwitchPrimitive.Root, __assign({ ref: ref, id: id, "data-slot": "switch", "aria-invalid": hasError, required: required, className: (0, utils_1.cn)("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
|
|
@@ -76,7 +76,9 @@ var Switch = React.forwardRef(function (_a, ref) {
|
|
|
76
76
|
if (label) {
|
|
77
77
|
return (React.createElement("div", { className: "w-full space-y-2" },
|
|
78
78
|
React.createElement("div", { className: "flex items-center justify-between space-x-2" },
|
|
79
|
-
React.createElement(
|
|
79
|
+
React.createElement("div", null,
|
|
80
|
+
React.createElement(label_1.Label, { htmlFor: id, required: required }, label),
|
|
81
|
+
description && (React.createElement("p", { className: "text-sm text-gray-400" }, description))),
|
|
80
82
|
switchElement),
|
|
81
83
|
(error || info) && (React.createElement("div", null, error ? (React.createElement("p", { className: "text-xs text-destructive" }, error)) : info ? (React.createElement("p", { className: "text-xs text-blue-600 dark:text-blue-400" }, info)) : null))));
|
|
82
84
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@appcorp/shadcn",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.38",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build:next": "next build",
|
|
6
6
|
"build:storybook": "storybook build -c .storybook -o .out",
|
|
@@ -48,9 +48,9 @@
|
|
|
48
48
|
"@radix-ui/react-separator": "^1.1.7",
|
|
49
49
|
"@radix-ui/react-slot": "^1.2.3",
|
|
50
50
|
"@radix-ui/react-switch": "^1.2.6",
|
|
51
|
-
"@storybook/addon-docs": "^10.0.
|
|
52
|
-
"@storybook/addon-onboarding": "^10.0.
|
|
53
|
-
"@storybook/nextjs": "^10.0.
|
|
51
|
+
"@storybook/addon-docs": "^10.0.6",
|
|
52
|
+
"@storybook/addon-onboarding": "^10.0.6",
|
|
53
|
+
"@storybook/nextjs": "^10.0.6",
|
|
54
54
|
"@tailwindcss/postcss": "^4.1.14",
|
|
55
55
|
"@tanstack/react-table": "^8.21.3",
|
|
56
56
|
"@testing-library/dom": "^10.4.1",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"eslint": "^9.37.0",
|
|
75
75
|
"eslint-config-next": "^15.5.5",
|
|
76
76
|
"eslint-config-prettier": "^10.1.8",
|
|
77
|
-
"eslint-plugin-storybook": "10.0.
|
|
77
|
+
"eslint-plugin-storybook": "10.0.6",
|
|
78
78
|
"husky": "^9.1.7",
|
|
79
79
|
"jest": "^30.2.0",
|
|
80
80
|
"jest-environment-jsdom": "^30.2.0",
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
"react-hook-form": "^7.65.0",
|
|
95
95
|
"rimraf": "^6.0.1",
|
|
96
96
|
"sonner": "^2.0.7",
|
|
97
|
-
"storybook": "^10.0.
|
|
97
|
+
"storybook": "^10.0.6",
|
|
98
98
|
"tailwind-merge": "^3.3.1",
|
|
99
99
|
"tailwindcss": "3",
|
|
100
100
|
"ts-node": "^10.9.2",
|