@dev-crew-berlin/enter-js-utils 0.6.3 → 0.7.0
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/form-elements/input.d.ts +6 -0
- package/dist/ui/form-elements/input.js +22 -0
- package/dist/ui/form-elements/input.stories.d.ts +15 -0
- package/dist/ui/form-elements/input.stories.js +33 -0
- package/dist/ui/form-elements/label.d.ts +4 -0
- package/dist/ui/form-elements/label.js +14 -0
- package/dist/ui/form-elements/label.stories.d.ts +5 -0
- package/dist/ui/form-elements/label.stories.js +13 -0
- package/dist/ui/index.d.ts +2 -0
- package/dist/ui/index.js +2 -0
- package/dist/ui/tag.stories.d.ts +9 -0
- package/dist/ui/tag.stories.js +13 -0
- package/package.json +1 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import _JSXStyle from "styled-jsx/style";
|
|
2
|
+
|
|
3
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { theme } from '../../lib';
|
|
7
|
+
import { Label } from './label';
|
|
8
|
+
export const Input = ({
|
|
9
|
+
label,
|
|
10
|
+
...props
|
|
11
|
+
}) => {
|
|
12
|
+
const id = props.id ?? label;
|
|
13
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Label, {
|
|
14
|
+
htmlFor: id
|
|
15
|
+
}, label), /*#__PURE__*/React.createElement("input", _extends({}, props, {
|
|
16
|
+
id: id,
|
|
17
|
+
className: _JSXStyle.dynamic([["3631038054", [theme.fonts.primary, theme.colors.enterDarkGrey, theme.colors.enterMediumGrey, theme.colors.enterRed]]]) + " " + (props && props.className != null && props.className || "")
|
|
18
|
+
})), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
19
|
+
id: "3631038054",
|
|
20
|
+
dynamic: [theme.fonts.primary, theme.colors.enterDarkGrey, theme.colors.enterMediumGrey, theme.colors.enterRed]
|
|
21
|
+
}, `input.__jsx-style-dynamic-selector{font-family:${theme.fonts.primary};font-size:1.1em;display:block;width:100%;padding:0.2em 0;margin-bottom:1.1em;border:none;outline:none;background-color:transparent;color:${theme.colors.enterDarkGrey};border-bottom:1px solid ${theme.colors.enterMediumGrey};border-radius:0;-webkit-transition:border-color 0.2s;transition:border-color 0.2s;}input.__jsx-style-dynamic-selector:focus{border-color:${theme.colors.enterRed};}`));
|
|
22
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
3
|
+
declare const _default: ComponentMeta<React.FunctionComponent<React.InputHTMLAttributes<HTMLInputElement> & {
|
|
4
|
+
label: string;
|
|
5
|
+
}>>;
|
|
6
|
+
export default _default;
|
|
7
|
+
export declare const Basic: ComponentStory<React.FunctionComponent<React.InputHTMLAttributes<HTMLInputElement> & {
|
|
8
|
+
label: string;
|
|
9
|
+
}>>;
|
|
10
|
+
export declare const NumberInput: ComponentStory<React.FunctionComponent<React.InputHTMLAttributes<HTMLInputElement> & {
|
|
11
|
+
label: string;
|
|
12
|
+
}>>;
|
|
13
|
+
export declare const WithValue: ComponentStory<React.FunctionComponent<React.InputHTMLAttributes<HTMLInputElement> & {
|
|
14
|
+
label: string;
|
|
15
|
+
}>>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Input } from './input';
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Form Elements/Input',
|
|
5
|
+
component: Input
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
const Template = args => /*#__PURE__*/React.createElement(Input, args);
|
|
9
|
+
|
|
10
|
+
export const Basic = Template.bind({});
|
|
11
|
+
Basic.args = {
|
|
12
|
+
type: 'text',
|
|
13
|
+
label: 'Text input',
|
|
14
|
+
placeholder: 'Enter text here',
|
|
15
|
+
value: '',
|
|
16
|
+
onClick: () => undefined
|
|
17
|
+
};
|
|
18
|
+
export const NumberInput = Template.bind({});
|
|
19
|
+
NumberInput.args = {
|
|
20
|
+
type: 'number',
|
|
21
|
+
label: 'Number input',
|
|
22
|
+
placeholder: 'Enter number here',
|
|
23
|
+
value: '',
|
|
24
|
+
onClick: () => undefined
|
|
25
|
+
};
|
|
26
|
+
export const WithValue = Template.bind({});
|
|
27
|
+
WithValue.args = {
|
|
28
|
+
type: 'text',
|
|
29
|
+
label: 'Text input',
|
|
30
|
+
placeholder: 'Enter text here',
|
|
31
|
+
value: 'Text value',
|
|
32
|
+
onClick: () => undefined
|
|
33
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import _JSXStyle from "styled-jsx/style";
|
|
2
|
+
|
|
3
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { theme } from '../../lib';
|
|
7
|
+
export const Label = props => {
|
|
8
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("label", _extends({}, props, {
|
|
9
|
+
className: _JSXStyle.dynamic([["2896178063", [theme.fonts.secondary, theme.colors.enterDarkGrey]]]) + " " + (props && props.className != null && props.className || "")
|
|
10
|
+
}), props.children), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
11
|
+
id: "2896178063",
|
|
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;}`));
|
|
14
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
3
|
+
declare const _default: ComponentMeta<React.FunctionComponent<React.LabelHTMLAttributes<HTMLLabelElement>>>;
|
|
4
|
+
export default _default;
|
|
5
|
+
export declare const Basic: ComponentStory<React.FunctionComponent<React.LabelHTMLAttributes<HTMLLabelElement>>>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Label } from './label';
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Form Elements/Label',
|
|
5
|
+
component: Label
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
const Template = args => /*#__PURE__*/React.createElement(Label, args);
|
|
9
|
+
|
|
10
|
+
export const Basic = Template.bind({});
|
|
11
|
+
Basic.args = {
|
|
12
|
+
children: 'Label text'
|
|
13
|
+
};
|
package/dist/ui/index.d.ts
CHANGED
package/dist/ui/index.js
CHANGED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
3
|
+
declare const _default: ComponentMeta<React.FunctionComponent<{
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
}>>;
|
|
6
|
+
export default _default;
|
|
7
|
+
export declare const Basic: ComponentStory<React.FunctionComponent<{
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
}>>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Tag } from './tag';
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Tag',
|
|
5
|
+
component: Tag
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
const Template = args => /*#__PURE__*/React.createElement(Tag, args);
|
|
9
|
+
|
|
10
|
+
export const Basic = Template.bind({});
|
|
11
|
+
Basic.args = {
|
|
12
|
+
children: 'my tag'
|
|
13
|
+
};
|