@pareto-engineering/design-system 4.6.0 → 4.7.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.
@@ -37,12 +37,17 @@ const Button = _ref => {
37
37
  const buttonText = isSimple ? /*#__PURE__*/React.createElement("span", {
38
38
  className: _exports.default.modifierUnderlined
39
39
  }, children) : children;
40
+ const {
41
+ disabled,
42
+ ...rest
43
+ } = otherProps;
40
44
  return /*#__PURE__*/React.createElement("button", _extends({
41
45
  id: id,
42
46
  className: [baseClassName, componentClassName, userClassName, `x-${color}`, textColor && `y-${textColor}`, isGhost && _exports.default.modifierGhost, isCompact && _exports.default.modifierCompact, isSimple && _exports.default.modifierSimple, isGradient && _exports.default.modifierGradient, isSpaced && _exports.default.modifierSpaced, !isLoading && arrowDirection && `arrow-${arrowDirection}`].filter(e => e).join(' '),
43
47
  style: style,
44
- type: "button"
45
- }, otherProps), isLoading ? /*#__PURE__*/React.createElement(_.LoadingCircle, {
48
+ type: "button",
49
+ disabled: disabled || isLoading
50
+ }, rest), isLoading ? /*#__PURE__*/React.createElement(_.LoadingCircle, {
46
51
  style: {
47
52
  '--x': 'var(--stroke-color, var(--on-x))'
48
53
  },
@@ -31,12 +31,17 @@ const Button = ({
31
31
  const buttonText = isSimple ? /*#__PURE__*/React.createElement("span", {
32
32
  className: styleNames.modifierUnderlined
33
33
  }, children) : children;
34
+ const {
35
+ disabled,
36
+ ...rest
37
+ } = otherProps;
34
38
  return /*#__PURE__*/React.createElement("button", _extends({
35
39
  id: id,
36
40
  className: [baseClassName, componentClassName, userClassName, `x-${color}`, textColor && `y-${textColor}`, isGhost && styleNames.modifierGhost, isCompact && styleNames.modifierCompact, isSimple && styleNames.modifierSimple, isGradient && styleNames.modifierGradient, isSpaced && styleNames.modifierSpaced, !isLoading && arrowDirection && `arrow-${arrowDirection}`].filter(e => e).join(' '),
37
41
  style: style,
38
- type: "button"
39
- }, otherProps), isLoading ? /*#__PURE__*/React.createElement(LoadingCircle, {
42
+ type: "button",
43
+ disabled: disabled || isLoading
44
+ }, rest), isLoading ? /*#__PURE__*/React.createElement(LoadingCircle, {
40
45
  style: {
41
46
  '--x': 'var(--stroke-color, var(--on-x))'
42
47
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pareto-engineering/design-system",
3
- "version": "4.6.0",
3
+ "version": "4.7.0",
4
4
  "description": "",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/es/index.js",
@@ -82,5 +82,5 @@
82
82
  "relay-test-utils": "^15.0.0"
83
83
  },
84
84
  "browserslist": "> 2%",
85
- "gitHead": "55eab180bec6adf2c4acb1908e2e1381495cf4ca"
85
+ "gitHead": "a0b1f11ada4ec43eab0107932d1fbafe8108bbb6"
86
86
  }
@@ -31,6 +31,8 @@ const Button = ({
31
31
  const buttonText = isSimple ? <span className={styleNames.modifierUnderlined}>{children}</span>
32
32
  : children
33
33
 
34
+ const { disabled, ...rest } = otherProps
35
+
34
36
  return (
35
37
  <button
36
38
  id={id}
@@ -51,7 +53,8 @@ const Button = ({
51
53
  .join(' ')}
52
54
  style={style}
53
55
  type="button"
54
- {...otherProps}
56
+ disabled={disabled || isLoading}
57
+ {...rest}
55
58
  >
56
59
  {isLoading ? (
57
60
  <LoadingCircle
@@ -17562,6 +17562,7 @@ exports[`Storyshots b/Button Loading 1`] = `
17562
17562
  [
17563
17563
  <button
17564
17564
  className="base button x-main"
17565
+ disabled={true}
17565
17566
  type="button"
17566
17567
  >
17567
17568
  <div
@@ -17603,6 +17604,7 @@ exports[`Storyshots b/Button Loading 1`] = `
17603
17604
  </button>,
17604
17605
  <button
17605
17606
  className="base button x-main2"
17607
+ disabled={true}
17606
17608
  type="button"
17607
17609
  >
17608
17610
  <div
@@ -17644,6 +17646,7 @@ exports[`Storyshots b/Button Loading 1`] = `
17644
17646
  </button>,
17645
17647
  <button
17646
17648
  className="base button x-red"
17649
+ disabled={true}
17647
17650
  type="button"
17648
17651
  >
17649
17652
  <div
@@ -17685,6 +17688,7 @@ exports[`Storyshots b/Button Loading 1`] = `
17685
17688
  </button>,
17686
17689
  <button
17687
17690
  className="base button x-green"
17691
+ disabled={true}
17688
17692
  type="button"
17689
17693
  >
17690
17694
  <div
@@ -17726,6 +17730,7 @@ exports[`Storyshots b/Button Loading 1`] = `
17726
17730
  </button>,
17727
17731
  <button
17728
17732
  className="base button x-orange"
17733
+ disabled={true}
17729
17734
  type="button"
17730
17735
  >
17731
17736
  <div
@@ -17767,6 +17772,7 @@ exports[`Storyshots b/Button Loading 1`] = `
17767
17772
  </button>,
17768
17773
  <button
17769
17774
  className="base button x-gray"
17775
+ disabled={true}
17770
17776
  type="button"
17771
17777
  >
17772
17778
  <div
@@ -17808,6 +17814,7 @@ exports[`Storyshots b/Button Loading 1`] = `
17808
17814
  </button>,
17809
17815
  <button
17810
17816
  className="base button x-blue"
17817
+ disabled={true}
17811
17818
  type="button"
17812
17819
  >
17813
17820
  <div
@@ -17849,6 +17856,7 @@ exports[`Storyshots b/Button Loading 1`] = `
17849
17856
  </button>,
17850
17857
  <button
17851
17858
  className="base button x-purple"
17859
+ disabled={true}
17852
17860
  type="button"
17853
17861
  >
17854
17862
  <div
@@ -17890,6 +17898,7 @@ exports[`Storyshots b/Button Loading 1`] = `
17890
17898
  </button>,
17891
17899
  <button
17892
17900
  className="base button x-yellow"
17901
+ disabled={true}
17893
17902
  type="button"
17894
17903
  >
17895
17904
  <div
@@ -17931,6 +17940,7 @@ exports[`Storyshots b/Button Loading 1`] = `
17931
17940
  </button>,
17932
17941
  <button
17933
17942
  className="base button x-seagreen"
17943
+ disabled={true}
17934
17944
  type="button"
17935
17945
  >
17936
17946
  <div
@@ -17972,6 +17982,7 @@ exports[`Storyshots b/Button Loading 1`] = `
17972
17982
  </button>,
17973
17983
  <button
17974
17984
  className="base button x-deepblue"
17985
+ disabled={true}
17975
17986
  type="button"
17976
17987
  >
17977
17988
  <div
@@ -18013,6 +18024,7 @@ exports[`Storyshots b/Button Loading 1`] = `
18013
18024
  </button>,
18014
18025
  <button
18015
18026
  className="base button x-light-blue"
18027
+ disabled={true}
18016
18028
  type="button"
18017
18029
  >
18018
18030
  <div
@@ -18054,6 +18066,7 @@ exports[`Storyshots b/Button Loading 1`] = `
18054
18066
  </button>,
18055
18067
  <button
18056
18068
  className="base button x-light-purple"
18069
+ disabled={true}
18057
18070
  type="button"
18058
18071
  >
18059
18072
  <div
@@ -18095,6 +18108,7 @@ exports[`Storyshots b/Button Loading 1`] = `
18095
18108
  </button>,
18096
18109
  <button
18097
18110
  className="base button x-light-seagreen"
18111
+ disabled={true}
18098
18112
  type="button"
18099
18113
  >
18100
18114
  <div
@@ -18136,6 +18150,7 @@ exports[`Storyshots b/Button Loading 1`] = `
18136
18150
  </button>,
18137
18151
  <button
18138
18152
  className="base button x-ui-main"
18153
+ disabled={true}
18139
18154
  type="button"
18140
18155
  >
18141
18156
  <div
@@ -18177,6 +18192,7 @@ exports[`Storyshots b/Button Loading 1`] = `
18177
18192
  </button>,
18178
18193
  <button
18179
18194
  className="base button x-ui-main-2"
18195
+ disabled={true}
18180
18196
  type="button"
18181
18197
  >
18182
18198
  <div
@@ -18218,6 +18234,7 @@ exports[`Storyshots b/Button Loading 1`] = `
18218
18234
  </button>,
18219
18235
  <button
18220
18236
  className="base button x-ui-lines"
18237
+ disabled={true}
18221
18238
  type="button"
18222
18239
  >
18223
18240
  <div
@@ -18259,6 +18276,7 @@ exports[`Storyshots b/Button Loading 1`] = `
18259
18276
  </button>,
18260
18277
  <button
18261
18278
  className="base button x-ui-icons"
18279
+ disabled={true}
18262
18280
  type="button"
18263
18281
  >
18264
18282
  <div
@@ -18300,6 +18318,7 @@ exports[`Storyshots b/Button Loading 1`] = `
18300
18318
  </button>,
18301
18319
  <button
18302
18320
  className="base button x-heading"
18321
+ disabled={true}
18303
18322
  type="button"
18304
18323
  >
18305
18324
  <div
@@ -18341,6 +18360,7 @@ exports[`Storyshots b/Button Loading 1`] = `
18341
18360
  </button>,
18342
18361
  <button
18343
18362
  className="base button x-paragraph"
18363
+ disabled={true}
18344
18364
  type="button"
18345
18365
  >
18346
18366
  <div
@@ -18382,6 +18402,7 @@ exports[`Storyshots b/Button Loading 1`] = `
18382
18402
  </button>,
18383
18403
  <button
18384
18404
  className="base button x-subtitle"
18405
+ disabled={true}
18385
18406
  type="button"
18386
18407
  >
18387
18408
  <div
@@ -18423,6 +18444,7 @@ exports[`Storyshots b/Button Loading 1`] = `
18423
18444
  </button>,
18424
18445
  <button
18425
18446
  className="base button x-metadata"
18447
+ disabled={true}
18426
18448
  type="button"
18427
18449
  >
18428
18450
  <div
@@ -18464,6 +18486,7 @@ exports[`Storyshots b/Button Loading 1`] = `
18464
18486
  </button>,
18465
18487
  <button
18466
18488
  className="base button x-link"
18489
+ disabled={true}
18467
18490
  type="button"
18468
18491
  >
18469
18492
  <div
@@ -18505,6 +18528,7 @@ exports[`Storyshots b/Button Loading 1`] = `
18505
18528
  </button>,
18506
18529
  <button
18507
18530
  className="base button x-disabled"
18531
+ disabled={true}
18508
18532
  type="button"
18509
18533
  >
18510
18534
  <div
@@ -18546,6 +18570,7 @@ exports[`Storyshots b/Button Loading 1`] = `
18546
18570
  </button>,
18547
18571
  <button
18548
18572
  className="base button x-shadow"
18573
+ disabled={true}
18549
18574
  type="button"
18550
18575
  >
18551
18576
  <div
@@ -18587,6 +18612,7 @@ exports[`Storyshots b/Button Loading 1`] = `
18587
18612
  </button>,
18588
18613
  <button
18589
18614
  className="base button x-transparent"
18615
+ disabled={true}
18590
18616
  type="button"
18591
18617
  >
18592
18618
  <div
@@ -18628,6 +18654,7 @@ exports[`Storyshots b/Button Loading 1`] = `
18628
18654
  </button>,
18629
18655
  <button
18630
18656
  className="base button x-highlighted"
18657
+ disabled={true}
18631
18658
  type="button"
18632
18659
  >
18633
18660
  <div
@@ -18669,6 +18696,7 @@ exports[`Storyshots b/Button Loading 1`] = `
18669
18696
  </button>,
18670
18697
  <button
18671
18698
  className="base button x-interactive"
18699
+ disabled={true}
18672
18700
  type="button"
18673
18701
  >
18674
18702
  <div
@@ -18710,6 +18738,7 @@ exports[`Storyshots b/Button Loading 1`] = `
18710
18738
  </button>,
18711
18739
  <button
18712
18740
  className="base button x-background-far"
18741
+ disabled={true}
18713
18742
  type="button"
18714
18743
  >
18715
18744
  <div
@@ -18751,6 +18780,7 @@ exports[`Storyshots b/Button Loading 1`] = `
18751
18780
  </button>,
18752
18781
  <button
18753
18782
  className="base button x-background-near"
18783
+ disabled={true}
18754
18784
  type="button"
18755
18785
  >
18756
18786
  <div
@@ -18792,6 +18822,7 @@ exports[`Storyshots b/Button Loading 1`] = `
18792
18822
  </button>,
18793
18823
  <button
18794
18824
  className="base button x-background-inputs"
18825
+ disabled={true}
18795
18826
  type="button"
18796
18827
  >
18797
18828
  <div
@@ -18833,6 +18864,7 @@ exports[`Storyshots b/Button Loading 1`] = `
18833
18864
  </button>,
18834
18865
  <button
18835
18866
  className="base button x-background-cards"
18867
+ disabled={true}
18836
18868
  type="button"
18837
18869
  >
18838
18870
  <div
@@ -18874,6 +18906,7 @@ exports[`Storyshots b/Button Loading 1`] = `
18874
18906
  </button>,
18875
18907
  <button
18876
18908
  className="base button x-background-mesh"
18909
+ disabled={true}
18877
18910
  type="button"
18878
18911
  >
18879
18912
  <div
@@ -18915,6 +18948,7 @@ exports[`Storyshots b/Button Loading 1`] = `
18915
18948
  </button>,
18916
18949
  <button
18917
18950
  className="base button x-outline-inputs"
18951
+ disabled={true}
18918
18952
  type="button"
18919
18953
  >
18920
18954
  <div
@@ -18956,6 +18990,7 @@ exports[`Storyshots b/Button Loading 1`] = `
18956
18990
  </button>,
18957
18991
  <button
18958
18992
  className="base button x-twitter"
18993
+ disabled={true}
18959
18994
  type="button"
18960
18995
  >
18961
18996
  <div
@@ -18997,6 +19032,7 @@ exports[`Storyshots b/Button Loading 1`] = `
18997
19032
  </button>,
18998
19033
  <button
18999
19034
  className="base button x-facebook"
19035
+ disabled={true}
19000
19036
  type="button"
19001
19037
  >
19002
19038
  <div
@@ -19038,6 +19074,7 @@ exports[`Storyshots b/Button Loading 1`] = `
19038
19074
  </button>,
19039
19075
  <button
19040
19076
  className="base button x-instagram"
19077
+ disabled={true}
19041
19078
  type="button"
19042
19079
  >
19043
19080
  <div
@@ -19079,6 +19116,7 @@ exports[`Storyshots b/Button Loading 1`] = `
19079
19116
  </button>,
19080
19117
  <button
19081
19118
  className="base button x-google"
19119
+ disabled={true}
19082
19120
  type="button"
19083
19121
  >
19084
19122
  <div
@@ -19120,6 +19158,7 @@ exports[`Storyshots b/Button Loading 1`] = `
19120
19158
  </button>,
19121
19159
  <button
19122
19160
  className="base button x-black"
19161
+ disabled={true}
19123
19162
  type="button"
19124
19163
  >
19125
19164
  <div
@@ -19161,6 +19200,7 @@ exports[`Storyshots b/Button Loading 1`] = `
19161
19200
  </button>,
19162
19201
  <button
19163
19202
  className="base button x-anchor"
19203
+ disabled={true}
19164
19204
  type="button"
19165
19205
  >
19166
19206
  <div
@@ -19202,6 +19242,7 @@ exports[`Storyshots b/Button Loading 1`] = `
19202
19242
  </button>,
19203
19243
  <button
19204
19244
  className="base button x-grey"
19245
+ disabled={true}
19205
19246
  type="button"
19206
19247
  >
19207
19248
  <div
@@ -19243,6 +19284,7 @@ exports[`Storyshots b/Button Loading 1`] = `
19243
19284
  </button>,
19244
19285
  <button
19245
19286
  className="base button x-pearl"
19287
+ disabled={true}
19246
19288
  type="button"
19247
19289
  >
19248
19290
  <div
@@ -19284,6 +19326,7 @@ exports[`Storyshots b/Button Loading 1`] = `
19284
19326
  </button>,
19285
19327
  <button
19286
19328
  className="base button x-white"
19329
+ disabled={true}
19287
19330
  type="button"
19288
19331
  >
19289
19332
  <div