@landform.io/sdk 0.1.2
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/api/index.cjs +17 -0
- package/dist/api/index.cjs.map +1 -0
- package/dist/api/index.d.cts +48 -0
- package/dist/api/index.d.ts +48 -0
- package/dist/api/index.js +4 -0
- package/dist/api/index.js.map +1 -0
- package/dist/chunk-52W6RI6C.cjs +4 -0
- package/dist/chunk-52W6RI6C.cjs.map +1 -0
- package/dist/chunk-DASQI7IA.cjs +4 -0
- package/dist/chunk-DASQI7IA.cjs.map +1 -0
- package/dist/chunk-EL7YGOTY.js +3 -0
- package/dist/chunk-EL7YGOTY.js.map +1 -0
- package/dist/chunk-GVOTY5NG.js +3 -0
- package/dist/chunk-GVOTY5NG.js.map +1 -0
- package/dist/chunk-HUIMGLDC.js +488 -0
- package/dist/chunk-HUIMGLDC.js.map +1 -0
- package/dist/chunk-I6L5OCM3.js +1657 -0
- package/dist/chunk-I6L5OCM3.js.map +1 -0
- package/dist/chunk-IQXKFO6Q.cjs +55 -0
- package/dist/chunk-IQXKFO6Q.cjs.map +1 -0
- package/dist/chunk-P2GUKJHH.cjs +117 -0
- package/dist/chunk-P2GUKJHH.cjs.map +1 -0
- package/dist/chunk-PDUJU32P.js +687 -0
- package/dist/chunk-PDUJU32P.js.map +1 -0
- package/dist/chunk-PKHTPGWQ.js +114 -0
- package/dist/chunk-PKHTPGWQ.js.map +1 -0
- package/dist/chunk-V7WAYO2Q.js +48 -0
- package/dist/chunk-V7WAYO2Q.js.map +1 -0
- package/dist/chunk-WHV333XL.cjs +1684 -0
- package/dist/chunk-WHV333XL.cjs.map +1 -0
- package/dist/chunk-WIFNU3FA.cjs +497 -0
- package/dist/chunk-WIFNU3FA.cjs.map +1 -0
- package/dist/chunk-ZLOP4BTK.cjs +695 -0
- package/dist/chunk-ZLOP4BTK.cjs.map +1 -0
- package/dist/components/index.cjs +99 -0
- package/dist/components/index.cjs.map +1 -0
- package/dist/components/index.d.cts +166 -0
- package/dist/components/index.d.ts +166 -0
- package/dist/components/index.js +6 -0
- package/dist/components/index.js.map +1 -0
- package/dist/hooks/index.cjs +35 -0
- package/dist/hooks/index.cjs.map +1 -0
- package/dist/hooks/index.d.cts +75 -0
- package/dist/hooks/index.d.ts +75 -0
- package/dist/hooks/index.js +6 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/index-DoRZImTl.d.cts +590 -0
- package/dist/index-DoRZImTl.d.ts +590 -0
- package/dist/index.cjs +186 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +8 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/theme/index.cjs +61 -0
- package/dist/theme/index.cjs.map +1 -0
- package/dist/theme/index.d.cts +65 -0
- package/dist/theme/index.d.ts +65 -0
- package/dist/theme/index.js +4 -0
- package/dist/theme/index.js.map +1 -0
- package/dist/useForm-D1mB6REv.d.ts +48 -0
- package/dist/useForm-kF8xK1mJ.d.cts +48 -0
- package/package.json +101 -0
|
@@ -0,0 +1,687 @@
|
|
|
1
|
+
// src/theme/generateCSS.ts
|
|
2
|
+
function radiusToCSS(radius) {
|
|
3
|
+
switch (radius) {
|
|
4
|
+
case "none":
|
|
5
|
+
return "0";
|
|
6
|
+
case "small":
|
|
7
|
+
return "4px";
|
|
8
|
+
case "medium":
|
|
9
|
+
return "8px";
|
|
10
|
+
case "large":
|
|
11
|
+
return "12px";
|
|
12
|
+
case "full":
|
|
13
|
+
return "9999px";
|
|
14
|
+
default:
|
|
15
|
+
return "0";
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
function generateThemeCSS(theme) {
|
|
19
|
+
const t = theme;
|
|
20
|
+
return `
|
|
21
|
+
:root {
|
|
22
|
+
/* Colors - Base */
|
|
23
|
+
--lf-color-primary: ${t.colors.primary};
|
|
24
|
+
--lf-color-secondary: ${t.colors.secondary};
|
|
25
|
+
--lf-color-accent: ${t.colors.accent};
|
|
26
|
+
|
|
27
|
+
/* Colors - Backgrounds */
|
|
28
|
+
--lf-color-background: ${t.colors.background};
|
|
29
|
+
--lf-color-surface: ${t.colors.surfaceBackground};
|
|
30
|
+
--lf-color-input-bg: ${t.colors.inputBackground};
|
|
31
|
+
--lf-color-input-border: ${t.colors.inputBorder};
|
|
32
|
+
|
|
33
|
+
/* Colors - Text */
|
|
34
|
+
--lf-color-question: ${t.colors.questionText};
|
|
35
|
+
--lf-color-answer: ${t.colors.answerText};
|
|
36
|
+
--lf-color-placeholder: ${t.colors.placeholderText};
|
|
37
|
+
|
|
38
|
+
/* Colors - Buttons */
|
|
39
|
+
--lf-color-button-bg: ${t.colors.buttonBackground};
|
|
40
|
+
--lf-color-button-text: ${t.colors.buttonText};
|
|
41
|
+
--lf-color-button-hover: ${t.colors.buttonHoverBackground};
|
|
42
|
+
|
|
43
|
+
/* Colors - Selection */
|
|
44
|
+
--lf-color-selected-bg: ${t.colors.selectedBackground};
|
|
45
|
+
--lf-color-selected-border: ${t.colors.selectedBorder};
|
|
46
|
+
|
|
47
|
+
/* Colors - Feedback */
|
|
48
|
+
--lf-color-error: ${t.colors.errorColor};
|
|
49
|
+
--lf-color-success: ${t.colors.successColor};
|
|
50
|
+
|
|
51
|
+
/* Colors - Progress */
|
|
52
|
+
--lf-color-progress-bg: ${t.colors.progressBackground};
|
|
53
|
+
--lf-color-progress-fill: ${t.colors.progressFill};
|
|
54
|
+
|
|
55
|
+
/* Typography - Question */
|
|
56
|
+
--lf-font-question: ${t.typography.questionFont.family};
|
|
57
|
+
--lf-font-size-question: ${t.typography.questionFont.size};
|
|
58
|
+
--lf-font-weight-question: ${t.typography.questionFont.weight};
|
|
59
|
+
--lf-line-height-question: ${t.typography.questionFont.lineHeight};
|
|
60
|
+
${t.typography.questionFont.letterSpacing ? `--lf-letter-spacing-question: ${t.typography.questionFont.letterSpacing};` : ""}
|
|
61
|
+
|
|
62
|
+
/* Typography - Answer */
|
|
63
|
+
--lf-font-answer: ${t.typography.answerFont.family};
|
|
64
|
+
--lf-font-size-answer: ${t.typography.answerFont.size};
|
|
65
|
+
--lf-font-weight-answer: ${t.typography.answerFont.weight};
|
|
66
|
+
--lf-line-height-answer: ${t.typography.answerFont.lineHeight};
|
|
67
|
+
${t.typography.answerFont.letterSpacing ? `--lf-letter-spacing-answer: ${t.typography.answerFont.letterSpacing};` : ""}
|
|
68
|
+
|
|
69
|
+
/* Typography - Button */
|
|
70
|
+
--lf-font-button: ${t.typography.buttonFont.family};
|
|
71
|
+
--lf-font-size-button: ${t.typography.buttonFont.size};
|
|
72
|
+
--lf-font-weight-button: ${t.typography.buttonFont.weight};
|
|
73
|
+
--lf-line-height-button: ${t.typography.buttonFont.lineHeight};
|
|
74
|
+
|
|
75
|
+
/* Spacing */
|
|
76
|
+
--lf-spacing-question: ${t.spacing.questionGap};
|
|
77
|
+
--lf-spacing-option: ${t.spacing.optionGap};
|
|
78
|
+
--lf-spacing-container: ${t.spacing.containerPadding};
|
|
79
|
+
|
|
80
|
+
/* Borders */
|
|
81
|
+
--lf-border-width: ${t.borders.inputBorderWidth};
|
|
82
|
+
--lf-border-style: ${t.borders.inputBorderStyle};
|
|
83
|
+
--lf-border-radius: ${radiusToCSS(t.borders.radius)};
|
|
84
|
+
|
|
85
|
+
/* Animations */
|
|
86
|
+
--lf-transition-duration: ${t.animations.transitionDuration};
|
|
87
|
+
--lf-transition-easing: ${t.animations.transitionEasing};
|
|
88
|
+
}
|
|
89
|
+
`.trim();
|
|
90
|
+
}
|
|
91
|
+
function generateComponentStyles() {
|
|
92
|
+
return `
|
|
93
|
+
/* ============================================================================
|
|
94
|
+
Landform SDK - Component Styles
|
|
95
|
+
============================================================================ */
|
|
96
|
+
|
|
97
|
+
/* Form Container */
|
|
98
|
+
.lf-form {
|
|
99
|
+
min-height: 100vh;
|
|
100
|
+
display: flex;
|
|
101
|
+
flex-direction: column;
|
|
102
|
+
background-color: var(--lf-color-background);
|
|
103
|
+
font-family: var(--lf-font-answer);
|
|
104
|
+
color: var(--lf-color-answer);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/* Question Container */
|
|
108
|
+
.lf-question-container {
|
|
109
|
+
flex: 1;
|
|
110
|
+
display: flex;
|
|
111
|
+
flex-direction: column;
|
|
112
|
+
justify-content: center;
|
|
113
|
+
padding: var(--lf-spacing-container);
|
|
114
|
+
max-width: 720px;
|
|
115
|
+
margin: 0 auto;
|
|
116
|
+
width: 100%;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/* Question Title */
|
|
120
|
+
.lf-question-title {
|
|
121
|
+
font-family: var(--lf-font-question);
|
|
122
|
+
font-size: var(--lf-font-size-question);
|
|
123
|
+
font-weight: var(--lf-font-weight-question);
|
|
124
|
+
line-height: var(--lf-line-height-question);
|
|
125
|
+
color: var(--lf-color-question);
|
|
126
|
+
margin: 0 0 0.5rem 0;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/* Question Description */
|
|
130
|
+
.lf-question-description {
|
|
131
|
+
color: var(--lf-color-answer);
|
|
132
|
+
opacity: 0.8;
|
|
133
|
+
margin: 0;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/* Required Indicator */
|
|
137
|
+
.lf-required {
|
|
138
|
+
color: var(--lf-color-error);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/* Input Base */
|
|
142
|
+
.lf-input {
|
|
143
|
+
width: 100%;
|
|
144
|
+
padding: 0.75rem 1rem;
|
|
145
|
+
font-family: var(--lf-font-answer);
|
|
146
|
+
font-size: var(--lf-font-size-answer);
|
|
147
|
+
color: var(--lf-color-answer);
|
|
148
|
+
background-color: var(--lf-color-input-bg);
|
|
149
|
+
border: var(--lf-border-width) var(--lf-border-style) var(--lf-color-input-border);
|
|
150
|
+
border-radius: var(--lf-border-radius);
|
|
151
|
+
outline: none;
|
|
152
|
+
transition: border-color var(--lf-transition-duration) var(--lf-transition-easing);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.lf-input:focus {
|
|
156
|
+
border-color: var(--lf-color-primary);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.lf-input::placeholder {
|
|
160
|
+
color: var(--lf-color-placeholder);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/* Input Underline Style */
|
|
164
|
+
.lf-input-underline {
|
|
165
|
+
width: 100%;
|
|
166
|
+
padding: 0.75rem 0;
|
|
167
|
+
font-family: var(--lf-font-answer);
|
|
168
|
+
font-size: var(--lf-font-size-answer);
|
|
169
|
+
color: var(--lf-color-answer);
|
|
170
|
+
background-color: transparent;
|
|
171
|
+
border: none;
|
|
172
|
+
border-bottom: var(--lf-border-width) var(--lf-border-style) var(--lf-color-input-border);
|
|
173
|
+
border-radius: 0;
|
|
174
|
+
outline: none;
|
|
175
|
+
transition: border-color var(--lf-transition-duration) var(--lf-transition-easing);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.lf-input-underline:focus {
|
|
179
|
+
border-bottom-color: var(--lf-color-primary);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.lf-input-underline::placeholder {
|
|
183
|
+
color: var(--lf-color-placeholder);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/* Choice Button */
|
|
187
|
+
.lf-choice {
|
|
188
|
+
display: flex;
|
|
189
|
+
align-items: center;
|
|
190
|
+
gap: 0.75rem;
|
|
191
|
+
width: 100%;
|
|
192
|
+
padding: 1rem 1.25rem;
|
|
193
|
+
font-family: var(--lf-font-answer);
|
|
194
|
+
font-size: var(--lf-font-size-answer);
|
|
195
|
+
color: var(--lf-color-answer);
|
|
196
|
+
background-color: var(--lf-color-surface);
|
|
197
|
+
border: var(--lf-border-width) var(--lf-border-style) var(--lf-color-input-border);
|
|
198
|
+
border-radius: var(--lf-border-radius);
|
|
199
|
+
cursor: pointer;
|
|
200
|
+
transition: all var(--lf-transition-duration) var(--lf-transition-easing);
|
|
201
|
+
text-align: left;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.lf-choice:hover {
|
|
205
|
+
border-color: var(--lf-color-primary);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.lf-choice-selected {
|
|
209
|
+
background-color: var(--lf-color-selected-bg);
|
|
210
|
+
border-color: var(--lf-color-selected-border);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/* Key Hint */
|
|
214
|
+
.lf-key-hint {
|
|
215
|
+
display: inline-flex;
|
|
216
|
+
align-items: center;
|
|
217
|
+
justify-content: center;
|
|
218
|
+
min-width: 1.75rem;
|
|
219
|
+
height: 1.75rem;
|
|
220
|
+
padding: 0 0.5rem;
|
|
221
|
+
font-size: 0.875rem;
|
|
222
|
+
font-weight: 500;
|
|
223
|
+
color: var(--lf-color-answer);
|
|
224
|
+
background-color: var(--lf-color-background);
|
|
225
|
+
border: 1px solid var(--lf-color-input-border);
|
|
226
|
+
border-radius: var(--lf-border-radius);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.lf-choice-selected .lf-key-hint {
|
|
230
|
+
background-color: var(--lf-color-primary);
|
|
231
|
+
border-color: var(--lf-color-primary);
|
|
232
|
+
color: var(--lf-color-button-text);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/* Button */
|
|
236
|
+
.lf-button {
|
|
237
|
+
display: inline-flex;
|
|
238
|
+
align-items: center;
|
|
239
|
+
justify-content: center;
|
|
240
|
+
gap: 0.5rem;
|
|
241
|
+
padding: 0.75rem 1.5rem;
|
|
242
|
+
font-family: var(--lf-font-button);
|
|
243
|
+
font-size: var(--lf-font-size-button);
|
|
244
|
+
font-weight: var(--lf-font-weight-button);
|
|
245
|
+
line-height: var(--lf-line-height-button);
|
|
246
|
+
color: var(--lf-color-button-text);
|
|
247
|
+
background-color: var(--lf-color-button-bg);
|
|
248
|
+
border: none;
|
|
249
|
+
border-radius: var(--lf-border-radius);
|
|
250
|
+
cursor: pointer;
|
|
251
|
+
transition: background-color var(--lf-transition-duration) var(--lf-transition-easing);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
.lf-button:hover {
|
|
255
|
+
background-color: var(--lf-color-button-hover);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
.lf-button:disabled {
|
|
259
|
+
opacity: 0.5;
|
|
260
|
+
cursor: not-allowed;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/* Progress Bar */
|
|
264
|
+
.lf-progress {
|
|
265
|
+
background-color: var(--lf-color-progress-bg);
|
|
266
|
+
overflow: hidden;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
.lf-progress-fill {
|
|
270
|
+
background-color: var(--lf-color-progress-fill);
|
|
271
|
+
transition: width var(--lf-transition-duration) var(--lf-transition-easing);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
/* Rating Stars */
|
|
275
|
+
.lf-rating-star {
|
|
276
|
+
cursor: pointer;
|
|
277
|
+
color: var(--lf-color-input-border);
|
|
278
|
+
transition: color var(--lf-transition-duration) var(--lf-transition-easing);
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
.lf-rating-star-active {
|
|
282
|
+
color: var(--lf-color-primary);
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
.lf-rating-star:hover {
|
|
286
|
+
color: var(--lf-color-primary);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
/* Scale Button (Opinion Scale, NPS) */
|
|
290
|
+
.lf-scale-button {
|
|
291
|
+
display: flex;
|
|
292
|
+
align-items: center;
|
|
293
|
+
justify-content: center;
|
|
294
|
+
min-width: 2.5rem;
|
|
295
|
+
height: 2.5rem;
|
|
296
|
+
padding: 0.5rem;
|
|
297
|
+
font-family: var(--lf-font-answer);
|
|
298
|
+
font-size: var(--lf-font-size-answer);
|
|
299
|
+
color: var(--lf-color-answer);
|
|
300
|
+
background-color: var(--lf-color-surface);
|
|
301
|
+
border: var(--lf-border-width) var(--lf-border-style) var(--lf-color-input-border);
|
|
302
|
+
border-radius: var(--lf-border-radius);
|
|
303
|
+
cursor: pointer;
|
|
304
|
+
transition: all var(--lf-transition-duration) var(--lf-transition-easing);
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
.lf-scale-button:hover {
|
|
308
|
+
border-color: var(--lf-color-primary);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
.lf-scale-button-selected {
|
|
312
|
+
background-color: var(--lf-color-primary);
|
|
313
|
+
border-color: var(--lf-color-primary);
|
|
314
|
+
color: var(--lf-color-button-text);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
/* Navigation */
|
|
318
|
+
.lf-navigation {
|
|
319
|
+
position: fixed;
|
|
320
|
+
bottom: 0;
|
|
321
|
+
left: 0;
|
|
322
|
+
right: 0;
|
|
323
|
+
display: flex;
|
|
324
|
+
align-items: center;
|
|
325
|
+
justify-content: space-between;
|
|
326
|
+
padding: 1rem var(--lf-spacing-container);
|
|
327
|
+
background-color: var(--lf-color-background);
|
|
328
|
+
border-top: 1px solid var(--lf-color-input-border);
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
.lf-navigation-button {
|
|
332
|
+
display: inline-flex;
|
|
333
|
+
align-items: center;
|
|
334
|
+
gap: 0.5rem;
|
|
335
|
+
padding: 0.5rem 1rem;
|
|
336
|
+
font-family: var(--lf-font-button);
|
|
337
|
+
font-size: 0.875rem;
|
|
338
|
+
color: var(--lf-color-answer);
|
|
339
|
+
background-color: transparent;
|
|
340
|
+
border: 1px solid var(--lf-color-input-border);
|
|
341
|
+
border-radius: var(--lf-border-radius);
|
|
342
|
+
cursor: pointer;
|
|
343
|
+
transition: all var(--lf-transition-duration) var(--lf-transition-easing);
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
.lf-navigation-button:hover {
|
|
347
|
+
border-color: var(--lf-color-primary);
|
|
348
|
+
color: var(--lf-color-primary);
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
.lf-navigation-button:disabled {
|
|
352
|
+
opacity: 0.3;
|
|
353
|
+
cursor: not-allowed;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
/* Error Message */
|
|
357
|
+
.lf-error {
|
|
358
|
+
color: var(--lf-color-error);
|
|
359
|
+
font-size: 0.875rem;
|
|
360
|
+
margin-top: 0.5rem;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
/* Branding */
|
|
364
|
+
.lf-branding {
|
|
365
|
+
padding: 1rem;
|
|
366
|
+
text-align: center;
|
|
367
|
+
font-size: 0.75rem;
|
|
368
|
+
color: var(--lf-color-placeholder);
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
.lf-branding a {
|
|
372
|
+
color: var(--lf-color-primary);
|
|
373
|
+
text-decoration: none;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
.lf-branding a:hover {
|
|
377
|
+
text-decoration: underline;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
/* Picture Choice Grid */
|
|
381
|
+
.lf-picture-grid {
|
|
382
|
+
display: grid;
|
|
383
|
+
grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
|
|
384
|
+
gap: var(--lf-spacing-option);
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
.lf-picture-card {
|
|
388
|
+
display: flex;
|
|
389
|
+
flex-direction: column;
|
|
390
|
+
overflow: hidden;
|
|
391
|
+
background-color: var(--lf-color-surface);
|
|
392
|
+
border: var(--lf-border-width) var(--lf-border-style) var(--lf-color-input-border);
|
|
393
|
+
border-radius: var(--lf-border-radius);
|
|
394
|
+
cursor: pointer;
|
|
395
|
+
transition: all var(--lf-transition-duration) var(--lf-transition-easing);
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
.lf-picture-card:hover {
|
|
399
|
+
border-color: var(--lf-color-primary);
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
.lf-picture-card-selected {
|
|
403
|
+
border-color: var(--lf-color-selected-border);
|
|
404
|
+
background-color: var(--lf-color-selected-bg);
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
.lf-picture-card img {
|
|
408
|
+
width: 100%;
|
|
409
|
+
aspect-ratio: 4/3;
|
|
410
|
+
object-fit: cover;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
.lf-picture-card-label {
|
|
414
|
+
padding: 0.75rem;
|
|
415
|
+
text-align: center;
|
|
416
|
+
font-size: 0.875rem;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
/* Welcome & Thank You Screens */
|
|
420
|
+
.lf-screen {
|
|
421
|
+
display: flex;
|
|
422
|
+
flex-direction: column;
|
|
423
|
+
align-items: center;
|
|
424
|
+
justify-content: center;
|
|
425
|
+
text-align: center;
|
|
426
|
+
min-height: 100vh;
|
|
427
|
+
padding: var(--lf-spacing-container);
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
.lf-screen-title {
|
|
431
|
+
font-family: var(--lf-font-question);
|
|
432
|
+
font-size: calc(var(--lf-font-size-question) * 1.25);
|
|
433
|
+
font-weight: var(--lf-font-weight-question);
|
|
434
|
+
color: var(--lf-color-question);
|
|
435
|
+
margin: 0 0 1rem 0;
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
.lf-screen-description {
|
|
439
|
+
font-size: var(--lf-font-size-answer);
|
|
440
|
+
color: var(--lf-color-answer);
|
|
441
|
+
opacity: 0.8;
|
|
442
|
+
margin: 0 0 2rem 0;
|
|
443
|
+
max-width: 480px;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
/* Slider */
|
|
447
|
+
.lf-slider {
|
|
448
|
+
width: 100%;
|
|
449
|
+
height: 8px;
|
|
450
|
+
appearance: none;
|
|
451
|
+
background: var(--lf-color-progress-bg);
|
|
452
|
+
border-radius: var(--lf-border-radius);
|
|
453
|
+
outline: none;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
.lf-slider::-webkit-slider-thumb {
|
|
457
|
+
appearance: none;
|
|
458
|
+
width: 24px;
|
|
459
|
+
height: 24px;
|
|
460
|
+
background: var(--lf-color-primary);
|
|
461
|
+
border-radius: 50%;
|
|
462
|
+
cursor: pointer;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
.lf-slider::-moz-range-thumb {
|
|
466
|
+
width: 24px;
|
|
467
|
+
height: 24px;
|
|
468
|
+
background: var(--lf-color-primary);
|
|
469
|
+
border-radius: 50%;
|
|
470
|
+
cursor: pointer;
|
|
471
|
+
border: none;
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
/* Signature Canvas */
|
|
475
|
+
.lf-signature-canvas {
|
|
476
|
+
border: var(--lf-border-width) var(--lf-border-style) var(--lf-color-input-border);
|
|
477
|
+
border-radius: var(--lf-border-radius);
|
|
478
|
+
background-color: var(--lf-color-input-bg);
|
|
479
|
+
cursor: crosshair;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
/* ============================================================================
|
|
483
|
+
Component Variants - Card Style Choices (Quiz Template)
|
|
484
|
+
============================================================================ */
|
|
485
|
+
|
|
486
|
+
.lf-choice-card {
|
|
487
|
+
display: flex;
|
|
488
|
+
align-items: center;
|
|
489
|
+
justify-content: space-between;
|
|
490
|
+
width: 100%;
|
|
491
|
+
padding: 1rem 1.25rem;
|
|
492
|
+
font-family: var(--lf-font-answer);
|
|
493
|
+
font-size: var(--lf-font-size-answer);
|
|
494
|
+
color: var(--lf-color-answer);
|
|
495
|
+
background-color: var(--lf-color-surface);
|
|
496
|
+
border: none;
|
|
497
|
+
border-radius: var(--lf-border-radius);
|
|
498
|
+
cursor: pointer;
|
|
499
|
+
transition: all var(--lf-transition-duration) var(--lf-transition-easing);
|
|
500
|
+
text-align: left;
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
.lf-choice-card:hover {
|
|
504
|
+
background-color: var(--lf-color-input-bg);
|
|
505
|
+
transform: translateY(-1px);
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
.lf-choice-card-selected {
|
|
509
|
+
background-color: var(--lf-color-selected-bg);
|
|
510
|
+
color: var(--lf-color-button-text);
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
.lf-choice-card-selected:hover {
|
|
514
|
+
background-color: var(--lf-color-selected-bg);
|
|
515
|
+
transform: none;
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
/* Circular indicator for card choices */
|
|
519
|
+
.lf-choice-indicator {
|
|
520
|
+
display: flex;
|
|
521
|
+
align-items: center;
|
|
522
|
+
justify-content: center;
|
|
523
|
+
width: 24px;
|
|
524
|
+
height: 24px;
|
|
525
|
+
flex-shrink: 0;
|
|
526
|
+
transition: all var(--lf-transition-duration) var(--lf-transition-easing);
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
/* Checkmark indicator style (default) */
|
|
530
|
+
.lf-choice-indicator-checkmark {
|
|
531
|
+
border-radius: 50%;
|
|
532
|
+
border: 2px solid var(--lf-color-input-border);
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
.lf-choice-card-selected .lf-choice-indicator-checkmark {
|
|
536
|
+
background-color: var(--lf-color-button-text);
|
|
537
|
+
border-color: var(--lf-color-button-text);
|
|
538
|
+
color: var(--lf-color-selected-bg);
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
/* Arrow indicator style - no border, SVG handles circle */
|
|
542
|
+
.lf-choice-indicator svg {
|
|
543
|
+
width: 18px;
|
|
544
|
+
height: 18px;
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
/* ============================================================================
|
|
548
|
+
Component Variants - Bottom Bar Navigation (Quiz Template)
|
|
549
|
+
============================================================================ */
|
|
550
|
+
|
|
551
|
+
.lf-navigation-bottom-bar {
|
|
552
|
+
position: fixed;
|
|
553
|
+
bottom: 0;
|
|
554
|
+
left: 0;
|
|
555
|
+
right: 0;
|
|
556
|
+
display: flex;
|
|
557
|
+
align-items: center;
|
|
558
|
+
justify-content: center;
|
|
559
|
+
gap: 1rem;
|
|
560
|
+
padding: 1.5rem var(--lf-spacing-container);
|
|
561
|
+
background-color: var(--lf-color-background);
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
.lf-nav-btn-back {
|
|
565
|
+
display: inline-flex;
|
|
566
|
+
align-items: center;
|
|
567
|
+
gap: 0.5rem;
|
|
568
|
+
padding: 0.875rem 1.5rem;
|
|
569
|
+
font-family: var(--lf-font-button);
|
|
570
|
+
font-size: var(--lf-font-size-button);
|
|
571
|
+
font-weight: var(--lf-font-weight-button);
|
|
572
|
+
color: var(--lf-color-answer);
|
|
573
|
+
background-color: var(--lf-color-background);
|
|
574
|
+
border: 1px solid var(--lf-color-input-border);
|
|
575
|
+
border-radius: var(--lf-border-radius);
|
|
576
|
+
cursor: pointer;
|
|
577
|
+
transition: all var(--lf-transition-duration) var(--lf-transition-easing);
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
.lf-nav-btn-back:hover {
|
|
581
|
+
background-color: var(--lf-color-surface);
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
.lf-nav-btn-back:disabled {
|
|
585
|
+
opacity: 0.4;
|
|
586
|
+
cursor: not-allowed;
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
.lf-nav-btn-next {
|
|
590
|
+
display: inline-flex;
|
|
591
|
+
align-items: center;
|
|
592
|
+
gap: 0.5rem;
|
|
593
|
+
padding: 0.875rem 2rem;
|
|
594
|
+
font-family: var(--lf-font-button);
|
|
595
|
+
font-size: var(--lf-font-size-button);
|
|
596
|
+
font-weight: var(--lf-font-weight-button);
|
|
597
|
+
color: var(--lf-color-button-text);
|
|
598
|
+
background-color: var(--lf-color-button-bg);
|
|
599
|
+
border: none;
|
|
600
|
+
border-radius: var(--lf-border-radius);
|
|
601
|
+
cursor: pointer;
|
|
602
|
+
transition: all var(--lf-transition-duration) var(--lf-transition-easing);
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
.lf-nav-btn-next:hover {
|
|
606
|
+
background-color: var(--lf-color-button-hover);
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
.lf-nav-btn-next:disabled {
|
|
610
|
+
opacity: 0.5;
|
|
611
|
+
cursor: not-allowed;
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
/* ============================================================================
|
|
615
|
+
Component Variants - Centered Header (Quiz Template)
|
|
616
|
+
============================================================================ */
|
|
617
|
+
|
|
618
|
+
.lf-header-centered {
|
|
619
|
+
display: flex;
|
|
620
|
+
flex-direction: column;
|
|
621
|
+
align-items: center;
|
|
622
|
+
padding: 1.5rem var(--lf-spacing-container);
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
.lf-header-logo {
|
|
626
|
+
max-height: 48px;
|
|
627
|
+
width: auto;
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
.lf-header-brand {
|
|
631
|
+
margin-top: 0.5rem;
|
|
632
|
+
font-size: 0.875rem;
|
|
633
|
+
color: var(--lf-color-placeholder);
|
|
634
|
+
}
|
|
635
|
+
`.trim();
|
|
636
|
+
}
|
|
637
|
+
function generateThemeStyleTag(theme) {
|
|
638
|
+
const cssVariables = generateThemeCSS(theme);
|
|
639
|
+
const componentStyles = generateComponentStyles();
|
|
640
|
+
return `${cssVariables}
|
|
641
|
+
|
|
642
|
+
${componentStyles}`;
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
// src/theme/injection.ts
|
|
646
|
+
var STYLE_ID = "lf-form-theme-variables";
|
|
647
|
+
var CUSTOM_STYLE_ID = "lf-form-custom-css";
|
|
648
|
+
function isBrowser() {
|
|
649
|
+
return typeof window !== "undefined" && typeof document !== "undefined";
|
|
650
|
+
}
|
|
651
|
+
function injectThemeCSS(theme) {
|
|
652
|
+
if (!isBrowser()) {
|
|
653
|
+
return () => {
|
|
654
|
+
};
|
|
655
|
+
}
|
|
656
|
+
let styleEl = document.getElementById(STYLE_ID);
|
|
657
|
+
if (!styleEl) {
|
|
658
|
+
styleEl = document.createElement("style");
|
|
659
|
+
styleEl.id = STYLE_ID;
|
|
660
|
+
document.head.appendChild(styleEl);
|
|
661
|
+
}
|
|
662
|
+
styleEl.textContent = generateThemeStyleTag(theme);
|
|
663
|
+
if (theme.customCSS) {
|
|
664
|
+
let customStyleEl = document.getElementById(
|
|
665
|
+
CUSTOM_STYLE_ID
|
|
666
|
+
);
|
|
667
|
+
if (!customStyleEl) {
|
|
668
|
+
customStyleEl = document.createElement("style");
|
|
669
|
+
customStyleEl.id = CUSTOM_STYLE_ID;
|
|
670
|
+
document.head.appendChild(customStyleEl);
|
|
671
|
+
}
|
|
672
|
+
customStyleEl.textContent = theme.customCSS;
|
|
673
|
+
}
|
|
674
|
+
return () => {
|
|
675
|
+
const el = document.getElementById(STYLE_ID);
|
|
676
|
+
if (el) el.remove();
|
|
677
|
+
const customEl = document.getElementById(CUSTOM_STYLE_ID);
|
|
678
|
+
if (customEl) customEl.remove();
|
|
679
|
+
};
|
|
680
|
+
}
|
|
681
|
+
function getThemeCSSForSSR(theme) {
|
|
682
|
+
return generateThemeStyleTag(theme);
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
export { generateComponentStyles, generateThemeCSS, generateThemeStyleTag, getThemeCSSForSSR, injectThemeCSS, isBrowser, radiusToCSS };
|
|
686
|
+
//# sourceMappingURL=chunk-PDUJU32P.js.map
|
|
687
|
+
//# sourceMappingURL=chunk-PDUJU32P.js.map
|