@elixir-cloud/cloud-registry 2.0.0-alpha.28

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.
Files changed (39) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +12 -0
  3. package/dist/chunks/chunk.3WU6NPWM.js +1 -0
  4. package/dist/chunks/chunk.HIA3DP4L.js +158 -0
  5. package/dist/chunks/chunk.HM342EMQ.js +574 -0
  6. package/dist/chunks/chunk.S3NI7NKU.js +30 -0
  7. package/dist/chunks/chunk.SG7Q2SX3.js +25 -0
  8. package/dist/chunks/chunk.U3XZVV4K.js +1 -0
  9. package/dist/chunks/chunk.V3D32NZ5.js +717 -0
  10. package/dist/chunks/chunk.XMLA2YKQ.js +10 -0
  11. package/dist/components/index.d.ts +1 -0
  12. package/dist/components/index.js +6 -0
  13. package/dist/components/service-create/index.d.ts +8 -0
  14. package/dist/components/service-create/index.js +5 -0
  15. package/dist/components/service-create/service-create.d.ts +41 -0
  16. package/dist/components/service-create/service-create.js +4 -0
  17. package/dist/components/service-create/tw-styles.d.ts +1 -0
  18. package/dist/components/service-create/tw-styles.js +2 -0
  19. package/dist/custom-elements.json +303 -0
  20. package/dist/events/ecc-service-create-failed.d.ts +8 -0
  21. package/dist/events/ecc-service-create-validation-failed.d.ts +8 -0
  22. package/dist/events/ecc-service-created.d.ts +11 -0
  23. package/dist/events/index.d.ts +3 -0
  24. package/dist/global.d.ts +4 -0
  25. package/dist/index.d.ts +1 -0
  26. package/dist/index.js +6 -0
  27. package/dist/providers/cr-provider.d.ts +50 -0
  28. package/dist/providers/cr-provider.js +1 -0
  29. package/dist/providers/index.d.ts +3 -0
  30. package/dist/providers/index.js +3 -0
  31. package/dist/providers/rest-cr-provider.d.ts +62 -0
  32. package/dist/providers/rest-cr-provider.js +2 -0
  33. package/dist/react/index.d.ts +1 -0
  34. package/dist/react/index.js +5 -0
  35. package/dist/react/service-create/index.d.ts +25 -0
  36. package/dist/react/service-create/index.js +5 -0
  37. package/dist/vscode.html-custom-data.json +17 -0
  38. package/dist/web-types.json +66 -0
  39. package/package.json +77 -0
