@via-profit/ui-kit 0.1.0-rc.76 → 0.1.0-rc.78
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/Accordion/AccordionActions.d.ts +8 -0
- package/Accordion/AccordionActions.js +31 -0
- package/Accordion/AccordionContainer.d.ts +8 -0
- package/Accordion/AccordionContainer.js +61 -0
- package/Accordion/AccordionContent.d.ts +10 -0
- package/Accordion/AccordionContent.js +35 -0
- package/Accordion/AccordionHeader.d.ts +10 -0
- package/Accordion/AccordionHeader.js +53 -0
- package/Accordion/Chevron.d.ts +4 -0
- package/Accordion/Chevron.js +13 -0
- package/Accordion/index.d.ts +86 -0
- package/Accordion/index.js +65 -0
- package/Button/ButtonIconWrapper.d.ts +1 -1
- package/Calendar/CalendarBottomBar.d.ts +4 -0
- package/Calendar/CalendarBottomBar.js +28 -0
- package/Calendar/CalendarMonthControl.d.ts +6 -0
- package/Calendar/CalendarMonthControl.js +41 -0
- package/Calendar/IconChevronLeft.d.ts +3 -0
- package/Calendar/IconChevronLeft.js +9 -0
- package/CountryFlags/Uknown.d.ts +3 -0
- package/CountryFlags/Uknown.js +34 -0
- package/Selectbox/IconShow.d.ts +3 -0
- package/Selectbox/IconShow.js +9 -0
- package/Switch/SwitchAsterisk.d.ts +13 -0
- package/Switch/SwitchAsterisk.js +53 -0
- package/Switch/SwitchContainer.d.ts +26 -0
- package/Switch/SwitchContainer.js +52 -0
- package/Switch/SwitchDot.d.ts +17 -0
- package/Switch/SwitchDot.js +145 -0
- package/Switch/SwitchErrorText.d.ts +6 -0
- package/Switch/SwitchErrorText.js +76 -0
- package/Switch/SwitchTextWrapper.d.ts +4 -0
- package/Switch/SwitchTextWrapper.js +30 -0
- package/Switch/SwitchToggleWrapper.d.ts +4 -0
- package/Switch/SwitchToggleWrapper.js +57 -0
- package/Switch/SwitchTrack.d.ts +17 -0
- package/Switch/SwitchTrack.js +80 -0
- package/Switch/SwitchWrapper.d.ts +4 -0
- package/Switch/SwitchWrapper.js +31 -0
- package/Switch/index.d.ts +138 -0
- package/Switch/index.js +56 -0
- package/TextArea/TextAreaIconWrapper.d.ts +1 -1
- package/TextField/TextFieldIconWrapper.d.ts +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type AccordionActionsProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
3
|
+
readonly noPadding?: boolean;
|
|
4
|
+
};
|
|
5
|
+
declare const _default: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
6
|
+
readonly noPadding?: boolean | undefined;
|
|
7
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
const react_1 = __importDefault(require("react"));
|
|
18
|
+
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
19
|
+
const StyledActions = styled_1.default.div `
|
|
20
|
+
display: flex;
|
|
21
|
+
align-items: center;
|
|
22
|
+
justify-content: flex-end;
|
|
23
|
+
padding: ${({ $noPadding }) => ($noPadding ? '0' : '1rem 0')};
|
|
24
|
+
border-bottom-left-radius: inherit;
|
|
25
|
+
border-bottom-right-radius: inherit;
|
|
26
|
+
`;
|
|
27
|
+
const AccordionActions = (props, ref) => {
|
|
28
|
+
const { children, noPadding } = props, nativeProps = __rest(props, ["children", "noPadding"]);
|
|
29
|
+
return (react_1.default.createElement(StyledActions, Object.assign({}, nativeProps, { "$noPadding": Boolean(noPadding), ref: ref }), children));
|
|
30
|
+
};
|
|
31
|
+
exports.default = react_1.default.forwardRef(AccordionActions);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type AccordionContainerProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
3
|
+
readonly inline?: boolean;
|
|
4
|
+
};
|
|
5
|
+
declare const _default: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
6
|
+
readonly inline?: boolean | undefined;
|
|
7
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
const react_1 = __importDefault(require("react"));
|
|
18
|
+
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
19
|
+
const StyledAccordionContainer = styled_1.default.div `
|
|
20
|
+
display: ${({ $inline }) => ($inline ? 'inline-flex' : 'flex')};
|
|
21
|
+
box-sizing: border-box;
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
background: ${({ theme }) => theme.color.surface.toString()};
|
|
24
|
+
color: ${({ theme }) => theme.color.textPrimary.toString()};
|
|
25
|
+
border-radius: ${({ theme }) => theme.shape.radiusFactor}em;
|
|
26
|
+
font-size: 1em;
|
|
27
|
+
position: relative;
|
|
28
|
+
margin-top: 1px;
|
|
29
|
+
box-shadow:
|
|
30
|
+
${({ theme }) => theme.isDark
|
|
31
|
+
? theme.color.backgroundSecondary.lighten(80).alpha(0.2).toString()
|
|
32
|
+
: theme.color.backgroundSecondary.lighten(50).alpha(0.2).toString()}
|
|
33
|
+
0px 2px 1px -1px,
|
|
34
|
+
${({ theme }) => theme.isDark
|
|
35
|
+
? theme.color.backgroundSecondary.lighten(80).alpha(0.14).toString()
|
|
36
|
+
: theme.color.backgroundSecondary.lighten(50).alpha(0.14).toString()}
|
|
37
|
+
0px 1px 1px 0px,
|
|
38
|
+
${({ theme }) => theme.isDark
|
|
39
|
+
? theme.color.backgroundSecondary.lighten(80).alpha(0.12).toString()
|
|
40
|
+
: theme.color.backgroundSecondary.lighten(50).alpha(0.12).toString()}
|
|
41
|
+
0px 1px 3px 0px;
|
|
42
|
+
margin-top: 1px;
|
|
43
|
+
|
|
44
|
+
&:has(+ div[class*='StyledAccordionContainer']) {
|
|
45
|
+
border-radius: ${({ theme }) => theme.shape.radiusFactor}em
|
|
46
|
+
${({ theme }) => theme.shape.radiusFactor}em 0 0;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
& + div[class*='StyledAccordionContainer'] {
|
|
50
|
+
border-radius: 0 0 0 0;
|
|
51
|
+
}
|
|
52
|
+
&:not(:has(+ div[class*='StyledAccordionContainer'])) {
|
|
53
|
+
border-radius: 0 0 ${({ theme }) => theme.shape.radiusFactor}em
|
|
54
|
+
${({ theme }) => theme.shape.radiusFactor}em;
|
|
55
|
+
}
|
|
56
|
+
`;
|
|
57
|
+
const AccordionContainer = (props, ref) => {
|
|
58
|
+
const { inline, children } = props, nativeProps = __rest(props, ["inline", "children"]);
|
|
59
|
+
return (react_1.default.createElement(StyledAccordionContainer, Object.assign({ "$inline": inline }, nativeProps, { ref: ref }), children));
|
|
60
|
+
};
|
|
61
|
+
exports.default = react_1.default.forwardRef(AccordionContainer);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type AccordionContentProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
3
|
+
readonly noPadding?: boolean;
|
|
4
|
+
readonly isOpen: boolean;
|
|
5
|
+
};
|
|
6
|
+
declare const _default: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
7
|
+
readonly noPadding?: boolean | undefined;
|
|
8
|
+
readonly isOpen: boolean;
|
|
9
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
const react_1 = __importDefault(require("react"));
|
|
18
|
+
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
19
|
+
const StyledAccordionContent = styled_1.default.div `
|
|
20
|
+
flex: 1;
|
|
21
|
+
overflow: auto;
|
|
22
|
+
transition: all 0.3s ease-out;
|
|
23
|
+
max-height: ${({ $isOpen }) => (!$isOpen ? '0px' : '90vh')};
|
|
24
|
+
box-sizing: content-box;
|
|
25
|
+
overflow: hidden;
|
|
26
|
+
`;
|
|
27
|
+
const Wrapper = styled_1.default.div `
|
|
28
|
+
padding: ${({ $noPadding }) => ($noPadding ? '0' : '1rem')};
|
|
29
|
+
`;
|
|
30
|
+
const AccordionContent = (props, ref) => {
|
|
31
|
+
const { children, noPadding, isOpen } = props, nativeProps = __rest(props, ["children", "noPadding", "isOpen"]);
|
|
32
|
+
return (react_1.default.createElement(StyledAccordionContent, Object.assign({ "$isOpen": isOpen }, nativeProps, { ref: ref }),
|
|
33
|
+
react_1.default.createElement(Wrapper, { "$noPadding": Boolean(noPadding) }, children)));
|
|
34
|
+
};
|
|
35
|
+
exports.default = react_1.default.forwardRef(AccordionContent);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type AccordionHeaderProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
3
|
+
readonly isOpen: boolean;
|
|
4
|
+
readonly onOpen: () => void;
|
|
5
|
+
};
|
|
6
|
+
declare const _default: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
7
|
+
readonly isOpen: boolean;
|
|
8
|
+
readonly onOpen: () => void;
|
|
9
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
const react_1 = __importDefault(require("react"));
|
|
18
|
+
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
19
|
+
const Button_1 = __importDefault(require("../Button"));
|
|
20
|
+
const Chevron_1 = __importDefault(require("./Chevron"));
|
|
21
|
+
const StyledHeader = styled_1.default.div `
|
|
22
|
+
padding: 1rem 1rem 1rem 1rem;
|
|
23
|
+
font-size: 1.3rem;
|
|
24
|
+
font-weight: 600;
|
|
25
|
+
border-top-left-radius: inherit;
|
|
26
|
+
border-top-right-radius: inherit;
|
|
27
|
+
display: flex;
|
|
28
|
+
cursor: pointer;
|
|
29
|
+
flex-direction: row;
|
|
30
|
+
flex-wrap: nowrap;
|
|
31
|
+
align-items: center;
|
|
32
|
+
`;
|
|
33
|
+
const StyledChevron = (0, styled_1.default)(Chevron_1.default, { shouldForwardProp: p => p[0] !== '$' }) `
|
|
34
|
+
transform: ${({ $isOpen }) => (!$isOpen ? 'rotate(180deg)' : 'rotate(0)')};
|
|
35
|
+
transition: all 0.3s ease-out;
|
|
36
|
+
`;
|
|
37
|
+
const StyledButton = (0, styled_1.default)(Button_1.default) `
|
|
38
|
+
width: 1rem;
|
|
39
|
+
height: 1rem;
|
|
40
|
+
`;
|
|
41
|
+
const HeaderCell = styled_1.default.div `
|
|
42
|
+
flex: 1;
|
|
43
|
+
`;
|
|
44
|
+
const Actions = styled_1.default.div ``;
|
|
45
|
+
const AccordionHeader = (props, ref) => {
|
|
46
|
+
const { children, isOpen, onOpen } = props, nativeProps = __rest(props, ["children", "isOpen", "onOpen"]);
|
|
47
|
+
return (react_1.default.createElement(StyledHeader, Object.assign({}, nativeProps, { ref: ref, onClick: () => onOpen() }),
|
|
48
|
+
react_1.default.createElement(HeaderCell, null, children),
|
|
49
|
+
react_1.default.createElement(Actions, null,
|
|
50
|
+
react_1.default.createElement(StyledButton, { iconOnly: true, onClick: () => onOpen() },
|
|
51
|
+
react_1.default.createElement(StyledChevron, { "$isOpen": isOpen })))));
|
|
52
|
+
};
|
|
53
|
+
exports.default = react_1.default.forwardRef(AccordionHeader);
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
8
|
+
const Path = styled_1.default.path `
|
|
9
|
+
fill: ${({ theme }) => theme.color.accentSecondary.toString()};
|
|
10
|
+
`;
|
|
11
|
+
const Spinner = (props, ref) => (react_1.default.createElement("svg", Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", viewBox: "0 0 24 24" }, props, { ref: ref }),
|
|
12
|
+
react_1.default.createElement(Path, { d: "M7.41,15.41L12,10.83L16.59,15.41L18,14L12,8L6,14L7.41,15.41Z" })));
|
|
13
|
+
exports.default = react_1.default.forwardRef(Spinner);
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { AccordionContainerProps } from './AccordionContainer';
|
|
3
|
+
import { AccordionHeaderProps } from './AccordionHeader';
|
|
4
|
+
import { AccordionContentProps } from './AccordionContent';
|
|
5
|
+
import { AccordionActionsProps } from './AccordionActions';
|
|
6
|
+
export type AccordionProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
7
|
+
readonly children: React.ReactNode | React.ReactNode[];
|
|
8
|
+
/**
|
|
9
|
+
* Header content
|
|
10
|
+
*/
|
|
11
|
+
readonly header?: JSX.Element | string;
|
|
12
|
+
/**
|
|
13
|
+
* Actions content
|
|
14
|
+
*/
|
|
15
|
+
readonly actions?: JSX.Element | string;
|
|
16
|
+
/**
|
|
17
|
+
* Overridable components map
|
|
18
|
+
*/
|
|
19
|
+
readonly overrides?: AccordionOverrides;
|
|
20
|
+
/**
|
|
21
|
+
* This props ovveride default component open state
|
|
22
|
+
*/
|
|
23
|
+
readonly isOpen?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* If `true` accordion will be opened by default
|
|
26
|
+
*/
|
|
27
|
+
readonly defaultOpened?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Callback function witch should open the accordion. You can forward your own function to make accordion controlled
|
|
30
|
+
*/
|
|
31
|
+
readonly onOpen?: () => void;
|
|
32
|
+
/**
|
|
33
|
+
* If `true` initial padding of accorion content would be disabled
|
|
34
|
+
*/
|
|
35
|
+
readonly noPadding?: boolean;
|
|
36
|
+
};
|
|
37
|
+
export interface AccordionOverrides {
|
|
38
|
+
/**
|
|
39
|
+
* Accordion container component
|
|
40
|
+
*/
|
|
41
|
+
readonly Container?: React.ForwardRefExoticComponent<AccordionContainerProps & React.RefAttributes<HTMLDivElement>>;
|
|
42
|
+
/**
|
|
43
|
+
* Accordion header component
|
|
44
|
+
*/
|
|
45
|
+
readonly Header?: React.ForwardRefExoticComponent<AccordionHeaderProps & React.RefAttributes<HTMLDivElement>>;
|
|
46
|
+
/**
|
|
47
|
+
* Accordion content component
|
|
48
|
+
*/
|
|
49
|
+
readonly Content?: React.ForwardRefExoticComponent<AccordionContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
50
|
+
/**
|
|
51
|
+
* Accordion footer component
|
|
52
|
+
*/
|
|
53
|
+
readonly Actions?: React.ForwardRefExoticComponent<AccordionActionsProps & React.RefAttributes<HTMLDivElement>>;
|
|
54
|
+
}
|
|
55
|
+
declare const _default: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
56
|
+
readonly children: React.ReactNode | React.ReactNode[];
|
|
57
|
+
/**
|
|
58
|
+
* Header content
|
|
59
|
+
*/
|
|
60
|
+
readonly header?: string | JSX.Element | undefined;
|
|
61
|
+
/**
|
|
62
|
+
* Actions content
|
|
63
|
+
*/
|
|
64
|
+
readonly actions?: string | JSX.Element | undefined;
|
|
65
|
+
/**
|
|
66
|
+
* Overridable components map
|
|
67
|
+
*/
|
|
68
|
+
readonly overrides?: AccordionOverrides | undefined;
|
|
69
|
+
/**
|
|
70
|
+
* This props ovveride default component open state
|
|
71
|
+
*/
|
|
72
|
+
readonly isOpen?: boolean | undefined;
|
|
73
|
+
/**
|
|
74
|
+
* If `true` accordion will be opened by default
|
|
75
|
+
*/
|
|
76
|
+
readonly defaultOpened?: boolean | undefined;
|
|
77
|
+
/**
|
|
78
|
+
* Callback function witch should open the accordion. You can forward your own function to make accordion controlled
|
|
79
|
+
*/
|
|
80
|
+
readonly onOpen?: (() => void) | undefined;
|
|
81
|
+
/**
|
|
82
|
+
* If `true` initial padding of accorion content would be disabled
|
|
83
|
+
*/
|
|
84
|
+
readonly noPadding?: boolean | undefined;
|
|
85
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
86
|
+
export default _default;
|
|
@@ -0,0 +1,65 @@
|
|
|
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 (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
26
|
+
var t = {};
|
|
27
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
28
|
+
t[p] = s[p];
|
|
29
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
30
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
31
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
32
|
+
t[p[i]] = s[p[i]];
|
|
33
|
+
}
|
|
34
|
+
return t;
|
|
35
|
+
};
|
|
36
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
|
+
};
|
|
39
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
+
const React = __importStar(require("react"));
|
|
41
|
+
const AccordionContainer_1 = __importDefault(require("./AccordionContainer"));
|
|
42
|
+
const AccordionHeader_1 = __importDefault(require("./AccordionHeader"));
|
|
43
|
+
const AccordionContent_1 = __importDefault(require("./AccordionContent"));
|
|
44
|
+
const AccordionActions_1 = __importDefault(require("./AccordionActions"));
|
|
45
|
+
const Accordion = (props, ref) => {
|
|
46
|
+
const { children, header, actions, isOpen, onOpen, overrides, noPadding, defaultOpened } = props, nativeProps = __rest(props, ["children", "header", "actions", "isOpen", "onOpen", "overrides", "noPadding", "defaultOpened"]);
|
|
47
|
+
const hasActions = typeof actions !== 'undefined' && actions !== null;
|
|
48
|
+
const hasHeader = typeof header !== 'undefined' && header !== null;
|
|
49
|
+
const [opened, setOpened] = React.useState(typeof defaultOpened !== 'undefined' ? defaultOpened : false);
|
|
50
|
+
const overridesMap = React.useMemo(() => ({
|
|
51
|
+
Container: (overrides === null || overrides === void 0 ? void 0 : overrides.Container) || AccordionContainer_1.default,
|
|
52
|
+
Header: (overrides === null || overrides === void 0 ? void 0 : overrides.Header) || AccordionHeader_1.default,
|
|
53
|
+
Content: (overrides === null || overrides === void 0 ? void 0 : overrides.Content) || AccordionContent_1.default,
|
|
54
|
+
Actions: (overrides === null || overrides === void 0 ? void 0 : overrides.Actions) || AccordionActions_1.default,
|
|
55
|
+
}), [overrides]);
|
|
56
|
+
if (!hasHeader) {
|
|
57
|
+
console.warn(`[@via-profit/ui-kit] Accordion component. If you use a subheader, then you should add a header`);
|
|
58
|
+
}
|
|
59
|
+
return (React.createElement(overridesMap.Container, Object.assign({}, nativeProps, { ref: ref }),
|
|
60
|
+
hasHeader && (React.createElement(overridesMap.Header, { isOpen: typeof isOpen !== 'undefined' ? isOpen : opened, onOpen: onOpen ? onOpen : () => setOpened(typeof isOpen !== 'undefined' ? !isOpen : !opened) }, header)),
|
|
61
|
+
React.createElement(overridesMap.Content, { noPadding: noPadding, isOpen: typeof isOpen !== 'undefined' ? isOpen : opened },
|
|
62
|
+
children,
|
|
63
|
+
hasActions && React.createElement(overridesMap.Actions, { noPadding: noPadding }, actions))));
|
|
64
|
+
};
|
|
65
|
+
exports.default = React.forwardRef(Accordion);
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
const react_1 = __importDefault(require("react"));
|
|
18
|
+
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
19
|
+
const Container = styled_1.default.div `
|
|
20
|
+
display: flex;
|
|
21
|
+
justify-content: space-between;
|
|
22
|
+
align-items: center;
|
|
23
|
+
`;
|
|
24
|
+
const CalendarBottomBar = (props, ref) => {
|
|
25
|
+
const { children } = props, restProps = __rest(props, ["children"]);
|
|
26
|
+
return (react_1.default.createElement(Container, Object.assign({}, restProps, { ref: ref }), children));
|
|
27
|
+
};
|
|
28
|
+
exports.default = react_1.default.forwardRef(CalendarBottomBar);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface CalendarMonthControlProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
3
|
+
readonly displayIcon: 'prev' | 'next';
|
|
4
|
+
}
|
|
5
|
+
declare const _default: React.ForwardRefExoticComponent<CalendarMonthControlProps & React.RefAttributes<HTMLButtonElement>>;
|
|
6
|
+
export default _default;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
const react_1 = __importDefault(require("react"));
|
|
18
|
+
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
19
|
+
const react_2 = require("@emotion/react");
|
|
20
|
+
const Button_1 = __importDefault(require("../Button"));
|
|
21
|
+
const IconChevronLeft_1 = __importDefault(require("./IconChevronLeft"));
|
|
22
|
+
const IconChevronRight_1 = __importDefault(require("./IconChevronRight"));
|
|
23
|
+
const StyledButton = (0, styled_1.default)(Button_1.default) `
|
|
24
|
+
color: ${({ theme }) => theme.color.accentSecondaryContrast.toString()};
|
|
25
|
+
&:hover {
|
|
26
|
+
color: ${({ theme }) => theme.color.accentSecondaryContrast.alpha(0.5).toString()};
|
|
27
|
+
background-color: ${({ theme }) => theme.color.accentSecondary.lighten(10).toString()};
|
|
28
|
+
}
|
|
29
|
+
&:active {
|
|
30
|
+
color: ${({ theme }) => theme.color.accentSecondaryContrast.alpha(0.9).toString()};
|
|
31
|
+
}
|
|
32
|
+
${({ disabled }) => disabled &&
|
|
33
|
+
(0, react_2.css) `
|
|
34
|
+
opacity: 0.5;
|
|
35
|
+
`};
|
|
36
|
+
`;
|
|
37
|
+
const CalendarMonthControl = (props, ref) => {
|
|
38
|
+
const { displayIcon } = props, restProps = __rest(props, ["displayIcon"]);
|
|
39
|
+
return (react_1.default.createElement(StyledButton, Object.assign({ variant: "plain", iconOnly: true, type: "button" }, restProps, { ref: ref }), displayIcon === 'next' ? react_1.default.createElement(IconChevronRight_1.default, null) : react_1.default.createElement(IconChevronLeft_1.default, null)));
|
|
40
|
+
};
|
|
41
|
+
exports.default = react_1.default.forwardRef(CalendarMonthControl);
|
|
@@ -0,0 +1,9 @@
|
|
|
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
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const IconChevronLeft = (props, ref) => (react_1.default.createElement("svg", Object.assign({ xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512", width: "1em", height: "1em", ref: ref }, props),
|
|
8
|
+
react_1.default.createElement("path", { fill: "none", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 48, d: "M328 112 184 256l144 144" })));
|
|
9
|
+
exports.default = react_1.default.forwardRef(IconChevronLeft);
|
|
@@ -0,0 +1,34 @@
|
|
|
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 (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
const React = __importStar(require("react"));
|
|
27
|
+
const react_1 = require("@emotion/react");
|
|
28
|
+
const Uknown = (props, ref) => {
|
|
29
|
+
const { color } = (0, react_1.useTheme)();
|
|
30
|
+
return (React.createElement("svg", Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", viewBox: "0 0 512 512", ref: ref }, props),
|
|
31
|
+
React.createElement("path", { transform: "translate(78.682 31.951)", d: "m-78.682-31.951h512v512h-512z", fill: color.surface.toString(), strokeLinejoin: "round", strokeWidth: "2.176" }),
|
|
32
|
+
React.createElement("path", { transform: "translate(78.682 31.951)", d: "m177.32 288.09q-4.915 0-8.0953-3.1803-3.1803-3.4694-3.1803-8.3844 0-11.854 5.7824-25.153 5.7823-13.299 15.612-22.551l7.2279-6.6497q9.83-9.2518 15.323-15.323 5.4932-6.3606 8.9626-15.034 3.7585-8.9626 3.7585-20.527 0-11.276-5.4932-20.527-5.4932-9.5409-15.612-15.034-10.119-5.4932-23.129-5.4932-21.395 0-34.116 13.01-12.432 12.721-12.432 33.248 0 4.915-3.1803 8.0953-2.8912 2.8912-7.8062 2.8912t-8.0953-2.8912q-3.1803-3.1803-3.1803-8.0953 0-19.66 8.6735-34.983 8.6735-15.323 24.286-23.997 15.612-8.6735 35.851-8.6735 19.082 0 34.116 8.3844 15.323 8.0953 23.708 22.551 8.6735 14.456 8.6735 32.67 0 14.167-4.6259 24.864-4.6259 10.408-11.854 18.503-6.9388 8.0953-19.949 19.949l-5.2041 4.6259q-8.0953 7.2279-11.565 17.058-3.1803 9.5409-3.1803 19.082 0 4.915-3.1803 8.3844-3.1803 3.1803-8.0953 3.1803zm0 51.174q-7.2279 0-12.143-4.915-4.6259-4.915-4.6259-11.854 0-7.2279 4.915-12.143 4.915-4.915 11.854-4.915t11.854 4.915q5.2041 4.915 5.2041 12.143 0 6.9388-5.2041 11.854-4.915 4.915-11.854 4.915z", fill: color.textPrimary.toString(), strokeWidth: ".72279" })));
|
|
33
|
+
};
|
|
34
|
+
exports.default = React.forwardRef(Uknown);
|
|
@@ -0,0 +1,9 @@
|
|
|
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
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const IconShow = (props, ref) => (react_1.default.createElement("svg", Object.assign({ xmlns: "http://www.w3.org/2000/svg", version: "1.1", width: "1em", height: "1em", viewBox: "0 0 512 512" }, props, { ref: ref }),
|
|
8
|
+
react_1.default.createElement("path", { d: "m105.79 160.82a24 24 0 0 0-10.76 6.2109 24 24 0 0 0 0 33.941l144 144a24.002 24.002 0 0 0 33.941 0l144-144a24 24 0 0 0 0-33.941 24 24 0 0 0-33.941 0l-127.03 127.03-127.03-127.03a24 24 0 0 0-23.182-6.2109z", fill: "currentColor" })));
|
|
9
|
+
exports.default = react_1.default.forwardRef(IconShow);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface SwitchAsteriskProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
3
|
+
/**
|
|
4
|
+
* If true, the asterisk will be set the error color
|
|
5
|
+
*/
|
|
6
|
+
readonly error?: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Not used
|
|
9
|
+
*/
|
|
10
|
+
readonly focused?: boolean;
|
|
11
|
+
}
|
|
12
|
+
declare const _default: React.ForwardRefExoticComponent<SwitchAsteriskProps & React.RefAttributes<HTMLSpanElement>>;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,53 @@
|
|
|
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 (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
26
|
+
var t = {};
|
|
27
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
28
|
+
t[p] = s[p];
|
|
29
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
30
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
31
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
32
|
+
t[p[i]] = s[p[i]];
|
|
33
|
+
}
|
|
34
|
+
return t;
|
|
35
|
+
};
|
|
36
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
|
+
};
|
|
39
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
+
const React = __importStar(require("react"));
|
|
41
|
+
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
42
|
+
const Asterisk = styled_1.default.span `
|
|
43
|
+
font-size: 0.8em;
|
|
44
|
+
margin-left: 0.2em;
|
|
45
|
+
position: relative;
|
|
46
|
+
top: -0.4em;
|
|
47
|
+
color: ${({ theme }) => theme.color.error.toString()};
|
|
48
|
+
`;
|
|
49
|
+
const SwitchAsterisk = (props, ref) => {
|
|
50
|
+
const { children, error, focused } = props, nativeProps = __rest(props, ["children", "error", "focused"]);
|
|
51
|
+
return (React.createElement(Asterisk, Object.assign({}, nativeProps, { "$error": error, "$focused": focused, ref: ref }), children));
|
|
52
|
+
};
|
|
53
|
+
exports.default = React.forwardRef(SwitchAsterisk);
|