@brilo/base-blocks 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/blocks/form/form-group/edit.d.ts.map +1 -1
- package/build/blocks/form/form-group/edit.js +17 -3
- package/build/blocks/form/form-group/factory.d.ts.map +1 -1
- package/build/blocks/form/form-group/factory.js +1 -0
- package/build/blocks/form/form-group/types.d.ts +1 -0
- package/build/blocks/form/form-group/types.d.ts.map +1 -1
- package/package.json +3 -2
- package/src/blocks/column/column-group/edit.tsx +56 -0
- package/src/blocks/column/column-group/editor.scss +7 -0
- package/src/blocks/column/column-group/factory.tsx +29 -0
- package/src/blocks/column/column-group/index.ts +14 -0
- package/src/blocks/column/column-group/types.ts +8 -0
- package/src/blocks/column/column-item/constants.ts +1 -0
- package/src/blocks/column/column-item/edit.tsx +48 -0
- package/src/blocks/column/column-item/editor.scss +34 -0
- package/src/blocks/column/column-item/factory.tsx +25 -0
- package/src/blocks/column/column-item/index.ts +10 -0
- package/src/blocks/column/column-item/types.ts +7 -0
- package/src/blocks/compare/compare-group/constants.ts +1 -0
- package/src/blocks/compare/compare-group/edit.tsx +52 -0
- package/src/blocks/compare/compare-group/factory.tsx +29 -0
- package/src/blocks/compare/compare-group/icon.tsx +7 -0
- package/src/blocks/compare/compare-group/index.ts +13 -0
- package/src/blocks/compare/compare-group/types.ts +12 -0
- package/src/blocks/compare/compare-item/edit.tsx +38 -0
- package/src/blocks/compare/compare-item/editor.scss +15 -0
- package/src/blocks/compare/compare-item/factory.tsx +28 -0
- package/src/blocks/compare/compare-item/icon.tsx +9 -0
- package/src/blocks/compare/compare-item/index.ts +13 -0
- package/src/blocks/compare/compare-item/types.ts +9 -0
- package/src/blocks/compare/compare-option/constants.ts +7 -0
- package/src/blocks/compare/compare-option/edit.tsx +64 -0
- package/src/blocks/compare/compare-option/editor.scss +26 -0
- package/src/blocks/compare/compare-option/factory.tsx +35 -0
- package/src/blocks/compare/compare-option/icon.tsx +7 -0
- package/src/blocks/compare/compare-option/index.ts +8 -0
- package/src/blocks/compare/compare-option/types.ts +12 -0
- package/src/blocks/contact/contact-group/constants.ts +3 -0
- package/src/blocks/contact/contact-group/edit.tsx +57 -0
- package/src/blocks/contact/contact-group/editor.scss +20 -0
- package/src/blocks/contact/contact-group/factory.tsx +35 -0
- package/src/blocks/contact/contact-group/index.ts +12 -0
- package/src/blocks/contact/contact-group/types.ts +12 -0
- package/src/blocks/contact/contact-item/constants.ts +17 -0
- package/src/blocks/contact/contact-item/edit.tsx +93 -0
- package/src/blocks/contact/contact-item/editor.scss +38 -0
- package/src/blocks/contact/contact-item/factory.tsx +35 -0
- package/src/blocks/contact/contact-item/index.ts +23 -0
- package/src/blocks/contact/contact-item/types.ts +21 -0
- package/src/blocks/core/basic-button/constants.ts +17 -0
- package/src/blocks/core/basic-button/edit.tsx +107 -0
- package/src/blocks/core/basic-button/editor.scss +80 -0
- package/src/blocks/core/basic-button/factory.tsx +54 -0
- package/src/blocks/core/basic-button/index.ts +8 -0
- package/src/blocks/core/basic-button/types.ts +29 -0
- package/src/blocks/core/basic-heading/constants.ts +1 -0
- package/src/blocks/core/basic-heading/edit.tsx +76 -0
- package/src/blocks/core/basic-heading/editor.scss +8 -0
- package/src/blocks/core/basic-heading/factory.tsx +40 -0
- package/src/blocks/core/basic-heading/index.ts +8 -0
- package/src/blocks/core/basic-heading/types.ts +20 -0
- package/src/blocks/core/basic-overline/edit.tsx +28 -0
- package/src/blocks/core/basic-overline/editor.scss +14 -0
- package/src/blocks/core/basic-overline/factory.tsx +22 -0
- package/src/blocks/core/basic-overline/index.ts +8 -0
- package/src/blocks/core/basic-overline/types.ts +7 -0
- package/src/blocks/faq/faq-group/constants.ts +11 -0
- package/src/blocks/faq/faq-group/edit.tsx +55 -0
- package/src/blocks/faq/faq-group/editor.scss +11 -0
- package/src/blocks/faq/faq-group/factory.tsx +39 -0
- package/src/blocks/faq/faq-group/index.ts +11 -0
- package/src/blocks/faq/faq-group/types.ts +14 -0
- package/src/blocks/faq/faq-item/edit.tsx +50 -0
- package/src/blocks/faq/faq-item/editor.scss +57 -0
- package/src/blocks/faq/faq-item/factory.tsx +24 -0
- package/src/blocks/faq/faq-item/index.ts +9 -0
- package/src/blocks/faq/faq-item/types.ts +7 -0
- package/src/blocks/form/form-field/constants.ts +14 -0
- package/src/blocks/form/form-field/edit.tsx +178 -0
- package/src/blocks/form/form-field/editor.scss +71 -0
- package/src/blocks/form/form-field/factory.tsx +32 -0
- package/src/blocks/form/form-field/index.ts +10 -0
- package/src/blocks/form/form-field/types.ts +18 -0
- package/src/blocks/form/form-group/constants.ts +16 -0
- package/src/blocks/form/form-group/edit.tsx +214 -0
- package/src/blocks/form/form-group/editor.scss +41 -0
- package/src/blocks/form/form-group/factory.tsx +36 -0
- package/src/blocks/form/form-group/index.ts +18 -0
- package/src/blocks/form/form-group/types.ts +23 -0
- package/src/blocks/groups/banner-group/constants.ts +15 -0
- package/src/blocks/groups/banner-group/edit.tsx +122 -0
- package/src/blocks/groups/banner-group/editor.scss +18 -0
- package/src/blocks/groups/banner-group/factory.tsx +64 -0
- package/src/blocks/groups/banner-group/icon.tsx +13 -0
- package/src/blocks/groups/banner-group/index.ts +11 -0
- package/src/blocks/groups/banner-group/types.ts +30 -0
- package/src/blocks/groups/basic-header-group/constants.ts +9 -0
- package/src/blocks/groups/basic-header-group/edit.tsx +99 -0
- package/src/blocks/groups/basic-header-group/editor.scss +35 -0
- package/src/blocks/groups/basic-header-group/factory.tsx +46 -0
- package/src/blocks/groups/basic-header-group/icon.tsx +17 -0
- package/src/blocks/groups/basic-header-group/index.ts +9 -0
- package/src/blocks/groups/basic-header-group/types.ts +27 -0
- package/src/blocks/groups/button-group/constants.ts +7 -0
- package/src/blocks/groups/button-group/edit.tsx +52 -0
- package/src/blocks/groups/button-group/editor.scss +23 -0
- package/src/blocks/groups/button-group/factory.tsx +34 -0
- package/src/blocks/groups/button-group/index.ts +11 -0
- package/src/blocks/groups/button-group/types.ts +12 -0
- package/src/blocks/groups/text-and-media-group/constants.ts +43 -0
- package/src/blocks/groups/text-and-media-group/edit.tsx +241 -0
- package/src/blocks/groups/text-and-media-group/editor.scss +123 -0
- package/src/blocks/groups/text-and-media-group/factory.tsx +100 -0
- package/src/blocks/groups/text-and-media-group/icon.tsx +37 -0
- package/src/blocks/groups/text-and-media-group/index.ts +18 -0
- package/src/blocks/groups/text-and-media-group/types.ts +60 -0
- package/src/blocks/hero/hero-group/constants.ts +23 -0
- package/src/blocks/hero/hero-group/edit.tsx +85 -0
- package/src/blocks/hero/hero-group/editor.scss +0 -0
- package/src/blocks/hero/hero-group/factory.tsx +45 -0
- package/src/blocks/hero/hero-group/icon.tsx +28 -0
- package/src/blocks/hero/hero-group/index.ts +11 -0
- package/src/blocks/hero/hero-group/types.ts +22 -0
- package/src/blocks/hero/hero-item/constants.ts +15 -0
- package/src/blocks/hero/hero-item/edit.tsx +107 -0
- package/src/blocks/hero/hero-item/editor.scss +87 -0
- package/src/blocks/hero/hero-item/factory.tsx +49 -0
- package/src/blocks/hero/hero-item/index.ts +10 -0
- package/src/blocks/hero/hero-item/types.ts +38 -0
- package/src/blocks/map/map-group/constants.ts +20 -0
- package/src/blocks/map/map-group/edit.tsx +108 -0
- package/src/blocks/map/map-group/editor.scss +24 -0
- package/src/blocks/map/map-group/factory.tsx +51 -0
- package/src/blocks/map/map-group/index.ts +9 -0
- package/src/blocks/map/map-group/types.ts +16 -0
- package/src/blocks/newsletter/newsletter-form/constants.ts +5 -0
- package/src/blocks/newsletter/newsletter-form/edit.tsx +194 -0
- package/src/blocks/newsletter/newsletter-form/editor.scss +68 -0
- package/src/blocks/newsletter/newsletter-form/factory.tsx +59 -0
- package/src/blocks/newsletter/newsletter-form/index.ts +11 -0
- package/src/blocks/newsletter/newsletter-form/types.ts +45 -0
- package/src/blocks/post/post-slider-group/constants.ts +3 -0
- package/src/blocks/post/post-slider-group/edit.tsx +76 -0
- package/src/blocks/post/post-slider-group/factory.tsx +43 -0
- package/src/blocks/post/post-slider-group/icon.tsx +13 -0
- package/src/blocks/post/post-slider-group/index.ts +9 -0
- package/src/blocks/post/post-slider-group/types.ts +20 -0
- package/src/blocks/responsive-grid/responsive-grid-group/edit.tsx +95 -0
- package/src/blocks/responsive-grid/responsive-grid-group/factory.tsx +33 -0
- package/src/blocks/responsive-grid/responsive-grid-group/index.ts +13 -0
- package/src/blocks/responsive-grid/responsive-grid-group/types.ts +9 -0
- package/src/blocks/responsive-grid/responsive-grid-item/edit.tsx +19 -0
- package/src/blocks/responsive-grid/responsive-grid-item/factory.tsx +20 -0
- package/src/blocks/responsive-grid/responsive-grid-item/index.ts +9 -0
- package/src/blocks/responsive-grid/responsive-grid-item/types.ts +5 -0
- package/src/blocks/sections/base-section/attributes.ts +17 -0
- package/src/blocks/sections/base-section/constants.ts +18 -0
- package/src/blocks/sections/base-section/controls.tsx +70 -0
- package/src/blocks/sections/base-section/edit.tsx +34 -0
- package/src/blocks/sections/base-section/editor.scss +24 -0
- package/src/blocks/sections/base-section/factory.tsx +47 -0
- package/src/blocks/sections/base-section/icon.tsx +6 -0
- package/src/blocks/sections/base-section/index.ts +14 -0
- package/src/blocks/sections/base-section/types.ts +26 -0
- package/src/blocks/signpost/signpost-group/constants.ts +3 -0
- package/src/blocks/signpost/signpost-group/edit.tsx +75 -0
- package/src/blocks/signpost/signpost-group/editor.scss +0 -0
- package/src/blocks/signpost/signpost-group/factory.tsx +40 -0
- package/src/blocks/signpost/signpost-group/icon.tsx +19 -0
- package/src/blocks/signpost/signpost-group/index.ts +15 -0
- package/src/blocks/signpost/signpost-group/types.ts +9 -0
- package/src/blocks/signpost/signpost-item/constants.ts +4 -0
- package/src/blocks/signpost/signpost-item/edit.tsx +90 -0
- package/src/blocks/signpost/signpost-item/editor.scss +25 -0
- package/src/blocks/signpost/signpost-item/factory.tsx +29 -0
- package/src/blocks/signpost/signpost-item/icon.tsx +7 -0
- package/src/blocks/signpost/signpost-item/index.ts +10 -0
- package/src/blocks/signpost/signpost-item/types.ts +12 -0
- package/src/blocks/step/step-group/constants.ts +6 -0
- package/src/blocks/step/step-group/edit.tsx +64 -0
- package/src/blocks/step/step-group/editor.scss +19 -0
- package/src/blocks/step/step-group/factory.tsx +36 -0
- package/src/blocks/step/step-group/icon.tsx +27 -0
- package/src/blocks/step/step-group/index.ts +15 -0
- package/src/blocks/step/step-group/types.ts +13 -0
- package/src/blocks/step/step-item/constants.ts +6 -0
- package/src/blocks/step/step-item/edit.tsx +60 -0
- package/src/blocks/step/step-item/editor.scss +18 -0
- package/src/blocks/step/step-item/factory.tsx +27 -0
- package/src/blocks/step/step-item/index.ts +11 -0
- package/src/blocks/step/step-item/types.ts +12 -0
- package/src/blocks/testimonial/testimonial-group/constants.ts +27 -0
- package/src/blocks/testimonial/testimonial-group/edit.tsx +74 -0
- package/src/blocks/testimonial/testimonial-group/editor.scss +38 -0
- package/src/blocks/testimonial/testimonial-group/factory.tsx +44 -0
- package/src/blocks/testimonial/testimonial-group/icon.tsx +33 -0
- package/src/blocks/testimonial/testimonial-group/index.ts +15 -0
- package/src/blocks/testimonial/testimonial-group/types.ts +19 -0
- package/src/blocks/testimonial/testimonial-item/edit.tsx +48 -0
- package/src/blocks/testimonial/testimonial-item/editor.scss +20 -0
- package/src/blocks/testimonial/testimonial-item/factory.tsx +35 -0
- package/src/blocks/testimonial/testimonial-item/index.ts +9 -0
- package/src/blocks/testimonial/testimonial-item/types.ts +9 -0
- package/src/blocks/text-and-form/text-and-form-group/constants.ts +6 -0
- package/src/blocks/text-and-form/text-and-form-group/edit.tsx +59 -0
- package/src/blocks/text-and-form/text-and-form-group/editor.scss +21 -0
- package/src/blocks/text-and-form/text-and-form-group/factory.tsx +38 -0
- package/src/blocks/text-and-form/text-and-form-group/icon.tsx +23 -0
- package/src/blocks/text-and-form/text-and-form-group/index.ts +9 -0
- package/src/blocks/text-and-form/text-and-form-group/types.ts +23 -0
- package/src/blocks/text-and-form/text-and-form-text-column/constants.ts +10 -0
- package/src/blocks/text-and-form/text-and-form-text-column/edit.tsx +94 -0
- package/src/blocks/text-and-form/text-and-form-text-column/editor.scss +29 -0
- package/src/blocks/text-and-form/text-and-form-text-column/factory.tsx +41 -0
- package/src/blocks/text-and-form/text-and-form-text-column/index.ts +18 -0
- package/src/blocks/text-and-form/text-and-form-text-column/types.ts +23 -0
- package/src/blocks/usp/usp-group/constants.ts +54 -0
- package/src/blocks/usp/usp-group/edit.tsx +197 -0
- package/src/blocks/usp/usp-group/editor.scss +24 -0
- package/src/blocks/usp/usp-group/factory.tsx +113 -0
- package/src/blocks/usp/usp-group/icon.tsx +18 -0
- package/src/blocks/usp/usp-group/index.ts +15 -0
- package/src/blocks/usp/usp-group/types.ts +70 -0
- package/src/blocks/usp/usp-item/constants.ts +7 -0
- package/src/blocks/usp/usp-item/edit.tsx +65 -0
- package/src/blocks/usp/usp-item/editor.scss +17 -0
- package/src/blocks/usp/usp-item/factory.tsx +30 -0
- package/src/blocks/usp/usp-item/index.ts +11 -0
- package/src/blocks/usp/usp-item/types.ts +17 -0
- package/src/components/IconControl/IconControl.tsx +55 -0
- package/src/components/IconControl/editor.scss +53 -0
- package/src/components/IconControl/index.ts +2 -0
- package/src/components/IconControl/index.tsx +1 -0
- package/src/components/ImagePicker/ImagePicker.tsx +124 -0
- package/src/components/ImagePicker/editor.scss +79 -0
- package/src/components/ImagePicker/index.ts +2 -0
- package/src/components/ImagePicker/index.tsx +1 -0
- package/src/components/ItemIconControl/ItemIconControl.tsx +72 -0
- package/src/components/ItemIconControl/ItemIconModal.tsx +12 -0
- package/src/components/ItemIconControl/ItemIconPreview.tsx +93 -0
- package/src/components/ItemIconControl/editor.scss +52 -0
- package/src/components/ItemIconControl/index.ts +2 -0
- package/src/components/ItemIconControl/types.d.ts +30 -0
- package/src/constants.ts +20 -0
- package/src/editor.scss +34 -0
- package/src/globals.scss +237 -0
- package/src/hooks/useGroupBlock.ts +53 -0
- package/src/index.ts +122 -0
- package/src/types.ts +33 -0
- package/src/utils/createEditAdapter.ts +11 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
@layer base {
|
|
2
|
+
.i-button {
|
|
3
|
+
--background: transparent;
|
|
4
|
+
--font-color: inherit;
|
|
5
|
+
--border-color: transparent;
|
|
6
|
+
--padding-y: 10px;
|
|
7
|
+
--padding-x: 20px;
|
|
8
|
+
--font-size: 14px;
|
|
9
|
+
--font-weight: 600;
|
|
10
|
+
--border-radius: 4px;
|
|
11
|
+
|
|
12
|
+
display: contents;
|
|
13
|
+
|
|
14
|
+
&.--variant-primary {
|
|
15
|
+
--background: #0073aa;
|
|
16
|
+
--font-color: #fff;
|
|
17
|
+
--border-color: #0073aa;
|
|
18
|
+
|
|
19
|
+
&.--outline {
|
|
20
|
+
--background: transparent;
|
|
21
|
+
--font-color: #0073aa;
|
|
22
|
+
--border-color: #0073aa;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&.--variant-secondary {
|
|
27
|
+
--background: #5a6e8b;
|
|
28
|
+
--font-color: #fff;
|
|
29
|
+
--border-color: #5a6e8b;
|
|
30
|
+
|
|
31
|
+
&.--outline {
|
|
32
|
+
--background: transparent;
|
|
33
|
+
--font-color: #5a6e8b;
|
|
34
|
+
--border-color: #5a6e8b;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&.--variant-neutral {
|
|
39
|
+
--background: #e2e8f0;
|
|
40
|
+
--font-color: #1a202c;
|
|
41
|
+
--border-color: transparent;
|
|
42
|
+
|
|
43
|
+
&.--outline {
|
|
44
|
+
--background: transparent;
|
|
45
|
+
--font-color: #1a202c;
|
|
46
|
+
--border-color: #1a202c;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&.--variant-ghost {
|
|
51
|
+
--background: transparent;
|
|
52
|
+
--font-color: #1a202c;
|
|
53
|
+
--border-color: transparent;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
&.--size-sm {
|
|
57
|
+
--padding-y: 6px;
|
|
58
|
+
--padding-x: 14px;
|
|
59
|
+
--font-size: 12px;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.i-button__inner {
|
|
64
|
+
display: inline-flex;
|
|
65
|
+
align-items: center;
|
|
66
|
+
padding: var(--padding-y) var(--padding-x);
|
|
67
|
+
border-radius: var(--border-radius);
|
|
68
|
+
background-color: var(--background);
|
|
69
|
+
color: var(--font-color);
|
|
70
|
+
border: 1px solid var(--border-color);
|
|
71
|
+
font-size: var(--font-size);
|
|
72
|
+
font-weight: var(--font-weight);
|
|
73
|
+
cursor: pointer;
|
|
74
|
+
text-decoration: none;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.i-button__label {
|
|
78
|
+
pointer-events: auto;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type {BlockConfiguration} from '@wordpress/blocks'
|
|
2
|
+
import {__} from '@wordpress/i18n'
|
|
3
|
+
import type {OptionArray} from '~/types'
|
|
4
|
+
import {DEFAULT_FULL_WIDTH_OPTIONS, DEFAULT_SIZES, DEFAULT_VARIANTS} from './constants'
|
|
5
|
+
import {createBasicButtonEdit} from './edit'
|
|
6
|
+
import type {BasicButtonAttributes, BasicButtonOptions} from './types'
|
|
7
|
+
|
|
8
|
+
export type {BasicButtonAttributes, BasicButtonOptions}
|
|
9
|
+
|
|
10
|
+
export function createBasicButtonBlock<
|
|
11
|
+
TVariants extends OptionArray = typeof DEFAULT_VARIANTS,
|
|
12
|
+
TSizes extends OptionArray = typeof DEFAULT_SIZES,
|
|
13
|
+
TFullWidthOptions extends OptionArray = typeof DEFAULT_FULL_WIDTH_OPTIONS,
|
|
14
|
+
>(
|
|
15
|
+
options: BasicButtonOptions<TVariants, TSizes, TFullWidthOptions>,
|
|
16
|
+
): BlockConfiguration<BasicButtonAttributes<TVariants[number]['value'], TSizes[number]['value'], TFullWidthOptions[number]['value']>> {
|
|
17
|
+
const variants = options.variants ?? DEFAULT_VARIANTS
|
|
18
|
+
const sizes = options.sizes ?? DEFAULT_SIZES
|
|
19
|
+
const fullWidthOptions = options.fullWidthOptions ?? DEFAULT_FULL_WIDTH_OPTIONS
|
|
20
|
+
|
|
21
|
+
return {
|
|
22
|
+
name: options.name,
|
|
23
|
+
title: options.title ?? __('Tlačítko', 'brilo-blocks'),
|
|
24
|
+
description: options.description,
|
|
25
|
+
category: options.category ?? 'common',
|
|
26
|
+
...(options.parent && {parent: options.parent}),
|
|
27
|
+
icon: options.icon ?? 'button',
|
|
28
|
+
supports: {html: false, customClassName: false},
|
|
29
|
+
attributes: {
|
|
30
|
+
title: {type: 'string', default: ''},
|
|
31
|
+
variant: {
|
|
32
|
+
type: 'string',
|
|
33
|
+
default: variants[0].value,
|
|
34
|
+
enum: variants.map((v) => v.value),
|
|
35
|
+
},
|
|
36
|
+
outline: {type: 'boolean', default: false},
|
|
37
|
+
fullWidth: {
|
|
38
|
+
type: 'string',
|
|
39
|
+
default: fullWidthOptions[0].value,
|
|
40
|
+
enum: fullWidthOptions.map((o) => o.value),
|
|
41
|
+
},
|
|
42
|
+
size: {
|
|
43
|
+
type: 'string',
|
|
44
|
+
default: sizes[0].value,
|
|
45
|
+
enum: sizes.map((s) => s.value),
|
|
46
|
+
},
|
|
47
|
+
url: {type: 'object', default: {src: '', blank: false}},
|
|
48
|
+
},
|
|
49
|
+
edit: createBasicButtonEdit(options as unknown as BasicButtonOptions),
|
|
50
|
+
save: () => null,
|
|
51
|
+
} as unknown as BlockConfiguration<
|
|
52
|
+
BasicButtonAttributes<TVariants[number]['value'], TSizes[number]['value'], TFullWidthOptions[number]['value']>
|
|
53
|
+
>
|
|
54
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type {BasicButtonAttributes, BasicButtonOptions} from './types'
|
|
2
|
+
export {createBasicButtonBlock} from './factory'
|
|
3
|
+
|
|
4
|
+
import type {BasicButtonOptions} from './types'
|
|
5
|
+
|
|
6
|
+
export const basicButtonDefaults: BasicButtonOptions = {
|
|
7
|
+
name: 'brilo/basic-button',
|
|
8
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type {BriloBlockType, OptionArray} from '~/types'
|
|
2
|
+
import type {DEFAULT_FULL_WIDTH_OPTIONS, DEFAULT_SIZES, DEFAULT_VARIANTS} from './constants'
|
|
3
|
+
|
|
4
|
+
export type ButtonVariant = (typeof DEFAULT_VARIANTS)[number]['value']
|
|
5
|
+
export type ButtonSize = (typeof DEFAULT_SIZES)[number]['value']
|
|
6
|
+
export type ButtonFullWidth = (typeof DEFAULT_FULL_WIDTH_OPTIONS)[number]['value']
|
|
7
|
+
|
|
8
|
+
export interface BasicButtonAttributes<
|
|
9
|
+
TVariant extends string = ButtonVariant,
|
|
10
|
+
TSize extends string = ButtonSize,
|
|
11
|
+
TFullWidth extends string = ButtonFullWidth,
|
|
12
|
+
> extends Record<string, unknown> {
|
|
13
|
+
title: string
|
|
14
|
+
variant: TVariant
|
|
15
|
+
outline: boolean
|
|
16
|
+
fullWidth: TFullWidth
|
|
17
|
+
size: TSize
|
|
18
|
+
url: {src: string; blank: boolean}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface BasicButtonOptions<
|
|
22
|
+
TVariants extends OptionArray = typeof DEFAULT_VARIANTS,
|
|
23
|
+
TSizes extends OptionArray = typeof DEFAULT_SIZES,
|
|
24
|
+
TFullWidthOptions extends OptionArray = typeof DEFAULT_FULL_WIDTH_OPTIONS,
|
|
25
|
+
> extends BriloBlockType {
|
|
26
|
+
variants?: TVariants
|
|
27
|
+
sizes?: TSizes
|
|
28
|
+
fullWidthOptions?: TFullWidthOptions
|
|
29
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {HEADING_LEVELS as DEFAULT_LEVELS, HEADING_STYLES as DEFAULT_STYLES} from '~/constants'
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import {BlockControls, InspectorControls, RichText, useBlockProps} from '@wordpress/block-editor'
|
|
2
|
+
import {
|
|
3
|
+
PanelBody,
|
|
4
|
+
__experimentalToggleGroupControl as ToggleGroupControl,
|
|
5
|
+
__experimentalToggleGroupControlOption as ToggleGroupControlOption,
|
|
6
|
+
ToolbarButton,
|
|
7
|
+
ToolbarGroup,
|
|
8
|
+
} from '@wordpress/components'
|
|
9
|
+
import {__} from '@wordpress/i18n'
|
|
10
|
+
import clsx from 'clsx'
|
|
11
|
+
import {DEFAULT_LEVELS, DEFAULT_STYLES} from './constants'
|
|
12
|
+
import type {BasicHeadingAttributes, BasicHeadingOptions, HeadingStyle} from './types'
|
|
13
|
+
|
|
14
|
+
export function createBasicHeadingEdit(options: BasicHeadingOptions) {
|
|
15
|
+
const LEVELS = options.levels ?? DEFAULT_LEVELS
|
|
16
|
+
const STYLES = options.styles ?? DEFAULT_STYLES
|
|
17
|
+
|
|
18
|
+
return function Edit({
|
|
19
|
+
attributes,
|
|
20
|
+
setAttributes,
|
|
21
|
+
}: {
|
|
22
|
+
attributes: BasicHeadingAttributes
|
|
23
|
+
setAttributes: (a: Partial<BasicHeadingAttributes>) => void
|
|
24
|
+
}) {
|
|
25
|
+
const {title, level, style} = attributes
|
|
26
|
+
const blockProps = useBlockProps({
|
|
27
|
+
className: clsx(options.blockClassName ?? 'i-heading', `--heading-style-${style}`),
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<>
|
|
32
|
+
<BlockControls>
|
|
33
|
+
<ToolbarGroup>
|
|
34
|
+
{LEVELS.map((l) => (
|
|
35
|
+
<ToolbarButton key={l} isActive={level === l} onClick={() => setAttributes({level: l as BasicHeadingAttributes['level']})}>
|
|
36
|
+
{`H${l}`}
|
|
37
|
+
</ToolbarButton>
|
|
38
|
+
))}
|
|
39
|
+
</ToolbarGroup>
|
|
40
|
+
</BlockControls>
|
|
41
|
+
<InspectorControls>
|
|
42
|
+
<PanelBody title={__('Nadpis', 'brilo-blocks')}>
|
|
43
|
+
<ToggleGroupControl
|
|
44
|
+
label={__('Úroveň', 'brilo-blocks')}
|
|
45
|
+
value={String(level)}
|
|
46
|
+
onChange={(value) => setAttributes({level: Number(value) as BasicHeadingAttributes['level']})}
|
|
47
|
+
isBlock
|
|
48
|
+
>
|
|
49
|
+
{LEVELS.map((l) => (
|
|
50
|
+
<ToggleGroupControlOption key={l} value={String(l)} label={`H${l}`} />
|
|
51
|
+
))}
|
|
52
|
+
</ToggleGroupControl>
|
|
53
|
+
<ToggleGroupControl
|
|
54
|
+
label={__('Styl', 'brilo-blocks')}
|
|
55
|
+
value={style}
|
|
56
|
+
onChange={(value) => setAttributes({style: value as HeadingStyle})}
|
|
57
|
+
isBlock
|
|
58
|
+
>
|
|
59
|
+
{STYLES.map((s) => (
|
|
60
|
+
<ToggleGroupControlOption key={s} value={s} label={s.toUpperCase()} />
|
|
61
|
+
))}
|
|
62
|
+
</ToggleGroupControl>
|
|
63
|
+
</PanelBody>
|
|
64
|
+
</InspectorControls>
|
|
65
|
+
<RichText
|
|
66
|
+
{...blockProps}
|
|
67
|
+
tagName={`h${level}` as 'h1' | 'h2' | 'h3' | 'h4'}
|
|
68
|
+
value={title}
|
|
69
|
+
onChange={(value) => setAttributes({title: value})}
|
|
70
|
+
placeholder={__('Nadpis...', 'brilo-blocks')}
|
|
71
|
+
allowedFormats={['core/bold', 'core/italic']}
|
|
72
|
+
/>
|
|
73
|
+
</>
|
|
74
|
+
)
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type {BlockConfiguration} from '@wordpress/blocks'
|
|
2
|
+
import {__} from '@wordpress/i18n'
|
|
3
|
+
import type {NumberArray, StringArray} from '~/types'
|
|
4
|
+
import {DEFAULT_LEVELS, DEFAULT_STYLES} from './constants'
|
|
5
|
+
import {createBasicHeadingEdit} from './edit'
|
|
6
|
+
import type {BasicHeadingAttributes, BasicHeadingOptions} from './types'
|
|
7
|
+
|
|
8
|
+
export type {BasicHeadingAttributes, BasicHeadingOptions}
|
|
9
|
+
|
|
10
|
+
export function createBasicHeadingBlock<
|
|
11
|
+
TLevels extends NumberArray = typeof DEFAULT_LEVELS,
|
|
12
|
+
TStyles extends StringArray = typeof DEFAULT_STYLES,
|
|
13
|
+
>(options: BasicHeadingOptions<TLevels, TStyles>): BlockConfiguration<BasicHeadingAttributes<TLevels[number], TStyles[number]>> {
|
|
14
|
+
const levels = options.levels ?? DEFAULT_LEVELS
|
|
15
|
+
const styles = options.styles ?? DEFAULT_STYLES
|
|
16
|
+
|
|
17
|
+
return {
|
|
18
|
+
name: options.name,
|
|
19
|
+
title: options.title ?? __('Nadpis', 'brilo-blocks'),
|
|
20
|
+
description: options.description,
|
|
21
|
+
category: options.category ?? 'text',
|
|
22
|
+
supports: {html: false, customClassName: false},
|
|
23
|
+
icon: options.icon ?? 'heading',
|
|
24
|
+
attributes: {
|
|
25
|
+
title: {type: 'string', default: ''},
|
|
26
|
+
level: {
|
|
27
|
+
type: 'number',
|
|
28
|
+
default: levels[1] ?? levels[0],
|
|
29
|
+
enum: [...levels],
|
|
30
|
+
},
|
|
31
|
+
style: {
|
|
32
|
+
type: 'string',
|
|
33
|
+
default: styles[1] ?? styles[0],
|
|
34
|
+
enum: [...styles],
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
edit: createBasicHeadingEdit(options as unknown as BasicHeadingOptions),
|
|
38
|
+
save: () => null,
|
|
39
|
+
} as unknown as BlockConfiguration<BasicHeadingAttributes<TLevels[number], TStyles[number]>>
|
|
40
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type {BasicHeadingAttributes, BasicHeadingOptions} from './types'
|
|
2
|
+
export {createBasicHeadingBlock} from './factory'
|
|
3
|
+
|
|
4
|
+
import type {BasicHeadingOptions} from './types'
|
|
5
|
+
|
|
6
|
+
export const basicHeadingDefaults: BasicHeadingOptions = {
|
|
7
|
+
name: 'brilo/basic-heading',
|
|
8
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type {BriloBlockType, NumberArray, StringArray} from '~/types'
|
|
2
|
+
import type {DEFAULT_LEVELS, DEFAULT_STYLES} from './constants'
|
|
3
|
+
|
|
4
|
+
export type HeadingLevel = (typeof DEFAULT_LEVELS)[number]
|
|
5
|
+
export type HeadingStyle = (typeof DEFAULT_STYLES)[number]
|
|
6
|
+
|
|
7
|
+
export interface BasicHeadingAttributes<TLevel extends number = HeadingLevel, TStyle extends string = HeadingStyle>
|
|
8
|
+
extends Record<string, unknown> {
|
|
9
|
+
title: string
|
|
10
|
+
level: TLevel
|
|
11
|
+
style: TStyle
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface BasicHeadingOptions<
|
|
15
|
+
TLevels extends NumberArray = typeof DEFAULT_LEVELS,
|
|
16
|
+
TStyles extends StringArray = typeof DEFAULT_STYLES,
|
|
17
|
+
> extends BriloBlockType {
|
|
18
|
+
levels?: TLevels
|
|
19
|
+
styles?: TStyles
|
|
20
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import {RichText, useBlockProps} from '@wordpress/block-editor'
|
|
2
|
+
import {__} from '@wordpress/i18n'
|
|
3
|
+
import type {BasicOverlineAttributes, BasicOverlineOptions} from './types'
|
|
4
|
+
|
|
5
|
+
export function createBasicOverlineEdit(options: BasicOverlineOptions) {
|
|
6
|
+
return function Edit({
|
|
7
|
+
attributes,
|
|
8
|
+
setAttributes,
|
|
9
|
+
}: {
|
|
10
|
+
attributes: BasicOverlineAttributes
|
|
11
|
+
setAttributes: (a: Partial<BasicOverlineAttributes>) => void
|
|
12
|
+
}) {
|
|
13
|
+
const blockProps = useBlockProps({className: options.blockClassName ?? 'i-overline'})
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<div {...blockProps}>
|
|
17
|
+
<RichText
|
|
18
|
+
tagName="span"
|
|
19
|
+
className="i-overline__text u-text-editable"
|
|
20
|
+
value={attributes.title}
|
|
21
|
+
onChange={(value) => setAttributes({title: value})}
|
|
22
|
+
placeholder={__('Overline...', 'brilo-blocks')}
|
|
23
|
+
allowedFormats={[]}
|
|
24
|
+
/>
|
|
25
|
+
</div>
|
|
26
|
+
)
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type {BlockConfiguration} from '@wordpress/blocks'
|
|
2
|
+
import {__} from '@wordpress/i18n'
|
|
3
|
+
import {createBasicOverlineEdit} from './edit'
|
|
4
|
+
import type {BasicOverlineAttributes, BasicOverlineOptions} from './types'
|
|
5
|
+
|
|
6
|
+
export type {BasicOverlineAttributes, BasicOverlineOptions}
|
|
7
|
+
|
|
8
|
+
export function createBasicOverlineBlock(options: BasicOverlineOptions): BlockConfiguration<BasicOverlineAttributes> {
|
|
9
|
+
return {
|
|
10
|
+
name: options.name,
|
|
11
|
+
title: options.title ?? __('Overline', 'brilo-blocks'),
|
|
12
|
+
description: options.description,
|
|
13
|
+
category: options.category ?? 'text',
|
|
14
|
+
supports: {html: false, customClassName: false},
|
|
15
|
+
icon: options.icon ?? 'text',
|
|
16
|
+
attributes: {
|
|
17
|
+
title: {type: 'string', default: ''},
|
|
18
|
+
},
|
|
19
|
+
edit: createBasicOverlineEdit(options),
|
|
20
|
+
save: () => null,
|
|
21
|
+
} as unknown as BlockConfiguration<BasicOverlineAttributes>
|
|
22
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type {BasicOverlineAttributes, BasicOverlineOptions} from './types'
|
|
2
|
+
export {createBasicOverlineBlock} from './factory'
|
|
3
|
+
|
|
4
|
+
import type {BasicOverlineOptions} from './types'
|
|
5
|
+
|
|
6
|
+
export const basicOverlineDefaults: BasicOverlineOptions = {
|
|
7
|
+
name: 'brilo/basic-overline',
|
|
8
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import {__} from '@wordpress/i18n'
|
|
2
|
+
|
|
3
|
+
export const FAQ_HEADING_LEVELS = ['2', '3'] as const
|
|
4
|
+
|
|
5
|
+
export const DEFAULT_ICON_VARIANTS = [
|
|
6
|
+
{value: 'none', label: __('Nic', 'brilo-blocks')},
|
|
7
|
+
{value: 'question', label: __('Otazník', 'brilo-blocks')},
|
|
8
|
+
{value: 'exclamation', label: __('Vykřičník', 'brilo-blocks')},
|
|
9
|
+
{value: 'info', label: __('Informace', 'brilo-blocks')},
|
|
10
|
+
{value: 'message', label: __('Zpráva', 'brilo-blocks')},
|
|
11
|
+
] as const
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import {InspectorControls} from '@wordpress/block-editor'
|
|
2
|
+
import {PanelBody, SelectControl} from '@wordpress/components'
|
|
3
|
+
import {__} from '@wordpress/i18n'
|
|
4
|
+
import {useGroupBlock} from '~/hooks/useGroupBlock'
|
|
5
|
+
import {DEFAULT_ICON_VARIANTS, FAQ_HEADING_LEVELS} from './constants'
|
|
6
|
+
import type {FaqGroupAttributes, FaqGroupOptions, FaqHeadingLevel, FaqIconVariant} from './types'
|
|
7
|
+
|
|
8
|
+
export function createFaqGroupEdit(options: FaqGroupOptions) {
|
|
9
|
+
const ICON_VARIANTS = options.iconVariants ?? DEFAULT_ICON_VARIANTS
|
|
10
|
+
|
|
11
|
+
return function Edit({
|
|
12
|
+
attributes,
|
|
13
|
+
setAttributes,
|
|
14
|
+
}: {
|
|
15
|
+
attributes: FaqGroupAttributes
|
|
16
|
+
setAttributes: (a: Partial<FaqGroupAttributes>) => void
|
|
17
|
+
}) {
|
|
18
|
+
const {headingLevel, iconVariant} = attributes
|
|
19
|
+
|
|
20
|
+
const {blockProps, innerBlocksProps} = useGroupBlock({
|
|
21
|
+
blockClassName: options.blockClassName ?? 'g-faq wp-block-section',
|
|
22
|
+
containerClassName: options.containerClassName ?? 'g-faq__items',
|
|
23
|
+
allowedBlocks: options.allowedBlocks,
|
|
24
|
+
template: options.template,
|
|
25
|
+
orientation: 'vertical',
|
|
26
|
+
layout: {type: 'default'},
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<>
|
|
31
|
+
<InspectorControls>
|
|
32
|
+
<PanelBody title={__('Nadpis', 'brilo-blocks')}>
|
|
33
|
+
<SelectControl
|
|
34
|
+
label={__('Level nadpisu FAQ', 'brilo-blocks')}
|
|
35
|
+
value={headingLevel}
|
|
36
|
+
options={FAQ_HEADING_LEVELS.map((level) => ({value: level, label: `H${level}`}))}
|
|
37
|
+
onChange={(value) => setAttributes({headingLevel: value as FaqHeadingLevel})}
|
|
38
|
+
/>
|
|
39
|
+
</PanelBody>
|
|
40
|
+
<PanelBody title={__('Ikona', 'brilo-blocks')}>
|
|
41
|
+
<SelectControl
|
|
42
|
+
label={__('Typ ikonky', 'brilo-blocks')}
|
|
43
|
+
value={iconVariant}
|
|
44
|
+
options={ICON_VARIANTS.map((v) => ({value: v.value, label: v.label}))}
|
|
45
|
+
onChange={(value) => setAttributes({iconVariant: value as FaqIconVariant})}
|
|
46
|
+
/>
|
|
47
|
+
</PanelBody>
|
|
48
|
+
</InspectorControls>
|
|
49
|
+
<div {...blockProps}>
|
|
50
|
+
<div {...innerBlocksProps} />
|
|
51
|
+
</div>
|
|
52
|
+
</>
|
|
53
|
+
)
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import {InnerBlocks} from '@wordpress/block-editor'
|
|
2
|
+
import type {BlockConfiguration} from '@wordpress/blocks'
|
|
3
|
+
import {__} from '@wordpress/i18n'
|
|
4
|
+
import type {OptionArray} from '~/types'
|
|
5
|
+
import {DEFAULT_ICON_VARIANTS, FAQ_HEADING_LEVELS} from './constants'
|
|
6
|
+
import {createFaqGroupEdit} from './edit'
|
|
7
|
+
import type {FaqGroupAttributes, FaqGroupOptions} from './types'
|
|
8
|
+
|
|
9
|
+
export type {FaqGroupAttributes, FaqGroupOptions}
|
|
10
|
+
|
|
11
|
+
export function createFaqGroupBlock<TIconVariants extends OptionArray = typeof DEFAULT_ICON_VARIANTS>(
|
|
12
|
+
options: FaqGroupOptions<TIconVariants>,
|
|
13
|
+
): BlockConfiguration<FaqGroupAttributes<TIconVariants[number]['value']>> {
|
|
14
|
+
const iconVariants = options.iconVariants ?? DEFAULT_ICON_VARIANTS
|
|
15
|
+
|
|
16
|
+
return {
|
|
17
|
+
name: options.name,
|
|
18
|
+
title: options.title ?? __('FAQ', 'brilo-blocks'),
|
|
19
|
+
description: options.description,
|
|
20
|
+
category: options.category ?? 'layout',
|
|
21
|
+
...(options.parent && {parent: options.parent}),
|
|
22
|
+
icon: options.icon ?? 'editor-help',
|
|
23
|
+
supports: {html: false, customClassName: false},
|
|
24
|
+
attributes: {
|
|
25
|
+
headingLevel: {
|
|
26
|
+
type: 'string',
|
|
27
|
+
default: FAQ_HEADING_LEVELS[1],
|
|
28
|
+
enum: [...FAQ_HEADING_LEVELS],
|
|
29
|
+
},
|
|
30
|
+
iconVariant: {
|
|
31
|
+
type: 'string',
|
|
32
|
+
default: iconVariants[1]?.value ?? iconVariants[0].value,
|
|
33
|
+
enum: iconVariants.map((v) => v.value),
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
edit: createFaqGroupEdit(options as unknown as FaqGroupOptions),
|
|
37
|
+
save: () => <InnerBlocks.Content />,
|
|
38
|
+
} as unknown as BlockConfiguration<FaqGroupAttributes<TIconVariants[number]['value']>>
|
|
39
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type {FaqGroupAttributes, FaqGroupOptions} from './types'
|
|
2
|
+
export {createFaqGroupBlock} from './factory'
|
|
3
|
+
|
|
4
|
+
import type {FaqGroupOptions} from './types'
|
|
5
|
+
|
|
6
|
+
export const faqGroupDefaults: FaqGroupOptions = {
|
|
7
|
+
name: 'brilo/faq-group',
|
|
8
|
+
parent: ['brilo/base-section'],
|
|
9
|
+
allowedBlocks: ['brilo/faq-item'],
|
|
10
|
+
template: [['brilo/faq-item', {}]],
|
|
11
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type {BriloBlockType, OptionArray} from '~/types'
|
|
2
|
+
import type {DEFAULT_ICON_VARIANTS, FAQ_HEADING_LEVELS} from './constants'
|
|
3
|
+
|
|
4
|
+
export type FaqHeadingLevel = (typeof FAQ_HEADING_LEVELS)[number]
|
|
5
|
+
export type FaqIconVariant = (typeof DEFAULT_ICON_VARIANTS)[number]['value']
|
|
6
|
+
|
|
7
|
+
export interface FaqGroupAttributes<TIconVariant extends string = FaqIconVariant> extends Record<string, unknown> {
|
|
8
|
+
headingLevel: FaqHeadingLevel
|
|
9
|
+
iconVariant: TIconVariant
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface FaqGroupOptions<TIconVariants extends OptionArray = typeof DEFAULT_ICON_VARIANTS> extends BriloBlockType {
|
|
13
|
+
iconVariants?: TIconVariants
|
|
14
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import {InspectorControls, RichText, useBlockProps, useInnerBlocksProps} from '@wordpress/block-editor'
|
|
2
|
+
import {BaseControl, PanelBody} from '@wordpress/components'
|
|
3
|
+
import {Icon, chevronDown} from '@wordpress/icons'
|
|
4
|
+
import {__} from '@wordpress/i18n'
|
|
5
|
+
import clsx from 'clsx'
|
|
6
|
+
import type {FaqItemAttributes, FaqItemOptions} from './types'
|
|
7
|
+
|
|
8
|
+
export function createFaqItemEdit(_options: FaqItemOptions) {
|
|
9
|
+
return function Edit({
|
|
10
|
+
attributes,
|
|
11
|
+
setAttributes,
|
|
12
|
+
}: {
|
|
13
|
+
attributes: FaqItemAttributes
|
|
14
|
+
setAttributes: (a: Partial<FaqItemAttributes>) => void
|
|
15
|
+
}) {
|
|
16
|
+
const {title} = attributes
|
|
17
|
+
|
|
18
|
+
const blockProps = useBlockProps({className: clsx('faq-item')})
|
|
19
|
+
const innerBlocksProps = useInnerBlocksProps(
|
|
20
|
+
{},
|
|
21
|
+
{allowedBlocks: ['core/paragraph', 'core/list', 'core/image', 'core/table', 'brilo/button-group']},
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<>
|
|
26
|
+
<div {...blockProps}>
|
|
27
|
+
<header className="faq-item__header flex gap-2">
|
|
28
|
+
<RichText
|
|
29
|
+
identifier="title"
|
|
30
|
+
className="title u-text-editable grow"
|
|
31
|
+
tagName="h3"
|
|
32
|
+
value={title}
|
|
33
|
+
allowedFormats={[]}
|
|
34
|
+
onChange={(value: string) => setAttributes({title: value})}
|
|
35
|
+
placeholder={__('Nadpis prvku', 'brilo-blocks')}
|
|
36
|
+
data-custom-placeholder={true}
|
|
37
|
+
/>
|
|
38
|
+
<label className="faq-item__dropdown flex items-center justify-center cursor-pointer">
|
|
39
|
+
<Icon icon={chevronDown} size={32} className="faq-item__dropdown-icon" color="white" />
|
|
40
|
+
<input type="checkbox" defaultChecked />
|
|
41
|
+
</label>
|
|
42
|
+
</header>
|
|
43
|
+
<BaseControl label={__('Odpověď:', 'brilo-blocks')} className="faq-item__content">
|
|
44
|
+
<div {...innerBlocksProps} />
|
|
45
|
+
</BaseControl>
|
|
46
|
+
</div>
|
|
47
|
+
</>
|
|
48
|
+
)
|
|
49
|
+
}
|
|
50
|
+
}
|