@q2devel/q2-storybook 1.0.10 → 1.0.12

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,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,6 @@
1
+ import React from 'react';
2
+ interface HeadingProps {
3
+ text: string;
4
+ }
5
+ declare const Heading: React.FC<HeadingProps>;
6
+ export default Heading;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ var Heading = function (_a) {
3
+ var text = _a.text;
4
+ return React.createElement("h1", null, text);
5
+ };
6
+ export default Heading;
@@ -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 CHANGED
@@ -1,10 +1,3 @@
1
- import './global.css';
2
- export { default as Badge } from './components/badge/Badge';
3
- export { Banner } from './components/banner/Banner';
4
1
  export { default as Button } from './components/button/Button';
5
- export { NavBar } from './components/nav-bar/NavBar';
6
- export { ProductCard } from './components/product-card/ProductCard';
7
- export { default as SelectField } from './components/select-field/SelectField';
8
- export { default as TextField } from './components/text-field/TextField';
2
+ export { default as Badge } from './components/badge/Badge';
9
3
  export { default as ImageWithText } from './components/text-with-image/ImageWithText';
10
- export { buildClassesByJoining } from './utils/StyleHelper';
package/dist/index.js ADDED
@@ -0,0 +1,4 @@
1
+ // src/index.ts
2
+ export { default as Button } from './components/button/Button';
3
+ export { default as Badge } from './components/badge/Badge';
4
+ export { default as ImageWithText } from './components/text-with-image/ImageWithText';
package/dist/main.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";
package/package.json CHANGED
@@ -1,69 +1,55 @@
1
- {
2
- "name": "@q2devel/q2-storybook",
3
- "version": "1.0.10",
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
- "./styles": "./dist/global.css"
13
- },
14
- "files": [
15
- "dist"
16
- ],
17
- "scripts": {
18
- "test": "echo \"Error: no test specified\" && exit 1",
19
- "storybook": "storybook dev -p 6006",
20
- "build-storybook": "storybook build",
21
- "build": "vite build && tsc --emitDeclarationOnly --outDir dist",
22
- "copy-assets": "find src -name '*.css' -exec cp --parents {} dist \\; || xcopy /s /y src\\*.css dist\\",
23
- "postbuild": "npm run copy-assets",
24
- "prepublishOnly": "npm run build"
25
- },
26
- "keywords": [],
27
- "author": "Q2",
28
- "license": "ISC",
29
- "description": "Komponenty nebo konfigurace pro storybook",
30
- "devDependencies": {
31
- "@storybook/addon-actions": "^8.6.12",
32
- "@storybook/addon-essentials": "^8.6.12",
33
- "@storybook/addon-interactions": "^8.6.12",
34
- "@storybook/addon-links": "^8.6.12",
35
- "@storybook/addon-onboarding": "^8.6.12",
36
- "@storybook/blocks": "^8.6.12",
37
- "@storybook/react": "^8.6.12",
38
- "@storybook/react-vite": "^8.6.12",
39
- "@storybook/test": "^8.6.12",
40
- "@types/classnames": "^2.3.0",
41
- "@types/node": "^22.14.1",
42
- "@types/react": "^19.1.2",
43
- "@types/react-dom": "^19.1.2",
44
- "@vitejs/plugin-react": "^4.4.1",
45
- "autoprefixer": "^10.4.21",
46
- "next": "^15.3.2",
47
- "postcss": "^8.5.3",
48
- "react": "^19.1.0",
49
- "react-dom": "^19.1.0",
50
- "storybook": "^8.6.12",
51
- "tailwindcss": "^4.1.4",
52
- "typescript": "^5.8.3",
53
- "vite": "^6.3.5",
54
- "vite-plugin-css-injected-by-js": "^3.5.2",
55
- "vite-plugin-dts": "^4.5.3"
56
- },
57
- "peerDependencies": {
58
- "react": "^19.0.0",
59
- "react-dom": "^19.0.0"
60
- },
61
- "dependencies": {
62
- "@heroicons/react": "^2.2.0",
63
- "@tailwindcss/postcss": "^4.1.4",
64
- "classnames": "^2.5.1",
65
- "html-react-parser": "^5.2.3",
66
- "react-select": "^5.10.1",
67
- "tailwind-merge": "^3.2.0"
68
- }
69
- }
1
+ {
2
+ "name": "@q2devel/q2-storybook",
3
+ "version": "1.0.12",
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
+ }
@@ -1,48 +0,0 @@
1
- import React, { ReactNode } from 'react';
2
- export type BannerItem = {
3
- id: string;
4
- imageSrc: string;
5
- imageAlt?: string;
6
- title: string;
7
- subtitle: string;
8
- buttonText?: string;
9
- buttonLink?: string;
10
- customContent?: ReactNode;
11
- overlayOpacity?: number;
12
- buttonVariant?: 'primary' | 'secondary' | 'ghost' | 'outline';
13
- buttonSize?: 'sm' | 'md' | 'lg';
14
- };
15
- export type ControlsType = 'arrows' | 'dots' | 'both' | 'none';
16
- export type BannerProps = {
17
- items: BannerItem[];
18
- height?: 'sm' | 'md' | 'lg' | 'xl' | 'full' | 'auto';
19
- autoplay?: boolean;
20
- autoplayInterval?: number;
21
- controls?: ControlsType;
22
- overlayStyle?: 'dark' | 'light' | 'gradient' | 'none';
23
- textAlignment?: 'left' | 'center' | 'right';
24
- textPosition?: 'top' | 'center' | 'bottom';
25
- className?: string;
26
- imageClassName?: string;
27
- titleClassName?: string;
28
- subtitleClassName?: string;
29
- buttonClassName?: string;
30
- indicatorsClassName?: string;
31
- controlsClassName?: string;
32
- contentClassName?: string;
33
- rounded?: 'none' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
34
- buttonRounded?: 'none' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
35
- animation?: 'slide' | 'fade' | 'zoom' | 'none';
36
- animationDuration?: number;
37
- pauseOnHover?: boolean;
38
- infiniteLoop?: boolean;
39
- objectFit?: 'cover' | 'contain' | 'fill' | 'none';
40
- objectPosition?: 'center' | 'top' | 'bottom' | 'left' | 'right';
41
- renderItem?: (item: BannerItem, index: number) => ReactNode;
42
- renderControls?: (goToNext: () => void, goToPrev: () => void) => ReactNode;
43
- renderIndicators?: (current: number, total: number, goToSlide: (index: number) => void) => ReactNode;
44
- onSlideChange?: (currentIndex: number, previousIndex: number) => void;
45
- withOverlay?: boolean;
46
- overlayOpacity?: number;
47
- };
48
- export declare const Banner: ({ items, height, autoplay, autoplayInterval, controls, overlayStyle, textAlignment, textPosition, className, imageClassName, titleClassName, subtitleClassName, buttonClassName, indicatorsClassName, controlsClassName, contentClassName, rounded, buttonRounded, animation, animationDuration, pauseOnHover, infiniteLoop, objectFit, objectPosition, renderItem, renderControls, renderIndicators, onSlideChange, withOverlay, overlayOpacity, }: BannerProps) => React.JSX.Element | null;
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- import { SVGProps } from 'react';
3
- export declare const CloseIcon: (props: SVGProps<SVGSVGElement>) => React.JSX.Element;
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- import { SVGProps } from 'react';
3
- export declare const InfoIcon: (props: SVGProps<SVGSVGElement>) => React.JSX.Element;
@@ -1,12 +0,0 @@
1
- import React from "react";
2
- interface LabelProps {
3
- text?: string;
4
- i18nKey?: string;
5
- isRequired?: boolean;
6
- htmlFor?: string;
7
- subtitle?: string;
8
- srOnly?: boolean;
9
- className?: string;
10
- }
11
- declare const Label: ({ text, i18nKey, isRequired, htmlFor, subtitle, srOnly, className, }: LabelProps) => React.JSX.Element | null;
12
- export default Label;
@@ -1,19 +0,0 @@
1
- import React from 'react';
2
- export type NavItem = {
3
- name: string;
4
- href: string;
5
- };
6
- export type NavBarProps = {
7
- items?: NavItem[];
8
- logo?: React.ReactNode;
9
- rightContent?: React.ReactNode;
10
- backgroundColor?: string;
11
- textColor?: string;
12
- activeColor?: string;
13
- mobileMenuBgColor?: string;
14
- containerClassName?: string;
15
- navClassName?: string;
16
- itemClassName?: string;
17
- mobileItemClassName?: string;
18
- };
19
- export declare const NavBar: ({ items, logo, rightContent, backgroundColor, textColor, activeColor, mobileMenuBgColor, containerClassName, navClassName, itemClassName, mobileItemClassName, }: NavBarProps) => React.JSX.Element;
@@ -1,61 +0,0 @@
1
- import React from 'react';
2
- export type Product = {
3
- id: string;
4
- imageSrc: string;
5
- imageAlt: string;
6
- href: string;
7
- name: string;
8
- color?: string;
9
- price: string;
10
- description?: string;
11
- badges?: Array<{
12
- text: string;
13
- color: string;
14
- }>;
15
- };
16
- export type QuantityControlProps = {
17
- quantity: number;
18
- onIncrement: (e: React.MouseEvent) => void;
19
- onDecrement: (e: React.MouseEvent) => void;
20
- minQuantity?: number;
21
- maxQuantity?: number;
22
- controlsClassName?: string;
23
- buttonClassName?: string;
24
- quantityClassName?: string;
25
- };
26
- export type ProductCardProps = {
27
- product: Product;
28
- className?: string;
29
- imageClassName?: string;
30
- contentClassName?: string;
31
- titleClassName?: string;
32
- colorClassName?: string;
33
- priceClassName?: string;
34
- descriptionClassName?: string;
35
- badgeClassName?: string;
36
- aspectRatio?: 'square' | 'auto' | 'video' | 'wide';
37
- imagePosition?: 'top' | 'bottom' | 'center';
38
- imageObjectFit?: 'cover' | 'contain' | 'fill' | 'none';
39
- layout?: 'default' | 'compact' | 'horizontal';
40
- hoverEffect?: 'opacity' | 'scale' | 'shadow' | 'border' | 'none';
41
- renderBadges?: boolean;
42
- renderColor?: boolean;
43
- renderDescription?: boolean;
44
- elevationLevel?: 0 | 1 | 2 | 3;
45
- rounded?: 'none' | 'sm' | 'md' | 'lg' | 'full';
46
- titleLines?: 1 | 2 | 3;
47
- onCardClick?: (product: Product) => void;
48
- onImageClick?: (product: Product) => void;
49
- renderFooter?: (product: Product) => React.ReactNode;
50
- renderHeader?: (product: Product) => React.ReactNode;
51
- actionButton?: React.ReactNode;
52
- showAddButton?: boolean;
53
- initialQuantity?: number;
54
- onQuantityChange?: (product: Product, quantity: number) => void;
55
- addButtonIcon?: React.ReactNode;
56
- maxQuantity?: number;
57
- quantityControlProps?: Partial<QuantityControlProps>;
58
- customAddButton?: React.ReactNode;
59
- customQuantityControl?: React.ReactNode;
60
- };
61
- export declare const ProductCard: ({ product, className, imageClassName, contentClassName, titleClassName, colorClassName, priceClassName, descriptionClassName, badgeClassName, aspectRatio, imagePosition, imageObjectFit, layout, hoverEffect, renderBadges, renderColor, renderDescription, elevationLevel, rounded, titleLines, onCardClick, onImageClick, renderFooter, renderHeader, actionButton, showAddButton, initialQuantity, onQuantityChange, addButtonIcon, maxQuantity, quantityControlProps, customAddButton, customQuantityControl, }: ProductCardProps) => React.JSX.Element;
@@ -1,27 +0,0 @@
1
- import React, { ReactNode, Ref } from 'react';
2
- import { GroupBase, Props, SelectInstance } from 'react-select';
3
- import { TooltipRef } from '../tooltip/Tooltip';
4
- export type SelectFieldSize = 'sm' | 'md' | 'xs' | 'border-sm';
5
- export type SelectFieldProps<Option, Group extends GroupBase<Option> = GroupBase<Option>, IsMulti extends boolean = false> = Omit<Props<Option, IsMulti, Group>, 'className' | 'classNamePrefix' | 'loadOptions'> & {
6
- label?: string;
7
- isRequired?: boolean;
8
- srOnlyLabel?: boolean;
9
- subtitle?: string;
10
- color?: string;
11
- valid?: boolean;
12
- size?: SelectFieldSize;
13
- message?: string;
14
- className?: string;
15
- removePaddingTop?: boolean;
16
- renderMessageInTooltip?: boolean;
17
- selectFieldType?: 'table' | 'default';
18
- placeholder?: string;
19
- tooltipRef?: Ref<TooltipRef>;
20
- disablePortal?: boolean;
21
- tooltipMessage?: ReactNode;
22
- typeSelect?: 'single' | 'multi' | 'single-badges';
23
- badgeLabelClassName?: string;
24
- };
25
- export type SelectFieldRefType<Option, Group extends GroupBase<Option>, IsMulti extends boolean = false> = SelectInstance<Option, IsMulti, Group>;
26
- declare const SelectField: <Option = unknown, Group extends GroupBase<Option> = GroupBase<Option>, IsMulti extends boolean = false>(props: SelectFieldProps<Option, Group, IsMulti> & React.RefAttributes<SelectFieldRefType<Option, Group, IsMulti>>) => React.JSX.Element;
27
- export default SelectField;
@@ -1,5 +0,0 @@
1
- import React from 'react';
2
- import { GroupBase, OptionProps } from 'react-select';
3
- export type SelectFieldOptionProps<Option = unknown, IsMulti extends boolean = false, Group extends GroupBase<Option> = GroupBase<Option>> = OptionProps<Option, IsMulti, Group>;
4
- declare const SelectFieldOption: <Option = unknown, IsMulti extends boolean = false, Group extends GroupBase<Option> = GroupBase<Option>>({ children, data, ...props }: SelectFieldOptionProps<Option, IsMulti, Group>) => React.JSX.Element;
5
- export default SelectFieldOption;
@@ -1,21 +0,0 @@
1
- import { MouseEvent } from 'react';
2
- import { TextFieldType } from './TextField.types';
3
- import React from 'react';
4
- declare const _default: React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "children" | "type" | "size"> & {
5
- label?: string | React.ReactNode;
6
- labelColor?: string;
7
- variant?: import("./TextField.types").TextFieldVariant;
8
- labelType?: import("./TextField.types").TextFieldLabelType;
9
- type?: TextFieldType;
10
- size?: import("./TextField.types").TextFieldSize;
11
- valid?: boolean;
12
- message?: string | React.ReactNode;
13
- messageColor?: string;
14
- background?: string;
15
- leftIcon?: React.ReactNode;
16
- rightIcon?: React.ReactNode;
17
- onLeftIconClick?: (event: MouseEvent<HTMLButtonElement>) => void;
18
- onRightIconClick?: (event: MouseEvent<HTMLButtonElement>) => void;
19
- showPasswordEyeIcon?: boolean;
20
- } & React.RefAttributes<HTMLInputElement>>;
21
- export default _default;
@@ -1,22 +0,0 @@
1
- import React, { MouseEvent } from 'react';
2
- export type TextFieldSize = 'sm' | 'md';
3
- export type TextFieldLabelType = 'outside' | 'inside' | 'overlapping' | 'hidden';
4
- export type TextFieldVariant = 'normal' | 'rounded' | 'flat';
5
- export type TextFieldType = 'text' | 'password' | 'email' | 'number' | 'date' | 'file';
6
- export type TextFieldProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, 'children' | 'type' | 'size'> & {
7
- label?: string | React.ReactNode;
8
- labelColor?: string;
9
- variant?: TextFieldVariant;
10
- labelType?: TextFieldLabelType;
11
- type?: TextFieldType;
12
- size?: TextFieldSize;
13
- valid?: boolean;
14
- message?: string | React.ReactNode;
15
- messageColor?: string;
16
- background?: string;
17
- leftIcon?: React.ReactNode;
18
- rightIcon?: React.ReactNode;
19
- onLeftIconClick?: (event: MouseEvent<HTMLButtonElement>) => void;
20
- onRightIconClick?: (event: MouseEvent<HTMLButtonElement>) => void;
21
- showPasswordEyeIcon?: boolean;
22
- };
@@ -1,18 +0,0 @@
1
- import React from 'react';
2
- import { ReactNode } from 'react';
3
- export interface TooltipRef {
4
- show: () => void;
5
- hide: () => void;
6
- }
7
- interface TooltipProps {
8
- content?: ReactNode;
9
- children: ReactNode;
10
- backgroundColor?: string;
11
- textColor?: string;
12
- placement?: 'top' | 'bottom' | 'left' | 'right';
13
- contentClassName?: string;
14
- disabled?: boolean;
15
- lazy?: boolean;
16
- }
17
- declare const Tooltip: React.ForwardRefExoticComponent<TooltipProps & React.RefAttributes<TooltipRef>>;
18
- export default Tooltip;
package/dist/global.css DELETED
@@ -1 +0,0 @@
1
- @import "tailwindcss";