@dev-crew-berlin/enter-js-utils 0.31.0 → 0.32.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.
@@ -67,7 +67,7 @@ export default class APIBase {
67
67
  'Content-Type': 'application/json'
68
68
  };
69
69
  const res = await APIBase.fetchResult(`${this.credentials.url}${endpoint}`, {
70
- method,
70
+ method: method.toUpperCase(),
71
71
  headers,
72
72
  body
73
73
  });
@@ -0,0 +1,8 @@
1
+ import { FunctionComponent, InputHTMLAttributes } from 'react';
2
+ declare type Props = InputHTMLAttributes<HTMLInputElement> & {
3
+ textColor: string;
4
+ borderColor: string;
5
+ placeholder: string;
6
+ };
7
+ export declare const SearchInput: FunctionComponent<Props>;
8
+ export {};
@@ -0,0 +1,29 @@
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, { useId } from 'react';
6
+ import { theme } from '../../lib';
7
+ import { SearchIcon } from '../icons/search-icon';
8
+ export const SearchInput = ({
9
+ textColor = theme.colors.enterDarkGrey,
10
+ borderColor = theme.colors.enterMediumGrey,
11
+ placeholder = 'Search',
12
+ ...props
13
+ }) => {
14
+ const id = useId();
15
+ return /*#__PURE__*/React.createElement("div", {
16
+ className: _JSXStyle.dynamic([["1366111563", [theme.fonts.primary, textColor, borderColor, theme.colors.enterRed]]]) + " " + 'search-input'
17
+ }, /*#__PURE__*/React.createElement("div", {
18
+ className: _JSXStyle.dynamic([["1366111563", [theme.fonts.primary, textColor, borderColor, theme.colors.enterRed]]]) + " " + 'icon'
19
+ }, /*#__PURE__*/React.createElement(SearchIcon, {
20
+ color: textColor
21
+ })), /*#__PURE__*/React.createElement("input", _extends({}, props, {
22
+ placeholder: placeholder,
23
+ id: id,
24
+ className: _JSXStyle.dynamic([["1366111563", [theme.fonts.primary, textColor, borderColor, theme.colors.enterRed]]]) + " " + (props && props.className != null && props.className || "")
25
+ })), /*#__PURE__*/React.createElement(_JSXStyle, {
26
+ id: "1366111563",
27
+ dynamic: [theme.fonts.primary, textColor, borderColor, theme.colors.enterRed]
28
+ }, `.search-input.__jsx-style-dynamic-selector{display:grid;grid-template-areas:'icon-input';-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin-bottom:1.1em;}.icon.__jsx-style-dynamic-selector{grid-area:icon-input;width:12px;height:14px;margin:0 0 0 0.2em;}input.__jsx-style-dynamic-selector{grid-area:icon-input;font-family:${theme.fonts.primary};font-size:1.1em;display:block;width:calc(100% - 20px);padding:0.2em 0 0.2em 20px;border:none;outline:none;background-color:transparent;color:${textColor};border-bottom:1px solid ${borderColor};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};}`));
29
+ };
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { ComponentStory, ComponentMeta } from '@storybook/react';
3
+ declare const _default: ComponentMeta<React.FunctionComponent<React.InputHTMLAttributes<HTMLInputElement> & {
4
+ textColor: string;
5
+ borderColor: string;
6
+ placeholder: string;
7
+ }>>;
8
+ export default _default;
9
+ export declare const Basic: ComponentStory<React.FunctionComponent<React.InputHTMLAttributes<HTMLInputElement> & {
10
+ textColor: string;
11
+ borderColor: string;
12
+ placeholder: string;
13
+ }>>;
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import { SearchInput } from './search-input';
3
+ import { theme } from '../../lib';
4
+ export default {
5
+ title: 'Form Elements/SearchInput',
6
+ component: SearchInput
7
+ };
8
+
9
+ const Template = args => /*#__PURE__*/React.createElement(SearchInput, args);
10
+
11
+ export const Basic = Template.bind({});
12
+ Basic.args = {
13
+ textColor: theme.colors.enterDarkGrey,
14
+ borderColor: theme.colors.enterMediumGrey,
15
+ placeholder: 'Search'
16
+ };
@@ -3,5 +3,5 @@ declare type Props = {
3
3
  color?: string;
4
4
  rotateDeg: number;
5
5
  };
