packages feed

svg-icons 2.8.1.0 → 2.9.0.0

raw patch · 5 files changed

+301/−7 lines, 5 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

- SvgIcons.Icons.Textarea: curvyArrowLeft :: Svg
+ SvgIcons.Icons.Arrows: bigArrowLeft :: Svg
+ SvgIcons.Icons.Arrows: bigArrowRight :: Svg
+ SvgIcons.Icons.Arrows: curvyArrowLeft :: Svg
+ SvgIcons.Icons.Arrows: curvyArrowRight :: Svg
+ SvgIcons.Icons.Arrows: svgArrows :: [(String, Svg)]
+ SvgIcons.Icons.Business: creditCard :: Svg
+ SvgIcons.Icons.Business: creditIn :: Svg
+ SvgIcons.Icons.Business: creditOut :: Svg

Files

src/Main.hs view
@@ -17,6 +17,7 @@ import SvgIcons.Core.Style
 import SvgIcons.Core.Utils
 import SvgIcons.Icons (exampleIcons)
+import SvgIcons.Icons.Arrows   (svgArrows)
 import SvgIcons.Icons.Business (svgBusiness)
 import SvgIcons.Icons.Coding   (svgCoding)
 import SvgIcons.Icons.Computer (svgComputer)
@@ -109,6 +110,7 @@ renderIcons path = 
   do
     createDirectory path
+    createDirectory arrowsPath
     createDirectory businessPath
     createDirectory codingPath
     createDirectory computerPath
@@ -119,6 +121,9 @@     createDirectory religionPath
     createDirectory textareaPath
     createDirectory toolsPath
+    renderSvgFiles arrowsPath (map fillIcons svgArrows)
+    renderSvgFiles arrowsPath (map fullIcons svgArrows)
+    renderSvgFiles arrowsPath (map strkIcons svgArrows)
     renderSvgFiles businessPath (map fillIcons svgBusiness)
     renderSvgFiles businessPath (map fullIcons svgBusiness)
     renderSvgFiles businessPath (map strkIcons svgBusiness)
@@ -154,6 +159,7 @@     fullIcons (a,b) = (a ++ "_full" , stdDims $ fullStyle b)
     strkIcons (a,b) = (a ++ "_strk" , stdDims $ strkStyle b)
     -- test (a,b) = (a, coreSvg def $ b >> frame (-1) (-1) 2 2)
+    arrowsPath   = path ++ "arrows/"
     businessPath = path ++ "business/"
     codingPath   = path ++ "coding/"
     computerPath = path ++ "computer/"
