@pareto-engineering/design-system 4.2.1 → 4.3.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 (58) hide show
  1. package/dist/cjs/f/FormInput/FormInput.js +6 -0
  2. package/dist/cjs/f/common/utils/index.js +8 -1
  3. package/dist/cjs/f/common/utils/validators.js +17 -0
  4. package/dist/cjs/f/fields/ChoicesInput/common/Choice/Choice.js +3 -2
  5. package/dist/cjs/f/fields/FileUpload/FileUpload.js +234 -0
  6. package/dist/cjs/f/fields/FileUpload/common/FilePreview/FilePreview.js +118 -0
  7. package/dist/cjs/f/fields/FileUpload/common/FilePreview/index.js +13 -0
  8. package/dist/cjs/f/fields/FileUpload/common/FilePreview/styles.scss +93 -0
  9. package/dist/cjs/f/fields/FileUpload/common/index.js +12 -0
  10. package/dist/cjs/f/fields/FileUpload/index.js +32 -0
  11. package/dist/cjs/f/fields/FileUpload/styles.scss +73 -0
  12. package/dist/cjs/f/fields/FileUpload/utils.js +45 -0
  13. package/dist/cjs/f/fields/index.js +26 -1
  14. package/dist/cjs/g/FormBuilder/FormBuilder.js +11 -3
  15. package/dist/cjs/g/FormBuilder/common/Builder/common/InputBuilder/InputBuilder.js +34 -7
  16. package/dist/cjs/g/FormBuilder/common/Builder/common/InputBuilder/styles.scss +11 -0
  17. package/dist/cjs/g/FormBuilder/common/Renderer/Renderer.js +14 -4
  18. package/dist/cjs/g/FormBuilder/common/Renderer/common/Section/Section.js +8 -4
  19. package/dist/es/f/FormInput/FormInput.js +7 -1
  20. package/dist/es/f/common/utils/index.js +2 -1
  21. package/dist/es/f/common/utils/validators.js +10 -0
  22. package/dist/es/f/fields/ChoicesInput/common/Choice/Choice.js +3 -2
  23. package/dist/es/f/fields/FileUpload/FileUpload.js +223 -0
  24. package/dist/es/f/fields/FileUpload/common/FilePreview/FilePreview.js +108 -0
  25. package/dist/es/f/fields/FileUpload/common/FilePreview/index.js +2 -0
  26. package/dist/es/f/fields/FileUpload/common/FilePreview/styles.scss +93 -0
  27. package/dist/es/f/fields/FileUpload/common/index.js +2 -0
  28. package/dist/es/f/fields/FileUpload/index.js +3 -0
  29. package/dist/es/f/fields/FileUpload/styles.scss +73 -0
  30. package/dist/es/f/fields/FileUpload/utils.js +37 -0
  31. package/dist/es/f/fields/index.js +2 -1
  32. package/dist/es/g/FormBuilder/FormBuilder.js +11 -3
  33. package/dist/es/g/FormBuilder/common/Builder/common/InputBuilder/InputBuilder.js +35 -8
  34. package/dist/es/g/FormBuilder/common/Builder/common/InputBuilder/styles.scss +11 -0
  35. package/dist/es/g/FormBuilder/common/Renderer/Renderer.js +14 -4
  36. package/dist/es/g/FormBuilder/common/Renderer/common/Section/Section.js +8 -3
  37. package/package.json +3 -3
  38. package/src/stories/f/FileUpload.stories.jsx +55 -0
  39. package/src/stories/g/FormBuilder.stories.jsx +19 -97
  40. package/src/ui/f/FormInput/FormInput.jsx +11 -0
  41. package/src/ui/f/common/utils/index.js +1 -0
  42. package/src/ui/f/common/utils/validators.js +10 -0
  43. package/src/ui/f/fields/ChoicesInput/common/Choice/Choice.jsx +2 -0
  44. package/src/ui/f/fields/FileUpload/FileUpload.jsx +279 -0
  45. package/src/ui/f/fields/FileUpload/common/FilePreview/FilePreview.jsx +160 -0
  46. package/src/ui/f/fields/FileUpload/common/FilePreview/index.js +2 -0
  47. package/src/ui/f/fields/FileUpload/common/FilePreview/styles.scss +93 -0
  48. package/src/ui/f/fields/FileUpload/common/index.js +2 -0
  49. package/src/ui/f/fields/FileUpload/index.js +3 -0
  50. package/src/ui/f/fields/FileUpload/styles.scss +73 -0
  51. package/src/ui/f/fields/FileUpload/utils.js +49 -0
  52. package/src/ui/f/fields/index.js +6 -0
  53. package/src/ui/g/FormBuilder/FormBuilder.jsx +9 -0
  54. package/src/ui/g/FormBuilder/common/Builder/common/InputBuilder/InputBuilder.jsx +53 -11
  55. package/src/ui/g/FormBuilder/common/Builder/common/InputBuilder/styles.scss +11 -0
  56. package/src/ui/g/FormBuilder/common/Renderer/Renderer.jsx +17 -3
  57. package/src/ui/g/FormBuilder/common/Renderer/common/Section/Section.jsx +11 -2
  58. package/tests/__snapshots__/Storyshots.test.js.snap +180 -154
