@pareto-engineering/design-system 4.0.0-alpha.46 → 4.0.0-alpha.48

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 (30) hide show
  1. package/dist/cjs/a/SnapScroller/styles.scss +0 -1
  2. package/dist/cjs/a/Tip/Tip.js +19 -5
  3. package/dist/cjs/a/Tip/styles.scss +7 -13
  4. package/dist/cjs/b/Button/Button.js +1 -1
  5. package/dist/cjs/b/Card/common/Group/styles.scss +0 -3
  6. package/dist/cjs/b/SocialMediaButton/SocialMediaButton.js +5 -1
  7. package/dist/cjs/b/ThemeSelector/ThemeSelector.js +16 -14
  8. package/dist/cjs/b/ThemeSelector/styles.scss +46 -3
  9. package/dist/es/a/SnapScroller/styles.scss +0 -1
  10. package/dist/es/a/Tip/Tip.js +19 -5
  11. package/dist/es/a/Tip/styles.scss +7 -13
  12. package/dist/es/b/Button/Button.js +1 -1
  13. package/dist/es/b/Card/common/Group/styles.scss +0 -3
  14. package/dist/es/b/SocialMediaButton/SocialMediaButton.js +5 -1
  15. package/dist/es/b/ThemeSelector/ThemeSelector.js +16 -14
  16. package/dist/es/b/ThemeSelector/styles.scss +46 -3
  17. package/package.json +4 -4
  18. package/src/stories/a/AppContext.stories.jsx +2 -0
  19. package/src/stories/a/Tip.stories.jsx +3 -2
  20. package/src/stories/b/SocialMediaButton.stories.jsx +2 -0
  21. package/src/stories/b/ThemeSelector.stories.jsx +0 -4
  22. package/src/ui/a/SnapScroller/styles.scss +0 -1
  23. package/src/ui/a/Tip/Tip.jsx +21 -4
  24. package/src/ui/a/Tip/styles.scss +7 -13
  25. package/src/ui/b/Button/Button.jsx +1 -1
  26. package/src/ui/b/Card/common/Group/styles.scss +0 -3
  27. package/src/ui/b/SocialMediaButton/SocialMediaButton.jsx +5 -1
  28. package/src/ui/b/ThemeSelector/ThemeSelector.jsx +16 -11
  29. package/src/ui/b/ThemeSelector/styles.scss +46 -3
  30. package/tests/__snapshots__/Storyshots.test.js.snap +91 -49
@@ -21,7 +21,6 @@ $default-spacing: var(--gap);
21
21
  }
22
22
 
23
23
  >* {
24
- display: inline-block;
25
24
  scroll-snap-align: start;
26
25
 
27
26
  &:first-child {
@@ -24,8 +24,10 @@ const Tip = _ref => {
24
24
  className: userClassName,
25
25
  style,
26
26
  children,
27
+ icon,
27
28
  as: Wrapper,
28
- color
29
+ color,
30
+ backgroundColor
29
31
  // ...otherProps
30
32
  } = _ref;
31
33
  (0, React.useInsertionEffect)(() => {
@@ -33,10 +35,12 @@ const Tip = _ref => {
33
35
  }, []);
34
36
  return /*#__PURE__*/React.createElement(Wrapper, {
35
37
  id: id,
36
- className: [baseClassName, componentClassName, userClassName, `x-${color}`].filter(e => e).join(' '),
38
+ className: [baseClassName, componentClassName, userClassName, `x-${backgroundColor}`].filter(e => e).join(' '),
37
39
  style: style
38
40
  // {...otherProps}
39
- }, children);
41
+ }, /*#__PURE__*/React.createElement("span", {
42
+ className: `x-${color} c-x icon`
43
+ }, icon), children);
40
44
  };
41
45
  Tip.propTypes = {
42
46
  /**
@@ -56,9 +60,17 @@ Tip.propTypes = {
56
60
  */
57
61
  children: _propTypes.default.node.isRequired,
58
62
  /**
59
- * The color of the bar
63
+ * The icon
64
+ */
65
+ icon: _propTypes.default.string,
66
+ /**
67
+ * The color of the icon
60
68
  */
61
69
  color: _propTypes.default.string,
70
+ /**
71
+ * The background color
72
+ */
73
+ backgroundColor: _propTypes.default.string,
62
74
  /**
63
75
  * The wrapper html type
64
76
  */
@@ -66,7 +78,9 @@ Tip.propTypes = {
66
78
  };
67
79
  Tip.defaultProps = {
68
80
  as: 'p',
69
- color: 'main'
81
+ icon: ')',
82
+ color: 'interactive',
83
+ backgroundColor: 'background-near'
70
84
  };
71
85
  var _default = Tip;
72
86
  exports.default = _default;
@@ -4,19 +4,13 @@
4
4
  @use "@pareto-engineering/styles/src/mixins";
5
5
  @use "@pareto-engineering/styles/src/globals" as *;
6
6
 
7
- $default-bar-width: 2px;
8
- $default-padding: 1em;
7
+ $default-padding: calc(var(--gap) * 2);
9
8
 
10
9
  .#{bem.$base}.tip {
11
- padding-left: $default-padding;
12
- position: relative;
13
-
14
- &::before {
15
- background: var(--x);
16
- content: "";
17
- height: 100%;
18
- left: 0;
19
- position: absolute;
20
- width: $default-bar-width;
21
- }
10
+ align-items: center;
11
+ background: var(--x);
12
+ border-radius: var(--theme-default-border-radius);
13
+ display: flex;
14
+ gap: var(--gap);
15
+ padding: $default-padding;
22
16
  }
@@ -47,7 +47,7 @@ const Button = _ref => {
47
47
  type: "button"
48
48
  }, otherProps), isLoading ? /*#__PURE__*/React.createElement(_.LoadingCircle, {
49
49
  style: {
50
- '--x': 'var(--on-x)'
50
+ '--x': 'var(--stroke-color, var(--on-x))'
51
51
  },
52
52
  heightWidth: "1.15em"
53
53
  }) : buttonText);
