@scottish-government/designsystem-react 0.1.2 → 0.1.4
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/.svgrrc +15 -0
- package/@types/common/Icon.d.ts +3 -5
- package/@types/components/Button.d.ts +1 -1
- package/@types/components/Pagination.d.ts +21 -0
- package/@types/components/TextInput.d.ts +1 -1
- package/@types/sgds.d.ts +1 -0
- package/README.md +3 -0
- package/dist/common/icon.jsx +48 -5
- package/dist/components/back-to-top/back-to-top.jsx +1 -1
- package/dist/components/confirmation-message/confirmation-message.jsx +1 -1
- package/dist/components/date-picker/date-picker.jsx +2 -0
- package/dist/components/notification-banner/notification-banner.jsx +4 -5
- package/dist/components/pagination/pagination.jsx +97 -0
- package/dist/components/select/select.jsx +1 -1
- package/dist/components/site-search/site-search.jsx +1 -1
- package/dist/components/text-input/text-input.jsx +1 -1
- package/dist/components/textarea/textarea.jsx +1 -1
- package/dist/icons/ArrowUpward.jsx +41 -0
- package/dist/icons/CalendarToday.jsx +41 -0
- package/dist/icons/Cancel.jsx +40 -0
- package/dist/icons/CheckCircle.jsx +41 -0
- package/dist/icons/ChevronLeft.jsx +41 -0
- package/dist/icons/ChevronRight.jsx +41 -0
- package/dist/icons/Close.jsx +41 -0
- package/dist/icons/Description.jsx +41 -0
- package/dist/icons/DoubleChevronLeft.jsx +41 -0
- package/dist/icons/DoubleChevronRight.jsx +41 -0
- package/dist/icons/Error.jsx +41 -0
- package/dist/icons/ExpandLess.jsx +41 -0
- package/dist/icons/ExpandMore.jsx +41 -0
- package/dist/icons/List.jsx +44 -0
- package/dist/icons/Menu.jsx +41 -0
- package/dist/icons/PriorityHigh.jsx +42 -0
- package/dist/icons/Search.jsx +41 -0
- package/dist/icons/index.js +40 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -1
- package/src/common/icon.test.tsx +5 -26
- package/src/common/icon.tsx +18 -13
- package/src/components/back-to-top/back-to-top.tsx +1 -1
- package/src/components/button/button.test.tsx +3 -3
- package/src/components/confirmation-message/confirmation-message.tsx +1 -1
- package/src/components/date-picker/date-picker.test.tsx +21 -0
- package/src/components/date-picker/date-picker.tsx +2 -0
- package/src/components/notification-banner/notification-banner.tsx +5 -5
- package/src/components/pagination/pagination.test.tsx +366 -0
- package/src/components/pagination/pagination.tsx +157 -0
- package/src/components/phase-banner/phase-banner.test.tsx +1 -1
- package/src/components/select/select.test.tsx +1 -0
- package/src/components/select/select.tsx +1 -0
- package/src/components/site-search/site-search.tsx +1 -1
- package/src/components/text-input/text-input.test.tsx +5 -4
- package/src/components/text-input/text-input.tsx +1 -0
- package/src/components/textarea/textarea.test.tsx +1 -0
- package/src/components/textarea/textarea.tsx +1 -0
- package/src/icons/ArrowUpward.tsx +15 -0
- package/src/icons/CalendarToday.tsx +15 -0
- package/src/icons/Cancel.tsx +13 -0
- package/src/icons/CheckCircle.tsx +15 -0
- package/src/icons/ChevronLeft.tsx +15 -0
- package/src/icons/ChevronRight.tsx +15 -0
- package/src/icons/Close.tsx +15 -0
- package/src/icons/Description.tsx +15 -0
- package/src/icons/DoubleChevronLeft.tsx +19 -0
- package/src/icons/DoubleChevronRight.tsx +19 -0
- package/src/icons/Error.tsx +15 -0
- package/src/icons/ExpandLess.tsx +15 -0
- package/src/icons/ExpandMore.tsx +15 -0
- package/src/icons/List.tsx +18 -0
- package/src/icons/Menu.tsx +15 -0
- package/src/icons/PriorityHigh.tsx +16 -0
- package/src/icons/Search.tsx +15 -0
- package/src/icons/index.ts +17 -0
package/.svgrrc
ADDED
package/@types/common/Icon.d.ts
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
declare namespace SGDS.Common {
|
|
2
2
|
interface Icon extends React.AllHTMLAttributes<SVGSVGElement> {
|
|
3
|
-
|
|
3
|
+
ariaLabel?: string,
|
|
4
4
|
className?: string,
|
|
5
5
|
fill?: boolean,
|
|
6
|
-
icon:
|
|
7
|
-
|
|
8
|
-
iconSize?: string,
|
|
9
|
-
title?: string
|
|
6
|
+
icon: IconName,
|
|
7
|
+
iconSize?: string
|
|
10
8
|
}
|
|
11
9
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
declare namespace SGDS.Component {
|
|
2
|
+
namespace Pagination {
|
|
3
|
+
interface Page extends React.AllHTMLAttributes<HTMLElement> {
|
|
4
|
+
ariaLabel: string,
|
|
5
|
+
current?: boolean,
|
|
6
|
+
href: string,
|
|
7
|
+
onClick?: React.EventHandler<any>,
|
|
8
|
+
text: string
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
interface Pagination extends React.AllHTMLAttributes<HTMLElement> {
|
|
13
|
+
ariaLabel: string,
|
|
14
|
+
className?: string,
|
|
15
|
+
onClick?: React.EventHandler<any>,
|
|
16
|
+
padding: number,
|
|
17
|
+
page: number,
|
|
18
|
+
pattern: string,
|
|
19
|
+
totalPages: number
|
|
20
|
+
}
|
|
21
|
+
}
|
package/@types/sgds.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
declare namespace SGDS {
|
|
2
2
|
type AriaLive = 'polite' | 'assertive';
|
|
3
3
|
type HeaderLevel = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
4
|
+
type IconName = 'ArrowUpward' | 'CalendarToday' | 'Cancel' | 'CheckCircle' | 'ChevronLeft' | 'ChevronRight' | 'Close' | 'Description' | 'DoubleChevronLeft' | 'DoubleChevronRight' | 'Error' | 'ExpandLess' | 'ExpandMore' | 'List' | 'Menu' | 'PriorityHigh' | 'Search';
|
|
4
5
|
type InputWidth = 'fixed-20' | 'fixed-10' | 'fixed-5' | 'fixed-4' | 'fixed-3' | 'fixed-2' | 'fluid-three-quarters' | 'fluid-two-thirds' | 'fluid-half' | 'fluid-one-third' | 'fluid-one-quarter';
|
|
5
6
|
type TagColour = 'grey' | 'green' | 'teal' | 'blue' | 'purple' | 'pink' | 'red' | 'orange' | 'yellow';
|
|
6
7
|
|
package/README.md
CHANGED
|
@@ -24,3 +24,6 @@ Run unit tests
|
|
|
24
24
|
|
|
25
25
|
`npm run coverage`
|
|
26
26
|
Run unit tests and output a coverage report, located in `/coverage`
|
|
27
|
+
|
|
28
|
+
`npm run svgr`
|
|
29
|
+
Create icon components for each SVG icon used by the Design System. These icon components are present in the repository. You likely will never need to run this command as an end user.
|
package/dist/common/icon.jsx
CHANGED
|
@@ -1,14 +1,57 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
2
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const
|
|
4
|
-
|
|
39
|
+
const react_1 = __importDefault(require("react"));
|
|
40
|
+
const Icons = __importStar(require("../icons"));
|
|
41
|
+
const Icon = ({ ariaLabel, className, fill, icon, iconSize }) => {
|
|
42
|
+
const Component = react_1.default.createElement(Icons[icon], {
|
|
43
|
+
'aria-hidden': ariaLabel ? undefined : true,
|
|
44
|
+
'aria-label': ariaLabel,
|
|
45
|
+
className: [
|
|
5
46
|
'ds_icon',
|
|
6
47
|
className,
|
|
7
48
|
fill && 'ds_icon--fill',
|
|
8
49
|
iconSize && `ds_icon--${iconSize}`
|
|
9
|
-
].join(' ')
|
|
10
|
-
|
|
11
|
-
|
|
50
|
+
].join(' ')
|
|
51
|
+
});
|
|
52
|
+
return (<>
|
|
53
|
+
{Component}
|
|
54
|
+
</>);
|
|
12
55
|
};
|
|
13
56
|
Icon.displayName = 'Icon';
|
|
14
57
|
exports.default = Icon;
|
|
@@ -19,7 +19,7 @@ const BackToTop = ({ className, href = '#page-top', ...props }) => {
|
|
|
19
19
|
className
|
|
20
20
|
].join(' ')} ref={ref} {...props}>
|
|
21
21
|
<a href={href} className="ds_back-to-top__button">Back to top
|
|
22
|
-
<icon_1.default className="ds_back-to-top__icon" icon="
|
|
22
|
+
<icon_1.default className="ds_back-to-top__icon" icon="ArrowUpward"/>
|
|
23
23
|
</a>
|
|
24
24
|
</div>);
|
|
25
25
|
};
|
|
@@ -10,7 +10,7 @@ const ConfirmationMessage = ({ ariaLive = 'polite', children, className, headerL
|
|
|
10
10
|
'ds_confirmation-message',
|
|
11
11
|
className
|
|
12
12
|
].join(' ')} {...props}>
|
|
13
|
-
<icon_1.default className="ds_confirmation-message__icon" icon="
|
|
13
|
+
<icon_1.default className="ds_confirmation-message__icon" icon="CheckCircle" iconSize="24"/>
|
|
14
14
|
|
|
15
15
|
<wrapper_tag_1.default className="ds_confirmation-message__title" tagName={headerLevel}>
|
|
16
16
|
{title}
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const react_1 = require("react");
|
|
7
7
|
// @ts-ignore
|
|
8
8
|
const date_picker_1 = __importDefault(require("@scottish-government/design-system/src/components/date-picker/date-picker"));
|
|
9
|
+
const error_message_1 = __importDefault(require("../error-message/error-message"));
|
|
9
10
|
const text_input_1 = __importDefault(require("../text-input/text-input"));
|
|
10
11
|
const DatePicker = ({ className, disabledDates, error, errorMessage, hintText, id, iconPath = './', label, maxDate, minDate, multiple, name, onBlur, onChange, value, width = 'fixed-10', ...props }) => {
|
|
11
12
|
// todo: dateSelectCallback function
|
|
@@ -32,6 +33,7 @@ const DatePicker = ({ className, disabledDates, error, errorMessage, hintText, i
|
|
|
32
33
|
].join(' ')} data-disableddates={disabledDates} data-maxdate={maxDate} data-mindate={minDate} data-module="ds-datepicker" ref={ref} {...props}>
|
|
33
34
|
{(multiple ? (<fieldset className="ds_datepicker__input-wrapper">
|
|
34
35
|
<legend>{label}</legend>
|
|
36
|
+
{errorMessage && <error_message_1.default text={errorMessage}/>}
|
|
35
37
|
<div>
|
|
36
38
|
<text_input_1.default className="js-datepicker-date" error={!!error} id={id + "-day"} hintText={hintText} label="Day" name={name + "-day"} onBlur={handleBlur} onChange={handleChange} value={value?.split('/')[0]} width="fixed-2"/>
|
|
37
39
|
</div>
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const react_1 = require("react");
|
|
7
7
|
// @ts-ignore
|
|
8
8
|
const notification_banner_1 = __importDefault(require("@scottish-government/design-system/src/components/notification-banner/notification-banner"));
|
|
9
|
-
const button_1 = __importDefault(require("../button/button"));
|
|
10
9
|
const icon_1 = __importDefault(require("../../common/icon"));
|
|
11
10
|
const screen_reader_text_1 = __importDefault(require("../../common/screen-reader-text"));
|
|
12
11
|
const NotificationBanner = ({ children, className, close, icon, iconColour, iconInverse, title = 'Information', ...props }) => {
|
|
@@ -34,7 +33,7 @@ const NotificationBanner = ({ children, className, close, icon, iconColour, icon
|
|
|
34
33
|
iconInverse && 'ds_notification__icon--inverse',
|
|
35
34
|
iconColour && 'ds_notification__icon--colour'
|
|
36
35
|
].join(' ')} aria-hidden="true">
|
|
37
|
-
<icon_1.default icon="
|
|
36
|
+
<icon_1.default icon="PriorityHigh"/>
|
|
38
37
|
</span>}
|
|
39
38
|
|
|
40
39
|
<div className="ds_notification__text">
|
|
@@ -42,10 +41,10 @@ const NotificationBanner = ({ children, className, close, icon, iconColour, icon
|
|
|
42
41
|
</div>
|
|
43
42
|
|
|
44
43
|
{close &&
|
|
45
|
-
<
|
|
44
|
+
<button type="button" className="ds_notification__close js-close-notification">
|
|
46
45
|
<screen_reader_text_1.default>Close this notification</screen_reader_text_1.default>
|
|
47
|
-
<icon_1.default fill icon="
|
|
48
|
-
</
|
|
46
|
+
<icon_1.default fill icon="Close" aria-hidden="true"/>
|
|
47
|
+
</button>}
|
|
49
48
|
</div>
|
|
50
49
|
</div>
|
|
51
50
|
</div>);
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Ellipsis = exports.Page = void 0;
|
|
7
|
+
const icon_1 = __importDefault(require("../../common/icon"));
|
|
8
|
+
const Page = ({ ariaLabel, current = false, href, onClick, text }) => {
|
|
9
|
+
function handleClick(event) {
|
|
10
|
+
if (typeof onClick === 'function') {
|
|
11
|
+
onClick(event);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return (<li className="ds_pagination__item">
|
|
15
|
+
<a aria-label={ariaLabel} className={[
|
|
16
|
+
'ds_pagination__link',
|
|
17
|
+
current ? 'ds_current' : undefined
|
|
18
|
+
].join(' ')} href={href} aria-current={current ? "page" : undefined} onClick={handleClick}>
|
|
19
|
+
<span className="ds_pagination__link-label">{text}</span>
|
|
20
|
+
</a>
|
|
21
|
+
</li>);
|
|
22
|
+
};
|
|
23
|
+
exports.Page = Page;
|
|
24
|
+
const Ellipsis = () => {
|
|
25
|
+
return (<li className="ds_pagination__item" aria-hidden="true">
|
|
26
|
+
<span className="ds_pagination__link ds_pagination__link--ellipsis">…</span>
|
|
27
|
+
</li>);
|
|
28
|
+
};
|
|
29
|
+
exports.Ellipsis = Ellipsis;
|
|
30
|
+
const Pagination = ({ ariaLabel = 'Pages', className, onClick, padding = 1, page = 1, pattern = '/search?page=$1', totalPages, ...props }) => {
|
|
31
|
+
padding = Number(padding);
|
|
32
|
+
page = Number(page);
|
|
33
|
+
const minToShow = padding + 2;
|
|
34
|
+
let includeFirst, includeLast;
|
|
35
|
+
let pages = [];
|
|
36
|
+
if (page <= minToShow) {
|
|
37
|
+
for (let i = 1; i <= minToShow + 1; i++) {
|
|
38
|
+
pages.push(Number(i));
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
else if (page <= totalPages - minToShow) {
|
|
42
|
+
pages = [page];
|
|
43
|
+
for (let i = 0; i < padding; i++) {
|
|
44
|
+
pages.unshift(page - 1 - i);
|
|
45
|
+
pages.push(Number(page) + 1 + i);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
for (let i = totalPages; i > totalPages - minToShow - 1; i--) {
|
|
50
|
+
pages.push(Number(i));
|
|
51
|
+
}
|
|
52
|
+
pages.reverse();
|
|
53
|
+
}
|
|
54
|
+
// filter out pages that are out of bounds
|
|
55
|
+
pages = pages.filter(item => item > 0 && item <= totalPages);
|
|
56
|
+
if ((page - padding) > 2) {
|
|
57
|
+
includeFirst = true;
|
|
58
|
+
}
|
|
59
|
+
if ((page + padding < totalPages - 1)) {
|
|
60
|
+
includeLast = true;
|
|
61
|
+
}
|
|
62
|
+
return (<nav className={[
|
|
63
|
+
'ds_pagination',
|
|
64
|
+
className
|
|
65
|
+
].join(' ')} aria-label={ariaLabel} {...props}>
|
|
66
|
+
<ul className="ds_pagination__list">
|
|
67
|
+
{page > 1 && (<li className="ds_pagination__item">
|
|
68
|
+
<a aria-label="Previous page" className="ds_pagination__link ds_pagination__link--text ds_pagination__link--icon" href={pattern.replace('$1', String(page - 1))} data-search="pagination-previous" onClick={onClick}>
|
|
69
|
+
<icon_1.default icon="ChevronLeft"/>
|
|
70
|
+
<span className="ds_pagination__link-label">Previous</span>
|
|
71
|
+
</a>
|
|
72
|
+
</li>)}
|
|
73
|
+
|
|
74
|
+
{includeFirst && (<>
|
|
75
|
+
<exports.Page ariaLabel="Page 1" href={pattern.replace('$1', String(1))} onClick={onClick} text="1"/>
|
|
76
|
+
<exports.Ellipsis />
|
|
77
|
+
</>)}
|
|
78
|
+
|
|
79
|
+
{pages && pages.map((item, index) => (<exports.Page ariaLabel={`Page ${item}`} current={item === page} href={pattern.replace('$1', String(item))} key={`pagination${index}`} onClick={onClick} pattern={pattern} text={item.toString()}/>))}
|
|
80
|
+
|
|
81
|
+
{includeLast && (<>
|
|
82
|
+
<exports.Ellipsis />
|
|
83
|
+
<exports.Page ariaLabel={`Page ${totalPages}`} href={pattern.replace('$1', String(totalPages))} onClick={onClick} pattern={pattern} text={totalPages.toString()}/>
|
|
84
|
+
</>)}
|
|
85
|
+
|
|
86
|
+
{page < totalPages && (<li className="ds_pagination__item">
|
|
87
|
+
<a aria-label="Next page" className="ds_pagination__link ds_pagination__link--text ds_pagination__link--icon" href={pattern.replace('$1', String(page + 1))} data-search="pagination-next" onClick={onClick}>
|
|
88
|
+
<span className="ds_pagination__link-label">Next</span>
|
|
89
|
+
<icon_1.default icon="ChevronRight"/>
|
|
90
|
+
</a>
|
|
91
|
+
</li>)}
|
|
92
|
+
|
|
93
|
+
</ul>
|
|
94
|
+
</nav>);
|
|
95
|
+
};
|
|
96
|
+
Pagination.displayName = 'Pagination';
|
|
97
|
+
exports.default = Pagination;
|
|
@@ -40,7 +40,7 @@ const Select = function ({ className, defaultValue, error, errorMessage, hintTex
|
|
|
40
40
|
width && `ds_input--${width}`,
|
|
41
41
|
className
|
|
42
42
|
].join(' ')} {...props}>
|
|
43
|
-
<select aria-describedby={describedbys.join(' ')} className="ds_select" defaultValue={defaultValue} id={id} name={name || id} onBlur={handleBlur} onChange={handleChange}>
|
|
43
|
+
<select aria-describedby={describedbys.join(' ')} aria-invalid={error} className="ds_select" defaultValue={defaultValue} id={id} name={name || id} onBlur={handleBlur} onChange={handleChange}>
|
|
44
44
|
<option value="">{placeholder}</option>
|
|
45
45
|
{options && options.map((option, index) => (<Option value={option.value} text={option.text} key={`option-${index}`}/>))}
|
|
46
46
|
</select>
|
|
@@ -42,7 +42,7 @@ const SiteSearch = function ({ action = '/search', autocompleteEndpoint, autocom
|
|
|
42
42
|
hasAutocomplete ? 'js-autocomplete-input' : undefined
|
|
43
43
|
].join(' ')} id={id} name={name} placeholder={placeholder} required spellCheck="false" type="search"/>
|
|
44
44
|
|
|
45
|
-
<button_1.default type="submit" icon="
|
|
45
|
+
<button_1.default type="submit" icon="Search" iconOnly>Search</button_1.default>
|
|
46
46
|
|
|
47
47
|
{hasAutocomplete && (<div id="autocomplete-suggestions" className="ds_autocomplete__suggestions">
|
|
48
48
|
<ol className="ds_autocomplete__suggestions-list" role="listbox" aria-labelledby="site-search-label"></ol>
|
|
@@ -44,7 +44,7 @@ const TextInput = ({ buttonIcon, buttonText, children, className, countThreshold
|
|
|
44
44
|
{hintText && <hint_text_1.default id={hintTextId} text={hintText}/>}
|
|
45
45
|
{errorMessage && <error_message_1.default id={errorMessageId} text={errorMessage}/>}
|
|
46
46
|
<conditional_wrapper_1.default condition={hasButton || typeof currency !== 'undefined' && currency} wrapper={(children) => <div className={inputWrapperClasses} data-symbol={currencySymbol}>{children}</div>}>
|
|
47
|
-
<input aria-describedby={describedbys.join(' ')} className={[
|
|
47
|
+
<input aria-describedby={describedbys.join(' ')} aria-invalid={error} className={[
|
|
48
48
|
'ds_input',
|
|
49
49
|
className,
|
|
50
50
|
error ? 'ds_input--error' : '',
|
|
@@ -42,7 +42,7 @@ const Textarea = ({ className, countThreshold, error, errorMessage, hintText, id
|
|
|
42
42
|
{hintText && <hint_text_1.default id={hintTextId} text={hintText}/>}
|
|
43
43
|
{errorMessage && <error_message_1.default id={errorMessageId} text={errorMessage}/>}
|
|
44
44
|
|
|
45
|
-
<textarea aria-describedby={describedbys.join(' ')} className={[
|
|
45
|
+
<textarea aria-describedby={describedbys.join(' ')} aria-invalid={error} className={[
|
|
46
46
|
'ds_input',
|
|
47
47
|
error && 'ds_input--error',
|
|
48
48
|
className
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
const React = __importStar(require("react"));
|
|
37
|
+
const SvgArrowUpward = (props) => (<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#000000" role="img" {...props}>
|
|
38
|
+
<path d="M0 0h24v24H0V0z" fill="none"/>
|
|
39
|
+
<path d="M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z"/>
|
|
40
|
+
</svg>);
|
|
41
|
+
exports.default = SvgArrowUpward;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
const React = __importStar(require("react"));
|
|
37
|
+
const SvgCalendarToday = (props) => (<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#000000" role="img" {...props}>
|
|
38
|
+
<path d="M0 0h24v24H0z" fill="none"/>
|
|
39
|
+
<path d="M20 3h-1V1h-2v2H7V1H5v2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 18H4V8h16v13z"/>
|
|
40
|
+
</svg>);
|
|
41
|
+
exports.default = SvgCalendarToday;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
const React = __importStar(require("react"));
|
|
37
|
+
const SvgCancel = (props) => (<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" role="img" {...props}>
|
|
38
|
+
<path d="m336-280 144-144 144 144 56-56-144-144 144-144-56-56-144 144-144-144-56 56 144 144-144 144 56 56ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Z"/>
|
|
39
|
+
</svg>);
|
|
40
|
+
exports.default = SvgCancel;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
const React = __importStar(require("react"));
|
|
37
|
+
const SvgCheckCircle = (props) => (<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#000000" role="img" {...props}>
|
|
38
|
+
<path d="M0 0h24v24H0z" fill="none"/>
|
|
39
|
+
<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/>
|
|
40
|
+
</svg>);
|
|
41
|
+
exports.default = SvgCheckCircle;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
const React = __importStar(require("react"));
|
|
37
|
+
const SvgChevronLeft = (props) => (<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#000000" role="img" {...props}>
|
|
38
|
+
<path d="M0 0h24v24H0z" fill="none"/>
|
|
39
|
+
<path d="M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"/>
|
|
40
|
+
</svg>);
|
|
41
|
+
exports.default = SvgChevronLeft;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
const React = __importStar(require("react"));
|
|
37
|
+
const SvgChevronRight = (props) => (<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#000000" role="img" {...props}>
|
|
38
|
+
<path d="M0 0h24v24H0z" fill="none"/>
|
|
39
|
+
<path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"/>
|
|
40
|
+
</svg>);
|
|
41
|
+
exports.default = SvgChevronRight;
|