@@ -27478,6 +27478,119 @@ exports[`Storyshots f/fields/EditorInput Optional 1`] = `
27478
27478
  </form>
27479
27479
  `;
27480
27480
 
27481
+ exports[`Storyshots f/fields/FileUpload Base 1`] = `
27482
+ <form
27483
+ action="#"
27484
+ onReset={[Function]}
27485
+ onSubmit={[Function]}
27486
+ >
27487
+ <div
27488
+ className="base file-upload preview-bottom y-paragraph"
27489
+ >
27490
+ <p>
27491
+ The file upload
27492
+ </p>
27493
+ <label
27494
+ className="base form-label x-paragraph"
27495
+ htmlFor="section_0_input_0"
27496
+ >
27497
+ <input
27498
+ accept=".mp4,.ogg,.webm,video/mp4,video/ogg,video/webm,.pdf,application/pdf"
27499
+ className="file"
27500
+ disabled={false}
27501
+ id="section_0_input_0"
27502
+ onChange={[Function]}
27503
+ type="file"
27504
+ />
27505
+ <span
27506
+ className="ai-icon"
27507
+ >
27508
+ U
27509
+ </span>
27510
+ <span>
27511
+ Attach file
27512
+ </span>
27513
+ </label>
27514
+ </div>
27515
+ </form>
27516
+ `;
27517
+
27518
+ exports[`Storyshots f/fields/FileUpload Multiple 1`] = `
27519
+ <form
27520
+ action="#"
27521
+ onReset={[Function]}
27522
+ onSubmit={[Function]}
27523
+ >
27524
+ <div
27525
+ className="base file-upload preview-bottom y-paragraph"
27526
+ >
27527
+ <p>
27528
+ The file upload
27529
+ </p>
27530
+ <label
27531
+ className="base form-label x-paragraph"
27532
+ htmlFor="section_0_input_0"
27533
+ >
27534
+ <input
27535
+ accept=".mp4,.ogg,.webm,video/mp4,video/ogg,video/webm,.pdf,application/pdf"
27536
+ className="file"
27537
+ disabled={false}
27538
+ id="section_0_input_0"
27539
+ multiple={true}
27540
+ onChange={[Function]}
27541
+ type="file"
27542
+ />
27543
+ <span
27544
+ className="ai-icon"
27545
+ >
27546
+ U
27547
+ </span>
27548
+ <span>
27549
+ Attach file
27550
+ </span>
27551
+ </label>
27552
+ </div>
27553
+ </form>
27554
+ `;
27555
+
27556
+ exports[`Storyshots f/fields/FileUpload With Limited Count 1`] = `
27557
+ <form
27558
+ action="#"
27559
+ onReset={[Function]}
27560
+ onSubmit={[Function]}
27561
+ >
27562
+ <div
27563
+ className="base file-upload preview-bottom y-paragraph"
27564
+ >
27565
+ <p>
27566
+ The file upload
27567
+ </p>
27568
+ <label
27569
+ className="base form-label x-paragraph"
27570
+ htmlFor="section_0_input_0"
27571
+ >
27572
+ <input
27573
+ accept=".mp4,.ogg,.webm,video/mp4,video/ogg,video/webm,.pdf,application/pdf"
27574
+ className="file"
27575
+ disabled={false}
27576
+ id="section_0_input_0"
27577
+ multiple={true}
27578
+ onChange={[Function]}
27579
+ type="file"
27580
+ />
27581
+ <span
27582
+ className="ai-icon"
27583
+ >
27584
+ U
27585
+ </span>
27586
+ <span>
27587
+ Attach file
27588
+ </span>
27589
+ </label>
27590
+ </div>
27591
+ </form>
27592
+ `;
27593
+
27481
27594
  exports[`Storyshots f/fields/LinkInput Base 1`] = `
27482
27595
  <form
27483
27596
  action="#"
@@ -32643,7 +32756,7 @@ exports[`Storyshots g/FormBuilder Renderer 1`] = `
32643
32756
  <p
32644
32757
  className="h3"
32645
32758
  >
32646
- This is a survey of some of the best LLM models out there
32759
+ Hello
32647
32760
  </p>
32648
32761
  <div