@@ -0,0 +1,717 @@
1
+ import { ComponentStyles } from './chunk.HM342EMQ.js';
2
+ import { RestCloudRegistryProvider } from './chunk.HIA3DP4L.js';
3
+ import { __decorateClass, __spreadProps, __spreadValues } from './chunk.S3NI7NKU.js';
4
+ import { css, LitElement, html } from 'lit';
5
+ import { property, state } from 'lit/decorators.js';
6
+ import '@elixir-cloud/design/components/button/index.js';
7
+ import '@elixir-cloud/design/components/input/index.js';
8
+ import '@elixir-cloud/design/components/select/index.js';
9
+ import '@elixir-cloud/design/components/label/index.js';
10
+ import '@elixir-cloud/design/components/textarea/index.js';
11
+ import '@elixir-cloud/design/components/collapsible/index.js';
12
+
13
+ var GlobalStyles = css`
14
+ :host {
15
+ --background: var(--ecc-background, oklch(1 0 0));
16
+ --foreground: var(--ecc-foreground, oklch(0.145 0 0));
17
+ --card: var(--ecc-card, oklch(1 0 0));
18
+ --card-foreground: var(--ecc-card-foreground, oklch(0.145 0 0));
19
+ --popover: var(--ecc-popover, oklch(1 0 0));
20
+ --popover-foreground: var(--ecc-popover-foreground, oklch(0.145 0 0));
21
+ --primary: var(--ecc-primary, oklch(0.205 0 0));
22
+ --primary-foreground: var(--ecc-primary-foreground, oklch(0.985 0 0));
23
+ --secondary: var(--ecc-secondary, oklch(0.97 0 0));
24
+ --secondary-foreground: var(--ecc-secondary-foreground, oklch(0.205 0 0));
25
+ --muted: var(--ecc-muted, oklch(0.97 0 0));
26
+ --muted-foreground: var(--ecc-muted-foreground, oklch(0.556 0 0));
27
+ --accent: var(--ecc-accent, oklch(0.97 0 0));
28
+ --accent-foreground: var(--ecc-accent-foreground, oklch(0.205 0 0));
29
+ --destructive: var(--ecc-destructive, oklch(0.577 0.245 27.325));
30
+ --destructive-foreground: var(
31
+ --ecc-destructive-foreground,
32
+ oklch(0.985 0 0)
33
+ );
34
+ --border: var(--ecc-border, oklch(0.922 0 0));
35
+ --input: var(--ecc-input, oklch(0.922 0 0));
36
+ --ring: var(--ecc-ring, oklch(0.708 0 0));
37
+ --chart-1: var(--ecc-chart-1, oklch(0.646 0.222 41.116));
38
+ --chart-2: var(--ecc-chart-2, oklch(0.6 0.118 184.704));
39
+ --chart-3: var(--ecc-chart-3, oklch(0.398 0.07 227.392));
40
+ --chart-4: var(--ecc-chart-4, oklch(0.828 0.189 84.429));
41
+ --chart-5: var(--ecc-chart-5, oklch(0.769 0.188 70.08));
42
+ --radius: var(--ecc-radius, 0.625rem);
43
+ --sidebar: var(--ecc-sidebar, oklch(0.985 0 0));
44
+ --sidebar-foreground: var(--ecc-sidebar-foreground, oklch(0.145 0 0));
45
+ --sidebar-primary: var(--ecc-sidebar-primary, oklch(0.205 0 0));
46
+ --sidebar-primary-foreground: var(
47
+ --ecc-sidebar-primary-foreground,
48
+ oklch(0.985 0 0)
49
+ );
50
+ --sidebar-accent: var(--ecc-sidebar-accent, oklch(0.97 0 0));
51
+ --sidebar-accent-foreground: var(
52
+ --ecc-sidebar-accent-foreground,
53
+ oklch(0.205 0 0)
54
+ );
55
+ --sidebar-border: var(--ecc-sidebar-border, oklch(0.922 0 0));
56
+ --sidebar-ring: var(--ecc-sidebar-ring, oklch(0.708 0 0));
57
+ }
58
+
59
+ :host([dark]),
60
+ :host-context([dark]),
61
+ :host-context(.dark) {
62
+ --background: var(--ecc-background, oklch(0.145 0 0));
63
+ --foreground: var(--ecc-foreground, oklch(0.985 0 0));
64
+ --card: var(--ecc-card, oklch(0.145 0 0));
65
+ --card-foreground: var(--ecc-card-foreground, oklch(0.985 0 0));
66
+ --popover: var(--ecc-popover, oklch(0.145 0 0));
67
+ --popover-foreground: var(--ecc-popover-foreground, oklch(0.985 0 0));
68
+ --primary: var(--ecc-primary, oklch(0.985 0 0));
69
+ --primary-foreground: var(--ecc-primary-foreground, oklch(0.205 0 0));
70
+ --secondary: var(--ecc-secondary, oklch(0.269 0 0));
71
+ --secondary-foreground: var(--ecc-secondary-foreground, oklch(0.985 0 0));
72
+ --muted: var(--ecc-muted, oklch(0.269 0 0));
73
+ --muted-foreground: var(--ecc-muted-foreground, oklch(0.708 0 0));
74
+ --accent: var(--ecc-accent, oklch(0.269 0 0));
75
+ --accent-foreground: var(--ecc-accent-foreground, oklch(0.985 0 0));
76
+ --destructive: var(--ecc-destructive, oklch(0.396 0.141 25.723));
77
+ --destructive-foreground: var(
78
+ --ecc-destructive-foreground,
79
+ oklch(0.637 0.237 25.331)
80
+ );
81
+ --border: var(--ecc-border, oklch(0.269 0 0));
82
+ --input: var(--ecc-input, oklch(0.269 0 0));
83
+ --ring: var(--ecc-ring, oklch(0.439 0 0));
84
+ --chart-1: var(--ecc-chart-1, oklch(0.488 0.243 264.376));
85
+ --chart-2: var(--ecc-chart-2, oklch(0.696 0.17 162.48));
86
+ --chart-3: var(--ecc-chart-3, oklch(0.769 0.188 70.08));
87
+ --chart-4: var(--ecc-chart-4, oklch(0.627 0.265 303.9));
88
+ --chart-5: var(--ecc-chart-5, oklch(0.645 0.246 16.439));
89
+ --sidebar: var(--ecc-sidebar, oklch(0.205 0 0));
90
+ --sidebar-foreground: var(--ecc-sidebar-foreground, oklch(0.985 0 0));
91
+ --sidebar-primary: var(--ecc-sidebar-primary, oklch(0.488 0.243 264.376));
92
+ --sidebar-primary-foreground: var(
93
+ --ecc-sidebar-primary-foreground,
94
+ oklch(0.985 0 0)
95
+ );
96
+ --sidebar-accent: var(--ecc-sidebar-accent, oklch(0.269 0 0));
97
+ --sidebar-accent-foreground: var(
98
+ --ecc-sidebar-accent-foreground,
99
+ oklch(0.985 0 0)
100
+ );
101
+ --sidebar-border: var(--ecc-sidebar-border, oklch(0.269 0 0));
102
+ --sidebar-ring: var(--ecc-sidebar-ring, oklch(0.439 0 0));
103
+ }
104
+ `;
105
+ var ECCClientElixirCloudRegistryServiceCreate = class extends LitElement {
106
+ constructor() {
107
+ super(...arguments);
108
+ this.baseUrl = "";
109
+ this.serviceTypes = [];
110
+ this.loading = false;
111
+ this.error = null;
112
+ this.success = null;
113
+ this.formData = {
114
+ name: "",
115
+ url: "",
116
+ organization: {
117
+ name: "",
118
+ url: ""
119
+ },
120
+ type: {
121
+ group: "org.ga4gh",
122
+ artifact: "",
123
+ version: ""
124
+ },
125
+ version: "",
126
+ description: "",
127
+ contactUrl: "",
128
+ documentationUrl: "",
129
+ environment: "",
130
+ createdAt: "",
131
+ updatedAt: "",
132
+ customServiceId: "",
133
+ useCustomId: false
134
+ };
135
+ this._provider = null;
136
+ }
137
+ async firstUpdated() {
138
+ if (!this.baseUrl && !this.provider) {
139
+ this.dispatchEvent(
140
+ new CustomEvent("ecc-service-create-validation-failed", {
141
+ detail: {
142
+ error: "Please provide either a base URL for the Cloud Registry API or a custom provider."
143
+ },
144
+ bubbles: true,
145
+ composed: true
146
+ })
147
+ );
148
+ return;
149
+ }
150
+ if (this.provider) {
151
+ this._provider = this.provider;
152
+ } else if (this.baseUrl) {
153
+ this._provider = new RestCloudRegistryProvider(this.baseUrl);
154
+ } else {
155
+ this._provider = null;
156
+ }
157
+ if (this._provider) {
158
+ await this.loadServiceTypes();
159
+ }
160
+ }
161
+ updated(changedProperties) {
162
+ if (changedProperties.has("baseUrl") && this.baseUrl) {
163
+ this._provider = new RestCloudRegistryProvider(this.baseUrl);
164
+ this.loadServiceTypes();
165
+ }
166
+ }
167
+ async loadServiceTypes() {
168
+ if (!this._provider) return;
169
+ try {
170
+ this.serviceTypes = await this._provider.getServiceTypes();
171
+ } catch (error) {
172
+ console.error("Failed to load service types:", error);
173
+ this.dispatchEvent(
174
+ new CustomEvent("ecc-service-create-failed", {
175
+ detail: { error: "Failed to load service types" },
176
+ bubbles: true,
177
+ composed: true
178
+ })
179
+ );
180
+ }
181
+ }
182
+ handleInputChange(field, value) {
183
+ this.formData = __spreadProps(__spreadValues({}, this.formData), { [field]: value });
184
+ }
185
+ handleNestedInputChange(parent, field, value) {
186
+ const parentObject = this.formData[parent];
187
+ if (typeof parentObject === "object" && parentObject !== null) {
188
+ this.formData = __spreadProps(__spreadValues({}, this.formData), {
189
+ [parent]: __spreadProps(__spreadValues({}, parentObject), { [field]: value })
190
+ });
191
+ }
192
+ }
193
+ async handleSubmit() {
194
+ if (!this._provider || !this._provider.createService) {
195
+ this.dispatchEvent(
196
+ new CustomEvent("ecc-service-create-failed", {
197
+ detail: {
198
+ error: "Service creation is not supported by the current provider"
199
+ },
200
+ bubbles: true,
201
+ composed: true
202
+ })
203
+ );
204
+ return;
205
+ }
206
+ this.loading = true;
207
+ try {
208
+ if (!this.formData.name) {
209
+ throw new Error("Service name is required");
210
+ }
211
+ if (!this.formData.url) {
212
+ throw new Error("Service URL is required");
213
+ }
214
+ if (!this.formData.organization.name) {
215
+ throw new Error("Organization name is required");
216
+ }
217
+ if (!this.formData.organization.url) {
218
+ throw new Error("Organization URL is required");
219
+ }
220
+ if (!this.formData.type.artifact) {
221
+ throw new Error("Service type artifact is required");
222
+ }
223
+ if (!this.formData.type.version) {
224
+ throw new Error("Service type version is required");
225
+ }
226
+ if (!this.formData.version) {
227
+ throw new Error("Service version is required");
228
+ }
229
+ const serviceData = {
230
+ name: this.formData.name,
231
+ url: this.formData.url,
232
+ organization: {
233
+ name: this.formData.organization.name,
234
+ url: this.formData.organization.url
235
+ },
236
+ type: {
237
+ group: this.formData.type.group,
238
+ artifact: this.formData.type.artifact,
239
+ version: this.formData.type.version
240
+ },
241
+ version: this.formData.version,
242
+ description: this.formData.description || void 0,
243
+ contactUrl: this.formData.contactUrl || void 0,
244
+ documentationUrl: this.formData.documentationUrl || void 0,
245
+ environment: this.formData.environment || void 0,
246
+ createdAt: this.formData.createdAt || void 0,
247
+ updatedAt: this.formData.updatedAt || void 0
248
+ };
249
+ let serviceId;
250
+ if (this.formData.useCustomId && this.formData.customServiceId) {
251
+ serviceId = await this._provider.createServiceWithId(
252
+ this.formData.customServiceId,
253
+ serviceData
254
+ );
255
+ } else {
256
+ serviceId = await this._provider.createService(serviceData);
257
+ }
258
+ const successMessage = `Service created successfully with ID: ${serviceId}`;
259
+ this.dispatchEvent(
260
+ new CustomEvent("ecc-service-created", {
261
+ detail: { serviceId, serviceData, message: successMessage },
262
+ bubbles: true,
263
+ composed: true
264
+ })
265
+ );
266
+ this.resetForm();
267
+ } catch (err) {
268
+ const errorMessage = err instanceof Error ? err.message : "Failed to create service";
269
+ this.dispatchEvent(
270
+ new CustomEvent("ecc-service-create-failed", {
271
+ detail: { error: errorMessage },
272
+ bubbles: true,
273
+ composed: true
274
+ })
275
+ );
276
+ } finally {
277
+ this.loading = false;
278
+ }
279
+ }
280
+ resetForm() {
281
+ this.formData = {
282
+ name: "",
283
+ url: "",
284
+ organization: {
285
+ name: "",
286
+ url: ""
287
+ },
288
+ type: {
289
+ group: "org.ga4gh",
290
+ artifact: "",
291
+ version: ""
292
+ },
293
+ version: "",
294
+ description: "",
295
+ contactUrl: "",
296
+ documentationUrl: "",
297
+ environment: "",
298
+ createdAt: "",
299
+ updatedAt: "",
300
+ customServiceId: "",
301
+ useCustomId: false
302
+ };
303
+ }
304
+ renderBasicFields() {
305
+ return html`
306
+ <div class="grid gap-4">
307
+ <!-- Service Name and URL in same row on desktop -->
308
+ <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
309
+ <div class="grid gap-2">
310
+ <ecc-utils-design-label
311
+ for="service-name"
312
+ class="text-sm font-medium"
313
+ >
314
+ Service Name <span class="text-destructive">*</span>
315
+ </ecc-utils-design-label>
316
+ <ecc-utils-design-input
317
+ id="service-name"
318
+ .value=${this.formData.name}
319
+ @ecc-input-changed=${(e) => this.handleInputChange("name", e.detail.value)}
320
+ placeholder="Enter a descriptive name for your service"
321
+ required
322
+ class="h-10"
323
+ ></ecc-utils-design-input>
324
+ </div>
325
+
326
+ <div class="grid gap-2">
327
+ <ecc-utils-design-label
328
+ for="service-url"
329
+ class="text-sm font-medium"
330
+ >
331
+ Service URL <span class="text-destructive">*</span>
332
+ </ecc-utils-design-label>
333
+ <ecc-utils-design-input
334
+ id="service-url"
335
+ .value=${this.formData.url}
336
+ @ecc-input-changed=${(e) => this.handleInputChange("url", e.detail.value)}
337
+ placeholder="https://api.example.com/v1"
338
+ required
339
+ class="h-10"
340
+ ></ecc-utils-design-input>
341
+ </div>
342
+ </div>
343
+
344
+ <!-- Organization fields -->
345
+ <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
346
+ <div class="grid gap-2">
347
+ <ecc-utils-design-label for="org-name" class="text-sm font-medium">
348
+ Organization Name <span class="text-destructive">*</span>
349
+ </ecc-utils-design-label>
350
+ <ecc-utils-design-input
351
+ id="org-name"
352
+ .value=${this.formData.organization.name}
353
+ @ecc-input-changed=${(e) => this.handleNestedInputChange(
354
+ "organization",
355
+ "name",
356
+ e.detail.value
357
+ )}
358
+ placeholder="Enter your organization name"
359
+ required
360
+ class="h-10"
361
+ ></ecc-utils-design-input>
362
+ </div>
363
+
364
+ <div class="grid gap-2">
365
+ <ecc-utils-design-label for="org-url" class="text-sm font-medium">
366
+ Organization URL <span class="text-destructive">*</span>
367
+ </ecc-utils-design-label>
368
+ <ecc-utils-design-input
369
+ id="org-url"
370
+ .value=${this.formData.organization.url}
371
+ @ecc-input-changed=${(e) => this.handleNestedInputChange(
372
+ "organization",
373
+ "url",
374
+ e.detail.value
375
+ )}
376
+ placeholder="https://example.com"
377
+ required
378
+ class="h-10"
379
+ ></ecc-utils-design-input>
380
+ </div>
381
+ </div>
382
+
383
+ <!-- Service Type fields -->
384
+ <div class="grid grid-cols-1 md:grid-cols-3 gap-4">
385
+ <div class="grid gap-2">
386
+ <ecc-utils-design-label
387
+ for="type-group"
388
+ class="text-sm font-medium"
389
+ >
390
+ Type Group <span class="text-destructive">*</span>
391
+ </ecc-utils-design-label>
392
+ <ecc-utils-design-input
393
+ id="type-group"
394
+ .value=${this.formData.type.group}
395
+ @ecc-input-changed=${(e) => this.handleNestedInputChange("type", "group", e.detail.value)}
396
+ placeholder="org.ga4gh"
397
+ required
398
+ class="h-10"
399
+ ></ecc-utils-design-input>
400
+ </div>
401
+
402
+ <div class="grid gap-2">
403
+ <ecc-utils-design-label
404
+ for="type-artifact"
405
+ class="text-sm font-medium"
406
+ >
407
+ Type Artifact <span class="text-destructive">*</span>
408
+ </ecc-utils-design-label>
409
+ <ecc-utils-design-input
410
+ id="type-artifact"
411
+ .value=${this.formData.type.artifact}
412
+ @ecc-input-changed=${(e) => this.handleNestedInputChange(
413
+ "type",
414
+ "artifact",
415
+ e.detail.value
416
+ )}
417
+ placeholder="beacon, wes, trs, etc."
418
+ required
419
+ class="h-10"
420
+ ></ecc-utils-design-input>
421
+ </div>
422
+
423
+ <div class="grid gap-2">
424
+ <ecc-utils-design-label
425
+ for="type-version"
426
+ class="text-sm font-medium"
427
+ >
428
+ Type Version <span class="text-destructive">*</span>
429
+ </ecc-utils-design-label>
430
+ <ecc-utils-design-input
431
+ id="type-version"
432
+ .value=${this.formData.type.version}
433
+ @ecc-input-changed=${(e) => this.handleNestedInputChange("type", "version", e.detail.value)}
434
+ placeholder="1.0.0"
435
+ required
436
+ class="h-10"
437
+ ></ecc-utils-design-input>
438
+ </div>
439
+ </div>
440
+
441
+ <!-- Service Version -->
442
+ <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
443
+ <div class="grid gap-2">
444
+ <ecc-utils-design-label
445
+ for="service-version"
446
+ class="text-sm font-medium"
447
+ >
448
+ Service Version <span class="text-destructive">*</span>
449
+ </ecc-utils-design-label>
450
+ <ecc-utils-design-input
451
+ id="service-version"
452
+ .value=${this.formData.version}
453
+ @ecc-input-changed=${(e) => this.handleInputChange("version", e.detail.value)}
454
+ placeholder="1.0.0"
455
+ required
456
+ class="h-10"
457
+ ></ecc-utils-design-input>
458
+ </div>
459
+
460
+ <div class="grid gap-2">
461
+ <ecc-utils-design-label
462
+ for="environment"
463
+ class="text-sm font-medium"
464
+ >
465
+ Environment
466
+ </ecc-utils-design-label>
467
+ <ecc-utils-design-select
468
+ id="environment"
469
+ .value=${this.formData.environment}
470
+ @ecc-input-changed=${(e) => this.handleInputChange("environment", e.detail.value)}
471
+ >
472
+ <ecc-utils-design-select-trigger class="h-10">
473
+ <ecc-utils-design-select-value
474
+ placeholder="Select environment"
475
+ ></ecc-utils-design-select-value>
476
+ </ecc-utils-design-select-trigger>
477
+ <ecc-utils-design-select-content>
478
+ <ecc-utils-design-select-item value=""
479
+ >No environment specified</ecc-utils-design-select-item
480
+ >
481
+ <ecc-utils-design-select-item value="prod"
482
+ >Production</ecc-utils-design-select-item
483
+ >
484
+ <ecc-utils-design-select-item value="test"
485
+ >Test</ecc-utils-design-select-item
486
+ >
487
+ <ecc-utils-design-select-item value="dev"
488
+ >Development</ecc-utils-design-select-item
489
+ >
490
+ <ecc-utils-design-select-item value="staging"
491
+ >Staging</ecc-utils-design-select-item
492
+ >
493
+ </ecc-utils-design-select-content>
494
+ </ecc-utils-design-select>
495
+ </div>
496
+ </div>
497
+
498
+ <!-- Description spans full width -->
499
+ <div class="grid gap-2">
500
+ <ecc-utils-design-label for="description" class="text-sm font-medium">
501
+ Description
502
+ </ecc-utils-design-label>
503
+ <ecc-utils-design-textarea
504
+ id="description"
505
+ .value=${this.formData.description}
506
+ @ecc-input-changed=${(e) => this.handleInputChange("description", e.detail.value)}
507
+ placeholder="Provide a detailed description of what your service does"
508
+ rows="4"
509
+ class="resize-none"
510
+ ></ecc-utils-design-textarea>
511
+ </div>
512
+
513
+ ${this.renderAdvancedFields()}
514
+ </div>
515
+ `;
516
+ }
517
+ renderAdvancedFields() {
518
+ return html`
519
+ <div class="space-y-6">
520
+ <ecc-utils-design-collapsible>
521
+ <ecc-utils-design-collapsible-trigger>
522
+ <div
523
+ class="flex items-center justify-between w-full py-2 text-left hover:bg-muted/50 focus:outline-none focus:ring-1 focus:ring-ring rounded-t cursor-pointer transition-colors px-2"
524
+ >
525
+ <div class="space-y-0.5">
526
+ <h4 class="text-sm font-medium text-muted-foreground">
527
+ Advanced Configuration
528
+ </h4>
529
+ </div>
530
+ <svg
531
+ class="w-4 h-4 text-muted-foreground/60 transition-transform duration-200 shrink-0"
532
+ fill="none"
533
+ stroke="currentColor"
534
+ viewBox="0 0 24 24"
535
+ >
536
+ <path
537
+ stroke-linecap="round"
538
+ stroke-linejoin="round"
539
+ stroke-width="2"
540
+ d="M19 9l-7 7-7-7"
541
+ ></path>
542
+ </svg>
543
+ </div>
544
+ </ecc-utils-design-collapsible-trigger>
545
+
546
+ <ecc-utils-design-collapsible-content>
547
+ <div class="pt-4 space-y-4 border-t border-border/50">
548
+ <!-- Custom Service ID -->
549
+ <div class="grid gap-2">
550
+ <ecc-utils-design-label
551
+ for="custom-service-id"
552
+ class="text-sm font-medium"
553
+ >
554
+ Custom Service ID
555
+ </ecc-utils-design-label>
556
+ <ecc-utils-design-input
557
+ id="custom-service-id"
558
+ .value=${this.formData.customServiceId}
559
+ @ecc-input-changed=${(e) => {
560
+ this.handleInputChange("customServiceId", e.detail.value);
561
+ this.handleInputChange(
562
+ "useCustomId",
563
+ Boolean(e.detail.value)
564
+ );
565
+ }}
566
+ placeholder="org.example.my-service (optional)"
567
+ class="h-10"
568
+ ></ecc-utils-design-input>
569
+ </div>
570
+
571
+ <!-- Contact and Documentation URLs -->
572
+ <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
573
+ <div class="grid gap-2">
574
+ <ecc-utils-design-label
575
+ for="contact-url"
576
+ class="text-sm font-medium"
577
+ >
578
+ Contact URL
579
+ </ecc-utils-design-label>
580
+ <ecc-utils-design-input
581
+ id="contact-url"
582
+ .value=${this.formData.contactUrl}
583
+ @ecc-input-changed=${(e) => this.handleInputChange("contactUrl", e.detail.value)}
584
+ placeholder="mailto:support@example.com or https://contact.example.com"
585
+ class="h-10"
586
+ ></ecc-utils-design-input>
587
+ </div>
588
+
589
+ <div class="grid gap-2">
590
+ <ecc-utils-design-label
591
+ for="documentation-url"
592
+ class="text-sm font-medium"
593
+ >
594
+ Documentation URL
595
+ </ecc-utils-design-label>
596
+ <ecc-utils-design-input
597
+ id="documentation-url"
598
+ .value=${this.formData.documentationUrl}
599
+ @ecc-input-changed=${(e) => this.handleInputChange(
600
+ "documentationUrl",
601
+ e.detail.value
602
+ )}
603
+ placeholder="https://docs.example.com"
604
+ class="h-10"
605
+ ></ecc-utils-design-input>
606
+ </div>
607
+ </div>
608
+
609
+ <!-- Creation and Update timestamps -->
610
+ <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
611
+ <div class="grid gap-2">
612
+ <ecc-utils-design-label
613
+ for="created-at"
614
+ class="text-sm font-medium"
615
+ >
616
+ Created At (RFC 3339)
617
+ </ecc-utils-design-label>
618
+ <ecc-utils-design-input
619
+ id="created-at"
620
+ .value=${this.formData.createdAt}
621
+ @ecc-input-changed=${(e) => this.handleInputChange("createdAt", e.detail.value)}
622
+ placeholder="2019-06-04T12:58:19Z (optional)"
623
+ class="h-10"
624
+ ></ecc-utils-design-input>
625
+ </div>
626
+
627
+ <div class="grid gap-2">
628
+ <ecc-utils-design-label
629
+ for="updated-at"
630
+ class="text-sm font-medium"
631
+ >
632
+ Updated At (RFC 3339)
633
+ </ecc-utils-design-label>
634
+ <ecc-utils-design-input
635
+ id="updated-at"
636
+ .value=${this.formData.updatedAt}
637
+ @ecc-input-changed=${(e) => this.handleInputChange("updatedAt", e.detail.value)}
638
+ placeholder="2019-06-04T12:58:19Z (optional)"
639
+ class="h-10"
640
+ ></ecc-utils-design-input>
641
+ </div>
642
+ </div>
643
+ </div>
644
+ </ecc-utils-design-collapsible-content>
645
+ </ecc-utils-design-collapsible>
646
+ </div>
647
+ `;
648
+ }
649
+ render() {
650
+ return html`
651
+ <div class="">
652
+ <form
653
+ @submit=${(e) => {
654
+ e.preventDefault();
655
+ this.handleSubmit();
656
+ }}
657
+ >
658
+ <div class="space-y-4">${this.renderBasicFields()}</div>
659
+
660
+ <div class="flex justify-between items-center mt-4">
661
+ <div></div>
662
+ <div class="space-x-2">
663
+ <ecc-utils-design-button
664
+ type="button"
665
+ variant="outline"
666
+ @click=${this.resetForm}
667
+ >
668
+ Reset
669
+ </ecc-utils-design-button>
670
+ <ecc-utils-design-button
671
+ type="submit"
672
+ @click=${this.handleSubmit}
673
+ .disabled=${this.loading || !this.formData.name || !this.formData.url || !this.formData.organization.name || !this.formData.organization.url || !this.formData.type.artifact || !this.formData.type.version || !this.formData.version}
674
+ >
675
+ ${this.loading ? "Creating..." : "Create Service"}
676
+ </ecc-utils-design-button>
677
+ </div>
678
+ </div>
679
+ </form>
680
+ </div>
681
+ `;
682
+ }
683
+ };
684
+ ECCClientElixirCloudRegistryServiceCreate.styles = [
685
+ ComponentStyles,
686
+ GlobalStyles,
687
+ css`
688
+ :host {
689
+ display: block;
690
+ width: 100%;
691
+ }
692
+ `
693
+ ];
694
+ __decorateClass([
695
+ property({ type: String, reflect: true })
696
+ ], ECCClientElixirCloudRegistryServiceCreate.prototype, "baseUrl", 2);
697
+ __decorateClass([
698
+ property({ attribute: false, reflect: true })
699
+ ], ECCClientElixirCloudRegistryServiceCreate.prototype, "provider", 2);
700
+ __decorateClass([
701
+ state()
702
+ ], ECCClientElixirCloudRegistryServiceCreate.prototype, "serviceTypes", 2);
703
+ __decorateClass([
704
+ state()
705
+ ], ECCClientElixirCloudRegistryServiceCreate.prototype, "loading", 2);
706
+ __decorateClass([
707
+ state()
708
+ ], ECCClientElixirCloudRegistryServiceCreate.prototype, "error", 2);
709
+ __decorateClass([
710
+ state()
711
+ ], ECCClientElixirCloudRegistryServiceCreate.prototype, "success", 2);
712
+ __decorateClass([
713
+ state()
714
+ ], ECCClientElixirCloudRegistryServiceCreate.prototype, "formData", 2);
715
+ var service_create_default = ECCClientElixirCloudRegistryServiceCreate;
716
+
717
+ export { ECCClientElixirCloudRegistryServiceCreate, service_create_default };