@pareto-engineering/design-system 4.0.0-alpha.22 → 4.0.0-alpha.24

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 (73) hide show
  1. package/dist/cjs/a/AppContext/useTheme.js +0 -10
  2. package/dist/cjs/a/BlurOverlay/BlurOverlay.js +59 -0
  3. package/dist/cjs/a/BlurOverlay/index.js +13 -0
  4. package/dist/cjs/a/BlurOverlay/styles.scss +31 -0
  5. package/dist/cjs/a/ContentTree/styles.scss +2 -1
  6. package/dist/cjs/a/Conversation/common/Message/Message.js +7 -2
  7. package/dist/cjs/a/Conversation/styles.scss +23 -1
  8. package/dist/cjs/a/MetaCard/MetaCard.js +8 -3
  9. package/dist/cjs/a/MetaCard/styles.scss +15 -0
  10. package/dist/cjs/a/index.js +7 -0
  11. package/dist/cjs/b/Button/Button.js +1 -0
  12. package/dist/cjs/b/Button/common/WithLink/WithLink.js +60 -0
  13. package/dist/cjs/b/Button/common/WithLink/index.js +13 -0
  14. package/dist/cjs/b/Button/common/WithLink/styles.scss +9 -0
  15. package/dist/cjs/b/Button/common/index.js +8 -1
  16. package/dist/cjs/b/Button/styles.scss +4 -4
  17. package/dist/cjs/b/Card/common/Group/styles.scss +0 -4
  18. package/dist/cjs/b/Page/common/PageHelmet/PageHelmet.js +1 -1
  19. package/dist/cjs/b/ThemeSelector/ThemeSelector.js +3 -1
  20. package/dist/cjs/f/fields/ChoicesInput/ChoicesInput.js +5 -4
  21. package/dist/cjs/f/fields/ChoicesInput/styles.scss +6 -0
  22. package/dist/cjs/f/fields/SelectInput/styles.scss +4 -3
  23. package/dist/cjs/f/fields/TextInput/styles.scss +3 -2
  24. package/dist/es/a/AppContext/useTheme.js +0 -10
  25. package/dist/es/a/BlurOverlay/BlurOverlay.js +51 -0
  26. package/dist/es/a/BlurOverlay/index.js +2 -0
  27. package/dist/es/a/BlurOverlay/styles.scss +31 -0
  28. package/dist/es/a/ContentTree/styles.scss +2 -1
  29. package/dist/es/a/Conversation/common/Message/Message.js +7 -2
  30. package/dist/es/a/Conversation/styles.scss +23 -1
  31. package/dist/es/a/MetaCard/MetaCard.js +8 -3
  32. package/dist/es/a/MetaCard/styles.scss +15 -0
  33. package/dist/es/a/index.js +1 -0
  34. package/dist/es/b/Button/Button.js +2 -1
  35. package/dist/es/b/Button/common/WithLink/WithLink.js +52 -0
  36. package/dist/es/b/Button/common/WithLink/index.js +1 -0
  37. package/dist/es/b/Button/common/WithLink/styles.scss +9 -0
  38. package/dist/es/b/Button/common/index.js +2 -1
  39. package/dist/es/b/Button/styles.scss +4 -4
  40. package/dist/es/b/Card/common/Group/styles.scss +0 -4
  41. package/dist/es/b/Page/common/PageHelmet/PageHelmet.js +1 -1
  42. package/dist/es/b/ThemeSelector/ThemeSelector.js +3 -1
  43. package/dist/es/f/fields/ChoicesInput/ChoicesInput.js +5 -4
  44. package/dist/es/f/fields/ChoicesInput/styles.scss +6 -0
  45. package/dist/es/f/fields/SelectInput/styles.scss +4 -3
  46. package/dist/es/f/fields/TextInput/styles.scss +3 -2
  47. package/package.json +5 -4
  48. package/src/stories/a/BlurOverlay.stories.jsx +39 -0
  49. package/src/stories/b/Button/WithLink.stories.jsx +38 -0
  50. package/src/ui/a/AppContext/useTheme.js +0 -11
  51. package/src/ui/a/BlurOverlay/BlurOverlay.jsx +75 -0
  52. package/src/ui/a/BlurOverlay/index.js +2 -0
  53. package/src/ui/a/BlurOverlay/styles.scss +31 -0
  54. package/src/ui/a/ContentTree/styles.scss +2 -1
  55. package/src/ui/a/Conversation/common/Message/Message.jsx +10 -4
  56. package/src/ui/a/Conversation/styles.scss +23 -1
  57. package/src/ui/a/MetaCard/MetaCard.jsx +7 -0
  58. package/src/ui/a/MetaCard/styles.scss +15 -0
  59. package/src/ui/a/index.js +1 -0
  60. package/src/ui/b/Button/Button.jsx +2 -1
  61. package/src/ui/b/Button/common/WithLink/WithLink.jsx +80 -0
  62. package/src/ui/b/Button/common/WithLink/index.js +1 -0
  63. package/src/ui/b/Button/common/WithLink/styles.scss +9 -0
  64. package/src/ui/b/Button/common/index.js +1 -0
  65. package/src/ui/b/Button/styles.scss +4 -4
  66. package/src/ui/b/Card/common/Group/styles.scss +0 -4
  67. package/src/ui/b/Page/common/PageHelmet/PageHelmet.jsx +1 -1
  68. package/src/ui/b/ThemeSelector/ThemeSelector.jsx +3 -1
  69. package/src/ui/f/fields/ChoicesInput/ChoicesInput.jsx +4 -2
  70. package/src/ui/f/fields/ChoicesInput/styles.scss +6 -0
  71. package/src/ui/f/fields/SelectInput/styles.scss +4 -3
  72. package/src/ui/f/fields/TextInput/styles.scss +3 -2
  73. package/tests/__snapshots__/Storyshots.test.js.snap +672 -2
