@dev-crew-berlin/enter-js-utils 0.2.3 → 0.3.3

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/README.md CHANGED
@@ -1 +1,11 @@
1
1
  # js utils
2
+
3
+ ## lib
4
+
5
+ Some common helper functions and types.
6
+ This also contains the dcb colors.
7
+
8
+ ## ui
9
+
10
+ react ui components for enter and dcb apps.
11
+ see: https://js-utils-main.mrdcb.vercel.app
@@ -1 +1,2 @@
1
1
  export * from './result';
2
+ export * as theme from './theme';
package/dist/lib/index.js CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from './result';
2
+ export * as theme from './theme';
2
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,OAAO,KAAK,KAAK,MAAM,SAAS,CAAA"}
@@ -0,0 +1,18 @@
1
+ export declare const colors: {
2
+ enterDarkGrey: string;
3
+ enterLightGrey: string;
4
+ enterMediumGrey: string;
5
+ enterGrey: string;
6
+ enterBackground: string;
7
+ enterModalBackground: string;
8
+ enterError: string;
9
+ enterRed: string;
10
+ enterCyan: string;
11
+ enterGreen: string;
12
+ enterYellow: string;
13
+ enterPink: string;
14
+ };
15
+ export declare const fonts: {
16
+ primary: string;
17
+ secondary: string;
18
+ };
@@ -0,0 +1,19 @@
1
+ export var colors = {
2
+ enterDarkGrey: '#483E47',
3
+ enterLightGrey: '#EEE',
4
+ enterMediumGrey: '#A09999',
5
+ enterGrey: '#D8D8D8',
6
+ enterBackground: '#F8FAFB',
7
+ enterModalBackground: '#FFFEFC',
8
+ enterError: '#CE1E3D',
9
+ enterRed: '#FF5555',
10
+ enterCyan: '#74ACBC',
11
+ enterGreen: '#89B859',
12
+ enterYellow: '#E7C700',
13
+ enterPink: '#E66084',
14
+ };
15
+ export var fonts = {
16
+ primary: 'PTSans, sans-serif',
17
+ secondary: 'Iosevka monospaced',
18
+ };
19
+ //# sourceMappingURL=theme.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.js","sourceRoot":"","sources":["../../src/lib/theme.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,IAAM,MAAM,GAAG;IACpB,aAAa,EAAE,SAAS;IACxB,cAAc,EAAE,MAAM;IACtB,eAAe,EAAE,SAAS;IAC1B,SAAS,EAAE,SAAS;IACpB,eAAe,EAAE,SAAS;IAC1B,oBAAoB,EAAE,SAAS;IAC/B,UAAU,EAAE,SAAS;IACrB,QAAQ,EAAE,SAAS;IACnB,SAAS,EAAE,SAAS;IACpB,UAAU,EAAE,SAAS;IACrB,WAAW,EAAE,SAAS;IACtB,SAAS,EAAE,SAAS;CACrB,CAAA;AAED,MAAM,CAAC,IAAM,KAAK,GAAG;IACnB,OAAO,EAAE,oBAAoB;IAC7B,SAAS,EAAE,oBAAoB;CAChC,CAAA"}
@@ -1,10 +1,16 @@
1
1
  import { FunctionComponent } from 'react';
2
- declare type Checkin = {
2
+ import 'styled-jsx';
3
+ export declare type Checkin = {
3
4
  id: string;
4
5
  time: Date;
5
6
  };
6
7
  declare type Props = {
7
- checkins: [Checkin];
8
+ checkins: Checkin[];
9
+ didRespond: true;
10
+ rsvpCount: number;
11
+ } | {
12
+ checkins: Checkin[];
13
+ didRespond: false;
8
14
  };
9
15
  export declare const CheckinCountIndicator: FunctionComponent<Props>;
10
16
  export {};
@@ -1,5 +1,52 @@
1
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
2
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
3
+ if (ar || !(i in from)) {
4
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
5
+ ar[i] = from[i];
6
+ }
7
+ }
8
+ return to.concat(ar || Array.prototype.slice.call(from));
9
+ };
1
10
  import React from 'react';
