@dev-crew-berlin/enter-js-utils 0.70.2 → 0.80.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/README.md +1 -1
- package/dist/api-client/api-base.d.ts +11 -5
- package/dist/api-client/api-base.js +13 -12
- package/dist/api-client/index.d.ts +20 -20
- package/dist/api-client/index.js +38 -38
- package/dist/generated/api-schema.d.ts +208 -20
- package/dist/lib/result.js +0 -1
- package/dist/models/attendee.d.ts +16 -15
- package/dist/models/attendee.js +43 -25
- package/dist/models/branch.d.ts +9 -0
- package/dist/models/branch.js +7 -0
- package/dist/models/checkin-counter.d.ts +2 -0
- package/dist/models/checkin-counter.js +1 -0
- package/dist/models/checkin.d.ts +5 -2
- package/dist/models/checkin.js +4 -1
- package/dist/models/checkins.d.ts +2 -2
- package/dist/models/checkins.js +6 -6
- package/dist/models/event.d.ts +2 -1
- package/dist/models/field.d.ts +9 -0
- package/dist/models/index.d.ts +3 -0
- package/dist/models/index.js +1 -0
- package/dist/models/instance.d.ts +2 -1
- package/dist/models/instance.js +6 -3
- package/dist/models/rsvp.d.ts +3 -2
- package/dist/models/rsvp.js +7 -4
- package/dist/ui/button.js +7 -6
- package/dist/ui/button.stories.d.ts +16 -59
- package/dist/ui/button.stories.js +66 -54
- package/dist/ui/checkin-count-indicator.stories.d.ts +14 -84
- package/dist/ui/checkin-count-indicator.stories.js +60 -52
- package/dist/ui/checkin-progress-bar.js +11 -11
- package/dist/ui/checkin-progress-bar.stories.d.ts +12 -59
- package/dist/ui/checkin-progress-bar.stories.js +45 -39
- package/dist/ui/companion-info.js +6 -6
- package/dist/ui/companion-info.stories.d.ts +8 -44
- package/dist/ui/companion-info.stories.js +29 -27
- package/dist/ui/enter-logo.js +2 -2
- package/dist/ui/enter-logo.stories.d.ts +7 -12
- package/dist/ui/enter-logo.stories.js +11 -12
- package/dist/ui/form-elements/input.js +6 -6
- package/dist/ui/form-elements/input.stories.d.ts +8 -15
- package/dist/ui/form-elements/input.stories.js +26 -24
- package/dist/ui/form-elements/label.js +6 -6
- package/dist/ui/form-elements/label.stories.d.ts +6 -5
- package/dist/ui/form-elements/label.stories.js +6 -6
- package/dist/ui/form-elements/search-input.js +10 -10
- package/dist/ui/form-elements/search-input.stories.d.ts +7 -18
- package/dist/ui/form-elements/search-input.stories.js +18 -17
- package/dist/ui/form-elements/segmented-control.js +8 -8
- package/dist/ui/form-elements/segmented-control.stories.d.ts +6 -17
- package/dist/ui/form-elements/segmented-control.stories.js +7 -7
- package/dist/ui/guest-card.d.ts +2 -1
- package/dist/ui/guest-card.js +17 -16
- package/dist/ui/guest-card.stories.d.ts +14 -124
- package/dist/ui/guest-card.stories.js +93 -76
- package/dist/ui/icons/add-guest-icon.stories.d.ts +7 -12
- package/dist/ui/icons/add-guest-icon.stories.js +11 -12
- package/dist/ui/icons/caret-icon.stories.d.ts +7 -15
- package/dist/ui/icons/caret-icon.stories.js +11 -12
- package/dist/ui/icons/filter-icon.stories.d.ts +7 -12
- package/dist/ui/icons/filter-icon.stories.js +11 -12
- package/dist/ui/icons/search-icon.stories.d.ts +7 -12
- package/dist/ui/icons/search-icon.stories.js +11 -12
- package/dist/ui/icons/settings-icon.stories.d.ts +7 -12
- package/dist/ui/icons/settings-icon.stories.js +11 -12
- package/dist/ui/icons/sort-list-icon.stories.d.ts +7 -15
- package/dist/ui/icons/sort-list-icon.stories.js +11 -12
- package/dist/ui/tag.js +5 -5
- package/dist/ui/tag.stories.d.ts +6 -9
- package/dist/ui/tag.stories.js +6 -6
- package/package.json +18 -17
|
@@ -1,31 +1,33 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { Input } from './input';
|
|
3
|
-
|
|
2
|
+
const meta = {
|
|
4
3
|
title: 'Form Elements/Input',
|
|
5
4
|
component: Input
|
|
6
5
|
};
|
|
7
|
-
|
|
8
|
-
export const Basic =
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
6
|
+
export default meta;
|
|
7
|
+
export const Basic = {
|
|
8
|
+
args: {
|
|
9
|
+
type: 'text',
|
|
10
|
+
label: 'Text input',
|
|
11
|
+
placeholder: 'Enter text here',
|
|
12
|
+
value: '',
|
|
13
|
+
onClick: () => undefined
|
|
14
|
+
}
|
|
15
15
|
};
|
|
16
|
-
export const NumberInput =
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
export const NumberInput = {
|
|
17
|
+
args: {
|
|
18
|
+
type: 'number',
|
|
19
|
+
label: 'Number input',
|
|
20
|
+
placeholder: 'Enter number here',
|
|
21
|
+
value: '',
|
|
22
|
+
onClick: () => undefined
|
|
23
|
+
}
|
|
23
24
|
};
|
|
24
|
-
export const WithValue =
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
25
|
+
export const WithValue = {
|
|
26
|
+
args: {
|
|
27
|
+
type: 'text',
|
|
28
|
+
label: 'Text input',
|
|
29
|
+
placeholder: 'Enter text here',
|
|
30
|
+
value: 'Text value',
|
|
31
|
+
onClick: () => undefined
|
|
32
|
+
}
|
|
31
33
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import _JSXStyle from "styled-jsx/style";
|
|
2
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
2
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
3
|
import React from 'react';
|
|
4
|
-
import {
|
|
4
|
+
import { colors, fonts } from '../../lib/theme';
|
|
5
5
|
export const Label = props => {
|
|
6
6
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("label", _extends({}, props, {
|
|
7
|
-
className: _JSXStyle.dynamic([["
|
|
7
|
+
className: _JSXStyle.dynamic([["1684173836", [fonts.secondary, colors.enterDarkGrey]]]) + " " + (props && props.className != null && props.className || "")
|
|
8
8
|
}), props.children), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
9
|
-
id: "
|
|
10
|
-
dynamic: [
|
|
11
|
-
}, `label.__jsx-style-dynamic-selector{display:block;font-family:${
|
|
9
|
+
id: "1684173836",
|
|
10
|
+
dynamic: [fonts.secondary, colors.enterDarkGrey]
|
|
11
|
+
}, `label.__jsx-style-dynamic-selector{display:block;font-family:${fonts.secondary};font-weight:400;font-size:0.9em;color:${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;}`));
|
|
12
12
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
declare const
|
|
4
|
-
export default
|
|
5
|
-
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Label } from './label';
|
|
3
|
+
declare const meta: Meta<typeof Label>;
|
|
4
|
+
export default meta;
|
|
5
|
+
declare type Story = StoryObj<typeof Label>;
|
|
6
|
+
export declare const Basic: Story;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { Label } from './label';
|
|
3
|
-
|
|
2
|
+
const meta = {
|
|
4
3
|
title: 'Form Elements/Label',
|
|
5
4
|
component: Label
|
|
6
5
|
};
|
|
7
|
-
|
|
8
|
-
export const Basic =
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
export default meta;
|
|
7
|
+
export const Basic = {
|
|
8
|
+
args: {
|
|
9
|
+
children: 'Label text'
|
|
10
|
+
}
|
|
11
11
|
};
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import _JSXStyle from "styled-jsx/style";
|
|
2
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
2
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
3
|
import React, { useId } from 'react';
|
|
4
|
-
import {
|
|
4
|
+
import { colors, fonts } from '../../lib/theme';
|
|
5
5
|
import { SearchIcon } from '../icons/search-icon';
|
|
6
6
|
export const SearchInput = ({
|
|
7
|
-
textColor =
|
|
8
|
-
borderColor =
|
|
7
|
+
textColor = colors.enterDarkGrey,
|
|
8
|
+
borderColor = colors.enterMediumGrey,
|
|
9
9
|
placeholder = 'Search',
|
|
10
10
|
...props
|
|
11
11
|
}) => {
|
|
12
12
|
const id = useId();
|
|
13
13
|
return /*#__PURE__*/React.createElement("div", {
|
|
14
|
-
className: _JSXStyle.dynamic([["
|
|
14
|
+
className: _JSXStyle.dynamic([["1969077888", [fonts.primary, textColor, borderColor, colors.enterRed]]]) + " " + 'search-input'
|
|
15
15
|
}, /*#__PURE__*/React.createElement("div", {
|
|
16
|
-
className: _JSXStyle.dynamic([["
|
|
16
|
+
className: _JSXStyle.dynamic([["1969077888", [fonts.primary, textColor, borderColor, colors.enterRed]]]) + " " + 'icon'
|
|
17
17
|
}, /*#__PURE__*/React.createElement(SearchIcon, {
|
|
18
18
|
color: textColor
|
|
19
19
|
})), /*#__PURE__*/React.createElement("input", _extends({}, props, {
|
|
20
20
|
placeholder: placeholder,
|
|
21
21
|
id: id,
|
|
22
|
-
className: _JSXStyle.dynamic([["
|
|
22
|
+
className: _JSXStyle.dynamic([["1969077888", [fonts.primary, textColor, borderColor, colors.enterRed]]]) + " " + (props && props.className != null && props.className || "")
|
|
23
23
|
})), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
24
|
-
id: "
|
|
25
|
-
dynamic: [
|
|
26
|
-
}, `.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:16px;margin:0 0 0 0.2em;}input.__jsx-style-dynamic-selector{grid-area:icon-input;font-family:${
|
|
24
|
+
id: "1969077888",
|
|
25
|
+
dynamic: [fonts.primary, textColor, borderColor, colors.enterRed]
|
|
26
|
+
}, `.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:16px;margin:0 0 0 0.2em;}input.__jsx-style-dynamic-selector{grid-area:icon-input;font-family:${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:${colors.enterRed};}`));
|
|
27
27
|
};
|
|
@@ -1,18 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
declare const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export default _default;
|
|
9
|
-
export declare const Basic: ComponentStory<React.FunctionComponent<React.InputHTMLAttributes<HTMLInputElement> & {
|
|
10
|
-
textColor?: string | undefined;
|
|
11
|
-
borderColor?: string | undefined;
|
|
12
|
-
placeholder?: string | undefined;
|
|
13
|
-
}>>;
|
|
14
|
-
export declare const WhiteText: ComponentStory<React.FunctionComponent<React.InputHTMLAttributes<HTMLInputElement> & {
|
|
15
|
-
textColor?: string | undefined;
|
|
16
|
-
borderColor?: string | undefined;
|
|
17
|
-
placeholder?: string | undefined;
|
|
18
|
-
}>>;
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { SearchInput } from './search-input';
|
|
3
|
+
declare const meta: Meta<typeof SearchInput>;
|
|
4
|
+
export default meta;
|
|
5
|
+
declare type Story = StoryObj<typeof SearchInput>;
|
|
6
|
+
export declare const Basic: Story;
|
|
7
|
+
export declare const WhiteText: Story;
|
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { SearchInput } from './search-input';
|
|
3
|
-
import {
|
|
4
|
-
|
|
2
|
+
import { colors } from '../../lib/theme';
|
|
3
|
+
const meta = {
|
|
5
4
|
title: 'Form Elements/SearchInput',
|
|
6
5
|
component: SearchInput
|
|
7
6
|
};
|
|
8
|
-
|
|
9
|
-
export const Basic =
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
};
|
|
15
|
-
export const WhiteText = Template.bind({});
|
|
16
|
-
WhiteText.parameters = {
|
|
17
|
-
backgrounds: {
|
|
18
|
-
default: 'dark'
|
|
7
|
+
export default meta;
|
|
8
|
+
export const Basic = {
|
|
9
|
+
args: {
|
|
10
|
+
textColor: colors.enterDarkGrey,
|
|
11
|
+
borderColor: colors.enterMediumGrey,
|
|
12
|
+
placeholder: 'Search'
|
|
19
13
|
}
|
|
20
14
|
};
|
|
21
|
-
WhiteText
|
|
22
|
-
|
|
23
|
-
|
|
15
|
+
export const WhiteText = {
|
|
16
|
+
parameters: {
|
|
17
|
+
backgrounds: {
|
|
18
|
+
default: 'dark'
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
args: {
|
|
22
|
+
textColor: 'white',
|
|
23
|
+
borderColor: 'white'
|
|
24
|
+
}
|
|
24
25
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import _JSXStyle from "styled-jsx/style";
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { colors, fonts } from '../../lib/theme';
|
|
4
4
|
export const SegmentedControl = props => {
|
|
5
5
|
const name = props.segments.join('');
|
|
6
6
|
return /*#__PURE__*/React.createElement("div", {
|
|
7
|
-
className: _JSXStyle.dynamic([["
|
|
7
|
+
className: _JSXStyle.dynamic([["2098643240", [fonts.secondary, colors.enterLightGrey, colors.enterMediumGrey, colors.enterDarkGrey]]]) + " " + 'segmented-controll'
|
|
8
8
|
}, props.segments.map((segment, index) => /*#__PURE__*/React.createElement("div", {
|
|
9
9
|
key: segment,
|
|
10
|
-
className: _JSXStyle.dynamic([["
|
|
10
|
+
className: _JSXStyle.dynamic([["2098643240", [fonts.secondary, colors.enterLightGrey, colors.enterMediumGrey, colors.enterDarkGrey]]]) + " " + 'segment'
|
|
11
11
|
}, /*#__PURE__*/React.createElement("input", {
|
|
12
12
|
type: "radio",
|
|
13
13
|
id: segment,
|
|
@@ -15,15 +15,15 @@ export const SegmentedControl = props => {
|
|
|
15
15
|
checked: segment === props.activeSegment,
|
|
16
16
|
onChange: () => props.onChange(segment),
|
|
17
17
|
onFocus: props.onFocus,
|
|
18
|
-
className: _JSXStyle.dynamic([["
|
|
18
|
+
className: _JSXStyle.dynamic([["2098643240", [fonts.secondary, colors.enterLightGrey, colors.enterMediumGrey, colors.enterDarkGrey]]])
|
|
19
19
|
}), /*#__PURE__*/React.createElement("label", {
|
|
20
20
|
htmlFor: segment,
|
|
21
21
|
style: props.colors && {
|
|
22
22
|
backgroundColor: props.colors[index] && segment === props.activeSegment ? props.colors[index] : undefined
|
|
23
23
|
},
|
|
24
|
-
className: _JSXStyle.dynamic([["
|
|
24
|
+
className: _JSXStyle.dynamic([["2098643240", [fonts.secondary, colors.enterLightGrey, colors.enterMediumGrey, colors.enterDarkGrey]]])
|
|
25
25
|
}, segment))), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
26
|
-
id: "
|
|
27
|
-
dynamic: [
|
|
28
|
-
}, `.segmented-controll.__jsx-style-dynamic-selector{display:grid;grid-auto-flow:column;grid-auto-columns:1fr;grid-gap:2px;}.segment.__jsx-style-dynamic-selector{position:relative;}.segment.__jsx-style-dynamic-selector:first-child label.__jsx-style-dynamic-selector,.segment.__jsx-style-dynamic-selector:first-child input.__jsx-style-dynamic-selector{border-radius:2px 0 0 2px;}.segment.__jsx-style-dynamic-selector:last-child label.__jsx-style-dynamic-selector,.segment.__jsx-style-dynamic-selector:last-child input.__jsx-style-dynamic-selector{border-radius:0 2px 2px 0;}label.__jsx-style-dynamic-selector{font-family:${
|
|
26
|
+
id: "2098643240",
|
|
27
|
+
dynamic: [fonts.secondary, colors.enterLightGrey, colors.enterMediumGrey, colors.enterDarkGrey]
|
|
28
|
+
}, `.segmented-controll.__jsx-style-dynamic-selector{display:grid;grid-auto-flow:column;grid-auto-columns:1fr;grid-gap:2px;}.segment.__jsx-style-dynamic-selector{position:relative;}.segment.__jsx-style-dynamic-selector:first-child label.__jsx-style-dynamic-selector,.segment.__jsx-style-dynamic-selector:first-child input.__jsx-style-dynamic-selector{border-radius:2px 0 0 2px;}.segment.__jsx-style-dynamic-selector:last-child label.__jsx-style-dynamic-selector,.segment.__jsx-style-dynamic-selector:last-child input.__jsx-style-dynamic-selector{border-radius:0 2px 2px 0;}label.__jsx-style-dynamic-selector{font-family:${fonts.secondary};text-transform:uppercase;font-size:0.9em;-webkit-letter-spacing:0.05em;-moz-letter-spacing:0.05em;-ms-letter-spacing:0.05em;letter-spacing:0.05em;padding:0.7em 0.5em;text-align:center;background-color:${colors.enterLightGrey};box-sizing:border-box;display:block;width:100%;height:100%;-webkit-transition:background-color 0.1s;transition:background-color 0.1s;cursor:pointer;}label.__jsx-style-dynamic-selector:hover{background-color:${colors.enterMediumGrey};color:white;}input.__jsx-style-dynamic-selector:checked+label.__jsx-style-dynamic-selector{background-color:${colors.enterDarkGrey};color:white;}input.__jsx-style-dynamic-selector{-webkit-appearance:none;-moz-appearance:none;appearance:none;position:absolute;left:0;top:0;margin:0;width:100%;height:100%;background-color:transparent;pointer-events:none;}`));
|
|
29
29
|
};
|
|
@@ -1,17 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
declare const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
onChange: (segment: Segment) => void;
|
|
8
|
-
onFocus?: (() => void) | undefined;
|
|
9
|
-
}) => React.ReactElement<any, string | React.JSXElementConstructor<any>>)>;
|
|
10
|
-
export default _default;
|
|
11
|
-
export declare const Basic: ComponentStory<(<Segment extends string>(props: {
|
|
12
|
-
segments: Segment[];
|
|
13
|
-
activeSegment?: Segment | undefined;
|
|
14
|
-
colors?: string[] | undefined;
|
|
15
|
-
onChange: (segment: Segment) => void;
|
|
16
|
-
onFocus?: (() => void) | undefined;
|
|
17
|
-
}) => React.ReactElement<any, string | React.JSXElementConstructor<any>>)>;
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { SegmentedControl } from './segmented-control';
|
|
3
|
+
declare const meta: Meta<typeof SegmentedControl>;
|
|
4
|
+
export default meta;
|
|
5
|
+
declare type Story = StoryObj<typeof SegmentedControl>;
|
|
6
|
+
export declare const Basic: Story;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { SegmentedControl } from './segmented-control';
|
|
3
|
-
|
|
2
|
+
const meta = {
|
|
4
3
|
title: 'Form Elements/Segmented Control',
|
|
5
4
|
component: SegmentedControl
|
|
6
5
|
};
|
|
7
|
-
|
|
8
|
-
export const Basic =
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
export default meta;
|
|
7
|
+
export const Basic = {
|
|
8
|
+
args: {
|
|
9
|
+
segments: ['One', 'Two', 'Three'],
|
|
10
|
+
activeSegment: 'One'
|
|
11
|
+
}
|
|
12
12
|
};
|
package/dist/ui/guest-card.d.ts
CHANGED
package/dist/ui/guest-card.js
CHANGED
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
import _JSXStyle from "styled-jsx/style";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import 'styled-jsx';
|
|
4
|
-
import {
|
|
4
|
+
import { colors, fonts } from '../lib/theme';
|
|
5
|
+
import { classNames as cx } from '../lib/class-names';
|
|
5
6
|
import { CheckinCountIndicator } from './checkin-count-indicator';
|
|
6
7
|
import { CompanionInfo } from './companion-info';
|
|
7
8
|
import { Tag } from './tag';
|
|
8
9
|
export const GuestCard = props => {
|
|
9
10
|
const filterTags = props.filterTags ?? (() => true);
|
|
10
|
-
const tags = (props.attendee.tags
|
|
11
|
+
const tags = Array.from(props.attendee.tags).filter(filterTags);
|
|
11
12
|
const getTagColor = props.getTagColor ?? (() => undefined);
|
|
12
13
|
const onClick = props.onClick ? () => {
|
|
13
14
|
if (!props.onClick) return;
|
|
14
15
|
props.onClick(props.attendee.id);
|
|
15
16
|
} : undefined;
|
|
16
17
|
return /*#__PURE__*/React.createElement("div", {
|
|
17
|
-
className: _JSXStyle.dynamic([["
|
|
18
|
+
className: _JSXStyle.dynamic([["1739379681", [colors.enterGrey, colors.enterBackground, fonts.primary, props.dense ? '0.5em 0' : '1.5em 0']]]) + " " + (cx({
|
|
18
19
|
'guest-card-wrapper': true,
|
|
19
20
|
plain: props.plain
|
|
20
21
|
}) || "")
|
|
21
22
|
}, /*#__PURE__*/React.createElement("div", {
|
|
22
|
-
className: _JSXStyle.dynamic([["
|
|
23
|
+
className: _JSXStyle.dynamic([["1739379681", [colors.enterGrey, colors.enterBackground, fonts.primary, props.dense ? '0.5em 0' : '1.5em 0']]]) + " " + 'tag-color-list'
|
|
23
24
|
}, tags.map(tag => [tag, getTagColor(tag)]).filter(([, tagColor]) => tagColor).map(([tag, tagColor]) => /*#__PURE__*/React.createElement("div", {
|
|
24
25
|
key: tag,
|
|
25
26
|
title: tag,
|
|
@@ -27,30 +28,30 @@ export const GuestCard = props => {
|
|
|
27
28
|
backgroundColor: tagColor,
|
|
28
29
|
height: '100%'
|
|
29
30
|
},
|
|
30
|
-
className: _JSXStyle.dynamic([["
|
|
31
|
+
className: _JSXStyle.dynamic([["1739379681", [colors.enterGrey, colors.enterBackground, fonts.primary, props.dense ? '0.5em 0' : '1.5em 0']]]) + " " + 'tag-color'
|
|
31
32
|
}))), /*#__PURE__*/React.createElement("div", {
|
|
32
33
|
onClick: onClick,
|
|
33
|
-
className: _JSXStyle.dynamic([["
|
|
34
|
+
className: _JSXStyle.dynamic([["1739379681", [colors.enterGrey, colors.enterBackground, fonts.primary, props.dense ? '0.5em 0' : '1.5em 0']]]) + " " + 'guest-card'
|
|
34
35
|
}, /*#__PURE__*/React.createElement("div", {
|
|
35
|
-
className: _JSXStyle.dynamic([["
|
|
36
|
+
className: _JSXStyle.dynamic([["1739379681", [colors.enterGrey, colors.enterBackground, fonts.primary, props.dense ? '0.5em 0' : '1.5em 0']]])
|
|
36
37
|
}, /*#__PURE__*/React.createElement("h2", {
|
|
37
|
-
className: _JSXStyle.dynamic([["
|
|
38
|
+
className: _JSXStyle.dynamic([["1739379681", [colors.enterGrey, colors.enterBackground, fonts.primary, props.dense ? '0.5em 0' : '1.5em 0']]]) + " " + 'name'
|
|
38
39
|
}, props.formatName(props.attendee)), /*#__PURE__*/React.createElement(CompanionInfo, {
|
|
39
40
|
companionStatus: props.attendee.companions,
|
|
40
41
|
findMainGuest: props.findMainGuest,
|
|
41
42
|
formatName: props.formatName
|
|
42
43
|
}), /*#__PURE__*/React.createElement(CheckinCountIndicator, {
|
|
43
|
-
checkins: props.attendee.
|
|
44
|
-
response: props.attendee.
|
|
45
|
-
rsvpCount: props.attendee.
|
|
44
|
+
checkins: props.attendee.getCheckinsForBranch(props.branchName).getActiveCheckins(props.counterName),
|
|
45
|
+
response: props.attendee.getResponse(props.branchName, props.counterName),
|
|
46
|
+
rsvpCount: props.attendee.getRsvpCount(props.branchName, props.counterName)
|
|
46
47
|
})), /*#__PURE__*/React.createElement("div", {
|
|
47
|
-
className: _JSXStyle.dynamic([["
|
|
48
|
+
className: _JSXStyle.dynamic([["1739379681", [colors.enterGrey, colors.enterBackground, fonts.primary, props.dense ? '0.5em 0' : '1.5em 0']]]) + " " + 'tag-list'
|
|
48
49
|
}, tags.map(tag => /*#__PURE__*/React.createElement(Tag, {
|
|
49
50
|
key: tag
|
|
50
51
|
}, tag)), props.infoText && /*#__PURE__*/React.createElement("div", {
|
|
51
|
-
className: _JSXStyle.dynamic([["
|
|
52
|
+
className: _JSXStyle.dynamic([["1739379681", [colors.enterGrey, colors.enterBackground, fonts.primary, props.dense ? '0.5em 0' : '1.5em 0']]]) + " " + 'info'
|
|
52
53
|
}, " ", props.infoText))), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
53
|
-
id: "
|
|
54
|
-
dynamic: [
|
|
55
|
-
}, `.guest-card-wrapper.__jsx-style-dynamic-selector{border-radius:2px;border:1px solid ${
|
|
54
|
+
id: "1739379681",
|
|
55
|
+
dynamic: [colors.enterGrey, colors.enterBackground, fonts.primary, props.dense ? '0.5em 0' : '1.5em 0']
|
|
56
|
+
}, `.guest-card-wrapper.__jsx-style-dynamic-selector{border-radius:2px;border:1px solid ${colors.enterGrey};background-color:${colors.enterBackground};font-family:${fonts.primary};margin:${props.dense ? '0.5em 0' : '1.5em 0'};-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}.guest-card.__jsx-style-dynamic-selector{position:relative;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;-webkit-align-items:start;-webkit-box-align:start;-ms-flex-align:start;align-items:start;padding:1.1em 1em 0.9em;-webkit-flex:1;-ms-flex:1;flex:1;}.tag-color-list.__jsx-style-dynamic-selector{width:0.35em;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}.tag-color.__jsx-style-dynamic-selector:first-child{border-top-left-radius:1px;}.tag-color.__jsx-style-dynamic-selector:last-child{border-bottom-left-radius:1px;}.plain.__jsx-style-dynamic-selector{border:none;background-color:transparent;}.name.__jsx-style-dynamic-selector{font-size:1.15em;margin:-0.1em 0 0.3em;}.tag-list.__jsx-style-dynamic-selector{max-width:40%;text-align:right;font-size:0.9em;}.info.__jsx-style-dynamic-selector{display:block;width:100%;text-align:right;}`));
|
|
56
57
|
};
|
|
@@ -1,124 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}>>;
|
|
16
|
-
export default _default;
|
|
17
|
-
export declare const WithBackground: ComponentStory<React.FunctionComponent<{
|
|
18
|
-
attendee: Attendee;
|
|
19
|
-
checkinTag: string;
|
|
20
|
-
plain?: boolean | undefined;
|
|
21
|
-
dense?: boolean | undefined;
|
|
22
|
-
infoText?: string | undefined;
|
|
23
|
-
formatName: (attendee: Attendee) => string;
|
|
24
|
-
filterTags?: ((tag: string) => boolean) | undefined;
|
|
25
|
-
getTagColor?: ((tag: string) => string | undefined) | undefined;
|
|
26
|
-
findMainGuest?: ((attendeeId: string) => Attendee | undefined) | undefined;
|
|
27
|
-
onClick?: ((attendeeId: string) => void) | undefined;
|
|
28
|
-
}>>;
|
|
29
|
-
export declare const Plain: ComponentStory<React.FunctionComponent<{
|
|
30
|
-
attendee: Attendee;
|
|
31
|
-
checkinTag: string;
|
|
32
|
-
plain?: boolean | undefined;
|
|
33
|
-
dense?: boolean | undefined;
|
|
34
|
-
infoText?: string | undefined;
|
|
35
|
-
formatName: (attendee: Attendee) => string;
|
|
36
|
-
filterTags?: ((tag: string) => boolean) | undefined;
|
|
37
|
-
getTagColor?: ((tag: string) => string | undefined) | undefined;
|
|
38
|
-
findMainGuest?: ((attendeeId: string) => Attendee | undefined) | undefined;
|
|
39
|
-
onClick?: ((attendeeId: string) => void) | undefined;
|
|
40
|
-
}>>;
|
|
41
|
-
export declare const Dense: ComponentStory<React.FunctionComponent<{
|
|
42
|
-
attendee: Attendee;
|
|
43
|
-
checkinTag: string;
|
|
44
|
-
plain?: boolean | undefined;
|
|
45
|
-
dense?: boolean | undefined;
|
|
46
|
-
infoText?: string | undefined;
|
|
47
|
-
formatName: (attendee: Attendee) => string;
|
|
48
|
-
filterTags?: ((tag: string) => boolean) | undefined;
|
|
49
|
-
getTagColor?: ((tag: string) => string | undefined) | undefined;
|
|
50
|
-
findMainGuest?: ((attendeeId: string) => Attendee | undefined) | undefined;
|
|
51
|
-
onClick?: ((attendeeId: string) => void) | undefined;
|
|
52
|
-
}>>;
|
|
53
|
-
export declare const FilteredTags: ComponentStory<React.FunctionComponent<{
|
|
54
|
-
attendee: Attendee;
|
|
55
|
-
checkinTag: string;
|
|
56
|
-
plain?: boolean | undefined;
|
|
57
|
-
dense?: boolean | undefined;
|
|
58
|
-
infoText?: string | undefined;
|
|
59
|
-
formatName: (attendee: Attendee) => string;
|
|
60
|
-
filterTags?: ((tag: string) => boolean) | undefined;
|
|
61
|
-
getTagColor?: ((tag: string) => string | undefined) | undefined;
|
|
62
|
-
findMainGuest?: ((attendeeId: string) => Attendee | undefined) | undefined;
|
|
63
|
-
onClick?: ((attendeeId: string) => void) | undefined;
|
|
64
|
-
}>>;
|
|
65
|
-
export declare const WithColorLabel: ComponentStory<React.FunctionComponent<{
|
|
66
|
-
attendee: Attendee;
|
|
67
|
-
checkinTag: string;
|
|
68
|
-
plain?: boolean | undefined;
|
|
69
|
-
dense?: boolean | undefined;
|
|
70
|
-
infoText?: string | undefined;
|
|
71
|
-
formatName: (attendee: Attendee) => string;
|
|
72
|
-
filterTags?: ((tag: string) => boolean) | undefined;
|
|
73
|
-
getTagColor?: ((tag: string) => string | undefined) | undefined;
|
|
74
|
-
findMainGuest?: ((attendeeId: string) => Attendee | undefined) | undefined;
|
|
75
|
-
onClick?: ((attendeeId: string) => void) | undefined;
|
|
76
|
-
}>>;
|
|
77
|
-
export declare const WithMultipleColorLabels: ComponentStory<React.FunctionComponent<{
|
|
78
|
-
attendee: Attendee;
|
|
79
|
-
checkinTag: string;
|
|
80
|
-
plain?: boolean | undefined;
|
|
81
|
-
dense?: boolean | undefined;
|
|
82
|
-
infoText?: string | undefined;
|
|
83
|
-
formatName: (attendee: Attendee) => string;
|
|
84
|
-
filterTags?: ((tag: string) => boolean) | undefined;
|
|
85
|
-
getTagColor?: ((tag: string) => string | undefined) | undefined;
|
|
86
|
-
findMainGuest?: ((attendeeId: string) => Attendee | undefined) | undefined;
|
|
87
|
-
onClick?: ((attendeeId: string) => void) | undefined;
|
|
88
|
-
}>>;
|
|
89
|
-
export declare const WithInfoText: ComponentStory<React.FunctionComponent<{
|
|
90
|
-
attendee: Attendee;
|
|
91
|
-
checkinTag: string;
|
|
92
|
-
plain?: boolean | undefined;
|
|
93
|
-
dense?: boolean | undefined;
|
|
94
|
-
infoText?: string | undefined;
|
|
95
|
-
formatName: (attendee: Attendee) => string;
|
|
96
|
-
filterTags?: ((tag: string) => boolean) | undefined;
|
|
97
|
-
getTagColor?: ((tag: string) => string | undefined) | undefined;
|
|
98
|
-
findMainGuest?: ((attendeeId: string) => Attendee | undefined) | undefined;
|
|
99
|
-
onClick?: ((attendeeId: string) => void) | undefined;
|
|
100
|
-
}>>;
|
|
101
|
-
export declare const WithCompanion: ComponentStory<React.FunctionComponent<{
|
|
102
|
-
attendee: Attendee;
|
|
103
|
-
checkinTag: string;
|
|
104
|
-
plain?: boolean | undefined;
|
|
105
|
-
dense?: boolean | undefined;
|
|
106
|
-
infoText?: string | undefined;
|
|
107
|
-
formatName: (attendee: Attendee) => string;
|
|
108
|
-
filterTags?: ((tag: string) => boolean) | undefined;
|
|
109
|
-
getTagColor?: ((tag: string) => string | undefined) | undefined;
|
|
110
|
-
findMainGuest?: ((attendeeId: string) => Attendee | undefined) | undefined;
|
|
111
|
-
onClick?: ((attendeeId: string) => void) | undefined;
|
|
112
|
-
}>>;
|
|
113
|
-
export declare const WithCompanionButNoMainGuestInfo: ComponentStory<React.FunctionComponent<{
|
|
114
|
-
attendee: Attendee;
|
|
115
|
-
checkinTag: string;
|
|
116
|
-
plain?: boolean | undefined;
|
|
117
|
-
dense?: boolean | undefined;
|
|
118
|
-
infoText?: string | undefined;
|
|
119
|
-
formatName: (attendee: Attendee) => string;
|
|
120
|
-
filterTags?: ((tag: string) => boolean) | undefined;
|
|
121
|
-
getTagColor?: ((tag: string) => string | undefined) | undefined;
|
|
122
|
-
findMainGuest?: ((attendeeId: string) => Attendee | undefined) | undefined;
|
|
123
|
-
onClick?: ((attendeeId: string) => void) | undefined;
|
|
124
|
-
}>>;
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { GuestCard } from './guest-card';
|
|
3
|
+
declare const meta: Meta<typeof GuestCard>;
|
|
4
|
+
export default meta;
|
|
5
|
+
declare type Story = StoryObj<typeof GuestCard>;
|
|
6
|
+
export declare const WithBackground: Story;
|
|
7
|
+
export declare const Plain: Story;
|
|
8
|
+
export declare const Dense: Story;
|
|
9
|
+
export declare const FilteredTags: Story;
|
|
10
|
+
export declare const WithColorLabel: Story;
|
|
11
|
+
export declare const WithMultipleColorLabels: Story;
|
|
12
|
+
export declare const WithInfoText: Story;
|
|
13
|
+
export declare const WithCompanion: Story;
|
|
14
|
+
export declare const WithCompanionButNoMainGuestInfo: Story;
|