@mrshmllw/smores-react 2.4.0 → 2.4.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/dist/Accordion/Accordion.d.ts +2 -1
- package/dist/Accordion/Accordion.js +14 -2
- package/dist/Accordion/Accordion.js.map +1 -1
- package/dist/ActionDropdown/ActionDropdown.d.ts +2 -1
- package/dist/ActionDropdown/ActionDropdown.js +19 -6
- package/dist/ActionDropdown/ActionDropdown.js.map +1 -1
- package/dist/Box/Box.d.ts +3 -3
- package/dist/Box/Box.js +3 -2
- package/dist/Box/Box.js.map +1 -1
- package/dist/Button/Button.d.ts +2 -2
- package/dist/Button/Button.js +10 -12
- package/dist/Button/Button.js.map +1 -1
- package/dist/Card/Card.d.ts +2 -1
- package/dist/Card/Card.js +17 -2
- package/dist/Card/Card.js.map +1 -1
- package/dist/CheckBoxGroup/CheckBoxGroup.d.ts +4 -3
- package/dist/CheckBoxGroup/CheckBoxGroup.js +17 -2
- package/dist/CheckBoxGroup/CheckBoxGroup.js.map +1 -1
- package/dist/CheckBoxGroup/CheckBoxGroup.stories.d.ts +1 -1
- package/dist/Chip/Chip.d.ts +2 -1
- package/dist/Chip/Chip.js +3 -2
- package/dist/Chip/Chip.js.map +1 -1
- package/dist/ConfirmationRadioButtons/Confirmation.d.ts +2 -1
- package/dist/ConfirmationRadioButtons/Confirmation.js +17 -5
- package/dist/ConfirmationRadioButtons/Confirmation.js.map +1 -1
- package/dist/Datepicker/Datepicker.d.ts +2 -2
- package/dist/Datepicker/Datepicker.js +15 -3
- package/dist/Datepicker/Datepicker.js.map +1 -1
- package/dist/Datepicker/DatesList.d.ts +0 -1
- package/dist/Datepicker/DatesList.js +4 -5
- package/dist/Datepicker/DatesList.js.map +1 -1
- package/dist/Dropdown/Dropdown.d.ts +2 -2
- package/dist/Dropdown/Dropdown.js +1 -1
- package/dist/Dropdown/Dropdown.stories.d.ts +2 -2
- package/dist/Emoji/Emoji.d.ts +2 -6
- package/dist/Emoji/Emoji.js +17 -6
- package/dist/Emoji/Emoji.js.map +1 -1
- package/dist/Field/Field.d.ts +1 -1
- package/dist/Field/Field.js +14 -3
- package/dist/Field/Field.js.map +1 -1
- package/dist/Field/types/commonFieldTypes.d.ts +2 -1
- package/dist/Fieldset/Fieldset.d.ts +4 -3
- package/dist/Fieldset/Fieldset.js +14 -2
- package/dist/Fieldset/Fieldset.js.map +1 -1
- package/dist/Icon/Icon.d.ts +2 -6
- package/dist/Icon/Icon.js +819 -808
- package/dist/Icon/Icon.js.map +1 -1
- package/dist/IconWrapper/IconWrapper.d.ts +2 -1
- package/dist/IconWrapper/IconWrapper.js +21 -6
- package/dist/IconWrapper/IconWrapper.js.map +1 -1
- package/dist/LabelledText/LabelledText.d.ts +2 -1
- package/dist/LabelledText/LabelledText.js +19 -4
- package/dist/LabelledText/LabelledText.js.map +1 -1
- package/dist/NumberInput/NumberInput.d.ts +17 -30
- package/dist/NumberInput/NumberInput.js +84 -62
- package/dist/NumberInput/NumberInput.js.map +1 -1
- package/dist/NumberInput/NumberInput.stories.d.ts +1 -1
- package/dist/Pagination/Pagination.d.ts +2 -1
- package/dist/Pagination/Pagination.js +14 -2
- package/dist/Pagination/Pagination.js.map +1 -1
- package/dist/RadioButton/RadioButton.d.ts +2 -1
- package/dist/RadioButton/RadioButton.js +14 -2
- package/dist/RadioButton/RadioButton.js.map +1 -1
- package/dist/Row/Row.d.ts +2 -1
- package/dist/Row/Row.js +15 -3
- package/dist/Row/Row.js.map +1 -1
- package/dist/SearchInput/SearchInput.d.ts +0 -1
- package/dist/SearchInput/SearchInput.js +15 -3
- package/dist/SearchInput/SearchInput.js.map +1 -1
- package/dist/SupportMessage/Collection.js +44 -29
- package/dist/SupportMessage/Collection.js.map +1 -1
- package/dist/SupportMessage/SupportMessage.d.ts +2 -1
- package/dist/SupportMessage/SupportMessage.js +27 -12
- package/dist/SupportMessage/SupportMessage.js.map +1 -1
- package/dist/Tag/Tag.d.ts +2 -1
- package/dist/Tag/Tag.js +18 -3
- package/dist/Tag/Tag.js.map +1 -1
- package/dist/Text/Text.d.ts +2 -1
- package/dist/Text/Text.js +2 -1
- package/dist/Text/Text.js.map +1 -1
- package/dist/TextInput/TextInput.js +17 -3
- package/dist/TextInput/TextInput.js.map +1 -1
- package/dist/Textarea/Textarea.d.ts +3 -5
- package/dist/Textarea/Textarea.js +1 -1
- package/dist/Textarea/Textarea.js.map +1 -1
- package/dist/Toggle/Toggle.d.ts +2 -1
- package/dist/Toggle/Toggle.js +16 -3
- package/dist/Toggle/Toggle.js.map +1 -1
- package/dist/Toggle/Toggle.stories.d.ts +1 -1
- package/dist/utils/space.d.ts +4 -4
- package/dist/utils/space.js +7 -2
- package/dist/utils/space.js.map +1 -1
- package/package.json +1 -1
- package/dist/CheckBoxGroup/CheckBox.d.ts +0 -9
- package/dist/CheckBoxGroup/CheckBox.js +0 -67
- package/dist/CheckBoxGroup/CheckBox.js.map +0 -1
@@ -1,11 +1,24 @@
|
|
1
|
-
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
2
|
+
var t = {};
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
4
|
+
t[p] = s[p];
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
8
|
+
t[p[i]] = s[p[i]];
|
9
|
+
}
|
10
|
+
return t;
|
11
|
+
};
|
12
|
+
import React, { forwardRef } from 'react';
|
2
13
|
import styled from 'styled-components';
|
3
14
|
import { Box } from '../Box';
|
4
15
|
import { Text } from '../Text';
|
5
16
|
import { Icon } from '../Icon';
|
17
|
+
import { Field } from '../Field';
|
6
18
|
import { theme } from '../theme';
|
7
19
|
import { useUniqueId } from '../utils/id';
|
8
|
-
export const NumberInput = (
|
20
|
+
export const NumberInput = forwardRef(function NumberInput(_a, ref) {
|
21
|
+
var { id: idProp, type = 'number', placeholder, name, value, trailingIcon, onChange, onInputChange, onBlur, prefix, suffix, roundCurrency, min = -999999, max = 999999, strict, step = 0, disabled = false, error = false, outlined = false } = _a, fieldProps = __rest(_a, ["id", "type", "placeholder", "name", "value", "trailingIcon", "onChange", "onInputChange", "onBlur", "prefix", "suffix", "roundCurrency", "min", "max", "strict", "step", "disabled", "error", "outlined"]);
|
9
22
|
const id = useUniqueId(idProp);
|
10
23
|
// Check whether the min/max value exists is within the specified range
|
11
24
|
const isInRange = (value) => {
|
@@ -41,6 +54,8 @@ export const NumberInput = ({ id: idProp, className, type = 'number', placeholde
|
|
41
54
|
return Math.abs(dMax) < Math.abs(dMin) ? max : min;
|
42
55
|
};
|
43
56
|
const handleChange = (event) => {
|
57
|
+
if (onChange === undefined)
|
58
|
+
return;
|
44
59
|
const EMPTY_INPUT = '';
|
45
60
|
if (event === EMPTY_INPUT) {
|
46
61
|
onChange(event);
|
@@ -60,6 +75,8 @@ export const NumberInput = ({ id: idProp, className, type = 'number', placeholde
|
|
60
75
|
};
|
61
76
|
// Increment or decrement the value when clicking the Spinner controls
|
62
77
|
const incrementValue = (event) => {
|
78
|
+
if (onChange === undefined)
|
79
|
+
return;
|
63
80
|
event.preventDefault();
|
64
81
|
const currentValue = Number(value) + step;
|
65
82
|
if (isInRange(currentValue)) {
|
@@ -67,73 +84,44 @@ export const NumberInput = ({ id: idProp, className, type = 'number', placeholde
|
|
67
84
|
}
|
68
85
|
};
|
69
86
|
const decrementValue = (event) => {
|
87
|
+
if (onChange === undefined)
|
88
|
+
return;
|
70
89
|
event.preventDefault();
|
71
90
|
const currentValue = Number(value) - step;
|
72
91
|
if (isInRange(currentValue)) {
|
73
92
|
onChange(roundNumber(currentValue));
|
74
93
|
}
|
75
94
|
};
|
76
|
-
return (React.createElement(
|
77
|
-
|
78
|
-
React.createElement(
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
suffix && (React.createElement(
|
86
|
-
|
87
|
-
step > 0 && (React.createElement(Spinner, null,
|
95
|
+
return (React.createElement(Field, Object.assign({}, fieldProps, { id: id, error: error, outlined: outlined, value: value }),
|
96
|
+
React.createElement(Box, { flex: true },
|
97
|
+
prefix && (React.createElement(SymbolText, { tag: "span", color: "secondary", outlined: outlined, prefix: prefix }, prefix)),
|
98
|
+
React.createElement(Input, { error: error, outlined: outlined, disabled: disabled, type: type, id: id, name: name, placeholder: placeholder, value: value, prefix: prefix, onChange: (e) => {
|
99
|
+
onChange && handleChange(e.currentTarget.value);
|
100
|
+
onInputChange && onInputChange(e);
|
101
|
+
}, onBlur: (e) => {
|
102
|
+
onBlur && onBlur(e);
|
103
|
+
} }),
|
104
|
+
suffix && (React.createElement(SymbolText, { tag: "span", color: "secondary", outlined: outlined, suffix: suffix }, suffix)),
|
105
|
+
onChange && step > 0 && (React.createElement(Spinner, { outlined: outlined },
|
88
106
|
React.createElement(SpinnerButton, { onClick: incrementValue, disabled: disabled },
|
89
107
|
React.createElement(Icon, { render: "caret", rotate: 180, color: "subtext", size: 24 })),
|
90
108
|
React.createElement(SpinnerButton, { onClick: decrementValue, disabled: disabled },
|
91
109
|
React.createElement(Icon, { render: "caret", color: "subtext", size: 24 })))),
|
92
|
-
trailingIcon && React.createElement(
|
93
|
-
|
94
|
-
};
|
95
|
-
const Container = styled.div `
|
96
|
-
font-family: 'Gordita', san-serif;
|
97
|
-
display: flex;
|
98
|
-
flex-direction: column;
|
99
|
-
height: auto;
|
100
|
-
`;
|
101
|
-
const Content = styled.div `
|
102
|
-
border-bottom: 1px solid;
|
103
|
-
border-color: ${({ error }) => theme.colors[`${error ? 'error' : 'outline'}`]};
|
104
|
-
display: flex;
|
105
|
-
align-items: center;
|
106
|
-
height: 32px;
|
107
|
-
cursor: ${({ disabled }) => (disabled ? 'not-allowed' : 'pointer')};
|
108
|
-
opacity: ${({ disabled }) => (disabled ? '0.5' : '1')};
|
109
|
-
|
110
|
-
&:hover,
|
111
|
-
&:focus-within {
|
112
|
-
border-color: ${({ error }) => theme.colors[`${error ? 'error' : 'outline'}`]};
|
113
|
-
}
|
114
|
-
|
115
|
-
${({ outlined }) => outlined &&
|
116
|
-
`
|
117
|
-
border: 2px solid ${theme.colors.outline};
|
118
|
-
border-radius: 8px;
|
119
|
-
padding: 16px 12px;
|
120
|
-
height: auto;
|
121
|
-
`}
|
122
|
-
|
123
|
-
${({ value }) => value &&
|
124
|
-
value !== '' &&
|
125
|
-
`
|
126
|
-
border-color: ${theme.colors.outline};
|
127
|
-
`}
|
128
|
-
`;
|
110
|
+
trailingIcon && React.createElement(StyledIcon, { render: trailingIcon, color: "subtext" }))));
|
111
|
+
});
|
129
112
|
const Input = styled.input `
|
130
|
-
font-family: '
|
113
|
+
font-family: 'Circular', san-serif;
|
131
114
|
border: none;
|
115
|
+
border-bottom: 1px solid;
|
116
|
+
border-color: ${({ error }) => theme.colors[`${error ? 'error' : 'outline'}`]};
|
132
117
|
color: ${({ error }) => theme.colors[`${error ? 'error' : 'secondary'}`]};
|
133
118
|
font-size: 16px;
|
134
119
|
width: 100%;
|
135
120
|
outline: none;
|
136
121
|
cursor: ${({ disabled }) => (disabled ? 'not-allowed' : 'pointer')};
|
122
|
+
opacity: ${({ disabled }) => (disabled ? '0.5' : '1')};
|
123
|
+
padding: ${({ outlined }) => (outlined ? '17px 14px' : '1px 2px')};
|
124
|
+
padding-right: 60px;
|
137
125
|
|
138
126
|
&::placeholder {
|
139
127
|
color: ${theme.colors.subtext};
|
@@ -147,25 +135,59 @@ const Input = styled.input `
|
|
147
135
|
-webkit-appearance: none;
|
148
136
|
margin: 0;
|
149
137
|
}
|
138
|
+
|
139
|
+
&:hover,
|
140
|
+
&:focus-within {
|
141
|
+
border-color: ${({ error }) => theme.colors[`${error ? 'error' : 'outline'}`]};
|
142
|
+
}
|
143
|
+
|
144
|
+
${({ outlined, error }) => outlined &&
|
145
|
+
`
|
146
|
+
border: 2px solid ${error ? theme.colors.error : theme.colors.outline};
|
147
|
+
border-radius: 8px;
|
148
|
+
height: auto;
|
149
|
+
`}
|
150
|
+
|
151
|
+
${({ value }) => value &&
|
152
|
+
value !== '' &&
|
153
|
+
`
|
154
|
+
border-color: ${theme.colors.outline};
|
155
|
+
`}
|
156
|
+
|
157
|
+
${({ prefix }) => prefix &&
|
158
|
+
`
|
159
|
+
padding-left: 12px;
|
160
|
+
left: -10px;
|
161
|
+
position: relative;
|
162
|
+
`}
|
150
163
|
`;
|
151
|
-
const
|
152
|
-
|
153
|
-
|
154
|
-
font-size: 12px;
|
164
|
+
const StyledIcon = styled(Icon) `
|
165
|
+
position: relative;
|
166
|
+
left: -24px;
|
155
167
|
`;
|
156
168
|
const SymbolText = styled(Text) `
|
157
|
-
font-family: '
|
169
|
+
font-family: 'Circular', san-serif;
|
158
170
|
font-size: 16px;
|
159
171
|
line-height: 19px;
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
172
|
+
position: relative;
|
173
|
+
z-index: 1;
|
174
|
+
|
175
|
+
${({ outlined, prefix }) => outlined &&
|
176
|
+
`
|
177
|
+
top: 20px;
|
178
|
+
left: ${prefix ? '1px' : '0'};
|
179
|
+
`}
|
180
|
+
|
181
|
+
${({ suffix, outlined }) => suffix &&
|
182
|
+
`
|
183
|
+
left: ${outlined ? '-25px' : '-10px'};
|
184
|
+
`}
|
164
185
|
`;
|
165
186
|
const Spinner = styled.div `
|
166
187
|
display: flex;
|
167
188
|
position: relative;
|
168
|
-
top: -3px;
|
189
|
+
top: ${({ outlined }) => (outlined ? '17px' : '-3px')};
|
190
|
+
left: -60px;
|
169
191
|
`;
|
170
192
|
const SpinnerButton = styled.button `
|
171
193
|
width: 24px;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"NumberInput.js","sourceRoot":"","sources":["../../src/NumberInput/NumberInput.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
1
|
+
{"version":3,"file":"NumberIn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CAAC,CAI7B;;;;;;;IAOE,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,CACzB,QAAQ;IACR;;cAEU,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG;KAC7B;;IAED,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,EAAE,CACzB,MAAM;IACN;cACU,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO;KACrC;CACJ,CAAA;AAED,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAExB;;;SAGO,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC;;CAEtD,CAAA;AAMD,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,CAAS;;;;;;YAMhC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC;CACnE,CAAA"}
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
2
2
|
import { NumberInputProps } from './NumberInput';
|
3
3
|
declare const _default: {
|
4
4
|
title: string;
|
5
|
-
component: React.
|
5
|
+
component: React.ForwardRefExoticComponent<NumberInputProps & React.RefAttributes<HTMLInputElement>>;
|
6
6
|
argTypes: {
|
7
7
|
onChange: {
|
8
8
|
action: string;
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import { FC } from 'react';
|
2
|
+
import { MarginProps } from '../utils/space';
|
2
3
|
export declare type PaginationProps = {
|
3
4
|
/** Total number of records */
|
4
5
|
total: number;
|
@@ -6,5 +7,5 @@ export declare type PaginationProps = {
|
|
6
7
|
partition: number;
|
7
8
|
/** Handle page change */
|
8
9
|
handlePageChange: (page: number) => void;
|
9
|
-
};
|
10
|
+
} & MarginProps;
|
10
11
|
export declare const Pagination: FC<PaginationProps>;
|
@@ -1,3 +1,14 @@
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
2
|
+
var t = {};
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
4
|
+
t[p] = s[p];
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
8
|
+
t[p[i]] = s[p[i]];
|
9
|
+
}
|
10
|
+
return t;
|
11
|
+
};
|
1
12
|
import React, { useEffect, useState } from 'react';
|
2
13
|
import styled from 'styled-components';
|
3
14
|
import { Box } from '../Box';
|
@@ -6,7 +17,8 @@ import { Icon } from '../Icon';
|
|
6
17
|
import { theme } from '../theme';
|
7
18
|
const MAX_PAGES = 7;
|
8
19
|
const MAX_ADDITIONAL_PAGES = Math.ceil(MAX_PAGES / 2);
|
9
|
-
export const Pagination = (
|
20
|
+
export const Pagination = (_a) => {
|
21
|
+
var { total, partition, handlePageChange } = _a, marginProps = __rest(_a, ["total", "partition", "handlePageChange"]);
|
10
22
|
const [lastPage, setLastPage] = useState(0);
|
11
23
|
const [activePage, setActivePage] = useState(1);
|
12
24
|
const [pages, setPages] = useState([]);
|
@@ -61,7 +73,7 @@ export const Pagination = ({ total, partition, handlePageChange, }) => {
|
|
61
73
|
handlePageChange(page);
|
62
74
|
}
|
63
75
|
};
|
64
|
-
return (React.createElement(Container, { flex: true, direction: "row" },
|
76
|
+
return (React.createElement(Container, Object.assign({ flex: true, direction: "row" }, marginProps),
|
65
77
|
activePage - 1 > 0 && (React.createElement(PageBox, { onClick: () => movePage(activePage - 1) },
|
66
78
|
React.createElement(Icon, { size: 24, render: "arrow" }))),
|
67
79
|
React.createElement(PageBox, { active: activePage === 1, onClick: () => movePage(1) },
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Pagination.js","sourceRoot":"","sources":["../../src/Pagination/Pagination.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAM,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACtD,OAAO,MAAM,MAAM,mBAAmB,CAAA;AAEtC,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAC5B,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAE9B,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;
|
1
|
+
{"version":3,"file":"Pagination.js","sourceRoot":"","sources":["../../src/Pagination/Pagination.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAM,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACtD,OAAO,MAAM,MAAM,mBAAmB,CAAA;AAEtC,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAC5B,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAE9B,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAGhC,MAAM,SAAS,GAAG,CAAC,CAAA;AACnB,MAAM,oBAAoB,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC,CAAA;AAWrD,MAAM,CAAC,MAAM,UAAU,GAAwB,CAAC,EAK/C,EAAE,EAAE;QAL2C,EAC9C,KAAK,EACL,SAAS,EACT,gBAAgB,OAEjB,EADI,WAAW,cAJgC,0CAK/C,CADe;IAEd,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAA;IAC3C,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAA;IAC/C,MAAM,CAAC,KAAK,EAAE,QAAQ,CAA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C,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,YAAY,EAC5D,GAAG,EAAC,GAAG,IAEN,QAAQ,CACJ,CACC,CACX;QACA,UAAU,GAAG,CAAC,IAAI,QAAQ,IAAI,CAC7B,oBAAC,OAAO,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,UAAU,GAAG,CAAC,CAAC;YAC9C,oBAAC,IAAI,IAAC,IAAI,EAAE,EAAE,EAAE,MAAM,EAAC,OAAO,EAAC,MAAM,EAAE,GAAG,GAAI,CACtC,CACX,CACS,CACb,CAAA;AACH,CAAC,CAAA;AAMD,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,CAAA;;;;;;;;;;;CAW5B,CAAA;AAED,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,CAAU;gBACrB,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC;;;;;CAK1E,CAAA"}
|
@@ -1,9 +1,10 @@
|
|
1
1
|
import { FC, ChangeEvent } from 'react';
|
2
|
+
import { MarginProps } from '../utils/space';
|
2
3
|
export declare type RadioButtonProps = {
|
3
4
|
id?: string;
|
4
5
|
label: string;
|
5
6
|
checked?: boolean;
|
6
7
|
value: string;
|
7
8
|
onChange: (event: ChangeEvent<HTMLInputElement>) => void;
|
8
|
-
};
|
9
|
+
} & MarginProps;
|
9
10
|
export declare const RadioButton: FC<RadioButtonProps>;
|
@@ -1,12 +1,24 @@
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
2
|
+
var t = {};
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
4
|
+
t[p] = s[p];
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
8
|
+
t[p[i]] = s[p[i]];
|
9
|
+
}
|
10
|
+
return t;
|
11
|
+
};
|
1
12
|
import React from 'react';
|
2
13
|
import styled from 'styled-components';
|
3
14
|
import { focusOutline } from '../utils/focusOutline';
|
4
15
|
import { Box } from '../Box';
|
5
16
|
import { theme } from '../theme';
|
6
17
|
import { useUniqueId } from '../utils/id';
|
7
|
-
export const RadioButton = (
|
18
|
+
export const RadioButton = (_a) => {
|
19
|
+
var { id: idProp, label, checked, value, onChange } = _a, marginProps = __rest(_a, ["id", "label", "checked", "value", "onChange"]);
|
8
20
|
const id = useUniqueId(idProp);
|
9
|
-
return (React.createElement(Box, { flex: true, alignItems: "center" },
|
21
|
+
return (React.createElement(Box, Object.assign({ flex: true, alignItems: "center" }, marginProps),
|
10
22
|
React.createElement(RadioInput, { id: id, type: "radio", checked: checked, value: value, onChange: onChange }),
|
11
23
|
React.createElement(RadioLabel, { htmlFor: id },
|
12
24
|
React.createElement(FakeInput, { checked: checked }),
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"RadioButton.js","sourceRoot":"","sources":["../../src/RadioButton/RadioButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA0B,MAAM,OAAO,CAAA;AAC9C,OAAO,MAAM,MAAM,mBAAmB,CAAA;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAEpD,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAE5B,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;
|
1
|
+
{"version":3,"file":"RadioButton.js","sourceRoot":"","sources":["../../src/RadioButton/RadioButton.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAA0B,MAAM,OAAO,CAAA;AAC9C,OAAO,MAAM,MAAM,mBAAmB,CAAA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MAAM,CAAC,KAAK,CAAA;;;;;;IAM3B,YAAY,CAAC;IACb,QAAQ,EAAE,qBAAqB,UAAU,IAAI,SAAS,EAAE;CACzD,CAAC;CACH,CAAA;AAED,wDAAwD;AACxD,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAA;;;CAGvB,CAAA"}
|
package/dist/Row/Row.d.ts
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
import { FC } from 'react';
|
2
2
|
import { Color } from '../theme';
|
3
|
+
import { MarginProps } from '../utils/space';
|
3
4
|
export declare type RowProps = {
|
4
5
|
iconLeft?: string;
|
5
6
|
iconLeftColor?: Color;
|
@@ -12,5 +13,5 @@ export declare type RowProps = {
|
|
12
13
|
borderTop?: boolean;
|
13
14
|
borderBottom?: boolean;
|
14
15
|
boldHeading?: boolean;
|
15
|
-
};
|
16
|
+
} & MarginProps;
|
16
17
|
export declare const Row: FC<RowProps>;
|
package/dist/Row/Row.js
CHANGED
@@ -1,19 +1,31 @@
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
2
|
+
var t = {};
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
4
|
+
t[p] = s[p];
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
8
|
+
t[p[i]] = s[p[i]];
|
9
|
+
}
|
10
|
+
return t;
|
11
|
+
};
|
1
12
|
import React from 'react';
|
2
13
|
import styled, { css } from 'styled-components';
|
3
14
|
import { theme } from '../theme';
|
4
15
|
import { Icon } from '../Icon';
|
5
16
|
import { Box } from '../Box';
|
6
17
|
import { Text } from '../Text';
|
7
|
-
export const Row = (
|
18
|
+
export const Row = (_a) => {
|
19
|
+
var { iconLeft, iconLeftColor, iconRight, iconRightColor, handleClick, heading, subHeading, type, borderTop = true, borderBottom = true, boldHeading } = _a, marginProps = __rest(_a, ["iconLeft", "iconLeftColor", "iconRight", "iconRightColor", "handleClick", "heading", "subHeading", "type", "borderTop", "borderBottom", "boldHeading"]);
|
8
20
|
const windowWidth = screen.width;
|
9
|
-
return (React.createElement(Container, { type: type, iconLeft: iconLeft, borderTop: borderTop, borderBottom: borderBottom, iconRight: iconRight, onClick: handleClick, boldHeading: boldHeading },
|
21
|
+
return (React.createElement(Container, Object.assign({ type: type, iconLeft: iconLeft, borderTop: borderTop, borderBottom: borderBottom, iconRight: iconRight, onClick: handleClick, boldHeading: boldHeading }, marginProps),
|
10
22
|
iconLeft && (React.createElement(Icon, { render: iconLeft, size: windowWidth > 768 ? 24 : 18, color: iconLeftColor })),
|
11
23
|
React.createElement(Box, null,
|
12
24
|
React.createElement(Text, { tag: "h1", typo: "base" }, heading),
|
13
25
|
React.createElement(Text, { tag: "p", typo: "desc-small", color: "subtext" }, subHeading)),
|
14
26
|
iconRight && (React.createElement(Icon, { className: "iconRight", render: iconRight, size: 24, rotate: iconRight === 'caret' ? -90 : 0, color: iconRightColor }))));
|
15
27
|
};
|
16
|
-
const Container = styled
|
28
|
+
const Container = styled(Box)(({ type, iconLeft, borderTop, borderBottom, boldHeading }) => css `
|
17
29
|
border-radius: ${(type === 'first' && `8px 8px 0 0`) ||
|
18
30
|
(type === 'curved' && `8px`) ||
|
19
31
|
(type === 'last' && `0 0 8px 8px`) ||
|
package/dist/Row/Row.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Row.js","sourceRoot":"","sources":["../../src/Row/Row.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAa,MAAM,OAAO,CAAA;AACjC,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAA;AAE/C,OAAO,EAAS,KAAK,EAAE,MAAM,UAAU,CAAA;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO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EAAC,IAAI,EAAC,MAAM,IACvB,OAAO,CACH;YACP,oBAAC,IAAI,IAAC,GAAG,EAAC,GAAG,EAAC,IAAI,EAAC,YAAY,EAAC,KAAK,EAAC,SAAS,IAC5C,UAAU,CACN,CACH;QACL,SAAS,IAAI,CACZ,oBAAC,IAAI,IACH,SAAS,EAAC,WAAW,EACrB,MAAM,EAAE,SAAS,EACjB,IAAI,EAAE,EAAE,EACR,MAAM,EAAE,SAAS,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EACvC,KAAK,EAAE,cAAc,GACrB,CACH,CACS,CACb,CAAA;AACH,CAAC,CAAA;AAWD,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,CAC3B,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,GAAG,CAAA;qBAC9C,CAAC,IAAI,KAAK,OAAO,IAAI,aAAa,CAAC;IACpD,CAAC,IAAI,KAAK,QAAQ,IAAI,KAAK,CAAC;IAC5B,CAAC,IAAI,KAAK,MAAM,IAAI,aAAa,CAAC;IAClC,CAAC;wBACmB,KAAK,CAAC,MAAM,CAAC,OAAO;;6BAEf,QAAQ,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,WAAW;;;;kBAIpD,CAAC,SAAS,IAAI,MAAM;qBACjB,CAAC,YAAY,IAAI,MAAM;;;;;qBAKvB,WAAW,IAAI,GAAG;;;;;;;;;;GAUpC,CACF,CAAA"}
|
@@ -1,3 +1,14 @@
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
2
|
+
var t = {};
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
4
|
+
t[p] = s[p];
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
8
|
+
t[p[i]] = s[p[i]];
|
9
|
+
}
|
10
|
+
return t;
|
11
|
+
};
|
1
12
|
import React, { useState } from 'react';
|
2
13
|
import styled from 'styled-components';
|
3
14
|
import { darken } from 'polished';
|
@@ -5,7 +16,8 @@ import { theme } from '../theme';
|
|
5
16
|
import { Icon } from '../Icon';
|
6
17
|
import { Field } from '../Field';
|
7
18
|
import { useUniqueId } from '../utils/id';
|
8
|
-
export const SearchInput = (
|
19
|
+
export const SearchInput = (_a) => {
|
20
|
+
var { id: idProp, name = 'search_input', className = '', placeholder, searchList, onFound, resultsRelativePosition = false, outlined = false, showIcon = false, renderAsTitle = false } = _a, otherProps = __rest(_a, ["id", "name", "className", "placeholder", "searchList", "onFound", "resultsRelativePosition", "outlined", "showIcon", "renderAsTitle"]);
|
9
21
|
const id = useUniqueId(idProp);
|
10
22
|
const [active, setActive] = useState(false);
|
11
23
|
const [list, setList] = useState([]);
|
@@ -34,7 +46,7 @@ export const SearchInput = ({ id: idProp, name = 'search_input', label, classNam
|
|
34
46
|
onFound(selectedItem.value);
|
35
47
|
setSelected(true);
|
36
48
|
};
|
37
|
-
return (React.createElement(Field, { className: className, renderAsTitle: renderAsTitle, id: id,
|
49
|
+
return (React.createElement(Field, Object.assign({ className: className, renderAsTitle: renderAsTitle, id: id, outlined: outlined, value: selectedResult }, otherProps),
|
38
50
|
React.createElement(React.Fragment, null,
|
39
51
|
React.createElement(StyledInputBox, { outlined: outlined, selected: selected },
|
40
52
|
showIcon && React.createElement(SearchIcon, { size: 24, render: "search", color: "subtext" }),
|
@@ -89,7 +101,7 @@ const StyledResultsContainer = styled.div `
|
|
89
101
|
${({ absolutePosition }) => absolutePosition && 'position: absolute;'}
|
90
102
|
width: 100%;
|
91
103
|
visibility: ${({ show }) => (show ? 'visible' : 'hidden')};
|
92
|
-
${({ outlined }) => outlined && 'left: 0px; top:
|
104
|
+
${({ outlined }) => outlined && 'left: 0px; top: 90%;'};
|
93
105
|
|
94
106
|
ul {
|
95
107
|
max-height: ${({ show }) => (show ? '192px' : '0px')};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"SearchInput.js","sourceRoot":"","sources":["../../src/SearchInput/SearchInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAM,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC3C,OAAO,MAAM,MAAM,mBAAmB,CAAA;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEjC,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,KAAK,EAAoB,MAAM,UAAU,CAAA;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;
|
1
|
+
{"version":3,"file":"SearchInput.js","sourceRoot":"","sources":["../../src/SearchInput/SearchInput.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAAM,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC3C,OAAO,MAAM,MAAM,mBAAmB,CAAA;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEjC,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,KAAK,EAAoB,MAAM,UAAU,CAAA;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAgBzC,MAAM,CAAC,MAAM,WAAW,GAAyB,CAAC,EAYjD,EAAE,EAAE;QAZ6C,EAChD,EAAE,EAAE,MAAM,EACV,IAAI,GAAG,cAAc,EACrB,SAAS,GAAG,EAAE,EACd,WAAW,EACX,UAAU,EACV,OAAO,EACP,uBAAuB,GAAG,KAAK,EAC/B,QAAQ,GAAG,KAAK,EA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CAAC,CAAC,QAAQ,CAAC;IACvD,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,QAAQ,IAAI,sBAAsB;;;kBAGtC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC;;CAEvD,CAAA;AAED,MAAM,WAAW,GAAG,MAAM,CAAC,EAAE,CAAa;;;;;;sBAMpB,KAAK,CAAC,MAAM,CAAC,KAAK;sBAClB,KAAK,CAAC,MAAM,CAAC,OAAO;;;;;IAKtC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CACjB,QAAQ;IACR;wBACoB,KAAK,CAAC,MAAM,CAAC,OAAO;GACzC;;;;;;aAMU,KAAK,CAAC,MAAM,CAAC,SAAS;;;;0BAIT,KAAK,CAAC,MAAM,CAAC,UAAU;;;CAGhD,CAAA;AAED,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA;;CAE9B,CAAA"}
|
@@ -3,38 +3,53 @@ import styled from 'styled-components';
|
|
3
3
|
import { Text } from '../Text';
|
4
4
|
import { Box } from '../Box';
|
5
5
|
import { SupportMessage } from './SupportMessage';
|
6
|
+
const variationList = [
|
7
|
+
{
|
8
|
+
type: 'info',
|
9
|
+
title: 'Additional information',
|
10
|
+
description: 'Information needs to be communicated to the user.',
|
11
|
+
},
|
12
|
+
{
|
13
|
+
type: 'info-outline',
|
14
|
+
title: 'Additional information',
|
15
|
+
description: 'Information needs to be communicated to the user.',
|
16
|
+
},
|
17
|
+
{
|
18
|
+
type: 'alert',
|
19
|
+
title: 'Potential issue',
|
20
|
+
description: 'The user should be aware and possibly exercise caution.',
|
21
|
+
},
|
22
|
+
{
|
23
|
+
type: 'warning',
|
24
|
+
title: 'Error encountered',
|
25
|
+
description: "An error has occurred, here's feedback on how to proceed.",
|
26
|
+
},
|
27
|
+
];
|
6
28
|
export const CollectionPage = () => {
|
7
|
-
return (React.createElement(Box, { flex: true, direction: "column" },
|
8
|
-
React.createElement(
|
9
|
-
React.createElement(
|
10
|
-
|
11
|
-
|
12
|
-
React.createElement(
|
13
|
-
|
14
|
-
|
15
|
-
React.createElement(
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
React.createElement(SupportMessage, { type: "alert", description: "Alert support message" })),
|
20
|
-
React.createElement(ContainerBox, null,
|
21
|
-
React.createElement(Label, { tag: "span", typo: "header-small" }, "Type alert - With title"),
|
22
|
-
React.createElement(SupportMessage, { type: "alert", title: "General alert title", description: "Alert support message" })),
|
23
|
-
React.createElement(ContainerBox, null,
|
24
|
-
React.createElement(Label, { tag: "span", typo: "header-small" }, "Type warning - Default"),
|
25
|
-
React.createElement(SupportMessage, { type: "warning", description: "Warning support message" })),
|
26
|
-
React.createElement(ContainerBox, null,
|
27
|
-
React.createElement(Label, { tag: "span", typo: "header-small" }, "Type warning - With title"),
|
28
|
-
React.createElement(SupportMessage, { type: "warning", title: "General warning title", description: "Warning support message" }))));
|
29
|
+
return (React.createElement(Box, { flex: true, direction: "column" }, variationList.map(({ type, title, description }) => {
|
30
|
+
return (React.createElement(Box, { key: type, flex: true, direction: "column", mb: "32px" },
|
31
|
+
React.createElement(Title, { tag: "span", typo: "header-medium" },
|
32
|
+
"Type: ",
|
33
|
+
type),
|
34
|
+
React.createElement(Box, { flex: true },
|
35
|
+
React.createElement(Label, { tag: "span", typo: "header-small" }, "Without title"),
|
36
|
+
React.createElement(SupportMessage, { type: type, description: description })),
|
37
|
+
React.createElement(Box, { flex: true, mt: "8px" },
|
38
|
+
React.createElement(Label, { tag: "span", typo: "header-small" }, "With title"),
|
39
|
+
React.createElement(SupportMessage, { type: type, title: title, description: description }))));
|
40
|
+
})));
|
29
41
|
};
|
30
|
-
const
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
42
|
+
const LABEL_WIDTH = '140px';
|
43
|
+
const Title = styled(Text) `
|
44
|
+
margin-bottom: 12px;
|
45
|
+
font-size: 18px;
|
46
|
+
line-height: 20px;
|
47
|
+
margin-left: ${LABEL_WIDTH};
|
35
48
|
`;
|
36
49
|
const Label = styled(Text) `
|
37
|
-
margin-
|
38
|
-
|
50
|
+
margin-bottom: 4px;
|
51
|
+
font-size: 14px;
|
52
|
+
width: ${LABEL_WIDTH};
|
53
|
+
flex-shrink: 0;
|
39
54
|
`;
|
40
55
|
//# sourceMappingURL=Collection.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Collection.js","sourceRoot":"","sources":["../../src/SupportMessage/Collection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAa,MAAM,OAAO,CAAA;AACjC,OAAO,MAAM,MAAM,mBAAmB,CAAA;AAEtC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAC5B,OAAO,EAAE,cAAc,
|
1
|
+
{"version":3,"file":"Collection.js","sourceRoot":"","sources":["../../src/SupportMessage/Collection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAa,MAAM,OAAO,CAAA;AACjC,OAAO,MAAM,MAAM,mBAAmB,CAAA;AAEtC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAC5B,OAAO,EAAE,cAAc,EAAuB,MAAM,kBAAkB,CAAA;AAEtE,MAAM,aAAa,GAA0B;IAC3C;QACE,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,wBAAwB;QAC/B,WAAW,EAAE,mDAAmD;KACjE;IACD;QACE,IAAI,EAAE,cAAc;QACpB,KAAK,EAAE,wBAAwB;QAC/B,WAAW,EAAE,mDAAmD;KACjE;IACD;QACE,IAAI,EAAE,OAAO;QACb,KAAK,EAAE,iBAAiB;QACxB,WAAW,EAAE,yDAAyD;KACvE;IACD;QACE,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,mBAAmB;QAC1B,WAAW,EAAE,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