@atlaskit/editor-toolbar 0.3.5 → 0.3.7

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 (111) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/types/hooks/ui-context.d.ts +5 -5
  3. package/dist/types/ui/ColorPalette/types.d.ts +30 -30
  4. package/dist/types/ui/ToolbarButton.d.ts +5 -5
  5. package/dist/types/ui/ToolbarDropdownItem.d.ts +9 -9
  6. package/dist/types/ui/ToolbarDropdownMenu.d.ts +4 -4
  7. package/dist/types/ui/ToolbarDropdownMenuContext.d.ts +1 -1
  8. package/dist/types/ui/ToolbarNestedDropdownMenu.d.ts +3 -3
  9. package/dist/types/ui/ToolbarSection.d.ts +1 -1
  10. package/dist/types/ui/ToolbarTooltip.d.ts +1 -1
  11. package/dist/types-ts4.5/hooks/ui-context.d.ts +5 -5
  12. package/dist/types-ts4.5/ui/ColorPalette/types.d.ts +30 -30
  13. package/dist/types-ts4.5/ui/ToolbarButton.d.ts +5 -5
  14. package/dist/types-ts4.5/ui/ToolbarDropdownItem.d.ts +9 -9
  15. package/dist/types-ts4.5/ui/ToolbarDropdownMenu.d.ts +4 -4
  16. package/dist/types-ts4.5/ui/ToolbarDropdownMenuContext.d.ts +1 -1
  17. package/dist/types-ts4.5/ui/ToolbarNestedDropdownMenu.d.ts +3 -3
  18. package/dist/types-ts4.5/ui/ToolbarSection.d.ts +1 -1
  19. package/dist/types-ts4.5/ui/ToolbarTooltip.d.ts +1 -1
  20. package/package.json +1 -2
  21. package/afm-cc/tsconfig.json +0 -54
  22. package/afm-dev-agents/tsconfig.json +0 -54
  23. package/afm-jira/tsconfig.json +0 -54
  24. package/afm-passionfruit/tsconfig.json +0 -54
  25. package/afm-post-office/tsconfig.json +0 -54
  26. package/afm-rovo-extension/tsconfig.json +0 -54
  27. package/afm-townsquare/tsconfig.json +0 -54
  28. package/afm-volt/tsconfig.json +0 -54
  29. package/build/tsconfig.json +0 -17
  30. package/examples/basic.tsx +0 -3
  31. package/examples/config.jsonc +0 -8
  32. package/examples/toolbar/examples/ExampleManuallyComposedToolbar.tsx +0 -638
  33. package/examples/toolbar/examples/useExampleToolbarState.tsx +0 -86
  34. package/examples/toolbar-ui.tsx +0 -26
  35. package/src/hooks/ui-context.tsx +0 -63
  36. package/src/index.ts +0 -74
  37. package/src/types.ts +0 -3
  38. package/src/ui/ColorPalette/Color.tsx +0 -118
  39. package/src/ui/ColorPalette/getColorMessage.ts +0 -27
  40. package/src/ui/ColorPalette/index.tsx +0 -125
  41. package/src/ui/ColorPalette/types.ts +0 -96
  42. package/src/ui/ColorPalette/utils.ts +0 -102
  43. package/src/ui/Toolbar.tsx +0 -57
  44. package/src/ui/ToolbarButton.tsx +0 -120
  45. package/src/ui/ToolbarButtonGroup.tsx +0 -57
  46. package/src/ui/ToolbarColorSwatch.tsx +0 -37
  47. package/src/ui/ToolbarDropdownItem.tsx +0 -142
  48. package/src/ui/ToolbarDropdownItemSection.tsx +0 -21
  49. package/src/ui/ToolbarDropdownMenu.tsx +0 -112
  50. package/src/ui/ToolbarDropdownMenuContext.tsx +0 -44
  51. package/src/ui/ToolbarKeyboardShortcutHint.tsx +0 -11
  52. package/src/ui/ToolbarNestedDropdownMenu.tsx +0 -45
  53. package/src/ui/ToolbarSection.tsx +0 -44
  54. package/src/ui/ToolbarTooltip.tsx +0 -18
  55. package/src/ui/icons/AIAdjustLengthIcon.tsx +0 -2
  56. package/src/ui/icons/AICasualIcon.tsx +0 -2
  57. package/src/ui/icons/AIChangeToneIcon.tsx +0 -2
  58. package/src/ui/icons/AIChatIcon.tsx +0 -50
  59. package/src/ui/icons/AICommandIcon.tsx +0 -2
  60. package/src/ui/icons/AIHeartIcon.tsx +0 -2
  61. package/src/ui/icons/AILengthenIcon.tsx +0 -2
  62. package/src/ui/icons/AIProfessionalIcon.tsx +0 -2
  63. package/src/ui/icons/AIShortenIcon.tsx +0 -2
  64. package/src/ui/icons/AISpellcheckIcon.tsx +0 -2
  65. package/src/ui/icons/AISummarizeIcon.tsx +0 -2
  66. package/src/ui/icons/AITranslateIcon.tsx +0 -2
  67. package/src/ui/icons/AddIcon.tsx +0 -2
  68. package/src/ui/icons/AlignTextCenterIcon.tsx +0 -2
  69. package/src/ui/icons/AlignTextLeftIcon.tsx +0 -2
  70. package/src/ui/icons/AlignTextRightIcon.tsx +0 -2
  71. package/src/ui/icons/AppsIcon.tsx +0 -2
  72. package/src/ui/icons/BoldIcon.tsx +0 -2
  73. package/src/ui/icons/ClearFormattingIcon.tsx +0 -2
  74. package/src/ui/icons/CodeIcon.tsx +0 -2
  75. package/src/ui/icons/CommentIcon.tsx +0 -2
  76. package/src/ui/icons/EmojiIcon.tsx +0 -2
  77. package/src/ui/icons/HeadingFiveIcon.tsx +0 -2
  78. package/src/ui/icons/HeadingFourIcon.tsx +0 -2
  79. package/src/ui/icons/HeadingOneIcon.tsx +0 -2
  80. package/src/ui/icons/HeadingSixIcon.tsx +0 -2
  81. package/src/ui/icons/HeadingThreeIcon.tsx +0 -2
  82. package/src/ui/icons/HeadingTwoIcon.tsx +0 -2
  83. package/src/ui/icons/HistoryIcon.tsx +0 -2
  84. package/src/ui/icons/ImageIcon.tsx +0 -2
  85. package/src/ui/icons/IndentIcon.tsx +0 -2
  86. package/src/ui/icons/ItalicIcon.tsx +0 -2
  87. package/src/ui/icons/LayoutIcon.tsx +0 -2
  88. package/src/ui/icons/LinkIcon.tsx +0 -2
  89. package/src/ui/icons/ListBulletedIcon.tsx +0 -2
  90. package/src/ui/icons/ListNumberedIcon.tsx +0 -2
  91. package/src/ui/icons/MentionIcon.tsx +0 -2
  92. package/src/ui/icons/MoreItemsIcon.tsx +0 -22
  93. package/src/ui/icons/NestedDropdownRightIcon.tsx +0 -22
  94. package/src/ui/icons/OutdentIcon.tsx +0 -2
  95. package/src/ui/icons/PinIcon.tsx +0 -2
  96. package/src/ui/icons/PinnedIcon.tsx +0 -2
  97. package/src/ui/icons/QuoteIcon.tsx +0 -2
  98. package/src/ui/icons/RedoIcon.tsx +0 -2
  99. package/src/ui/icons/ShowMoreHorizontal.tsx +0 -22
  100. package/src/ui/icons/StrikeThroughIcon.tsx +0 -2
  101. package/src/ui/icons/SubscriptIcon.tsx +0 -31
  102. package/src/ui/icons/SuperscriptIcon.tsx +0 -31
  103. package/src/ui/icons/TableIcon.tsx +0 -2
  104. package/src/ui/icons/TaskIcon.tsx +0 -2
  105. package/src/ui/icons/TextColorIcon.tsx +0 -43
  106. package/src/ui/icons/TextIcon.tsx +0 -2
  107. package/src/ui/icons/UnderlineIcon.tsx +0 -2
  108. package/src/ui/icons/UndoIcon.tsx +0 -2
  109. package/tsconfig.app.json +0 -65
  110. package/tsconfig.dev.json +0 -56
  111. package/tsconfig.json +0 -18
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @atlaskit/editor-toolbar
2
2
 
