@dev-crew-berlin/enter-js-utils 0.8.1 → 0.9.1
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/button.d.ts +2 -1
- package/dist/ui/button.js +5 -4
- package/dist/ui/button.stories.d.ts +28 -10
- package/dist/ui/button.stories.js +19 -6
- package/dist/ui/form-elements/label.js +3 -3
- package/dist/ui/form-elements/segmented-control.d.ts +1 -0
- package/dist/ui/form-elements/segmented-control.js +1 -0
- package/dist/ui/form-elements/segmented-control.stories.d.ts +2 -0
- package/package.json +1 -1
package/dist/ui/button.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ButtonHTMLAttributes, FunctionComponent } from 'react';
|
|
2
2
|
import 'styled-jsx';
|
|
3
3
|
declare type Props = Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'className' | 'color'> & {
|
|
4
|
-
appearance?: 'default' | 'primary' | 'danger' | 'green'
|
|
4
|
+
appearance?: 'default' | 'primary' | 'danger' | 'green';
|
|
5
|
+
borderless?: boolean;
|
|
5
6
|
fullWidth?: boolean;
|
|
6
7
|
};
|
|
7
8
|
export declare const Button: FunctionComponent<Props>;
|
package/dist/ui/button.js
CHANGED
|
@@ -10,13 +10,14 @@ export const Button = ({
|
|
|
10
10
|
...props
|
|
11
11
|
}) => {
|
|
12
12
|
return /*#__PURE__*/React.createElement("button", _extends({}, props, {
|
|
13
|
-
className: _JSXStyle.dynamic([["
|
|
13
|
+
className: _JSXStyle.dynamic([["2457126629", [theme.fonts.secondary, theme.colors.enterBackground, theme.colors.enterDarkGrey, theme.colors.enterGrey, theme.colors.enterError, theme.colors.enterGrey, theme.colors.enterError, theme.colors.enterDarkGrey, theme.colors.enterDarkGrey, theme.colors.enterDarkGrey, theme.colors.enterGreen, theme.colors.enterGreen, theme.colors.enterGreen]]]) + " " + (classNames({
|
|
14
14
|
button: true,
|
|
15
15
|
[appearance]: true,
|
|
16
|
+
borderless: props.borderless,
|
|
16
17
|
'full-width': props.fullWidth
|
|
17
18
|
}) || "")
|
|
18
19
|
}), props.children, /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
19
|
-
id: "
|
|
20
|
-
dynamic: [theme.fonts.secondary, theme.colors.enterBackground, theme.colors.enterDarkGrey, theme.colors.enterGrey, theme.colors.
|
|
21
|
-
}, `.button.__jsx-style-dynamic-selector{font-family:${theme.fonts.secondary};margin:1em 0;padding:0.8em 1.5em;min-width:150px;font-size:1em;font-weight:500;white-space:nowrap;text-align:center;-webkit-text-decoration:none;text-decoration:none;text-transform:uppercase;-webkit-letter-spacing:0.06em;-moz-letter-spacing:0.06em;-ms-letter-spacing:0.06em;letter-spacing:0.06em;line-height:1;cursor:pointer;border-radius:2px;background-color:${theme.colors.enterBackground};color:${theme.colors.enterDarkGrey};border:1px solid ${theme.colors.enterGrey};box-shadow:0px 0px 2px 0px rgba(0,0,0,0.12), 0px 1px 2px 0px rgba(0,0,0,0.24);}.full-width.__jsx-style-dynamic-selector{display:block;width:100%;}.danger.__jsx-style-dynamic-selector{
|
|
20
|
+
id: "2457126629",
|
|
21
|
+
dynamic: [theme.fonts.secondary, theme.colors.enterBackground, theme.colors.enterDarkGrey, theme.colors.enterGrey, theme.colors.enterError, theme.colors.enterGrey, theme.colors.enterError, theme.colors.enterDarkGrey, theme.colors.enterDarkGrey, theme.colors.enterDarkGrey, theme.colors.enterGreen, theme.colors.enterGreen, theme.colors.enterGreen]
|
|
22
|
+
}, `.button.__jsx-style-dynamic-selector{font-family:${theme.fonts.secondary};margin:1em 0;padding:0.8em 1.5em;min-width:150px;font-size:1em;font-weight:500;white-space:nowrap;text-align:center;-webkit-text-decoration:none;text-decoration:none;text-transform:uppercase;-webkit-letter-spacing:0.06em;-moz-letter-spacing:0.06em;-ms-letter-spacing:0.06em;letter-spacing:0.06em;line-height:1;cursor:pointer;border-radius:2px;background-color:${theme.colors.enterBackground};color:${theme.colors.enterDarkGrey};border:1px solid ${theme.colors.enterGrey};box-shadow:0px 0px 2px 0px rgba(0,0,0,0.12), 0px 1px 2px 0px rgba(0,0,0,0.24);}.button.borderless.__jsx-style-dynamic-selector{background-color:transparent;border:0;box-shadow:none;}.full-width.__jsx-style-dynamic-selector{display:block;width:100%;}.danger.__jsx-style-dynamic-selector{color:${theme.colors.enterError};border:1px solid ${theme.colors.enterGrey};}.danger.borderless.__jsx-style-dynamic-selector{color:${theme.colors.enterError};}.primary.__jsx-style-dynamic-selector{background-color:${theme.colors.enterDarkGrey};color:white;border:1px solid ${theme.colors.enterDarkGrey};}.primary.borderless.__jsx-style-dynamic-selector{color:${theme.colors.enterDarkGrey};font-weight:bold;}.green.__jsx-style-dynamic-selector{background-color:${theme.colors.enterGreen};color:white;border:1px solid ${theme.colors.enterGreen};}.green.borderless.__jsx-style-dynamic-selector{color:${theme.colors.enterGreen};}`));
|
|
22
23
|
};
|
|
@@ -1,35 +1,53 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
3
3
|
declare const _default: ComponentMeta<React.FunctionComponent<Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "className" | "color"> & {
|
|
4
|
-
appearance?: "default" | "primary" | "danger" | "green" |
|
|
4
|
+
appearance?: "default" | "primary" | "danger" | "green" | undefined;
|
|
5
|
+
borderless?: boolean | undefined;
|
|
5
6
|
fullWidth?: boolean | undefined;
|
|
6
7
|
}>>;
|
|
7
8
|
export default _default;
|
|
8
9
|
export declare const Basic: ComponentStory<React.FunctionComponent<Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "className" | "color"> & {
|
|
9
|
-
appearance?: "default" | "primary" | "danger" | "green" |
|
|
10
|
+
appearance?: "default" | "primary" | "danger" | "green" | undefined;
|
|
11
|
+
borderless?: boolean | undefined;
|
|
10
12
|
fullWidth?: boolean | undefined;
|
|
11
13
|
}>>;
|
|
12
14
|
export declare const FullWidth: ComponentStory<React.FunctionComponent<Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "className" | "color"> & {
|
|
13
|
-
appearance?: "default" | "primary" | "danger" | "green" |
|
|
15
|
+
appearance?: "default" | "primary" | "danger" | "green" | undefined;
|
|
16
|
+
borderless?: boolean | undefined;
|
|
14
17
|
fullWidth?: boolean | undefined;
|
|
15
18
|
}>>;
|
|
16
19
|
export declare const Primary: ComponentStory<React.FunctionComponent<Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "className" | "color"> & {
|
|
17
|
-
appearance?: "default" | "primary" | "danger" | "green" |
|
|
20
|
+
appearance?: "default" | "primary" | "danger" | "green" | undefined;
|
|
21
|
+
borderless?: boolean | undefined;
|
|
18
22
|
fullWidth?: boolean | undefined;
|
|
19
23
|
}>>;
|
|
20
24
|
export declare const Danger: ComponentStory<React.FunctionComponent<Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "className" | "color"> & {
|
|
21
|
-
appearance?: "default" | "primary" | "danger" | "green" |
|
|
25
|
+
appearance?: "default" | "primary" | "danger" | "green" | undefined;
|
|
26
|
+
borderless?: boolean | undefined;
|
|
22
27
|
fullWidth?: boolean | undefined;
|
|
23
28
|
}>>;
|
|
24
29
|
export declare const Green: ComponentStory<React.FunctionComponent<Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "className" | "color"> & {
|
|
25
|
-
appearance?: "default" | "primary" | "danger" | "green" |
|
|
30
|
+
appearance?: "default" | "primary" | "danger" | "green" | undefined;
|
|
31
|
+
borderless?: boolean | undefined;
|
|
26
32
|
fullWidth?: boolean | undefined;
|
|
27
33
|
}>>;
|
|
28
|
-
export declare const
|
|
29
|
-
appearance?: "default" | "primary" | "danger" | "green" |
|
|
34
|
+
export declare const Borderless: ComponentStory<React.FunctionComponent<Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "className" | "color"> & {
|
|
35
|
+
appearance?: "default" | "primary" | "danger" | "green" | undefined;
|
|
36
|
+
borderless?: boolean | undefined;
|
|
30
37
|
fullWidth?: boolean | undefined;
|
|
31
38
|
}>>;
|
|
32
|
-
export declare const
|
|
33
|
-
appearance?: "default" | "primary" | "danger" | "green" |
|
|
39
|
+
export declare const BorderlessPrimary: ComponentStory<React.FunctionComponent<Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "className" | "color"> & {
|
|
40
|
+
appearance?: "default" | "primary" | "danger" | "green" | undefined;
|
|
41
|
+
borderless?: boolean | undefined;
|
|
42
|
+
fullWidth?: boolean | undefined;
|
|
43
|
+
}>>;
|
|
44
|
+
export declare const BorderlessDanger: ComponentStory<React.FunctionComponent<Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "className" | "color"> & {
|
|
45
|
+
appearance?: "default" | "primary" | "danger" | "green" | undefined;
|
|
46
|
+
borderless?: boolean | undefined;
|
|
47
|
+
fullWidth?: boolean | undefined;
|
|
48
|
+
}>>;
|
|
49
|
+
export declare const BorderlessGreen: ComponentStory<React.FunctionComponent<Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "className" | "color"> & {
|
|
50
|
+
appearance?: "default" | "primary" | "danger" | "green" | undefined;
|
|
51
|
+
borderless?: boolean | undefined;
|
|
34
52
|
fullWidth?: boolean | undefined;
|
|
35
53
|
}>>;
|
|
@@ -31,13 +31,26 @@ Green.args = {
|
|
|
31
31
|
children: 'green',
|
|
32
32
|
appearance: 'green'
|
|
33
33
|
};
|
|
34
|
-
export const Ghost = Template.bind({});
|
|
35
|
-
Ghost.args = {
|
|
36
|
-
children: 'ghost',
|
|
37
|
-
appearance: 'ghost'
|
|
38
|
-
};
|
|
39
34
|
export const Borderless = Template.bind({});
|
|
40
35
|
Borderless.args = {
|
|
41
36
|
children: 'borderless',
|
|
42
|
-
|
|
37
|
+
borderless: true
|
|
38
|
+
};
|
|
39
|
+
export const BorderlessPrimary = Template.bind({});
|
|
40
|
+
BorderlessPrimary.args = {
|
|
41
|
+
children: 'borderless primaray',
|
|
42
|
+
borderless: true,
|
|
43
|
+
appearance: 'primary'
|
|
44
|
+
};
|
|
45
|
+
export const BorderlessDanger = Template.bind({});
|
|
46
|
+
BorderlessDanger.args = {
|
|
47
|
+
children: 'borderless danger',
|
|
48
|
+
borderless: true,
|
|
49
|
+
appearance: 'danger'
|
|
50
|
+
};
|
|
51
|
+
export const BorderlessGreen = Template.bind({});
|
|
52
|
+
BorderlessGreen.args = {
|
|
53
|
+
children: 'borderless green',
|
|
54
|
+
borderless: true,
|
|
55
|
+
appearance: 'green'
|
|
43
56
|
};
|
|
@@ -6,9 +6,9 @@ import React from 'react';
|
|
|
6
6
|
import { theme } from '../../lib';
|
|
7
7
|
export const Label = props => {
|
|
8
8
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("label", _extends({}, props, {
|
|
9
|
-
className: _JSXStyle.dynamic([["
|
|
9
|
+
className: _JSXStyle.dynamic([["1848048607", [theme.fonts.secondary, theme.colors.enterDarkGrey]]]) + " " + (props && props.className != null && props.className || "")
|
|
10
10
|
}), props.children), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
11
|
-
id: "
|
|
11
|
+
id: "1848048607",
|
|
12
12
|
dynamic: [theme.fonts.secondary, theme.colors.enterDarkGrey]
|
|
13
|
-
}, `label.__jsx-style-dynamic-selector{font-family:${theme.fonts.secondary};font-weight:400;font-size:0.9em;color:${theme.colors.enterDarkGrey};-webkit-letter-spacing:0.05em;-moz-letter-spacing:0.05em;-ms-letter-spacing:0.05em;letter-spacing:0.05em;margin-bottom:0.6em;}`));
|
|
13
|
+
}, `label.__jsx-style-dynamic-selector{display:block;font-family:${theme.fonts.secondary};font-weight:400;font-size:0.9em;color:${theme.colors.enterDarkGrey};-webkit-letter-spacing:0.05em;-moz-letter-spacing:0.05em;-ms-letter-spacing:0.05em;letter-spacing:0.05em;margin-bottom:0.6em;}`));
|
|
14
14
|
};
|
|
@@ -12,6 +12,7 @@ export const SegmentedControl = props => {
|
|
|
12
12
|
id: segment,
|
|
13
13
|
name: name,
|
|
14
14
|
checked: segment === props.activeSegment,
|
|
15
|
+
onChange: () => props.onChange(segment),
|
|
15
16
|
className: _JSXStyle.dynamic([["235524868", [theme.fonts.secondary, theme.colors.enterLightGrey, theme.colors.enterMediumGrey, theme.colors.enterDarkGrey]]])
|
|
16
17
|
}), /*#__PURE__*/React.createElement("label", {
|
|
17
18
|
htmlFor: segment,
|
|
@@ -3,9 +3,11 @@ import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
|
3
3
|
declare const _default: ComponentMeta<React.FunctionComponent<{
|
|
4
4
|
segments: string[];
|
|
5
5
|
activeSegment?: string | undefined;
|
|
6
|
+
onChange: (segment: string) => void;
|
|
6
7
|
}>>;
|
|
7
8
|
export default _default;
|
|
8
9
|
export declare const Basic: ComponentStory<React.FunctionComponent<{
|
|
9
10
|
segments: string[];
|
|
10
11
|
activeSegment?: string | undefined;
|
|
12
|
+
onChange: (segment: string) => void;
|
|
11
13
|
}>>;
|