@@ -23,9 +23,6 @@ $default-spacing: var(--gap);
23
23
  &.desktop-grid {
24
24
  display: grid;
25
25
  grid-template-columns: repeat(var(--columns), 1fr);
26
- }
27
-
28
- &.snap-scroller {
29
26
  margin-left: unset;
30
27
  margin-right: unset;
31
28
  }
@@ -32,6 +32,10 @@ const defaultsMap = {
32
32
  linkedin: {
33
33
  icon: 'l',
34
34
  link: 'LINKEDIN'
35
+ },
36
+ threads: {
37
+ icon: 'u',
38
+ link: 'THREADS'
35
39
  }
36
40
  };
37
41
 
@@ -57,7 +61,7 @@ const SocialMediaButton = _ref => {
57
61
  Promise.resolve().then(() => _interopRequireWildcard(require("./styles.scss")));
58
62
  }, []);
59
63
  const content = type && defaultsMap[type];
60
- const href = link || applicationContext?.SOCIAL?.[content.link];
64
+ const href = link || applicationContext?.SOCIAL?.[content?.link];
61
65
  return /*#__PURE__*/React.createElement("a", {
62
66
  href: href,
63
67
  target: "_blank",
@@ -37,20 +37,22 @@ const ThemeSelector = _ref => {
37
37
  const current = themes.indexOf(userTheme);
38
38
  setPreferredTheme(themes[(current + 1) % themes.length]);
39
39
  }, [userTheme]);
40
- const current = userTheme ? themes.indexOf(userTheme) : 0;
41
- const nextTheme = themes[(current + 1) % themes.length];
42
- const themeText = nextTheme && nextTheme.charAt(0).toUpperCase() + nextTheme.slice(1);
43
- return (
44
- /*#__PURE__*/
45
- // eslint-disable-next-line jsx-a11y/anchor-is-valid, jsx-a11y/no-static-element-interactions
46
- React.createElement("a", {
47
- className: [baseClassName, componentClassName, userClassName].filter(e => e).join(' '),
48
- id: id,
49
- style: style,
50
- onClick: loopThemes,
51
- onKeyDown: loopThemes
52
- }, themeText)
53
- );
40
+ return /*#__PURE__*/React.createElement("div", {
41
+ className: [baseClassName, componentClassName, userClassName].filter(e => e).join(' '),
42
+ id: id,
43
+ style: style
44
+ }, /*#__PURE__*/React.createElement("span", {
45
+ className: "c-x x-paragraph"
46
+ }, "Theme:", ' ', userTheme && userTheme[0].toUpperCase() + userTheme.slice(1)), /*#__PURE__*/React.createElement("button", {
47
+ type: "button",
48
+ onClick: loopThemes
49
+ }, /*#__PURE__*/React.createElement("input", {
50
+ type: "checkbox",
51
+ id: "switch",
52
+ checked: userTheme === 'dark'
53
+ }), /*#__PURE__*/React.createElement("label", {
54
+ htmlFor: "switch"
55
+ })));
54
56
  };
55
57
  ThemeSelector.propTypes = {
56
58
  /**
@@ -2,8 +2,51 @@
2
2
 
3
3
  @use "@pareto-engineering/bem";
4
4
 
5
+ $default-border-radius: var(--theme-default-border-radius);
6
+ $default-size: 1.2em;
7
+
5
8
  .#{bem.$base}.theme-selector {
6
- cursor: pointer;
7
- display: block;
8
- text-decoration: none;
9
+ align-items: center;
10
+ display: flex;
11
+ gap: var(--gap);
12
+
13
+ > button {
14
+ background: transparent;
15
+ border: none;
16
+ cursor: pointer;
17
+ display: flex;
18
+
19
+ >input {
20
+ height: 0;
21
+ visibility: hidden;
22
+ width: 0;
23
+ }
24
+
25
+ >label {
26
+ background: var(--interactive);
27
+ border-radius: $default-border-radius;
28
+ cursor: pointer;
29
+ display: block;
30
+ height: $default-size;
31
+ position: relative;
32
+ width: calc($default-size * 2);
33
+
34
+ &::after {
35
+ background: var(--background-far);
36
+ border: 1px solid var(--ui-lines);
37
+ border-radius: $default-border-radius;
38
+ content: "";
39
+ height: $default-size;
40
+ left: 0;
41
+ position: absolute;
42
+ top: 0;
43
+ transition: .3s;
44
+ width: $default-size;
45
+ }
46
+ }
47
+
48
+ >input:checked + label::after {
49
+ left: $default-size;
50
+ }
51
+ }
9
52
  }
@@ -21,7 +21,6 @@ $default-spacing: var(--gap);
21
21
  }
22
22
 
23
23
  >* {
24
- display: inline-block;
25
24
  scroll-snap-align: start;
26
25
 
27
26
  &:first-child {
@@ -17,8 +17,10 @@ const Tip = ({
17
17
  className: userClassName,
18
18
  style,
19
19
  children,
20
+ icon,
20
21
  as: Wrapper,
21
- color
22
+ color,
23
+ backgroundColor
22
24
  // ...otherProps
23
25
  }) => {
24
26
  useInsertionEffect(() => {
@@ -26,10 +28,12 @@ const Tip = ({
26
28
  }, []);
27
29
  return /*#__PURE__*/React.createElement(Wrapper, {
28
30
  id: id,
29
- className: [baseClassName, componentClassName, userClassName, `x-${color}`].filter(e => e).join(' '),
31
+ className: [baseClassName, componentClassName, userClassName, `x-${backgroundColor}`].filter(e => e).join(' '),
30
32
  style: style
31
33
  // {...otherProps}
32
- }, children);
34
+ }, /*#__PURE__*/React.createElement("span", {
35
+ className: `x-${color} c-x icon`
36
+ }, icon), children);
33
37
  };