6
- export declare const Caret: FunctionComponent<Props>;
6
+ export declare const CaretIcon: FunctionComponent<Props>;
7
7
  export {};
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { colors } from '../../lib/theme';
3
- export const Caret = ({
3
+ export const CaretIcon = ({
4
4
  color = colors.enterDarkGrey,
5
5
  rotateDeg = 0
6
6
  }) => {
@@ -1,11 +1,11 @@
1
1
  import React from 'react';
2
- import { Caret } from './caret';
2
+ import { CaretIcon } from './caret-icon';
3
3
  export default {
4
4
  title: 'Icons/Caret',
5
- component: Caret
5
+ component: CaretIcon
6
6
  };
7
7
 
8
- const Template = args => /*#__PURE__*/React.createElement(Caret, args);
8
+ const Template = args => /*#__PURE__*/React.createElement(CaretIcon, args);
9
9
 
10
10
  export const Basic = Template.bind({});
11
11
  Basic.args = {};
@@ -1,7 +1,13 @@
1
1
  export { Input } from './form-elements/input';
2
2
  export { Label } from './form-elements/label';
3
+ export { SearchInput } from './form-elements/search-input';
3
4
  export { SegmentedControl } from './form-elements/segmented-control';
5
+ export { AddGuestIcon } from './icons/add-guest-icon';
6
+ export { CaretIcon } from './icons/caret-icon';
7
+ export { FilterIcon } from './icons/filter-icon';
8
+ export { SearchIcon } from './icons/search-icon';
4
9
  export { SettingsIcon } from './icons/settings-icon';
10
+ export { SortListIcon } from './icons/sort-list-icon';
5
11
  export { Button } from './button';
6
12
  export { CheckinCountIndicator } from './checkin-count-indicator';
7
13
  export { CheckinProgressBar } from './checkin-progress-bar';
package/dist/ui/index.js CHANGED
@@ -1,7 +1,13 @@
1
1
  export { Input } from './form-elements/input';
2
2
  export { Label } from './form-elements/label';
3
+ export { SearchInput } from './form-elements/search-input';
3
4
  export { SegmentedControl } from './form-elements/segmented-control';
5
+ export { AddGuestIcon } from './icons/add-guest-icon';
6
+ export { CaretIcon } from './icons/caret-icon';
7
+ export { FilterIcon } from './icons/filter-icon';
8
+ export { SearchIcon } from './icons/search-icon';
4
9
  export { SettingsIcon } from './icons/settings-icon';
10
+ export { SortListIcon } from './icons/sort-list-icon';
5
11
  export { Button } from './button';
6
12
  export { CheckinCountIndicator } from './checkin-count-indicator';
7
13
  export { CheckinProgressBar } from './checkin-progress-bar';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dev-crew-berlin/enter-js-utils",
3
- "version": "0.31.0",
3
+ "version": "0.32.0",
4
4
  "description": "utils such as vaildation and other helpers to work with data from the enter app",
5
5
  "files": [
6
6
  "dist",
@@ -44,14 +44,14 @@
44
44
  "@babel/preset-react": "^7.17.12",
45
45
  "@babel/preset-typescript": "^7.17.12",
46
46
  "@liangskyli/openapi-typescript": "^5.4.1",
47
- "@storybook/addon-actions": "^6.5.13",
48
- "@storybook/addon-essentials": "^6.5.13",
49
- "@storybook/addon-interactions": "^6.5.13",
50
- "@storybook/addon-links": "^6.5.13",
51
- "@storybook/builder-webpack4": "^6.5.8",
52
- "@storybook/manager-webpack4": "^6.5.8",
53
- "@storybook/react": "^6.5.13",
54
- "@storybook/testing-library": "^0.0.11",
47
+ "@storybook/addon-actions": "^6.5.15",
48
+ "@storybook/addon-essentials": "^6.5.15",
49
+ "@storybook/addon-interactions": "^6.5.15",
50
+ "@storybook/addon-links": "^6.5.15",
51
+ "@storybook/builder-webpack4": "^6.5.15",
52
+ "@storybook/manager-webpack4": "^6.5.15",
53
+ "@storybook/react": "^6.5.15",
54
+ "@storybook/testing-library": "^0.0.13",
55
55
  "@types/node": "^17.0.38",
56
56
  "@types/react": "^18.0.10",
57
57
  "@types/react-dom": "^18.0.5",