3
+ ## 0.3.7
4
+
5
+ ### Patch Changes
6
+
7
+ - [`f0b0ea63f59bc`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f0b0ea63f59bc) -
8
+ [ux] ED-28803 Register Delete Button in block menu and add delete functionality and hover styles
9
+ - [`0fdcb6f2f96fd`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0fdcb6f2f96fd) -
10
+ Sorted type and interface props to improve Atlaskit docs
11
+ - Updated dependencies
12
+
13
+ ## 0.3.6
14
+
15
+ ### Patch Changes
16
+
17
+ - [`098cfbb01dc36`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/098cfbb01dc36) -
18
+ Add missing npmignore files to remove unnecessary files from published package
19
+
3
20
  ## 0.3.5
4
21
 
5
22
  ### Patch Changes
@@ -1,21 +1,21 @@
1
1
  import React from 'react';
2
2
  import type { OnOpenChangeArgs } from '@atlaskit/dropdown-menu';
3
3
  export type ToolbarUIContextType = {
4
+ /**
5
+ * Indicates whether the toolbar is disabled when the editor is offline.
6
+ */
7
+ isDisabled?: boolean;
4
8
  /**
5
9
  * Callback for when the dropdown is open/closed. Receives an object with `isOpen` state.
6
10
  *
7
11
  * If the dropdown was closed programmatically, the `event` parameter will be `null`.
8
12
  */
9
13
  onDropdownOpenChanged: (args: OnOpenChangeArgs) => void;
14
+ popupsMountPoint?: HTMLElement;
10
15
  /**
11
16
  * Whether to prevent default behavior on mouse down events on ToolbarButton.
12
17
  */
13
18
  preventDefaultOnMouseDown?: boolean;
14
- /**
15
- * Indicates whether the toolbar is disabled when the editor is offline.
16
- */
17
- isDisabled?: boolean;
18
- popupsMountPoint?: HTMLElement;
19
19
  };
