-----------------------------------------------------------------------------
{-# LANGUAGE OverloadedStrings #-}
-----------------------------------------------------------------------------
-- |
-- Module      :  Miso.Native.X.Element.BlurView.Property
-- Copyright   :  (C) 2016-2026 David M. Johnson
-- License     :  BSD3-style (see the file LICENSE)
-- Maintainer  :  David M. Johnson <code@dmj.io>
-- Stability   :  experimental
-- Portability :  non-portable
----------------------------------------------------------------------------
module Miso.Native.X.Element.BlurView.Property
  ( -- *** Property
    androidCaptureTarget_
  , blurEffect_
  , blurRadius_
  , blurSampling_
  , enableAutoBlur_
  , experimentalUpdateBlurRadius_
  , glassInteractive_
  , glassStyle_
  , glassTintColor_
  , spacing_
    -- *** Types
  , BlurEffect (..)
  , GlassStyle (..)
  ) where
-----------------------------------------------------------------------------
import           Miso.JSON (ToJSON(..))
import           Miso.String (MisoString)
import           Miso.Types (Attribute)
import           Miso.Property
-----------------------------------------------------------------------------
-- | The blur/material effect of a \<blur-view\> (iOS), used by 'blurEffect_'.
data BlurEffect
  = BlurLight
  | BlurExtraLight
  | BlurDark
  | BlurGlass
  | BlurGlassContainer
  deriving (Int -> BlurEffect -> ShowS
[BlurEffect] -> ShowS
BlurEffect -> String
(Int -> BlurEffect -> ShowS)
-> (BlurEffect -> String)
-> ([BlurEffect] -> ShowS)
-> Show BlurEffect
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> BlurEffect -> ShowS
showsPrec :: Int -> BlurEffect -> ShowS
$cshow :: BlurEffect -> String
show :: BlurEffect -> String
$cshowList :: [BlurEffect] -> ShowS
showList :: [BlurEffect] -> ShowS
Show, BlurEffect -> BlurEffect -> Bool
(BlurEffect -> BlurEffect -> Bool)
-> (BlurEffect -> BlurEffect -> Bool) -> Eq BlurEffect
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: BlurEffect -> BlurEffect -> Bool
== :: BlurEffect -> BlurEffect -> Bool
$c/= :: BlurEffect -> BlurEffect -> Bool
/= :: BlurEffect -> BlurEffect -> Bool
Eq)
-----------------------------------------------------------------------------
instance ToJSON BlurEffect where
  toJSON :: BlurEffect -> Value
toJSON BlurEffect
BlurLight          = Value
"light"
  toJSON BlurEffect
BlurExtraLight     = Value
"extra-light"
  toJSON BlurEffect
BlurDark           = Value
"dark"
  toJSON BlurEffect
BlurGlass          = Value
"glass"
  toJSON BlurEffect
BlurGlassContainer = Value
"glass-container"
-----------------------------------------------------------------------------
-- | The glass effect appearance of a \<blur-view\> (iOS), used by 'glassStyle_'.
data GlassStyle
  = GlassClear
  | GlassRegular
  deriving (Int -> GlassStyle -> ShowS
[GlassStyle] -> ShowS
GlassStyle -> String
(Int -> GlassStyle -> ShowS)
-> (GlassStyle -> String)
-> ([GlassStyle] -> ShowS)
-> Show GlassStyle
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GlassStyle -> ShowS
showsPrec :: Int -> GlassStyle -> ShowS
$cshow :: GlassStyle -> String
show :: GlassStyle -> String
$cshowList :: [GlassStyle] -> ShowS
showList :: [GlassStyle] -> ShowS
Show, GlassStyle -> GlassStyle -> Bool
(GlassStyle -> GlassStyle -> Bool)
-> (GlassStyle -> GlassStyle -> Bool) -> Eq GlassStyle
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GlassStyle -> GlassStyle -> Bool
== :: GlassStyle -> GlassStyle -> Bool
$c/= :: GlassStyle -> GlassStyle -> Bool
/= :: GlassStyle -> GlassStyle -> Bool
Eq)
-----------------------------------------------------------------------------
instance ToJSON GlassStyle where
  toJSON :: GlassStyle -> Value
toJSON GlassStyle
GlassClear   = Value
"clear"
  toJSON GlassStyle
GlassRegular = Value
"regular"
-----------------------------------------------------------------------------
-- | https://lynxjs.org/api/elements/built-in/blur-view.html#android-capture-target
--
-- *Android 3.9+*. The raw id of the Android Lynx view to capture and blur.
--
androidCaptureTarget_ :: MisoString -> Attribute model action
androidCaptureTarget_ :: forall model action. MisoString -> Attribute model action
androidCaptureTarget_ = MisoString -> MisoString -> Attribute model action
forall model action.
MisoString -> MisoString -> Attribute model action
textProp MisoString
"android-capture-target"
-----------------------------------------------------------------------------
-- | https://lynxjs.org/api/elements/built-in/blur-view.html#blur-effect
--
-- *iOS* only. Controls brightness of the blurred area; glass variants apply
-- material effects.
--
-- > blurEffect_ BlurDark
--
-- Default Value: 'BlurLight'
--
blurEffect_ :: BlurEffect -> Attribute model action
blurEffect_ :: forall model action. BlurEffect -> Attribute model action
blurEffect_ = MisoString -> BlurEffect -> Attribute model action
forall a model action.
ToJSON a =>
MisoString -> a -> Attribute model action
prop MisoString
"blur-effect"
-----------------------------------------------------------------------------
-- | https://lynxjs.org/api/elements/built-in/blur-view.html#blur-radius
--
-- Gaussian blur radius specification.
--
-- Default Value: @\"0px\"@
--
blurRadius_ :: MisoString -> Attribute model action
blurRadius_ :: forall model action. MisoString -> Attribute model action
blurRadius_ = MisoString -> MisoString -> Attribute model action
forall model action.
MisoString -> MisoString -> Attribute model action
textProp MisoString
"blur-radius"
-----------------------------------------------------------------------------
-- | https://lynxjs.org/api/elements/built-in/blur-view.html#blur-sampling
--
-- *Android* only. Downsampling ratio for performance optimization.
--
-- Default Value: 6
--
blurSampling_ :: Int -> Attribute model action
blurSampling_ :: forall model action. Int -> Attribute model action
blurSampling_ = MisoString -> Int -> Attribute model action
forall model action. MisoString -> Int -> Attribute model action
intProp MisoString
"blur-sampling"
-----------------------------------------------------------------------------
-- | https://lynxjs.org/api/elements/built-in/blur-view.html#enable-auto-blur
--
-- *Android* only. Automatic blur update toggle.
--
-- Default Value: 'True'
--
enableAutoBlur_ :: Bool -> Attribute model action
enableAutoBlur_ :: forall model action. Bool -> Attribute model action
enableAutoBlur_ = MisoString -> Bool -> Attribute model action
forall model action. MisoString -> Bool -> Attribute model action
boolProp MisoString
"enable-auto-blur"
-----------------------------------------------------------------------------
-- | https://lynxjs.org/api/elements/built-in/blur-view.html#experimental-update-blur-radius
--
-- *Android 3.4+*. Switches the internal blur-buffer refresh mechanism.
--
experimentalUpdateBlurRadius_ :: Bool -> Attribute model action
experimentalUpdateBlurRadius_ :: forall model action. Bool -> Attribute model action
experimentalUpdateBlurRadius_ = MisoString -> Bool -> Attribute model action
forall model action. MisoString -> Bool -> Attribute model action
boolProp MisoString
"experimental-update-blur-radius"
-----------------------------------------------------------------------------
-- | https://lynxjs.org/api/elements/built-in/blur-view.html#glass-interactive
--
-- *iOS 3.8+*. Enables interactive glass effect behavior.
--
-- Default Value: 'False'
--
glassInteractive_ :: Bool -> Attribute model action
glassInteractive_ :: forall model action. Bool -> Attribute model action
glassInteractive_ = MisoString -> Bool -> Attribute model action
forall model action. MisoString -> Bool -> Attribute model action
boolProp MisoString
"glass-interactive"
-----------------------------------------------------------------------------
-- | https://lynxjs.org/api/elements/built-in/blur-view.html#glass-style
--
-- *iOS 3.8+*. Glass effect visual appearance.
--
-- > glassStyle_ GlassClear
--
-- Default Value: 'GlassRegular'
--
glassStyle_ :: GlassStyle -> Attribute model action
glassStyle_ :: forall model action. GlassStyle -> Attribute model action
glassStyle_ = MisoString -> GlassStyle -> Attribute model action
forall a model action.
ToJSON a =>
MisoString -> a -> Attribute model action
prop MisoString
"glass-style"
-----------------------------------------------------------------------------
-- | https://lynxjs.org/api/elements/built-in/blur-view.html#glass-tint-color
--
-- *iOS 3.8+*. Tint color applied to the glass effect.
--
-- Default Value: @\"transparent\"@
--
glassTintColor_ :: MisoString -> Attribute model action
glassTintColor_ :: forall model action. MisoString -> Attribute model action
glassTintColor_ = MisoString -> MisoString -> Attribute model action
forall model action.
MisoString -> MisoString -> Attribute model action
textProp MisoString
"glass-tint-color"
-----------------------------------------------------------------------------
-- | https://lynxjs.org/api/elements/built-in/blur-view.html#spacing
--
-- *iOS* only. Distance threshold for element merging.
--
-- Default Value: 0
--
spacing_ :: Int -> Attribute model action
spacing_ :: forall model action. Int -> Attribute model action
spacing_ = MisoString -> Int -> Attribute model action
forall model action. MisoString -> Int -> Attribute model action
intProp MisoString
"spacing"
-----------------------------------------------------------------------------