|
18 | 18 | };
|
19 | 19 |
|
20 | 20 | const sizeClasses = {
|
21 |
| - label: variant === 'compact' ? 'mb-2 text-xl' : 'mb-4 text-3xl', |
| 21 | + label: variant === 'compact' ? 'mb-2 text-xl' : 'mb-4 text-2xl', |
22 | 22 | input: variant === 'compact' ? 'mt-1 px-3 py-2 text-lg' : 'mt-2 px-5 py-4 text-xl',
|
23 |
| - option: variant === 'compact' ? 'p-2 text-lg' : 'p-3 text-xl' |
| 23 | + option: variant === 'compact' ? 'p-1 text-lg' : 'p-2 text-lg' |
24 | 24 | };
|
25 | 25 |
|
26 | 26 | const errorClasses = {
|
27 |
| - label: variant === 'compact' ? 'text-red-500' : 'text-2xl text-red-500' |
| 27 | + label: variant === 'compact' ? 'text-red-500' : 'text-xl text-red-500' |
28 | 28 | };
|
29 | 29 |
|
30 | 30 | function handleInput(event) {
|
|
34 | 34 | </script>
|
35 | 35 |
|
36 | 36 | <label class={`${baseClasses.label} ${sizeClasses.label}`} for="question-{index}">
|
37 |
| - <span class="absolute inset-0 -z-10 rounded-md bg-gray-100 px-3 py-2 dark:bg-gray-800"></span> |
38 | 37 | {#if question.content.type !== 'label'}
|
39 | 38 | {question.content.label_text}
|
40 | 39 | {/if}
|
41 | 40 | {#if required && question.content.type !== 'label'}
|
42 |
| - <span class="ml-1 text-red-500">*</span> |
| 41 | + <span class="ml-1 text-red-500" aria-label="Required question">*</span> |
43 | 42 | {/if}
|
44 | 43 | </label>
|
45 | 44 |
|
|
53 | 52 | class={`${baseClasses.input} ${sizeClasses.input} ${error ? 'border-red-500' : ''}`}
|
54 | 53 | />
|
55 | 54 | {:else if question.content.type === 'radio'}
|
56 |
| - <div class={`mt-2 space-y-${variant === 'compact' ? '1' : '4'}`}> |
| 55 | + <div class={`mt-2 space-y-${variant === 'compact' ? '0' : '2'}`}> |
57 | 56 | {#each question.content.options as option}
|
58 | 57 | <Radio
|
59 | 58 | name="radio-{index}"
|
|
67 | 66 | {/each}
|
68 | 67 | </div>
|
69 | 68 | {:else if question.content.type === 'checkbox'}
|
70 |
| - <div class={`mt-2 space-y-${variant === 'compact' ? '1' : '4'}`}> |
| 69 | + <div class={`mt-2 space-y-${variant === 'compact' ? '0' : '2'}`}> |
71 | 70 | {#each question.content.options as option}
|
72 | 71 | <Checkbox
|
73 | 72 | name="checkbox-{index}"
|
|
81 | 80 | {/each}
|
82 | 81 | </div>
|
83 | 82 | {:else if question.content.type === 'label'}
|
84 |
| - <p class={`${sizeClasses.label} mt-4 font-bold text-black dark:text-white`}> |
| 83 | + <p class={`${sizeClasses.label} text-semibold mt-4 font-bold dark:text-white`}> |
85 | 84 | {question.content.label_text}
|
86 | 85 | </p>
|
87 | 86 | {:else if question.content.type === 'external_survey'}
|
|
90 | 89 | href={question.content.url}
|
91 | 90 | target="_blank"
|
92 | 91 | rel="noopener noreferrer"
|
93 |
| - class="inline-block text-2xl font-semibold text-blue-500 underline transition-all hover:text-blue-600" |
| 92 | + class="inline-block text-xl font-semibold text-blue-500 underline transition-all hover:text-blue-600" |
94 | 93 | >
|
95 | 94 | {question.content.label_text}
|
96 | 95 | </a>
|
97 | 96 | {#if question.content.survey_provider}
|
98 |
| - <p class="mt-1 text-2xl text-gray-500"> |
| 97 | + <p class="mt-1 text-gray-500"> |
99 | 98 | Powered by {question.content.survey_provider}
|
100 | 99 | </p>
|
101 | 100 | {/if}
|
|
0 commit comments