@q2devel/q2-storybook 1.0.101 → 1.0.102

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.
@@ -17,5 +17,6 @@ export type ContactFormProps = {
17
17
  onSubmit?: (data: ContactFormData) => void;
18
18
  subject?: string;
19
19
  webformId?: string;
20
+ label?: string;
20
21
  };
21
- export default function ContactForm({ title, darkMode, backgroundColor, textColor, buttonText, onSubmit, subject, webformId, }: ContactFormProps): import("react/jsx-runtime").JSX.Element;
22
+ export default function ContactForm({ title, darkMode, backgroundColor, textColor, buttonText, onSubmit, subject, webformId, label }: ContactFormProps): import("react/jsx-runtime").JSX.Element;
@@ -3,7 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { useState } from "react";
4
4
  import TextField from "../text-field/TextField";
5
5
  import TextArea from "../text-area/TextArea";
6
- export default function ContactForm({ title, darkMode = false, backgroundColor, textColor, buttonText = "ODESLAT", onSubmit, subject, webformId = "contact", }) {
6
+ export default function ContactForm({ title, darkMode = false, backgroundColor, textColor, buttonText = "ODESLAT", onSubmit, subject, webformId = "contact", label = "Souhlas s použitím osobních údajů" }) {
7
7
  const [agreed, setAgreed] = useState(false);
8
8
  const [formData, setFormData] = useState({
9
9
  webform_id: webformId,
@@ -74,8 +74,8 @@ export default function ContactForm({ title, darkMode = false, backgroundColor,
74
74
  };
75
75
  const iconPaths = darkMode ? iconPathsDark : iconPathsLight;
76
76
  const styles = colorMap[darkMode ? "dark" : "light"] ?? colorMap.dark;
77
- return (_jsxs("form", { onSubmit: handleSubmit, className: `${styles.background} ${styles.text} py-6 md:py-10 rounded-md mx-auto space-y-6`, children: [title && (_jsxs("h2", { className: styles.titleStyle, children: [title.split(" ").slice(0, -1).join(" "), " ", _jsx("span", { className: "text-[#c26b38]", children: title.split(" ").slice(-1) })] })), _jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [_jsx(TextField, { type: "text", placeholder: "Jm\u00E9no", required: true, variant: "flat", color: styles.colorMode, value: formData.name, onChange: (e) => handleInputChange("name", e.target.value), leftIcon: _jsx("img", { src: iconPaths.person, alt: "User icon", className: `min-h-9.5 min-w-9.5 -ml-3 ${styles.icon}` }), className: `${styles.border} bg-transparent ${styles.placeholder}` }), _jsx(TextField, { type: "text", placeholder: "Firma", variant: "flat", color: styles.colorMode, value: formData.company, onChange: (e) => handleInputChange("company", e.target.value), leftIcon: _jsx("img", { src: iconPaths.person, alt: "Office icon", className: `min-h-9.5 min-w-9.5 -ml-3 ${styles.icon}` }), className: `${styles.border} bg-transparent ${styles.placeholder}` }), _jsx(TextField, { type: "email", placeholder: "Email", required: true, variant: "flat", color: styles.colorMode, value: formData.email, onChange: (e) => handleInputChange("email", e.target.value), leftIcon: _jsx("img", { src: iconPaths.mail, alt: "Envelope icon", className: `min-h-9.5 min-w-9.5 -ml-3 ${styles.icon}` }), className: `${styles.border} bg-transparent ${styles.placeholder}` }), _jsx(TextField, { type: "text", placeholder: "Telefon", required: true, variant: "flat", color: styles.colorMode, value: formData.phone, onChange: (e) => handleInputChange("phone", e.target.value), pattern: "[\\+]?[0-9\\s\\-\\(\\)]{12,}", title: "Zadejte kompletn\u00ED telefonn\u00ED \u010D\u00EDslo (minim\u00E1ln\u011B 9 \u010D\u00EDslic)", leftIcon: _jsx("img", { src: iconPaths.phone, alt: "Phone icon", className: `min-h-9.5 min-w-9.5 -ml-3 ${styles.icon}` }), className: `${styles.border} bg-transparent ${styles.placeholder}` }), _jsxs("div", { className: "md:col-span-2 relative", children: [subject ? (_jsxs("div", { className: "absolute left-2 top-0 -ml-3 -mt-8 flex items-center", children: [_jsx("img", { src: iconPaths.messages, alt: "Message icon", className: `min-h-9.5 min-w-9.5 ${styles.icon}` }), _jsx("span", { className: "text-sm", children: subject })] })) : (_jsx("img", { src: iconPaths.messages, alt: "Message icon", className: `absolute left-2 top-0 min-h-9.5 min-w-9.5 -ml-3 ${styles.icon}` })), _jsx(TextArea, { id: "message", placeholder: "Zpr\u00E1va...", variant: "flat", color: styles.colorMode, value: formData.message, required: true, onChange: (e) => handleInputChange("message", e.target.value), className: `pl-8 pt-2 w-full ${styles.placeholder}` })] })] }), _jsxs("div", { className: "flex items-center space-x-3", children: [_jsx("input", { id: "agree", type: "checkbox", checked: agreed, onChange: () => {
77
+ return (_jsxs("form", { onSubmit: handleSubmit, className: `${styles.background} ${styles.text} py-6 md:py-10 rounded-md mx-auto space-y-6`, children: [title && (_jsxs("h2", { className: styles.titleStyle, children: [title.split(" ").slice(0, -1).join(" "), " ", _jsx("span", { className: "text-[#c26b38]", children: title.split(" ").slice(-1) })] })), _jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-6", children: [_jsx(TextField, { type: "text", placeholder: "Jm\u00E9no", required: true, variant: "flat", color: styles.colorMode, value: formData.name, onChange: (e) => handleInputChange("name", e.target.value), leftIcon: _jsx("img", { src: iconPaths.person, alt: "User icon", className: `min-h-9.5 min-w-9.5 -ml-3 ${styles.icon}` }), className: `${styles.border} bg-transparent ${styles.placeholder}` }), _jsx(TextField, { type: "text", placeholder: "Firma", variant: "flat", color: styles.colorMode, value: formData.company, onChange: (e) => handleInputChange("company", e.target.value), leftIcon: _jsx("img", { src: iconPaths.person, alt: "Office icon", className: `min-h-9.5 min-w-9.5 -ml-3 ${styles.icon}` }), className: `${styles.border} bg-transparent ${styles.placeholder}` }), _jsx(TextField, { type: "email", placeholder: "Email", required: true, variant: "flat", color: styles.colorMode, value: formData.email, onChange: (e) => handleInputChange("email", e.target.value), leftIcon: _jsx("img", { src: iconPaths.mail, alt: "Envelope icon", className: `min-h-9.5 min-w-9.5 -ml-3 ${styles.icon}` }), className: `${styles.border} bg-transparent ${styles.placeholder}` }), _jsx(TextField, { type: "text", placeholder: "Telefon", required: true, variant: "flat", color: styles.colorMode, value: formData.phone, onChange: (e) => handleInputChange("phone", e.target.value), pattern: "[\\+]?[0-9\\s\\-\\(\\)]{9,}", title: "Zadejte kompletn\u00ED telefonn\u00ED \u010D\u00EDslo (minim\u00E1ln\u011B 9 \u010D\u00EDslic)", leftIcon: _jsx("img", { src: iconPaths.phone, alt: "Phone icon", className: `min-h-9.5 min-w-9.5 -ml-3 ${styles.icon}` }), className: `${styles.border} bg-transparent ${styles.placeholder}` }), _jsxs("div", { className: "md:col-span-2 relative", children: [subject ? (_jsxs("div", { className: "absolute left-2 top-0 -ml-3 -mt-8 flex items-center", children: [_jsx("img", { src: iconPaths.messages, alt: "Message icon", className: `min-h-9.5 min-w-9.5 ${styles.icon}` }), _jsx("span", { className: "text-sm", children: subject })] })) : (_jsx("img", { src: iconPaths.messages, alt: "Message icon", className: `absolute left-2 top-0 min-h-9.5 min-w-9.5 -ml-3 ${styles.icon}` })), _jsx(TextArea, { id: "message", placeholder: "Zpr\u00E1va...", variant: "flat", color: styles.colorMode, value: formData.message, required: true, onChange: (e) => handleInputChange("message", e.target.value), className: `pl-8 pt-2 w-full ${styles.placeholder}` })] })] }), _jsxs("div", { className: "flex items-center space-x-3", children: [_jsx("input", { id: "agree", type: "checkbox", checked: agreed, onChange: () => {
78
78
  setAgreed(!agreed);
79
79
  handleInputChange("agreed", !agreed);
80
- }, className: `bg-transparent border ${styles.border} rounded-sm ${styles.checkbox}` }), _jsx("label", { htmlFor: "agree", className: "text-sm", children: "Souhlas s pou\u017Eit\u00EDm osobn\u00EDch \u00FAdaj\u016F" })] }), _jsx("button", { type: "submit", className: `px-6 py-2 uppercase text-sm ${styles.button}`, children: buttonText })] }));
80
+ }, className: `bg-transparent border cursor-pointer ${styles.border} rounded-sm ${styles.checkbox}` }), _jsx("label", { htmlFor: "agree", className: "text-sm", children: label })] }), _jsx("button", { type: "submit", className: `px-6 py-2 uppercase text-sm cursor-pointer ${styles.button}`, children: buttonText })] }));
81
81
  }
@@ -20,7 +20,7 @@ function WebSection({ imagePosition = "left", imagePath, title, subtitle, paragr
20
20
  width: `${(cols / 12) * 100}%`,
21
21
  });
22
22
  const fitClass = `object-${objectFit}`;
23
- return (_jsxs("div", { className: clsx("w-full bg-white", isHorizontal ? "flex flex-col lg:flex-row" : "flex flex-col", containerClassName), children: [_jsx("div", { className: clsx("w-full", isHorizontal && isImageFirst
23
+ return (_jsxs("div", { className: clsx("w-full bg-white", isHorizontal ? "flex flex-col lg:flex-row" : "flex flex-col", containerClassName), children: [_jsx("div", { className: clsx("w-full h-full", isHorizontal && isImageFirst
24
24
  ? getColWidthClass(imageWidthColumns)
25
25
  : "", isHorizontal && !isImageFirst
26
26
  ? getColWidthClass(textWidthColumns)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@q2devel/q2-storybook",
3
- "version": "1.0.101",
3
+ "version": "1.0.102",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",