11
+ import { colors, fonts } from '../lib/theme';
12
+ import 'styled-jsx';
13
+ var CHUNK_SIZE = 5;
2
14
  export var CheckinCountIndicator = function (props) {
3
- return React.createElement("div", null, "hello");
15
+ var checkinCount = props.checkins.length;
16
+ var hasCheckins = checkinCount > 0;
17
+ var didRsvp = props.didRespond;
18
+ var rsvpCount = props.didRespond ? props.rsvpCount : 0;
19
+ var rsvpsWithoutCheckin = rsvpCount > checkinCount ? rsvpCount - checkinCount : 0;
20
+ var checkinsAndRsvp = __spreadArray(__spreadArray([], props.checkins, true), Array.from({ length: rsvpsWithoutCheckin }, function () { return 'rsvp'; }), true);
21
+ var chunked = [];
22
+ for (var i = 0; i < checkinsAndRsvp.length; i += CHUNK_SIZE) {
23
+ var chunk = checkinsAndRsvp.slice(i, i + CHUNK_SIZE);
24
+ chunked.push(chunk);
25
+ }
26
+ var text = getText({ checkinCount: checkinCount, rsvpCount: rsvpCount, didRsvp: didRsvp });
27
+ return (React.createElement("div", { className: 'checkin-count-indicator' },
28
+ didRsvp && rsvpCount == 0 && !hasCheckins ? (React.createElement("div", { className: 'box-wrapper' },
29
+ React.createElement("span", { className: 'decline-box' }, "\u00D7"),
30
+ React.createElement("span", { className: 'text' }, "Declined"))) : (React.createElement("div", { className: "box-wrapper ".concat(chunked.length > 1 ? 'multiple-chunks' : '', " ") },
31
+ chunked.map(function (chunk, idx) { return (React.createElement("div", { key: idx, className: 'chunk' }, chunk.map(function (checkinOrRsvp, idx) {
32
+ return typeof checkinOrRsvp === 'string' ? (React.createElement("span", { key: idx, className: 'rsvp' })) : (React.createElement("span", { key: idx, className: 'checkin', "data-toggle": 'tooltip', title: checkinOrRsvp.time.toLocaleString() }));
33
+ }))); }),
34
+ text && React.createElement("span", { className: 'text' }, text))),
35
+ React.createElement("style", { jsx: true }, "\n .checkin-count-indicator {\n font-family: ".concat(fonts.primary, ";\n }\n\n .text {\n color: ").concat(colors.enterDarkGrey, ";\n text-transform: uppercase;\n font-size: 10px;\n line-height: 15px;\n font-weight: bold;\n white-space: nowrap;\n width: 100%;\n margin-top: 0.2em;\n }\n\n .text:nth-child(2) {\n width: auto;\n margin-top: 0;\n }\n\n .box-wrapper {\n display: flex;\n min-width: 100px;\n }\n .box-wrapper.multiple-chunks {\n flex-flow: wrap;\n }\n\n .chunk {\n display: flex;\n margin-right: 5px;\n margin-bottom: 4px;\n width: 95px;\n white-space: nowrap;\n }\n\n .chunk:first-of-type.chunk:last-of-type {\n width: auto;\n margin-right: 2px;\n }\n\n .checkin,\n .rsvp,\n .decline-box {\n box-sizing: border-box;\n display: flex;\n justify-content: center;\n align-items: center;\n font-size: 120%;\n width: 15px;\n height: 15px;\n border-radius: 2px;\n border: 3px solid ").concat(colors.enterGreen, ";\n margin: 0 4px 0 0;\n vertical-align: middle;\n color: white;\n }\n\n .checkin {\n background-color: ").concat(colors.enterGreen, ";\n }\n\n .decline-box {\n background-color: ").concat(colors.enterError, ";\n border-color: ").concat(colors.enterError, ";\n }\n "))));
4
36
  };
37
+ function getText(args) {
38
+ if (args.checkinCount === 1 && args.rsvpCount === 1) {
39
+ return 'checked in';
40
+ }
41
+ if (args.checkinCount > 0) {
42
+ return "".concat(args.checkinCount, " / ").concat(args.rsvpCount, " Checkins");
43
+ }
44
+ if (args.rsvpCount == 1) {
45
+ return 'Confirmed';
46
+ }
47
+ if (args.rsvpCount > 0) {
48
+ return "".concat(args.rsvpCount, " Confirmations");
49
+ }
50
+ return 'no response';
51
+ }
5
52
  //# sourceMappingURL=checkin-count-indicator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"checkin-count-indicator.js","sourceRoot":"","sources":["../../src/ui/checkin-count-indicator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAA;AAMhD,MAAM,CAAC,IAAM,qBAAqB,GAA6B,UAAC,KAAK;IACnE,OAAO,yCAAgB,CAAA;AACzB,CAAC,CAAA"}