34
38
  Tip.propTypes = {
35
39
  /**
@@ -49,9 +53,17 @@ Tip.propTypes = {
49
53
  */
50
54
  children: PropTypes.node.isRequired,
51
55
  /**
52
- * The color of the bar
56
+ * The icon
57
+ */
58
+ icon: PropTypes.string,
59
+ /**
60
+ * The color of the icon
53
61
  */
54
62
  color: PropTypes.string,
63
+ /**
64
+ * The background color
65
+ */
66
+ backgroundColor: PropTypes.string,
55
67
  /**
56
68
  * The wrapper html type
57
69
  */
@@ -59,6 +71,8 @@ Tip.propTypes = {
59
71
  };
60
72
  Tip.defaultProps = {
61
73
  as: 'p',
62
- color: 'main'
74
+ icon: ')',
75
+ color: 'interactive',
76
+ backgroundColor: 'background-near'
63
77
  };
64
78
  export default Tip;
@@ -4,19 +4,13 @@
4
4
  @use "@pareto-engineering/styles/src/mixins";
5
5
  @use "@pareto-engineering/styles/src/globals" as *;
6
6
 
7
- $default-bar-width: 2px;
8
- $default-padding: 1em;
7
+ $default-padding: calc(var(--gap) * 2);
9
8
 
10
9
  .#{bem.$base}.tip {
11
- padding-left: $default-padding;
12
- position: relative;
13
-
14
- &::before {
15
- background: var(--x);
16
- content: "";
17
- height: 100%;
18
- left: 0;
19
- position: absolute;
20
- width: $default-bar-width;
21
- }
10
+ align-items: center;
11
+ background: var(--x);
12
+ border-radius: var(--theme-default-border-radius);
13
+ display: flex;
14
+ gap: var(--gap);
15
+ padding: $default-padding;
22
16
  }
@@ -42,7 +42,7 @@ const Button = ({
42
42
  type: "button"
43
43
  }, otherProps), isLoading ? /*#__PURE__*/React.createElement(LoadingCircle, {
44
44
  style: {
45
- '--x': 'var(--on-x)'
45
+ '--x': 'var(--stroke-color, var(--on-x))'
46
46
  },
47
47
  heightWidth: "1.15em"
48
48
  }) : buttonText);
@@ -23,9 +23,6 @@ $default-spacing: var(--gap);
23
23
  &.desktop-grid {
24
24
  display: grid;
25
25
  grid-template-columns: repeat(var(--columns), 1fr);
26
- }
27
-
28
- &.snap-scroller {
29
26
  margin-left: unset;
30
27
  margin-right: unset;
31
28
  }
@@ -26,6 +26,10 @@ const defaultsMap = {
26
26
  linkedin: {
27
27
  icon: 'l',
28
28
  link: 'LINKEDIN'
29
+ },
30
+ threads: {
31
+ icon: 'u',
32
+ link: 'THREADS'
29
33
  }
30
34
  };
31
35
 
@@ -50,7 +54,7 @@ const SocialMediaButton = ({
50
54
  import("./styles.scss");
51
55
  }, []);
52
56
  const content = type && defaultsMap[type];
