@meduza/ui-kit-2 0.1.53 → 0.1.54
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/dist/ui-kit-2.cjs.development.js +124 -131
- package/dist/ui-kit-2.cjs.development.js.map +1 -1
- package/dist/ui-kit-2.cjs.production.min.js +1 -1
- package/dist/ui-kit-2.cjs.production.min.js.map +1 -1
- package/dist/ui-kit-2.esm.js +125 -132
- package/dist/ui-kit-2.esm.js.map +1 -1
- package/dist/ui-kit.css +846 -846
- package/package.json +1 -1
- package/src/Toolbar/index.tsx +2 -9
- package/src/ToolbarButton/index.tsx +12 -9
package/package.json
CHANGED
package/src/Toolbar/index.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react'
|
|
2
2
|
import { ToolbarProps } from './Toolbar.types'
|
|
3
3
|
import makeStyleContext from '../utils/makeStyleContext'
|
|
4
4
|
import { makeClassName, ClassNames } from '../utils/makeClassName'
|
|
@@ -12,16 +12,9 @@ export const Toolbar: React.FC<ToolbarProps> = ({ children, styleContext }) => {
|
|
|
12
12
|
classNames = makeStyleContext(classNames, styleContext, styles)
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
const renderItems = (): JSX.Element[] =>
|
|
16
|
-
Children.map(children, (item: JSX.Element, index) => (
|
|
17
|
-
<li className={styles.item} key={`${index}-${item.props.type}`}>
|
|
18
|
-
{React.cloneElement(item)}
|
|
19
|
-
</li>
|
|
20
|
-
))
|
|
21
|
-
|
|
22
15
|
return (
|
|
23
16
|
<div data-testid="toolbar" className={makeClassName(classNames)}>
|
|
24
|
-
<ul className={styles.list}>{
|
|
17
|
+
<ul className={styles.list}>{children}</ul>
|
|
25
18
|
</div>
|
|
26
19
|
)
|
|
27
20
|
}
|
|
@@ -3,6 +3,7 @@ import { ToolbarButtonProps } from './ToolbarButton.types'
|
|
|
3
3
|
import { SvgSymbol } from '../SvgSymbol/'
|
|
4
4
|
import { makeClassName, ClassNames } from '../utils/makeClassName'
|
|
5
5
|
|
|
6
|
+
import toolbarStyles from '../Toolbar/Toolbar.module.css'
|
|
6
7
|
import styles from './ToolbarButton.module.css'
|
|
7
8
|
|
|
8
9
|
export const ToolbarButton: React.FC<ToolbarButtonProps> = ({
|
|
@@ -20,14 +21,16 @@ export const ToolbarButton: React.FC<ToolbarButtonProps> = ({
|
|
|
20
21
|
]
|
|
21
22
|
|
|
22
23
|
return (
|
|
23
|
-
<
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
24
|
+
<li className={toolbarStyles.item}>
|
|
25
|
+
<button
|
|
26
|
+
data-testid="toolbar-button"
|
|
27
|
+
className={makeClassName(classNames)}
|
|
28
|
+
type="button"
|
|
29
|
+
onClick={(): void => onClick(type)}
|
|
30
|
+
>
|
|
31
|
+
<SvgSymbol size="medium" icon={type} styleContext="isInToolbar" />
|
|
32
|
+
{children && <span className={styles.text}>{children}</span>}
|
|
33
|
+
</button>
|
|
34
|
+
</li>
|
|
32
35
|
)
|
|
33
36
|
}
|