Skip to content

Commit 1d3728e

Browse files
Dave ZuchDave Zuch
Dave Zuch
authored and
Dave Zuch
committed
FBCM-5076 Demonstrate pill buttons in UI Guide
With the addition of pill buttons, we demonstrate some of the different variations that are possible from the UI Guide. Worth noting is that while with the old "block" pattern we were forced to use `<button>` elements, with the new pattern we not only offer a `<button>` and an `<a>` option, but we could actually use any HTML element we want.
1 parent 18f1901 commit 1d3728e

File tree

1 file changed

+94
-0
lines changed

1 file changed

+94
-0
lines changed

ui-guide/Components/Button.purs

+94
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import Halogen as H
1212
import Halogen.HTML as HH
1313
import Halogen.HTML.Properties as HP
1414
import Ocelot.Block.Format as Format
15+
import Ocelot.Block.Icon as Ocelot.Block.Icon
1516
import Ocelot.Button as Button
1617
import Ocelot.Clipboard as Ocelot.Clipboard
1718
import Ocelot.HTML.Properties (css)
@@ -71,6 +72,7 @@ render _ =
7172
[ renderButtons
7273
, renderButtonGroups
7374
, renderClipboardButtons
75+
, renderPills
7476
]
7577

7678
renderButtons :: forall m. ComponentHTML m
@@ -418,3 +420,95 @@ renderClipboardButtons =
418420
]
419421
]
420422
]
423+
424+
renderPills :: forall m. ComponentHTML m
425+
renderPills =
426+
Documentation.customBlock_
427+
{ header: "Pills"
428+
, subheader: "These might be used for displaying selected filters."
429+
}
430+
[ Documentation.callout_
431+
[ Backdrop.backdrop_
432+
[ Backdrop.content_
433+
[ HH.div
434+
[ css "mb-6 flex" ]
435+
[ HH.div
436+
[ css "flex-1" ]
437+
[ Format.caption_
438+
[ HH.text "Standard Button" ]
439+
, Button.pillButton
440+
{ decorator: Button.Left Ocelot.Block.Icon.plus_ }
441+
[ HH.text "Add Filter" ]
442+
]
443+
, HH.div
444+
[ css "flex-1" ]
445+
[ Format.caption_
446+
[ HH.text "Disabled Button" ]
447+
, Button.pillButton
448+
{ decorator: Button.Left Ocelot.Block.Icon.plus_
449+
, props: [ HP.disabled true ]
450+
}
451+
[ HH.text "Add Filter" ]
452+
]
453+
]
454+
, HH.div
455+
[ css "mb-6 flex" ]
456+
[ HH.div
457+
[ css "flex-1" ]
458+
[ Format.caption_
459+
[ HH.text "Primary Anchor" ]
460+
, Button.pillAnchor
461+
{ decorator: Button.Right Ocelot.Block.Icon.delete_
462+
, style: Button.Primary
463+
}
464+
[ HH.text "Color: Primary" ]
465+
]
466+
, HH.div
467+
[ css "flex-1" ]
468+
[]
469+
]
470+
]
471+
]
472+
, Backdrop.backdropWhite_
473+
[ Backdrop.content_
474+
[ HH.div
475+
[ css "mb-6 flex" ]
476+
[ HH.div
477+
[ css "flex-1" ]
478+
[ Format.caption_
479+
[ HH.text "Standard Button" ]
480+
, Button.pillButton
481+
{ decorator: Button.Left Ocelot.Block.Icon.plus_ }
482+
[ HH.text "Add Filter" ]
483+
]
484+
, HH.div
485+
[ css "flex-1" ]
486+
[ Format.caption_
487+
[ HH.text "Disabled Button" ]
488+
, Button.pillButton
489+
{ decorator: Button.Left Ocelot.Block.Icon.plus_
490+
, props: [ HP.disabled true ]
491+
}
492+
[ HH.text "Add Filter" ]
493+
]
494+
]
495+
, HH.div
496+
[ css "mb-6 flex" ]
497+
[ HH.div
498+
[ css "flex-1" ]
499+
[ Format.caption_
500+
[ HH.text "Primary Anchor" ]
501+
, Button.pillAnchor
502+
{ decorator: Button.Right Ocelot.Block.Icon.delete_
503+
, style: Button.Primary
504+
}
505+
[ HH.text "Color: Primary" ]
506+
]
507+
, HH.div
508+
[ css "flex-1" ]
509+
[]
510+
]
511+
]
512+
]
513+
]
514+
]

0 commit comments

Comments
 (0)