@iroco/ui 0.21.0 → 0.50.0

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 (94) hide show
  1. package/Alert.svelte +72 -0
  2. package/Alert.svelte.d.ts +18 -0
  3. package/{lib/iroco.css → Button.svelte} +69 -88
  4. package/Button.svelte.d.ts +43 -0
  5. package/DataTable.svelte +94 -0
  6. package/DataTable.svelte.d.ts +27 -0
  7. package/{src/IconBurger.svelte → IconBurger.svelte} +2 -3
  8. package/IconBurger.svelte.d.ts +17 -0
  9. package/{src/IconClose.svelte → IconClose.svelte} +2 -3
  10. package/IconClose.svelte.d.ts +17 -0
  11. package/{src/IconFloppyDisk.svelte → IconFloppyDisk.svelte} +3 -4
  12. package/IconFloppyDisk.svelte.d.ts +18 -0
  13. package/{src/IconInfo.svelte → IconInfo.svelte} +2 -3
  14. package/IconInfo.svelte.d.ts +17 -0
  15. package/{src/IconIrocoLogo.svelte → IconIrocoLogo.svelte} +2 -3
  16. package/IconIrocoLogo.svelte.d.ts +17 -0
  17. package/IconMastodon.svelte +19 -0
  18. package/IconMastodon.svelte.d.ts +18 -0
  19. package/{src/IconMoreSign.svelte → IconMoreSign.svelte} +2 -3
  20. package/IconMoreSign.svelte.d.ts +17 -0
  21. package/{src/IconTrashCan.svelte → IconTrashCan.svelte} +4 -11
  22. package/IconTrashCan.svelte.d.ts +18 -0
  23. package/IrocoLogo.svelte +49 -0
  24. package/IrocoLogo.svelte.d.ts +19 -0
  25. package/{src/Loader.svelte → Loader.svelte} +1 -2
  26. package/Loader.svelte.d.ts +14 -0
  27. package/NavBar.svelte +669 -0
  28. package/NavBar.svelte.d.ts +21 -0
  29. package/Navigation.svelte +325 -0
  30. package/Navigation.svelte.d.ts +19 -0
  31. package/NumberInput.svelte +117 -0
  32. package/NumberInput.svelte.d.ts +25 -0
  33. package/NumberInputSized.svelte +4 -0
  34. package/NumberInputSized.svelte.d.ts +14 -0
  35. package/README.md +21 -31
  36. package/RadioButton.svelte +93 -0
  37. package/RadioButton.svelte.d.ts +23 -0
  38. package/RadioButtonTest.svelte +10 -0
  39. package/RadioButtonTest.svelte.d.ts +19 -0
  40. package/SlottedComponentWrapper.svelte +7 -0
  41. package/SlottedComponentWrapper.svelte.d.ts +23 -0
  42. package/TextInput.svelte +148 -0
  43. package/TextInput.svelte.d.ts +30 -0
  44. package/{src/TopBar.svelte → TopBar.svelte} +0 -0
  45. package/TopBar.svelte.d.ts +23 -0
  46. package/definition.d.ts +28 -0
  47. package/definition.js +35 -0
  48. package/index.d.ts +18 -0
  49. package/index.js +18 -0
  50. package/package.json +71 -113
  51. package/scss/button.scss +57 -55
  52. package/scss/check.scss +45 -46
  53. package/scss/colors.scss +39 -17
  54. package/scss/constants.scss +1 -1
  55. package/scss/containers.scss +126 -130
  56. package/scss/fields/_checkbox.scss +37 -42
  57. package/scss/fields/_input.scss +160 -169
  58. package/scss/fonts.scss +7 -7
  59. package/scss/forms.scss +53 -55
  60. package/scss/iroco.scss +22 -22
  61. package/scss/layouts.scss +21 -7
  62. package/scss/loader.scss +18 -16
  63. package/scss/style.scss +5 -5
  64. package/lib/button.scss +0 -61
  65. package/lib/check.scss +0 -48
  66. package/lib/colors.scss +0 -23
  67. package/lib/constants.scss +0 -1
  68. package/lib/containers.scss +0 -226
  69. package/lib/fields/_checkbox.scss +0 -44
  70. package/lib/fields/_input.scss +0 -171
  71. package/lib/fields/_style.scss +0 -2
  72. package/lib/fonts.scss +0 -11
  73. package/lib/forms.scss +0 -67
  74. package/lib/index.js +0 -5816
  75. package/lib/index.min.js +0 -330
  76. package/lib/index.mjs +0 -5789
  77. package/lib/iroco.css.map +0 -1
  78. package/lib/iroco.scss +0 -37
  79. package/lib/layouts.scss +0 -7
  80. package/lib/loader.scss +0 -20
  81. package/lib/style.scss +0 -5
  82. package/src/Alert.svelte +0 -34
  83. package/src/Button.svelte +0 -24
  84. package/src/DataTable.svelte +0 -72
  85. package/src/Icon.svelte +0 -29
  86. package/src/IconMastodon.svelte +0 -13
  87. package/src/IrocoLogo.svelte +0 -45
  88. package/src/NavBar.svelte +0 -154
  89. package/src/Navigation.svelte +0 -107
  90. package/src/NumberInput.svelte +0 -23
  91. package/src/RadioButton.svelte +0 -56
  92. package/src/TextInput.svelte +0 -121
  93. package/src/definition.ts +0 -30
  94. package/src/index.ts +0 -21