53
- const href = link || applicationContext?.SOCIAL?.[content.link];
57
+ const href = link || applicationContext?.SOCIAL?.[content?.link];
54
58
  return /*#__PURE__*/React.createElement("a", {
55
59
  href: href,
56
60
  target: "_blank",
@@ -30,20 +30,22 @@ const ThemeSelector = ({
30
30
  const current = themes.indexOf(userTheme);
31
31
  setPreferredTheme(themes[(current + 1) % themes.length]);
32
32
  }, [userTheme]);
33
- const current = userTheme ? themes.indexOf(userTheme) : 0;
34
- const nextTheme = themes[(current + 1) % themes.length];
35
- const themeText = nextTheme && nextTheme.charAt(0).toUpperCase() + nextTheme.slice(1);
36
- return (
37
- /*#__PURE__*/
38
- // eslint-disable-next-line jsx-a11y/anchor-is-valid, jsx-a11y/no-static-element-interactions
39
- React.createElement("a", {
40
- className: [baseClassName, componentClassName, userClassName].filter(e => e).join(' '),
41
- id: id,
42
- style: style,
43
- onClick: loopThemes,
44
- onKeyDown: loopThemes
45
- }, themeText)
46
- );
33
+ return /*#__PURE__*/React.createElement("div", {
34
+ className: [baseClassName, componentClassName, userClassName].filter(e => e).join(' '),
35
+ id: id,
36
+ style: style
37
+ }, /*#__PURE__*/React.createElement("span", {
38
+ className: "c-x x-paragraph"
39
+ }, "Theme:", ' ', userTheme && userTheme[0].toUpperCase() + userTheme.slice(1)), /*#__PURE__*/React.createElement("button", {
40
+ type: "button",
41
+ onClick: loopThemes
42
+ }, /*#__PURE__*/React.createElement("input", {
43
+ type: "checkbox",
44
+ id: "switch",
45
+ checked: userTheme === 'dark'
46
+ }), /*#__PURE__*/React.createElement("label", {
47
+ htmlFor: "switch"
48
+ })));
47
49
  };
48
50
  ThemeSelector.propTypes = {
49
51
  /**
@@ -2,8 +2,51 @@
2
2
 
3
3
  @use "@pareto-engineering/bem";
4
4
 
5
+ $default-border-radius: var(--theme-default-border-radius);
6
+ $default-size: 1.2em;
7
+
5
8
  .#{bem.$base}.theme-selector {
6
- cursor: pointer;
7
- display: block;
8
- text-decoration: none;
9
+ align-items: center;
10
+ display: flex;
11
+ gap: var(--gap);
12
+
13
+ > button {
14
+ background: transparent;
15
+ border: none;
16
+ cursor: pointer;
17
+ display: flex;
18
+
19
+ >input {
20
+ height: 0;
21
+ visibility: hidden;
22
+ width: 0;
23
+ }
24
+
25
+ >label {
26
+ background: var(--interactive);
27
+ border-radius: $default-border-radius;
28
+ cursor: pointer;
29
+ display: block;
30
+ height: $default-size;
31
+ position: relative;
32
+ width: calc($default-size * 2);
33
+
34
+ &::after {
35
+ background: var(--background-far);
36
+ border: 1px solid var(--ui-lines);
37
+ border-radius: $default-border-radius;
38
+ content: "";
39
+ height: $default-size;
40
+ left: 0;
41
+ position: absolute;
42
+ top: 0;
43
+ transition: .3s;
44
+ width: $default-size;
45
+ }
46
+ }
47
+
48
+ >input:checked + label::after {
49
+ left: $default-size;
50
+ }
51
+ }
9
52
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pareto-engineering/design-system",
3
- "version": "4.0.0-alpha.46",
3
+ "version": "4.0.0-alpha.48",
4
4
  "description": "",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/es/index.js",
@@ -51,9 +51,9 @@
51
51
  },
52
52
  "dependencies": {
53
53
  "@lexical/react": "^0.11.3",
54
- "@pareto-engineering/assets": "^4.0.0-alpha.45",
54
+ "@pareto-engineering/assets": "^4.0.0-alpha.48",
55
55
  "@pareto-engineering/bem": "^4.0.0-alpha.20",
56
- "@pareto-engineering/styles": "^4.0.0-alpha.46",
56
+ "@pareto-engineering/styles": "^4.0.0-alpha.48",
57
57
  "@pareto-engineering/utils": "^4.0.0-alpha.46",
58
58
  "date-fns": "^2.29.3",
59
59
  "downshift": "^6.1.12",
@@ -70,5 +70,5 @@
70
70
  "relay-test-utils": "^15.0.0"
71
71
  },
72
72
  "browserslist": "> 2%",
73
- "gitHead": "b2719ca8ef140bea2c08806f532564610b4008e6"
73
+ "gitHead": "38ad4d7544d818f09deafd3b4ac951916c7e4810"
74
74
  }
@@ -30,6 +30,8 @@ export const Base = () => (
30
30
  FACEBOOK :'https://www.facebook.com/hellopareto',
31
31
  INSTAGRAM:'https://www.instagram.com/hellopareto',
32
32
  TWITTER :'https://www.twitter.com/hellopareto',
33
+ THREADS :'https://www.threads.net/@hellopareto',
34
+ LINKEDIN :'https://www.linkedin.com/company/hellopareto',
33
35
  },
34
36
  EXTRA:{
35
37
  SURVEY:'https://survey.pareto.ai',
@@ -13,7 +13,8 @@ export default {
13
13
  // storyfn => <div className="">{ storyfn() }</div>,
14
14
  ],
15
15
  argTypes:{
16
- color:{ control: 'color' },
16
+ color :{ control: 'text' },
17
+ backgroundColor:{ control: 'text' },
17
18
  },
18
19
  }
19
20
 
@@ -24,5 +25,5 @@ const Template = (args) => (
24
25
  export const Base = Template.bind({})
25
26
  Base.args = {
26
27
  children:'Remember to wash your vegetables before eating them.',
27
- color :'main',
28
+ color :'interactive',
28
29
  }
@@ -25,6 +25,7 @@ const Template = ({ isTransparent = false, ...rest }) => (
25
25
  <SocialMediaButton type="twitter" isTransparent={isTransparent} />
26
26
  <SocialMediaButton type="instagram" isTransparent={isTransparent} />
27
27
  <SocialMediaButton type="linkedin" isTransparent={isTransparent} />
28
+ <SocialMediaButton type="threads" isTransparent={isTransparent} />
28
29
  </AppContextProvider>
29
30
  )
30
31
 
@@ -42,6 +43,7 @@ Base.args = {
42
43
  INSTAGRAM:'https://www.instagram.com/hellopareto',
43
44
  TWITTER :'https://www.twitter.com/hellopareto',
44
45
  LINKEDIN :'https://www.linkedin.com/company/hellopareto',
46
+ THREADS :'https://www.threads.net/@hellopareto',
45
47
  },
46
48
  EXTRA:{
47
49
  SURVEY:'https://survey.pareto.ai',
@@ -39,10 +39,6 @@ export const Base = () => {
39
39
  ].filter((e) => e).join(' ')
40
40
  }
41
41
  >
42
- <p>
43
- Theme :
44
- { userTheme }
45
- </p>
46
42
  <ThemeSelector />
47
43
  </div>
48
44
  )
@@ -21,7 +21,6 @@ $default-spacing: var(--gap);
21
21
  }
22
22
 
23
23
  >* {
24
- display: inline-block;
25
24
  scroll-snap-align: start;
26
25
 
27
26
  &:first-child {
@@ -21,8 +21,10 @@ const Tip = ({
21
21
  className:userClassName,
22
22
  style,
23
23
  children,
24
+ icon,
24
25
  as:Wrapper,
25
26
  color,
27
+ backgroundColor,
26
28
  // ...otherProps
27
29
  }) => {
28
30
  useInsertionEffect(() => {
@@ -36,13 +38,16 @@ const Tip = ({
36
38
  baseClassName,
37
39
  componentClassName,
38
40
  userClassName,
39
- `x-${color}`,
41
+ `x-${backgroundColor}`,
40
42
  ]
41
43
  .filter((e) => e)
42
44
  .join(' ')}
43
45
  style={style}
44
46
  // {...otherProps}
45
47
  >
48
+ <span className={`x-${color} c-x icon`}>
49
+ {icon}
50
+ </span>
46
51
  {children}
47
52
  </Wrapper>
48
53
  )
@@ -70,10 +75,20 @@ Tip.propTypes = {
70
75
  children:PropTypes.node.isRequired,
71
76
 
72
77
  /**
73
- * The color of the bar
78
+ * The icon
79
+ */
80
+ icon:PropTypes.string,
81
+
82
+ /**
83
+ * The color of the icon
74
84
  */
75
85
  color:PropTypes.string,
76
86
 
87
+ /**
88
+ * The background color
89
+ */
90
+ backgroundColor:PropTypes.string,
91
+
77
92
  /**
78
93
  * The wrapper html type
79
94
  */
@@ -81,8 +96,10 @@ Tip.propTypes = {
81
96
  }
82
97
 
83
98
  Tip.defaultProps = {
84
- as :'p',
85
- color:'main',
99
+ as :'p',
100
+ icon :')',
101
+ color :'interactive',
102
+ backgroundColor:'background-near',
86
103
  }
87
104
 
88
105
  export default Tip
@@ -4,19 +4,13 @@
4
4
  @use "@pareto-engineering/styles/src/mixins";
5
5
  @use "@pareto-engineering/styles/src/globals" as *;
6
6
 
7
- $default-bar-width: 2px;
8
- $default-padding: 1em;
7
+ $default-padding: calc(var(--gap) * 2);
9
8
 
10
9
  .#{bem.$base}.tip {
11
- padding-left: $default-padding;
12
- position: relative;
13
-
14
- &::before {
15
- background: var(--x);
16
- content: "";
17
- height: 100%;
18
- left: 0;
19
- position: absolute;
20
- width: $default-bar-width;
21
- }
10
+ align-items: center;
11
+ background: var(--x);
12
+ border-radius: var(--theme-default-border-radius);
13
+ display: flex;
14
+ gap: var(--gap);
15
+ padding: $default-padding;
22
16
  }
@@ -61,7 +61,7 @@ const Button = ({
61
61
  {isLoading ? (
62
62
  <LoadingCircle
63
63
  style={{
64
- '--x':'var(--on-x)',
64
+ '--x':'var(--stroke-color, var(--on-x))',
65
65
  }}
66
66
  heightWidth="1.15em"
67
67
  />
@@ -23,9 +23,6 @@ $default-spacing: var(--gap);
23
23
  &.desktop-grid {
24
24
  display: grid;
25
25
  grid-template-columns: repeat(var(--columns), 1fr);
26
- }
27
-
28
- &.snap-scroller {
29
26
  margin-left: unset;
30
27
  margin-right: unset;
31
28
  }
@@ -32,6 +32,10 @@ const defaultsMap = {
32
32
  icon:'l',
33
33
  link:'LINKEDIN',
34
34
  },
35
+ threads:{
36
+ icon:'u',
37
+ link:'THREADS',
38
+ },
35
39
  }
36
40
 
37
41
  /**
@@ -57,7 +61,7 @@ const SocialMediaButton = ({
57
61
  }, [])
58
62
 
59
63
  const content = type && defaultsMap[type]
60
- const href = link || applicationContext?.SOCIAL?.[content.link]
64
+ const href = link || applicationContext?.SOCIAL?.[content?.link]
61
65
 
62
66
  return (
63
67
  <a href={href} target="_blank" rel="noreferrer">
@@ -17,7 +17,7 @@ const componentClassName = 'theme-selector'
17
17
  */
18
18
  const ThemeSelector = ({
19
19
  id,
20
- className:userClassName,
20
+ className: userClassName,
21
21
  style,
22
22
  themes,
23
23
  }) => {
@@ -36,13 +36,8 @@ const ThemeSelector = ({
36
36
  },
37
37
  [userTheme])
38
38
 
39
- const current = userTheme ? themes.indexOf(userTheme) : 0
40
- const nextTheme = themes[(current + 1) % themes.length]
41
- const themeText = nextTheme && nextTheme.charAt(0).toUpperCase() + nextTheme.slice(1)
42
-
43
39
  return (
44
- // eslint-disable-next-line jsx-a11y/anchor-is-valid, jsx-a11y/no-static-element-interactions
45
- <a
40
+ <div
46
41
  className={[
47
42
  baseClassName,
48
43
  componentClassName,
@@ -52,11 +47,21 @@ const ThemeSelector = ({
52
47
  .join(' ')}
53
48
  id={id}
54
49
  style={style}
55
- onClick={loopThemes}
56
- onKeyDown={loopThemes}
57
50
  >
58
- {themeText}
59
- </a>
51
+ <span className="c-x x-paragraph">
52
+ Theme:
53
+ {' '}
54
+ {userTheme && userTheme[0].toUpperCase() + userTheme.slice(1)}
55
+ </span>
56
+ <button
57
+ type="button"
58
+ onClick={loopThemes}
59
+ >
60
+ <input type="checkbox" id="switch" checked={userTheme === 'dark'} />
61
+ {/* eslint-disable-next-line jsx-a11y/label-has-associated-control */}
62
+ <label htmlFor="switch" />
63
+ </button>
64
+ </div>
60
65
  )
61
66
  }
62
67
 
@@ -2,8 +2,51 @@
2
2
 
3
3
  @use "@pareto-engineering/bem";
4
4
 
5
+ $default-border-radius: var(--theme-default-border-radius);
6
+ $default-size: 1.2em;
7
+
5
8
  .#{bem.$base}.theme-selector {
6
- cursor: pointer;
7
- display: block;
8
- text-decoration: none;
9
+ align-items: center;
10
+ display: flex;
11
+ gap: var(--gap);
12
+
13
+ > button {
14
+ background: transparent;
15
+ border: none;
16
+ cursor: pointer;
17
+ display: flex;
18
+
19
+ >input {
20
+ height: 0;
21
+ visibility: hidden;
22
+ width: 0;
23
+ }
24
+
25
+ >label {
26
+ background: var(--interactive);
27
+ border-radius: $default-border-radius;
28
+ cursor: pointer;
29
+ display: block;
30
+ height: $default-size;
31
+ position: relative;
32
+ width: calc($default-size * 2);
33
+
34
+ &::after {
35
+ background: var(--background-far);
36
+ border: 1px solid var(--ui-lines);
37
+ border-radius: $default-border-radius;
38
+ content: "";
39
+ height: $default-size;
40
+ left: 0;
41
+ position: absolute;
42
+ top: 0;
43
+ transition: .3s;
44
+ width: $default-size;
45
+ }
46
+ }
47
+
48
+ >input:checked + label::after {
49
+ left: $default-size;
50
+ }
51
+ }
9
52
  }
@@ -3199,7 +3199,7 @@ exports[`Storyshots a/Timestamp Distance Format 1`] = `
3199
3199
  className="base timestamp"
3200
3200
  onClick={[Function]}
3201
3201
  >
3202
- 12 months ago
3202
+ about 1 year ago
3203
3203
  </p>
3204
3204
  `;
3205
3205
 
@@ -3227,8 +3227,13 @@ exports[`Storyshots a/Timestamp Relative Format 1`] = `
3227
3227
 
3228
3228
  exports[`Storyshots a/Tip Base 1`] = `
3229
3229
  <p
3230
- className="base tip x-main"
3230
+ className="base tip x-background-near"
3231
3231
  >
3232
+ <span
3233
+ className="x-interactive c-x icon"
3234
+ >
3235
+ )
3236
+ </span>
3232
3237
  Remember to wash your vegetables before eating them.
3233
3238
  </p>
3234
3239
  `;
@@ -8076,7 +8081,7 @@ exports[`Storyshots b/Button Loading 1`] = `
8076
8081
  {
8077
8082
  "--height-width": "1.15em",
8078
8083
  "--stroke-width": undefined,
8079
- "--x": "var(--on-x)",
8084
+ "--x": "var(--stroke-color, var(--on-x))",
8080
8085
  }
8081
8086
  }
8082
8087
  >
@@ -8117,7 +8122,7 @@ exports[`Storyshots b/Button Loading 1`] = `
8117
8122
  {
8118
8123
  "--height-width": "1.15em",
8119
8124
  "--stroke-width": undefined,
8120
- "--x": "var(--on-x)",
8125
+ "--x": "var(--stroke-color, var(--on-x))",
8121
8126
  }
8122
8127
  }
8123
8128
  >
@@ -8158,7 +8163,7 @@ exports[`Storyshots b/Button Loading 1`] = `
8158
8163
  {
8159
8164
  "--height-width": "1.15em",
8160
8165
  "--stroke-width": undefined,
8161
- "--x": "var(--on-x)",
8166
+ "--x": "var(--stroke-color, var(--on-x))",
8162
8167
  }
8163
8168
  }
8164
8169
  >
@@ -8199,7 +8204,7 @@ exports[`Storyshots b/Button Loading 1`] = `
8199
8204
  {
8200
8205
  "--height-width": "1.15em",
8201
8206
  "--stroke-width": undefined,
8202
- "--x": "var(--on-x)",
8207
+ "--x": "var(--stroke-color, var(--on-x))",
8203
8208
  }
8204
8209
  }
8205
8210
  >
@@ -8240,7 +8245,7 @@ exports[`Storyshots b/Button Loading 1`] = `
8240
8245
  {
8241
8246
  "--height-width": "1.15em",
8242
8247
  "--stroke-width": undefined,
8243
- "--x": "var(--on-x)",
8248
+ "--x": "var(--stroke-color, var(--on-x))",
8244
8249
  }
8245
8250
  }
8246
8251
  >
@@ -8281,7 +8286,7 @@ exports[`Storyshots b/Button Loading 1`] = `
8281
8286
  {
8282
8287
  "--height-width": "1.15em",
8283
8288
  "--stroke-width": undefined,
8284
- "--x": "var(--on-x)",
8289
+ "--x": "var(--stroke-color, var(--on-x))",
8285
8290
  }
8286
8291
  }
8287
8292
  >
@@ -8322,7 +8327,7 @@ exports[`Storyshots b/Button Loading 1`] = `
8322
8327
  {
8323
8328
  "--height-width": "1.15em",
8324
8329
  "--stroke-width": undefined,
8325
- "--x": "var(--on-x)",
8330
+ "--x": "var(--stroke-color, var(--on-x))",
8326
8331
  }
8327
8332
  }
8328
8333
  >
@@ -8363,7 +8368,7 @@ exports[`Storyshots b/Button Loading 1`] = `
8363
8368
  {
8364
8369
  "--height-width": "1.15em",
8365
8370
  "--stroke-width": undefined,
8366
- "--x": "var(--on-x)",
8371
+ "--x": "var(--stroke-color, var(--on-x))",
8367
8372
  }
8368
8373
  }
8369
8374
  >
@@ -8404,7 +8409,7 @@ exports[`Storyshots b/Button Loading 1`] = `
8404
8409
  {
8405
8410
  "--height-width": "1.15em",
8406
8411
  "--stroke-width": undefined,
8407
- "--x": "var(--on-x)",
8412
+ "--x": "var(--stroke-color, var(--on-x))",
8408
8413
  }
8409
8414
  }