+ src/SvgIcons/Icons/Arrows.hs view
@@ -0,0 +1,174 @@+{-# LANGUAGE     OverloadedStrings       #-}
+
+
+
+module SvgIcons.Icons.Arrows
+  ( svgArrows
+  , curvyArrowLeft
+  , curvyArrowRight
+  , bigArrowLeft
+  , bigArrowRight
+  ) where
+
+import           Text.Blaze.Svg11 ((!))
+import           Text.Blaze.Svg11 as S
+import           Text.Blaze.Svg11.Attributes as A
+
+import SvgIcons.Core.Utils
+
+
+{- |
+A list with all the icons of this module, 
+together with appropriate names.
+This module contains icons suitable for the 
+tool bars of a text editor (bold, italic, etc.)
+
+>svgArrows :: [ (String , S.Svg) ]
+>svgArrows =
+>  [ (,) "curvyArrowLeft" curvyArrowLeft
+>  , (,) "curvyArrowRight" curvyArrowRight
+>  , (,) "bigArrowLeft"    bigArrowLeft
+>  , (,) "bigArrowRight"   bigArrowRight
+>  ]
+-}
+svgArrows :: [ (String , S.Svg) ]
+svgArrows =
+  [ (,) "curvyArrowLeft"  curvyArrowLeft
+  , (,) "curvyArrowRight" curvyArrowRight
+  , (,) "bigArrowLeft"    bigArrowLeft
+  , (,) "bigArrowRight"   bigArrowRight
+  ]
+
+
+--------------------------------------------------------------------------------
+
+
+{- |
+![fill style](https://raw.githubusercontent.com/RamiroPastor/SvgIcons/main/svg/icons/arrows/curvyArrowLeft_fill.svg)
+
+![fill and stroke](https://raw.githubusercontent.com/RamiroPastor/SvgIcons/main/svg/icons/arrows/curvyArrowLeft_full.svg)
+
+![stroke style](https://raw.githubusercontent.com/RamiroPastor/SvgIcons/main/svg/icons/arrows/curvyArrowLeft_strk.svg)
+-}
+curvyArrowLeft :: S.Svg
+curvyArrowLeft =
+    S.path
+      ! d dirs
+      ! strokeLinejoin "round"
+  where
+    r1 = 0.5
+    r2 = 0.66
+    rm = (r2 - r1)
+    k1 = 0.24
+    k2 = k1 + rm/2
+    dirs = mkPath $ do
+      m   (-r1) 0
+      aa  (rm/2) (rm/2)  0 False False (-r2)   0
+      aa   r2     r2     0 True  False   0   (-r2)
+      lr    k1  (-k1)
+      lr  (-rm)   0
+      lr  (-k2)   k2
+      lr    k2    k2
+      lr    rm    0
+      lr  (-k1) (-k1)
+      aa   r1     r1     0 True  True  (-r1)   0
+      S.z
+    
+
+
+{- |
+![fill style](https://raw.githubusercontent.com/RamiroPastor/SvgIcons/main/svg/icons/arrows/curvyArrowRight_fill.svg)
+
+![fill and stroke](https://raw.githubusercontent.com/RamiroPastor/SvgIcons/main/svg/icons/arrows/curvyArrowRight_full.svg)
+
+![stroke style](https://raw.githubusercontent.com/RamiroPastor/SvgIcons/main/svg/icons/arrows/curvyArrowRight_strk.svg)
+-}
+curvyArrowRight :: S.Svg
+curvyArrowRight =
+    S.path
+      ! d dirs
+      ! strokeLinejoin "round"
+  where
+    r1 = 0.5
+    r2 = 0.66
+    rm = (r2 - r1)
+    k1 = 0.24
+    k2 = k1 + rm/2
+    dirs = mkPath $ do
+      m   ( r1) 0
+      aa  (rm/2) (rm/2)  0 False True  ( r2)   0
+      aa   r2     r2     0 True  True    0   (-r2)
+      lr  (-k1)  (-k1)
+      lr  ( rm)   0
+      lr  ( k2)   k2
+      lr  (-k2)   k2
+      lr  (-rm)   0
+      lr  ( k1) (-k1)
+      aa   r1     r1     0 True  False ( r1)   0
+      S.z
+    
+
+
+{- |
+![fill style](https://raw.githubusercontent.com/RamiroPastor/SvgIcons/main/svg/icons/arrows/bigArrowLeft_fill.svg)
+
+![fill and stroke](https://raw.githubusercontent.com/RamiroPastor/SvgIcons/main/svg/icons/arrows/bigArrowLeft_full.svg)
+
+![stroke style](https://raw.githubusercontent.com/RamiroPastor/SvgIcons/main/svg/icons/arrows/bigArrowLeft_strk.svg)
+-}
+bigArrowLeft :: S.Svg
+bigArrowLeft =
+    S.path
+      ! d dirs
+      ! strokeLinejoin "round"
+  where
+    k0 = 0.2
+    y0 = 0.6
+    x0 = 0.9
+    x1 = 0.5
+    x2 = 0.4
+    x3 = x1 - 2*k0
+    dirs = mkPath $ do
+      m  ( x0) (-k0)
+      l  (-x2) (-k0)
+      l  (-x3) (-y0)
+      l  (-x1) (-y0)
+      l  (-x0)   0
+      l  (-x1) ( y0)
+      l  (-x3) ( y0)
+      l  (-x2) ( k0)
+      l  ( x0) ( k0)
+      S.z
+
+
+
+{- |
+![fill style](https://raw.githubusercontent.com/RamiroPastor/SvgIcons/main/svg/icons/arrows/bigArrowRight_fill.svg)
+
+![fill and stroke](https://raw.githubusercontent.com/RamiroPastor/SvgIcons/main/svg/icons/arrows/bigArrowRight_full.svg)
+
+![stroke style](https://raw.githubusercontent.com/RamiroPastor/SvgIcons/main/svg/icons/arrows/bigArrowRight_strk.svg)
+-}
+bigArrowRight :: S.Svg
+bigArrowRight =
+    S.path
+      ! d dirs
+      ! strokeLinejoin "round"
+  where
+    k0 = 0.2
+    y0 = 0.6
+    x0 = 0.9
+    x1 = 0.5
+    x2 = 0.4
+    x3 = x1 - 2*k0
+    dirs = mkPath $ do
+      m  (-x0) (-k0)
+      l  ( x2) (-k0)
+      l  ( x3) (-y0)
+      l  ( x1) (-y0)
+      l    x0    0
+      l  ( x1) ( y0)
+      l  ( x3) ( y0)
+      l  ( x2) ( k0)
+      l  (-x0) ( k0)
+      S.z
src/SvgIcons/Icons/Business.hs view
@@ -8,6 +8,9 @@   , bullseye
   , company
   , connections
+  , creditCard
+  , creditIn
+  , creditOut
   ) where
 
 import           Text.Blaze.Svg11 ((!))
@@ -15,6 +18,7 @@ import           Text.Blaze.Svg11.Attributes as A
 
 import SvgIcons.Core.Utils
+import SvgIcons.Icons.Arrows (bigArrowLeft, bigArrowRight)
 
 
 
@@ -28,6 +32,9 @@ >  , (,) "bullseye"    bullseye
 >  , (,) "company"     company
 >  , (,) "connections" connections
+>  , (,) "creditCard"  creditCard
+>  , (,) "creditIn"    creditIn
+>  , (,) "creditOut"   creditOut
 >  ]
 -}
 svgBusiness :: [ (String , S.Svg) ]
@@ -36,6 +43,9 @@   , (,) "bullseye"    bullseye
   , (,) "company"     company
   , (,) "connections" connections
+  , (,) "creditCard"  creditCard
+  , (,) "creditIn"    creditIn
+  , (,) "creditOut"   creditOut
   ]
 
 
@@ -280,4 +290,105 @@       m   q3         q3
       l   q3         (q3 - fl)
       m   q3         q3
-      l   (q3 - fl)  q3+      l   (q3 - fl)  q3
+
+
+
+{- |
+![fill style](https://raw.githubusercontent.com/RamiroPastor/SvgIcons/main/svg/icons/business/creditCard_fill.svg)
+
+![fill and stroke](https://raw.githubusercontent.com/RamiroPastor/SvgIcons/main/svg/icons/business/creditCard_full.svg)
+
+![stroke style](https://raw.githubusercontent.com/RamiroPastor/SvgIcons/main/svg/icons/business/creditCard_strk.svg)
+-}
+creditCard :: Svg
+creditCard =
+    S.g $ do
+      S.path
+        ! A.fill "none"
+        ! A.d cardPath
+      S.path
+        ! A.d cardBand
+      S.path
+        ! A.fill "none"
+        ! A.strokeLinejoin "round"
+        ! A.d chip
+  where
+    x0 = 0.93
+    y0 = x0 * 0.618
+    r0 = 0.1
+    y1 = -0.4
+    y2 = -0.15
+    cw = 1.618 * ch
+    ch = 0.3
+    cx = -0.7
+    cy = 0.5 * (y0 + y2) - 0.5 * ch
+    cardPath = mkPath $ do
+      m    0          y0
+      l  ( x0 - r0)   y0
+      aa   r0   r0    0   False  False    x0        ( y0 - r0)
+      l    x0       (-y0 + r0)
+      aa   r0   r0    0   False  False  ( x0 - r0)  (-y0)
+      l  (-x0 + r0) (-y0)
+      aa   r0   r0    0   False  False  (-x0)       (-y0 + r0)
+      l  (-x0)      ( y0 - r0)
+      aa   r0   r0    0   False  False  (-x0 + r0)    y0
+      S.z
+    cardBand = mkPath $ do
+      m   (-x0)  y1
+      l   ( x0)  y1
+      l   ( x0)  y2
+      l   (-x0)  y2
+      S.z
+    chip = mkPath $ do
+      m     cx      cy
+      lr    cw      0
+      lr    0       ch
+      lr  (-cw)     0
+      S.z
+      ---
+      mr  ( cw/3)   0
+      lr    0       ch
+      mr    0     (-ch/3)
+      lr  (-cw/3)   0
+      mr    0     (-ch/3)
+      lr  ( cw/3)   0
+      ---
+      mr  ( cw/3) (-ch/3)
+      lr    0       ch
+      mr    0     (-ch/3)
+      lr  ( cw/3)   0
+      mr    0     (-ch/3)
+      lr  (-cw/3)   0
+    
+  
+
+{- |
+![fill style](https://raw.githubusercontent.com/RamiroPastor/SvgIcons/main/svg/icons/business/creditIn_fill.svg)
+
+![fill and stroke](https://raw.githubusercontent.com/RamiroPastor/SvgIcons/main/svg/icons/business/creditIn_full.svg)
+
+![stroke style](https://raw.githubusercontent.com/RamiroPastor/SvgIcons/main/svg/icons/business/creditIn_strk.svg)
+-}
+creditIn :: Svg
+creditIn =
+    S.g $ do
+      creditCard
+      bigArrowLeft 
+        ! A.transform (translate 0.45 0.22 <> S.scale 0.25 0.25)
+
+
+
+{- |
+![fill style](https://raw.githubusercontent.com/RamiroPastor/SvgIcons/main/svg/icons/business/creditOut_fill.svg)
+
+![fill and stroke](https://raw.githubusercontent.com/RamiroPastor/SvgIcons/main/svg/icons/business/creditOut_full.svg)
+
+![stroke style](https://raw.githubusercontent.com/RamiroPastor/SvgIcons/main/svg/icons/business/creditOut_strk.svg)
+-}
+creditOut :: Svg
+creditOut =
+    S.g $ do
+      creditCard
+      bigArrowRight 
+        ! A.transform (translate 0.45 0.22 <> S.scale 0.25 0.25)
src/SvgIcons/Icons/Textarea.hs view
@@ -14,7 +14,6 @@   , numberList
   , header
   , horizontalRule
-  , curvyArrowLeft
   , undo
   , redo
   , questionMark
@@ -518,8 +517,9 @@ -}
 undo :: S.Svg
 undo =
-  curvyArrowLeft
-    ! A.transform (translate 0 0.1)
+  S.g $ do
+    curvyArrowLeft
+      ! A.transform (translate 0 0.1)
 
 
 
@@ -532,8 +532,9 @@ -}
 redo :: S.Svg
 redo =
-  curvyArrowLeft
-    ! A.transform (translate 0 0.1 <> horizontalMirrorMatrix)
+  S.g $ do
+    curvyArrowLeft
+      ! A.transform (translate 0 0.1 <> horizontalMirrorMatrix)
 
 
 
svg-icons.cabal view
@@ -1,6 +1,6 @@ cabal-version:      2.4
 name:               svg-icons
-version:            2.8.1.0
+version:            2.9.0.0
 homepage:           https://github.com/RamiroPastor/SvgIcons
 license:            BSD-3-Clause
 license-file:       LICENSE
@@ -33,6 +33,7 @@     SvgIcons.Core.Style,
     SvgIcons.Core.Utils,
     SvgIcons.Icons,
+    SvgIcons.Icons.Arrows,
     SvgIcons.Icons.Business,
     SvgIcons.Icons.Coding,
     SvgIcons.Icons.Computer,
@@ -79,6 +80,7 @@     SvgIcons.Core.Style,
     SvgIcons.Core.Utils,
     SvgIcons.Icons,
+    SvgIcons.Icons.Arrows,
     SvgIcons.Icons.Business,
     SvgIcons.Icons.Coding,
     SvgIcons.Icons.Computer,