@elementor/editor-editing-panel 4.5.0-1217 → 4.5.0-1219

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.
Files changed (47) hide show
  1. package/dist/index.d.mts +96 -75
  2. package/dist/index.d.ts +96 -75
  3. package/dist/index.js +1026 -934
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.mjs +681 -595
  6. package/dist/index.mjs.map +1 -1
  7. package/package.json +25 -25
  8. package/src/components/editing-panel-tabs.tsx +8 -4
  9. package/src/components/style-sections/border-section/border-color-field.tsx +4 -4
  10. package/src/components/style-sections/border-section/border-radius-field.tsx +4 -4
  11. package/src/components/style-sections/border-section/border-style-field.tsx +4 -4
  12. package/src/components/style-sections/border-section/border-width-field.tsx +4 -4
  13. package/src/components/style-sections/effects-section/blend-mode-field.tsx +4 -4
  14. package/src/components/style-sections/effects-section/opacity-control-field.tsx +4 -4
  15. package/src/components/style-sections/layout-section/align-content-field.tsx +4 -4
  16. package/src/components/style-sections/layout-section/align-items-field.tsx +4 -4
  17. package/src/components/style-sections/layout-section/display-field.tsx +4 -4
  18. package/src/components/style-sections/layout-section/flex-direction-field.tsx +4 -4
  19. package/src/components/style-sections/layout-section/gap-control-field.tsx +4 -4
  20. package/src/components/style-sections/layout-section/grid-justify-items-field.tsx +4 -4
  21. package/src/components/style-sections/layout-section/justify-content-field.tsx +4 -4
  22. package/src/components/style-sections/layout-section/wrap-field.tsx +4 -4
  23. package/src/components/style-sections/position-section/offset-field.tsx +4 -4
  24. package/src/components/style-sections/position-section/position-field.tsx +4 -4
  25. package/src/components/style-sections/position-section/z-index-field.tsx +4 -4
  26. package/src/components/style-sections/size-section/object-fit-field.tsx +4 -4
  27. package/src/components/style-sections/size-section/overflow-field.tsx +4 -4
  28. package/src/components/style-sections/typography-section/column-count-field.tsx +4 -4
  29. package/src/components/style-sections/typography-section/column-gap-field.tsx +4 -4
  30. package/src/components/style-sections/typography-section/font-family-field.tsx +5 -9
  31. package/src/components/style-sections/typography-section/font-size-field.tsx +5 -5
  32. package/src/components/style-sections/typography-section/font-style-field.tsx +4 -4
  33. package/src/components/style-sections/typography-section/font-weight-field.tsx +4 -4
  34. package/src/components/style-sections/typography-section/letter-spacing-field.tsx +4 -4
  35. package/src/components/style-sections/typography-section/line-height-field.tsx +4 -4
  36. package/src/components/style-sections/typography-section/text-alignment-field.tsx +4 -4
  37. package/src/components/style-sections/typography-section/text-color-field.tsx +4 -4
  38. package/src/components/style-sections/typography-section/text-decoration-field.tsx +4 -4
  39. package/src/components/style-sections/typography-section/text-direction-field.tsx +4 -4
  40. package/src/components/style-sections/typography-section/transform-field.tsx +4 -4
  41. package/src/components/style-sections/typography-section/word-spacing-field.tsx +4 -4
  42. package/src/contexts/styles-field-targets-context.tsx +17 -0
  43. package/src/controls-registry/styles-field.tsx +4 -0
  44. package/src/hooks/use-styles-fields.ts +89 -56
  45. package/src/index.ts +5 -2
  46. package/src/styles-field-registry.ts +79 -0
  47. package/src/utils/element-local-style.ts +30 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elementor/editor-editing-panel",
3
- "version": "4.5.0-1217",
3
+ "version": "4.5.0-1219",
4
4
  "private": false,
5
5
  "author": "Elementor Team",
6
6
  "homepage": "https://elementor.com/",
@@ -39,32 +39,32 @@
39
39
  "dev": "tsup --config=../../tsup.dev.ts"
40
40
  },