package/NavBar.svelte ADDED
@@ -0,0 +1,669 @@
1
+ <script>import IconClose from "./IconClose.svelte";
2
+ import { createEventDispatcher } from "svelte";
3
+ import { navigating } from "$app/stores";
4
+ export let navigationItems;
5
+ export let type;
6
+ let active;
7
+ const dispatch = createEventDispatcher();
8
+ const handleClickLink = (menuItem) => {
9
+ if (typeof menuItem.hrefOrCallback === "function") {
10
+ menuItem.hrefOrCallback();
11
+ return false;
12
+ }
13
+ dispatch("click_link");
14
+ };
15
+ function isActive(current, item) {
16
+ if (typeof item.hrefOrCallback === "string") {
17
+ return item.hrefOrCallback === current;
18
+ }
19
+ return false;
20
+ }
21
+ $:
22
+ if ($navigating)
23
+ active = $navigating.to.url.pathname;
24
+ </script>
25
+
26
+ <nav data-testid={type} class="nav__{type}">
27
+ <button on:click class="nav__{type}__close">
28
+ <IconClose width="3em" height="3em" />
29
+ </button>
30
+
31
+ <ul class="nav__{type}__item-container">
32
+ {#each navigationItems as item}
33
+ <li class="nav__{type}__item" class:active={isActive(active, item)}>
34
+ <a
35
+ on:click={() => handleClickLink(item)}
36
+ href={typeof item.hrefOrCallback === 'string' ? item.hrefOrCallback : '#'}
37
+ class:iroco-ui-button={item.button}
38
+ class:iroco-ui-button--small={item.button}
39
+ class:iroco-ui-button--success={item.button}
40
+ >
41
+ {item.name}
42
+ </a>
43
+ </li>
44
+ {/each}
45
+ </ul>
46
+ </nav>
47
+
48
+ <style>.font-color-blue {
49
+ color: #00b9ff;
50
+ }
51
+
52
+ .font-color-darkBlue {
53
+ color: #211d28;
54
+ }
55
+
56
+ .font-color-nightBlue {
57
+ color: #18151e;
58
+ }
59
+
60
+ .font-color-green {
61
+ color: #00d692;
62
+ }
63
+
64
+ .font-color-red {
65
+ color: #ff504d;
66
+ }
67
+
68
+ .font-color-yellow {
69
+ color: #ffe032;
70
+ }
71
+
72
+ .font-color-beige {
73
+ color: #f2ebe3;
74
+ }
75
+
76
+ .font-color-darkBeige {
77
+ color: #a9a29e;
78
+ }
79
+
80
+ .font-color-mediumGrey {
81
+ color: #464452;
82
+ }
83
+
84
+ .font-color-darkGrey {
85
+ color: #33323a;
86
+ }
87
+
88
+ .font-color-lightGrey {
89
+ color: #f5f5f5;
90
+ }
91
+
92
+ .container-wide {
93
+ width: calc(100% - 20px);
94
+ max-width: 2360px;
95
+ margin-left: auto;
96
+ margin-right: auto;
97
+ transition: max-width ease-out 200ms;
98
+ }
99
+
100
+ @media all and (max-width: 2560px) {
101
+ .container-wide {
102
+ max-width: 1620px;
103
+ }
104
+ }
105
+
106
+ @media all and (max-width: 1800px) {
107
+ .container-wide {
108
+ max-width: 1280px;
109
+ }
110
+ }
111
+
112
+ @media all and (max-width: 1440px) {
113
+ .container-wide {
114
+ max-width: 884px;
115
+ }
116
+ }
117
+
118
+ @media all and (max-width: 1024px) {
119
+ .container-wide {
120
+ max-width: 648px;
121
+ }
122
+ }
123
+
124
+ @media all and (max-width: 768px) {
125
+ .container-wide {
126
+ max-width: 496px;
127
+ }
128
+ }
129
+
130
+ @media all and (max-width: 596px) {
131
+ .container-wide {
132
+ max-width: 365px;
133
+ }
134
+ }
135
+
136
+ @media all and (max-width: 425px) {
137
+ .container-wide {
138
+ max-width: calc(100% - 60px);
139
+ }
140
+ }
141
+
142
+ @media all and (max-width: 375px) {
143
+ .container-wide {
144
+ max-width: calc(100% - 40px);
145
+ }
146
+ }
147
+
148
+ @media all and (max-width: 320px) {
149
+ .container-wide {
150
+ max-width: calc(100% - 20px);
151
+ }
152
+ }
153
+
154
+ .container-large {
155
+ width: calc(100% - 20px);
156
+ max-width: 1280px;
157
+ margin-left: auto;
158
+ margin-right: auto;
159
+ transition: max-width ease-out 200ms;
160
+ }
161
+
162
+ @media all and (max-width: 1440px) {
163
+ .container-large {
164
+ max-width: 884px;
165
+ }
166
+ }
167
+
168
+ @media all and (max-width: 1024px) {
169
+ .container-large {
170
+ max-width: 648px;
171
+ }
172
+ }
173
+
174
+ @media all and (max-width: 768px) {
175
+ .container-large {
176
+ max-width: 496px;
177
+ }
178
+ }
179
+
180
+ @media all and (max-width: 596px) {
181
+ .container-large {
182
+ max-width: 365px;
183
+ }
184
+ }
185
+
186
+ @media all and (max-width: 425px) {
187
+ .container-large {
188
+ max-width: calc(100% - 60px);
189
+ }
190
+ }
191
+
192
+ @media all and (max-width: 375px) {
193
+ .container-large {
194
+ max-width: calc(100% - 40px);
195
+ }
196
+ }
197
+
198
+ @media all and (max-width: 320px) {
199
+ .container-large {
200
+ max-width: calc(100% - 20px);
201
+ }
202
+ }
203
+
204
+ .container-medium {
205
+ width: calc(100% - 20px);
206
+ max-width: 884px;
207
+ margin-left: auto;
208
+ margin-right: auto;
209
+ transition: max-width ease-out 200ms;
210
+ }
211
+
212
+ @media all and (max-width: 1024px) {
213
+ .container-medium {
214
+ max-width: 648px;
215
+ }
216
+ }
217
+
218
+ @media all and (max-width: 768px) {
219
+ .container-medium {
220
+ max-width: 496px;
221
+ }
222
+ }
223
+
224
+ @media all and (max-width: 596px) {
225
+ .container-medium {
226
+ max-width: 365px;
227
+ }
228
+ }
229
+
230
+ @media all and (max-width: 425px) {
231
+ .container-medium {
232
+ max-width: calc(100% - 60px);
233
+ }
234
+ }
235
+
236
+ @media all and (max-width: 375px) {
237
+ .container-medium {
238
+ max-width: calc(100% - 40px);
239
+ }
240
+ }
241
+
242
+ @media all and (max-width: 320px) {
243
+ .container-medium {
244
+ max-width: calc(100% - 20px);
245
+ }
246
+ }
247
+
248
+ .container-small {
249
+ width: calc(100% - 20px);
250
+ max-width: 496px;
251
+ margin-left: auto;
252
+ margin-right: auto;
253
+ transition: max-width ease-out 200ms;
254
+ }
255
+
256
+ @media all and (max-width: 425px) {
257
+ .container-small {
258
+ max-width: calc(100% - 60px);
259
+ }
260
+ }
261
+
262
+ @media all and (max-width: 375px) {
263
+ .container-small {
264
+ max-width: calc(100% - 40px);
265
+ }
266
+ }
267
+
268
+ @media all and (max-width: 320px) {
269
+ .container-small {
270
+ max-width: calc(100% - 20px);
271
+ }
272
+ }
273
+
274
+ .font-color-blue {
275
+ color: #00b9ff;
276
+ }
277
+
278
+ .font-color-darkBlue {
279
+ color: #211d28;
280
+ }
281
+
282
+ .font-color-nightBlue {
283
+ color: #18151e;
284
+ }
285
+
286
+ .font-color-green {
287
+ color: #00d692;
288
+ }
289
+
290
+ .font-color-red {
291
+ color: #ff504d;
292
+ }
293
+
294
+ .font-color-yellow {
295
+ color: #ffe032;
296
+ }
297
+
298
+ .font-color-beige {
299
+ color: #f2ebe3;
300
+ }
301
+
302
+ .font-color-darkBeige {
303
+ color: #a9a29e;
304
+ }
305
+
306
+ .font-color-mediumGrey {
307
+ color: #464452;
308
+ }
309
+
310
+ .font-color-darkGrey {
311
+ color: #33323a;
312
+ }
313
+
314
+ .font-color-lightGrey {
315
+ color: #f5f5f5;
316
+ }
317
+
318
+ .container-wide {
319
+ width: calc(100% - 20px);
320
+ max-width: 2360px;
321
+ margin-left: auto;
322
+ margin-right: auto;
323
+ transition: max-width ease-out 200ms;
324
+ }
325
+
326
+ @media all and (max-width: 2560px) {
327
+ .container-wide {
328
+ max-width: 1620px;
329
+ }
330
+ }
331
+
332
+ @media all and (max-width: 1800px) {
333
+ .container-wide {
334
+ max-width: 1280px;
335
+ }
336
+ }
337
+
338
+ @media all and (max-width: 1440px) {
339
+ .container-wide {
340
+ max-width: 884px;
341
+ }
342
+ }
343
+
344
+ @media all and (max-width: 1024px) {
345
+ .container-wide {
346
+ max-width: 648px;
347
+ }
348
+ }
349
+
350
+ @media all and (max-width: 768px) {
351
+ .container-wide {
352
+ max-width: 496px;
353
+ }
354
+ }
355
+
356
+ @media all and (max-width: 596px) {
357
+ .container-wide {
358
+ max-width: 365px;
359
+ }
360
+ }
361
+
362
+ @media all and (max-width: 425px) {
363
+ .container-wide {
364
+ max-width: calc(100% - 60px);
365
+ }
366
+ }
367
+
368
+ @media all and (max-width: 375px) {
369
+ .container-wide {
370
+ max-width: calc(100% - 40px);
371
+ }
372
+ }
373
+
374
+ @media all and (max-width: 320px) {
375
+ .container-wide {
376
+ max-width: calc(100% - 20px);
377
+ }
378
+ }
379
+
380
+ .container-large {
381
+ width: calc(100% - 20px);
382
+ max-width: 1280px;
383
+ margin-left: auto;
384
+ margin-right: auto;
385
+ transition: max-width ease-out 200ms;
386
+ }
387
+
388
+ @media all and (max-width: 1440px) {
389
+ .container-large {
390
+ max-width: 884px;
391
+ }
392
+ }
393
+
394
+ @media all and (max-width: 1024px) {
395
+ .container-large {
396
+ max-width: 648px;
397
+ }
398
+ }
399
+
400
+ @media all and (max-width: 768px) {
401
+ .container-large {
402
+ max-width: 496px;
403
+ }
404
+ }
405
+
406
+ @media all and (max-width: 596px) {
407
+ .container-large {
408
+ max-width: 365px;
409
+ }
410
+ }
411
+
412
+ @media all and (max-width: 425px) {
413
+ .container-large {
414
+ max-width: calc(100% - 60px);
415
+ }
416
+ }
417
+
418
+ @media all and (max-width: 375px) {
419
+ .container-large {
420
+ max-width: calc(100% - 40px);
421
+ }
422
+ }
423
+
424
+ @media all and (max-width: 320px) {
425
+ .container-large {
426
+ max-width: calc(100% - 20px);
427
+ }
428
+ }
429
+
430
+ .container-medium {
431
+ width: calc(100% - 20px);
432
+ max-width: 884px;
433
+ margin-left: auto;
434
+ margin-right: auto;
435
+ transition: max-width ease-out 200ms;
436
+ }
437
+
438
+ @media all and (max-width: 1024px) {
439
+ .container-medium {
440
+ max-width: 648px;
441
+ }
442
+ }
443
+
444
+ @media all and (max-width: 768px) {
445
+ .container-medium {
446
+ max-width: 496px;
447
+ }
448
+ }
449
+
450
+ @media all and (max-width: 596px) {
451
+ .container-medium {
452
+ max-width: 365px;
453
+ }
454
+ }
455
+
456
+ @media all and (max-width: 425px) {
457
+ .container-medium {
458
+ max-width: calc(100% - 60px);
459
+ }
460
+ }
461
+
462
+ @media all and (max-width: 375px) {
463
+ .container-medium {
464
+ max-width: calc(100% - 40px);
465
+ }
466
+ }
467
+
468
+ @media all and (max-width: 320px) {
469
+ .container-medium {
470
+ max-width: calc(100% - 20px);
471
+ }
472
+ }
473
+
474
+ .container-small {
475
+ width: calc(100% - 20px);
476
+ max-width: 496px;
477
+ margin-left: auto;
478
+ margin-right: auto;
479
+ transition: max-width ease-out 200ms;
480
+ }
481
+
482
+ @media all and (max-width: 425px) {
483
+ .container-small {
484
+ max-width: calc(100% - 60px);
485
+ }
486
+ }
487
+
488
+ @media all and (max-width: 375px) {
489
+ .container-small {
490
+ max-width: calc(100% - 40px);
491
+ }
492
+ }
493
+
494
+ @media all and (max-width: 320px) {
495
+ .container-small {
496
+ max-width: calc(100% - 20px);
497
+ }
498
+ }
499
+
500
+ .iroco-ui-button {
501
+ cursor: pointer;
502
+ -webkit-touch-callout: none;
503
+ -webkit-user-select: none;
504
+ -khtml-user-select: none;
505
+ -moz-user-select: none;
506
+ -ms-user-select: none;
507
+ user-select: none;
508
+ border: none;
509
+ flex-shrink: 0;
510
+ margin: 1em 0em;
511
+ position: relative;
512
+ text-transform: uppercase;
513
+ border-radius: 0.3em;
514
+ }
515
+
516
+ .iroco-ui-button--basic {
517
+ background: #f2ebe3;
518
+ border: 1px solid #18151e;
519
+ }
520
+
521
+ .iroco-ui-button--dark {
522
+ background: #18151e;
523
+ color: #f2ebe3;
524
+ }
525
+
526
+ .iroco-ui-button--success {
527
+ background: #00d692;
528
+ color: #18151e;
529
+ }
530
+
531
+ .iroco-ui-button--danger {
532
+ background: #ff504d;
533
+ }
534
+
535
+ .iroco-ui-button--regular {
536
+ padding: 1em 2em;
537
+ }
538
+
539
+ .iroco-ui-button--small {
540
+ padding: 0.5em 1em;
541
+ }
542
+
543
+ .iroco-ui-button--basic:hover, .iroco-ui-button--success:hover, .iroco-ui-button--danger:hover {
544
+ box-shadow: inset 0 0 0 10em rgba(0, 0, 0, 0.2);
545
+ }
546
+
547
+ .iroco-ui-button--dark:hover {
548
+ box-shadow: inset 0 0 0 10em rgba(255, 255, 255, 0.2);
549
+ }
550
+
551
+ .iroco-ui-button:active {
552
+ box-shadow: none;
553
+ }
554
+
555
+ .iroco-ui-button.disabled {
556
+ background-color: #f5f5f5;
557
+ cursor: default;
558
+ }
559
+
560
+ .iroco-ui-button.disabled:hover {
561
+ box-shadow: none;
562
+ }
563
+
564
+ .nav__sidebar__item, .nav__topbar__item {
565
+ text-decoration: none;
566
+ display: block;
567
+ font-size: 1em;
568
+ }
569
+
570
+ .nav__sidebar__close, .nav__topbar__close {
571
+ display: none;
572
+ }
573
+
574
+ .nav__sidebar {
575
+ height: 100%;
576
+ width: 300px;
577
+ position: absolute;
578
+ top: 4.45em;
579
+ left: 0;
580
+ overflow-x: hidden;
581
+ }
582
+
583
+ .nav__sidebar__item-container {
584
+ margin: 0;
585
+ padding: 0;
586
+ width: 100%;
587
+ height: 100%;
588
+ }
589
+
590
+ .nav__sidebar__item {
591
+ padding: 2em;
592
+ border-top: 1px solid #464452;
593
+ }
594
+
595
+ .nav__sidebar__item:first-child {
596
+ border-top: none;
597
+ }
598
+
599
+ .nav__sidebar .active {
600
+ border-top: 1px solid #00d692;
601
+ border-bottom: 1px solid #00d692;
602
+ }
603
+
604
+ .nav__topbar {
605
+ flex-grow: 1;
606
+ display: flex;
607
+ justify-content: flex-end;
608
+ }
609
+
610
+ .nav__topbar ul,
611
+ .nav__topbar li {
612
+ display: inline;
613
+ }
614
+
615
+ .nav__topbar ul {
616
+ display: flex;
617
+ flex-grow: 1;
618
+ justify-content: space-around;
619
+ }
620
+
621
+ .nav__topbar .active {
622
+ border-bottom: 1px solid #00d692;
623
+ }
624
+
625
+ @media all and (max-width: 768px) {
626
+ .nav__sidebar, .nav__topbar {
627
+ position: fixed;
628
+ background-color: #211d28;
629
+ top: 0;
630
+ right: 0;
631
+ width: 100%;
632
+ padding: 0;
633
+ padding-top: 2em;
634
+ margin: 0;
635
+ border-right: none;
636
+ }
637
+ .nav__sidebar__item-container, .nav__topbar__item-container {
638
+ padding: 0em;
639
+ margin-top: 2rem;
640
+ }
641
+ .nav__sidebar ul,
642
+ .nav__sidebar li, .nav__topbar ul,
643
+ .nav__topbar li {
644
+ display: block;
645
+ }
646
+ .nav__sidebar__close, .nav__topbar__close {
647
+ display: block;
648
+ position: absolute;
649
+ right: 0;
650
+ top: 0;
651
+ background-color: transparent;
652
+ border: none;
653
+ color: #a9a29e;
654
+ }
655
+ .nav__sidebar {
656
+ top: 0;
657
+ left: 0;
658
+ }
659
+ .nav__sidebar__item:first-child {
660
+ border-top: 1px solid #464452;
661
+ }
662
+ .nav__topbar {
663
+ height: 100%;
664
+ }
665
+ .nav__topbar__item {
666
+ padding: 2em;
667
+ border-top: 1px solid #464452;
668
+ }
669
+ }</style>
@@ -0,0 +1,21 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ import type { NavigationItem } from './definition';
3
+ declare const __propDef: {
4
+ props: {
5
+ navigationItems: Array<NavigationItem>;
6
+ type: 'sidebar' | 'topbar';
7
+ };
8
+ events: {
9
+ click: MouseEvent;
10
+ click_link: CustomEvent<any>;
11
+ } & {
12
+ [evt: string]: CustomEvent<any>;
13
+ };
14
+ slots: {};
15
+ };
16
+ export type NavBarProps = typeof __propDef.props;
17
+ export type NavBarEvents = typeof __propDef.events;
18
+ export type NavBarSlots = typeof __propDef.slots;
19
+ export default class NavBar extends SvelteComponentTyped<NavBarProps, NavBarEvents, NavBarSlots> {
20
+ }
21
+ export {};