diff --git a/components/blockquote/Component.php b/components/blockquote/Component.php new file mode 100644 index 0000000..c2da3ed --- /dev/null +++ b/components/blockquote/Component.php @@ -0,0 +1,40 @@ +text = $text; + $this->author = $author; + } + + /** + * Get the view / contents that represent the component. + */ + public function render(): View|Closure|string + { + return view('components.blockquote'); + } +} diff --git a/components/blockquote/Layout.php b/components/blockquote/Layout.php new file mode 100644 index 0000000..3f42c3b --- /dev/null +++ b/components/blockquote/Layout.php @@ -0,0 +1,64 @@ +fields([ + Textarea::make('Text', 'text') + ->rules('required'), + + Text::make('Author', 'author') + ->help('Optionnal.'), + ]), + ]; + } + + /** + * The layout's display components + */ + public function display(): array + { + return [ + DataList::make() + ->row('Text', TextComponent::make($this->text)) + ->row('Author', TextComponent::make($this->author)), + ]; + } + + /** + * Extract the values from the bag to store them in the database. + */ + public function fillAttributes(Baggage $bag): array + { + return $bag->only(['text', 'author']); + } +} diff --git a/components/blockquote/style.scss b/components/blockquote/style.scss new file mode 100644 index 0000000..9f6a35f --- /dev/null +++ b/components/blockquote/style.scss @@ -0,0 +1,32 @@ +.blockquote { + margin: rem(28) auto; + position: relative; + padding-left: rem(20); + width: col(6, 12); + display: flex; + flex-direction: column-reverse; + + &:after { + content: ""; + position: absolute; + height: 100%; + width: 1px; + background-color: color(text-primary); + left: 0; + top: 0; + bottom: 0 + } + + &__quote { + font-size: rem(18); + line-height: 160%; + } + + &__author { + display: block; + font-size: rem(12); + line-height: 100%; + text-transform: uppercase; + margin-top: rem(12); + } +} diff --git a/components/blockquote/view.blade.php b/components/blockquote/view.blade.php new file mode 100644 index 0000000..b3268fd --- /dev/null +++ b/components/blockquote/view.blade.php @@ -0,0 +1,8 @@ +
+ @if($author) +
{{ $author }}
+ @endif +
+

{{ $text }}

+
+
diff --git a/src/Components/Publishers/Blockquote.php b/src/Components/Publishers/Blockquote.php new file mode 100644 index 0000000..643fb9f --- /dev/null +++ b/src/Components/Publishers/Blockquote.php @@ -0,0 +1,60 @@ +`"; + } +}