@pareto-engineering/design-system 4.0.0-alpha.23 → 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 (46) hide show
  1. package/dist/cjs/a/BlurOverlay/BlurOverlay.js +59 -0
  2. package/dist/cjs/a/BlurOverlay/index.js +13 -0
  3. package/dist/cjs/a/BlurOverlay/styles.scss +31 -0
  4. package/dist/cjs/a/index.js +7 -0
  5. package/dist/cjs/b/Button/Button.js +1 -0
  6. package/dist/cjs/b/Button/common/WithLink/WithLink.js +60 -0
  7. package/dist/cjs/b/Button/common/WithLink/index.js +13 -0
  8. package/dist/cjs/b/Button/common/WithLink/styles.scss +9 -0
  9. package/dist/cjs/b/Button/common/index.js +8 -1
  10. package/dist/cjs/b/Button/styles.scss +4 -4
  11. package/dist/cjs/b/ThemeSelector/ThemeSelector.js +3 -1
  12. package/dist/cjs/f/fields/ChoicesInput/ChoicesInput.js +5 -4
  13. package/dist/cjs/f/fields/ChoicesInput/styles.scss +4 -0
  14. package/dist/cjs/f/fields/TextInput/styles.scss +3 -2
  15. package/dist/es/a/BlurOverlay/BlurOverlay.js +51 -0
  16. package/dist/es/a/BlurOverlay/index.js +2 -0
  17. package/dist/es/a/BlurOverlay/styles.scss +31 -0
  18. package/dist/es/a/index.js +1 -0
  19. package/dist/es/b/Button/Button.js +2 -1
  20. package/dist/es/b/Button/common/WithLink/WithLink.js +52 -0
  21. package/dist/es/b/Button/common/WithLink/index.js +1 -0
  22. package/dist/es/b/Button/common/WithLink/styles.scss +9 -0
  23. package/dist/es/b/Button/common/index.js +2 -1
  24. package/dist/es/b/Button/styles.scss +4 -4
  25. package/dist/es/b/ThemeSelector/ThemeSelector.js +3 -1
  26. package/dist/es/f/fields/ChoicesInput/ChoicesInput.js +5 -4
  27. package/dist/es/f/fields/ChoicesInput/styles.scss +4 -0
  28. package/dist/es/f/fields/TextInput/styles.scss +3 -2
  29. package/package.json +4 -3
  30. package/src/stories/a/BlurOverlay.stories.jsx +39 -0
  31. package/src/stories/b/Button/WithLink.stories.jsx +38 -0
  32. package/src/ui/a/BlurOverlay/BlurOverlay.jsx +75 -0
  33. package/src/ui/a/BlurOverlay/index.js +2 -0
  34. package/src/ui/a/BlurOverlay/styles.scss +31 -0
  35. package/src/ui/a/index.js +1 -0
  36. package/src/ui/b/Button/Button.jsx +2 -1
  37. package/src/ui/b/Button/common/WithLink/WithLink.jsx +80 -0
  38. package/src/ui/b/Button/common/WithLink/index.js +1 -0
  39. package/src/ui/b/Button/common/WithLink/styles.scss +9 -0
  40. package/src/ui/b/Button/common/index.js +1 -0
  41. package/src/ui/b/Button/styles.scss +4 -4
  42. package/src/ui/b/ThemeSelector/ThemeSelector.jsx +3 -1
  43. package/src/ui/f/fields/ChoicesInput/ChoicesInput.jsx +4 -2
  44. package/src/ui/f/fields/ChoicesInput/styles.scss +4 -0
  45. package/src/ui/f/fields/TextInput/styles.scss +3 -2
  46. package/tests/__snapshots__/Storyshots.test.js.snap +672 -2
@@ -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: '/' }
@@ -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'
@@ -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
+ }
package/src/ui/a/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  export {
2
2
  AppContext, AppContextProvider, useApp, useTheme,
3
3
  } from './AppContext'
4
+ export { BlurOverlay } from './BlurOverlay'
4
5
  export { ContentTree } from './ContentTree'