8410
8415
  >
@@ -8445,7 +8450,7 @@ exports[`Storyshots b/Button Loading 1`] = `
8445
8450
  {
8446
8451
  "--height-width": "1.15em",
8447
8452
  "--stroke-width": undefined,
8448
- "--x": "var(--on-x)",
8453
+ "--x": "var(--stroke-color, var(--on-x))",
8449
8454
  }
8450
8455
  }
8451
8456
  >
@@ -8486,7 +8491,7 @@ exports[`Storyshots b/Button Loading 1`] = `
8486
8491
  {
8487
8492
  "--height-width": "1.15em",
8488
8493
  "--stroke-width": undefined,
8489
- "--x": "var(--on-x)",
8494
+ "--x": "var(--stroke-color, var(--on-x))",
8490
8495
  }
8491
8496
  }
8492
8497
  >
@@ -8527,7 +8532,7 @@ exports[`Storyshots b/Button Loading 1`] = `
8527
8532
  {
8528
8533
  "--height-width": "1.15em",
8529
8534
  "--stroke-width": undefined,
8530
- "--x": "var(--on-x)",
8535
+ "--x": "var(--stroke-color, var(--on-x))",
8531
8536
  }
8532
8537
  }
8533
8538
  >
@@ -8568,7 +8573,7 @@ exports[`Storyshots b/Button Loading 1`] = `
8568
8573
  {
8569
8574
  "--height-width": "1.15em",
8570
8575
  "--stroke-width": undefined,
8571
- "--x": "var(--on-x)",
8576
+ "--x": "var(--stroke-color, var(--on-x))",
8572
8577
  }
