lupine.components 1.1.14 → 1.1.15

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lupine.components",
3
- "version": "1.1.14",
3
+ "version": "1.1.15",
4
4
  "license": "MIT",
5
5
  "author": "uuware.com",
6
6
  "homepage": "https://github.com/uuware/lupine.js",
@@ -15,6 +15,9 @@ export type TogglePlayButtonProps = {
15
15
  checked?: boolean;
16
16
  onClick?: (checked: boolean) => void;
17
17
  hook?: ToggleBaseHookProps;
18
+ textColor?: string;
19
+ backgroundColor?: string;
20
+ noWave?: boolean;
18
21
  };
19
22
  export const TogglePlayButton = (props: TogglePlayButtonProps) => {
20
23
  const css: CssProps = {
@@ -25,12 +28,16 @@ export const TogglePlayButton = (props: TogglePlayButtonProps) => {
25
28
  display: 'flex',
26
29
  alignItems: 'center',
27
30
  justifyContent: 'center',
31
+ transition: 'all 0.3s',
32
+ cursor: 'pointer',
33
+ '&:hover': {
34
+ opacity: 0.8,
35
+ },
28
36
  '.play-icon': {
29
37
  width: '50%',
30
38
  height: '50%',
31
39
  transition: 'all 0.2s ease-in-out',
32
40
  backgroundColor: '#fff',
33
- cursor: 'pointer',
34
41
  },
35
42
  '&.toggle-off .play-icon': {
36
43
  clipPath: 'polygon(20% 0, 20% 100%, 90% 50%, 90% 50%, 90% 50%, 90% 50%, 90% 50%, 90% 50%, 90% 50%)',
@@ -46,16 +53,25 @@ export const TogglePlayButton = (props: TogglePlayButtonProps) => {
46
53
  },
47
54
  };
48
55
  bindGlobalStyle('toggle-play-button-component', css);
49
- return (
56
+
57
+ const Btn = () => (
58
+ <div
59
+ class={`toggle-play-button-component toggle-placeholder ${props.checked ? 'toggle-on' : 'toggle-off'}${
60
+ props.disabled ? ' disabled' : ''
61
+ }`}
62
+ style={{ backgroundColor: props.backgroundColor }}
63
+ >
64
+ <div class='play-icon' style={{ backgroundColor: props.textColor }}></div>
65
+ </div>
66
+ );
67
+ return props.noWave ? (
68
+ <ToggleBase {...props}>
69
+ <Btn />
70
+ </ToggleBase>
71
+ ) : (
50
72
  <ToggleBase {...props}>
51
73
  <ToggleWaveFrame>
52
- <div
53
- class={`toggle-play-button-component toggle-placeholder ${props.checked ? 'toggle-on' : 'toggle-off'}${
54
- props.disabled ? ' disabled' : ''
55
- }`}
56
- >
57
- <div class='play-icon'></div>
58
- </div>
74
+ <Btn />
59
75
  </ToggleWaveFrame>
60
76
  </ToggleBase>
61
77
  );