20
20
  /**
21
21
  * Access consumer specific config and state within a toolbar component
@@ -4,16 +4,16 @@ import { type MessageDescriptor } from 'react-intl-next';
4
4
  * Represents a single color in the palette
5
5
  */
6
6
  export interface PaletteColor {
7
- /** The color value (hex, token, etc.) */
8
- value: string;
9
- /** Display label for the color */
10
- label: string;
11
7
  /** Border color for the color swatch */
12
8
  border: string;
13
- /** Optional internationalization message */
14
- message?: MessageDescriptor;
15
9
  /** Optional decorator element to display instead of checkmark */
16
10
  decorator?: ReactElement;
11
+ /** Display label for the color */
12
+ label: string;
13
+ /** Optional internationalization message */
14
+ message?: MessageDescriptor;
15
+ /** The color value (hex, token, etc.) */
16
+ value: string;
17
17
  }
18
18
  /**
19
19
  * Array of palette colors
@@ -30,13 +30,13 @@ export type PaletteTooltipMessages = {
30
30
  * Configuration options for the color palette
31
31
  */
32
32
  export interface PaletteOptions {
33
- /** Array of colors to display */
34
- palette: PaletteColor[];
35
33
  /**
36
34
  * Function to convert hex codes to design system tokens
37
35
  * Different color palettes may use different mapping functions
38
36
  */
39
37
  hexToPaletteColor?: (hexColor: string) => string | undefined;
38
+ /** Array of colors to display */
39
+ palette: PaletteColor[];
40
40
  /**
41
41
  * Tooltip messages for different color themes
42
42
  * Consumer determines which tooltip messages to use
@@ -47,43 +47,43 @@ export interface PaletteOptions {
47
47
  * Props for the main ColorPalette component
48
48
  */
49
49
  export interface ColorPaletteProps {
50
- /** Currently selected color value */
51
- selectedColor: string | null;
50
+ /** Optional CSS class name */
51
+ className?: string;
52
+ /** Number of columns in the palette grid */
53
+ cols?: number;
52
54
  /** Callback when a color is clicked */
53
55
  onClick: (value: string, label: string) => void;
54
56
  /** Optional callback for keyboard navigation */
55
57
  onKeyDown?: (value: string, label: string, event: React.KeyboardEvent) => void;
56
- /** Number of columns in the palette grid */
57
- cols?: number;
58
- /** Optional CSS class name */
59
- className?: string;
60
58
  /** Palette configuration options */
61
59
  paletteOptions: PaletteOptions;
60
+ /** Currently selected color value */
61
+ selectedColor: string | null;
62
62
  }
63
63
  /**
64
64
  * Props for individual color palette items
65
65
  */
66
66
  export interface ColorProps {
67
- /** The color value */
68
- value: string;
69
- /** Display label for accessibility */
70
- label: string;
71
- /** Tab index for keyboard navigation */
72
- tabIndex?: number;
73
- /** Whether this color is currently selected */
74
- isSelected?: boolean;
75
- /** Click handler */
76
- onClick: (value: string, label: string) => void;
77
- /** Keyboard event handler */
78
- onKeyDown?: (value: string, label: string, event: React.KeyboardEvent) => void;
67
+ /** Whether to auto-focus this item */
68
+ autoFocus?: boolean;
79
69
  /** Border color for the swatch */
80
70
  borderColor: string;
81
71
  /** Color for the checkmark icon */
82
72
  checkMarkColor?: string;
83
- /** Whether to auto-focus this item */
84
- autoFocus?: boolean;
85
- /** Function to convert hex to palette color */
86
- hexToPaletteColor?: (hexColor: string) => string | undefined;
87
73
  /** Optional decorator element */
88
74
  decorator?: ReactElement;
75
+ /** Function to convert hex to palette color */
76
+ hexToPaletteColor?: (hexColor: string) => string | undefined;
77
+ /** Whether this color is currently selected */
78
+ isSelected?: boolean;
79
+ /** Display label for accessibility */
80
+ label: string;
81
+ /** Click handler */
82
+ onClick: (value: string, label: string) => void;
83
+ /** Keyboard event handler */
84
+ onKeyDown?: (value: string, label: string, event: React.KeyboardEvent) => void;
85
+ /** Tab index for keyboard navigation */
86
+ tabIndex?: number;
87
+ /** The color value */
88
+ value: string;
89
89
  }
@@ -1,16 +1,16 @@
1
1
  import React, { type ReactNode } from 'react';
2
2
  import { type TriggerProps } from '@atlaskit/popup';
3
3
  type ToolbarButtonProps = Partial<TriggerProps> & {
4
+ ariaKeyshortcuts?: string;
4
5
  children?: ReactNode;
6
+ iconBefore: React.ReactNode;
7
+ isDisabled?: boolean;
5
8
  isSelected?: boolean;
6
- onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
9
+ label?: string;
7
10
  onBlur?: (event: React.FocusEvent<HTMLButtonElement>) => void;
11
+ onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
8
12
  onFocus?: (event: React.FocusEvent<HTMLButtonElement>) => void;
9
13
  testId?: string;
10
- iconBefore: React.ReactNode;
11
- isDisabled?: boolean;
12
- ariaKeyshortcuts?: string;
13
- label?: string;
14
14
  };
15
15
  export declare const ToolbarButton: React.ForwardRefExoticComponent<Omit<ToolbarButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
16
16
  export {};
@@ -2,23 +2,23 @@ import React, { type ReactNode, type Ref } from 'react';
2
2
  import type { CustomItemComponentProps } from '@atlaskit/menu/types';
3
3
  type TextStyle = 'normal' | 'heading1' | 'heading2' | 'heading3' | 'heading4' | 'heading5' | 'heading6';
4
4
  export type CustomDropdownMenuItemButtonProps = CustomItemComponentProps & {
5
- 'aria-haspopup'?: boolean;
6
5
  'aria-disabled'?: boolean;
7
- 'aria-pressed'?: boolean;
6
+ 'aria-haspopup'?: boolean;
8
7
  'aria-keyshortcuts'?: string;
8
+ 'aria-pressed'?: boolean;
9
9
  };
10
10
  type ToolbarDropdownItemProps = {
11
- onClick?: (e: React.MouseEvent | React.KeyboardEvent) => void;
12
- elemBefore?: ReactNode;
11
+ ariaKeyshortcuts?: string;
12
+ children?: React.ReactNode;
13
13
  elemAfter?: ReactNode;
14
+ elemBefore?: ReactNode;
15
+ hasNestedDropdownMenu?: boolean;
16
+ isDisabled?: boolean;
14
17
  isSelected?: boolean;
15
- children?: React.ReactNode;
18
+ onClick?: (e: React.MouseEvent | React.KeyboardEvent) => void;
19
+ testId?: string;
16
20
  textStyle?: TextStyle;
17
- isDisabled?: boolean;
18
- hasNestedDropdownMenu?: boolean;
19
21
  triggerRef?: Ref<HTMLButtonElement>;
20
- testId?: string;
21
- ariaKeyshortcuts?: string;
22
22
  };
23
23
  export declare const ToolbarDropdownItem: ({ onClick, elemBefore, elemAfter, isSelected, children, isDisabled, hasNestedDropdownMenu, triggerRef, testId, ariaKeyshortcuts, }: ToolbarDropdownItemProps) => React.JSX.Element;
24
24
  export {};
@@ -4,15 +4,15 @@
4
4
  */
5
5
  import React, { type ReactNode } from 'react';
6
6
  type ToolbarDropdownMenuProps = {
7
- iconBefore: React.ReactNode;
8
7
  children?: ReactNode;
9
- isDisabled?: boolean;
10
- testId?: string;
11
- label?: string;
12
8
  /**
13
9
  * Whether to add margin around sections to align with 4px block padding existing in current editor dropdown
14
10
  */
15
11
  hasSectionMargin?: boolean;
12
+ iconBefore: React.ReactNode;
13
+ isDisabled?: boolean;
14
+ label?: string;
15
+ testId?: string;
16
16
  };
17
17
  export declare const ToolbarDropdownMenu: ({ iconBefore, children, isDisabled, testId, label, hasSectionMargin, }: ToolbarDropdownMenuProps) => JSX.Element;
18
18
  export {};
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
2
  interface ToolbarDropdownMenuContextValue {
3
- openMenu: () => void;
4
3
  closeMenu: () => void;
5
4
  isOpen: boolean;
5
+ openMenu: () => void;
6
6
  }
7
7
  export declare const useToolbarDropdownMenu: () => ToolbarDropdownMenuContextValue;
8
8
  interface ToolbarDropdownMenuProviderProps {
@@ -1,11 +1,11 @@
1
1
  import React, { type ReactNode } from 'react';
2
2
  type ToolbarNestedDropdownMenuProps = {
3
- elemBefore: ReactNode;
4
- elemAfter: ReactNode;
5
- text?: string;
6
3
  children?: ReactNode;
4
+ elemAfter: ReactNode;
5
+ elemBefore: ReactNode;
7
6
  isDisabled?: boolean;
8
7
  testId?: string;
8
+ text?: string;
9
9
  };
10
10
  export declare const ToolbarNestedDropdownMenu: ({ elemBefore, text, elemAfter, children, isDisabled, testId, }: ToolbarNestedDropdownMenuProps) => React.JSX.Element;
11
11
  export {};
@@ -5,11 +5,11 @@
5
5
  import { type ReactNode } from 'react';
6
6
  type ToolbarSectionProps = {
7
7
  children?: ReactNode;
8
- testId?: string;
9
8
  /**
10
9
  * Whether to add a separator at the start of the section
11
10
  */
12
11
  hasSeparator?: boolean;
12
+ testId?: string;
13
13
  };
14
14
  export declare const ToolbarSection: ({ children, testId, hasSeparator }: ToolbarSectionProps) => JSX.Element;
15
15
  export {};
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
2
  import type { PositionType } from '@atlaskit/tooltip';
3
3
  type ToolbarTooltipProps = {
4
- content: React.ReactNode;
5
4
  children: React.ReactNode;
5
+ content: React.ReactNode;
6
6
  position?: PositionType;
7
7
  };
8
8
  export declare const ToolbarTooltip: ({ content, children, position }: ToolbarTooltipProps) => React.JSX.Element;
@@ -1,21 +1,21 @@
1
1
  import React from 'react';
2
2
  import type { OnOpenChangeArgs } from '@atlaskit/dropdown-menu';
3
3
  export type ToolbarUIContextType = {
4
+ /**
5
+ * Indicates whether the toolbar is disabled when the editor is offline.
6
+ */
7
+ isDisabled?: boolean;
4
8
  /**
5
9
  * Callback for when the dropdown is open/closed. Receives an object with `isOpen` state.
6
10
  *
7
11
  * If the dropdown was closed programmatically, the `event` parameter will be `null`.
8
12
  */
9
13
  onDropdownOpenChanged: (args: OnOpenChangeArgs) => void;
14
+ popupsMountPoint?: HTMLElement;
10
15
  /**
11
16
  * Whether to prevent default behavior on mouse down events on ToolbarButton.
12
17
  */
13
18
  preventDefaultOnMouseDown?: boolean;
14
- /**
15
- * Indicates whether the toolbar is disabled when the editor is offline.
16
- */
17
- isDisabled?: boolean;
18
- popupsMountPoint?: HTMLElement;
19
19
  };
20
20
  /**
21
21
  * Access consumer specific config and state within a toolbar component
@@ -4,16 +4,16 @@ import { type MessageDescriptor } from 'react-intl-next';
4
4
  * Represents a single color in the palette
5
5
  */
6
6
  export interface PaletteColor {
7
- /** The color value (hex, token, etc.) */
8
- value: string;
9
- /** Display label for the color */
10
- label: string;
11
7
  /** Border color for the color swatch */
12
8
  border: string;
13
- /** Optional internationalization message */
14
- message?: MessageDescriptor;
15
9
  /** Optional decorator element to display instead of checkmark */
16
10
  decorator?: ReactElement;
11
+ /** Display label for the color */
12
+ label: string;
13
+ /** Optional internationalization message */
14
+ message?: MessageDescriptor;
15
+ /** The color value (hex, token, etc.) */
16
+ value: string;
17
17
  }
18
18
  /**
19
19
  * Array of palette colors
@@ -30,13 +30,13 @@ export type PaletteTooltipMessages = {
30
30
  * Configuration options for the color palette
31
31
  */
32
32
  export interface PaletteOptions {
33
- /** Array of colors to display */
34
- palette: PaletteColor[];
35
33
  /**
36
34
  * Function to convert hex codes to design system tokens
37
35
  * Different color palettes may use different mapping functions
38
36
  */
39
37
  hexToPaletteColor?: (hexColor: string) => string | undefined;
38
+ /** Array of colors to display */
39
+ palette: PaletteColor[];
40
40
  /**
41
41
  * Tooltip messages for different color themes
42
42
  * Consumer determines which tooltip messages to use
@@ -47,43 +47,43 @@ export interface PaletteOptions {
47
47
  * Props for the main ColorPalette component
48
48
  */
49
49
  export interface ColorPaletteProps {
50
- /** Currently selected color value */
51
- selectedColor: string | null;
50
+ /** Optional CSS class name */
51
+ className?: string;
52
+ /** Number of columns in the palette grid */
53
+ cols?: number;
52
54
  /** Callback when a color is clicked */
53
55
  onClick: (value: string, label: string) => void;
54
56
  /** Optional callback for keyboard navigation */
55
57
  onKeyDown?: (value: string, label: string, event: React.KeyboardEvent) => void;
56
- /** Number of columns in the palette grid */
57
- cols?: number;
58
- /** Optional CSS class name */
59
- className?: string;
60
58
  /** Palette configuration options */
61
59
  paletteOptions: PaletteOptions;
60
+ /** Currently selected color value */
61
+ selectedColor: string | null;
62
62
  }
63
63
  /**
64
64
  * Props for individual color palette items
65
65
  */
66
66
  export interface ColorProps {
67
- /** The color value */
68
- value: string;
69
- /** Display label for accessibility */
70
- label: string;
71
- /** Tab index for keyboard navigation */
72
- tabIndex?: number;
73
- /** Whether this color is currently selected */
74
- isSelected?: boolean;
75
- /** Click handler */
76
- onClick: (value: string, label: string) => void;
77
- /** Keyboard event handler */
78
- onKeyDown?: (value: string, label: string, event: React.KeyboardEvent) => void;
67
+ /** Whether to auto-focus this item */
68
+ autoFocus?: boolean;
79
69
  /** Border color for the swatch */
80
70
  borderColor: string;
81
71
  /** Color for the checkmark icon */
82
72
  checkMarkColor?: string;
83
- /** Whether to auto-focus this item */
84
- autoFocus?: boolean;
85
- /** Function to convert hex to palette color */
86
- hexToPaletteColor?: (hexColor: string) => string | undefined;
87
73
  /** Optional decorator element */
88
74
  decorator?: ReactElement;
75
+ /** Function to convert hex to palette color */
76
+ hexToPaletteColor?: (hexColor: string) => string | undefined;
77
+ /** Whether this color is currently selected */
78
+ isSelected?: boolean;
79
+ /** Display label for accessibility */
80
+ label: string;
81
+ /** Click handler */
82
+ onClick: (value: string, label: string) => void;
83
+ /** Keyboard event handler */
84
+ onKeyDown?: (value: string, label: string, event: React.KeyboardEvent) => void;
85
+ /** Tab index for keyboard navigation */
86
+ tabIndex?: number;
87
+ /** The color value */
88
+ value: string;
89
89
  }
@@ -1,16 +1,16 @@
1
1
  import React, { type ReactNode } from 'react';
2
2
  import { type TriggerProps } from '@atlaskit/popup';
3
3
  type ToolbarButtonProps = Partial<TriggerProps> & {
4
+ ariaKeyshortcuts?: string;
4
5
  children?: ReactNode;
6
+ iconBefore: React.ReactNode;
7
+ isDisabled?: boolean;
5
8
  isSelected?: boolean;
6
- onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
9
+ label?: string;
7
10
  onBlur?: (event: React.FocusEvent<HTMLButtonElement>) => void;
11
+ onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
8
12
  onFocus?: (event: React.FocusEvent<HTMLButtonElement>) => void;
9
13
  testId?: string;
10
- iconBefore: React.ReactNode;
11
- isDisabled?: boolean;
12
- ariaKeyshortcuts?: string;
13
- label?: string;
14
14
  };
15
15
  export declare const ToolbarButton: React.ForwardRefExoticComponent<Omit<ToolbarButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
16
16
  export {};
@@ -2,23 +2,23 @@ import React, { type ReactNode, type Ref } from 'react';
2
2
  import type { CustomItemComponentProps } from '@atlaskit/menu/types';
3
3
  type TextStyle = 'normal' | 'heading1' | 'heading2' | 'heading3' | 'heading4' | 'heading5' | 'heading6';
4
4
  export type CustomDropdownMenuItemButtonProps = CustomItemComponentProps & {
5
- 'aria-haspopup'?: boolean;
6
5
  'aria-disabled'?: boolean;
7
- 'aria-pressed'?: boolean;
6
+ 'aria-haspopup'?: boolean;
8
7
  'aria-keyshortcuts'?: string;
8
+ 'aria-pressed'?: boolean;
9
9
  };
10
10
  type ToolbarDropdownItemProps = {
11
- onClick?: (e: React.MouseEvent | React.KeyboardEvent) => void;
12
- elemBefore?: ReactNode;
11
+ ariaKeyshortcuts?: string;
12
+ children?: React.ReactNode;
13
13
  elemAfter?: ReactNode;
14
+ elemBefore?: ReactNode;
15
+ hasNestedDropdownMenu?: boolean;
16
+ isDisabled?: boolean;
14
17
  isSelected?: boolean;
15
- children?: React.ReactNode;
18
+ onClick?: (e: React.MouseEvent | React.KeyboardEvent) => void;
19
+ testId?: string;
16
20
  textStyle?: TextStyle;
17
- isDisabled?: boolean;
18
- hasNestedDropdownMenu?: boolean;
19
21
  triggerRef?: Ref<HTMLButtonElement>;
20
- testId?: string;
21
- ariaKeyshortcuts?: string;
22
22
  };
23
23
  export declare const ToolbarDropdownItem: ({ onClick, elemBefore, elemAfter, isSelected, children, isDisabled, hasNestedDropdownMenu, triggerRef, testId, ariaKeyshortcuts, }: ToolbarDropdownItemProps) => React.JSX.Element;
24
24
  export {};
@@ -4,15 +4,15 @@
4
4
  */
5
5
  import React, { type ReactNode } from 'react';
6
6
  type ToolbarDropdownMenuProps = {
7
- iconBefore: React.ReactNode;
8
7
  children?: ReactNode;
9
- isDisabled?: boolean;
10
- testId?: string;
11
- label?: string;
12
8
  /**
13
9
  * Whether to add margin around sections to align with 4px block padding existing in current editor dropdown
14
10
  */
15
11
  hasSectionMargin?: boolean;
12
+ iconBefore: React.ReactNode;
13
+ isDisabled?: boolean;
14
+ label?: string;
15
+ testId?: string;
16
16
  };
17
17
  export declare const ToolbarDropdownMenu: ({ iconBefore, children, isDisabled, testId, label, hasSectionMargin, }: ToolbarDropdownMenuProps) => JSX.Element;
18
18
  export {};
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
2
  interface ToolbarDropdownMenuContextValue {
3
- openMenu: () => void;
4
3
  closeMenu: () => void;
5
4
  isOpen: boolean;
5
+ openMenu: () => void;
6
6
  }
7
7
  export declare const useToolbarDropdownMenu: () => ToolbarDropdownMenuContextValue;
8
8
  interface ToolbarDropdownMenuProviderProps {
@@ -1,11 +1,11 @@
1
1
  import React, { type ReactNode } from 'react';
2
2
  type ToolbarNestedDropdownMenuProps = {
3
- elemBefore: ReactNode;
4
- elemAfter: ReactNode;
5
- text?: string;
6
3
  children?: ReactNode;
4
+ elemAfter: ReactNode;
5
+ elemBefore: ReactNode;
7
6
  isDisabled?: boolean;
8
7
  testId?: string;
8
+ text?: string;
9
9
  };
10
10
  export declare const ToolbarNestedDropdownMenu: ({ elemBefore, text, elemAfter, children, isDisabled, testId, }: ToolbarNestedDropdownMenuProps) => React.JSX.Element;
11
11
  export {};
@@ -5,11 +5,11 @@
5
5
  import { type ReactNode } from 'react';
6
6
  type ToolbarSectionProps = {
7
7
  children?: ReactNode;
8
- testId?: string;
9
8
  /**
10
9
  * Whether to add a separator at the start of the section
11
10
  */
12
11
  hasSeparator?: boolean;
12
+ testId?: string;
13
13
  };
14
14
  export declare const ToolbarSection: ({ children, testId, hasSeparator }: ToolbarSectionProps) => JSX.Element;
15
15
  export {};
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
2
  import type { PositionType } from '@atlaskit/tooltip';
3
3
  type ToolbarTooltipProps = {
4
- content: React.ReactNode;
5
4
  children: React.ReactNode;
5
+ content: React.ReactNode;
6
6
  position?: PositionType;
7
7
  };
8
8
  export declare const ToolbarTooltip: ({ content, children, position }: ToolbarTooltipProps) => React.JSX.Element;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "registry": "https://registry.npmjs.org/"
5
5
  },
6
- "version": "0.3.5",
6
+ "version": "0.3.7",
7
7
  "description": "Common UI for Toolbars across the platform",
8
8
  "atlassian": {
9
9
  "team": "Editor: Jenga",
@@ -47,7 +47,6 @@
47
47
  "@af/integration-testing": "workspace:^",
48
48
  "@af/visual-regression": "workspace:^",
49
49
  "@atlaskit/ssr": "workspace:^",
50
- "@atlaskit/visual-regression": "workspace:^",
51
50
  "@testing-library/react": "^13.4.0",
52
51
  "react-dom": "^18.2.0"
53
52
  },
@@ -1,54 +0,0 @@
1
- {
2
- "extends": "../../../../tsconfig.entry-points.confluence.json",
3
- "compilerOptions": {
4
- "declaration": true,
5
- "target": "es5",
6
- "composite": true,
7
- "outDir": "../../../../../confluence/tsDist/@atlaskit__editor-toolbar",
8
- "rootDir": "../"
9
- },
10
- "include": [
11
- "../src/**/*.ts",
12
- "../src/**/*.tsx"
13
- ],
14
- "exclude": [
15
- "../src/**/__tests__/*",
16
- "../src/**/*.test.*",
17
- "../src/**/test.*"
18
- ],
19
- "references": [
20
- {
21
- "path": "../../../design-system/badge/afm-cc/tsconfig.json"
22
- },
23
- {
24
- "path": "../../../design-system/button/afm-cc/tsconfig.json"
25
- },
26
- {
27
- "path": "../../../design-system/css/afm-cc/tsconfig.json"
28
- },
29
- {
30
- "path": "../../../design-system/dropdown-menu/afm-cc/tsconfig.json"
31
- },
32
- {
33
- "path": "../../../design-system/icon/afm-cc/tsconfig.json"
34
- },
35
- {
36
- "path": "../../../design-system/icon-lab/afm-cc/tsconfig.json"
37
- },
38
- {
39
- "path": "../../../design-system/logo/afm-cc/tsconfig.json"
40
- },
41
- {
42
- "path": "../../../design-system/popup/afm-cc/tsconfig.json"
43
- },
44
- {
45
- "path": "../../../design-system/primitives/afm-cc/tsconfig.json"
46
- },
47
- {
48
- "path": "../../../design-system/tokens/afm-cc/tsconfig.json"
49
- },
50
- {
51
- "path": "../../../design-system/tooltip/afm-cc/tsconfig.json"
52
- }
53
- ]
54
- }