41
41
  "dependencies": {
42
- "@elementor/editor": "4.5.0-1217",
43
- "@elementor/editor-canvas": "4.5.0-1217",
44
- "@elementor/editor-controls": "4.5.0-1217",
45
- "@elementor/editor-current-user": "4.5.0-1217",
46
- "@elementor/editor-documents": "4.5.0-1217",
47
- "@elementor/editor-elements": "4.5.0-1217",
48
- "@elementor/editor-interactions": "4.5.0-1217",
49
- "@elementor/editor-notifications": "4.5.0-1217",
50
- "@elementor/editor-panels": "4.5.0-1217",
51
- "@elementor/editor-props": "4.5.0-1217",
52
- "@elementor/editor-responsive": "4.5.0-1217",
53
- "@elementor/editor-styles": "4.5.0-1217",
54
- "@elementor/editor-styles-repository": "4.5.0-1217",
55
- "@elementor/editor-ui": "4.5.0-1217",
56
- "@elementor/editor-v1-adapters": "4.5.0-1217",
57
- "@elementor/http-client": "4.5.0-1217",
42
+ "@elementor/editor": "4.5.0-1219",
43
+ "@elementor/editor-canvas": "4.5.0-1219",
44
+ "@elementor/editor-controls": "4.5.0-1219",
45
+ "@elementor/editor-current-user": "4.5.0-1219",
46
+ "@elementor/editor-documents": "4.5.0-1219",
47
+ "@elementor/editor-elements": "4.5.0-1219",
48
+ "@elementor/editor-interactions": "4.5.0-1219",
49
+ "@elementor/editor-notifications": "4.5.0-1219",
50
+ "@elementor/editor-panels": "4.5.0-1219",
51
+ "@elementor/editor-props": "4.5.0-1219",
52
+ "@elementor/editor-responsive": "4.5.0-1219",
53
+ "@elementor/editor-styles": "4.5.0-1219",
54
+ "@elementor/editor-styles-repository": "4.5.0-1219",
55
+ "@elementor/editor-ui": "4.5.0-1219",
56
+ "@elementor/editor-v1-adapters": "4.5.0-1219",
57
+ "@elementor/http-client": "4.5.0-1219",
58
58
  "@elementor/icons": "~1.78.1",
59
- "@elementor/editor-variables": "4.5.0-1217",
60
- "@elementor/locations": "4.5.0-1217",
61
- "@elementor/menus": "4.5.0-1217",
62
- "@elementor/query": "4.5.0-1217",
63
- "@elementor/schema": "4.5.0-1217",
64
- "@elementor/session": "4.5.0-1217",
59
+ "@elementor/editor-variables": "4.5.0-1219",
60
+ "@elementor/locations": "4.5.0-1219",
61
+ "@elementor/menus": "4.5.0-1219",
62
+ "@elementor/query": "4.5.0-1219",
63
+ "@elementor/schema": "4.5.0-1219",
64
+ "@elementor/session": "4.5.0-1219",
65
65
  "@elementor/ui": "1.41.4",
66
- "@elementor/utils": "4.5.0-1217",
67
- "@elementor/wp-media": "4.5.0-1217",
66
+ "@elementor/utils": "4.5.0-1219",
67
+ "@elementor/wp-media": "4.5.0-1219",
68
68
  "@wordpress/i18n": "^5.13.0"
69
69
  },
