accomadesc 0.2.14 → 0.2.15

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.
@@ -9,6 +9,7 @@
9
9
  import OccuPlanPicker from './occuplan/OccuPlanPicker.svelte';
10
10
  import { slide } from 'svelte/transition';
11
11
  import type { DateTime } from 'luxon';
12
+ import { randomID } from './names/gen.ts';
12
13
 
13
14
  const {
14
15
  endpoint,
@@ -30,6 +31,8 @@
30
31
  formatDateFunc,
31
32
  }: BookingRequestContent & I18nFacade = $props();
32
33
 
34
+ const id = randomID();
35
+
33
36
  let name = $state('');
34
37
  let email = $state('');
35
38
  let message = $state('');
@@ -127,31 +130,31 @@
127
130
 
128
131
  <form onsubmit={createRequest}>
129
132
  <input type="hidden" value={userID} />
130
- <label for="name-input">
133
+ <label for={`${id}-name-input`}>
131
134
  <span class:disabled>{@html translateFunc ? translateFunc(nameLabel) : 'Name'}:</span>
132
135
  </label>
133
136
  <div class="input-wrapper">
134
137
  <TextInput
135
- id="name-input"
138
+ id={`${id}name-input`}
136
139
  type="text"
137
140
  marginForMessage={false}
138
141
  bind:value={name}
139
142
  enabled={!disabled}
140
143
  />
141
144
  </div>
142
- <label for="email-input">
145
+ <label for={`${id}-email-input`}>
143
146
  <span class:disabled>{@html translateFunc ? translateFunc(emailLabel) : 'Email'}:</span>
144
147
  </label>
145
148
  <div class="input-wrapper">
146
149
  <TextInput
147
- id="email-input"
150
+ id={`${id}-email-input`}
148
151
  type="email"
149
152
  marginForMessage={false}
150
153
  bind:value={email}
151
154
  enabled={!disabled}
152
155
  />
153
156
  </div>
154
- <label for="date-input">
157
+ <label for={`${id}-date-input`}>
155
158
  <span class:disabled
156
159
  >{@html translateFunc ? translateFunc(dateEntryLabel) : 'Vacation Dates'}:</span
157
160
  >
@@ -165,7 +168,7 @@
165
168
  <div class="date-input-wrapper" id="engage-date-buttons">
166
169
  <Button
167
170
  enabled={!disabled}
168
- id="date-input"
171
+ id={`${id}-date-input`}
169
172
  iconName="edit"
170
173
  size={1.8}
171
174
  clicked={engageDateInput}
@@ -229,7 +232,6 @@
229
232
  background-color: var(--main-bg-color);
230
233
  color: var(--main-font-color);
231
234
 
232
- width: 100%;
233
235
  display: flex;
234
236
  flex-direction: column;
235
237
  align-items: center;
@@ -246,6 +248,7 @@
246
248
  row-gap: 0.5rem;
247
249
 
248
250
  label {
251
+ align-content: center;
249
252
  grid-column-start: start;
250
253
  grid-column-end: gap-start;
251
254
  }
@@ -4,6 +4,7 @@
4
4
  import TextInput from './basic/TextInput.svelte';
5
5
  import Notes from './basic/Notes.svelte';
6
6
  import type { ContactFormContent, I18nFacade } from './types.js';
7
+ import { randomID } from './names/gen.ts';
7
8
 
8
9
  const {
9
10
  userID,
@@ -20,6 +21,8 @@
20
21
  translateFunc,
21
22
  }: ContactFormContent & I18nFacade = $props();
22
23
 
24
+ const id = randomID();
25
+
23
26
  let name = $state('');
24
27
  let email = $state('');
25
28
  let question = $state('');
