-
Notifications
You must be signed in to change notification settings - Fork 3
/
elemental.js
2616 lines (2237 loc) · 103 KB
/
elemental.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Elemental = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
'use strict';
exports.Alert = require('./components/Alert');
exports.BlankState = require('./components/BlankState');
exports.Button = require('./components/Button');
exports.ButtonGroup = require('./components/ButtonGroup');
exports.Checkbox = require('./components/Checkbox');
exports.Card = require('./components/Card');
exports.Col = require('./components/Col');
exports.Container = require('./components/Container');
exports.Dropdown = require('./components/Dropdown');
exports.EmailInputGroup = require('./components/EmailInputGroup');
exports.FileDragAndDrop = require('./components/FileDragAndDrop');
exports.FileUpload = require('./components/FileUpload');
exports.Form = require('./components/Form');
exports.FormField = require('./components/FormField');
exports.FormIcon = require('./components/FormIcon');
exports.FormIconField = require('./components/FormIconField');
exports.FormInput = require('./components/FormInput');
exports.FormLabel = require('./components/FormLabel');
exports.FormNote = require('./components/FormNote');
exports.FormRow = require('./components/FormRow');
exports.FormSelect = require('./components/FormSelect');
exports.Glyph = require('./components/Glyph');
exports.InputGroup = require('./components/InputGroup');
exports.InputGroupSection = require('./components/InputGroupSection');
exports.Modal = require('./components/Modal');
exports.ModalBody = require('./components/ModalBody');
exports.ModalFooter = require('./components/ModalFooter');
exports.ModalHeader = require('./components/ModalHeader');
exports.Pagination = require('./components/Pagination');
exports.PasswordInputGroup = require('./components/PasswordInputGroup');
exports.Pill = require('./components/Pill');
exports.Radio = require('./components/Radio');
exports.ResponsiveText = require('./components/ResponsiveText');
exports.Row = require('./components/Row');
exports.RadioGroup = require('./components/RadioGroup');
exports.SegmentedControl = require('./components/SegmentedControl');
exports.Spinner = require('./components/Spinner');
exports.Table = require('./components/Table');
},{"./components/Alert":3,"./components/BlankState":4,"./components/Button":5,"./components/ButtonGroup":6,"./components/Card":7,"./components/Checkbox":8,"./components/Col":9,"./components/Container":10,"./components/Dropdown":11,"./components/EmailInputGroup":12,"./components/FileDragAndDrop":13,"./components/FileUpload":14,"./components/Form":15,"./components/FormField":16,"./components/FormIcon":17,"./components/FormIconField":18,"./components/FormInput":19,"./components/FormLabel":20,"./components/FormNote":21,"./components/FormRow":22,"./components/FormSelect":23,"./components/Glyph":24,"./components/InputGroup":25,"./components/InputGroupSection":26,"./components/Modal":27,"./components/ModalBody":28,"./components/ModalFooter":29,"./components/ModalHeader":30,"./components/Pagination":31,"./components/PasswordInputGroup":32,"./components/Pill":33,"./components/Radio":34,"./components/RadioGroup":35,"./components/ResponsiveText":36,"./components/Row":37,"./components/SegmentedControl":38,"./components/Spinner":39,"./components/Table":40}],2:[function(require,module,exports){
'use strict';
var list = [{ label: 'Alert', value: 'alert', className: 'octicon octicon-alert' }, { label: 'Arrow Down', value: 'arrow-down', className: 'octicon octicon-arrow-down' }, { label: 'Arrow Left', value: 'arrow-left', className: 'octicon octicon-arrow-left' }, { label: 'Arrow Right', value: 'arrow-right', className: 'octicon octicon-arrow-right' }, { label: 'Arrow Small-down', value: 'arrow-small-down', className: 'octicon octicon-arrow-small-down' }, { label: 'Arrow Small-left', value: 'arrow-small-left', className: 'octicon octicon-arrow-small-left' }, { label: 'Arrow Small-right', value: 'arrow-small-right', className: 'octicon octicon-arrow-small-right' }, { label: 'Arrow Small-up', value: 'arrow-small-up', className: 'octicon octicon-arrow-small-up' }, { label: 'Arrow Up', value: 'arrow-up', className: 'octicon octicon-arrow-up' }, { label: 'Microscope', value: 'microscope', className: 'octicon octicon-microscope' }, { label: 'Beaker', value: 'beaker', className: 'octicon octicon-beaker' }, { label: 'Bell', value: 'bell', className: 'octicon octicon-bell' }, { label: 'Book', value: 'book', className: 'octicon octicon-book' }, { label: 'Bookmark', value: 'bookmark', className: 'octicon octicon-bookmark' }, { label: 'Briefcase', value: 'briefcase', className: 'octicon octicon-briefcase' }, { label: 'Broadcast', value: 'broadcast', className: 'octicon octicon-broadcast' }, { label: 'Browser', value: 'browser', className: 'octicon octicon-browser' }, { label: 'Bug', value: 'bug', className: 'octicon octicon-bug' }, { label: 'Calendar', value: 'calendar', className: 'octicon octicon-calendar' }, { label: 'Check', value: 'check', className: 'octicon octicon-check' }, { label: 'Checklist', value: 'checklist', className: 'octicon octicon-checklist' }, { label: 'Chevron Down', value: 'chevron-down', className: 'octicon octicon-chevron-down' }, { label: 'Chevron Left', value: 'chevron-left', className: 'octicon octicon-chevron-left' }, { label: 'Chevron Right', value: 'chevron-right', className: 'octicon octicon-chevron-right' }, { label: 'Chevron Up', value: 'chevron-up', className: 'octicon octicon-chevron-up' }, { label: 'Circle Slash', value: 'circle-slash', className: 'octicon octicon-circle-slash' }, { label: 'Circuit Board', value: 'circuit-board', className: 'octicon octicon-circuit-board' }, { label: 'Clippy', value: 'clippy', className: 'octicon octicon-clippy' }, { label: 'Clock', value: 'clock', className: 'octicon octicon-clock' }, { label: 'Cloud Download', value: 'cloud-download', className: 'octicon octicon-cloud-download' }, { label: 'Cloud Upload', value: 'cloud-upload', className: 'octicon octicon-cloud-upload' }, { label: 'Code', value: 'code', className: 'octicon octicon-code' }, { label: 'Color Mode', value: 'color-mode', className: 'octicon octicon-color-mode' }, { label: 'Comment Add', value: 'comment-add', className: 'octicon octicon-comment-add' }, { label: 'Comment', value: 'comment', className: 'octicon octicon-comment' }, { label: 'Comment Discussion', value: 'comment-discussion', className: 'octicon octicon-comment-discussion' }, { label: 'Credit Card', value: 'credit-card', className: 'octicon octicon-credit-card' }, { label: 'Dash', value: 'dash', className: 'octicon octicon-dash' }, { label: 'Dashboard', value: 'dashboard', className: 'octicon octicon-dashboard' }, { label: 'Database', value: 'database', className: 'octicon octicon-database' }, { label: 'Clone', value: 'clone', className: 'octicon octicon-clone' }, { label: 'Desktop Download', value: 'desktop-download', className: 'octicon octicon-desktop-download' }, { label: 'Device Camera', value: 'device-camera', className: 'octicon octicon-device-camera' }, { label: 'Device Camera-video', value: 'device-camera-video', className: 'octicon octicon-device-camera-video' }, { label: 'Device Desktop', value: 'device-desktop', className: 'octicon octicon-device-desktop' }, { label: 'Device Mobile', value: 'device-mobile', className: 'octicon octicon-device-mobile' }, { label: 'Diff', value: 'diff', className: 'octicon octicon-diff' }, { label: 'Diff Added', value: 'diff-added', className: 'octicon octicon-diff-added' }, { label: 'Diff Ignored', value: 'diff-ignored', className: 'octicon octicon-diff-ignored' }, { label: 'Diff Modified', value: 'diff-modified', className: 'octicon octicon-diff-modified' }, { label: 'Diff Removed', value: 'diff-removed', className: 'octicon octicon-diff-removed' }, { label: 'Diff Renamed', value: 'diff-renamed', className: 'octicon octicon-diff-renamed' }, { label: 'Ellipsis', value: 'ellipsis', className: 'octicon octicon-ellipsis' }, { label: 'Eye Unwatch', value: 'eye-unwatch', className: 'octicon octicon-eye-unwatch' }, { label: 'Eye Watch', value: 'eye-watch', className: 'octicon octicon-eye-watch' }, { label: 'Eye', value: 'eye', className: 'octicon octicon-eye' }, { label: 'File Binary', value: 'file-binary', className: 'octicon octicon-file-binary' }, { label: 'File Code', value: 'file-code', className: 'octicon octicon-file-code' }, { label: 'File Directory', value: 'file-directory', className: 'octicon octicon-file-directory' }, { label: 'File Media', value: 'file-media', className: 'octicon octicon-file-media' }, { label: 'File Pdf', value: 'file-pdf', className: 'octicon octicon-file-pdf' }, { label: 'File Submodule', value: 'file-submodule', className: 'octicon octicon-file-submodule' }, { label: 'File Symlink-directory', value: 'file-symlink-directory', className: 'octicon octicon-file-symlink-directory' }, { label: 'File Symlink-file', value: 'file-symlink-file', className: 'octicon octicon-file-symlink-file' }, { label: 'File Text', value: 'file-text', className: 'octicon octicon-file-text' }, { label: 'File Zip', value: 'file-zip', className: 'octicon octicon-file-zip' }, { label: 'Flame', value: 'flame', className: 'octicon octicon-flame' }, { label: 'Fold', value: 'fold', className: 'octicon octicon-fold' }, { label: 'Gear', value: 'gear', className: 'octicon octicon-gear' }, { label: 'Gift', value: 'gift', className: 'octicon octicon-gift' }, { label: 'Gist', value: 'gist', className: 'octicon octicon-gist' }, { label: 'Gist Secret', value: 'gist-secret', className: 'octicon octicon-gist-secret' }, { label: 'Git Branch-create', value: 'git-branch-create', className: 'octicon octicon-git-branch-create' }, { label: 'Git Branch-delete', value: 'git-branch-delete', className: 'octicon octicon-git-branch-delete' }, { label: 'Git Branch', value: 'git-branch', className: 'octicon octicon-git-branch' }, { label: 'Git Commit', value: 'git-commit', className: 'octicon octicon-git-commit' }, { label: 'Git Compare', value: 'git-compare', className: 'octicon octicon-git-compare' }, { label: 'Git Merge', value: 'git-merge', className: 'octicon octicon-git-merge' }, { label: 'Git Pull-request-abandoned', value: 'git-pull-request-abandoned', className: 'octicon octicon-git-pull-request-abandoned' }, { label: 'Git Pull-request', value: 'git-pull-request', className: 'octicon octicon-git-pull-request' }, { label: 'Globe', value: 'globe', className: 'octicon octicon-globe' }, { label: 'Graph', value: 'graph', className: 'octicon octicon-graph' }, { label: 'Heart', value: 'heart', className: 'octicon octicon-heart' }, { label: 'History', value: 'history', className: 'octicon octicon-history' }, { label: 'Home', value: 'home', className: 'octicon octicon-home' }, { label: 'Horizontal Rule', value: 'horizontal-rule', className: 'octicon octicon-horizontal-rule' }, { label: 'Hubot', value: 'hubot', className: 'octicon octicon-hubot' }, { label: 'Inbox', value: 'inbox', className: 'octicon octicon-inbox' }, { label: 'Info', value: 'info', className: 'octicon octicon-info' }, { label: 'Issue Closed', value: 'issue-closed', className: 'octicon octicon-issue-closed' }, { label: 'Issue Opened', value: 'issue-opened', className: 'octicon octicon-issue-opened' }, { label: 'Issue Reopened', value: 'issue-reopened', className: 'octicon octicon-issue-reopened' }, { label: 'Jersey', value: 'jersey', className: 'octicon octicon-jersey' }, { label: 'Key', value: 'key', className: 'octicon octicon-key' }, { label: 'Keyboard', value: 'keyboard', className: 'octicon octicon-keyboard' }, { label: 'Law', value: 'law', className: 'octicon octicon-law' }, { label: 'Light Bulb', value: 'light-bulb', className: 'octicon octicon-light-bulb' }, { label: 'Link', value: 'link', className: 'octicon octicon-link' }, { label: 'Link External', value: 'link-external', className: 'octicon octicon-link-external' }, { label: 'List Ordered', value: 'list-ordered', className: 'octicon octicon-list-ordered' }, { label: 'List Unordered', value: 'list-unordered', className: 'octicon octicon-list-unordered' }, { label: 'Location', value: 'location', className: 'octicon octicon-location' }, { label: 'Gist Private', value: 'gist-private', className: 'octicon octicon-gist-private' }, { label: 'Mirror Private', value: 'mirror-private', className: 'octicon octicon-mirror-private' }, { label: 'Git Fork-private', value: 'git-fork-private', className: 'octicon octicon-git-fork-private' }, { label: 'Lock', value: 'lock', className: 'octicon octicon-lock' }, { label: 'Logo Github', value: 'logo-github', className: 'octicon octicon-logo-github' }, { label: 'Mail', value: 'mail', className: 'octicon octicon-mail' }, { label: 'Mail Read', value: 'mail-read', className: 'octicon octicon-mail-read' }, { label: 'Mail Reply', value: 'mail-reply', className: 'octicon octicon-mail-reply' }, { label: 'Mark Github', value: 'mark-github', className: 'octicon octicon-mark-github' }, { label: 'Markdown', value: 'markdown', className: 'octicon octicon-markdown' }, { label: 'Megaphone', value: 'megaphone', className: 'octicon octicon-megaphone' }, { label: 'Mention', value: 'mention', className: 'octicon octicon-mention' }, { label: 'Milestone', value: 'milestone', className: 'octicon octicon-milestone' }, { label: 'Mirror Public', value: 'mirror-public', className: 'octicon octicon-mirror-public' }, { label: 'Mirror', value: 'mirror', className: 'octicon octicon-mirror' }, { label: 'Mortar Board', value: 'mortar-board', className: 'octicon octicon-mortar-board' }, { label: 'Mute', value: 'mute', className: 'octicon octicon-mute' }, { label: 'No Newline', value: 'no-newline', className: 'octicon octicon-no-newline' }, { label: 'Octoface', value: 'octoface', className: 'octicon octicon-octoface' }, { label: 'Organization', value: 'organization', className: 'octicon octicon-organization' }, { label: 'Package', value: 'package', className: 'octicon octicon-package' }, { label: 'Paintcan', value: 'paintcan', className: 'octicon octicon-paintcan' }, { label: 'Pencil', value: 'pencil', className: 'octicon octicon-pencil' }, { label: 'Person Add', value: 'person-add', className: 'octicon octicon-person-add' }, { label: 'Person Follow', value: 'person-follow', className: 'octicon octicon-person-follow' }, { label: 'Person', value: 'person', className: 'octicon octicon-person' }, { label: 'Pin', value: 'pin', className: 'octicon octicon-pin' }, { label: 'Plug', value: 'plug', className: 'octicon octicon-plug' }, { label: 'Repo Create', value: 'repo-create', className: 'octicon octicon-repo-create' }, { label: 'Gist New', value: 'gist-new', className: 'octicon octicon-gist-new' }, { label: 'File Directory-create', value: 'file-directory-create', className: 'octicon octicon-file-directory-create' }, { label: 'File Add', value: 'file-add', className: 'octicon octicon-file-add' }, { label: 'Plus', value: 'plus', className: 'octicon octicon-plus' }, { label: 'Primitive Dot', value: 'primitive-dot', className: 'octicon octicon-primitive-dot' }, { label: 'Primitive Square', value: 'primitive-square', className: 'octicon octicon-primitive-square' }, { label: 'Pulse', value: 'pulse', className: 'octicon octicon-pulse' }, { label: 'Question', value: 'question', className: 'octicon octicon-question' }, { label: 'Quote', value: 'quote', className: 'octicon octicon-quote' }, { label: 'Radio Tower', value: 'radio-tower', className: 'octicon octicon-radio-tower' }, { label: 'Repo Delete', value: 'repo-delete', className: 'octicon octicon-repo-delete' }, { label: 'Repo', value: 'repo', className: 'octicon octicon-repo' }, { label: 'Repo Clone', value: 'repo-clone', className: 'octicon octicon-repo-clone' }, { label: 'Repo Force-push', value: 'repo-force-push', className: 'octicon octicon-repo-force-push' }, { label: 'Gist Fork', value: 'gist-fork', className: 'octicon octicon-gist-fork' }, { label: 'Repo Forked', value: 'repo-forked', className: 'octicon octicon-repo-forked' }, { label: 'Repo Pull', value: 'repo-pull', className: 'octicon octicon-repo-pull' }, { label: 'Repo Push', value: 'repo-push', className: 'octicon octicon-repo-push' }, { label: 'Rocket', value: 'rocket', className: 'octicon octicon-rocket' }, { label: 'Rss', value: 'rss', className: 'octicon octicon-rss' }, { label: 'Ruby', value: 'ruby', className: 'octicon octicon-ruby' }, { label: 'Screen Full', value: 'screen-full', className: 'octicon octicon-screen-full' }, { label: 'Screen Normal', value: 'screen-normal', className: 'octicon octicon-screen-normal' }, { label: 'Search Save', value: 'search-save', className: 'octicon octicon-search-save' }, { label: 'Search', value: 'search', className: 'octicon octicon-search' }, { label: 'Server', value: 'server', className: 'octicon octicon-server' }, { label: 'Settings', value: 'settings', className: 'octicon octicon-settings' }, { label: 'Shield', value: 'shield', className: 'octicon octicon-shield' }, { label: 'Log In', value: 'log-in', className: 'octicon octicon-log-in' }, { label: 'Sign In', value: 'sign-in', className: 'octicon octicon-sign-in' }, { label: 'Log Out', value: 'log-out', className: 'octicon octicon-log-out' }, { label: 'Sign Out', value: 'sign-out', className: 'octicon octicon-sign-out' }, { label: 'Squirrel', value: 'squirrel', className: 'octicon octicon-squirrel' }, { label: 'Star Add', value: 'star-add', className: 'octicon octicon-star-add' }, { label: 'Star Delete', value: 'star-delete', className: 'octicon octicon-star-delete' }, { label: 'Star', value: 'star', className: 'octicon octicon-star' }, { label: 'Stop', value: 'stop', className: 'octicon octicon-stop' }, { label: 'Repo Sync', value: 'repo-sync', className: 'octicon octicon-repo-sync' }, { label: 'Sync', value: 'sync', className: 'octicon octicon-sync' }, { label: 'Tag Remove', value: 'tag-remove', className: 'octicon octicon-tag-remove' }, { label: 'Tag Add', value: 'tag-add', className: 'octicon octicon-tag-add' }, { label: 'Tag', value: 'tag', className: 'octicon octicon-tag' }, { label: 'Telescope', value: 'telescope', className: 'octicon octicon-telescope' }, { label: 'Terminal', value: 'terminal', className: 'octicon octicon-terminal' }, { label: 'Three Bars', value: 'three-bars', className: 'octicon octicon-three-bars' }, { label: 'Thumbsdown', value: 'thumbsdown', className: 'octicon octicon-thumbsdown' }, { label: 'Thumbsup', value: 'thumbsup', className: 'octicon octicon-thumbsup' }, { label: 'Tools', value: 'tools', className: 'octicon octicon-tools' }, { label: 'Trashcan', value: 'trashcan', className: 'octicon octicon-trashcan' }, { label: 'Triangle Down', value: 'triangle-down', className: 'octicon octicon-triangle-down' }, { label: 'Triangle Left', value: 'triangle-left', className: 'octicon octicon-triangle-left' }, { label: 'Triangle Right', value: 'triangle-right', className: 'octicon octicon-triangle-right' }, { label: 'Triangle Up', value: 'triangle-up', className: 'octicon octicon-triangle-up' }, { label: 'Unfold', value: 'unfold', className: 'octicon octicon-unfold' }, { label: 'Unmute', value: 'unmute', className: 'octicon octicon-unmute' }, { label: 'Versions', value: 'versions', className: 'octicon octicon-versions' }, { label: 'Watch', value: 'watch', className: 'octicon octicon-watch' }, { label: 'Remove Close', value: 'remove-close', className: 'octicon octicon-remove-close' }, { label: 'X', value: 'x', className: 'octicon octicon-x' }, { label: 'Zap', value: 'zap', className: 'octicon octicon-zap' }];
var map = {};
list.forEach(function (icon) {
map[icon.value] = icon;
});
function pluck(arr, key) {
return arr.map(function (obj) {
return obj[key];
});
}
module.exports = {
list: list,
keys: pluck(list, 'value'),
map: map
};
},{}],3:[function(require,module,exports){
(function (global){
'use strict';
var React = (typeof window !== "undefined" ? window['React'] : typeof global !== "undefined" ? global['React'] : null);
var classNames = require('classnames');
var ALERT_TYPES = ['danger', 'error', // alias for danger
'info', 'primary', 'success', 'warning'];
module.exports = React.createClass({
displayName: 'ElementalAlert',
propTypes: {
children: React.PropTypes.node.isRequired,
className: React.PropTypes.string,
type: React.PropTypes.oneOf(ALERT_TYPES).isRequired
},
render: function render() {
var componentClass = classNames('Alert', 'Alert--' + this.props.type, this.props.className);
return React.createElement(
'div',
{ className: componentClass },
this.props.children
);
}
});
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"classnames":undefined}],4:[function(require,module,exports){
(function (global){
'use strict';
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var React = (typeof window !== "undefined" ? window['React'] : typeof global !== "undefined" ? global['React'] : null);
module.exports = React.createClass({
displayName: 'BlankState',
propTypes: {
children: React.PropTypes.node.isRequired
},
render: function render() {
return React.createElement('div', _extends({ className: 'BlankState' }, this.props));
}
});
module.exports.Heading = React.createClass({
displayName: 'BlankStateHeading',
propTypes: {
children: React.PropTypes.node.isRequired
},
render: function render() {
return React.createElement('h2', _extends({ className: 'BlankState__heading' }, this.props));
}
});
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{}],5:[function(require,module,exports){
(function (global){
'use strict';
var React = (typeof window !== "undefined" ? window['React'] : typeof global !== "undefined" ? global['React'] : null);
var classNames = require('classnames');
var blacklist = require('blacklist');
var BUTTON_SIZES = ['lg', 'sm', 'xs'];
var BUTTON_TYPES = ['default', 'default-primary', 'default-success', 'default-warning', 'default-danger', 'hollow-primary', 'hollow-success', 'hollow-warning', 'hollow-danger', 'primary', 'success', 'warning', 'danger', 'link', 'link-text', 'link-cancel', 'link-delete'];
module.exports = React.createClass({
displayName: 'Button',
propTypes: {
block: React.PropTypes.bool,
className: React.PropTypes.string,
href: React.PropTypes.string,
component: React.PropTypes.node,
isActive: React.PropTypes.bool,
size: React.PropTypes.oneOf(BUTTON_SIZES),
submit: React.PropTypes.bool,
type: React.PropTypes.oneOf(BUTTON_TYPES)
},
getDefaultProps: function getDefaultProps() {
return {
type: 'default'
};
},
render: function render() {
// classes
var componentClass = classNames('Button', 'Button--' + this.props.type, this.props.size ? 'Button--' + this.props.size : null, {
'Button--block': this.props.block,
'is-active': this.props.isActive
}, this.props.className);
// props
var props = blacklist(this.props, 'type', 'size', 'component', 'className');
props.className = componentClass;
if (this.props.component) {
return React.cloneElement(this.props.component, props);
}
var tag = 'button';
props.type = this.props.submit ? 'submit' : 'button';
if (props.href) {
tag = 'a';
delete props.type;
}
return React.createElement(tag, props, this.props.children);
}
});
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"blacklist":undefined,"classnames":undefined}],6:[function(require,module,exports){
(function (global){
'use strict';
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var classnames = require('classnames');
var React = (typeof window !== "undefined" ? window['React'] : typeof global !== "undefined" ? global['React'] : null);
module.exports = React.createClass({
displayName: 'ButtonGroup',
propTypes: {
children: React.PropTypes.node.isRequired,
className: React.PropTypes.string
},
render: function render() {
var className = classnames('ButtonGroup', this.props.className);
return React.createElement('div', _extends({}, this.props, { className: className }));
}
});
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"classnames":undefined}],7:[function(require,module,exports){
(function (global){
'use strict';
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _constants = require('../constants');
var _constants2 = _interopRequireDefault(_constants);
var React = (typeof window !== "undefined" ? window['React'] : typeof global !== "undefined" ? global['React'] : null);
module.exports = React.createClass({
displayName: 'Card',
propTypes: {
children: React.PropTypes.node.isRequired,
style: React.PropTypes.object
},
render: function render() {
var style = {
backgroundColor: 'white',
borderRadius: _constants2['default'].borderRadius.sm,
boxShadow: '0 2px 3px rgba(0, 0, 0, 0.075), 0 0 0 1px rgba(0,0,0,0.1)',
marginBottom: _constants2['default'].spacing.md,
padding: _constants2['default'].spacing.md
};
return React.createElement('div', _extends({}, this.props, { style: _extends(style, this.props.style) }));
}
});
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"../constants":41}],8:[function(require,module,exports){
(function (global){
'use strict';
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var blacklist = require('blacklist');
var classNames = require('classnames');
var React = (typeof window !== "undefined" ? window['React'] : typeof global !== "undefined" ? global['React'] : null);
var Checkbox = React.createClass({
displayName: 'Checkbox',
propTypes: {
className: React.PropTypes.string,
disabled: React.PropTypes.bool,
focusOnMount: React.PropTypes.bool,
indeterminate: React.PropTypes.bool,
inline: React.PropTypes.bool,
label: React.PropTypes.string,
style: React.PropTypes.object,
title: React.PropTypes.string
},
componentDidMount: function componentDidMount() {
if (this.props.focusOnMount) {
this.refs.target.focus();
}
this.setIndeterminate(this.props.indeterminate);
},
componentWillReceiveProps: function componentWillReceiveProps(nextProps) {
this.setIndeterminate(nextProps.indeterminate);
},
setIndeterminate: function setIndeterminate(value) {
this.refs.target.indeterminate = value;
},
render: function render() {
var componentClass = classNames('Checkbox', {
'Checkbox--disabled': this.props.disabled,
'Checkbox--inline': this.props.inline
}, this.props.className);
var props = blacklist(this.props, 'className', 'label', 'style', 'title');
return React.createElement(
'label',
{ className: componentClass, style: this.props.style, title: this.props.title },
React.createElement('input', _extends({ ref: 'target', type: 'checkbox', className: 'Checkbox__input' }, props)),
this.props.label && React.createElement(
'span',
{ className: 'Checkbox__label' },
this.props.label
)
);
}
});
module.exports = Checkbox;
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"blacklist":undefined,"classnames":undefined}],9:[function(require,module,exports){
(function (global){
'use strict';
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _react = (typeof window !== "undefined" ? window['React'] : typeof global !== "undefined" ? global['React'] : null);
var _react2 = _interopRequireDefault(_react);
var _blacklist = require('blacklist');
var _blacklist2 = _interopRequireDefault(_blacklist);
var _constants = require('../constants');
var _constants2 = _interopRequireDefault(_constants);
module.exports = _react2['default'].createClass({
displayName: 'Col',
propTypes: {
/* eslint-disable react/jsx-sort-prop-types */
basis: _react2['default'].PropTypes.oneOfType([_react2['default'].PropTypes.number, // allow pixels
_react2['default'].PropTypes.string]),
// allow percentage
children: _react2['default'].PropTypes.node,
gutter: _react2['default'].PropTypes.number,
style: _react2['default'].PropTypes.object,
lg: _react2['default'].PropTypes.string, // width as a percentage or fraction
md: _react2['default'].PropTypes.string, // width as a percentage or fraction
sm: _react2['default'].PropTypes.string, // width as a percentage or fraction
xs: _react2['default'].PropTypes.string },
// width as a percentage or fraction
/* eslint-enable */
getDefaultProps: function getDefaultProps() {
return {
gutter: _constants2['default'].width.gutter
};
},
getInitialState: function getInitialState() {
return {
windowWidth: window.innerWidth
};
},
componentDidMount: function componentDidMount() {
window.addEventListener('resize', this.handleResize);
},
componentWillUnmount: function componentWillUnmount() {
window.removeEventListener('resize', this.handleResize);
},
handleResize: function handleResize() {
this.setState({
windowWidth: window.innerWidth
});
},
render: function render() {
var _props = this.props;
var basis = _props.basis;
var gutter = _props.gutter;
var xs = _props.xs;
var sm = _props.sm;
var md = _props.md;
var lg = _props.lg;
var windowWidth = this.state.windowWidth;
var columnStyle = {
minHeight: 1,
paddingLeft: gutter / 2,
paddingRight: gutter / 2
};
// if no width control is provided fill available space
if (!basis && !xs && !sm && !md && !lg) {
columnStyle.flex = '1 1 auto';
columnStyle.msFlex = '1 1 auto';
columnStyle.WebkitFlex = '1 1 auto';
}
// set widths / flex-basis
if (basis) {
columnStyle.flex = '1 0 ' + basis;
columnStyle.msFlex = '1 0 ' + basis;
columnStyle.WebkitFlex = '1 0 ' + basis;
} else if (windowWidth < _constants2['default'].breakpoint.xs) {
columnStyle.width = xs;
} else if (windowWidth < _constants2['default'].breakpoint.sm) {
columnStyle.width = sm || xs;
} else if (windowWidth < _constants2['default'].breakpoint.md) {
columnStyle.width = md || sm || xs;
} else {
columnStyle.width = lg || md || sm || xs;
}
if (!columnStyle.width) {
columnStyle.width = '100%';
}
if (columnStyle.width in _constants2['default'].fractions) {
columnStyle.width = _constants2['default'].fractions[columnStyle.width];
}
var props = (0, _blacklist2['default'])(this.props, 'basis', 'gutter', 'style', 'xs', 'sm', 'md', 'lg');
return _react2['default'].createElement('div', _extends({ style: _extends(columnStyle, this.props.style) }, props));
}
});
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"../constants":41,"blacklist":undefined}],10:[function(require,module,exports){
(function (global){
'use strict';
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _react = (typeof window !== "undefined" ? window['React'] : typeof global !== "undefined" ? global['React'] : null);
var _react2 = _interopRequireDefault(_react);
var _blacklist = require('blacklist');
var _blacklist2 = _interopRequireDefault(_blacklist);
var _constants = require('../constants');
var _constants2 = _interopRequireDefault(_constants);
module.exports = _react2['default'].createClass({
displayName: 'Container',
propTypes: {
children: _react2['default'].PropTypes.node.isRequired,
clearfix: _react2['default'].PropTypes.bool,
gutter: _react2['default'].PropTypes.number,
maxWidth: _react2['default'].PropTypes.number,
style: _react2['default'].PropTypes.object
},
getDefaultProps: function getDefaultProps() {
return {
gutter: _constants2['default'].width.gutter,
maxWidth: _constants2['default'].width.container
};
},
render: function render() {
var _props = this.props;
var gutter = _props.gutter;
var maxWidth = _props.maxWidth;
var containerStyle = {
marginLeft: 'auto',
marginRight: 'auto',
paddingLeft: gutter,
paddingRight: gutter,
maxWidth: maxWidth
};
var clearfixStyle = { clear: 'both', display: 'table' };
var props = (0, _blacklist2['default'])(this.props, 'gutter', 'maxWidth', 'style');
return this.props.clearfix ? _react2['default'].createElement(
'div',
_extends({ style: _extends(containerStyle, this.props.style) }, props),
_react2['default'].createElement('span', { style: clearfixStyle }),
this.props.children,
_react2['default'].createElement('span', { style: clearfixStyle })
) : _react2['default'].createElement('div', _extends({ style: _extends(containerStyle, this.props.style) }, props));
}
});
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"../constants":41,"blacklist":undefined}],11:[function(require,module,exports){
(function (global){
'use strict';
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var React = (typeof window !== "undefined" ? window['React'] : typeof global !== "undefined" ? global['React'] : null);
var Transition = require('react-addons-css-transition-group');
var blacklist = require('blacklist');
var classNames = require('classnames');
var Button = require('./Button');
var ESC_KEYCODE = 27;
module.exports = React.createClass({
displayName: 'Dropdown',
propTypes: {
alignRight: React.PropTypes.bool,
buttonHasDisclosureArrow: React.PropTypes.bool,
buttonLabel: React.PropTypes.string,
buttonType: React.PropTypes.string,
children: React.PropTypes.element,
className: React.PropTypes.string,
isOpen: React.PropTypes.bool,
items: React.PropTypes.array.isRequired,
onSelect: React.PropTypes.func
},
getDefaultProps: function getDefaultProps() {
return {
buttonHasDisclosureArrow: true,
onSelect: function onSelect() {}
};
},
getInitialState: function getInitialState() {
return {
isOpen: this.props.isOpen || false
};
},
openDropdown: function openDropdown() {
this.setState({ isOpen: true });
},
closeDropdown: function closeDropdown() {
this.setState({ isOpen: false });
},
componentWillUpdate: function componentWillUpdate(nextProps, nextState) {
if (nextState.isOpen) {
window.addEventListener('keydown', this.handleKeyDown);
} else {
window.removeEventListener('keydown', this.handleKeyDown);
}
},
handleKeyDown: function handleKeyDown(e) {
if (e.keyCode === ESC_KEYCODE) {
this.closeDropdown();
}
},
renderChildren: function renderChildren() {
var _this = this;
return React.Children.map(this.props.children, function (child) {
return React.cloneElement(child, {
onClick: _this.state.isOpen ? _this.closeDropdown : _this.openDropdown,
className: classNames(child.props.className, 'Dropdown-toggle')
});
});
},
renderButton: function renderButton() {
var disclosureArrow = this.props.buttonHasDisclosureArrow ? React.createElement('span', { className: 'disclosure-arrow' }) : null;
return React.createElement(
Button,
{ type: this.props.buttonType, onClick: this.state.isOpen ? this.closeDropdown : this.openDropdown, className: 'Dropdown-toggle' },
this.props.buttonLabel,
disclosureArrow
);
},
onClick: function onClick(selectedItem) {
this.setState({
isOpen: !this.state.isOpen
});
this.props.onSelect(selectedItem);
},
renderDropdownMenu: function renderDropdownMenu() {
var self = this;
if (!this.state.isOpen) return null;
var dropdownMenuItems = this.props.items.map(function (item, i) {
var menuItem;
if (item.type === 'header') {
menuItem = React.createElement(
'li',
{ key: 'item-' + i, className: 'Dropdown-menu__header' },
item.label
);
} else if (item.type === 'divider') {
menuItem = React.createElement('li', { key: 'item-' + i, className: 'Dropdown-menu__divider' });
} else {
menuItem = React.createElement(
'li',
{ key: 'item-' + i, className: 'Dropdown-menu__item' },
React.createElement(
'span',
{ className: 'Dropdown-menu__action', onClick: self.onClick.bind(self, item.value) },
item.label
)
);
}
return menuItem;
});
return React.createElement(
'ul',
{ key: 'Dropdown-menu', className: 'Dropdown-menu', role: 'menu' },
dropdownMenuItems
);
},
renderDropdownMenuBackground: function renderDropdownMenuBackground() {
if (!this.state.isOpen) return null;
return React.createElement('div', { className: 'Dropdown-menu-backdrop', onClick: this.closeDropdown });
},
render: function render() {
// classes
var dropdownClass = classNames('Dropdown', {
'is-open': this.state.isOpen,
'align-right': this.props.alignRight
}, this.props.className);
// props
var props = blacklist(this.props, 'alignRight', 'buttonHasDisclosureArrow', 'buttonLabel', 'buttonType', 'className', 'isOpen', 'items');
return React.createElement(
'span',
_extends({ className: dropdownClass }, props),
React.Children.count(this.props.children) ? this.renderChildren() : this.renderButton(),
React.createElement(
Transition,
{ transitionName: 'Dropdown-menu', transitionEnterTimeout: 100, transitionLeaveTimeout: 100 },
this.renderDropdownMenu()
),
this.renderDropdownMenuBackground()
);
}
});
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"./Button":5,"blacklist":undefined,"classnames":undefined,"react-addons-css-transition-group":undefined}],12:[function(require,module,exports){
(function (global){
'use strict';
var React = (typeof window !== "undefined" ? window['React'] : typeof global !== "undefined" ? global['React'] : null);
var classNames = require('classnames');
var REGEXP_EMAIL = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
function validateEmail(value) {
return REGEXP_EMAIL.test(value);
}
module.exports = React.createClass({
displayName: 'EmailInputGroup',
propTypes: {
alwaysValidate: React.PropTypes.bool,
className: React.PropTypes.string,
invalidMessage: React.PropTypes.string,
label: React.PropTypes.string,
onChange: React.PropTypes.func,
required: React.PropTypes.bool,
requiredMessage: React.PropTypes.string,
value: React.PropTypes.string
},
getDefaultProps: function getDefaultProps() {
return {
requiredMessage: 'Email address is required',
invalidMessage: 'Please enter a valid email address'
};
},
getInitialState: function getInitialState() {
return {
isValid: true,
validationIsActive: this.props.alwaysValidate
};
},
componentDidMount: function componentDidMount() {
if (this.state.validationIsActive) {
this.validateInput(this.props.value);
}
},
componentWillReceiveProps: function componentWillReceiveProps(newProps) {
if (this.state.validationIsActive) {
if (newProps.value !== this.props.value && newProps.value !== this._lastChangeValue && !newProps.alwaysValidate) {
// reset validation state if the value was changed outside the component
return this.setState({
isValid: true,
validationIsActive: false
});
}
this.validateInput(newProps.value);
}
},
handleChange: function handleChange(e) {
this._lastChangeValue = e.target.value;
if (this.props.onChange) this.props.onChange(e);
},
handleBlur: function handleBlur() {
if (!this.props.alwaysValidate) {
this.setState({ validationIsActive: false });
}
this.validateInput(this.props.value);
},
validateInput: function validateInput(value) {
var newState = {
isValid: true
};
if (value.length && !validateEmail(value) || !value.length && this.props.required) {
newState.isValid = false;
}
if (!newState.isValid) {
newState.validationIsActive = true;
}
this.setState(newState);
},
render: function render() {
var validationMessage;
if (!this.state.isValid) {
validationMessage = React.createElement(
'div',
{ className: 'form-validation is-invalid' },
this.props.value.length ? this.props.invalidMessage : this.props.requiredMessage
);
}
var formGroupClass = classNames('FormField', {
'is-invalid': !this.state.isValid
}, this.props.className);
var componentLabel = this.props.label ? React.createElement(
'label',
{ className: 'FormLabel', htmlFor: 'inputEmail' },
this.props.label
) : null;
return React.createElement(
'div',
{ className: formGroupClass },
componentLabel,
React.createElement('input', { onChange: this.handleChange, onBlur: this.handleBlur, value: this.props.value, type: 'email', className: 'FormInput', placeholder: 'Enter email', id: 'inputEmail' }),
validationMessage
);
}
});
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"classnames":undefined}],13:[function(require,module,exports){
(function (global){
'use strict';
var React = (typeof window !== "undefined" ? window['React'] : typeof global !== "undefined" ? global['React'] : null);
var classNames = require('classnames');
/*
Based on: https://github.com/paramaggarwal/react-dropzone
*/
var Dropzone = React.createClass({
displayName: 'Dropzone',
propTypes: {
className: React.PropTypes.string,
label: React.PropTypes.string,
labelActive: React.PropTypes.string,
onDrop: React.PropTypes.func.isRequired
},
getDefaultProps: function getDefaultProps() {
return {
label: 'Drag Files Here',
labelActive: 'Drop to Upload'
};
},
getInitialState: function getInitialState() {
return {
isDragActive: false
};
},
onDragLeave: function onDragLeave() {
this.setState({
isDragActive: false
});
},
onDragOver: function onDragOver(e) {
e.preventDefault();
e.dataTransfer.dropEffect = 'copy';
this.setState({
isDragActive: true
});
},
onDrop: function onDrop(e) {
e.preventDefault();
this.setState({
isDragActive: false
});
var files;
if (e.dataTransfer) {
files = e.dataTransfer.files;
} else if (e.target) {
files = e.target.files;
}
if (this.props.onDrop) {
files = Array.prototype.slice.call(files);
this.props.onDrop(files);
}
},
onClick: function onClick() {
this.refs.fileInput.click();
},
render: function render() {
var className = classNames('FileDragAndDrop', {
'active': this.state.isDragActive
}, this.props.className);
return React.createElement(
'button',
{ className: className, onClick: this.onClick, onDragLeave: this.onDragLeave, onDragOver: this.onDragOver, onDrop: this.onDrop },
React.createElement('input', { style: { display: 'none' }, type: 'file', multiple: true, ref: 'fileInput', onChange: this.onDrop }),
React.createElement(
'div',
{ className: 'FileDragAndDrop__label' },
this.state.isDragActive ? this.props.labelActive : this.props.label
),
this.props.children
);
}
});
module.exports = Dropzone;
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"classnames":undefined}],14:[function(require,module,exports){
(function (global){
'use strict';
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var React = (typeof window !== "undefined" ? window['React'] : typeof global !== "undefined" ? global['React'] : null);
var blacklist = require('blacklist');
var Button = require('./Button');
var Spinner = require('./Spinner');
module.exports = React.createClass({
displayName: 'FileUpload',
propTypes: {
buttonLabelChange: React.PropTypes.string,
buttonLabelInitial: React.PropTypes.string,
disabled: React.PropTypes.bool,
file: React.PropTypes.object, // https://developer.mozilla.org/en/docs/Using_files_from_web_applications
onChange: React.PropTypes.func
},
getDefaultProps: function getDefaultProps() {
return {
buttonLabelInitial: 'Upload File',
buttonLabelChange: 'Change File'
};
},
getInitialState: function getInitialState() {
return {
file: {},
loading: false
};
},
componentDidMount: function componentDidMount() {
this.refs.fileInput.addEventListener('click', function () {
this.value = '';
}, false);
},
triggerFileBrowser: function triggerFileBrowser() {
this.refs.fileInput.click();
},
handleChange: function handleChange(e) {
var self = this;
var reader = new FileReader();
var file = e.target.files[0];
reader.readAsDataURL(file);
reader.onloadstart = function () {
console.time('onLoad');
self.setState({
loading: true
});
};
reader.onloadend = function (upload) {
console.timeEnd('onLoad');
self.setState({
loading: false,
file: file,
dataURI: upload.target.result
});
};
},
cancelUpload: function cancelUpload() {
this.setState({
dataURI: false,
file: {}
});
},
render: function render() {
var _state = this.state;
var dataURI = _state.dataURI;
var file = _state.file;
// props
var props = blacklist(this.props, 'buttonClassChange', 'buttonClassInitial', 'buttonLabelChange', 'buttonLabelInitial', 'disabled', 'file', 'onChange');
// elements
var component = React.createElement(
Button,
{ onClick: this.triggerFileBrowser, disabled: this.props.disabled || this.state.loading },
this.state.loading && React.createElement(Spinner, null),
this.props.buttonLabelInitial
);
if (dataURI) {
component = React.createElement(
'div',
{ className: 'FileUpload' },
React.createElement(
'div',
{ className: 'FileUpload__image' },
React.createElement('img', { className: 'FileUpload__image-src', src: dataURI })
),
React.createElement(
'div',
{ className: 'FileUpload__content' },
React.createElement(
'div',
{ className: 'FileUpload__message' },
file.name,
' (',
Math.round(file.size / 1024),
'Kb)'
),
React.createElement(
'div',
{ className: 'FileUpload__buttons' },
React.createElement(
Button,
{ onClick: this.triggerFileBrowser, disabled: this.state.loading },
this.state.loading && React.createElement(Spinner, null),
this.props.buttonLabelChange
),
React.createElement(
Button,
{ onClick: this.cancelUpload, type: 'link-cancel', disabled: this.state.loading },
'Cancel'
)
)
)
);
}
return React.createElement(
'div',
null,
component,
React.createElement('input', _extends({ style: { display: 'none' }, type: 'file', ref: 'fileInput', onChange: this.handleChange }, props))
);
}
});
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"./Button":5,"./Spinner":39,"blacklist":undefined}],15:[function(require,module,exports){
(function (global){
'use strict';
var blacklist = require('blacklist');
var classnames = require('classnames');
var React = (typeof window !== "undefined" ? window['React'] : typeof global !== "undefined" ? global['React'] : null);
module.exports = React.createClass({
displayName: 'Form',
propTypes: {
children: React.PropTypes.node.isRequired,
className: React.PropTypes.string,
component: React.PropTypes.oneOfType([React.PropTypes.element, React.PropTypes.string]),
type: React.PropTypes.oneOf(['basic', 'horizontal', 'inline'])
},
getDefaultProps: function getDefaultProps() {
return {
component: 'form',
type: 'basic'
};
},
render: function render() {
var props = blacklist(this.props, 'children', 'type');
props.className = classnames('Form', 'Form--' + this.props.type, this.props.className);
return React.createElement(this.props.component, props, this.props.children);
}
});
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"blacklist":undefined,"classnames":undefined}],16:[function(require,module,exports){
(function (global){
'use strict';
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var React = (typeof window !== "undefined" ? window['React'] : typeof global !== "undefined" ? global['React'] : null);
var blacklist = require('blacklist');
var classNames = require('classnames');
module.exports = React.createClass({
displayName: 'FormField',
propTypes: {
className: React.PropTypes.string,
htmlFor: React.PropTypes.string,
id: React.PropTypes.string,
label: React.PropTypes.string,
offsetAbsentLabel: React.PropTypes.bool,