8573
8578
  }
8574
8579
  >
@@ -8609,7 +8614,7 @@ exports[`Storyshots b/Button Loading 1`] = `
8609
8614
  {
8610
8615
  "--height-width": "1.15em",
8611
8616
  "--stroke-width": undefined,
8612
- "--x": "var(--on-x)",
8617
+ "--x": "var(--stroke-color, var(--on-x))",
8613
8618
  }
8614
8619
  }
8615
8620
  >
@@ -8650,7 +8655,7 @@ exports[`Storyshots b/Button Loading 1`] = `
8650
8655
  {
8651
8656
  "--height-width": "1.15em",
8652
8657
  "--stroke-width": undefined,
8653
- "--x": "var(--on-x)",
8658
+ "--x": "var(--stroke-color, var(--on-x))",
8654
8659
  }
8655
8660
  }
8656
8661
  >
@@ -8691,7 +8696,7 @@ exports[`Storyshots b/Button Loading 1`] = `
8691
8696
  {
8692
8697
  "--height-width": "1.15em",
8693
8698
  "--stroke-width": undefined,
8694
- "--x": "var(--on-x)",
8699
+ "--x": "var(--stroke-color, var(--on-x))",
8695
8700
  }
8696
8701
  }
8697
8702
  >
@@ -8732,7 +8737,7 @@ exports[`Storyshots b/Button Loading 1`] = `
8732
8737
  {
8733
8738
  "--height-width": "1.15em",
8734
8739
  "--stroke-width": undefined,
8735
- "--x": "var(--on-x)",
8740
+ "--x": "var(--stroke-color, var(--on-x))",
8736
8741
  }
