ember-safe-button 2.0.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/README.md +24 -18
  2. package/addon-main.cjs +6 -0
  3. package/dist/_app_/components/safe-button/animations/flip.js +1 -0
  4. package/dist/_app_/components/safe-button/animations/index.js +1 -0
  5. package/dist/_app_/components/safe-button/animations/lift-bars.js +1 -0
  6. package/dist/_app_/components/safe-button/animations/poing.js +1 -0
  7. package/dist/_app_/components/safe-button/animations/roll.js +1 -0
  8. package/dist/_app_/components/safe-button/animations/slide.js +1 -0
  9. package/dist/_app_/components/safe-button/animations/zoom.js +1 -0
  10. package/dist/_app_/components/safe-button/index.js +1 -0
  11. package/dist/_app_/components/safety/index.js +1 -0
  12. package/dist/_app_/components/trigger/index.js +1 -0
  13. package/dist/_app_/modifiers/animate-me.js +1 -0
  14. package/dist/components/safe-button/animations/flip.js +103 -0
  15. package/dist/components/safe-button/animations/flip.js.map +1 -0
  16. package/dist/components/safe-button/animations/index.js +18 -0
  17. package/dist/components/safe-button/animations/index.js.map +1 -0
  18. package/dist/components/safe-button/animations/lift-bars.js +53 -0
  19. package/dist/components/safe-button/animations/lift-bars.js.map +1 -0
  20. package/dist/components/safe-button/animations/poing.js +93 -0
  21. package/dist/components/safe-button/animations/poing.js.map +1 -0
  22. package/dist/components/safe-button/animations/roll.js +57 -0
  23. package/dist/components/safe-button/animations/roll.js.map +1 -0
  24. package/dist/components/safe-button/animations/slide.js +57 -0
  25. package/dist/components/safe-button/animations/slide.js.map +1 -0
  26. package/dist/components/safe-button/animations/zoom.js +73 -0
  27. package/dist/components/safe-button/animations/zoom.js.map +1 -0
  28. package/dist/components/safe-button/index.js +9 -0
  29. package/dist/components/safe-button/index.js.map +1 -0
  30. package/dist/components/safety/index.js +54 -0
  31. package/dist/components/safety/index.js.map +1 -0
  32. package/dist/components/trigger/index.js +44 -0
  33. package/dist/components/trigger/index.js.map +1 -0
  34. package/dist/index-65a73164.js +249 -0
  35. package/dist/index-65a73164.js.map +1 -0
  36. package/dist/index.js +2 -0
  37. package/dist/index.js.map +1 -0
  38. package/dist/modifiers/animate-me.js +23 -0
  39. package/dist/modifiers/animate-me.js.map +1 -0
  40. package/package.json +71 -70
  41. package/.gitlab-ci.yml +0 -27
  42. package/.prettierignore +0 -21
  43. package/.prettierrc.js +0 -5
  44. package/.vscode/settings.json +0 -19
  45. package/CHANGELOG.md +0 -108
  46. package/LICENSE.md +0 -9
  47. package/addon/components/safe-button/animations/flip.js +0 -114
  48. package/addon/components/safe-button/animations/index.js +0 -15
  49. package/addon/components/safe-button/animations/lift-bars.js +0 -50
  50. package/addon/components/safe-button/animations/poing.js +0 -99
  51. package/addon/components/safe-button/animations/roll.js +0 -50
  52. package/addon/components/safe-button/animations/slide.js +0 -50
  53. package/addon/components/safe-button/animations/zoom.js +0 -52
  54. package/addon/components/safe-button/index.hbs +0 -35
  55. package/addon/components/safe-button/index.js +0 -184
  56. package/addon/components/safety/index.hbs +0 -20
  57. package/addon/components/safety/index.js +0 -31
  58. package/addon/components/trigger/index.hbs +0 -20
  59. package/addon/components/trigger/index.js +0 -31
  60. package/addon/modifiers/animate-me.js +0 -20
  61. package/app/components/safe-button.js +0 -1
  62. package/app/components/safety.js +0 -1
  63. package/app/components/trigger.js +0 -2
  64. package/app/modifiers/animate-me.js +0 -1
  65. package/app/templates/components/safe-button.js +0 -1
  66. package/app/templates/components/safety.js +0 -1
  67. package/app/templates/components/trigger.js +0 -1
  68. package/config/addon-docs.js +0 -11
  69. package/config/deploy.js +0 -29
  70. package/config/environment.js +0 -5
  71. package/config/tailwindcss-config.js +0 -924
  72. package/doc/demo.gif +0 -0
  73. package/doc/logo.png +0 -0
  74. package/index.js +0 -5
  75. package/netlify.toml +0 -3
  76. package/renovate.json +0 -75
  77. package/yarn-error.log +0 -13431