1
+ {"version":3,"file":"checkin-count-indic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AAC,SAAS,KAAK,CAAC,EAAE;QACnD,OAAO,YAAY,CAAA;KACpB;IACD,IAAI,IAAI,CAAC,YAAY,GAAG,CAAC,EAAE;QACzB,OAAO,UAAG,IAAI,CAAC,YAAY,gBAAM,IAAI,CAAC,SAAS,cAAW,CAAA;KAC3D;IACD,IAAI,IAAI,CAAC,SAAS,IAAI,CAAC,EAAE;QACvB,OAAO,WAAW,CAAA;KACnB;IACD,IAAI,IAAI,CAAC,SAAS,GAAG,CAAC,EAAE;QACtB,OAAO,UAAG,IAAI,CAAC,SAAS,mBAAgB,CAAA;KACzC;IACD,OAAO,aAAa,CAAA;AACtB,CAAC"}
@@ -0,0 +1,84 @@
1
+ import React from 'react';
2
+ import { ComponentStory, ComponentMeta } from '@storybook/react';
3
+ import { Checkin } from './checkin-count-indicator';
4
+ declare const _default: ComponentMeta<React.FunctionComponent<{
5
+ checkins: Checkin[];
6
+ didRespond: true;
7
+ rsvpCount: number;
8
+ } | {
9
+ checkins: Checkin[];
10
+ didRespond: false;
11
+ }>>;
12
+ export default _default;
13
+ export declare const SingleResponse: ComponentStory<React.FunctionComponent<{
14
+ checkins: Checkin[];
15
+ didRespond: true;
16
+ rsvpCount: number;
17
+ } | {
18
+ checkins: Checkin[];
19
+ didRespond: false;
20
+ }>>;
21
+ export declare const Decline: ComponentStory<React.FunctionComponent<{
22
+ checkins: Checkin[];
23
+ didRespond: true;
24
+ rsvpCount: number;
25
+ } | {
26
+ checkins: Checkin[];
27
+ didRespond: false;
28
+ }>>;
29
+ export declare const NoResponse: ComponentStory<React.FunctionComponent<{
30
+ checkins: Checkin[];
31
+ didRespond: true;
32
+ rsvpCount: number;
33
+ } | {
34
+ checkins: Checkin[];
35
+ didRespond: false;
36
+ }>>;
37
+ export declare const MultipleResponses: ComponentStory<React.FunctionComponent<{
38
+ checkins: Checkin[];
39
+ didRespond: true;
40
+ rsvpCount: number;
41
+ } | {
42
+ checkins: Checkin[];
43
+ didRespond: false;
44
+ }>>;
45
+ export declare const CheckinAndResponse: ComponentStory<React.FunctionComponent<{
46
+ checkins: Checkin[];
47
+ didRespond: true;
48
+ rsvpCount: number;
49
+ } | {
50
+ checkins: Checkin[];
51
+ didRespond: false;
52
+ }>>;
53
+ export declare const MultipleCheckinsAndResponse: ComponentStory<React.FunctionComponent<{
54
+ checkins: Checkin[];
55
+ didRespond: true;
56
+ rsvpCount: number;
57
+ } | {
58
+ checkins: Checkin[];
59
+ didRespond: false;
60
+ }>>;
61
+ export declare const CheckinsWithDecline: ComponentStory<React.FunctionComponent<{
62
+ checkins: Checkin[];
63
+ didRespond: true;
64
+ rsvpCount: number;
65
+ } | {
66
+ checkins: Checkin[];
67
+ didRespond: false;
68
+ }>>;
69
+ export declare const CheckinWithoutResponse: ComponentStory<React.FunctionComponent<{
70
+ checkins: Checkin[];
71
+ didRespond: true;
72
+ rsvpCount: number;
73
+ } | {
74
+ checkins: Checkin[];
75
+ didRespond: false;
76
+ }>>;
77
+ export declare const MultipleCheckins: ComponentStory<React.FunctionComponent<{
78
+ checkins: Checkin[];
79
+ didRespond: true;
80
+ rsvpCount: number;
81
+ } | {
82
+ checkins: Checkin[];
83
+ didRespond: false;
84
+ }>>;
@@ -0,0 +1,54 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import React from 'react';
13
+ import { CheckinCountIndicator } from './checkin-count-indicator';
14
+ export default {
15
+ title: 'Checkin-Count Indicator',
16
+ component: CheckinCountIndicator,
17
+ };
18
+ var exampleCheckin = { id: 'dummy-id', time: new Date('2022-01-01') };
19
+ var Template = function (args) { return (React.createElement(CheckinCountIndicator, __assign({}, args))); };
20
+ export var SingleResponse = Template.bind({});
21
+ SingleResponse.args = { checkins: [], didRespond: true, rsvpCount: 1 };
22
+ export var Decline = Template.bind({});
23
+ Decline.args = { checkins: [], didRespond: true, rsvpCount: 0 };
24
+ export var NoResponse = Template.bind({});
25
+ NoResponse.args = { checkins: [], didRespond: false };
26
+ export var MultipleResponses = Template.bind({});
27
+ MultipleResponses.args = { checkins: [], didRespond: true, rsvpCount: 16 };
28
+ export var CheckinAndResponse = Template.bind({});
29
+ CheckinAndResponse.args = {
30
+ checkins: [exampleCheckin],
31
+ didRespond: true,
32
+ rsvpCount: 1,
33
+ };
34
+ export var MultipleCheckinsAndResponse = Template.bind({});
35
+ MultipleCheckinsAndResponse.args = {
36
+ checkins: [exampleCheckin, exampleCheckin],
37
+ didRespond: true,
38
+ rsvpCount: 1,
39
+ };
40
+ export var CheckinsWithDecline = Template.bind({});
41
+ CheckinsWithDecline.args = {
42
+ checkins: [exampleCheckin],
43
+ didRespond: true,
44
+ rsvpCount: 0,
45
+ };
46
+ export var CheckinWithoutResponse = Template.bind({});
47
+ CheckinWithoutResponse.args = { checkins: [exampleCheckin], didRespond: false };
48
+ export var MultipleCheckins = Template.bind({});
49
+ MultipleCheckins.args = {
50
+ checkins: [exampleCheckin, exampleCheckin, exampleCheckin, exampleCheckin],
51
+ didRespond: true,
52
+ rsvpCount: 2,
53
+ };
54
+ //# sourceMappingURL=checkin-count-indicator.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkin-count-indicator.stories.js","sourceRoot":"","sources":["../../src/ui/checkin-count-indicator.stories.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAW,qBAAqB,EAAE,MAAM,2BAA2B,CAAA;AAE1E,eAAe;IACb,KAAK,EAAE,yBAAyB;IAChC,SAAS,EAAE,qBAAqB;CACc,CAAA;AAEhD,IAAM,cAAc,GAAY,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,IAAI,CAAC,YAAY,CAAC,EAAE,CA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AAC,cAAc,EAAE,cAAc,CAAC;IAC1C,UAAU,EAAE,IAAI;IAChB,SAAS,EAAE,CAAC;CACb,CAAA;AAED,MAAM,CAAC,IAAM,mBAAmB,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AACpD,mBAAmB,CAAC,IAAI,GAAG;IACzB,QAAQ,EAAE,CAAC,cAAc,CAAC;IAC1B,UAAU,EAAE,IAAI;IAChB,SAAS,EAAE,CAAC;CACb,CAAA;AAED,MAAM,CAAC,IAAM,sBAAsB,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AACvD,sBAAsB,CAAC,IAAI,GAAG,EAAE,QAAQ,EAAE,CAAC,cAAc,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,CAAA;AAE/E,MAAM,CAAC,IAAM,gBAAgB,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AACjD,gBAAgB,CAAC,IAAI,GAAG;IACtB,QAAQ,EAAE,CAAC,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,CAAC;IAC1E,UAAU,EAAE,IAAI;IAChB,SAAS,EAAE,CAAC;CACb,CAAA"}
package/lib.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './dist/lib'
package/lib.js ADDED
@@ -0,0 +1 @@
1
+ export * from './dist/lib'
package/package.json CHANGED
@@ -1,17 +1,36 @@
1
1
  {
2
2
  "name": "@dev-crew-berlin/enter-js-utils",
3
- "version": "0.2.3",
3
+ "version": "0.3.3",
4
4
  "description": "utils such as vaildation and other helpers to work with data from the enter app",
5
5
  "files": [
6
6
  "dist",
7
- "README.md"
7
+ "README.md",
8
+ "lib.js",
9
+ "lib.d.ts",
10
+ "ui.js",
11
+ "ui.d.ts"
8
12
  ],
13
+ "targets": {
14
+ "lib": {
15
+ "source": "src/lib/index.ts",
16
+ "outputFormat": "esmodule",
17
+ "isLibrary": true,
18
+ "includeNodeModules": false
19
+ },
20
+ "ui": {
21
+ "source": "src/ui/index.ts",
22
+ "outputFormat": "esmodule",
23
+ "isLibrary": true,
24
+ "includeNodeModules": false
25
+ }
26
+ },
9
27
  "scripts": {
10
28
  "prepare": "husky install && npm run build",
11
- "build": "rm -rf dist && tsc",
12
- "dev": "tsc -w",
29
+ "build": "rm -r dist & parcel build && tsc -d",
13
30
  "lint": "eslint src/ --ext .ts",
14
- "test": "echo \"Error: no test specified\" && exit 1"
31
+ "test": "echo \"Error: no test specified\" && exit 1",
32
+ "storybook": "start-storybook -p 6006",
33
+ "build-storybook": "build-storybook"
15
34
  },
16
35
  "lint-staged": {
17
36
  "**/*": "prettier --write --ignore-unknown"
@@ -27,19 +46,38 @@
27
46
  },
28
47
  "homepage": "https://gitlab.com/dcb-enter/js-utils#readme",
29
48
  "devDependencies": {
49
+ "@babel/core": "^7.18.2",
50
+ "@parcel/packager-ts": "^2.6.0",
51
+ "@parcel/transformer-typescript-tsc": "^2.6.0",
52
+ "@parcel/transformer-typescript-types": "^2.6.0",
53
+ "@storybook/addon-actions": "^6.5.8",
54
+ "@storybook/addon-essentials": "^6.5.8",
55
+ "@storybook/addon-interactions": "^6.5.8",
56
+ "@storybook/addon-links": "^6.5.8",
57
+ "@storybook/builder-webpack4": "^6.5.8",
58
+ "@storybook/manager-webpack4": "^6.5.8",
59
+ "@storybook/react": "^6.5.8",
60
+ "@storybook/testing-library": "^0.0.11",
30
61
  "@types/node": "^17.0.38",
31
62
  "@types/react": "^18.0.10",
63
+ "@types/react-dom": "^18.0.5",
64
+ "babel-loader": "^8.2.5",
32
65
  "eslint": "^8.16.0",
33
66
  "eslint-config-prettier": "^8.5.0",
34
67
  "husky": "^7.0.1",
68
+ "parcel": "^2.6.0",
35
69
  "prettier": "^2.6.2",
36
70
  "react": "^18.1.0",
37
- "typescript": "^4.7.2"
71
+ "react-dom": "^18.1.0",
72
+ "typescript": "^4.7.3"
38
73
  },
39
74
  "peerDependencies": {
40
- "react": "^17.0.0 || ^18.1.0"
75
+ "react": "^17.0.0 || ^18.1.0",
76
+ "react-dom": "^17.0.0 || ^18.1.0"
41
77
  },
42
78
  "dependencies": {
43
- "@typescript-eslint/eslint-plugin": "^5.27.0"
79
+ "@typescript-eslint/eslint-plugin": "^5.27.0",
80
+ "@typescript-eslint/parser": "^5.27.0",
81
+ "styled-jsx": "^5.0.2"
44
82
  }
45
83
  }
package/ui.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from 'dist/ui/'
package/ui.js ADDED
@@ -0,0 +1 @@
1
+ export * from 'dist/ui/'