@pareto-engineering/design-system 2.0.0-alpha.17 → 2.0.0-alpha.20

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.
@@ -6,7 +6,7 @@
6
6
 
7
7
  $default-padding: var(--u);
8
8
  $default-conversation-background: var(--y);
9
- $default-message-max-width: calc(100% - #{$default-padding});
9
+ $default-message-max-width: calc(100% - 4 * #{$default-padding});
10
10
  $default-message-min-width: 12em;
11
11
  $default-message-border: var(--theme-border);
12
12
  $triangle-border-size: 15px;
@@ -147,15 +147,3 @@ $triangle-after-side:25px;
147
147
  }
148
148
  }
149
149
  }
150
-
151
- //@keyframes fadeIn {
152
- // from {
153
- // opacity: 0;
154
- // transform: translate3d(0, 50%, 0);
155
- // }
156
- //
157
- // to {
158
- // opacity: 1;
159
- // transform: translate3d(0, 0, 0);
160
- // }
161
- //}
@@ -153,6 +153,12 @@ Object.defineProperty(exports, "OvalIllustration", {
153
153
  return _OvalIllustration.OvalIllustration;
154
154
  }
155
155
  });
156
+ Object.defineProperty(exports, "SnapScroller", {
157
+ enumerable: true,
158
+ get: function get() {
159
+ return _SnapScroller.SnapScroller;
160
+ }
161
+ });
156
162
  Object.defineProperty(exports, "BackgroundGradient", {
157
163
  enumerable: true,
158
164
  get: function get() {
@@ -204,4 +210,6 @@ var _Shapes = require("./Shapes");
204
210
 
205
211
  var _OvalIllustration = require("./OvalIllustration");
206
212
 
213
+ var _SnapScroller = require("./SnapScroller");
214
+
207
215
  var _BackgroundGradient = require("./BackgroundGradient");
@@ -59,7 +59,7 @@ var TextInput = _ref => {
59
59
  style: style // {...otherProps}
60
60
 
61
61
  }, /*#__PURE__*/React.createElement(_common.FormLabel, {
62
- className: ['input-label', oneInputLabel ? 'md-s2 s0 v1 mb-v' : 'v50 mb-v'].filter(e => e).join(' '),
62
+ className: [oneInputLabel ? 'md-s2 s0 v1 mb-v' : 'v50 mb-v'].filter(e => e).join(' '),
63
63
  name: name,
64
64
  color: labelColor
65
65
  }, label), /*#__PURE__*/React.createElement("input", _extends({
@@ -9,10 +9,6 @@ $default-padding: 0.75em 0.75em 0.55em;
9
9
  display: flex;
10
10
  flex-direction: column;
11
11
 
12
- .input-label {
13
- color: var(--main2);
14
- }
15
-
16
12
  .input {
17
13
  background: var(--light-background2);
18
14
  color: var(--on-background2);
@@ -43,7 +43,8 @@ var TextareaInput = _ref => {
43
43
  textAreaColor,
44
44
  labelColor,
45
45
  description,
46
- disabled // ...otherProps
46
+ disabled,
47
+ placeholder // ...otherProps
47
48
 
48
49
  } = _ref;
49
50
  (0, React.useLayoutEffect)(() => {
@@ -55,16 +56,18 @@ var TextareaInput = _ref => {
55
56
  });
56
57
  return /*#__PURE__*/React.createElement("div", {
57
58
  id: id,
58
- className: [baseClassName, componentClassName, userClassName, "x-".concat(textAreaColor), "y-".concat(labelColor)].filter(e => e).join(' '),
59
+ className: [baseClassName, componentClassName, userClassName, "x-".concat(textAreaColor)].filter(e => e).join(' '),
59
60
  style: style // {...otherProps}
60
61
 
61
62
  }, /*#__PURE__*/React.createElement(_common.FormLabel, {
62
- className: ['c-y', labelAsDescription ? 'md-s2 s0 v1 mb-v' : 'v50 mb-v'].filter(e => e).join(' '),
63
- name: name
63
+ className: [labelAsDescription ? 'md-s2 s0 v1 mb-v' : 'v50 mb-v'].filter(e => e).join(' '),
64
+ name: name,
65
+ color: labelColor
64
66
  }, label), /*#__PURE__*/React.createElement("textarea", _extends({
65
67
  id: textAreaId,
66
68
  className: "textarea v50 pv-v ".concat(meta.touched && meta.error ? 'input-border-error' : 'input-border')
67
69
  }, field, {
70
+ placeholder: placeholder,
68
71
  rows: rows,
69
72
  disabled: disabled
70
73
  })), (description || meta.touched && meta.error) && /*#__PURE__*/React.createElement(_common.FormDescription, {
@@ -137,12 +140,16 @@ TextareaInput.propTypes = {
137
140
  /**
138
141
  * Whether the text area should be disabled
139
142
  */
140
- disabled: _propTypes.default.bool
143
+ disabled: _propTypes.default.bool,
144
+
145
+ /**
146
+ * The textarea placeholder text
147
+ */
148
+ placeholder: _propTypes.default.string
141
149
  };
142
150
  TextareaInput.defaultProps = {
143
151
  rows: 3,
144
152
  textAreaColor: 'background1',
145
- labelColor: 'main2',
146
153
  disabled: false
147
154
  };
148
155
 
@@ -6,7 +6,7 @@
6
6
 
7
7
  $default-padding: var(--u);
8
8
  $default-conversation-background: var(--y);
9
- $default-message-max-width: calc(100% - #{$default-padding});
9
+ $default-message-max-width: calc(100% - 4 * #{$default-padding});
10
10
  $default-message-min-width: 12em;
11
11
  $default-message-border: var(--theme-border);
12
12
  $triangle-border-size: 15px;
@@ -147,15 +147,3 @@ $triangle-after-side:25px;
147
147
  }
148
148
  }
149
149
  }
150
-
151
- //@keyframes fadeIn {
152
- // from {
153
- // opacity: 0;
154
- // transform: translate3d(0, 50%, 0);
155
- // }
156
- //
157
- // to {
158
- // opacity: 1;
159
- // transform: translate3d(0, 0, 0);
160
- // }
161
- //}
@@ -20,4 +20,5 @@ export { DotInfo } from "./DotInfo";
20
20
  export { Timestamp } from "./Timestamp";
21
21
  export { Shapes } from "./Shapes";
22
22
  export { OvalIllustration } from "./OvalIllustration";
23
+ export { SnapScroller } from "./SnapScroller";
23
24
  export { BackgroundGradient } from "./BackgroundGradient";
@@ -42,7 +42,7 @@ const TextInput = ({
42
42
  style: style // {...otherProps}
43
43
 
44
44
  }, /*#__PURE__*/React.createElement(FormLabel, {
45
- className: ['input-label', oneInputLabel ? 'md-s2 s0 v1 mb-v' : 'v50 mb-v'].filter(e => e).join(' '),
45
+ className: [oneInputLabel ? 'md-s2 s0 v1 mb-v' : 'v50 mb-v'].filter(e => e).join(' '),
46
46
  name: name,
47
47
  color: labelColor
48
48
  }, label), /*#__PURE__*/React.createElement("input", _extends({
@@ -9,10 +9,6 @@ $default-padding: 0.75em 0.75em 0.55em;
9
9
  display: flex;
10
10
  flex-direction: column;
11
11
 
12
- .input-label {
13
- color: var(--main2);
14
- }
15
-
16
12
  .input {
17
13
  background: var(--light-background2);
18
14
  color: var(--on-background2);
@@ -27,7 +27,8 @@ const TextareaInput = ({
27
27
  textAreaColor,
28
28
  labelColor,
29
29
  description,
30
- disabled // ...otherProps
30
+ disabled,
31
+ placeholder // ...otherProps
31
32
 
32
33
  }) => {
33
34
  useLayoutEffect(() => {
@@ -39,16 +40,18 @@ const TextareaInput = ({
39
40
  });
40
41
  return /*#__PURE__*/React.createElement("div", {
41
42
  id: id,
42
- className: [baseClassName, componentClassName, userClassName, `x-${textAreaColor}`, `y-${labelColor}`].filter(e => e).join(' '),
43
+ className: [baseClassName, componentClassName, userClassName, `x-${textAreaColor}`].filter(e => e).join(' '),
43
44
  style: style // {...otherProps}
44
45
 
45
46
  }, /*#__PURE__*/React.createElement(FormLabel, {
46
- className: ['c-y', labelAsDescription ? 'md-s2 s0 v1 mb-v' : 'v50 mb-v'].filter(e => e).join(' '),
47
- name: name
47
+ className: [labelAsDescription ? 'md-s2 s0 v1 mb-v' : 'v50 mb-v'].filter(e => e).join(' '),
48
+ name: name,
49
+ color: labelColor
48
50
  }, label), /*#__PURE__*/React.createElement("textarea", _extends({
49
51
  id: textAreaId,
50
52
  className: `textarea v50 pv-v ${meta.touched && meta.error ? 'input-border-error' : 'input-border'}`
51
53
  }, field, {
54
+ placeholder: placeholder,
52
55
  rows: rows,
53
56
  disabled: disabled
54
57
  })), (description || meta.touched && meta.error) && /*#__PURE__*/React.createElement(FormDescription, {
@@ -121,12 +124,16 @@ TextareaInput.propTypes = {
121
124
  /**
122
125
  * Whether the text area should be disabled
123
126
  */
124
- disabled: PropTypes.bool
127
+ disabled: PropTypes.bool,
128
+
129
+ /**
130
+ * The textarea placeholder text
131
+ */
132
+ placeholder: PropTypes.string
125
133
  };
126
134
  TextareaInput.defaultProps = {
127
135
  rows: 3,
128
136
  textAreaColor: 'background1',
129
- labelColor: 'main2',
130
137
  disabled: false
131
138
  };
132
139
  export default /*#__PURE__*/memo(TextareaInput);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pareto-engineering/design-system",
3
- "version": "2.0.0-alpha.17",
3
+ "version": "2.0.0-alpha.20",
4
4
  "description": "",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/es/index.js",
@@ -1871,6 +1871,160 @@ exports[`Storyshots a/Shapes Triangle 1`] = `
1871
1871
 
1872
1872
  exports[`Storyshots a/SiteContext Base 1`] = `"Sample SiteContext"`;
1873
1873
 
1874
+ exports[`Storyshots a/SnapScroller Base 1`] = `
1875
+ <div
1876
+ className="base snap-scroller u1 pv-u"
1877
+ style={
1878
+ Object {
1879
+ "background": "var(--background4)",
1880
+ }
1881
+ }
1882
+ >
1883
+ <div
1884
+ className="card"
1885
+ style={
1886
+ Object {
1887
+ "background": "var(--background1)",
1888
+ "height": "400px",
1889
+ "minWidth": "330px",
1890
+ "padding": "var(--u)",
1891
+ }
1892
+ }
1893
+ >
1894
+ Some content here
1895
+ </div>
1896
+ <div
1897
+ className="card"
1898
+ style={
1899
+ Object {
1900
+ "background": "var(--background1)",
1901
+ "height": "400px",
1902
+ "minWidth": "330px",
1903
+ "padding": "var(--u)",
1904
+ }
1905
+ }
1906
+ >
1907
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam quis ornare lacus. Maecenas eu mollis erat. Donec pretium blandit vulputate. Fusce scelerisque nibh non euismod condimentum. Aenean non neque sem.
1908
+ </div>
1909
+ <div
1910
+ className="card"
1911
+ style={
1912
+ Object {
1913
+ "background": "var(--background1)",
1914
+ "height": "400px",
1915
+ "minWidth": "330px",
1916
+ "padding": "var(--u)",
1917
+ }
1918
+ }
1919
+ >
1920
+ Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Phasellus pretium feugiat lorem nec varius.
1921
+ </div>
1922
+ <div
1923
+ className="card"
1924
+ style={
1925
+ Object {
1926
+ "background": "var(--background1)",
1927
+ "height": "400px",
1928
+ "minWidth": "330px",
1929
+ "padding": "var(--u)",
1930
+ }
1931
+ }
1932
+ >
1933
+ Nam quis enim egestas, posuere felis ut, egestas tellus. Nulla facilisi. Pellentesque euismod bibendum ex ac euismod. Etiam rutrum quam nec nisi bibendum, sodales facilisis nunc dapibus. Nullam molestie magna efficitur dapibus pharetra.
1934
+ </div>
1935
+ <div
1936
+ className="card"
1937
+ style={
1938
+ Object {
1939
+ "background": "var(--background1)",
1940
+ "height": "400px",
1941
+ "minWidth": "330px",
1942
+ "padding": "var(--u)",
1943
+ }
1944
+ }
1945
+ >
1946
+ Sed quis lacinia lacus. Nam id faucibus nisi, quis imperdiet erat. Sed ac iaculis elit.
1947
+ </div>
1948
+ </div>
1949
+ `;
1950
+
1951
+ exports[`Storyshots a/SnapScroller No Scroll On Desktop 1`] = `
1952
+ <div
1953
+ className="base snap-scroller u1 pv-u desktop-no-scroll"
1954
+ style={
1955
+ Object {
1956
+ "background": "var(--background4)",
1957
+ }
1958
+ }
1959
+ >
1960
+ <div
1961
+ className="card"
1962
+ style={
1963
+ Object {
1964
+ "background": "var(--background1)",
1965
+ "height": "400px",
1966
+ "padding": "var(--u)",
1967
+ "width": "330px",
1968
+ }
1969
+ }
1970
+ >
1971
+ Some content here
1972
+ </div>
1973
+ <div
1974
+ className="card"
1975
+ style={
1976
+ Object {
1977
+ "background": "var(--background1)",
1978
+ "height": "400px",
1979
+ "padding": "var(--u)",
1980
+ "width": "330px",
1981
+ }
1982
+ }
1983
+ >
1984
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam quis ornare lacus. Maecenas eu mollis erat. Donec pretium blandit vulputate. Fusce scelerisque nibh non euismod condimentum. Aenean non neque sem.
1985
+ </div>
1986
+ <div
1987
+ className="card"
1988
+ style={
1989
+ Object {
1990
+ "background": "var(--background1)",
1991
+ "height": "400px",
1992
+ "padding": "var(--u)",
1993
+ "width": "330px",
1994
+ }
1995
+ }
1996
+ >
1997
+ Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Phasellus pretium feugiat lorem nec varius.
1998
+ </div>
1999
+ <div
2000
+ className="card"
2001
+ style={
2002
+ Object {
2003
+ "background": "var(--background1)",
2004
+ "height": "400px",
2005
+ "padding": "var(--u)",
2006
+ "width": "330px",
2007
+ }
2008
+ }
2009
+ >
2010
+ Nam quis enim egestas, posuere felis ut, egestas tellus. Nulla facilisi. Pellentesque euismod bibendum ex ac euismod. Etiam rutrum quam nec nisi bibendum, sodales facilisis nunc dapibus. Nullam molestie magna efficitur dapibus pharetra.
2011
+ </div>
2012
+ <div
2013
+ className="card"
2014
+ style={
2015
+ Object {
2016
+ "background": "var(--background1)",
2017
+ "height": "400px",
2018
+ "padding": "var(--u)",
2019
+ "width": "330px",
2020
+ }
2021
+ }
2022
+ >
2023
+ Sed quis lacinia lacus. Nam id faucibus nisi, quis imperdiet erat. Sed ac iaculis elit.
2024
+ </div>
2025
+ </div>
2026
+ `;
2027
+
1874
2028
  exports[`Storyshots a/Spinner Base 1`] = `
1875
2029
  <div
1876
2030
  className="y-background1 b-y"
@@ -9130,7 +9284,7 @@ exports[`Storyshots f/FormInput Base 1`] = `
9130
9284
  className="base text-input form-input"
9131
9285
  >
9132
9286
  <label
9133
- className="base label input-label v50 mb-v x-main2"
9287
+ className="base label v50 mb-v x-main2"
9134
9288
  htmlFor="firstName"
9135
9289
  >
9136
9290
  What's your first name ?
@@ -9150,7 +9304,7 @@ exports[`Storyshots f/FormInput Base 1`] = `
9150
9304
  className="base text-input form-input"
9151
9305
  >
9152
9306
  <label
9153
- className="base label input-label v50 mb-v x-main2"
9307
+ className="base label v50 mb-v x-main2"
9154
9308
  htmlFor="lastName"
9155
9309
  >
9156
9310
  What's your last name ?
@@ -9166,10 +9320,10 @@ exports[`Storyshots f/FormInput Base 1`] = `
9166
9320
  />
9167
9321
  </div>
9168
9322
  <div
9169
- className="base text-area-input form-input x-background1 y-main2"
9323
+ className="base text-area-input form-input x-background1"
9170
9324
  >
9171
9325
  <label
9172
- className="base label c-y v50 mb-v x-main2"
9326
+ className="base label v50 mb-v x-main2"
9173
9327
  htmlFor="description"
9174
9328
  >
9175
9329
  Describe yourself in a few sentences
@@ -9319,7 +9473,7 @@ exports[`Storyshots f/FormInput Disabled Form Input 1`] = `
9319
9473
  className="base text-input form-input"
9320
9474
  >
9321
9475
  <label
9322
- className="base label input-label v50 mb-v x-main2"
9476
+ className="base label v50 mb-v x-main2"
9323
9477
  htmlFor="firstName"
9324
9478
  >
9325
9479
  What's your first name ?
@@ -9339,7 +9493,7 @@ exports[`Storyshots f/FormInput Disabled Form Input 1`] = `
9339
9493
  className="base text-input form-input"
9340
9494
  >
9341
9495
  <label
9342
- className="base label input-label v50 mb-v x-main2"
9496
+ className="base label v50 mb-v x-main2"
9343
9497
  htmlFor="lastName"
9344
9498
  >
9345
9499
  What's your last name ?
@@ -9355,10 +9509,10 @@ exports[`Storyshots f/FormInput Disabled Form Input 1`] = `
9355
9509
  />
9356
9510
  </div>
9357
9511
  <div
9358
- className="base text-area-input form-input x-background1 y-main2"
9512
+ className="base text-area-input form-input x-background1"
9359
9513
  >
9360
9514
  <label
9361
- className="base label c-y v50 mb-v x-main2"
9515
+ className="base label v50 mb-v x-main2"
9362
9516
  htmlFor="description"
9363
9517
  >
9364
9518
  Describe yourself in a few sentences
@@ -9508,7 +9662,7 @@ exports[`Storyshots f/FormInput Extensible Form Input 1`] = `
9508
9662
  className="base text-input form-input"
9509
9663
  >
9510
9664
  <label
9511
- className="base label input-label v50 mb-v x-main2"
9665
+ className="base label v50 mb-v x-main2"
9512
9666
  htmlFor="extended"
9513
9667
  >
9514
9668
  Extended type input
@@ -11483,7 +11637,7 @@ exports[`Storyshots f/fields/TextInput Base 1`] = `
11483
11637
  className="base text-input"
11484
11638
  >
11485
11639
  <label
11486
- className="base label input-label v50 mb-v x-main2"
11640
+ className="base label v50 mb-v x-main2"
11487
11641
  htmlFor="firstName"
11488
11642
  >
11489
11643
  What's your first name ?
@@ -11527,7 +11681,7 @@ exports[`Storyshots f/fields/TextInput Date Time 1`] = `
11527
11681
  className="base text-input"
11528
11682
  >
11529
11683
  <label
11530
- className="base label input-label v50 mb-v x-main2"
11684
+ className="base label v50 mb-v x-main2"
11531
11685
  htmlFor="date"
11532
11686
  >
11533
11687
  Select date
@@ -11547,7 +11701,7 @@ exports[`Storyshots f/fields/TextInput Date Time 1`] = `
11547
11701
  className="base text-input"
11548
11702
  >
11549
11703
  <label
11550
- className="base label input-label v50 mb-v x-main2"
11704
+ className="base label v50 mb-v x-main2"
11551
11705
  htmlFor="time"
11552
11706
  >
11553
11707
  Select time
@@ -11591,7 +11745,7 @@ exports[`Storyshots f/fields/TextInput Disabled Text Input 1`] = `
11591
11745
  className="base text-input"
11592
11746
  >
11593
11747
  <label
11594
- className="base label input-label v50 mb-v x-main2"
11748
+ className="base label v50 mb-v x-main2"
11595
11749
  htmlFor="firstName"
11596
11750
  >
11597
11751
  What's your first name ?
@@ -11624,7 +11778,7 @@ exports[`Storyshots f/fields/TextInput Text Input With Place Holder 1`] = `
11624
11778
  className="base text-input"
11625
11779
  >
11626
11780
  <label
11627
- className="base label input-label v50 mb-v x-main2"
11781
+ className="base label v50 mb-v x-main2"
11628
11782
  htmlFor="firstName"
11629
11783
  >
11630
11784
  What's your first name ?
@@ -11655,18 +11809,18 @@ exports[`Storyshots f/fields/TextareaInput Base 1`] = `
11655
11809
  className="y-background1 b-dark-y"
11656
11810
  >
11657
11811
  <div
11658
- className="base text-area-input x-background1 y-main2"
11812
+ className="base text-area-input x-background1"
11659
11813
  >
11660
11814
  <label
11661
- className="base label c-y v50 mb-v x-main2"
11662
- htmlFor="feedBack"
11815
+ className="base label v50 mb-v x-main2"
11816
+ htmlFor="feedback"
11663
11817
  >
11664
11818
  What can we improve on?
11665
11819
  </label>
11666
11820
  <textarea
11667
11821
  className="textarea v50 pv-v input-border"
11668
11822
  disabled={false}
11669
- name="feedBack"
11823
+ name="feedback"
11670
11824
  onBlur={[Function]}
11671
11825
  onChange={[Function]}
11672
11826
  rows={3}
@@ -11689,7 +11843,7 @@ exports[`Storyshots f/fields/TextareaInput Base 1`] = `
11689
11843
  </form>
11690
11844
  `;
11691
11845
 
11692
- exports[`Storyshots f/fields/TextareaInput Disabled Textarea Input 1`] = `
11846
+ exports[`Storyshots f/fields/TextareaInput Disabled 1`] = `
11693
11847
  <form
11694
11848
  action="#"
11695
11849
  onReset={[Function]}
@@ -11699,20 +11853,110 @@ exports[`Storyshots f/fields/TextareaInput Disabled Textarea Input 1`] = `
11699
11853
  className="y-background1 b-dark-y"
11700
11854
  >
11701
11855
  <div
11702
- className="base text-area-input x-background1 y-main2"
11856
+ className="base text-area-input x-background1"
11703
11857
  >
11704
11858
  <label
11705
- className="base label c-y v50 mb-v x-main2"
11706
- htmlFor="feedBack"
11859
+ className="base label v50 mb-v x-main2"
11860
+ htmlFor="feedback"
11707
11861
  >
11708
11862
  What can we improve on?
11709
11863
  </label>
11710
11864
  <textarea
11711
11865
  className="textarea v50 pv-v input-border"
11712
11866
  disabled={true}
11713
- name="feedBack"
11867
+ name="feedback"
11868
+ onBlur={[Function]}
11869
+ onChange={[Function]}
11870
+ rows={3}
11871
+ value=""
11872
+ />
11873
+
11874
+ </div>
11875
+ <div
11876
+ className="debugger"
11877
+ >
11878
+ <button
11879
+ className="base button x-main2"
11880
+ onClick={[Function]}
11881
+ type="button"
11882
+ >
11883
+ Open FormDebugger
11884
+ </button>
11885
+ </div>
11886
+ </div>
11887
+ </form>
11888
+ `;
11889
+
11890
+ exports[`Storyshots f/fields/TextareaInput Placeholder 1`] = `
11891
+ <form
11892
+ action="#"
11893
+ onReset={[Function]}
11894
+ onSubmit={[Function]}
11895
+ >
11896
+ <div
11897
+ className="y-background1 b-dark-y"
11898
+ >
11899
+ <div
11900
+ className="base text-area-input x-background1"
11901
+ >
11902
+ <label
11903
+ className="base label v50 mb-v x-main2"
11904
+ htmlFor="feedback"
11905
+ >
11906
+ What can we improve on?
11907
+ </label>
11908
+ <textarea
11909
+ className="textarea v50 pv-v input-border"
11910
+ disabled={false}
11911
+ name="feedback"
11912
+ onBlur={[Function]}
11913
+ onChange={[Function]}
11914
+ placeholder="Type your feedback here..."
11915
+ rows={3}
11916
+ value=""
11917
+ />
11918
+
11919
+ </div>
11920
+ <div
11921
+ className="debugger"
11922
+ >
11923
+ <button
11924
+ className="base button x-main2"
11925
+ onClick={[Function]}
11926
+ type="button"
11927
+ >
11928
+ Open FormDebugger
11929
+ </button>
11930
+ </div>
11931
+ </div>
11932
+ </form>
11933
+ `;
11934
+
11935
+ exports[`Storyshots f/fields/TextareaInput Validation 1`] = `
11936
+ <form
11937
+ action="#"
11938
+ onReset={[Function]}
11939
+ onSubmit={[Function]}
11940
+ >
11941
+ <div
11942
+ className="y-background1 b-dark-y"
11943
+ >
11944
+ <div
11945
+ className="base text-area-input x-background1"
11946
+ >
11947
+ <label
11948
+ className="base label v50 mb-v x-main2"
11949
+ htmlFor="feedback"
11950
+ >
11951
+ What can we improve on?
11952
+ </label>
11953
+ <textarea
11954
+ className="textarea v50 pv-v input-border"
11955
+ disabled={false}
11956
+ name="feedback"
11714
11957
  onBlur={[Function]}
11715
11958
  onChange={[Function]}
11959
+ placeholder="Type your feedback here..."
11716
11960
  rows={3}
11717
11961
  value=""
11718
11962
  />
@@ -0,0 +1,98 @@
1
+ /* @pareto-engineering/generator-front 1.0.12 */
2
+ import * as React from 'react'
3
+
4
+ import { SnapScroller } from 'ui'
5
+
6
+ export default {
7
+ title :'a/SnapScroller',
8
+ component :SnapScroller,
9
+ subcomponents:{
10
+ // Item:SnapScroller.Item
11
+ },
12
+ decorators:[
13
+ // storyfn => <div className="">{ storyfn() }</div>,
14
+ ],
15
+ argTypes:{
16
+ backgroundColor:{ control: 'color' },
17
+ },
18
+ }
19
+
20
+ export const Base = () => {
21
+ // eslint-disable-next-line react/prop-types
22
+ const Card = ({ children }) => (
23
+ <div
24
+ className="card"
25
+ style={{
26
+ background:'var(--background1)', minWidth:'330px', height:'400px', padding:'var(--u)',
27
+ }}
28
+ >
29
+ { children }
30
+ </div>
31
+
32
+ )
33
+
34
+ return (
35
+ <SnapScroller style={{ background: 'var(--background4)' }} className="u1 pv-u">
36
+ <Card>
37
+ Some content here
38
+ </Card>
39
+ <Card>
40
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam quis ornare lacus.
41
+ Maecenas eu mollis erat. Donec pretium blandit vulputate. Fusce scelerisque nibh
42
+ non euismod condimentum. Aenean non neque sem.
43
+ </Card>
44
+ <Card>
45
+ Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae;
46
+ Phasellus pretium feugiat lorem nec varius.
47
+ </Card>
48
+ <Card>
49
+ Nam quis enim egestas, posuere felis ut, egestas tellus. Nulla facilisi.
50
+ Pellentesque euismod bibendum ex ac euismod. Etiam rutrum quam nec nisi bibendum,
51
+ sodales facilisis nunc dapibus. Nullam molestie magna efficitur dapibus pharetra.
52
+ </Card>
53
+ <Card>
54
+ Sed quis lacinia lacus. Nam id faucibus nisi, quis imperdiet erat. Sed ac iaculis elit.
55
+ </Card>
56
+ </SnapScroller>
57
+ )
58
+ }
59
+
60
+ export const NoScrollOnDesktop = () => {
61
+ // eslint-disable-next-line react/prop-types
62
+ const Card = ({ children }) => (
63
+ <div
64
+ className="card"
65
+ style={{
66
+ background:'var(--background1)', width:'330px', height:'400px', padding:'var(--u)',
67
+ }}
68
+ >
69
+ { children }
70
+ </div>
71
+
72
+ )
73
+
74
+ return (
75
+ <SnapScroller style={{ background: 'var(--background4)' }} className="u1 pv-u" noScrollOnDesktop>
76
+ <Card>
77
+ Some content here
78
+ </Card>
79
+ <Card>
80
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam quis ornare lacus.
81
+ Maecenas eu mollis erat. Donec pretium blandit vulputate. Fusce scelerisque nibh
82
+ non euismod condimentum. Aenean non neque sem.
83
+ </Card>
84
+ <Card>
85
+ Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae;
86
+ Phasellus pretium feugiat lorem nec varius.
87
+ </Card>
88
+ <Card>
89
+ Nam quis enim egestas, posuere felis ut, egestas tellus. Nulla facilisi. Pellentesque
90
+ euismod bibendum ex ac euismod. Etiam rutrum quam nec nisi bibendum, sodales facilisis
91
+ nunc dapibus. Nullam molestie magna efficitur dapibus pharetra.
92
+ </Card>
93
+ <Card>
94
+ Sed quis lacinia lacus. Nam id faucibus nisi, quis imperdiet erat. Sed ac iaculis elit.
95
+ </Card>
96
+ </SnapScroller>
97
+ )
98
+ }
@@ -14,7 +14,7 @@ export default {
14
14
  decorators:[
15
15
  (storyfn) => (
16
16
  <Formik
17
- initialValues={{ feedBack: '' }}
17
+ initialValues={{ feedback: '' }}
18
18
  >
19
19
  <Form>
20
20
 
@@ -31,16 +31,52 @@ export default {
31
31
  export const Base = () => (
32
32
  <div className="y-background1 b-dark-y">
33
33
  <TextareaInput
34
- name="feedBack"
34
+ name="feedback"
35
35
  label="What can we improve on?"
36
36
  />
37
37
  <FormDebugger />
38
38
  </div>
39
39
  )
40
- export const DisabledTextareaInput = () => (
40
+
41
+ export const Placeholder = () => (
42
+ <div className="y-background1 b-dark-y">
43
+ <TextareaInput
44
+ name="feedback"
45
+ label="What can we improve on?"
46
+ placeholder="Type your feedback here..."
47
+ />
48
+ <FormDebugger />
49
+ </div>
50
+ )
51
+
52
+ export const Validation = () => {
53
+ const validate = (value) => {
54
+ let errorMessage = ''
55
+ const isValid = value.length > 3
56
+
57
+ if (!isValid) {
58
+ errorMessage = 'Value should be greater than 3 characters'
59
+ }
60
+ return errorMessage
61
+ }
62
+
63
+ return (
64
+ <div className="y-background1 b-dark-y">
65
+ <TextareaInput
66
+ name="feedback"
67
+ label="What can we improve on?"
68
+ placeholder="Type your feedback here..."
69
+ validate={validate}
70
+ />
71
+ <FormDebugger />
72
+ </div>
73
+ )
74
+ }
75
+
76
+ export const Disabled = () => (
41
77
  <div className="y-background1 b-dark-y">
42
78
  <TextareaInput
43
- name="feedBack"
79
+ name="feedback"
44
80
  label="What can we improve on?"
45
81
  disabled
46
82
  />
@@ -6,7 +6,7 @@
6
6
 
7
7
  $default-padding: var(--u);
8
8
  $default-conversation-background: var(--y);
9
- $default-message-max-width: calc(100% - #{$default-padding});
9
+ $default-message-max-width: calc(100% - 4 * #{$default-padding});
10
10
  $default-message-min-width: 12em;
11
11
  $default-message-border: var(--theme-border);
12
12
  $triangle-border-size: 15px;
@@ -147,15 +147,3 @@ $triangle-after-side:25px;
147
147
  }
148
148
  }
149
149
  }
150
-
151
- //@keyframes fadeIn {
152
- // from {
153
- // opacity: 0;
154
- // transform: translate3d(0, 50%, 0);
155
- // }
156
- //
157
- // to {
158
- // opacity: 1;
159
- // transform: translate3d(0, 0, 0);
160
- // }
161
- //}
@@ -0,0 +1,83 @@
1
+ /* @pareto-engineering/generator-front 1.0.12 */
2
+ import * as React from 'react'
3
+
4
+ import { useLayoutEffect } from 'react'
5
+
6
+ import PropTypes from 'prop-types'
7
+
8
+ import styleNames from '@pareto-engineering/bem'
9
+
10
+ // Local Definitions
11
+
12
+ const baseClassName = styleNames.base
13
+
14
+ const componentClassName = 'snap-scroller'
15
+
16
+ /**
17
+ * This is the component description.
18
+ */
19
+ const SnapScroller = ({
20
+ id,
21
+ className:userClassName,
22
+ style,
23
+ children,
24
+ noScrollOnDesktop,
25
+ // ...otherProps
26
+ }) => {
27
+ useLayoutEffect(() => {
28
+ import('./styles.scss')
29
+ }, [])
30
+
31
+ return (
32
+ <div
33
+ id={id}
34
+ className={[
35
+
36
+ baseClassName,
37
+
38
+ componentClassName,
39
+ userClassName,
40
+ noScrollOnDesktop && 'desktop-no-scroll',
41
+ ]
42
+ .filter((e) => e)
43
+ .join(' ')}
44
+ style={style}
45
+ // {...otherProps}
46
+ >
47
+ {children}
48
+ </div>
49
+ )
50
+ }
51
+
52
+ SnapScroller.propTypes = {
53
+ /**
54
+ * The HTML id for this element
55
+ */
56
+ id:PropTypes.string,
57
+
58
+ /**
59
+ * The HTML class names for this element
60
+ */
61
+ className:PropTypes.string,
62
+
63
+ /**
64
+ * The React-written, css properties for this element.
65
+ */
66
+ style:PropTypes.objectOf(PropTypes.string),
67
+
68
+ /**
69
+ * The children JSX
70
+ */
71
+ children:PropTypes.node,
72
+
73
+ /**
74
+ * Whether to snap scroll on desktop (false will enable a flexbox)
75
+ */
76
+ noScrollOnDesktop:PropTypes.bool,
77
+ }
78
+
79
+ SnapScroller.defaultProps = {
80
+ noScrollOnDesktop:false,
81
+ }
82
+
83
+ export default SnapScroller
@@ -0,0 +1,2 @@
1
+ /* @pareto-engineering/generator-front 1.0.12 */
2
+ export { default as SnapScroller } from './SnapScroller'
@@ -0,0 +1,38 @@
1
+ /* @pareto-engineering/generator-front 1.0.12 */
2
+
3
+ @use "@pareto-engineering/bem";
4
+ @use "@aztlan/stylebook/src/mixins";
5
+ @use "@aztlan/stylebook/src/globals" as *;
6
+
7
+ $default-spacing:var(--spacing, var(--u));
8
+
9
+ .#{bem.$base}.snap-scroller {
10
+ display: flex;
11
+ -ms-overflow-style: none; /* for Internet Explorer, Edge */
12
+ overflow-x: auto;
13
+ scroll-padding: calc(#{$default-spacing} *2);
14
+ scroll-snap-type: x mandatory;
15
+ scrollbar-width: none;
16
+
17
+
18
+ > * {
19
+ &:first-child {
20
+ margin-left: $default-spacing;
21
+ }
22
+ display: inline-block;
23
+ margin-right: $default-spacing;
24
+ scroll-snap-align: start;
25
+ }
26
+
27
+
28
+ @include mixins.media($from:$sm-md) {
29
+ &.desktop-no-scroll {
30
+ overflow: auto;
31
+ -ms-overflow-style: unset; /* for Internet Explorer, Edge */
32
+ scroll-snap-type: none;
33
+ scrollbar-width: unset;
34
+ }
35
+ }
36
+ }
37
+
38
+
package/src/ui/a/index.js CHANGED
@@ -25,4 +25,5 @@ export { DotInfo } from './DotInfo'
25
25
  export { Timestamp } from './Timestamp'
26
26
  export { Shapes } from './Shapes'
27
27
  export { OvalIllustration } from './OvalIllustration'
28
+ export { SnapScroller } from './SnapScroller'
28
29
  export { BackgroundGradient } from './BackgroundGradient'
@@ -55,8 +55,7 @@ const TextInput = ({
55
55
  // {...otherProps}
56
56
  >
57
57
  <FormLabel
58
- className={[
59
- 'input-label', oneInputLabel ? 'md-s2 s0 v1 mb-v' : 'v50 mb-v']
58
+ className={[oneInputLabel ? 'md-s2 s0 v1 mb-v' : 'v50 mb-v']
60
59
  .filter((e) => e)
61
60
  .join(' ')}
62
61
  name={name}
@@ -9,10 +9,6 @@ $default-padding: 0.75em 0.75em 0.55em;
9
9
  display: flex;
10
10
  flex-direction: column;
11
11
 
12
- .input-label {
13
- color: var(--main2);
14
- }
15
-
16
12
  .input {
17
13
  background: var(--light-background2);
18
14
  color: var(--on-background2);
@@ -34,6 +34,7 @@ const TextareaInput = ({
34
34
  labelColor,
35
35
  description,
36
36
  disabled,
37
+ placeholder,
37
38
  // ...otherProps
38
39
  }) => {
39
40
  useLayoutEffect(() => {
@@ -52,7 +53,6 @@ const TextareaInput = ({
52
53
  componentClassName,
53
54
  userClassName,
54
55
  `x-${textAreaColor}`,
55
- `y-${labelColor}`,
56
56
  ]
57
57
  .filter((e) => e)
58
58
  .join(' ')}
@@ -60,11 +60,11 @@ const TextareaInput = ({
60
60
  // {...otherProps}
61
61
  >
62
62
  <FormLabel
63
- className={[
64
- 'c-y', labelAsDescription ? 'md-s2 s0 v1 mb-v' : 'v50 mb-v']
63
+ className={[labelAsDescription ? 'md-s2 s0 v1 mb-v' : 'v50 mb-v']
65
64
  .filter((e) => e)
66
65
  .join(' ')}
67
66
  name={name}
67
+ color={labelColor}
68
68
  >
69
69
  { label }
70
70
  </FormLabel>
@@ -72,6 +72,7 @@ const TextareaInput = ({
72
72
  id={textAreaId}
73
73
  className={`textarea v50 pv-v ${meta.touched && meta.error ? 'input-border-error' : 'input-border'}`}
74
74
  {...field}
75
+ placeholder={placeholder}
75
76
  rows={rows}
76
77
  disabled={disabled}
77
78
  >
@@ -123,36 +124,46 @@ TextareaInput.propTypes = {
123
124
  * If the text area depends on it's label's text as the default description
124
125
  */
125
126
  labelAsDescription:PropTypes.bool,
127
+
126
128
  /**
127
129
  * The textarea id
128
130
  */
129
- textAreaId :PropTypes.string,
131
+ textAreaId:PropTypes.string,
132
+
130
133
  /**
131
134
  * The number of rows int the text area
132
135
  */
133
- rows :PropTypes.number,
136
+ rows:PropTypes.number,
137
+
134
138
  /**
135
139
  * Text area base color
136
140
  */
137
- textAreaColor :PropTypes.string,
141
+ textAreaColor:PropTypes.string,
142
+
138
143
  /**
139
144
  * Label base color
140
145
  */
141
- labelColor :PropTypes.string,
146
+ labelColor:PropTypes.string,
147
+
142
148
  /**
143
149
  * Text area description
144
150
  */
145
- description :PropTypes.string,
151
+ description:PropTypes.string,
152
+
146
153
  /**
147
154
  * Whether the text area should be disabled
148
155
  */
149
- disabled :PropTypes.bool,
156
+ disabled:PropTypes.bool,
157
+
158
+ /**
159
+ * The textarea placeholder text
160
+ */
161
+ placeholder:PropTypes.string,
150
162
  }
151
163
 
152
164
  TextareaInput.defaultProps = {
153
165
  rows :3,
154
166
  textAreaColor:'background1',
155
- labelColor :'main2',
156
167
  disabled :false,
157
168
  }
158
169