@@ -83,17 +86,36 @@
83
86
  {#if explainer}
84
87
  <div class="explainer">{@html translateFunc ? translateFunc(explainer) : ''}</div>
85
88
  {/if}
89
+
86
90
  <form onsubmit={submitMessage}>
87
91
  <input type="hidden" value={userID} />
88
- <label class:disabled>
89
- {@html translateFunc ? translateFunc(nameLabel) : 'Name'}:
90
- <TextInput type="text" marginForMessage={false} bind:value={name} enabled={!disabled} />
92
+ <label for={`${id}-name`}>
93
+ <span class:disabled>{@html translateFunc ? translateFunc(nameLabel) : 'Name'}:</span>
91
94
  </label>
92
- <label class:disabled>
93
- {@html translateFunc ? translateFunc(emailLabel) : 'Email'}:
94
- <TextInput type="email" marginForMessage={false} bind:value={email} enabled={!disabled} />
95
+ <div class="input-wrapper">
96
+ <TextInput
97
+ id={`${id}-name`}
98
+ type="text"
99
+ marginForMessage={false}
100
+ bind:value={name}
101
+ enabled={!disabled}
102
+ />
103
+ </div>
104
+ <label for={`${id}-email`}>
105
+ <span class:disabled>{@html translateFunc ? translateFunc(emailLabel) : 'Email'}:</span>
95
106
  </label>
96
- <label class="row-label"
107
+
108
+ <div class="input-wrapper">
109
+ <TextInput
110
+ id={`${id}-email`}
111
+ type="email"
112
+ marginForMessage={false}
113
+ bind:value={email}
114
+ enabled={!disabled}
115
+ />
116
+ </div>
117
+
118
+ <label class="notes-input"
97
119
  ><div class:disabled>
98
120
  {@html translateFunc
99
121
  ? translateFunc(questionLabel)
@@ -101,9 +123,9 @@
101
123
  >&nbsp;({currentCharsCount}/{maxCharsAllowed})</span
102
124
  >{/if}:
103
125
  </div>
104
-
105
- <Notes {disabled} changed={questionChanged} />
126
+ <Notes id={`${id}-notes`} {disabled} changed={questionChanged} />
106
127
  </label>
128
+
107
129
  <div class="message-wrapper">
108
130
  {#if preview}<div>[PREVIEW]</div>{/if}
109
131
  {#if successfullySent || preview}
@@ -133,13 +155,13 @@
133
155
  <style>
134
156
  .explainer {
135
157
  margin-bottom: 1rem;
158
+ grid-column: span 2;
136
159
  }
137
160
 
138
161
  .wrapper {
139
162
  background-color: var(--main-bg-color);
140
163
  color: var(--main-font-color);
141
164
 
142
- width: 100%;
143
165
  display: flex;
144
166
  flex-direction: column;
145
167
  align-items: center;
@@ -151,28 +173,43 @@
151
173
  }
152
174
  }
153
175
 
154
- .message-wrapper {
155
- display: flex;
156
- justify-content: space-between;
157
- }
158
-
159
176
  form {
160
- display: flex;
161
- flex-direction: column;
162
- width: 100%;
163
- gap: 0.5rem;
164
- }
177
+ display: grid;
178
+ grid-template-columns: [start] 1fr [gap-start] 0.5fr [gap-end] 3fr [end];
179
+ row-gap: 0.5rem;
180
+
181
+ label {
182
+ align-content: center;
183
+ grid-column-start: start;
184
+ grid-column-end: gap-start;
185
+ }
165
186
 
166
- label {
167
- display: flex;
168
- gap: 1rem;
169
- align-items: center;
170
- justify-content: space-between;
171
- }
187
+ .message-wrapper {
188
+ margin-top: 1rem;
189
+ grid-column-start: start;
190
+ grid-column-end: end;
191
+ display: flex;
192
+ justify-content: space-between;
193
+ }
194
+ .button-wrapper {
195
+ grid-column-start: start;
196
+ grid-column-end: end;
197
+ display: flex;
198
+ justify-content: flex-start;
199
+ }
200
+ .input-wrapper {
201
+ grid-column-start: gap-end;
202
+ grid-column-end: end;
203
+ }
172
204
 
173
- .row-label {
174
- flex-direction: column;
175
- gap: 0.2rem;
205
+ .notes-input {
206
+ margin-top: 2rem;
207
+ grid-column-start: start;
208
+ grid-column-end: end;
209
+ display: flex;
210
+ flex-direction: column;
211
+ gap: 1rem;
212
+ }
176
213
  }
177
214
 
178
215
  .max-chars-message {
@@ -5,7 +5,7 @@
5
5
  import type { I18nFacade, PricingShortContent, PricingEntry } from './types.js';
6
6
 
7
7
  let {
8
- global = undefined,
8
+ global,
9
9
  entries = [],
10
10
  ranges = [],
11
11
  staticRanges = [],
package/dist/types.d.ts CHANGED
@@ -283,7 +283,6 @@ export interface BookingRequestContent {
283
283
  sentErroredText: string;
284
284
  invalidText: string;
285
285
  messageLabel: string;
286
- numberOfNightsLabel: string;
287
286
  maxCharsAllowed?: number;
288
287
  explainer?: string;
289
288
  preview?: boolean;
package/package.json CHANGED
@@ -1,10 +1,12 @@
1
1
  {
2
2
  "name": "accomadesc",
3
- "version": "0.2.14",
3
+ "version": "0.2.15",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build && npm run package",
7
7
  "preview": "vite preview",
8
+ "prepare": "svelte-kit sync || echo ''",
9
+ "prepack": "svelte-kit sync && svelte-package && publint",
8
10
  "package": "svelte-kit sync && svelte-package && publint",
9
11
  "prepublishOnly": "npm run package",
10
12
  "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
@@ -49,8 +51,7 @@
49
51
  "svelte": "^5.20.5",
50
52
  "svelte-check": "^4.1.4",
51
53
  "typescript": "^5.8.2",
52
- "vite": "^6.2.0",
53
- "vitest": "^2.1.9"
54
+ "vite": "^6.2.0"
54
55
  },
55
56
  "dependencies": {
56
57
  "@dinero.js/currencies": "2.0.0-alpha.14",
@@ -62,7 +63,6 @@
62
63
  "luxon": "^3.5.0",
63
64
  "squirrelly": "^9.1.0"
64
65
  },
65
- "packageManager": "pnpm@10.5.2+sha512.da9dc28cd3ff40d0592188235ab25d3202add8a207afbedc682220e4a0029ffbff4562102b9e6e46b4e3f9e8bd53e6d05de48544b0c57d4b0179e22c76d1199b",
66
66
  "pnpm": {
67
67
  "onlyBuiltDependencies": [
68
68
  "esbuild"