8737
8742
  }
8738
8743
  >
@@ -8773,7 +8778,7 @@ exports[`Storyshots b/Button Loading 1`] = `
8773
8778
  {
8774
8779
  "--height-width": "1.15em",
8775
8780
  "--stroke-width": undefined,
8776
- "--x": "var(--on-x)",
8781
+ "--x": "var(--stroke-color, var(--on-x))",
8777
8782
  }
8778
8783
  }
8779
8784
  >
@@ -8814,7 +8819,7 @@ exports[`Storyshots b/Button Loading 1`] = `
8814
8819
  {
8815
8820
  "--height-width": "1.15em",
8816
8821
  "--stroke-width": undefined,
8817
- "--x": "var(--on-x)",
8822
+ "--x": "var(--stroke-color, var(--on-x))",
8818
8823
  }
8819
8824
  }
8820
8825
  >
@@ -8855,7 +8860,7 @@ exports[`Storyshots b/Button Loading 1`] = `
8855
8860
  {
8856
8861
  "--height-width": "1.15em",
8857
8862
  "--stroke-width": undefined,
8858
- "--x": "var(--on-x)",
8863
+ "--x": "var(--stroke-color, var(--on-x))",
8859
8864
  }
8860
8865
  }
8861
8866
  >
@@ -8896,7 +8901,7 @@ exports[`Storyshots b/Button Loading 1`] = `
8896
8901
  {
8897
8902
  "--height-width": "1.15em",
8898
8903
  "--stroke-width": undefined,
8899
- "--x": "var(--on-x)",
8904
+ "--x": "var(--stroke-color, var(--on-x))",
8900
8905
  }
8901
8906
  }
8902
8907
  >
@@ -8937,7 +8942,7 @@ exports[`Storyshots b/Button Loading 1`] = `
8937
8942
  {
8938
8943
  "--height-width": "1.15em",
8939
8944
  "--stroke-width": undefined,
8940
- "--x": "var(--on-x)",
8945
+ "--x": "var(--stroke-color, var(--on-x))",
8941
8946
  }
8942
8947
  }
8943
8948
  >
@@ -8978,7 +8983,7 @@ exports[`Storyshots b/Button Loading 1`] = `
8978
8983
  {
8979
8984
  "--height-width": "1.15em",
8980
8985
  "--stroke-width": undefined,
8981
- "--x": "var(--on-x)",
8986
+ "--x": "var(--stroke-color, var(--on-x))",
8982
8987
  }
8983
8988
  }
8984
8989
  >
@@ -9019,7 +9024,7 @@ exports[`Storyshots b/Button Loading 1`] = `
9019
9024
  {
9020
9025
  "--height-width": "1.15em",
9021
9026
  "--stroke-width": undefined,
9022
- "--x": "var(--on-x)",
9027
+ "--x": "var(--stroke-color, var(--on-x))",
9023
9028
  }
9024
9029
  }
9025
9030
  >
@@ -9060,7 +9065,7 @@ exports[`Storyshots b/Button Loading 1`] = `
9060
9065
  {
9061
9066
  "--height-width": "1.15em",
9062
9067
  "--stroke-width": undefined,
9063
- "--x": "var(--on-x)",
9068
+ "--x": "var(--stroke-color, var(--on-x))",
9064
9069
  }
9065
9070
  }
9066
9071
  >
@@ -9101,7 +9106,7 @@ exports[`Storyshots b/Button Loading 1`] = `
9101
9106
  {
9102
9107
  "--height-width": "1.15em",
9103
9108
  "--stroke-width": undefined,
9104
- "--x": "var(--on-x)",
9109
+ "--x": "var(--stroke-color, var(--on-x))",
9105
9110
  }
9106
9111
  }
9107
9112
  >
@@ -9142,7 +9147,7 @@ exports[`Storyshots b/Button Loading 1`] = `
9142
9147
  {
9143
9148
  "--height-width": "1.15em",
9144
9149
  "--stroke-width": undefined,
9145
- "--x": "var(--on-x)",
9150
+ "--x": "var(--stroke-color, var(--on-x))",
9146
9151
  }
9147
9152
  }
9148
9153
  >
@@ -9183,7 +9188,7 @@ exports[`Storyshots b/Button Loading 1`] = `
9183
9188
  {
9184
9189
  "--height-width": "1.15em",
9185
9190
  "--stroke-width": undefined,
9186
- "--x": "var(--on-x)",
9191
+ "--x": "var(--stroke-color, var(--on-x))",
9187
9192
  }
9188
9193
  }
9189
9194
  >
@@ -9224,7 +9229,7 @@ exports[`Storyshots b/Button Loading 1`] = `
9224
9229
  {
9225
9230
  "--height-width": "1.15em",
9226
9231
  "--stroke-width": undefined,
9227
- "--x": "var(--on-x)",
9232
+ "--x": "var(--stroke-color, var(--on-x))",
9228
9233
  }
9229
9234
  }
9230
9235
  >
