Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,10 +1,24 @@
{
"title": "Tell your opinion about our websites",
"input-placeholder": "Please write here",
"success-title": "Thank you for your feedback!",
"input-placeholder": "(Optional)",
"input-placeholder-1": "What bothered you the most?",
"input-placeholder-2": "What fell short of your expectations?",
"input-placeholder-3": "What could be improved?",
"input-placeholder-4": "Any suggestions for improvement?",
"input-placeholder-5": "Wonderful! What did you like the most?",
"send": "Send",
"loading": "Sending...",
"href-to-fullform": "Go to the full form ->",
"error": "Select emote and then write feedback",
"error-submit-failed": "Submission failed. Please try again.",
"feedback-text": "Give specific feedback",
"success": "Thank you very much! We appreciate your feedback.",
"href-to-webform": "Website form",
"href-to-gameform": "Game form"
"href-to-webform": "Web form",
"href-to-gameform": "Game form",
"rating-label-1": "Bad",
"rating-label-2": "Meh..",
"rating-label-3": "OK",
"rating-label-4": "Good",
"rating-label-5": "Great"
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,24 @@
{
"title": "Kerro mielipiteesi verkkosivuistamme",
"input-placeholder": "Kirjoita tΓ€hΓ€n",
"success-title": "Kiitos palautteestasi!",
"input-placeholder": "(Valinnainen)",
"input-placeholder-1": "Harmi! MikΓ€ mΓ€tti eniten?",
"input-placeholder-2": "Voi ei - mikΓ€ jΓ€i vajaaksi?",
"input-placeholder-3": "MikÀ oli hyvÀÀ ja mitÀ parantaisit?",
"input-placeholder-4": "Kiva kuulla! Parannus ehdotuksia?",
"input-placeholder-5": "Ihanaa! MikΓ€ oli parasta?",
"send": "LΓ€hetΓ€",
"loading": "LÀhetetÀÀn...",
"href-to-fullform": "Siirry koko lomakkeeseen ->",
"error": "Valitse mieliala ja sitten kirjoita palaute.",
"error-submit-failed": "LΓ€hetys epΓ€onnistui. YritΓ€ uudelleen.",
"feedback-text": "Anna tarkempi palaute",
"success": "Kiitos paljon! Arvostamme palautettasi.",
"href-to-webform": "Verkkosivulomake",
"href-to-gameform": "Pelilomake"
"href-to-webform": "Web lomake",
"href-to-gameform": "Peli lomake",
"rating-label-1": "Huono",
"rating-label-2": "Meh..",
"rating-label-3": "Ihan ok",
"rating-label-4": "HyvΓ€",
"rating-label-5": "Loistava"
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
{
"title": "ΠŸΠΎΠ΄Π΅Π»ΠΈΡ‚Π΅ΡΡŒ своим ΠΌΠ½Π΅Π½ΠΈΠ΅ΠΌ ΠΎ нашСм сайтС",
"success-title": "Бпасибо Π·Π° ваш ΠΎΡ‚Π·Ρ‹Π²!",
"input-placeholder": "ΠΠ°ΠΏΠΈΡˆΠΈΡ‚Π΅ сюда",
"input-placeholder-1": "Π§Ρ‚ΠΎ Π²Π°ΠΌ Π½Π΅ ΠΏΠΎΠ½Ρ€Π°Π²ΠΈΠ»ΠΎΡΡŒ большС всСго?",
"input-placeholder-2": "Π§Ρ‚ΠΎ Π½Π΅ ΠΎΠΏΡ€Π°Π²Π΄Π°Π»ΠΎ Π²Π°ΡˆΠΈΡ… ΠΎΠΆΠΈΠ΄Π°Π½ΠΈΠΉ?",
"input-placeholder-3": "Π§Ρ‚ΠΎ Π±Ρ‹Π»ΠΎ Ρ…ΠΎΡ€ΠΎΡˆΠΎ ΠΈ Ρ‡Ρ‚ΠΎ ΠΌΠΎΠΆΠ½ΠΎ ΡƒΠ»ΡƒΡ‡ΡˆΠΈΡ‚ΡŒ?",
"input-placeholder-4": "ΠŸΡ€ΠΈΡΡ‚Π½ΠΎ ΡΠ»Ρ‹ΡˆΠ°Ρ‚ΡŒ! Π•ΡΡ‚ΡŒ прСдлоТСния ΠΏΠΎ ΡƒΠ»ΡƒΡ‡ΡˆΠ΅Π½ΠΈΡŽ?",
"input-placeholder-5": "Π—Π°ΠΌΠ΅Ρ‡Π°Ρ‚Π΅Π»ΡŒΠ½ΠΎ! Π§Ρ‚ΠΎ ΠΏΠΎΠ½Ρ€Π°Π²ΠΈΠ»ΠΎΡΡŒ большС всСго?",
"send": "ΠžΡ‚ΠΏΡ€Π°Π²ΠΈΡ‚ΡŒ",
"loading": "ΠžΡ‚ΠΏΡ€Π°Π²ΠΊΠ°...",
"href-to-fullform": "ΠŸΠ΅Ρ€Π΅ΠΉΡ‚ΠΈ ΠΊ ΠΏΠΎΠ»Π½ΠΎΠΉ Ρ„ΠΎΡ€ΠΌΠ΅ ->",
"error": "Π’Ρ‹Π±Π΅Ρ€ΠΈΡ‚Π΅ настроСниС ΠΈ Π·Π°Ρ‚Π΅ΠΌ Π½Π°ΠΏΠΈΡˆΠΈΡ‚Π΅ ΠΎΡ‚Π·Ρ‹Π².",
"error-submit-failed": "ΠžΡ‚ΠΏΡ€Π°Π²ΠΊΠ° Π½Π΅ ΡƒΠ΄Π°Π»Π°ΡΡŒ. ΠŸΠΎΠΏΡ€ΠΎΠ±ΡƒΠΉΡ‚Π΅ снова.",
"feedback-text": "ΠžΡΡ‚Π°Π²ΡŒΡ‚Π΅ ΠΏΠΎΠ΄Ρ€ΠΎΠ±Π½Ρ‹ΠΉ ΠΎΡ‚Π·Ρ‹Π²",
"success": "Π‘ΠΎΠ»ΡŒΡˆΠΎΠ΅ спасибо! ΠœΡ‹ Ρ†Π΅Π½ΠΈΠΌ ваш ΠΎΡ‚Π·Ρ‹Π².",
"href-to-webform": "ΠžΡ‚Π·Ρ‹Π² ΠΎ сайтС",
"href-to-gameform": "ΠžΡ‚Π·Ρ‹Π² ΠΎ ΠΈΠ³Ρ€Π΅"
"href-to-webform": "Π€ΠΎΡ€ΠΌΠ° сайта",
"href-to-gameform": "Π€ΠΎΡ€ΠΌΠ° ΠΈΠ³Ρ€Ρ‹"
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import React, {
memo,
DetailedHTMLProps,
InputHTMLAttributes,
TextareaHTMLAttributes,
useState,
useEffect,
useId,
Expand Down Expand Up @@ -318,12 +319,52 @@ function MultiSelectionDropdown<T>({
);
}

type TextareaFieldProps = {
label?: string;
error?: any;
className?: string;
textareaProps?: DetailedHTMLProps<
TextareaHTMLAttributes<HTMLTextAreaElement>,
HTMLTextAreaElement
>;
};

function TextareaField({ label, error, textareaProps, className = '' }: TextareaFieldProps) {
const reactId = useId();
const slug = slugifyLabel(label);
const normalizedReactId = reactId
.toString()
.toLowerCase()
.replace(/[^a-z0-9]+/g, '-');
const textareaId =
textareaProps?.id || (slug ? `textarea-${slug}` : `textarea-${normalizedReactId}`);

return (
<div className={classNames(cls.field, {}, [className])}>
{label && <label htmlFor={textareaId}>{label}</label>}
<textarea
id={textareaId}
{...textareaProps}
/>
{error && (
<p
role="alert"
className={cls.error}
>
{error}
</p>
)}
</div>
);
}

interface IFormProps extends HTMLAttributes<HTMLFormElement> {}

interface MemoizedFormCompose {
Button: typeof Button;
Header: typeof Header;
InputField: typeof InputField;
TextareaField: typeof TextareaField;
Checkbox: typeof Checkbox;
MultiSelectionDropdown: typeof MultiSelectionDropdown;
}
Expand Down Expand Up @@ -359,6 +400,7 @@ const MemoizedForm = memo(BaseForm) as NamedExoticComponent<IFormProps> & Memoiz
MemoizedForm.Button = Button;
MemoizedForm.Header = Header;
MemoizedForm.InputField = InputField;
MemoizedForm.TextareaField = TextareaField;
MemoizedForm.Checkbox = Checkbox;
MemoizedForm.MultiSelectionDropdown = MultiSelectionDropdown;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +1,36 @@
.feedbackForm {
font: var(--font-dm-xl);
background-color: var(--base-card-background);
display: flex;
display: flex !important;
flex-direction: column;
margin: 5px;
width: 100%;
max-width: 330px;
height: fit-content;
padding-top: 0;
width: 320px !important;
height: 400px;
align-items: center;
gap: 10px;
gap: 5px;
box-shadow: 8px 8px 1px #000000;
border-width: 4px;
border-style: solid;
border-color: #000000;
}

.collapsedVersion {
height: 230px;
}

.borderlessVersion {
box-shadow: none;
border: none;
}

.feedbackTitle {
line-height: 40px !important;
font: var(--font-sw-xl);
box-sizing: border-box;
height: fit-content;
font-size: 24px;
font-family: 'Marko One';
font-weight: bold;
line-height: 100%;
color: var(--primary-color);
text-align: center;
width: 100%;
margin: 0 auto;
margin: 0 0 8px 0;
}

.feedbackButton {
Expand All @@ -37,67 +44,67 @@
align-items: center;
padding: 9px 12px;
gap: 10px;
width: 100%;
max-width: 300px;
width:250px;
height: 48px;
background: var(--primary-color) !important;
border: 2px solid var(--drop-shadows) !important;
border-radius: 25px !important;
box-shadow: 2px 4px 0 var(--black) !important;
}

.inputField {
label {
font: var(--font-dm-m);
font-size: 14px;
color: var(--white);
display: block;
}
}

.textInput {
font: var(--font-dm-m);
color: var(--black);
width: 100%;
max-width: 300px;
height: 45px;
padding: 10px 10px;
background: #ffffff;
height: 81px;
padding: 10px;
border-radius: 12px;
background: #FFFFFF;
border: 2px solid #000000;
box-shadow: 2px 4px 0 #121212;
border-radius: 25px !important;
box-sizing: border-box;
resize: none;
vertical-align: top;
outline: none;
}

.emojiList {
display: inline-flex !important;
justify-content: space-between;
align-items: center;
align-items: start;
width: 100%;
padding-bottom: 5px;
box-sizing: border-box;
}

.linkToForm {
display: flex;
flex-direction: row;
font: var(--font-dm-m);
color: var(--white);
height: 100px;
}

.linkToFormContainer {
width: 100%;
max-width: 300px;
max-width:fit-content;
display: inline-flex !important;
flex-direction: row;
justify-content: space-between;
gap: unset;
gap: 10px;
}

.linkToFormContainer > * {
display: inline-block;
vertical-align: middle;
justify-items: end;
padding: 0 10px 0 10px;
.linkToFormLabel {
font: var(--font-dm-m);
color: var(--white);
padding: 0;
margin: 0;
overflow: hidden;
}

.embedabbleVersion {
background-color: transparent !important;
border: none !important;
box-shadow: none !important;
outline: none !important;
.linkToForm {
display: flex;
flex-direction: row;
align-items: center;
font: var(--font-dm-m);
color: var(--white);
}

.externalLinkIcon {
display: inline;
vertical-align: middle !important;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ const meta = {
argTypes: {
/**
* Defines the variant of the feedback card, which determines the layout style.
* @type {('full' | 'embedabble')}
* @type {('full' | 'borderless')}
*/
variant: {
control: 'select',
description: 'The variant of the FeedbackCard (either "full" or "embedabble").',
options: ['full', 'embedabble'],
description: 'The variant of the FeedbackCard ("full", "borderless").',
options: ['full', 'borderless'],
},
},
} satisfies Meta<typeof FeedbackCard>;
Expand All @@ -43,7 +43,7 @@ type Story = StoryObj<typeof meta>;
*/
export const Default: Story = {
args: {
variant: 'full', // Default is 'full'
variant: 'full',
},
parameters: {
docs: {
Expand All @@ -54,18 +54,14 @@ export const Default: Story = {
},
};

/**
* Story for the `FeedbackCard` component with the "embedabble" variant.
* A more compact version of the feedback card suitable for embedding in other sections of the app.
*/
export const Embedabble: Story = {
export const BorderlessVersion: Story = {
args: {
variant: 'embedabble', // Embedabble version for compact display
variant: 'borderless',
},
parameters: {
docs: {
description: {
story: 'Displays the `FeedbackCard` component with the "embedabble" variant, rendering a smaller, more compact layout.',
story: 'Displays the `FeedbackCard` component with the "borderless" variant, rendering the card without border and shadow styles.',
},
},
},
Expand Down
Loading