5
6
  export { Conversation } from './Conversation'
6
7
  export { DotInfo } from './DotInfo'
@@ -6,7 +6,7 @@ import PropTypes from 'prop-types'
6
6
  // Package-level Imports
7
7
  import styleNames from '@pareto-engineering/bem/exports'
8
8
  import { LoadingCircle } from 'ui'
9
- import { Group } from './common'
9
+ import { Group, WithLink } from './common'
10
10
  import './styles.scss'
11
11
 
12
12
  // Helper Definition
@@ -135,5 +135,6 @@ Button.defaultProps = {
135
135
  }
136
136
 
137
137
  Button.Group = Group
138
+ Button.WithLink = WithLink
138
139
 
139
140
  export default Button
@@ -0,0 +1,80 @@
1
+ /* @pareto-engineering/generator-front 1.0.12 */
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
+ import { Link } from 'react-router-dom'
10
+ import { Button } from '../../index'
11
+
12
+ // Local Definitions
13
+
14
+ const baseClassName = styleNames.base
15
+
16
+ const componentClassName = 'button-with-link'
17
+
18
+ const WithLink = ({
19
+ id,
20
+ className: userClassName,
21
+ children,
22
+ path,
23
+ ...otherProps
24
+ }) => {
25
+ useInsertionEffect(() => {
26
+ import('./styles.scss')
27
+ }, [])
28
+
29
+ return (
30
+ <Link
31
+ to={path}
32
+ id={id}
33
+ className={[
34
+ baseClassName,
35
+ componentClassName,
36
+ userClassName,
37
+ ]
38
+ .filter((e) => e)
39
+ .join(' ')}
40
+ >
41
+ <Button
42
+ {...otherProps}
43
+ >
44
+ {children}
45
+ </Button>
46
+ </Link>
47
+ )
48
+ }
49
+
50
+ WithLink.propTypes = {
51
+ /**
52
+ * The HTML id for this element
53
+ */
54
+ id:PropTypes.string,
55
+
56
+ /**
57
+ * The HTML class names for this element
58
+ */
59
+ className:PropTypes.string,
60
+
61
+ /**
62
+ * The React-written, css properties for this element.
63
+ */
64
+ style:PropTypes.objectOf(PropTypes.string),
65
+
66
+ /**
67
+ * The children JSX
68
+ */
69
+ children:PropTypes.node,
70
+
71
+ /**
72
+ * The path that this link would point to
73
+ */
74
+ path:PropTypes.string,
75
+ }
76
+
77
+ WithLink.defaultProps = {
78
+ }
79
+
80
+ 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
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
  }
@@ -36,7 +36,9 @@ const ThemeSelector = ({
36
36
  },
37
37
  [userTheme])
38
38
 
39
- const themeText = userTheme && userTheme.charAt(0).toUpperCase() + userTheme.slice(1)
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)
40
42
 
41
43
  return (
42
44
  // eslint-disable-next-line jsx-a11y/anchor-is-valid, jsx-a11y/no-static-element-interactions
@@ -35,7 +35,8 @@ const ChoicesInput = ({
35
35
  optional,
36
36
  disabled,
37
37
  description,
38
- // ...otherProps
38
+ spaceBetween,
39
+ ...otherProps
39
40
  }) => {
40
41
  useInsertionEffect(() => {
41
42
  import('./styles.scss')
@@ -67,7 +68,7 @@ const ChoicesInput = ({
67
68
  {label}
68
69
  </FormLabel>
69
70
  )}
70
- <div className="choices">
71
+ <div className={['choices', spaceBetween && 'space-between'].filter(Boolean).join(' ')}>
71
72
  { options.map((choice) => (
72
73
  <Choice
73
74
  labelClassName="with-faded-border"
@@ -77,6 +78,7 @@ const ChoicesInput = ({
77
78
  multiple={multiple}
78
79
  validate={validate}
79
80
  disabled={disabled}
81
+ {...otherProps}
80
82
  {...choice}
81
83
  />
82
84
  ))}
@@ -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
 
@@ -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 {