@q2devel/q2-storybook 1.0.0
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/components/badge/Badge.d.ts +12 -0
- package/dist/components/badge/Badge.js +8 -0
- package/dist/components/button/Button.d.ts +9 -0
- package/dist/components/button/Button.js +7 -0
- package/dist/components/text-with-image/ImageWithText.d.ts +14 -0
- package/dist/components/text-with-image/ImageWithText.js +15 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +4 -0
- package/dist/main.d.ts +0 -0
- package/dist/main.js +1 -0
- package/package.json +55 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { MouseEvent, ReactNode } from 'react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
interface BadgeProps {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
onClick?: (e: MouseEvent) => void;
|
|
6
|
+
color?: string;
|
|
7
|
+
className?: string;
|
|
8
|
+
labelClassName?: string;
|
|
9
|
+
rightIcon?: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
declare const Badge: ({ children, onClick, color, className, labelClassName, rightIcon, }: BadgeProps) => React.JSX.Element;
|
|
12
|
+
export default Badge;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
var Badge = function (_a) {
|
|
3
|
+
var children = _a.children, onClick = _a.onClick, _b = _a.color, color = _b === void 0 ? 'bg-blue-100 text-blue-800' : _b, _c = _a.className, className = _c === void 0 ? '' : _c, _d = _a.labelClassName, labelClassName = _d === void 0 ? '' : _d, rightIcon = _a.rightIcon;
|
|
4
|
+
return (React.createElement("span", { className: "inline-flex items-center rounded px-2.5 py-0.5 text-xs font-medium ".concat(color, " ").concat(className), onClick: onClick },
|
|
5
|
+
React.createElement("span", { className: labelClassName }, children),
|
|
6
|
+
rightIcon && React.createElement("span", { className: "ml-1" }, rightIcon)));
|
|
7
|
+
};
|
|
8
|
+
export default Badge;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// src/components/Button.tsx
|
|
2
|
+
import React from 'react';
|
|
3
|
+
var Button = function (_a) {
|
|
4
|
+
var onClick = _a.onClick, label = _a.label, _b = _a.variant, variant = _b === void 0 ? 'primary' : _b, _c = _a.disabled, disabled = _c === void 0 ? false : _c;
|
|
5
|
+
return (React.createElement("button", { onClick: onClick, className: "px-4 py-2 rounded text-white cursor-pointer ".concat(variant === 'primary' ? 'bg-blue-500' : 'bg-gray-500', " ").concat(disabled ? 'opacity-50 cursor-not-allowed' : ''), disabled: disabled }, label));
|
|
6
|
+
};
|
|
7
|
+
export default Button;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type ImageWithTextProps = {
|
|
3
|
+
title: string;
|
|
4
|
+
text: string;
|
|
5
|
+
imageSrc: string;
|
|
6
|
+
imageAlt: string;
|
|
7
|
+
inverted?: boolean;
|
|
8
|
+
button?: {
|
|
9
|
+
label: string;
|
|
10
|
+
href: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
declare const ImageWithText: React.FC<ImageWithTextProps>;
|
|
14
|
+
export default ImageWithText;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import HTMLReactParser from 'html-react-parser';
|
|
4
|
+
var ImageWithText = function (_a) {
|
|
5
|
+
var title = _a.title, text = _a.text, imageSrc = _a.imageSrc, imageAlt = _a.imageAlt, _b = _a.inverted, inverted = _b === void 0 ? false : _b, button = _a.button;
|
|
6
|
+
return (React.createElement("section", { className: "relative ".concat(inverted ? 'bg-white text-black' : 'bg-[var(--color-text-dark)] text-white') },
|
|
7
|
+
React.createElement("div", { className: "flex flex-col ".concat(inverted ? 'lg:flex-row-reverse' : 'lg:flex-row', " items-center justify-center") },
|
|
8
|
+
React.createElement("div", { className: "w-full lg:w-1/2 h-64 lg:h-auto overflow-hidden" },
|
|
9
|
+
React.createElement("img", { src: imageSrc, alt: imageAlt, loading: "lazy", className: "w-full h-full object-cover" })),
|
|
10
|
+
React.createElement("div", { className: "w-full text-black lg:w-1/2 px-6 py-10 flex flex-col gap-4" },
|
|
11
|
+
React.createElement("h2", { className: "text-2xl font-semibold uppercase border-b pb-2" }, title),
|
|
12
|
+
React.createElement("div", { className: "[&_p]:text-sm [&_p]:lg:text-base [&_p]:leading-relaxed" }, HTMLReactParser(text)),
|
|
13
|
+
button && (React.createElement("a", { href: button.href, className: "inline-block mt-4 px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600 transition" }, button.label))))));
|
|
14
|
+
};
|
|
15
|
+
export default ImageWithText;
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
package/dist/main.d.ts
ADDED
|
File without changes
|
package/dist/main.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
package/package.json
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@q2devel/q2-storybook",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"main": "dist/index.js",
|
|
5
|
+
"module": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"import": "./dist/index.js",
|
|
10
|
+
"require": "./dist/index.js"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"dist"
|
|
15
|
+
],
|
|
16
|
+
"scripts": {
|
|
17
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
18
|
+
"storybook": "storybook dev -p 6006",
|
|
19
|
+
"build-storybook": "storybook build",
|
|
20
|
+
"build": "tsc"
|
|
21
|
+
},
|
|
22
|
+
"keywords": [],
|
|
23
|
+
"author": "Q2",
|
|
24
|
+
"license": "ISC",
|
|
25
|
+
"description": "Komponenty nebo konfigurace pro storybook",
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@storybook/addon-actions": "^8.6.12",
|
|
28
|
+
"@storybook/addon-essentials": "^8.6.12",
|
|
29
|
+
"@storybook/addon-interactions": "^8.6.12",
|
|
30
|
+
"@storybook/addon-links": "^8.6.12",
|
|
31
|
+
"@storybook/addon-onboarding": "^8.6.12",
|
|
32
|
+
"@storybook/blocks": "^8.6.12",
|
|
33
|
+
"@storybook/react": "^8.6.12",
|
|
34
|
+
"@storybook/react-vite": "^8.6.12",
|
|
35
|
+
"@storybook/test": "^8.6.12",
|
|
36
|
+
"@types/node": "^22.14.1",
|
|
37
|
+
"@types/react": "^19.1.2",
|
|
38
|
+
"@types/react-dom": "^19.1.2",
|
|
39
|
+
"autoprefixer": "^10.4.21",
|
|
40
|
+
"postcss": "^8.5.3",
|
|
41
|
+
"react": "^19.1.0",
|
|
42
|
+
"react-dom": "^19.1.0",
|
|
43
|
+
"storybook": "^8.6.12",
|
|
44
|
+
"tailwindcss": "^4.1.4",
|
|
45
|
+
"typescript": "^5.8.3"
|
|
46
|
+
},
|
|
47
|
+
"peerDependencies": {
|
|
48
|
+
"react": "^19.0.0",
|
|
49
|
+
"react-dom": "^19.0.0"
|
|
50
|
+
},
|
|
51
|
+
"dependencies": {
|
|
52
|
+
"@tailwindcss/postcss": "^4.1.4",
|
|
53
|
+
"html-react-parser": "^5.2.3"
|
|
54
|
+
}
|
|
55
|
+
}
|