32649
32762
  className="base expandable-lexical-preview y-paragraph"
@@ -32682,58 +32795,33 @@ exports[`Storyshots g/FormBuilder Renderer 1`] = `
32682
32795
  </button>
32683
32796
  </div>
32684
32797
  <div
32685
- className="base text-input form-input y-paragraph "
32686
- style={{}}
32798
+ className="base file-upload form-input preview-bottom y-paragraph"
32687
32799
  >
32800
+ <p>
32801
+ The file upload
32802
+ </p>
32688
32803
  <label
32689
32804
  className="base form-label x-paragraph"
32690
32805
  htmlFor="section_0_input_0"
32691
32806
  >
32692
- Name the Model
32693
- </label>
32694
- <input
32695
- className="input"
32696
- conditionalLogic={null}
32697
- disabled={false}
32698
- id="section_0_input_0"
32699
- name="section_0_input_0"
32700
- onBlur={[Function]}
32701
- onChange={[Function]}
32702
- options={[]}
32703
- required={true}
32704
- type="text"
32705
- value=""
32706
- />
32707
- </div>
32708
- <div
32709
- className="base text-area-input form-input y-paragraph"
32710
- >
32711
- <label
32712
- className="base form-label x-paragraph"
32713
- htmlFor="section_0_input_1"
32714
- >
32715
- Describe the Model in detail
32807
+ <input
32808
+ accept=".mp4,.ogg,.webm,video/mp4,video/ogg,video/webm,.pdf,application/pdf"
32809
+ className="file"
32810
+ disabled={false}
32811
+ id="section_0_input_0"
32812
+ multiple={true}
32813
+ onChange={[Function]}
32814
+ type="file"
32815
+ />
32816
+ <span
32817
+ className="ai-icon"
32818
+ >
32819
+ U
32820
+ </span>
32821
+ <span>
32822
+ Attach file
32823
+ </span>
32716
32824
  </label>
32717
- <textarea
32718
- className="textarea"
32719
- disabled={false}
32720
- id="section_0_input_1"
32721
- name="section_0_input_1"
32722
- onBlur={[Function]}
32723
- onChange={[Function]}
32724
- rows={10}
32725
- style={
32726
- {
32727
- "resize": "vertical",
32728
- }
32729
- }
32730
- value=""
32731
- />
32732
- <div
32733
- className="base description s-1 x-metadata"
32734
- >
32735
- brief model description
32736
- </div>
32737
32825
  </div>
32738
32826
  </div>
32739
32827
  <div
@@ -32747,12 +32835,6 @@ exports[`Storyshots g/FormBuilder Renderer 1`] = `
32747
32835
  >
32748
32836
  Previous
32749
32837
  </button>
32750
- <button
32751
- className="base button x-interactive modifierGradient"
32752
- type="submit"
32753
- >
32754
- Next
32755
- </button>
32756
32838
  </div>
32757
32839
  </form>
32758
32840
  </div>
@@ -32782,7 +32864,7 @@ exports[`Storyshots g/FormBuilder Renderer With Disabled 1`] = `
32782
32864
  <p
32783
32865
  className="h3"
32784
32866
  >
32785
- This is a survey of some of the best LLM models out there
32867
+ Hello
32786
32868
  </p>
32787
32869
  <div
32788
32870
  className="base expandable-lexical-preview y-paragraph"
@@ -32821,58 +32903,33 @@ exports[`Storyshots g/FormBuilder Renderer With Disabled 1`] = `
32821
32903
  </button>
32822
32904
  </div>
32823
32905
  <div
32824
- className="base text-input form-input y-paragraph "
32825
- style={{}}
32906
+ className="base file-upload form-input preview-bottom y-paragraph"
32826
32907
  >
32908
+ <p>
32909
+ The file upload
32910
+ </p>
32827
32911
  <label
32828
32912
  className="base form-label x-paragraph"
32829
32913
  htmlFor="section_0_input_0"
32830
32914
  >
32831
- Name the Model
32915
+ <input
32916
+ accept=".mp4,.ogg,.webm,video/mp4,video/ogg,video/webm,.pdf,application/pdf"
32917
+ className="file"
32918
+ disabled={true}
32919
+ id="section_0_input_0"
32920
+ multiple={true}
32921
+ onChange={[Function]}
32922
+ type="file"
32923
+ />
32924
+ <span
32925
+ className="ai-icon"
32926
+ >
32927
+ U
32928
+ </span>
32929
+ <span>
32930
+ Attach file
32931
+ </span>
32832
32932
  </label>