@@ -9265,7 +9270,7 @@ exports[`Storyshots b/Button Loading 1`] = `
9265
9270
  {
9266
9271
  "--height-width": "1.15em",
9267
9272
  "--stroke-width": undefined,
9268
- "--x": "var(--on-x)",
9273
+ "--x": "var(--stroke-color, var(--on-x))",
9269
9274
  }
9270
9275
  }
9271
9276
  >
@@ -9306,7 +9311,7 @@ exports[`Storyshots b/Button Loading 1`] = `
9306
9311
  {
9307
9312
  "--height-width": "1.15em",
9308
9313
  "--stroke-width": undefined,
9309
- "--x": "var(--on-x)",
9314
+ "--x": "var(--stroke-color, var(--on-x))",
9310
9315
  }
9311
9316
  }
9312
9317
  >
@@ -9347,7 +9352,7 @@ exports[`Storyshots b/Button Loading 1`] = `
9347
9352
  {
9348
9353
  "--height-width": "1.15em",
9349
9354
  "--stroke-width": undefined,
9350
- "--x": "var(--on-x)",
9355
+ "--x": "var(--stroke-color, var(--on-x))",
9351
9356
  }
9352
9357
  }
9353
9358
  >
@@ -9388,7 +9393,7 @@ exports[`Storyshots b/Button Loading 1`] = `
9388
9393
  {
9389
9394
  "--height-width": "1.15em",
9390
9395
  "--stroke-width": undefined,
9391
- "--x": "var(--on-x)",
9396
+ "--x": "var(--stroke-color, var(--on-x))",
9392
9397
  }
9393
9398
  }
9394
9399
  >
@@ -9429,7 +9434,7 @@ exports[`Storyshots b/Button Loading 1`] = `
9429
9434
  {
9430
9435
  "--height-width": "1.15em",
9431
9436
  "--stroke-width": undefined,
9432
- "--x": "var(--on-x)",
9437
+ "--x": "var(--stroke-color, var(--on-x))",
9433
9438
  }
9434
9439
  }
9435
9440
  >
@@ -9470,7 +9475,7 @@ exports[`Storyshots b/Button Loading 1`] = `
9470
9475
  {
9471
9476
  "--height-width": "1.15em",
9472
9477
  "--stroke-width": undefined,
9473
- "--x": "var(--on-x)",
9478
+ "--x": "var(--stroke-color, var(--on-x))",
9474
9479
  }
9475
9480
  }
9476
9481
  >
@@ -9511,7 +9516,7 @@ exports[`Storyshots b/Button Loading 1`] = `
9511
9516
  {
9512
9517
  "--height-width": "1.15em",
9513
9518
  "--stroke-width": undefined,
9514
- "--x": "var(--on-x)",
9519
+ "--x": "var(--stroke-color, var(--on-x))",
9515
9520
  }
9516
9521
  }
9517
9522
  >
@@ -9552,7 +9557,7 @@ exports[`Storyshots b/Button Loading 1`] = `
9552
9557
  {
9553
9558
  "--height-width": "1.15em",
9554
9559
  "--stroke-width": undefined,
9555
- "--x": "var(--on-x)",
9560
+ "--x": "var(--stroke-color, var(--on-x))",
9556
9561
  }
9557
9562
  }
9558
9563
  >
@@ -9593,7 +9598,7 @@ exports[`Storyshots b/Button Loading 1`] = `
9593
9598
  {
9594
9599
  "--height-width": "1.15em",
9595
9600
  "--stroke-width": undefined,
9596
- "--x": "var(--on-x)",
9601
+ "--x": "var(--stroke-color, var(--on-x))",
9597
9602
  }
9598
9603
  }
9599
9604
  >
@@ -9634,7 +9639,7 @@ exports[`Storyshots b/Button Loading 1`] = `
9634
9639
  {
9635
9640
  "--height-width": "1.15em",
9636
9641
  "--stroke-width": undefined,
9637
- "--x": "var(--on-x)",
9642
+ "--x": "var(--stroke-color, var(--on-x))",
9638
9643
  }
9639
9644
  }
9640
9645
  >
@@ -13838,6 +13843,18 @@ exports[`Storyshots b/SocialMediaButton Base 1`] = `
13838
13843
  l
13839
13844
  </button>
13840
13845
  </a>,
13846
+ <a
13847
+ href="https://www.threads.net/@hellopareto"
13848
+ rel="noreferrer"
13849
+ target="_blank"
13850
+ >
13851
+ <button
13852
+ className="base x-threads social-media-button"
13853
+ type="button"
13854
+ >
13855
+ u
13856
+ </button>
13857
+ </a>,
13841
13858
  ]
13842
13859
  `;
13843
13860
 
@@ -13891,6 +13908,18 @@ exports[`Storyshots b/SocialMediaButton Transparent 1`] = `
13891
13908
  l
13892
13909
  </button>
13893
13910
  </a>,
13911
+ <a
13912
+ href="https://www.threads.net/@hellopareto"
13913
+ rel="noreferrer"
13914
+ target="_blank"
13915
+ >
13916
+ <button
13917
+ className="base x-threads modifierTransparent social-media-button"
13918
+ type="button"
13919
+ >
13920
+ u
13921
+ </button>
13922
+ </a>,
13894
13923
  ]
13895
13924
  `;
13896
13925
 
@@ -13898,16 +13927,29 @@ exports[`Storyshots b/ThemeSelector Base 1`] = `
13898
13927
  <div
13899
13928
  className="ui-undefined y-background-far b-y"
13900
13929
  >
13901
- <p>
13902
- Theme :
13903
- </p>
13904
- <a
13930
+ <div
13905
13931
  className="base theme-selector"
13906
- onClick={[Function]}
13907
- onKeyDown={[Function]}
13908
13932
  >
13909
- Dark
13910
- </a>
13933
+ <span
13934
+ className="c-x x-paragraph"
13935
+ >
13936
+ Theme:
13937
+
13938
+ </span>
13939
+ <button
13940
+ onClick={[Function]}
13941
+ type="button"
13942
+ >
13943
+ <input
13944
+ checked={false}
13945
+ id="switch"
13946
+ type="checkbox"
13947
+ />
13948
+ <label
13949
+ htmlFor="switch"
13950
+ />
13951
+ </button>
13952
+ </div>
13911
13953
  </div>
13912
13954
  `;
13913
13955