70
70
  "peerDependencies": {
@@ -21,13 +21,15 @@ const CONTENT_ONLY_TAB: TabValue = 'settings';
21
21
 
22
22
  const DESIGN_TABS: TabValue[] = [ 'style', 'interactions' ];
23
23
 
24
- type SettingsTabSlotProps = {
24
+ type TabSlotProps = {
25
25
  element: Element;
26
26
  elementType: ElementType;
27
27
  };
28
28
 
29
- export const { Slot: SettingsTabSlot, inject: injectIntoSettingsTab } =
30
- createReplaceableLocation< SettingsTabSlotProps >();
29
+ export const { Slot: SettingsTabSlot, inject: injectIntoSettingsTab } = createReplaceableLocation< TabSlotProps >();
30
+
31
+ export const { Slot: StyleTabContentSlot, inject: injectIntoStyleTabContent } =
32
+ createReplaceableLocation< TabSlotProps >();
31
33
 
32
34
  export const EditingPanelTabs = () => {
33
35
  const { element } = useElement();
@@ -112,7 +114,9 @@ const PanelTabContent = () => {
112
114
  { hasDesignTabs && ! areDesignTabsRestricted && (
113
115
  <>
114
116
  <TabPanel { ...getTabPanelProps( 'style' ) } disablePadding>
115
- <StyleTab />
117
+ <StyleTabContentSlot element={ element } elementType={ elementType }>
118
+ <StyleTab />
119
+ </StyleTabContentSlot>
116
120
  </TabPanel>
117
121
  <TabPanel { ...getTabPanelProps( 'interactions' ) } disablePadding>
118
122
  <InteractionsTab />
@@ -2,14 +2,14 @@ import * as React from 'react';
2
2
  import { ColorControl } from '@elementor/editor-controls';
3
3
  import { __ } from '@wordpress/i18n';
4
4
 
5
- import { StylesField } from '../../../controls-registry/styles-field';
5
+ import { StylesField, type StylesFieldLabelProps } from '../../../controls-registry/styles-field';
6
6
  import { StylesFieldLayout } from '../../styles-field-layout';
7
7
 
8
8
  const BORDER_COLOR_LABEL = __( 'Border color', 'elementor' );
9
9
 
10
- export const BorderColorField = () => (
11
- <StylesField bind="border-color" propDisplayName={ BORDER_COLOR_LABEL }>
12
- <StylesFieldLayout label={ BORDER_COLOR_LABEL }>
10
+ export const BorderColorField = ( { label = BORDER_COLOR_LABEL }: StylesFieldLabelProps ) => (
11
+ <StylesField bind="border-color" propDisplayName={ label }>
12
+ <StylesFieldLayout label={ label }>
13
13
  <ColorControl />
14
14
  </StylesFieldLayout>
15
15
  </StylesField>
@@ -11,7 +11,7 @@ import {
11
11
  import { withDirection } from '@elementor/ui';
12
12
  import { __ } from '@wordpress/i18n';
13
13
 
14
- import { StylesField } from '../../../controls-registry/styles-field';
14
+ import { StylesField, type StylesFieldLabelProps } from '../../../controls-registry/styles-field';
15
15
  import { useDirection } from '../../../hooks/use-direction';
16
16
  import { UiProviders } from '../../../styles-inheritance/components/ui-providers';
17
17
 
@@ -73,15 +73,15 @@ const getCorners = ( isSiteRtl: boolean ): EqualUnequalItems => [
73
73
  },
74
74
  ];
75
75
 
76
- export const BorderRadiusField = () => {
76
+ export const BorderRadiusField = ( { label = BORDER_RADIUS_LABEL }: StylesFieldLabelProps ) => {
77
77
  const { isSiteRtl } = useDirection();
78
78
 
79
79
  return (
80
80
  <UiProviders>
81
- <StylesField bind={ 'border-radius' } propDisplayName={ BORDER_RADIUS_LABEL }>
81
+ <StylesField bind={ 'border-radius' } propDisplayName={ label }>
82
82
  <EqualUnequalSizesControl
83
83
  items={ getCorners( isSiteRtl ) }
84
- label={ BORDER_RADIUS_LABEL }
84
+ label={ label }
85
85
  icon={ <BorderCornersIcon fontSize={ 'tiny' } /> }
86
86
  tooltipLabel={ __( 'Adjust corners', 'elementor' ) }
87
87
  multiSizePropTypeUtil={ borderRadiusPropTypeUtil }
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import { SelectControl } from '@elementor/editor-controls';
3
3
  import { __ } from '@wordpress/i18n';
4
4
 
5
- import { StylesField } from '../../../controls-registry/styles-field';
5
+ import { StylesField, type StylesFieldLabelProps } from '../../../controls-registry/styles-field';
6
6
  import { StylesFieldLayout } from '../../styles-field-layout';
7
7
 
8
8
  const BORDER_TYPE_LABEL = __( 'Border type', 'elementor' );
@@ -19,9 +19,9 @@ const borderStyles = [
19
19
  { value: 'outset', label: __( 'Outset', 'elementor' ) },
20
20
  ];
21
21
 
22
- export const BorderStyleField = () => (
23
- <StylesField bind="border-style" propDisplayName={ BORDER_TYPE_LABEL }>
24
- <StylesFieldLayout label={ BORDER_TYPE_LABEL }>
22
+ export const BorderStyleField = ( { label = BORDER_TYPE_LABEL }: StylesFieldLabelProps ) => (
23
+ <StylesField bind="border-style" propDisplayName={ label }>
24
+ <StylesFieldLayout label={ label }>
25
25
  <SelectControl options={ borderStyles } />
26
26
  </StylesFieldLayout>
27
27
  </StylesField>
@@ -5,7 +5,7 @@ import { SideAllIcon, SideBottomIcon, SideLeftIcon, SideRightIcon, SideTopIcon }
5
5
  import { withDirection } from '@elementor/ui';
6
6
  import { __ } from '@wordpress/i18n';
7
7
 
8
- import { StylesField } from '../../../controls-registry/styles-field';
8
+ import { StylesField, type StylesFieldLabelProps } from '../../../controls-registry/styles-field';
9
9
  import { useDirection } from '../../../hooks/use-direction';
10
10
 
11
11
  const BORDER_WIDTH_LABEL = __( 'Border width', 'elementor' );
@@ -40,14 +40,14 @@ const getEdges = ( isSiteRtl: boolean ): EqualUnequalItems => [
40
40
  },
41
41
  ];
42
42
 
43
- export const BorderWidthField = () => {
43
+ export const BorderWidthField = ( { label = BORDER_WIDTH_LABEL }: StylesFieldLabelProps ) => {
44
44
  const { isSiteRtl } = useDirection();
45
45
 
46
46
  return (
47
- <StylesField bind={ 'border-width' } propDisplayName={ BORDER_WIDTH_LABEL }>
47
+ <StylesField bind={ 'border-width' } propDisplayName={ label }>
48
48
  <EqualUnequalSizesControl
49
49
  items={ getEdges( isSiteRtl ) }
50
- label={ BORDER_WIDTH_LABEL }
50
+ label={ label }
51
51
  icon={ <SideAllIcon fontSize={ 'tiny' } /> }
52
52
  tooltipLabel={ __( 'Adjust borders', 'elementor' ) }
53
53
  multiSizePropTypeUtil={ borderWidthPropTypeUtil }
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import { SelectControl } from '@elementor/editor-controls';
3
3
  import { __ } from '@wordpress/i18n';
4
4
 
5
- import { StylesField } from '../../../controls-registry/styles-field';
5
+ import { StylesField, type StylesFieldLabelProps } from '../../../controls-registry/styles-field';
6
6
  import { StylesFieldLayout } from '../../styles-field-layout';
7
7
 
8
8
  const BLEND_MODE_LABEL = __( 'Blend mode', 'elementor' );
@@ -26,10 +26,10 @@ const blendModeOptions = [
26
26
  { label: __( 'Hard light', 'elementor' ), value: 'hard-light' },
27
27
  ];
28
28
 
29
- export const BlendModeField = () => {
29
+ export const BlendModeField = ( { label = BLEND_MODE_LABEL }: StylesFieldLabelProps ) => {
30
30
  return (
31
- <StylesField bind="mix-blend-mode" propDisplayName={ BLEND_MODE_LABEL }>
32
- <StylesFieldLayout label={ BLEND_MODE_LABEL }>
31
+ <StylesField bind="mix-blend-mode" propDisplayName={ label }>
32
+ <StylesFieldLayout label={ label }>
33
33
  <SelectControl options={ blendModeOptions } />
34
34
  </StylesFieldLayout>
35
35
  </StylesField>
@@ -3,17 +3,17 @@ import { useRef } from 'react';
3
3
  import { SizeControl } from '@elementor/editor-controls';
4
4
  import { __ } from '@wordpress/i18n';
5
5
 
6
- import { StylesField } from '../../../controls-registry/styles-field';
6
+ import { StylesField, type StylesFieldLabelProps } from '../../../controls-registry/styles-field';
7
7
  import { StylesFieldLayout } from '../../styles-field-layout';
8
8
 
9
9
  const OPACITY_LABEL = __( 'Opacity', 'elementor' );
10
10
 
11
- export const OpacityControlField = () => {
11
+ export const OpacityControlField = ( { label = OPACITY_LABEL }: StylesFieldLabelProps ) => {
12
12
  const rowRef = useRef< HTMLDivElement | null >( null );
13
13
 
14
14
  return (
15
- <StylesField bind={ 'opacity' } propDisplayName={ OPACITY_LABEL }>
16
- <StylesFieldLayout ref={ rowRef } label={ OPACITY_LABEL }>
15
+ <StylesField bind={ 'opacity' } propDisplayName={ label }>
16
+ <StylesFieldLayout ref={ rowRef } label={ label }>
17
17
  <SizeControl units={ [ '%' ] } anchorRef={ rowRef } defaultUnit="%" />
18
18
  </StylesFieldLayout>
19
19
  </StylesField>
@@ -11,7 +11,7 @@ import {
11
11
  import { withDirection } from '@elementor/ui';
12
12
  import { __ } from '@wordpress/i18n';
13
13
 
14
- import { StylesField } from '../../../controls-registry/styles-field';
14
+ import { StylesField, type StylesFieldLabelProps } from '../../../controls-registry/styles-field';
15
15
  import { UiProviders } from '../../../styles-inheritance/components/ui-providers';
16
16
  import { StylesFieldLayout } from '../../styles-field-layout';
17
17
  import { RotatedIcon } from './utils/rotated-icon';
@@ -68,10 +68,10 @@ const options: ToggleButtonGroupItem< AlignContent >[] = [
68
68
  },
69
69
  ];
70
70
 
71
- export const AlignContentField = () => (
72
- <StylesField bind="align-content" propDisplayName={ ALIGN_CONTENT_LABEL }>
71
+ export const AlignContentField = ( { label = ALIGN_CONTENT_LABEL }: StylesFieldLabelProps ) => (
72
+ <StylesField bind="align-content" propDisplayName={ label }>
73
73
  <UiProviders>
74
- <StylesFieldLayout label={ ALIGN_CONTENT_LABEL } direction="column">
74
+ <StylesFieldLayout label={ label } direction="column">
75
75
  <ToggleControl options={ options } fullWidth={ true } />
76
76
  </StylesFieldLayout>
77
77
  </UiProviders>
@@ -9,7 +9,7 @@ import {
9
9
  import { withDirection } from '@elementor/ui';
10
10
  import { __ } from '@wordpress/i18n';
11
11
 
12
- import { StylesField } from '../../../controls-registry/styles-field';
12
+ import { StylesField, type StylesFieldLabelProps } from '../../../controls-registry/styles-field';
13
13
  import { UiProviders } from '../../../styles-inheritance/components/ui-providers';
14
14
  import { StylesFieldLayout } from '../../styles-field-layout';
15
15
  import { RotatedIcon } from './utils/rotated-icon';
@@ -53,11 +53,11 @@ const options: ToggleButtonGroupItem< AlignItems >[] = [
53
53
  },
54
54
  ];
55
55
 
56
- export const AlignItemsField = () => {
56
+ export const AlignItemsField = ( { label = ALIGN_ITEMS_LABEL }: StylesFieldLabelProps ) => {
57
57
  return (
58
58
  <UiProviders>
59
- <StylesField bind="align-items" propDisplayName={ ALIGN_ITEMS_LABEL }>
60
- <StylesFieldLayout label={ ALIGN_ITEMS_LABEL }>
59
+ <StylesField bind="align-items" propDisplayName={ label }>
60
+ <StylesFieldLayout label={ label }>
61
61
  <ToggleControl options={ options } />
62
62
  </StylesFieldLayout>
63
63
  </StylesField>
@@ -3,7 +3,7 @@ import { type ToggleButtonGroupItem, ToggleControl } from '@elementor/editor-con
3
3
  import { __ } from '@wordpress/i18n';
4
4
 
5
5
  import { useStylesInheritanceChain } from '../../../contexts/styles-inheritance-context';
6
- import { StylesField } from '../../../controls-registry/styles-field';
6
+ import { StylesField, type StylesFieldLabelProps } from '../../../controls-registry/styles-field';
7
7
  import { StylesFieldLayout } from '../../styles-field-layout';
8
8
 
9
9
  type Displays = 'block' | 'flex' | 'grid' | 'inline-block' | 'inline-flex' | 'none';
@@ -49,12 +49,12 @@ const displayFieldItems: ToggleButtonGroupItem< Displays >[] = [
49
49
  },
50
50
  ];
51
51
 
52
- export const DisplayField = () => {
52
+ export const DisplayField = ( { label = DISPLAY_LABEL }: StylesFieldLabelProps ) => {
53
53
  const placeholder = useDisplayPlaceholderValue();
54
54
 
55
55
  return (
56
- <StylesField bind="display" propDisplayName={ DISPLAY_LABEL } placeholder={ placeholder }>
57
- <StylesFieldLayout label={ DISPLAY_LABEL } direction="column">
56
+ <StylesField bind="display" propDisplayName={ label } placeholder={ placeholder }>
57
+ <StylesFieldLayout label={ label } direction="column">
58
58
  <ToggleControl options={ displayFieldItems } maxItems={ 4 } fullWidth={ true } />
59
59
  </StylesFieldLayout>
60
60
  </StylesField>
@@ -4,7 +4,7 @@ import { ArrowDownSmallIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpSmallIcon } f
4
4
  import { withDirection } from '@elementor/ui';
5
5
  import { __ } from '@wordpress/i18n';
6
6
 
7
- import { StylesField } from '../../../controls-registry/styles-field';
7
+ import { StylesField, type StylesFieldLabelProps } from '../../../controls-registry/styles-field';
8
8
  import { UiProviders } from '../../../styles-inheritance/components/ui-providers';
9
9
  import { StylesFieldLayout } from '../../styles-field-layout';
10
10
 
@@ -45,11 +45,11 @@ const options: ToggleButtonGroupItem< FlexDirection >[] = [
45
45
  },
46
46
  ];
47
47
 
48
- export const FlexDirectionField = () => {
48
+ export const FlexDirectionField = ( { label = FLEX_DIRECTION_LABEL }: StylesFieldLabelProps ) => {
49
49
  return (
50
- <StylesField bind="flex-direction" propDisplayName={ FLEX_DIRECTION_LABEL }>
50
+ <StylesField bind="flex-direction" propDisplayName={ label }>
51
51
  <UiProviders>
52
- <StylesFieldLayout label={ FLEX_DIRECTION_LABEL }>
52
+ <StylesFieldLayout label={ label }>
53
53
  <ToggleControl options={ options } />
54
54
  </StylesFieldLayout>
55
55
  </UiProviders>
@@ -2,14 +2,14 @@ import * as React from 'react';
2
2
  import { GapControl } from '@elementor/editor-controls';
3
3
  import { __ } from '@wordpress/i18n';
4
4
 
5
- import { StylesField } from '../../../controls-registry/styles-field';
5
+ import { StylesField, type StylesFieldLabelProps } from '../../../controls-registry/styles-field';
6
6
 
7
7
  const GAPS_LABEL = __( 'Gaps', 'elementor' );
8
8
 
9
- export const GapControlField = () => {
9
+ export const GapControlField = ( { label = GAPS_LABEL }: StylesFieldLabelProps ) => {
10
10
  return (
11
- <StylesField bind={ 'gap' } propDisplayName={ GAPS_LABEL }>
12
- <GapControl label={ GAPS_LABEL } />
11
+ <StylesField bind={ 'gap' } propDisplayName={ label }>
12
+ <GapControl label={ label } />
13
13
  </StylesField>
14
14
  );
15
15
  };
@@ -9,7 +9,7 @@ import {
9
9
  import { withDirection } from '@elementor/ui';
10
10
  import { __ } from '@wordpress/i18n';
11
11
 
12
- import { StylesField } from '../../../controls-registry/styles-field';
12
+ import { StylesField, type StylesFieldLabelProps } from '../../../controls-registry/styles-field';
13
13
  import { UiProviders } from '../../../styles-inheritance/components/ui-providers';
14
14
  import { StylesFieldLayout } from '../../styles-field-layout';
15
15
 
@@ -47,10 +47,10 @@ const options: ToggleButtonGroupItem< JustifyItems >[] = [
47
47
  },
48
48
  ];
49
49
 
50
- export const GridJustifyItemsField = () => (
51
- <StylesField bind="justify-items" propDisplayName={ JUSTIFY_ITEMS_LABEL }>
50
+ export const GridJustifyItemsField = ( { label = JUSTIFY_ITEMS_LABEL }: StylesFieldLabelProps ) => (
51
+ <StylesField bind="justify-items" propDisplayName={ label }>
52
52
  <UiProviders>
53
- <StylesFieldLayout label={ JUSTIFY_ITEMS_LABEL }>
53
+ <StylesFieldLayout label={ label }>
54
54
  <ToggleControl options={ options } />
55
55
  </StylesFieldLayout>
56
56
  </UiProviders>
@@ -11,7 +11,7 @@ import {
11
11
  import { withDirection } from '@elementor/ui';
12
12
  import { __ } from '@wordpress/i18n';
13
13
 
14
- import { StylesField } from '../../../controls-registry/styles-field';
14
+ import { StylesField, type StylesFieldLabelProps } from '../../../controls-registry/styles-field';
15
15
  import { UiProviders } from '../../../styles-inheritance/components/ui-providers';
16
16
  import { StylesFieldLayout } from '../../styles-field-layout';
17
17
  import { RotatedIcon } from './utils/rotated-icon';
@@ -67,10 +67,10 @@ const options: ToggleButtonGroupItem< JustifyContent >[] = [
67
67
  },
68
68
  ];
69
69
 
70
- export const JustifyContentField = () => (
71
- <StylesField bind="justify-content" propDisplayName={ JUSTIFY_CONTENT_LABEL }>
70
+ export const JustifyContentField = ( { label = JUSTIFY_CONTENT_LABEL }: StylesFieldLabelProps ) => (
71
+ <StylesField bind="justify-content" propDisplayName={ label }>
72
72
  <UiProviders>
73
- <StylesFieldLayout label={ JUSTIFY_CONTENT_LABEL } direction="column">
73
+ <StylesFieldLayout label={ label } direction="column">
74
74
  <ToggleControl options={ options } fullWidth={ true } />
75
75
  </StylesFieldLayout>
76
76
  </UiProviders>
@@ -3,7 +3,7 @@ import { type ToggleButtonGroupItem, ToggleControl } from '@elementor/editor-con
3
3
  import { ArrowBackIcon, ArrowForwardIcon, ArrowRightIcon } from '@elementor/icons';
4
4
  import { __ } from '@wordpress/i18n';
5
5
 
6
- import { StylesField } from '../../../controls-registry/styles-field';
6
+ import { StylesField, type StylesFieldLabelProps } from '../../../controls-registry/styles-field';
7
7
  import { UiProviders } from '../../../styles-inheritance/components/ui-providers';
8
8
  import { StylesFieldLayout } from '../../styles-field-layout';
9
9
 
@@ -32,11 +32,11 @@ const options: ToggleButtonGroupItem< FlexWrap >[] = [
32
32
  },
33
33
  ];
34
34
 
35
- export const WrapField = () => {
35
+ export const WrapField = ( { label = FLEX_WRAP_LABEL }: StylesFieldLabelProps ) => {
36
36
  return (
37
- <StylesField bind="flex-wrap" propDisplayName={ FLEX_WRAP_LABEL }>
37
+ <StylesField bind="flex-wrap" propDisplayName={ label }>
38
38
  <UiProviders>
39
- <StylesFieldLayout label={ FLEX_WRAP_LABEL }>
39
+ <StylesFieldLayout label={ label }>
40
40
  <ToggleControl options={ options } />
41
41
  </StylesFieldLayout>
42
42
  </UiProviders>
@@ -3,19 +3,19 @@ import { useRef } from 'react';
3
3
  import { type LengthUnit, SizeControl } from '@elementor/editor-controls';
4
4
  import { __ } from '@wordpress/i18n';
5
5
 
6
- import { StylesField } from '../../../controls-registry/styles-field';
6
+ import { StylesField, type StylesFieldLabelProps } from '../../../controls-registry/styles-field';
7
7
  import { StylesFieldLayout } from '../../styles-field-layout';
8
8
 
9
9
  const OFFSET_LABEL = __( 'Anchor offset', 'elementor' );
10
10
 
11
11
  const UNITS: LengthUnit[] = [ 'px', 'em', 'rem', 'vw', 'vh' ];
12
12
 
13
- export const OffsetField = () => {
13
+ export const OffsetField = ( { label = OFFSET_LABEL }: StylesFieldLabelProps ) => {
14
14
  const rowRef = useRef< HTMLDivElement >( null );
15
15
 
16
16
  return (
17
- <StylesField bind="scroll-margin-top" propDisplayName={ OFFSET_LABEL }>
18
- <StylesFieldLayout label={ OFFSET_LABEL } ref={ rowRef }>
17
+ <StylesField bind="scroll-margin-top" propDisplayName={ label }>
18
+ <StylesFieldLayout label={ label } ref={ rowRef }>
19
19
  <SizeControl units={ UNITS } anchorRef={ rowRef } />
20
20
  </StylesFieldLayout>
21
21
  </StylesField>
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import { SelectControl } from '@elementor/editor-controls';
3
3
  import { __ } from '@wordpress/i18n';
4
4
 
5
- import { StylesField } from '../../../controls-registry/styles-field';
5
+ import { StylesField, type StylesFieldLabelProps } from '../../../controls-registry/styles-field';
6
6
  import { StylesFieldLayout } from '../../styles-field-layout';
7
7
 
8
8
  const POSITION_LABEL = __( 'Position', 'elementor' );
@@ -15,10 +15,10 @@ const positionOptions = [
15
15
  { label: __( 'Sticky', 'elementor' ), value: 'sticky' },
16
16
  ];
17
17
 
18
- export const PositionField = () => {
18
+ export const PositionField = ( { label = POSITION_LABEL }: StylesFieldLabelProps ) => {
19
19
  return (
20
- <StylesField bind="position" propDisplayName={ POSITION_LABEL }>
21
- <StylesFieldLayout label={ POSITION_LABEL }>
20
+ <StylesField bind="position" propDisplayName={ label }>
21
+ <StylesFieldLayout label={ label }>
22
22
  <SelectControl options={ positionOptions } />
23
23
  </StylesFieldLayout>
24
24
  </StylesField>
@@ -4,15 +4,15 @@ import { InfoCircleFilledIcon } from '@elementor/icons';
4
4
  import { Alert, AlertTitle, Box, Infotip } from '@elementor/ui';
5
5
  import { __ } from '@wordpress/i18n';
6
6
 
7
- import { StylesField } from '../../../controls-registry/styles-field';
7
+ import { StylesField, type StylesFieldLabelProps } from '../../../controls-registry/styles-field';
8
8
  import { StylesFieldLayout } from '../../styles-field-layout';
9
9
 
10
10
  const Z_INDEX_LABEL = __( 'Z-index', 'elementor' );
11
11
 
12
- export const ZIndexField = ( { disabled }: { disabled?: boolean } ) => {
12
+ export const ZIndexField = ( { disabled, label = Z_INDEX_LABEL }: StylesFieldLabelProps & { disabled?: boolean } ) => {
13
13
  const StyleField = (
14
- <StylesField bind="z-index" propDisplayName={ Z_INDEX_LABEL }>
15
- <StylesFieldLayout label={ Z_INDEX_LABEL }>
14
+ <StylesField bind="z-index" propDisplayName={ label }>
15
+ <StylesFieldLayout label={ label }>
16
16
  <NumberControl disabled={ disabled } />
17
17
  </StylesFieldLayout>
18
18
  </StylesField>
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import { SelectControl } from '@elementor/editor-controls';
3
3
  import { __ } from '@wordpress/i18n';
4
4
 
5
- import { StylesField } from '../../../controls-registry/styles-field';
5
+ import { StylesField, type StylesFieldLabelProps } from '../../../controls-registry/styles-field';
6
6
  import { StylesFieldLayout } from '../../styles-field-layout';
7
7
 
8
8
  const OBJECT_FIT_LABEL = __( 'Object fit', 'elementor' );
@@ -15,10 +15,10 @@ const positionOptions = [
15
15
  { label: __( 'Scale down', 'elementor' ), value: 'scale-down' },
16
16
  ];
17
17
 
18
- export const ObjectFitField = () => {
18
+ export const ObjectFitField = ( { label = OBJECT_FIT_LABEL }: StylesFieldLabelProps ) => {
19
19
  return (
20
- <StylesField bind="object-fit" propDisplayName={ OBJECT_FIT_LABEL }>
21
- <StylesFieldLayout label={ OBJECT_FIT_LABEL }>
20
+ <StylesField bind="object-fit" propDisplayName={ label }>
21
+ <StylesFieldLayout label={ label }>
22
22
  <SelectControl options={ positionOptions } />
23
23
  </StylesFieldLayout>
24
24
  </StylesField>
@@ -3,7 +3,7 @@ import { type ToggleButtonGroupItem, ToggleControl } from '@elementor/editor-con
3
3
  import { EyeIcon, EyeOffIcon, LetterAIcon } from '@elementor/icons';
4
4
  import { __ } from '@wordpress/i18n';
5
5
 
6
- import { StylesField } from '../../../controls-registry/styles-field';
6
+ import { StylesField, type StylesFieldLabelProps } from '../../../controls-registry/styles-field';
7
7
  import { StylesFieldLayout } from '../../styles-field-layout';
8
8
 
9
9
  type Overflows = 'visible' | 'hidden' | 'auto';
@@ -31,10 +31,10 @@ const options: ToggleButtonGroupItem< Overflows >[] = [
31
31
  },
32
32
  ];
33
33
 
34
- export const OverflowField = () => {
34
+ export const OverflowField = ( { label = OVERFLOW_LABEL }: StylesFieldLabelProps ) => {
35
35
  return (
36
- <StylesField bind="overflow" propDisplayName={ OVERFLOW_LABEL }>
37
- <StylesFieldLayout label={ OVERFLOW_LABEL }>
36
+ <StylesField bind="overflow" propDisplayName={ label }>
37
+ <StylesFieldLayout label={ label }>
38
38
  <ToggleControl options={ options } />
39
39
  </StylesFieldLayout>
40
40
  </StylesField>
@@ -2,15 +2,15 @@ import * as React from 'react';
2
2
  import { NumberControl } from '@elementor/editor-controls';
3
3
  import { __ } from '@wordpress/i18n';
4
4
 
5
- import { StylesField } from '../../../controls-registry/styles-field';
5
+ import { StylesField, type StylesFieldLabelProps } from '../../../controls-registry/styles-field';
6
6
  import { StylesFieldLayout } from '../../styles-field-layout';
7
7
 
8
8
  const COLUMN_COUNT_LABEL = __( 'Columns', 'elementor' );
9
9
 
10
- export const ColumnCountField = () => {
10
+ export const ColumnCountField = ( { label = COLUMN_COUNT_LABEL }: StylesFieldLabelProps ) => {
11
11
  return (
12
- <StylesField bind="column-count" propDisplayName={ COLUMN_COUNT_LABEL }>
13
- <StylesFieldLayout label={ COLUMN_COUNT_LABEL }>
12
+ <StylesField bind="column-count" propDisplayName={ label }>
13
+ <StylesFieldLayout label={ label }>
14
14
  <NumberControl shouldForceInt min={ 0 } step={ 1 } />
15
15
  </StylesFieldLayout>
16
16
  </StylesField>
@@ -3,17 +3,17 @@ import { useRef } from 'react';
3
3
  import { SizeControl } from '@elementor/editor-controls';
4
4
  import { __ } from '@wordpress/i18n';
5
5
 
6
- import { StylesField } from '../../../controls-registry/styles-field';
6
+ import { StylesField, type StylesFieldLabelProps } from '../../../controls-registry/styles-field';
7
7
  import { StylesFieldLayout } from '../../styles-field-layout';
8
8
 
9
9
  const COLUMN_GAP_LABEL = __( 'Column gap', 'elementor' );
10
10
 
11
- export const ColumnGapField = () => {
11
+ export const ColumnGapField = ( { label = COLUMN_GAP_LABEL }: StylesFieldLabelProps ) => {
12
12
  const rowRef = useRef< HTMLDivElement >( null );
13
13
 
14
14
  return (
15
- <StylesField bind="column-gap" propDisplayName={ COLUMN_GAP_LABEL }>
16
- <StylesFieldLayout label={ COLUMN_GAP_LABEL } ref={ rowRef }>
15
+ <StylesField bind="column-gap" propDisplayName={ label }>
16
+ <StylesFieldLayout label={ label } ref={ rowRef }>
17
17
  <SizeControl anchorRef={ rowRef } />
18
18
  </StylesFieldLayout>
19
19
  </StylesField>
@@ -3,12 +3,12 @@ import { FontFamilyControl, useFontFamilies } from '@elementor/editor-controls';
3
3
  import { useSectionWidth } from '@elementor/editor-ui';
4
4
  import { __ } from '@wordpress/i18n';
5
5
 
6
- import { StylesField } from '../../../controls-registry/styles-field';
6
+ import { StylesField, type StylesFieldLabelProps } from '../../../controls-registry/styles-field';
7
7
  import { StylesFieldLayout } from '../../styles-field-layout';
8
8
 
9
9
  const FONT_FAMILY_LABEL = __( 'Font family', 'elementor' );
10
10
 
11
- export const FontFamilyField = () => {
11
+ export const FontFamilyField = ( { label = FONT_FAMILY_LABEL }: StylesFieldLabelProps ) => {
12
12
  const fontFamilies = useFontFamilies();
13
13
  const sectionWidth = useSectionWidth();
14
14
 
@@ -17,13 +17,9 @@ export const FontFamilyField = () => {
17
17
  }
18
18
 
19
19
  return (
20
- <StylesField bind="font-family" propDisplayName={ FONT_FAMILY_LABEL }>
21
- <StylesFieldLayout label={ FONT_FAMILY_LABEL }>
22
- <FontFamilyControl
23
- fontFamilies={ fontFamilies }
24
- sectionWidth={ sectionWidth }
25
- ariaLabel={ FONT_FAMILY_LABEL }
26
- />
20
+ <StylesField bind="font-family" propDisplayName={ label }>
21
+ <StylesFieldLayout label={ label }>
22
+ <FontFamilyControl fontFamilies={ fontFamilies } sectionWidth={ sectionWidth } ariaLabel={ label } />
27
23
  </StylesFieldLayout>
28
24
  </StylesField>
29
25
  );