@spaced-out/ui-design-system 0.0.36 → 0.0.38
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/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.0.38](https://github.com/spaced-out/ui-design-system/compare/v0.0.37...v0.0.38) (2023-03-03)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* exposed a classname for each option in a menu ([ef5feab](https://github.com/spaced-out/ui-design-system/commit/ef5feab4f4cc39b1d479641906a141250481dd95))
|
|
11
|
+
|
|
12
|
+
### [0.0.37](https://github.com/spaced-out/ui-design-system/compare/v0.0.36...v0.0.37) (2023-03-03)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* added custom component docs ([7d333c2](https://github.com/spaced-out/ui-design-system/commit/7d333c289729c06fd0a09983985b70f9eda77f54))
|
|
18
|
+
|
|
5
19
|
### [0.0.36](https://github.com/spaced-out/ui-design-system/compare/v0.0.35...v0.0.36) (2023-03-03)
|
|
6
20
|
|
|
7
21
|
|
|
@@ -9,7 +9,7 @@ import {MenuOptionButton} from './MenuOptionButton.js';
|
|
|
9
9
|
import css from './Menu.module.css';
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
type ClassNames = $ReadOnly<{wrapper?: string}>;
|
|
12
|
+
type ClassNames = $ReadOnly<{wrapper?: string, option?: string}>;
|
|
13
13
|
|
|
14
14
|
export type MenuOption = {
|
|
15
15
|
key?: string,
|
|
@@ -20,7 +20,8 @@ const MenuOptionButton = props => {
|
|
|
20
20
|
size,
|
|
21
21
|
onSelect,
|
|
22
22
|
selectedOption,
|
|
23
|
-
menuDisabled
|
|
23
|
+
menuDisabled,
|
|
24
|
+
classNames
|
|
24
25
|
} = props;
|
|
25
26
|
const {
|
|
26
27
|
key,
|
|
@@ -46,7 +47,7 @@ const MenuOptionButton = props => {
|
|
|
46
47
|
[_MenuModule.default.disabled]: menuDisabled || disabled,
|
|
47
48
|
[_MenuModule.default.withIconLeft]: !!iconLeft,
|
|
48
49
|
[_MenuModule.default.withIconRight]: !!iconRight
|
|
49
|
-
}),
|
|
50
|
+
}, classNames?.option),
|
|
50
51
|
disabled: menuDisabled || disabled,
|
|
51
52
|
onClick: () => onSelect && onSelect(option),
|
|
52
53
|
autoFocus: selectedOption?.key === key
|
|
@@ -11,7 +11,7 @@ import type {MenuOption} from './Menu.js';
|
|
|
11
11
|
import css from './Menu.module.css';
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
type ClassNames = $ReadOnly<{wrapper?: string}>;
|
|
14
|
+
type ClassNames = $ReadOnly<{wrapper?: string, option?: string}>;
|
|
15
15
|
|
|
16
16
|
export type MenuOptionProps = {
|
|
17
17
|
option: MenuOption,
|
|
@@ -25,7 +25,8 @@ export type MenuOptionProps = {
|
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
export const MenuOptionButton = (props: MenuOptionProps): React.Node => {
|
|
28
|
-
const {option, size, onSelect, selectedOption, menuDisabled} =
|
|
28
|
+
const {option, size, onSelect, selectedOption, menuDisabled, classNames} =
|
|
29
|
+
props;
|
|
29
30
|
const {
|
|
30
31
|
key,
|
|
31
32
|
label,
|
|
@@ -46,14 +47,18 @@ export const MenuOptionButton = (props: MenuOptionProps): React.Node => {
|
|
|
46
47
|
|
|
47
48
|
return (
|
|
48
49
|
<UnstyledButton
|
|
49
|
-
className={classify(
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
50
|
+
className={classify(
|
|
51
|
+
css.option,
|
|
52
|
+
{
|
|
53
|
+
[css.selected]: key === selectedOption?.key,
|
|
54
|
+
[css.optionSmall]: buttonSize === 'small',
|
|
55
|
+
[css.optionMedium]: buttonSize === 'medium',
|
|
56
|
+
[css.disabled]: menuDisabled || disabled,
|
|
57
|
+
[css.withIconLeft]: !!iconLeft,
|
|
58
|
+
[css.withIconRight]: !!iconRight,
|
|
59
|
+
},
|
|
60
|
+
classNames?.option,
|
|
61
|
+
)}
|
|
57
62
|
disabled={menuDisabled || disabled}
|
|
58
63
|
onClick={() => onSelect && onSelect(option)}
|
|
59
64
|
autoFocus={selectedOption?.key === key}
|