@@ -0,0 +1,31 @@
1
+ /* @pareto-engineering/generator-front 1.1.1-alpha.1 */
2
+
3
+ @use "@pareto-engineering/bem";
4
+
5
+ .#{bem.$base}.blur-overlay {
6
+ background: inherit;
7
+ left: 0;
8
+ position: fixed;
9
+ top: 0;
10
+ width: 100%;
11
+ z-index: 3;
12
+ &.#{bem.$modifier-active} {
13
+ animation: blurAnimation .3s ease-in-out;
14
+ backdrop-filter: blur(5px);
15
+ height: 100%;
16
+ }
17
+ }
18
+
19
+ @keyframes blurAnimation {
20
+ 0% {
21
+ transform: translateX(-100%);
22
+ }
23
+
24
+ 1% {
25
+ transform: translateX(0);
26
+ }
27
+
28
+ 100% {
29
+ transform: translateX(0);
30
+ }
31
+ }
@@ -6,11 +6,12 @@
6
6
  $default-dot-size: .5em;
7
7
  $default-margin: 1em;
8
8
  $default-padding: 1em;
9
+ $default-navigation-height: 3.64rem;
9
10
 
10
11
  .#{bem.$base}.content-tree {
11
12
  > .#{bem.$base}.tree {
12
13
  position: sticky;
13
- top: var(--spacing-2);
14
+ top: calc($default-navigation-height + var(--spacing-2));
14
15
 
