@dev-crew-berlin/enter-js-utils 0.10.3 → 0.10.4
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.
|
@@ -3,6 +3,7 @@ declare type Props<Segment extends string> = {
|
|
|
3
3
|
segments: Segment[];
|
|
4
4
|
activeSegment?: Segment;
|
|
5
5
|
onChange: (segment: Segment) => void;
|
|
6
|
+
onFocus: () => void;
|
|
6
7
|
};
|
|
7
8
|
export declare const SegmentedControl: <Segment extends string>(props: Props<Segment>) => ReactElement;
|
|
8
9
|
export {};
|
|
@@ -6,6 +6,7 @@ export const SegmentedControl = props => {
|
|
|
6
6
|
return /*#__PURE__*/React.createElement("div", {
|
|
7
7
|
className: _JSXStyle.dynamic([["235524868", [theme.fonts.secondary, theme.colors.enterLightGrey, theme.colors.enterMediumGrey, theme.colors.enterDarkGrey]]]) + " " + 'segmented-controll'
|
|
8
8
|
}, props.segments.map(segment => /*#__PURE__*/React.createElement("div", {
|
|
9
|
+
key: segment,
|
|
9
10
|
className: _JSXStyle.dynamic([["235524868", [theme.fonts.secondary, theme.colors.enterLightGrey, theme.colors.enterMediumGrey, theme.colors.enterDarkGrey]]]) + " " + 'segment'
|
|
10
11
|
}, /*#__PURE__*/React.createElement("input", {
|
|
11
12
|
type: "radio",
|
|
@@ -13,6 +14,7 @@ export const SegmentedControl = props => {
|
|
|
13
14
|
name: name,
|
|
14
15
|
checked: segment === props.activeSegment,
|
|
15
16
|
onChange: () => props.onChange(segment),
|
|
17
|
+
onFocus: props.onFocus,
|
|
16
18
|
className: _JSXStyle.dynamic([["235524868", [theme.fonts.secondary, theme.colors.enterLightGrey, theme.colors.enterMediumGrey, theme.colors.enterDarkGrey]]])
|
|
17
19
|
}), /*#__PURE__*/React.createElement("label", {
|
|
18
20
|
htmlFor: segment,
|
|
@@ -4,10 +4,12 @@ declare const _default: ComponentMeta<(<Segment extends string>(props: {
|
|
|
4
4
|
segments: Segment[];
|
|
5
5
|
activeSegment?: Segment | undefined;
|
|
6
6
|
onChange: (segment: Segment) => void;
|
|
7
|
+
onFocus: () => void;
|
|
7
8
|
}) => React.ReactElement<any, string | React.JSXElementConstructor<any>>)>;
|
|
8
9
|
export default _default;
|
|
9
10
|
export declare const Basic: ComponentStory<(<Segment extends string>(props: {
|
|
10
11
|
segments: Segment[];
|
|
11
12
|
activeSegment?: Segment | undefined;
|
|
12
13
|
onChange: (segment: Segment) => void;
|
|
14
|
+
onFocus: () => void;
|
|
13
15
|
}) => React.ReactElement<any, string | React.JSXElementConstructor<any>>)>;
|