32833
- <input
32834
- className="input"
32835
- conditionalLogic={null}
32836
- disabled={true}
32837
- id="section_0_input_0"
32838
- name="section_0_input_0"
32839
- onBlur={[Function]}
32840
- onChange={[Function]}
32841
- options={[]}
32842
- required={true}
32843
- type="text"
32844
- value=""
32845
- />
32846
- </div>
32847
- <div
32848
- className="base text-area-input form-input y-paragraph"
32849
- >
32850
- <label
32851
- className="base form-label x-paragraph"
32852
- htmlFor="section_0_input_1"
32853
- >
32854
- Describe the Model in detail
32855
- </label>
32856
- <textarea
32857
- className="textarea"
32858
- disabled={true}
32859
- id="section_0_input_1"
32860
- name="section_0_input_1"
32861
- onBlur={[Function]}
32862
- onChange={[Function]}
32863
- rows={10}
32864
- style={
32865
- {
32866
- "resize": "vertical",
32867
- }
32868
- }
32869
- value=""
32870
- />
32871
- <div
32872
- className="base description s-1 x-metadata"
32873
- >
32874
- brief model description
32875
- </div>
32876
32933
  </div>
32877
32934
  </div>
32878
32935
  <div
@@ -32886,12 +32943,6 @@ exports[`Storyshots g/FormBuilder Renderer With Disabled 1`] = `
32886
32943
  >
32887
32944
  Previous
32888
32945
  </button>
32889
- <button
32890
- className="base button x-interactive modifierGradient"
32891
- type="submit"
32892
- >
32893
- Next
32894
- </button>
32895
32946
  </div>
32896
32947
  </form>
32897
32948
  </div>
@@ -32921,7 +32972,7 @@ exports[`Storyshots g/FormBuilder Renderer With Submit 1`] = `
32921
32972
  <p
32922
32973
  className="h3"
32923
32974
  >
32924
- This is a survey of some of the best LLM models out there
32975
+ Hello
32925
32976
  </p>
32926
32977
  <div
32927
32978
  className="base expandable-lexical-preview y-paragraph"
@@ -32960,58 +33011,33 @@ exports[`Storyshots g/FormBuilder Renderer With Submit 1`] = `
32960
33011
  </button>
32961
33012
  </div>
32962
33013
  <div
32963
- className="base text-input form-input y-paragraph "
32964
- style={{}}
33014
+ className="base file-upload form-input preview-bottom y-paragraph"
32965
33015
  >
33016
+ <p>
33017
+ The file upload
33018
+ </p>
32966
33019
  <label
32967
33020
  className="base form-label x-paragraph"
32968
33021
  htmlFor="section_0_input_0"
32969
33022
  >
32970
- Name the Model
32971
- </label>
32972
- <input
32973
- className="input"
32974
- conditionalLogic={null}
32975
- disabled={false}
32976
- id="section_0_input_0"
32977
- name="section_0_input_0"
32978
- onBlur={[Function]}
32979
- onChange={[Function]}
32980
- options={[]}
32981
- required={true}
32982
- type="text"
32983
- value=""
32984
- />
32985
- </div>
32986
- <div
32987
- className="base text-area-input form-input y-paragraph"
32988
- >
32989
- <label
32990
- className="base form-label x-paragraph"
32991
- htmlFor="section_0_input_1"
32992
- >
32993
- Describe the Model in detail
33023
+ <input
33024
+ accept=".mp4,.ogg,.webm,video/mp4,video/ogg,video/webm,.pdf,application/pdf"
33025
+ className="file"
33026
+ disabled={false}
33027
+ id="section_0_input_0"
33028
+ multiple={true}
33029
+ onChange={[Function]}
33030
+ type="file"
33031
+ />
33032
+ <span
33033
+ className="ai-icon"
33034
+ >
33035
+ U
33036
+ </span>
33037
+ <span>
33038
+ Attach file
33039
+ </span>
32994
33040
  </label>
32995
- <textarea
32996
- className="textarea"
32997
- disabled={false}
32998
- id="section_0_input_1"
32999
- name="section_0_input_1"
33000
- onBlur={[Function]}
33001
- onChange={[Function]}
33002
- rows={10}
33003
- style={
33004
- {
33005
- "resize": "vertical",
33006
- }
33007
- }
33008
- value=""
33009
- />
33010
- <div
33011
- className="base description s-1 x-metadata"
33012
- >
33013
- brief model description
33014
- </div>
33015
33041
  </div>
33016
33042
  </div>
33017
33043
  <div
@@ -33029,7 +33055,7 @@ exports[`Storyshots g/FormBuilder Renderer With Submit 1`] = `
33029
33055
  className="base button x-interactive modifierGradient"
33030
33056
  type="submit"
33031
33057
  >
33032
- Next
33058
+ Submit
33033
33059
  </button>
33034
33060
  </div>
33035
33061
  </form>