@@ -1,19 +0,0 @@
1
- {
2
- "workbench.colorCustomizations": {
3
- "activityBar.activeBackground": "#fbed80",
4
- "activityBar.activeBorder": "#06b9a5",
5
- "activityBar.background": "#fbed80",
6
- "activityBar.foreground": "#15202b",
7
- "activityBar.inactiveForeground": "#15202b99",
8
- "activityBarBadge.background": "#06b9a5",
9
- "activityBarBadge.foreground": "#15202b",
10
- "statusBar.background": "#f9e64f",
11
- "statusBar.foreground": "#15202b",
12
- "statusBarItem.hoverBackground": "#f7df1e",
13
- "titleBar.activeBackground": "#f9e64f",
14
- "titleBar.activeForeground": "#15202b",
15
- "titleBar.inactiveBackground": "#f9e64f99",
16
- "titleBar.inactiveForeground": "#15202b99"
17
- },
18
- "peacock.color": "#f9e64f"
19
- }
package/CHANGELOG.md DELETED
@@ -1,108 +0,0 @@
1
- # Changelog
2
-
3
- All notable changes to this project will be documented in this file.
4
-
5
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
- and this project adheres to [Semantic Versioning](https://semver.org/spec/2.0.0.html).
7
-
8
- ## 2.0.0 (2021-02-19)
9
-
10
- ### Chagned
11
-
12
- - **BREAKING**: Moved from [ember-animated](https://ember-animation.github.io/ember-animated/) to custom usage of [Web Animations API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Animations_API). This changed mostly the internal API of the component, but things might break.
13
-
14
- ### Added
15
-
16
- - New property `@animation`.
17
- - It either accepts a `string` which then points to one of the [embedded animation patterns](./addon/components/safe-button/animations/index.js).
18
- - Or it can accept an `object` which is then a series of Web Animation compatible object definitions for _safety_ and _trigger_ _unlocking_ and _locking_ animations.
19
- - Documentation page with showcase of all embedded animations.
20
- - Safety is _only_ clickable when the safety is locked. In all other states (including animation) the button is `disabled`.
21
- - `SafeButton` automatically changes `disabled` and `tabindex` attributes of respective button elements.
22
- - `SafeButton` automatically handles `focus()` of respective button elements.
23
-
24
- ### Fixed
25
-
26
- - Docs app page title is no longer `Dummy`, but `ember-safe-button`.
27
- - First in the DOM we have `trigger` and then `safety` which means that z-index will be in logical way when not explicitly set.
28
-
29
- ## 1.0.7 (2021-02-07)
30
-
31
- ### Fixed
32
-
33
- - Fixed animations in Safari.
34
-
35
- ### Changed
36
-
37
- - Removed auto-focus from trigger. This caused the Safari to misbehave. Will have to figure out more conceptual fix.
38
- - Replaced ember-animated with ember-animate-css
39
-
40
- ## 1.0.6 (2019-10-18)
41
-
42
- ### Fixed
43
-
44
- - The addon works when used in external app.
45
-
46
- ## 1.0.5 (2019-10-18)
47
-
48
- ### Fixed
49
-
50
- - Add ember-animated to dependencies.
51
-
52
- ## 1.0.4 (2019-10-18)
53
-
54
- ### Fixed
55
-
56
- - Netlify SRI / redirect issues.
57
-
58
- ## 1.0.3 (2019-10-18)
59
-
60
- ### Fixed
61
-
62
- - Netlify redirects.
63
-
64
- ## 1.0.2 (2019-10-18)
65
-
66
- ### Fixed
67
-
68
- - Better texts for readme to show what is this addon about.
69
- - Make sure that examples in addon docs work.
70
-
71
- ### Changed
72
-
73
- - Completely remove dependency on tailwind-css even for the docs.
74
- - Add custom styling for the examples.
75
-
76
- ## 1.0.1 (2019-10-04)
77
-
78
- ### Fixed
79
-
80
- - Correct configuration to generate addon docs.
81
-
82
- ## 1.0.0 (2019-10-03)
83
-
84
- ### Changed
85
-
86
- - Bumped from Octane preview to ember v3.13.1.
87
-
88
- ## 0.2.0 (2019-04-06)
89
-
90
- ### Added
91
-
92
- - CHANGELOG (this file :)).
93
- - `aria-label` attributes for better accessibility.
94
- - Example of styling for documentation examples.
95
- - Ability to provide `@message` that renders inside buttons when no block is provided
96
- - Fallback `@message="delete"`
97
-
98
- ### Changed
99
-
100
- - Documentation structure.
101
- - Names of examples in documentation.
102
-
103
- ## 0.1.0 (2019-03-30)
104
-
105
- ### Added
106
-
107
- - First implementation of `ember-safe-button` that allows basic interation where `safety` dissapears upon click, `trigger` triggers action on click and `safety` gets back after timeout.
108
- - Addon has nice styling through [ember-cli-addon-docs](https://ember-learn.github.io/ember-cli-addon-docs/).
package/LICENSE.md DELETED
@@ -1,9 +0,0 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2019
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
-
7
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
-
9
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,114 +0,0 @@
1
- // TODO: https://github.com/animate-css/animate.css/blob/main/source/flippers/flipOutX.css
2
- // TODO: https://github.com/animate-css/animate.css/blob/main/source/flippers/flipInX.css
3
- export default {
4
- safety: {
5
- unlocking: {
6
- keyframes: [
7
- { transform: 'perspective(400px)', offset: 0 },
8
- {
9
- transform: 'perspective(400px) rotate3d(1, 0, 0, -20deg)',
10
- offset: 0.3 / 2,
11
- opacity: 1,
12
- },
13
- {
14
- transform: 'perspective(400px) rotate3d(1, 0, 0, 90deg)',
15
- offset: 1 / 2,
16
- opacity: 0,
17
- },
18
- ],
19
- options: {
20
- duration: 1000,
21
- fill: 'forwards',
22
- easing: 'ease-in',
23
- },
24
- },
25
- locking: {
26
- keyframes: [
27
- {
28
- transform: 'perspective(400px) rotate3d(1, 0, 0, 90deg)',
29
- offset: 0,
30
- opacity: 0,
31
- },
32
- {
33
- transform: ['perspective(400px)', 'rotate3d(1, 0, 0, -20deg)'],
34
- offset: 0.4 / 2 + 0.5,
35
- },
36
- {
37
- transform: ['perspective(400px)', 'rotate3d(1, 0, 0, 10deg)'],
38
- offset: 0.6 / 2 + 0.5,
39
- opacity: 1,
40
- },
41
- {
42
- transform: ['perspective(400px)', 'rotate3d(1, 0, 0, -5deg)'],
43
- offset: 0.8 / 2 + 0.5,
44
- opacity: 1,
45
- },
46
- {
47
- transform: 'perspective(400px)',
48
- offset: 1 / 2 + 0.5,
49
- opacity: 1,
50
- },
51
- ],
52
- options: {
53
- duration: 1000,
54
- fill: 'forwards',
55
- easing: 'ease-in',
56
- },
57
- },
58
- },
59
- trigger: {
60
- unlocking: {
61
- keyframes: [
62
- {
63
- transform: 'perspective(400px) rotate3d(1, 0, 0, 90deg)',
64
- offset: 0 + 0.5,
65
- opacity: 0,
66
- },
67
- {
68
- transform: 'perspective(400px) rotate3d(1, 0, 0, -20deg)',
69
- offset: 0.4 / 2 + 0.5,
70
- },
71
- {
72
- transform: 'perspective(400px) rotate3d(1, 0, 0, 10deg)',
73
- offset: 0.6 / 2 + 0.5,
74
- opacity: 1,
75
- },
76
- {
77
- transform: 'perspective(400px) rotate3d(1, 0, 0, -5deg)',
78
- offset: 0.8 / 2 + 0.5,
79
- opacity: 1,
80
- },
81
- {
82
- transform: 'perspective(400px)',
83
- offset: 1 / 2 + 0.5,
84
- opacity: 1,
85
- },
86
- ],
87
- options: {
88
- duration: 1000,
89
- fill: 'forwards',
90
- easing: 'ease-in',
91
- },
92
- },
93
- locking: {
94
- keyframes: [
95
- { transform: 'perspective(400px)', offset: 0 },
96
- {
97
- transform: 'perspective(400px) rotate3d(1, 0, 0, -20deg)',
98
- offset: 0.3 / 2,
99
- opacity: 1,
100
- },
101
- {
102
- transform: 'perspective(400px) rotate3d(1, 0, 0, 90deg)',
103
- offset: 1 / 2,
104
- opacity: 0,
105
- },
106
- ],
107
- options: {
108
- duration: 1000,
109
- fill: 'forwards',
110
- easing: 'ease-in',
111
- },
112
- },
113
- },
114
- };
@@ -1,15 +0,0 @@
1
- import poing from './poing';
2
- import slide from './slide';
3
- import roll from './roll';
4
- import flip from './flip';
5
- import liftBars from './lift-bars';
6
- import zoom from './zoom';
7
-
8
- export default {
9
- poing,
10
- slide,
11
- flip,
12
- zoom,
13
- roll,
14
- 'lift-bars': liftBars,
15
- };
@@ -1,50 +0,0 @@
1
- export default {
2
- safety: {
3
- unlocking: {
4
- keyframes: [
5
- { transform: 'translate3d(0, 0, 0)' },
6
- { transform: 'translate3d(0, -100%, 0)' },
7
- ],
8
- options: {
9
- duration: 1000,
10
- fill: 'both',
11
- easing: 'ease',
12
- },
13
- },
14
- locking: {
15
- keyframes: [
16
- { transform: 'translate3d(0, -100%, 0)' },
17
- { transform: 'translate3d(0, 0, 0)' },
18
- ],
19
- options: {
20
- duration: 1000,
21
- fill: 'both',
22
- easing: 'ease',
23
- },
24
- },
25
- },
26
- trigger: {
27
- unlocking: {
28
- keyframes: [
29
- // { transform: 'translateX(100%)' },
30
- // { transform: 'translateX(0)' },
31
- ],
32
- options: {
33
- duration: 1000,
34
- fill: 'both',
35
- easing: 'ease',
36
- },
37
- },
38
- locking: {
39
- keyframes: [
40
- // { transform: 'translateX(0)' },
41
- // { transform: 'translateX(100%)' },
42
- ],
43
- options: {
44
- duration: 1000,
45
- fill: 'both',
46
- easing: 'ease',
47
- },
48
- },
49
- },
50
- };
@@ -1,99 +0,0 @@
1
- export default {
2
- safety: {
3
- unlocking: {
4
- keyframes: [
5
- { transform: 'scale(1)', opacity: 1, offset: 0 },
6
- {
7
- transform: 'translateX(0px) scale(0.7)',
8
- opacity: 0.7,
9
- offset: 0.2,
10
- },
11
- {
12
- transform: 'translateX(-2000px) scale(0.7)',
13
- opacity: 0.7,
14
- offset: 1,
15
- },
16
- ],
17
- options: {
18
- duration: 2000,
19
- fill: 'both',
20
- easing: 'ease',
21
- },
22
- },
23
- locking: {
24
- keyframes: [
25
- {
26
- transform: 'translateX(-2000px) scale(0.7)',
27
- opacity: 0.7,
28
- offset: 0,
29
- },
30
- {
31
- transform: 'translateX(0px) scale(0.7)',
32
- opacity: 0.7,
33
- offset: 0.8,
34
- },
35
- { transform: 'scale(1)', opacity: 1, offset: 1 },
36
- ],
37
- options: {
38
- duration: 2000,
39
- fill: 'both',
40
- easing: 'ease',
41
- },
42
- },
43
- },
44
- trigger: {
45
- unlocking: {
46
- keyframes: [
47
- {
48
- opacity: 0,
49
- transform: 'translate3d(3000px, 0, 0) scaleX(3)',
50
- offset: 0,
51
- },
52
- {
53
- opacity: 1,
54
- transform: 'translate3d(-25px, 0, 0) scaleX(1)',
55
- offset: 0.6,
56
- },
57
- {
58
- opacity: 1,
59
- transform: 'translate3d(10px, 0, 0) scaleX(0.98)',
60
- offset: 0.75,
61
- },
62
- {
63
- opacity: 1,
64
- transform: 'translate3d(-5px, 0, 0) scaleX(0.995)',
65
- offset: 0.9,
66
- },
67
- {
68
- opacity: 1,
69
- transform: 'translate3d(0, 0, 0)',
70
- offset: 1,
71
- },
72
- ],
73
- options: {
74
- duration: 2000,
75
- fill: 'both',
76
- easing: 'cubic-bezier(0.215, 0.61, 0.355, 1)',
77
- },
78
- },
79
- locking: {
80
- keyframes: [
81
- {
82
- opacity: 1,
83
- transform: 'translate3d(-20px, 0, 0) scaleX(0.9)',
84
- offset: 0.2,
85
- },
86
- {
87
- opacity: 0,
88
- transform: 'translate3d(2000px, 0, 0) scaleX(2)',
89
- offset: 1,
90
- },
91
- ],
92
- options: {
93
- duration: 2000,
94
- fill: 'both',
95
- easing: 'ease',
96
- },
97
- },
98
- },
99
- };
@@ -1,50 +0,0 @@
1
- export default {
2
- safety: {
3
- unlocking: {
4
- keyframes: [
5
- { transform: 'translateX(0)' },
6
- { transform: 'translateX(-100%) rotate(-180deg)' },
7
- ],
8
- options: {
9
- duration: 1000,
10
- fill: 'both',
11
- easing: 'ease',
12
- },
13
- },
14
- locking: {
15
- keyframes: [
16
- { transform: 'translateX(-100%) rotate(-180deg)' },
17
- { transform: 'translateX(0)' },
18
- ],
19
- options: {
20
- duration: 1000,
21
- fill: 'both',
22
- easing: 'ease',
23
- },
24
- },
25
- },
26
- trigger: {
27
- unlocking: {
28
- keyframes: [
29
- { transform: 'translateX(100%) rotate(180deg)' },
30
- { transform: 'translateX(0)' },
31
- ],
32
- options: {
33
- duration: 1000,
34
- fill: 'both',
35
- easing: 'ease',
36
- },
37
- },
38
- locking: {
39
- keyframes: [
40
- { transform: 'translateX(0)' },
41
- { transform: 'translateX(100%) rotate(180deg)' },
42
- ],
43
- options: {
44
- duration: 1000,
45
- fill: 'both',
46
- easing: 'ease',
47
- },
48
- },
49
- },
50
- };
@@ -1,50 +0,0 @@
1
- export default {
2
- safety: {
3
- unlocking: {
4
- keyframes: [
5
- { transform: 'translateX(0)' },
6
- { transform: 'translateX(-100%)' },
7
- ],
8
- options: {
9
- duration: 1000,
10
- fill: 'both',
11
- easing: 'ease',
12
- },
13
- },
14
- locking: {
15
- keyframes: [
16
- { transform: 'translateX(-100%)' },
17
- { transform: 'translateX(0)' },
18
- ],
19
- options: {
20
- duration: 1000,
21
- fill: 'both',
22
- easing: 'ease',
23
- },
24
- },
25
- },
26
- trigger: {
27
- unlocking: {
28
- keyframes: [
29
- { transform: 'translateX(100%)' },
30
- { transform: 'translateX(0)' },
31
- ],
32
- options: {
33
- duration: 1000,
34
- fill: 'both',
35
- easing: 'ease',
36
- },
37
- },
38
- locking: {
39
- keyframes: [
40
- { transform: 'translateX(0)' },
41
- { transform: 'translateX(100%)' },
42
- ],
43
- options: {
44
- duration: 1000,
45
- fill: 'both',
46
- easing: 'ease',
47
- },
48
- },
49
- },
50
- };
@@ -1,52 +0,0 @@
1
- export default {
2
- safety: {
3
- unlocking: {
4
- keyframes: [
5
- { offset: 0, transform: 'translate3d(0, 0, 0)' },
6
- { offset: 1, transform: 'translate3d(100%, 0, 0)' },
7
- ],
8
- options: {
9
- duration: 1000,
10
- fill: 'both',
11
- easing: 'ease',
12
- },
13
- },
14
- locking: {
15
- keyframes: [
16
- { offset: 0, transform: 'translate3d(-100%, 0, 0)' },
17
- { offset: 1, transform: 'translate3d(0, 0, 0)' },
18
- ],
19
- options: {
20
- duration: 1000,
21
- fill: 'both',
22
- easing: 'ease',
23
- },
24
- },
25
- },
26
- trigger: {
27
- unlocking: {
28
- keyframes: [
29
- { offset: 0, opacity: 0, transform: 'scale3d(0.3, 0.3, 0.3)' },
30
- { offset: 0.5, opacity: 1 },
31
- { offset: 1, opacity: 1 },
32
- ],
33
- options: {
34
- duration: 1000,
35
- fill: 'both',
36
- easing: 'ease',
37
- },
38
- },
39
- locking: {
40
- keyframes: [
41
- { offset: 0, opacity: 1 },
42
- { offset: 0.5, opacity: 0, transform: 'scale3d(0.3, 0.3, 0.3)' },
43
- { offset: 1, opacity: 0 },
44
- ],
45
- options: {
46
- duration: 1000,
47
- fill: 'both',
48
- easing: 'ease',
49
- },
50
- },
51
- },
52
- };
@@ -1,35 +0,0 @@
1
- <div class='ember-safe-button' ...attributes>
2
- {{#if (has-block)}}
3
- {{yield
4
- (hash
5
- trigger=(component
6
- 'trigger'
7
- onClick=@onConfirm
8
- safetyStatus=this.safetyStatus
9
- displayedMessage=this.displayedMessage
10
- webAnimations=this.webAnimations.trigger
11
- )
12
- safety=(component
13
- 'safety'
14
- onClick=this.onUnlocking
15
- safetyStatus=this.safetyStatus
16
- displayedMessage=this.displayedMessage
17
- webAnimations=this.webAnimations.safety
18
- )
19
- )
20
- }}
21
- {{else}}
22
- <Trigger
23
- @onClick={{@onConfirm}}
24
- @safetyStatus={{this.safetyStatus}}
25
- @displayedMessage={{this.displayedMessage}}
26
- @webAnimations={{this.webAnimations.trigger}}
27
- />
28
- <Safety
29
- @onClick={{this.onUnlocking}}
30
- @safetyStatus={{this.safetyStatus}}
31
- @displayedMessage={{this.displayedMessage}}
32
- @webAnimations={{this.webAnimations.safety}}
33
- />
34
- {{/if}}
35
- </div>