git.iko.soy/rowtype-yoga/ry-blocks
on main help sign in
Update framer motion
commit6802898f8dcf3e2f52a16c2f557606f6565fc940 authorMark Eibes <mark.eibes@gmail.com> dateSat 11 Dec 2021, 18:27 (5 years ago) parent3928060
23 files changed+10375−10093
.storybook/main.js+6−3 .vscode/settings.json+1−1 package.json+12−12 src/Yoga/Block/Atom/Segmented/View/ActiveIndicator.purs+82−77 src/Yoga/Block/Atom/Toggle/View.purs+119−105 src/Yoga/Block/Icon/SVG/BG.svg+1 src/Yoga/Block/Icon/SVG/Bg.purs+116 src/Yoga/Block/Icon/SVG/HeroiconCalendar.purs+22 src/Yoga/Block/Icon/SVG/HeroiconCalendar.svg+1 src/Yoga/Block/Icon/SVG/HeroiconClock.purs+22 src/Yoga/Block/Icon/SVG/HeroiconClock.svg+1 src/Yoga/Block/Icon/SVG/HeroiconGroup.purs+22 src/Yoga/Block/Icon/SVG/HeroiconGroup.svg+1 src/Yoga/Block/Icon/SVG/HeroiconMoon.purs+22 src/Yoga/Block/Icon/SVG/HeroiconMoon.svg+1 src/Yoga/Block/Icon/SVG/HeroiconSun.purs+22 src/Yoga/Block/Icon/SVG/HeroiconSun.svg+1 src/Yoga/Block/Icon/SVG/TMP.svg+1 src/Yoga/Block/Icon/SVG/Tmp.purs+172 src/Yoga/Block/Icon/SVG/WhatsAppLogo.purs+77 src/Yoga/Block/Icon/SVG/WhatsAppLogo.svg+1 webpack.common.js+3−3 yarn.lock+9669−9892
.storybook/main.js+6−3
@@ -1,4 +1,7 @@
11module.exports = {
2− stories: ['../output/**/*.Story/index.js'],
3− addons: []
4−};
2+ core: {
3+ builder: "webpack5",
4+ },
5+ stories: ["../output/**/*.Story/index.js"],
6+ addons: [],
7+}
.vscode/settings.json+1−1
@@ -1,6 +1,6 @@
11{
22 "editor.formatOnSave": true,
3− "workbench.colorTheme": "Kai Light Accent",
3+ "workbench.colorTheme": "Abyss",
44 "search.useGlobalIgnoreFiles": true,
55 "files.watcherExclude": {
66 "**/.spago/**": true,
package.json+12−12
@@ -9,9 +9,11 @@
99 "devDependencies": {
1010 "@babel/core": "^7.10.5",
1111 "@pmmmwh/react-refresh-webpack-plugin": "^0.4.2",
12− "@storybook/addons": "^6.3.4",
13− "@storybook/react": "^6.3.4",
14− "@storybook/theming": "^6.3.4",
12+ "@storybook/addons": "^6.4.9",
13+ "@storybook/builder-webpack5": "^6.4.9",
14+ "@storybook/manager-webpack5": "^6.4.9",
15+ "@storybook/react": "^6.4.9",
16+ "@storybook/theming": "^6.4.9",
1517 "@testing-library/react": "^11.0.4",
1618 "@testing-library/user-event": "^12.1.7",
1719 "babel-loader": "^8.1.0",
@@ -20,17 +22,15 @@
2022 "html-webpack-plugin": "^4.5.0",
2123 "jsdom": "^16.3.0",
2224 "jsdom-global": "^3.0.2",
23− "purescript": "^0.14.3",
2425 "react-refresh": "^0.8.3",
2526 "rimraf": "^3.0.2",
2627 "source-map": "GerHobbelt/source-map#patch-8",
2728 "source-map-loader": "^1.1.2",
28− "spago": "^0.20.3",
2929 "svg2psreact": "^2.1.0",
30− "webpack": "^4.0.0",
31− "webpack-cli": "^4.0.0",
32− "webpack-dev-server": "^3.11.0",
33− "webpack-merge": "^5.0.9"
30+ "webpack": "^5.0.0",
31+ "webpack-cli": "^4.9.1",
32+ "webpack-dev-server": "^4.6.0",
33+ "webpack-merge": "^5.8.0"
3434 },
3535 "scripts": {
3636 "clean": "rimraf node_modules output dce-output .spago dist/* *.lock dist",
@@ -55,9 +55,9 @@
5555 "@emotion/react": "^11.4.0",
5656 "@popperjs/core": "^2.6.0",
5757 "downshift": "^6.1.2",
58− "framer-motion": "^4.0.3",
59− "react": "^16.0.0",
60− "react-dom": "^16.0.0",
58+ "framer-motion": "^5.3.3",
59+ "react": "^17.0.0",
60+ "react-dom": "^17.0.0",
6161 "react-intersection-observer": "^8.32.0",
6262 "react-popper": "^2.2.4",
6363 "react-syntax-highlighter": "^15.3.1"
src/Yoga/Block/Atom/Segmented/View/ActiveIndicator.purs+82−77
@@ -6,6 +6,7 @@ import Control.MonadZero as MZ
66import Data.Traversable (traverse)
77import Data.TwoOrMore (TwoOrMore)
88import Data.TwoOrMore as TwoOrMore
9+import Effect.Class.Console as Console
910import Effect.Unsafe (unsafePerformEffect)
1011import Foreign.Object as Object
1112import Framer.Motion (VariantLabel)
@@ -40,7 +41,7 @@ component =
4041 \(props ∷ Props) -> React.do
4142 maybeAnimationVariants /\ setVariants <- useState' Nothing
4243 variantIndex /\ modVariantIndex <- useState props.activeItemIndex
43− maybeDragX /\ setDragX <- useState' Nothing
44+ maybeDragXRef <- useRef Nothing
4445 { scrollX, scrollY } <- useScrollPosition
4546 activeLeft <- useMotionValue 0.0
4647 activeWidth <- useMotionValue 0.0
@@ -50,14 +51,16 @@ component =
5051 unless (maybeAnimationVariants == Just styles) do
5152 setVariants (Just styles)
5253 mempty
53− useLayoutEffect maybeDragX do
54− case maybeDragX, maybeAnimationVariants of
55− Just x, Just animationVariants -> do
56− let { left, width } = handleDrag { activeItemIndex: props.activeItemIndex, animationVariants, x }
57− activeLeft # MotionValue.set left
58− activeWidth # MotionValue.set width
59− _, _ -> mempty
60− mempty
54+ let
55+ setDragXRef new = do
56+ writeRef maybeDragXRef new
57+ maybeDragX <- readRef maybeDragXRef
58+ case maybeDragX, maybeAnimationVariants of
59+ Just x, Just animationVariants -> do
60+ let { left, width } = handleDrag { activeItemIndex: props.activeItemIndex, animationVariants, x }
61+ activeLeft # MotionValue.set left
62+ activeWidth # MotionValue.set width
63+ _, _ -> mempty
6164 useEffect props.activeItemIndex do
6265 modVariantIndex (const props.activeItemIndex)
6366 mempty
@@ -84,63 +87,66 @@ component =
8487 { className: "ry-active-segmented-element-wrapper"
8588 , css: Style.activeElementWrapper
8689 , children:
87− [ Emotion.element Motion.div
88− { css: Style.activeElement
89− , layout: Motion.layout true
90− , custom: Motion.customProp (({ childRefs: props.activeItemRefs, scrollX, scrollY }) ∷ Custom)
91− , variants
92− , className: "ry-active-segmented-element"
93− , initial: Motion.initial $ indexToVariant props.activeItemIndex
94− , drag: Motion.drag "x"
95− , dragMomentum: Motion.dragMomentum false
96− , animate: Motion.animate $ indexToVariant variantIndex
97− , style:
98− css
99− { left: activeLeft
100− , width: activeWidth
101− }
102− , whileTap: Motion.whileTap $ css { scaleY: 0.8, scaleX: 0.95, y: -1.0 }
103− , onDragStart:
104− Motion.onDragStart \_ pi -> do
105− maybeBbox <- getBoundingBoxFromRef (TwoOrMore.head props.activeItemRefs)
106− for_ maybeBbox \bbox ->
107− setDragX (Just (pi.point.x - bbox.left))
108− , onDrag:
109− Motion.onDrag \_ pi -> do
110− when (isJust maybeDragX) do
111− maybeBbox <- getBoundingBoxFromRef (TwoOrMore.head props.activeItemRefs)
112− for_ maybeBbox \bbox ->
113− setDragX (Just (pi.point.x - bbox.left))
114− , onDragEnd:
115− Motion.onDragEnd \_ _ -> do
116− let
117− x = maybeDragX # fromMaybe' \_ -> unsafeCrashWith "no x"
118− newIdx =
119− findOverlapping
120− props.activeItemIndex
121− animationVariants
122− x
123− newItem = fromMaybe'
124− (\_ -> TwoOrMore.head props.buttonContents)
125− (props.buttonContents TwoOrMore.!! newIdx)
126− v =
127− animationVariants TwoOrMore.!! newIdx
128− # fromMaybe' \_ -> unsafeCrashWith "omg"
129− activeLeft # MotionValue.set v.left
130− activeWidth # MotionValue.set v.width
131− props.updateActiveItem newItem newIdx
132− setDragX Nothing
133− , dragElastic: Motion.dragElastic false
134− , dragConstraints: Motion.dragConstraintsBoundingBox { left: 0, right: 0, top: 0, bottom: 0 }
135− , transition:
136− Motion.transition
137− { type: "tween"
138− , duration: if isJust maybeDragX then 0.0 else 0.167
139− , ease: "easeOut"
140− }
141− , _aria: Object.fromHomogeneous { hidden: "true" }
142− }
143− ]
90+ [ Emotion.element Motion.div
91+ { css: Style.activeElement
92+ , layout: Motion.layout true
93+ , custom: Motion.customProp (({ childRefs: props.activeItemRefs, scrollX, scrollY }) ∷ Custom)
94+ , variants
95+ , className: "ry-active-segmented-element"
96+ , initial: Motion.initial $ indexToVariant props.activeItemIndex
97+ , drag: Motion.drag "x"
98+ , dragMomentum: Motion.dragMomentum false
99+ , animate: Motion.animate $ indexToVariant variantIndex
100+ , style:
101+ css
102+ { left: activeLeft
103+ , width: activeWidth
104+ }
105+ , whileTap: Motion.whileTap $ css { scaleY: 0.8, scaleX: 0.95, y: -1.0 }
106+ , onDragStart:
107+ Motion.onDragStart \_ pi -> do
108+ maybeBbox <- getBoundingBoxFromRef (TwoOrMore.head props.activeItemRefs)
109+ for_ maybeBbox \bbox ->
110+ setDragXRef (Just (pi.point.x - bbox.left))
111+ , onDrag:
112+ Motion.onDrag \_ pi -> do
113+ Console.log "Marlene on the wall"
114+ maybeDragX <- readRef maybeDragXRef
115+ when (isJust maybeDragX) do
116+ maybeBbox <- getBoundingBoxFromRef (TwoOrMore.head props.activeItemRefs)
117+ for_ maybeBbox \bbox ->
118+ setDragXRef (Just (pi.point.x - bbox.left))
119+ , onDragEnd:
120+ Motion.onDragEnd \_ _ -> do
121+ maybeDragX <- readRef maybeDragXRef
122+ let
123+ x = maybeDragX # fromMaybe' \_ -> unsafeCrashWith "no x"
124+ newIdx =
125+ findOverlapping
126+ props.activeItemIndex
127+ animationVariants
128+ x
129+ newItem = fromMaybe'
130+ (\_ -> TwoOrMore.head props.buttonContents)
131+ (props.buttonContents TwoOrMore.!! newIdx)
132+ v =
133+ animationVariants TwoOrMore.!! newIdx
134+ # fromMaybe' \_ -> unsafeCrashWith "omg"
135+ activeLeft # MotionValue.set v.left
136+ activeWidth # MotionValue.set v.width
137+ props.updateActiveItem newItem newIdx
138+ writeRef maybeDragXRef Nothing
139+ , dragElastic: Motion.dragElastic false
140+ , dragConstraints: Motion.dragConstraintsBoundingBox { left: 0, right: 0, top: 0, bottom: 0 }
141+ , transition:
142+ Motion.transition
143+ { type: "tween"
144+ , duration: if isJust (unsafePerformEffect (readRef maybeDragXRef)) then 0.0 else 0.167
145+ , ease: "easeOut"
146+ }
147+ , _aria: Object.fromHomogeneous { hidden: "true" }
148+ }
149+ ]
144150 }
145151
146152getStyles ∷ TwoOrMore (Ref (Nullable Node)) -> Effect (TwoOrMore BBox)
@@ -177,12 +183,12 @@ findOverlapping activeIndex styles x =
177183 let tooFarRight = MZ.guard (x >= lst.left) $> TwoOrMore.length styles - 1
178184 TwoOrMore.findIndex inside styles <|> tooFarLeft <|> tooFarRight
179185
180−handleDrag ∷
181− { activeItemIndex ∷ Int
182− , animationVariants ∷ TwoOrMore BBox
183− , x ∷ Number
184− } ->
185− { left ∷ Number, width ∷ Number }
186+handleDrag
187+ ∷ { activeItemIndex ∷ Int
188+ , animationVariants ∷ TwoOrMore BBox
189+ , x ∷ Number
190+ }
191+ -> { left ∷ Number, width ∷ Number }
186192handleDrag { x, activeItemIndex, animationVariants } = do
187193 let idx = findOverlapping activeItemIndex animationVariants x
188194 let av = animationVariants
@@ -223,8 +229,7 @@ handleDrag { x, activeItemIndex, animationVariants } = do
223229 let width = right - left
224230 if x < firstVariant.left then
225231 { left: firstVariant.left, width: firstVariant.width }
226− else
227− if x >= lastVariant.left + lastVariant.width then do
228− { left: lastVariant.left, width: lastVariant.width }
229− else do
230− { left, width }
232+ else if x >= lastVariant.left + lastVariant.width then do
233+ { left: lastVariant.left, width: lastVariant.width }
234+ else do
235+ { left, width }
src/Yoga/Block/Atom/Toggle/View.purs+119−105
@@ -71,32 +71,34 @@ rawComponent =
7171 buttonRef <- useRef null
7272 toggleRef <- useRef null
7373 tapState <- useRef TapNotAllowed
74− dragState /\ setDragState <- React.useState' NotDragging
75− useEffect dragState do
76− case dragState of
77− NotDragging -> mempty
78− Dragging _ -> do
79− writeRef tapState TapNotAllowed
80− DragDone { startX, endX } -> do
81− maybeBbox <- getBoundingBoxFromRef buttonRef
82− for_ maybeBbox \bbox -> do
83− if endX - startX <= (bbox.left - startX) + (bbox.width / 2.0) then do
84− setTogglePosition ToggleIsLeft
85− else do
86− setTogglePosition ToggleIsRight
87− mempty
74+ dragStateRef <- useRef NotDragging
75+ let
76+ setDragState new = do
77+ writeRef dragStateRef new
78+ dragState <- readRef dragStateRef
79+ case dragState of
80+ NotDragging -> mempty
81+ Dragging _ -> do
82+ writeRef tapState TapNotAllowed
83+ DragDone { startX, endX } -> do
84+ maybeBbox <- getBoundingBoxFromRef buttonRef
85+ for_ maybeBbox \bbox -> do
86+ if endX - startX <= (bbox.left - startX) + (bbox.width / 2.0) then do
87+ setTogglePosition ToggleIsLeft
88+ else do
89+ setTogglePosition ToggleIsRight
8890 let
8991 buttonVariants =
9092 { left:
91− { backgroundColor:
92− (Emotion.str <<< Color.cssStringRGBA <$> props.backgroundLeft)
93− ?|| (Emotion.str colour.backgroundLayer3)
94− }
93+ { backgroundColor:
94+ (Emotion.str <<< Color.cssStringRGBA <$> props.backgroundLeft)
95+ ?|| (Emotion.str colour.backgroundLayer3)
96+ }
9597 , right:
96− { backgroundColor:
97− (Emotion.str <<< Color.cssStringRGBA <$> props.backgroundRight)
98− ?|| (Emotion.str colour.success)
99− }
98+ { backgroundColor:
99+ (Emotion.str <<< Color.cssStringRGBA <$> props.backgroundRight)
100+ ?|| (Emotion.str colour.success)
101+ }
100102 }
101103 buttonVariant = Motion.makeVariantLabels buttonVariants
102104 -- components
@@ -108,40 +110,43 @@ rawComponent =
108110 , css: Style.button <>? props.css
109111 , variants: Motion.variants buttonVariants
110112 , initial:
111− Motion.initial case togglePosition of
112− ToggleIsRight -> buttonVariant.right
113− ToggleIsLeft -> buttonVariant.left
113+ Motion.initial case togglePosition of
114+ ToggleIsRight -> buttonVariant.right
115+ ToggleIsLeft -> buttonVariant.left
114116 , animate:
115− Motion.animate case togglePosition of
116− ToggleIsRight -> buttonVariant.right
117− ToggleIsLeft -> buttonVariant.left
117+ Motion.animate case togglePosition of
118+ ToggleIsRight -> buttonVariant.right
119+ ToggleIsLeft -> buttonVariant.left
118120 , value: show togglePosition
119121 , onClick: handler preventDefault \_ -> setTogglePosition (flipToggle togglePosition)
120122 , style: props.style
121123 , _data: Object.singleton "testid" "toggle-testid"
122124 , role: "switch"
123125 , _aria:
124− Object.fromHomogeneous
125− { checked:
126− case togglePosition of
127− ToggleIsLeft -> "false"
128− ToggleIsRight -> "true"
129− }
130− <>? (props.ariaLabel <#> Object.singleton "label")
126+ Object.fromHomogeneous
127+ { checked:
128+ case togglePosition of
129+ ToggleIsLeft -> "false"
130+ ToggleIsRight -> "true"
131+ }
132+ <>? (props.ariaLabel <#> Object.singleton "label")
131133 , ref: buttonRef
132134 , children
133135 }
134136 textContainer =
135137 div
136− </* { className: "ry-toggle-text"
138+ </*
139+ { className: "ry-toggle-text"
137140 , css: Style.toggleTextContainer
138141 }
139142 textOnContainer =
140143 div
141− </* { className: "ry-toggle-text-on"
144+ </*
145+ { className: "ry-toggle-text-on"
142146 , css: Style.toggleText
143147 }
144− /> [ guard (togglePosition == ToggleIsRight)
148+ />
149+ [ guard (togglePosition == ToggleIsRight)
145150 $ textOn
146151 [ props.left
147152 ?|| (Icon.component </> { icon: SVGIcon.on, stroke: Style.successTextColour })
@@ -149,10 +154,12 @@ rawComponent =
149154 ]
150155 textOffContainer =
151156 div
152− </* { className: "ry-toggle-text-off"
157+ </*
158+ { className: "ry-toggle-text-off"
153159 , css: Style.toggleText
154160 }
155− /> [ guard (togglePosition == ToggleIsLeft)
161+ />
162+ [ guard (togglePosition == ToggleIsLeft)
156163 $ textOff
157164 [ props.right
158165 ?|| (Icon.component </> { icon: SVGIcon.off, stroke: Style.disabledTextColour })
@@ -160,7 +167,8 @@ rawComponent =
160167 ]
161168 textOn =
162169 Motion.div
163− </ { className: "ry-toggle-text-container"
170+ </
171+ { className: "ry-toggle-text-container"
164172 , key: "ry-toggle-text-on-container"
165173 , initial: Motion.initial $ false
166174 , animate: Motion.animate $ css { scale: 1, opacity: 1 }
@@ -168,7 +176,8 @@ rawComponent =
168176 }
169177 textOff =
170178 Motion.div
171− </ { className: "ry-toggle-text-container"
179+ </
180+ { className: "ry-toggle-text-container"
172181 , key: "ry-toggle-text-off-container"
173182 , initial: Motion.initial $ false
174183 , animate: Motion.animate $ css { scale: 1, opacity: 1 }
@@ -177,11 +186,12 @@ rawComponent =
177186 animateTextPresence = Motion.animatePresence </ {}
178187 toggle =
179188 toggleCircle
180− </> { buttonRef
189+ </>
190+ { buttonRef
181191 , toggleRef
182192 , togglePosition
183193 , onChange: setTogglePosition
184− , dragState
194+ , dragStateRef
185195 , setDragState
186196 , tapState
187197 }
@@ -198,7 +208,7 @@ toggleCircle ∷
198208 , toggleRef ∷ NodeRef
199209 , buttonRef ∷ NodeRef
200210 , togglePosition ∷ TogglePosition
201− , dragState ∷ DragState
211+ , dragStateRef ∷ Ref DragState
202212 , setDragState ∷ DragState -> Effect Unit
203213 , tapState ∷ Ref TappingState
204214 }
@@ -206,14 +216,14 @@ toggleCircle =
206216 unsafePerformEffect
207217 $ reactComponent "ToggleCircle" do
208218 \( { togglePosition
209− , onChange
210− , toggleRef
211− , buttonRef
212− , dragState
213− , setDragState
214− , tapState
215− }
216− ) -> React.do
219+ , onChange
220+ , toggleRef
221+ , buttonRef
222+ , dragStateRef
223+ , setDragState
224+ , tapState
225+ }
226+ ) -> React.do
217227 maxLeft /\ setMaxLeft <- useState' Nothing
218228 yPos /\ setYPos <- useState' Nothing
219229 useEffectAlways do
@@ -236,7 +246,8 @@ toggleCircle =
236246 toggleVariant = Motion.makeVariantLabels toggleVariants
237247 pure
238248 $ Motion.div
239− </*> { className: "ry-toggle-toggle"
249+ </*>
250+ { className: "ry-toggle-toggle"
240251 , layout: Motion.layout true
241252 , onClick: handler stopPropagation mempty
242253 , onTouchStart: handler stopPropagation mempty
@@ -247,67 +258,70 @@ toggleCircle =
247258 , key: if isNothing maxLeft then "initialising" else show yPos
248259 , dragElastic: Motion.dragElastic false
249260 , dragConstraints:
250− Motion.dragConstraintsBoundingBox
251− { left:
252− case togglePosition of
253− ToggleIsLeft -> zero
254− ToggleIsRight -> -(maxLeft <#> (_ - Style.dragWidthDelta) # fromMaybe 0.0)
255− , right:
256− case togglePosition of
257− ToggleIsRight -> zero
258− ToggleIsLeft -> maxLeft <#> (_ - Style.dragWidthDelta) # fromMaybe 0.0
259− }
261+ Motion.dragConstraintsBoundingBox
262+ { left:
263+ case togglePosition of
264+ ToggleIsLeft -> zero
265+ ToggleIsRight -> 10.0 -- [WARN] Maybe this breaks down
266+ , right:
267+ case togglePosition of
268+ ToggleIsRight -> 26.0 -- [WARN] Maybe this breaks down
269+ ToggleIsLeft -> maxLeft <#> (_ - Style.dragWidthDelta) # fromMaybe 0.0
270+ }
260271 , variants: Motion.variants toggleVariants
261272 , transition: Motion.transition { type: "tween", duration: 0.33, ease: "easeOut" }
262273 , whileTap:
263− Motion.prop
264− $ css
265− { width: "calc(var(--s2)*0.85 + 10px)"
266− , left:
267− case togglePosition of
268− ToggleIsLeft -> Style.toggleLeft
269− ToggleIsRight -> "calc(" <> Style.toggleLeft <> " - 10px)"
270− , transition: { type: "tween", duration: 0.10, ease: "easeInOut" }
271− }
274+ Motion.prop
275+ $ css
276+ { width: "calc(var(--s2)*0.85 + 10px)"
277+ , left:
278+ case togglePosition of
279+ ToggleIsLeft -> Style.toggleLeft
280+ ToggleIsRight -> "calc(" <> Style.toggleLeft <> " - 10px)"
281+ , transition: { type: "tween", duration: 0.10, ease: "easeInOut" }
282+ }
272283 , onTapStart:
273− Motion.onTapStart \_ _ -> writeRef tapState TapAllowed
284+ Motion.onTapStart \_ _ -> writeRef tapState TapAllowed
274285 , onTap:
275− Motion.onTap \_ _ -> do
276− ts <- readRef tapState
277− case ts of
278− TapAllowed -> onChange (flipToggle togglePosition)
279− _ -> mempty
280− mempty
286+ Motion.onTap \_ _ -> do
287+ ts <- readRef tapState
288+ case ts of
289+ TapAllowed -> onChange (flipToggle togglePosition)
290+ _ -> mempty
291+ mempty
281292 , onTapCancel:
282− Motion.onTapCancel \_ _ -> do
283− writeRef tapState TapNotAllowed
284− mempty
293+ Motion.onTapCancel \_ _ -> do
294+ writeRef tapState TapNotAllowed
295+ mempty
285296 , initial: Motion.initial false
286297 , animate:
287− Motion.animate case togglePosition of
288− ToggleIsLeft -> toggleVariant.left
289− ToggleIsRight -> toggleVariant.right
298+ Motion.animate case togglePosition of
299+ ToggleIsLeft -> toggleVariant.left
300+ ToggleIsRight -> toggleVariant.right
290301 , onDragStart:
291− Motion.onDragStart \_ pi -> do
292− maybeBBox <- getBoundingBoxFromRef toggleRef
293− let x = maybeBBox <#> \bbox -> bbox.left + (bbox.width / 2.0)
294− setDragState
295− $ Dragging
296− { startX: x # fromMaybe pi.point.x, currentX: pi.point.x
297− }
302+ Motion.onDragStart \_ pi -> do
303+ maybeBBox <- getBoundingBoxFromRef toggleRef
304+ let x = maybeBBox <#> \bbox -> bbox.left + (bbox.width / 2.0)
305+ setDragState
306+ $ Dragging
307+ { startX: x # fromMaybe pi.point.x
308+ , currentX: pi.point.x
309+ }
298310 , onDrag:
299− Motion.onDrag \_ pi -> do
300− case dragState of
301− Dragging { startX } -> do
302− setDragState $ Dragging { startX, currentX: pi.point.x }
303− other -> Console.warn $ i "Unexpected drag state " (show other) " in onDragEvent"
311+ Motion.onDrag \_ pi -> do
312+ dragState <- readRef dragStateRef
313+ case dragState of
314+ Dragging { startX } -> do
315+ setDragState $ Dragging { startX, currentX: pi.point.x }
316+ other -> Console.warn $ i "Unexpected drag state " (show other) " in onDragEvent"
304317 , onDragEnd:
305− Motion.onDragEnd \_ _ -> do
306− case dragState of
307− Dragging { startX } -> do
308− maybeBBox <- getBoundingBoxFromRef toggleRef
309− let x = maybeBBox <#> \bbox -> bbox.left + (bbox.width / 2.0)
310− setDragState (DragDone { startX, endX: x # fromMaybe' \_ -> unsafeCrashWith "shit" })
311− other -> Console.warn $ i "Unexpected drag state " (show other) " in onDragEndEvent"
318+ Motion.onDragEnd \_ _ -> do
319+ dragState <- readRef dragStateRef
320+ case dragState of
321+ Dragging { startX } -> do
322+ maybeBBox <- getBoundingBoxFromRef toggleRef
323+ let x = maybeBBox <#> \bbox -> bbox.left + (bbox.width / 2.0)
324+ setDragState (DragDone { startX, endX: x # fromMaybe' \_ -> unsafeCrashWith "shit" })
325+ other -> Console.warn $ i "Unexpected drag state " (show other) " in onDragEndEvent"
312326 , ref: toggleRef
313327 }
src/Yoga/Block/Icon/SVG/BG.svgnew file+1
@@ -0,0 +1 @@
1+<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200" viewBox="0 0 800 800"><path fill="#303" d="M0 0h800v800H0z"/><g fill="none" stroke="#404" stroke-width="4.1"><path d="m769 229 268 31.9M927 880 731 737l-211-77-211-122-269 61 255 165-168.5 115.5L40 599l-237-106 299-111-133-153L126.5 79.5-69-63"/><path d="m-31 229 268 32 153 121 213 111-294.5 44.5-207-156M370 905l-75-141"/><path d="m520 660 58 182 153-105 109-138-237-106-83 167-225 104 14-226 81-156 149-113 230-40L577.5 41.5 370 105 295-36 126.5 79.5 237 261 102 382 40 599-69 737l196 143"/><path d="m520-140 58.5 182.5L731-63M603 493l-64-224-302-8 133-156m532 277L539 269M390 382H102"/><path d="m-222 42 348.5 37.5L370 105l169 164 38.5-227.5L927 80 769 229l133 153-299 111 128 244M295-36l282.5 77.5M578 842l-283-78M40-201l87 281m-25 302-363-113"/></g><g fill="#505"><circle cx="769" cy="229" r="7"/><circle cx="539" cy="269" r="7"/><circle cx="603" cy="493" r="7"/><circle cx="731" cy="737" r="7"/><circle cx="520" cy="660" r="7"/><circle cx="309" cy="538" r="7"/><circle cx="295" cy="764" r="7"/><circle cx="40" cy="599" r="7"/><circle cx="102" cy="382" r="7"/><circle cx="127" cy="80" r="7"/><circle cx="370" cy="105" r="7"/><circle cx="578" cy="42" r="7"/><circle cx="237" cy="261" r="7"/><circle cx="390" cy="382" r="7"/></g></svg>
src/Yoga/Block/Icon/SVG/Bg.pursnew file+116
@@ -0,0 +1,116 @@
1+module Yoga.Block.Icon.SVG.Bg where
2+
3+import React.Basic (JSX)
4+import React.Basic.DOM as R
5+import React.Basic.DOM.SVG as SVG
6+
7+bg :: JSX
8+bg = SVG.svg
9+ { xmlns: "http://www.w3.org/2000/svg"
10+ , width: "200"
11+ , height: "200"
12+ , viewBox: "0 0 800 800"
13+ , children:
14+ [ SVG.path
15+ { fill: "#303"
16+ , d: "M0 0h800v800H0z"
17+ }
18+ , SVG.g
19+ { fill: "none"
20+ , stroke: "#404"
21+ , strokeWidth: "4.1"
22+ , children:
23+ [ SVG.path
24+ { d: "m769 229 268 31.9M927 880 731 737l-211-77-211-122-269 61 255 165-168.5 115.5L40 599l-237-106 299-111-133-153L126.5 79.5-69-63"
25+ }
26+ , SVG.path
27+ { d: "m-31 229 268 32 153 121 213 111-294.5 44.5-207-156M370 905l-75-141"
28+ }
29+ , SVG.path
30+ { d: "m520 660 58 182 153-105 109-138-237-106-83 167-225 104 14-226 81-156 149-113 230-40L577.5 41.5 370 105 295-36 126.5 79.5 237 261 102 382 40 599-69 737l196 143"
31+ }
32+ , SVG.path
33+ { d: "m520-140 58.5 182.5L731-63M603 493l-64-224-302-8 133-156m532 277L539 269M390 382H102"
34+ }
35+ , SVG.path
36+ { d: "m-222 42 348.5 37.5L370 105l169 164 38.5-227.5L927 80 769 229l133 153-299 111 128 244M295-36l282.5 77.5M578 842l-283-78M40-201l87 281m-25 302-363-113"
37+ }
38+ ]
39+ }
40+ , SVG.g
41+ { fill: "#505"
42+ , children:
43+ [ SVG.circle
44+ { cx: "769"
45+ , cy: "229"
46+ , r: "7"
47+ }
48+ , SVG.circle
49+ { cx: "539"
50+ , cy: "269"
51+ , r: "7"
52+ }
53+ , SVG.circle
54+ { cx: "603"
55+ , cy: "493"
56+ , r: "7"
57+ }
58+ , SVG.circle
59+ { cx: "731"
60+ , cy: "737"
61+ , r: "7"
62+ }
63+ , SVG.circle
64+ { cx: "520"
65+ , cy: "660"
66+ , r: "7"
67+ }
68+ , SVG.circle
69+ { cx: "309"
70+ , cy: "538"
71+ , r: "7"
72+ }
73+ , SVG.circle
74+ { cx: "295"
75+ , cy: "764"
76+ , r: "7"
77+ }
78+ , SVG.circle
79+ { cx: "40"
80+ , cy: "599"
81+ , r: "7"
82+ }
83+ , SVG.circle
84+ { cx: "102"
85+ , cy: "382"
86+ , r: "7"
87+ }
88+ , SVG.circle
89+ { cx: "127"
90+ , cy: "80"
91+ , r: "7"
92+ }
93+ , SVG.circle
94+ { cx: "370"
95+ , cy: "105"
96+ , r: "7"
97+ }
98+ , SVG.circle
99+ { cx: "578"
100+ , cy: "42"
101+ , r: "7"
102+ }
103+ , SVG.circle
104+ { cx: "237"
105+ , cy: "261"
106+ , r: "7"
107+ }
108+ , SVG.circle
109+ { cx: "390"
110+ , cy: "382"
111+ , r: "7"
112+ }
113+ ]
114+ }
115+ ]
116+ }
src/Yoga/Block/Icon/SVG/HeroiconCalendar.pursnew file+22
@@ -0,0 +1,22 @@
1+module Yoga.Block.Icon.SVG.HeroiconCalendar where
2+
3+import React.Basic (JSX)
4+import React.Basic.DOM as R
5+import React.Basic.DOM.SVG as SVG
6+
7+heroiconCalendar :: JSX
8+heroiconCalendar = SVG.svg
9+ { xmlns: "http://www.w3.org/2000/svg"
10+ , className:"h-6 w-6"
11+ , fill: "none"
12+ , viewBox: "0 0 24 24"
13+ , stroke: "currentColor"
14+ , children:
15+ [ SVG.path
16+ { strokeLinecap: "round"
17+ , strokeLinejoin: "round"
18+ , strokeWidth: "2"
19+ , d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2z"
20+ }
21+ ]
22+ }
src/Yoga/Block/Icon/SVG/HeroiconCalendar.svgnew file+1
@@ -0,0 +1 @@
1+<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2z"/></svg>
src/Yoga/Block/Icon/SVG/HeroiconClock.pursnew file+22
@@ -0,0 +1,22 @@
1+module Yoga.Block.Icon.SVG.HeroiconClock where
2+
3+import React.Basic (JSX)
4+import React.Basic.DOM as R
5+import React.Basic.DOM.SVG as SVG
6+
7+heroiconClock :: JSX
8+heroiconClock = SVG.svg
9+ { xmlns: "http://www.w3.org/2000/svg"
10+ , className:"h-6 w-6"
11+ , fill: "none"
12+ , viewBox: "0 0 24 24"
13+ , stroke: "currentColor"
14+ , children:
15+ [ SVG.path
16+ { strokeLinecap: "round"
17+ , strokeLinejoin: "round"
18+ , strokeWidth: "2"
19+ , d: "M12 8v4l3 3m6-3a9 9 0 1 1-18 0 9 9 0 0 1 18 0z"
20+ }
21+ ]
22+ }
src/Yoga/Block/Icon/SVG/HeroiconClock.svgnew file+1
@@ -0,0 +1 @@
1+<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4l3 3m6-3a9 9 0 1 1-18 0 9 9 0 0 1 18 0z"/></svg>
src/Yoga/Block/Icon/SVG/HeroiconGroup.pursnew file+22
@@ -0,0 +1,22 @@
1+module Yoga.Block.Icon.SVG.HeroiconGroup where
2+
3+import React.Basic (JSX)
4+import React.Basic.DOM as R
5+import React.Basic.DOM.SVG as SVG
6+
7+heroiconGroup :: JSX
8+heroiconGroup = SVG.svg
9+ { xmlns: "http://www.w3.org/2000/svg"
10+ , className:"h-6 w-6"
11+ , fill: "none"
12+ , viewBox: "0 0 24 24"
13+ , stroke: "currentColor"
14+ , children:
15+ [ SVG.path
16+ { strokeLinecap: "round"
17+ , strokeLinejoin: "round"
18+ , strokeWidth: "2"
19+ , d: "M17 20h5v-2a3 3 0 0 0-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 0 1 5.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 0 1 9.288 0M15 7a3 3 0 1 1-6 0 3 3 0 0 1 6 0zm6 3a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM7 10a2 2 0 1 1-4 0 2 2 0 0 1 4 0z"
20+ }
21+ ]
22+ }
src/Yoga/Block/Icon/SVG/HeroiconGroup.svgnew file+1
@@ -0,0 +1 @@
1+<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 20h5v-2a3 3 0 0 0-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 0 1 5.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 0 1 9.288 0M15 7a3 3 0 1 1-6 0 3 3 0 0 1 6 0zm6 3a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM7 10a2 2 0 1 1-4 0 2 2 0 0 1 4 0z"/></svg>
src/Yoga/Block/Icon/SVG/HeroiconMoon.pursnew file+22
@@ -0,0 +1,22 @@
1+module Yoga.Block.Icon.SVG.HeroiconMoon where
2+
3+import React.Basic (JSX)
4+import React.Basic.DOM as R
5+import React.Basic.DOM.SVG as SVG
6+
7+heroiconMoon :: JSX
8+heroiconMoon = SVG.svg
9+ { xmlns: "http://www.w3.org/2000/svg"
10+ , className:"h-6 w-6"
11+ , fill: "none"
12+ , viewBox: "0 0 24 24"
13+ , stroke: "currentColor"
14+ , children:
15+ [ SVG.path
16+ { strokeLinecap: "round"
17+ , strokeLinejoin: "round"
18+ , strokeWidth: "2"
19+ , d: "M20.354 15.354A9 9 0 0 1 8.646 3.646 9.003 9.003 0 0 0 12 21a9.003 9.003 0 0 0 8.354-5.646z"
20+ }
21+ ]
22+ }
src/Yoga/Block/Icon/SVG/HeroiconMoon.svgnew file+1
@@ -0,0 +1 @@
1+<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20.354 15.354A9 9 0 0 1 8.646 3.646 9.003 9.003 0 0 0 12 21a9.003 9.003 0 0 0 8.354-5.646z"/></svg>
src/Yoga/Block/Icon/SVG/HeroiconSun.pursnew file+22
@@ -0,0 +1,22 @@
1+module Yoga.Block.Icon.SVG.HeroiconSun where
2+
3+import React.Basic (JSX)
4+import React.Basic.DOM as R
5+import React.Basic.DOM.SVG as SVG
6+
7+heroiconSun :: JSX
8+heroiconSun = SVG.svg
9+ { xmlns: "http://www.w3.org/2000/svg"
10+ , className:"h-6 w-6"
11+ , fill: "none"
12+ , viewBox: "0 0 24 24"
13+ , stroke: "currentColor"
14+ , children:
15+ [ SVG.path
16+ { strokeLinecap: "round"
17+ , strokeLinejoin: "round"
18+ , strokeWidth: "2"
19+ , d: "M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364-.707-.707M6.343 6.343l-.707-.707m12.728 0-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 1 1-8 0 4 4 0 0 1 8 0z"
20+ }
21+ ]
22+ }
src/Yoga/Block/Icon/SVG/HeroiconSun.svgnew file+1
@@ -0,0 +1 @@
1+<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364-.707-.707M6.343 6.343l-.707-.707m12.728 0-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 1 1-8 0 4 4 0 0 1 8 0z"/></svg>
src/Yoga/Block/Icon/SVG/TMP.svgnew file+1
@@ -0,0 +1 @@
1+<svg viewBox="0 0 1200 1527" xmlns="http://www.w3.org/2000/svg" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2"><path d="m0 503.083 22-3.409c22-3.409 67-10.227 111-13.635 45-3.409 89-3.409 134 6.817 44 10.227 89 30.679 133 34.088 44 3.409 89-10.226 133-13.635 45-3.409 89 3.409 134 27.27 44 23.862 89 64.767 133 68.176 44 3.409 89-30.679 133-44.314 45-13.635 89-6.818 134 6.817 44 13.635 89 34.088 111 44.314l22 10.227V1211H0V503.083z" style="fill:url(#a)" transform="translate(0 -484)"/><path d="m0 655.221 22-1.901c22-1.901 67-5.703 111-3.802 45 1.901 89 9.505 134 20.911 44 11.405 89 26.613 133 26.613s89-15.208 133-15.208c45 0 89 15.208 134 22.812 44 7.603 89 7.603 133-5.703 44-13.307 89-39.92 133-41.821 45-1.901 89 20.91 134 34.217 44 13.307 89 17.109 111 19.01l22 1.9V1318H0V655.221z" style="fill:url(#b)" transform="translate(0 -484)"/><path d="m0 848.096 33 8.219c34 8.219 100 24.658 167 20.548 67-4.11 133-28.767 200-45.205C467 815.219 533 807 600 807s133 8.219 200 20.548c67 12.329 133 28.767 200 28.767s133-16.438 167-24.657l33-8.22V1377H0V848.096z" style="fill:url(#c)" transform="translate(0 -484)"/><path d="m0 925.667 50 18c50 18 150 54 250 54s200-36 300-60 200-36 300-18 200 66 250 90.003l50 24V1683H0V925.667z" style="fill:url(#d)" transform="translate(0 -484)"/><path d="m0 1056.25 25-2.42c25-2.42 75-7.26 125 0s100 26.62 150 38.72c50 12.1 100 16.94 150 14.52 50-2.42 100-12.1 150-16.94 50-4.84 100-4.84 150 2.42s100 21.77 150 36.29 100 29.04 150 26.62c50-2.42 100-21.78 125-31.46l25-9.68V1669H0v-612.75z" style="fill:url(#e)" transform="translate(0 -484)"/><path d="M0 1737v-528.85c28.5-.02 100 12.03 150 0s100-18.9 150-10.31c50 8.59 100 32.66 150 32.66s100-24.07 150-25.79c50-1.71 100 18.91 150 32.66 50 13.75 100 20.63 150 15.47 50-5.16 100-22.34 150-24.06 50-1.72 100 12.03 125 18.9l25 6.88V1737H0z" style="fill:url(#f)" transform="translate(0 -484)"/><path d="m0 1315 40 13.4c40 13.41 120 40.21 200 58.08 80 17.87 160 26.81 240 13.41 80-13.41 160-49.15 240-35.75 80 13.41 160 75.96 240 89.36 80 13.4 160-22.34 200-40.21l40-17.87V2011H0v-696z" style="fill:#5c0bc2" transform="translate(0 -484)"/><defs><linearGradient id="a" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="rotate(90 58 542) scale(427)"><stop offset="0" style="stop-color:#e683ff;stop-opacity:1"/><stop offset="1" style="stop-color:#ff97f5;stop-opacity:1"/></linearGradient><linearGradient id="b" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(0 124.08 -124.08 0 600 649)"><stop offset="0" style="stop-color:#cc60ff;stop-opacity:1"/><stop offset="1" style="stop-color:#e062ff;stop-opacity:1"/></linearGradient><linearGradient id="c" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(0 238.356 -238.356 0 600 731.658)"><stop offset="0" style="stop-color:#a32eff;stop-opacity:1"/><stop offset="1" style="stop-color:#c03cff;stop-opacity:1"/></linearGradient><linearGradient id="d" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(0 452 -452 0 600 911)"><stop offset="0" style="stop-color:#8600f0;stop-opacity:1"/><stop offset="1" style="stop-color:#b659ff;stop-opacity:1"/></linearGradient><linearGradient id="e" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(0 359 -359 0 600 1050)"><stop offset="0" style="stop-color:#ca33ff;stop-opacity:1"/><stop offset="0" style="stop-color:#7d17ff;stop-opacity:1"/><stop offset="1" style="stop-color:#843dde;stop-opacity:1"/></linearGradient><linearGradient id="f" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(0 121.48 -121.48 0 600 1362.52)"><stop offset="0" style="stop-color:#6706e3;stop-opacity:1"/><stop offset="1" style="stop-color:#682de7;stop-opacity:1"/></linearGradient></defs></svg>
src/Yoga/Block/Icon/SVG/Tmp.pursnew file+172
@@ -0,0 +1,172 @@
1+module Yoga.Block.Icon.SVG.Tmp where
2+
3+import React.Basic (JSX)
4+import React.Basic.DOM as R
5+import React.Basic.DOM.SVG as SVG
6+
7+tmp :: JSX
8+tmp = SVG.svg
9+ { viewBox: "0 0 1200 1527"
10+ , xmlns: "http://www.w3.org/2000/svg"
11+ , xmlSpace: "preserve"
12+ , style: R.css { fillRule: "evenodd", clipRule: "evenodd", strokeLinejoin: "round", strokeMiterlimit: "2" }
13+ , children:
14+ [ SVG.path
15+ { d: "m0 503.083 22-3.409c22-3.409 67-10.227 111-13.635 45-3.409 89-3.409 134 6.817 44 10.227 89 30.679 133 34.088 44 3.409 89-10.226 133-13.635 45-3.409 89 3.409 134 27.27 44 23.862 89 64.767 133 68.176 44 3.409 89-30.679 133-44.314 45-13.635 89-6.818 134 6.817 44 13.635 89 34.088 111 44.314l22 10.227V1211H0V503.083z"
16+ , style: R.css { fill: "url(#a)" }
17+ , transform: "translate(0 -484)"
18+ }
19+ , SVG.path
20+ { d: "m0 655.221 22-1.901c22-1.901 67-5.703 111-3.802 45 1.901 89 9.505 134 20.911 44 11.405 89 26.613 133 26.613s89-15.208 133-15.208c45 0 89 15.208 134 22.812 44 7.603 89 7.603 133-5.703 44-13.307 89-39.92 133-41.821 45-1.901 89 20.91 134 34.217 44 13.307 89 17.109 111 19.01l22 1.9V1318H0V655.221z"
21+ , style: R.css { fill: "url(#b)" }
22+ , transform: "translate(0 -484)"
23+ }
24+ , SVG.path
25+ { d: "m0 848.096 33 8.219c34 8.219 100 24.658 167 20.548 67-4.11 133-28.767 200-45.205C467 815.219 533 807 600 807s133 8.219 200 20.548c67 12.329 133 28.767 200 28.767s133-16.438 167-24.657l33-8.22V1377H0V848.096z"
26+ , style: R.css { fill: "url(#c)" }
27+ , transform: "translate(0 -484)"
28+ }
29+ , SVG.path
30+ { d: "m0 925.667 50 18c50 18 150 54 250 54s200-36 300-60 200-36 300-18 200 66 250 90.003l50 24V1683H0V925.667z"
31+ , style: R.css { fill: "url(#d)" }
32+ , transform: "translate(0 -484)"
33+ }
34+ , SVG.path
35+ { d: "m0 1056.25 25-2.42c25-2.42 75-7.26 125 0s100 26.62 150 38.72c50 12.1 100 16.94 150 14.52 50-2.42 100-12.1 150-16.94 50-4.84 100-4.84 150 2.42s100 21.77 150 36.29 100 29.04 150 26.62c50-2.42 100-21.78 125-31.46l25-9.68V1669H0v-612.75z"
36+ , style: R.css { fill: "url(#e)" }
37+ , transform: "translate(0 -484)"
38+ }
39+ , SVG.path
40+ { d: "M0 1737v-528.85c28.5-.02 100 12.03 150 0s100-18.9 150-10.31c50 8.59 100 32.66 150 32.66s100-24.07 150-25.79c50-1.71 100 18.91 150 32.66 50 13.75 100 20.63 150 15.47 50-5.16 100-22.34 150-24.06 50-1.72 100 12.03 125 18.9l25 6.88V1737H0z"
41+ , style: R.css { fill: "url(#f)" }
42+ , transform: "translate(0 -484)"
43+ }
44+ , SVG.path
45+ { d: "m0 1315 40 13.4c40 13.41 120 40.21 200 58.08 80 17.87 160 26.81 240 13.41 80-13.41 160-49.15 240-35.75 80 13.41 160 75.96 240 89.36 80 13.4 160-22.34 200-40.21l40-17.87V2011H0v-696z"
46+ , style: R.css { fill: "#5c0bc2" }
47+ , transform: "translate(0 -484)"
48+ }
49+ , SVG.defs
50+ { children:
51+ [ SVG.linearGradient
52+ { id: "a"
53+ , x1: "0"
54+ , y1: "0"
55+ , x2: "1"
56+ , y2: "0"
57+ , gradientUnits: "userSpaceOnUse"
58+ , gradientTransform: "rotate(90 58 542) scale(427)"
59+ , children:
60+ [ SVG.stop
61+ { offset: "0"
62+ , style: R.css { stopColor: "#e683ff", stopOpacity: "1" }
63+ }
64+ , SVG.stop
65+ { offset: "1"
66+ , style: R.css { stopColor: "#ff97f5", stopOpacity: "1" }
67+ }
68+ ]
69+ }
70+ , SVG.linearGradient
71+ { id: "b"
72+ , x1: "0"
73+ , y1: "0"
74+ , x2: "1"
75+ , y2: "0"
76+ , gradientUnits: "userSpaceOnUse"
77+ , gradientTransform: "matrix(0 124.08 -124.08 0 600 649)"
78+ , children:
79+ [ SVG.stop
80+ { offset: "0"
81+ , style: R.css { stopColor: "#cc60ff", stopOpacity: "1" }
82+ }
83+ , SVG.stop
84+ { offset: "1"
85+ , style: R.css { stopColor: "#e062ff", stopOpacity: "1" }
86+ }
87+ ]
88+ }
89+ , SVG.linearGradient
90+ { id: "c"
91+ , x1: "0"
92+ , y1: "0"
93+ , x2: "1"
94+ , y2: "0"
95+ , gradientUnits: "userSpaceOnUse"
96+ , gradientTransform: "matrix(0 238.356 -238.356 0 600 731.658)"
97+ , children:
98+ [ SVG.stop
99+ { offset: "0"
100+ , style: R.css { stopColor: "#a32eff", stopOpacity: "1" }
101+ }
102+ , SVG.stop
103+ { offset: "1"
104+ , style: R.css { stopColor: "#c03cff", stopOpacity: "1" }
105+ }
106+ ]
107+ }
108+ , SVG.linearGradient
109+ { id: "d"
110+ , x1: "0"
111+ , y1: "0"
112+ , x2: "1"
113+ , y2: "0"
114+ , gradientUnits: "userSpaceOnUse"
115+ , gradientTransform: "matrix(0 452 -452 0 600 911)"
116+ , children:
117+ [ SVG.stop
118+ { offset: "0"
119+ , style: R.css { stopColor: "#8600f0", stopOpacity: "1" }
120+ }
121+ , SVG.stop
122+ { offset: "1"
123+ , style: R.css { stopColor: "#b659ff", stopOpacity: "1" }
124+ }
125+ ]
126+ }
127+ , SVG.linearGradient
128+ { id: "e"
129+ , x1: "0"
130+ , y1: "0"
131+ , x2: "1"
132+ , y2: "0"
133+ , gradientUnits: "userSpaceOnUse"
134+ , gradientTransform: "matrix(0 359 -359 0 600 1050)"
135+ , children:
136+ [ SVG.stop
137+ { offset: "0"
138+ , style: R.css { stopColor: "#ca33ff", stopOpacity: "1" }
139+ }
140+ , SVG.stop
141+ { offset: "0"
142+ , style: R.css { stopColor: "#7d17ff", stopOpacity: "1" }
143+ }
144+ , SVG.stop
145+ { offset: "1"
146+ , style: R.css { stopColor: "#843dde", stopOpacity: "1" }
147+ }
148+ ]
149+ }
150+ , SVG.linearGradient
151+ { id: "f"
152+ , x1: "0"
153+ , y1: "0"
154+ , x2: "1"
155+ , y2: "0"
156+ , gradientUnits: "userSpaceOnUse"
157+ , gradientTransform: "matrix(0 121.48 -121.48 0 600 1362.52)"
158+ , children:
159+ [ SVG.stop
160+ { offset: "0"
161+ , style: R.css { stopColor: "#6706e3", stopOpacity: "1" }
162+ }
163+ , SVG.stop
164+ { offset: "1"
165+ , style: R.css { stopColor: "#682de7", stopOpacity: "1" }
166+ }
167+ ]
168+ }
169+ ]
170+ }
171+ ]
172+ }
src/Yoga/Block/Icon/SVG/WhatsAppLogo.pursnew file+77
@@ -0,0 +1,77 @@
1+module Yoga.Block.Icon.SVG.WhatsAppLogo where
2+
3+import React.Basic (JSX)
4+import React.Basic.DOM as R
5+import React.Basic.DOM.SVG as SVG
6+
7+whatsAppLogo :: JSX
8+whatsAppLogo = SVG.svg
9+ { viewBox: "0 0 1281 1067"
10+ , xmlns: "http://www.w3.org/2000/svg"
11+ , xmlSpace: "preserve"
12+ , style: R.css { fillRule: "evenodd", clipRule: "evenodd", strokeLinejoin: "round", strokeMiterlimit: "2" }
13+ , children:
14+ [ SVG.path
15+ { d: "m0 287.286 6.333 3.754c26.611 15.791 57.12 24.143 88.231 24.16h.068c95.544 0 173.307-77.745 173.348-173.297.014-46.307-17.997-89.849-50.727-122.603-32.732-32.753-76.251-50.802-122.556-50.821-95.62 0-173.381 77.734-173.419 173.283-.013 32.743 9.148 64.631 26.502 92.224l4.126 6.555-17.517 63.947L0 287.286zm-115.686 66.737 29.589-108.039c-18.25-31.619-27.852-67.489-27.838-104.236.046-114.958 93.603-208.485 208.567-208.485 55.789.024 108.153 21.738 147.533 61.145 39.374 39.41 61.05 91.795 61.031 147.509-.049 114.952-93.619 208.496-208.564 208.496-.008 0 .005 0 0 0h-.09c-34.903-.014-69.202-8.768-99.664-25.381l-110.564 28.991z"
16+ , style: R.css { fill: "#fff", fillRule: "nonzero" }
17+ , transform: "translate(546.49 392.227)"
18+ }
19+ , SVG.path
20+ { d: "M.505.494A.488.488 0 0 1 .257.427L0 .498.069.235a.496.496 0 1 1 .436.259zM.009-.002zm0 0z"
21+ , style: R.css { fill: "url(#a)", fillRule: "nonzero" }
22+ , transform: "matrix(0 -406.194 -406.194 0 640.266 738.97)"
23+ }
24+ , SVG.path
25+ { d: "M.505.494A.488.488 0 0 1 .257.427L0 .498.069.235a.496.496 0 1 1 .436.259zM.27.337l.015.01a.412.412 0 1 0-.193-.349c0 .074.02.147.058.21l.009.015-.041.156L.27.337zM.009-.002zm0 0z"
26+ , style: R.css { fill: "url(#b)", fillRule: "nonzero" }
27+ , transform: "matrix(0 -420.76 -420.76 0 640.264 746.25)"
28+ }
29+ , SVG.path
30+ { d: "M0-181.636c-3.904-8.678-8.013-8.852-11.727-9.004-3.037-.13-6.515-.122-9.987-.122-3.474 0-9.121 1.305-13.895 6.52-4.778 5.215-18.242 17.821-18.242 43.46 0 25.642 18.676 50.417 21.279 53.897 2.606 3.475 36.052 57.771 89.021 78.66 44.022 17.359 52.98 13.906 62.535 13.038 9.555-.869 30.832-12.604 35.175-24.773 4.343-12.167 4.343-22.596 3.04-24.776-1.303-2.172-4.777-3.475-9.989-6.081-5.212-2.606-30.832-15.215-35.61-16.952-4.777-1.737-8.252-2.606-11.726 2.611-3.475 5.212-13.456 16.947-16.497 20.422-3.04 3.483-6.08 3.917-11.292 1.311-5.212-2.614-21.996-8.111-41.907-25.864-15.492-13.812-25.951-30.87-28.992-36.087-3.04-5.212-.325-8.035 2.289-10.633 2.34-2.335 5.212-6.083 7.818-9.126 2.6-3.043 3.469-5.215 5.206-8.69 1.737-3.48.869-6.523-.434-9.129S4.634-171.332 0-181.636"
31+ , style: R.css { fill: "#fff" }
32+ , transform: "translate(588.995 628.453)"
33+ }
34+ , SVG.defs
35+ { children:
36+ [ SVG.linearGradient
37+ { id: "a"
38+ , x1: "0"
39+ , y1: "0"
40+ , x2: "1"
41+ , y2: "0"
42+ , gradientUnits: "userSpaceOnUse"
43+ , gradientTransform: "scale(1 -1)"
44+ , children:
45+ [ SVG.stop
46+ { offset: "0"
47+ , style: R.css { stopColor: "#20b038", stopOpacity: "1" }
48+ }
49+ , SVG.stop
50+ { offset: "1"
51+ , style: R.css { stopColor: "#60d66a", stopOpacity: "1" }
52+ }
53+ ]
54+ }
55+ , SVG.linearGradient
56+ { id: "b"
57+ , x1: "0"
58+ , y1: "0"
59+ , x2: "1"
60+ , y2: "0"
61+ , gradientUnits: "userSpaceOnUse"
62+ , gradientTransform: "scale(1 -1)"
63+ , children:
64+ [ SVG.stop
65+ { offset: "0"
66+ , style: R.css { stopColor: "#f9f9f9", stopOpacity: "1" }
67+ }
68+ , SVG.stop
69+ { offset: "1"
70+ , style: R.css { stopColor: "white", stopOpacity: "1" }
71+ }
72+ ]
73+ }
74+ ]
75+ }
76+ ]
77+ }
src/Yoga/Block/Icon/SVG/WhatsAppLogo.svgnew file+1
@@ -0,0 +1 @@
1+<svg viewBox="0 0 1281 1067" xmlns="http://www.w3.org/2000/svg" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2"><path d="m0 287.286 6.333 3.754c26.611 15.791 57.12 24.143 88.231 24.16h.068c95.544 0 173.307-77.745 173.348-173.297.014-46.307-17.997-89.849-50.727-122.603-32.732-32.753-76.251-50.802-122.556-50.821-95.62 0-173.381 77.734-173.419 173.283-.013 32.743 9.148 64.631 26.502 92.224l4.126 6.555-17.517 63.947L0 287.286zm-115.686 66.737 29.589-108.039c-18.25-31.619-27.852-67.489-27.838-104.236.046-114.958 93.603-208.485 208.567-208.485 55.789.024 108.153 21.738 147.533 61.145 39.374 39.41 61.05 91.795 61.031 147.509-.049 114.952-93.619 208.496-208.564 208.496-.008 0 .005 0 0 0h-.09c-34.903-.014-69.202-8.768-99.664-25.381l-110.564 28.991z" style="fill:#fff;fill-rule:nonzero" transform="translate(546.49 392.227)"/><path d="M.505.494A.488.488 0 0 1 .257.427L0 .498.069.235a.496.496 0 1 1 .436.259zM.009-.002zm0 0z" style="fill:url(#a);fill-rule:nonzero" transform="matrix(0 -406.194 -406.194 0 640.266 738.97)"/><path d="M.505.494A.488.488 0 0 1 .257.427L0 .498.069.235a.496.496 0 1 1 .436.259zM.27.337l.015.01a.412.412 0 1 0-.193-.349c0 .074.02.147.058.21l.009.015-.041.156L.27.337zM.009-.002zm0 0z" style="fill:url(#b);fill-rule:nonzero" transform="matrix(0 -420.76 -420.76 0 640.264 746.25)"/><path d="M0-181.636c-3.904-8.678-8.013-8.852-11.727-9.004-3.037-.13-6.515-.122-9.987-.122-3.474 0-9.121 1.305-13.895 6.52-4.778 5.215-18.242 17.821-18.242 43.46 0 25.642 18.676 50.417 21.279 53.897 2.606 3.475 36.052 57.771 89.021 78.66 44.022 17.359 52.98 13.906 62.535 13.038 9.555-.869 30.832-12.604 35.175-24.773 4.343-12.167 4.343-22.596 3.04-24.776-1.303-2.172-4.777-3.475-9.989-6.081-5.212-2.606-30.832-15.215-35.61-16.952-4.777-1.737-8.252-2.606-11.726 2.611-3.475 5.212-13.456 16.947-16.497 20.422-3.04 3.483-6.08 3.917-11.292 1.311-5.212-2.614-21.996-8.111-41.907-25.864-15.492-13.812-25.951-30.87-28.992-36.087-3.04-5.212-.325-8.035 2.289-10.633 2.34-2.335 5.212-6.083 7.818-9.126 2.6-3.043 3.469-5.215 5.206-8.69 1.737-3.48.869-6.523-.434-9.129S4.634-171.332 0-181.636" style="fill:#fff" transform="translate(588.995 628.453)"/><defs><linearGradient id="a" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="scale(1 -1)"><stop offset="0" style="stop-color:#20b038;stop-opacity:1"/><stop offset="1" style="stop-color:#60d66a;stop-opacity:1"/></linearGradient><linearGradient id="b" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="scale(1 -1)"><stop offset="0" style="stop-color:#f9f9f9;stop-opacity:1"/><stop offset="1" style="stop-color:white;stop-opacity:1"/></linearGradient></defs></svg>
webpack.common.js+3−3
@@ -1,6 +1,6 @@
1−"use strict";
1+"use strict"
22
3−const { CleanWebpackPlugin } = require("clean-webpack-plugin");
3+const { CleanWebpackPlugin } = require("clean-webpack-plugin")
44
55module.exports = {
66 plugins: [
@@ -8,4 +8,4 @@ module.exports = {
88 // `./dist` in our case
99 new CleanWebpackPlugin(),
1010 ],
11−};
11+}
yarn.lock+9669−9892

This diff is too big to show here.