15
16
  ul {
16
17
  list-style: none;
@@ -17,6 +17,7 @@ const Message = ({
17
17
  className: userClassName,
18
18
  style,
19
19
  message,
20
+ customMessage,
20
21
  sender,
21
22
  from,
22
23
  attachment,
@@ -36,7 +37,7 @@ const Message = ({
36
37
  className: "sender"
37
38
  }, sender, ":"), /*#__PURE__*/React.createElement("div", {
38
39
  className: "message-content"
39
- }, /*#__PURE__*/React.createElement("p", null, message), attachment && /*#__PURE__*/React.createElement("div", {
40
+ }, customMessage || /*#__PURE__*/React.createElement("p", null, message), attachment && /*#__PURE__*/React.createElement("div", {
40
41
  className: `attachment y-${attachmentColor}`
41
42
  }, /*#__PURE__*/React.createElement("span", {
42
43
  className: "icon"
@@ -58,7 +59,11 @@ Message.propTypes = {
58
59
  /**
59
60
  * The message in the conversation
60
61
  */
61
- message: PropTypes.string.isRequired,
62
+ message: PropTypes.string,
63
+ /**
64
+ * The custom message if it uses more complex html
65
+ */
66
+ customMessage: PropTypes.node,
62
67
  /**
63
68
  * The sender of the message
64
69
  */
@@ -1,5 +1,7 @@
1
1
  /* @pareto-engineering/generator-front 1.0.12 */
2
2
  /* stylelint-disable selector-max-compound-selectors -- Required here */
3
+ /* stylelint-disable max-nesting-depth -- Required here */
4
+ /* stylelint-disable selector-max-universal -- Required here */
3
5
 
4
6
  @use "@pareto-engineering/bem";
5
7
  @use "@pareto-engineering/styles/src/mixins";
@@ -33,6 +35,7 @@ $default-message-border: 1px solid var(--hard-background-cards);
33
35
 
34
36
  > .sender {
35
37
  margin: 0;
38
+ padding: 0 var(--gap);
36
39
  }
37
40
 
38
41
  > .message-content {
@@ -47,6 +50,21 @@ $default-message-border: 1px solid var(--hard-background-cards);
47
50
  color: var(--on-x);
48
51
  }
49
52
 
53
+ > ul {
54
+ padding: 0 var(--gap);
55
+ text-align: left;
56
+
57
+ > li {
58
+ color: var(--on-x);
59
+ }
60
+ }
61
+
62
+ > * {
63
+ &:not(:last-child) {
64
+ margin-bottom: 0;
65
+ }
66
+ }
67
+
50
68
  > .attachment {
51
69
  align-items: center;
52
70
  align-self: flex-end;
@@ -56,8 +74,12 @@ $default-message-border: 1px solid var(--hard-background-cards);
56
74
  }
57
75
  }
58
76
 
59
- &.#{bem.$base}.ours {
77
+ &.#{bem.$base}.theirs {
60
78
  align-self: flex-end;
79
+
80
+ > .sender {
81
+ text-align: end;
82
+ }
61
83
  }
62
84
  }
63
85
  }
@@ -17,14 +17,15 @@ const MetaCard = ({
17
17
  className: userClassName,
18
18
  style,
19
19
  children,
20
- hasBackgroundBlur
20
+ hasBackgroundBlur,
21
+ spaced
21
22
  }) => {
22
23
  useInsertionEffect(() => {
23
24
  import("./styles.scss");
24
25
  }, []);
25
26
  return /*#__PURE__*/React.createElement("div", {
26
27
  id: id,
27
- className: [baseClassName, componentClassName, userClassName, hasBackgroundBlur && styleNames.modifierBlur].filter(e => e).join(' '),
28
+ className: [baseClassName, componentClassName, userClassName, hasBackgroundBlur && styleNames.modifierBlur, spaced && styleNames.modifierSpaced].filter(e => e).join(' '),
28
29
  style: style
29
30
  }, children);
30
31
  };
@@ -44,7 +45,11 @@ MetaCard.propTypes = {
44
45
  /**
45
46
  * Whether the card has a background blur
46
47
  * */
47
- hasBackgroundBlur: PropTypes.bool
48
+ hasBackgroundBlur: PropTypes.bool,
49
+ /**
50
+ * Whether to apply a gap to the top and bottom
51
+ * */
52
+ spaced: PropTypes.bool
48
53
  };
49
54
  MetaCard.defaultProps = {
50
55
  // someProp:false
@@ -1,4 +1,5 @@
1
1
  /* @pareto-engineering/generator-front 1.0.12 */
2
+ /* stylelint-disable selector-max-universal -- exception */
2
3
 
3
4
  @use "@pareto-engineering/bem";
4
5
  @use "@pareto-engineering/styles/src/mixins";
@@ -26,5 +27,19 @@ $default-blur: var(--theme-default-blur);
26
27
  margin-left: calc((var(--gap)) * -1);
27
28
  margin-right: calc((var(--gap)) * -1);
28
29
  padding: 0 var(--gap);
30
+
31
+ &.#{bem.$modifier-spaced} {
32
+ padding: var(--gap);
33
+
34
+ > * {
35
+ &:first-child {
36
+ margin-top: 0;
37
+ }
38
+
39
+ &:last-child {
40
+ margin-bottom: 0;
41
+ }
42
+ }
43
+ }
29
44
  }
30
45
  }
@@ -1,4 +1,5 @@
1
1
  export { AppContext, AppContextProvider, useApp, useTheme } from "./AppContext";
2
+ export { BlurOverlay } from "./BlurOverlay";
2
3
  export { ContentTree } from "./ContentTree";
3
4
  export { Conversation } from "./Conversation";
4
5
  export { DotInfo } from "./DotInfo";
@@ -7,7 +7,7 @@ import PropTypes from 'prop-types';
7
7
  // Package-level Imports
8
8
  import styleNames from '@pareto-engineering/bem/exports';
9
9
  import { LoadingCircle } from "../..";
10
- import { Group } from "./common";
10
+ import { Group, WithLink } from "./common";
11
11
  import "./styles.scss";
12
12
 
13
13
  // Helper Definition
@@ -100,4 +100,5 @@ Button.defaultProps = {
100
100
  color: 'main'
101
101
  };
102
102
  Button.Group = Group;
103
+ Button.WithLink = WithLink;
103
104
  export default Button;
@@ -0,0 +1,52 @@
1
+ /* @pareto-engineering/generator-front 1.0.12 */
2
+ import * as React from 'react';
3
+ import { useInsertionEffect } from 'react';
4
+ import PropTypes from 'prop-types';
5
+ import styleNames from '@pareto-engineering/bem/exports';
6
+ import { Link } from 'react-router-dom';
7
+ import { Button } from "../../index";
8
+
9
+ // Local Definitions
10
+
11
+ const baseClassName = styleNames.base;
12
+ const componentClassName = 'button-with-link';
13
+ const WithLink = ({
14
+ id,
15
+ className: userClassName,
16
+ children,
17
+ path,
18
+ ...otherProps
19
+ }) => {
20
+ useInsertionEffect(() => {
21
+ import("./styles.scss");
22
+ }, []);
23
+ return /*#__PURE__*/React.createElement(Link, {
24
+ to: path,
25
+ id: id,
26
+ className: [baseClassName, componentClassName, userClassName].filter(e => e).join(' ')
27
+ }, /*#__PURE__*/React.createElement(Button, otherProps, children));
28
+ };
29
+ WithLink.propTypes = {
30
+ /**
31
+ * The HTML id for this element
32
+ */
33
+ id: PropTypes.string,
34
+ /**
35
+ * The HTML class names for this element
36
+ */
37
+ className: PropTypes.string,
38
+ /**
39
+ * The React-written, css properties for this element.
40
+ */
41
+ style: PropTypes.objectOf(PropTypes.string),
42
+ /**
43
+ * The children JSX
44
+ */
45
+ children: PropTypes.node,
46
+ /**
47
+ * The path that this link would point to
48
+ */
49
+ path: PropTypes.string
50
+ };
51
+ WithLink.defaultProps = {};
52
+ export default WithLink;
@@ -0,0 +1 @@
1
+ export { default as WithLink } from "./WithLink";
@@ -0,0 +1,9 @@
1
+ /* @pareto-engineering/generator-front 1.0.12 */
2
+
3
+ @use "@pareto-engineering/bem";
4
+ @use "@pareto-engineering/styles/src/mixins";
5
+ @use "@pareto-engineering/styles/src/globals" as *;
6
+
7
+ .#{bem.$base}.button-with-link {
8
+ text-decoration: none;
9
+ }
@@ -1 +1,2 @@
1
- export { Group } from "./Group";
1
+ export { Group } from "./Group";
2
+ export { WithLink } from "./WithLink";
@@ -113,8 +113,8 @@ $default-animation-time: .31s;
113
113
  }
114
114
 
115
115
  &:disabled {
116
- border: 1px solid var(--x, var(--#{$default-color}));
117
- color: var(--x, var(--#{$default-color}));
116
+ border: 1px solid var(--hard-disabled, var(--#{$default-color}));
117
+ color: var(--hard-disabled, var(--#{$default-color}));
118
118
  }
119
119
  }
120
120
 
@@ -150,12 +150,12 @@ $default-animation-time: .31s;
150
150
  }
151
151
 
152
152
  &:disabled {
153
- color: var(--x, var(--#{$default-color}));
153
+ color: var(--hard-disabled, var(--#{$default-color}));
154
154
  }
155
155
  }
156
156
 
157
157
  &:disabled {
158
- background: var(--x);
158
+ background: var(--hard-disabled);
159
159
  filter: brightness(125%);
160
160
  }
161
161
  }
@@ -12,10 +12,6 @@ $default-spacing: var(--gap);
12
12
  &.snap-scroller {
13
13
  margin-left: calc($default-spacing * -1);
14
14
  margin-right: calc($default-spacing * -1);
15
-
16
- > .#{bem.$base}.card {
17
- height: 100%;
18
- }
19
15
  }
20
16
 
21
17
  &.vertical-flexbox {
@@ -17,7 +17,7 @@ const helmetMap = [{
17
17
  key: "title_tag"
18
18
  }, `
19
19
  ${v}
20
- ${c.SITE?.TITLE_SUFFIX && c.SITE.TITLE_SUFFIX}
20
+ ${c.SITE?.TITLE_SUFFIX ? c.SITE.TITLE_SUFFIX : ''}
21
21
  `)
22
22
  }, {
23
23
  variables: ['meta_description'],
@@ -30,7 +30,9 @@ const ThemeSelector = ({
30
30
  const current = themes.indexOf(userTheme);
31
31
  setPreferredTheme(themes[(current + 1) % themes.length]);
32
32
  }, [userTheme]);
33
- const themeText = userTheme && userTheme.charAt(0).toUpperCase() + userTheme.slice(1);
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);
34
36
  return (
35
37
  /*#__PURE__*/
36
38
  // eslint-disable-next-line jsx-a11y/anchor-is-valid, jsx-a11y/no-static-element-interactions
@@ -29,8 +29,9 @@ const ChoicesInput = ({
29
29
  label,
30
30
  optional,
31
31
  disabled,
32
- description
33
- // ...otherProps
32
+ description,
33
+ spaceBetween,
34
+ ...otherProps
34
35
  }) => {
35
36
  useInsertionEffect(() => {
36
37
  import("./styles.scss");
@@ -48,7 +49,7 @@ const ChoicesInput = ({
48
49
  as: "p",
49
50
  optional: optional
50
51
  }, label), /*#__PURE__*/React.createElement("div", {
51
- className: "choices"
52
+ className: ['choices', spaceBetween && 'space-between'].filter(Boolean).join(' ')
52
53
  }, options.map(choice => /*#__PURE__*/React.createElement(Choice, _extends({
53
54
  labelClassName: "with-faded-border",
54
55
  key: choice.value,
@@ -57,7 +58,7 @@ const ChoicesInput = ({
57
58
  multiple: multiple,
58
59
  validate: validate,
59
60
  disabled: disabled
60
- }, choice)))), /*#__PURE__*/React.createElement(FormDescription, {
61
+ }, otherProps, choice)))), /*#__PURE__*/React.createElement(FormDescription, {
61
62
  className: "v50 mt-v s-1",
62
63
  description: description,
63
64
  name: name
@@ -16,6 +16,10 @@ $default-label-height: .5em;
16
16
  flex-wrap: wrap;
17
17
  gap: $default-flex-separator;
18
18
 
19
+ &.space-between {
20
+ justify-content: space-between;
21
+ }
22
+
19
23
  >.choice {
20
24
  display: flex;
21
25
 
@@ -33,6 +37,7 @@ $default-label-height: .5em;
33
37
  > label {
34
38
  background-color: var(--background-inputs);
35
39
  border-radius: var(--theme-default-border-radius);
40
+ color: var(--paragraph);
36
41
  cursor: pointer;
37
42
  display: block;
38
43
  height: $default-label-height;
@@ -40,6 +45,7 @@ $default-label-height: .5em;
40
45
  padding: $default-label-padding;
41
46
  position: relative;
42
47
  transition: $default-transition;
48
+ white-space: nowrap;
43
49
 
44
50
  &:hover {
45
51
  box-shadow: var(--theme-default-input-box-shadow);
@@ -6,7 +6,7 @@
6
6
 
7
7
 
8
8
  $default-spacing-size: 1em;
9
- $default-padding: .75em;
9
+ $default-padding: .5em;
10
10
  $default-bg-gradient: var(--background-far);
11
11
  $default-input-border-radius: var(--theme-default-input-border-radius);
12
12
 
@@ -21,7 +21,7 @@ $default-input-border-radius: var(--theme-default-input-border-radius);
21
21
  >.select-wrapper {
22
22
  background-color: var(--background-inputs);
23
23
  border-radius: $default-input-border-radius;
24
- padding: $default-padding;
24
+ padding: $default-padding 0 $default-padding calc($default-padding * 1.5);
25
25
  position: relative;
26
26
 
27
27
  &::after {
@@ -40,7 +40,7 @@ $default-input-border-radius: var(--theme-default-input-border-radius);
40
40
 
41
41
  select {
42
42
  appearance: none;
43
- background-color: inherit;
43
+ background-color: transparent;
44
44
  background-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMTIiIHZpZXdCb3g9IjAgMCAyMCAxMiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTE5IDEuNUwxMCAxMC41TDEgMS41IiBzdHJva2U9IiM0QzRENTMiIHN0cm9rZS13aWR0aD0iMiIvPgo8L3N2Zz4=");
45
45
  background-position: calc(100% - $default-spacing-size);
46
46
  background-repeat: no-repeat;
@@ -48,6 +48,7 @@ $default-input-border-radius: var(--theme-default-input-border-radius);
48
48
  padding-right: $default-spacing-size;
49
49
 
50
50
  &.input {
51
+ color: var(--paragraph);
51
52
  width: 100%;
52
53
 
53
54
  &:disabled {
@@ -8,7 +8,7 @@ $default-symbol-left: 1em;
8
8
  $default-padding-with-symbol:
9
9
  .75em
10
10
  calc($default-symbol-left - 1em)
11
- .55em
11
+ .75em
12
12
  calc($default-symbol-left + 1em);
13
13
  $default-input-border-radius: var(--theme-default-input-border-radius);
14
14
 
@@ -30,7 +30,8 @@ $default-input-border-radius: var(--theme-default-input-border-radius);
30
30
  content: var(--symbol);
31
31
  left: $default-symbol-left;
32
32
  position: absolute;
33
- top: .5em;
33
+ top: 50%;
34
+ transform: translate(-50%, -50%);
34
35
  }
35
36
 
36
37
  input {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pareto-engineering/design-system",
3
- "version": "4.0.0-alpha.22",
3
+ "version": "4.0.0-alpha.24",
4
4
  "description": "",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/es/index.js",
@@ -50,9 +50,10 @@
50
50
  "style-loader": "^3.3.2"
51
51
  },
52
52
  "dependencies": {
53
- "@pareto-engineering/assets": "^4.0.0-alpha.22",
53
+ "@pareto-engineering/assets": "^4.0.0-alpha.23",
54
54
  "@pareto-engineering/bem": "^4.0.0-alpha.20",
55
- "@pareto-engineering/styles": "^4.0.0-alpha.22",
55
+ "@pareto-engineering/styles": "^4.0.0-alpha.24",
56
+ "@pareto-engineering/utils": "^4.0.0-alpha.23",
56
57
  "date-fns": "^2.29.3",
57
58
  "downshift": "^6.1.12",
58
59
  "formik": "^2.2.9",
@@ -67,5 +68,5 @@
67
68
  "relay-test-utils": "^15.0.0"
68
69
  },
69
70
  "browserslist": "> 2%",
70
- "gitHead": "3701cf2d7e297e33391876a0323bd055f7106ceb"
71
+ "gitHead": "711975d03e1556e4c99ecfee1471dbc59260aaf7"
71
72
  }
@@ -0,0 +1,39 @@
1
+ /* @pareto-engineering/generator-front 1.1.1-alpha.1 */
2
+ import * as React from 'react'
3
+
4
+ import { BlurOverlay } from 'ui'
5
+
6
+ export default {
7
+ title :'a/BlurOverlay',
8
+ component :BlurOverlay,
9
+ subcomponents:{
10
+ // Item:BlurOverlay.Item
11
+ },
12
+ decorators:[
13
+ // storyfn => <div className="">{ storyfn() }</div>,
14
+ ],
15
+ argTypes:{},
16
+ controls:{
17
+ blur:{ type: 'boolean' },
18
+ },
19
+ }
20
+
21
+ export const Base = (args) => (
22
+ <BlurOverlay {...args}>
23
+ <div style={{
24
+ height :'100px',
25
+ bottom :'0',
26
+ minWidth :'100%',
27
+ position :'fixed',
28
+ backgroundColor:'blue',
29
+ color :'white',
30
+ }}
31
+ >
32
+ Sample Foreground Component
33
+ </div>
34
+ </BlurOverlay>
35
+
36
+ )
37
+ Base.args = {
38
+ blur:true,
39
+ }
@@ -0,0 +1,38 @@
1
+ /* @pareto-engineering/generator-front 1.0.12 */
2
+ import * as React from 'react'
3
+
4
+ import { Button } from 'ui'
5
+
6
+ import { ALL_COLORS } from 'stories/colors'
7
+ import commonDecorators from '@pareto-engineering/utils/src/storybook/decorators'
8
+
9
+ export default {
10
+ title :'b/Button/WithLink',
11
+ component :Button.WithLink,
12
+ decorators:[
13
+ commonDecorators.router,
14
+ ],
15
+
16
+ argTypes:{
17
+ path:{ control: { type: 'text' } },
18
+ },
19
+ }
20
+
21
+ const Template = (args) => (
22
+ <Button.Group>
23
+ {
24
+ ALL_COLORS.map((colorName) => (
25
+ <Button.WithLink {...args} color={colorName} key={colorName}>
26
+ This is a
27
+ {' '}
28
+ {colorName}
29
+ {' '}
30
+ button
31
+ </Button.WithLink>
32
+ ))
33
+ }
34
+ </Button.Group>
35
+ )
36
+
37
+ export const Base = Template.bind({})
38
+ Base.args = { path: '/' }
@@ -32,17 +32,6 @@ export default (
32
32
  }
33
33
  }, [preferredTheme, isClient])
34
34
 
35
- useEffect(() => {
36
- const fav_theme = userTheme === 'dark' ? 'favicon-dark' : 'favicon-light'
37
- let link = document.querySelector("link[rel~='icon']")
38
- if (!link) {
39
- link = document.createElement('link')
40
- link.rel = 'icon'
41
- document.getElementsByTagName('head')[0].appendChild(link)
42
- }
43
- link.href = `/${fav_theme}.svg`
44
- }, [userTheme])
45
-
46
35
  const isTheme = useCallback((theme) => (userTheme === theme) || undefined, [userTheme])
47
36
 
48
37
  return {
@@ -0,0 +1,75 @@
1
+ /* @pareto-engineering/generator-front 1.1.1-alpha.1 */
2
+ import * as React from 'react'
3
+
4
+ import { useInsertionEffect } from 'react'
5
+
6
+ import PropTypes from 'prop-types'
7
+
8
+ import styleNames from '@pareto-engineering/bem/exports'
9
+
10
+ const baseClassName = styleNames.base
11
+
12
+ const componentClassName = 'blur-overlay'
13
+
14
+ const BlurOverlay = ({
15
+ id,
16
+ className:userClassName,
17
+ style,
18
+ children,
19
+ blur,
20
+ }) => {
21
+ useInsertionEffect(() => {
22
+ import('./styles.scss')
23
+ }, [])
24
+
25
+ return (
26
+ <div
27
+ id={id}
28
+ className={[
29
+ baseClassName,
30
+ componentClassName,
31
+ userClassName,
32
+ blur && styleNames.modifierActive,
33
+ ]
34
+ .filter((e) => e)
35
+ .join(' ')}
36
+ style={style}
37
+ >
38
+ { children }
39
+ </div>
40
+ )
41
+ }
42
+
43
+ BlurOverlay.propTypes = {
44
+ /**
45
+ * The HTML id for this element
46
+ */
47
+ id:PropTypes.string,
48
+
49
+ /**
50
+ * The HTML class names for this element
51
+ */
52
+ className:PropTypes.string,
53
+
54
+ /**
55
+ * The React-written, css properties for this element.
56
+ */
57
+ style:PropTypes.objectOf(PropTypes.string),
58
+
59
+ /**
60
+ * The children JSX
61
+ */
62
+ children:PropTypes.node,
63
+
64
+ /**
65
+ * Boolean to toggle blur effect
66
+ */
67
+ blur:PropTypes.bool,
68
+ }
69
+
70
+ BlurOverlay.defaultProps = {
71
+ blur:true,
72
+ // someProp:false
73
+ }
74
+
75
+ export default BlurOverlay
@@ -0,0 +1,2 @@
1
+ /* @pareto-engineering/generator-front 1.0.12 */
2
+ export { default as BlurOverlay } from './BlurOverlay'