@raketa-builder/ui 0.2.1-alpha → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/.turbo/turbo-build.log +2 -2
  2. package/.turbo/turbo-lint.log +10 -10
  3. package/dist/index.js +414 -721
  4. package/package.json +1 -2
  5. package/src/Button.jsx +33 -0
  6. package/src/Container.jsx +8 -0
  7. package/src/DataGrid.jsx +5 -54
  8. package/src/DefaultAvatar.jsx +31 -33
  9. package/src/FormGroup.jsx +8 -0
  10. package/src/Grid.jsx +47 -0
  11. package/src/H.jsx +7 -7
  12. package/src/Handle.jsx +8 -0
  13. package/src/Hint.jsx +16 -0
  14. package/src/ImageAvatar.jsx +20 -0
  15. package/src/Input.jsx +8 -0
  16. package/src/Label.jsx +11 -0
  17. package/src/LanguageSwitcher.jsx +19 -102
  18. package/src/Modal.jsx +68 -0
  19. package/src/Navigation.jsx +20 -0
  20. package/src/P.jsx +8 -0
  21. package/src/PageTitle.jsx +4 -7
  22. package/src/Pagination.jsx +4 -33
  23. package/src/Panel.jsx +11 -26
  24. package/src/Select.jsx +8 -0
  25. package/src/Stack.jsx +16 -0
  26. package/src/Tabs.jsx +41 -0
  27. package/src/Textarea.jsx +11 -0
  28. package/src/Toolbar.jsx +12 -0
  29. package/src/cn.js +3 -0
  30. package/src/index.js +1 -2
  31. package/src/styles.css +582 -5
  32. package/src/Button.js +0 -105
  33. package/src/Container.js +0 -16
  34. package/src/FormGroup.js +0 -8
  35. package/src/Grid.js +0 -38
  36. package/src/Handle.js +0 -12
  37. package/src/Hint.js +0 -12
  38. package/src/ImageAvatar.js +0 -16
  39. package/src/Input.js +0 -23
  40. package/src/Label.js +0 -12
  41. package/src/Modal.js +0 -112
  42. package/src/Navigation.js +0 -44
  43. package/src/P.js +0 -9
  44. package/src/Select.js +0 -29
  45. package/src/Stack.js +0 -8
  46. package/src/Tabs.js +0 -57
  47. package/src/Textarea.js +0 -24
  48. package/src/Toolbar.js +0 -11
  49. package/src/buttonReset.js +0 -12
  50. package/src/reset.js +0 -13
package/src/FormGroup.js DELETED
@@ -1,8 +0,0 @@
1
- import styled from "styled-components";
2
- import reset from "./reset";
3
-
4
- export default styled.div`
5
- ${reset};
6
- width: 100%;
7
- margin-bottom: 1em;
8
- `;
package/src/Grid.js DELETED
@@ -1,38 +0,0 @@
1
- import styled from "styled-components";
2
- import reset from "./reset";
3
-
4
- const Row = styled.div`
5
- ${reset};
6
-
7
- @media (min-width: 1184px) {
8
- display: grid;
9
- grid-template-columns: repeat(12, 1fr);
10
- grid-column-gap: ${(props) => props.gutter || "1em"};
11
- grid-row-gap: ${(props) => props.gutter || "1em"};
12
- margin: 0;
13
- }
14
- `;
15
-
16
- const Col = styled.div`
17
- ${reset};
18
-
19
- grid-column: span ${(props) => props.s || 12};
20
- `;
21
-
22
- const getShift = (s) => {
23
- const SHIFTS = {
24
- 1: "2 / span 10",
25
- 2: "3 / span 8",
26
- 3: "4 / span 6",
27
- };
28
-
29
- return SHIFTS[s];
30
- };
31
-
32
- const Shift = styled.div`
33
- ${reset};
34
-
35
- grid-column: ${(props) => getShift(props.s)};
36
- `;
37
-
38
- export { Shift, Row, Col };
package/src/Handle.js DELETED
@@ -1,12 +0,0 @@
1
- import styled from "styled-components";
2
-
3
- export default styled.div`
4
- width: 2em;
5
- height: 2em;
6
- background-size: 50%;
7
- background-repeat: no-repeat;
8
- background-position: center;
9
- background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IiMwMDAiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBjbGFzcz0iZmVhdGhlciBmZWF0aGVyLW1vcmUtdmVydGljYWwiPjxjaXJjbGUgY3g9IjEyIiBjeT0iMTIiIHI9IjEiPjwvY2lyY2xlPjxjaXJjbGUgY3g9IjEyIiBjeT0iNSIgcj0iMSI+PC9jaXJjbGU+PGNpcmNsZSBjeD0iMTIiIGN5PSIxOSIgcj0iMSI+PC9jaXJjbGU+PC9zdmc+);
10
- cursor: grabbing;
11
- filter: invert(${(props) => (props.active ? 1 : 0)});
12
- `;
package/src/Hint.js DELETED
@@ -1,12 +0,0 @@
1
- import styled from "styled-components";
2
- import reset from "./reset";
3
-
4
- const Hint = styled.div`
5
- ${reset};
6
-
7
- font-size: ${(props) => props.theme.font.small};
8
- opacity: 0.7;
9
- color: ${(props) => props.type === "error" && props.theme.colors.danger};
10
- `;
11
-
12
- export default Hint;
@@ -1,16 +0,0 @@
1
- import styled from 'styled-components';
2
- import reset from './reset';
3
-
4
- const ImageAvatar = styled.img`
5
- ${reset};
6
- display: block;
7
- width: ${props => props.size};
8
- height: ${props => props.size};
9
- border-radius: 50%;
10
- `;
11
-
12
- ImageAvatar.defaultProps = {
13
- size: '24px',
14
- }
15
-
16
- export default ImageAvatar;
package/src/Input.js DELETED
@@ -1,23 +0,0 @@
1
- import styled from "styled-components";
2
- import reset from "./reset";
3
-
4
- export default styled.input`
5
- ${reset};
6
- border: 0;
7
- outline: 0;
8
- border-radius: 4px;
9
- border: 0;
10
- width: 100%;
11
- padding: 0.5em 0.75em;
12
- border: 1px solid ${(props) => props.theme.colors.gray};
13
- background-color: ${(props) => props.theme.colors.trueWhite};
14
- transition: all 0.2s ease-in-out;
15
-
16
- &:hover {
17
- border-color: ${(props) => props.theme.colors.darkGray};
18
- }
19
-
20
- &:focus {
21
- border-color: ${(props) => props.theme.colors.primary};
22
- }
23
- `;
package/src/Label.js DELETED
@@ -1,12 +0,0 @@
1
- import styled from "styled-components";
2
- import reset from "./reset";
3
-
4
- export default styled.label`
5
- ${reset};
6
- display: block;
7
- margin-bottom: 0.25em;
8
- color: ${(props) => props.theme.colors.darkerGray};
9
- font-size: ${(props) => props.theme.font.small};
10
- font-weight: 600;
11
- cursor: pointer;
12
- `;
package/src/Modal.js DELETED
@@ -1,112 +0,0 @@
1
- import React from "react";
2
- import styled from "styled-components";
3
- import reset from "./reset";
4
- import buttonReset from "./buttonReset";
5
-
6
- const Overlay = styled.div`
7
- ${reset};
8
- position: fixed;
9
- top: 0;
10
- right: 0;
11
- bottom: 0;
12
- left: 0;
13
- z-index: 11;
14
- background-color: rgba(0, 0, 0, 0.6);
15
- cursor: pointer;
16
- `;
17
-
18
- const Wrapper = styled.div`
19
- ${reset};
20
- position: fixed;
21
- top: 0;
22
- right: 0;
23
- bottom: 0;
24
- left: 0;
25
- z-index: 12;
26
- display: flex;
27
- justify-content: center;
28
- align-items: center;
29
- pointer-events: none;
30
- `;
31
-
32
- const Inner = styled.div`
33
- ${reset};
34
- width: 80%;
35
- border-radius: 5px;
36
- background-color: ${(props) => props.theme.colors.lighterGray};
37
- box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
38
- pointer-events: all;
39
- `;
40
-
41
- const TitleBar = styled.div`
42
- ${reset};
43
- display: flex;
44
- justify-content: space-between;
45
- align-items: center;
46
- padding: 1em;
47
- border-bottom: 2px solid ${(props) => props.theme.colors.lightGray};
48
- `;
49
-
50
- const Title = styled.div`
51
- ${reset};
52
- font-size: 1.25em;
53
- font-weight: 500;
54
- `;
55
-
56
- const CloseButton = styled.button`
57
- ${buttonReset};
58
- position: relative;
59
- right: -4px;
60
- z-index: 13;
61
- width: 2em;
62
- height: 2em;
63
- margin: 0;
64
- padding: 0;
65
- background-repeat: no-repeat;
66
- background-size: 80%;
67
- background-position: center;
68
- background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IiMwMDAiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBjbGFzcz0iZmVhdGhlciBmZWF0aGVyLXgiPjxsaW5lIHgxPSIxOCIgeTE9IjYiIHgyPSI2IiB5Mj0iMTgiPjwvbGluZT48bGluZSB4MT0iNiIgeTE9IjYiIHgyPSIxOCIgeTI9IjE4Ij48L2xpbmU+PC9zdmc+);
69
- font-size: 1em;
70
- overflow: hidden;
71
- text-indent: -9999px;
72
- `;
73
-
74
- const Content = styled.div`
75
- ${reset};
76
- padding: 0.5em 1em 1em 1em;
77
- `;
78
-
79
- const Modal = ({ title, children, onClose }) => {
80
- const handleKeyUp = ({ key }) => {
81
- if (key === "Escape") onClose();
82
- };
83
-
84
- React.useEffect(() => {
85
- document.addEventListener("keyup", handleKeyUp);
86
-
87
- return () => {
88
- document.removeEventListener("keyup", handleKeyUp);
89
- };
90
- });
91
-
92
- return (
93
- <React.Fragment>
94
- <Overlay onClick={onClose} />
95
-
96
- <Wrapper>
97
- <Inner>
98
- <TitleBar>
99
- <Title>{title}</Title>
100
- <CloseButton type="button" onClick={onClose}>
101
- &times;
102
- </CloseButton>
103
- </TitleBar>
104
-
105
- <Content>{children}</Content>
106
- </Inner>
107
- </Wrapper>
108
- </React.Fragment>
109
- );
110
- };
111
-
112
- export default Modal;
package/src/Navigation.js DELETED
@@ -1,44 +0,0 @@
1
- import styled from "styled-components";
2
- import reset from "./reset";
3
-
4
- const Navigation = styled.div`
5
- ${reset};
6
-
7
- position: fixed;
8
- top: 0;
9
- bottom: 0;
10
- left: 0;
11
- display: flex;
12
- gap: 8px;
13
- flex-direction: column;
14
- align-items: center;
15
- width: 64px;
16
- padding: 8px 0;
17
- background-color: ${(props) => props.theme.colors.black};
18
- `;
19
-
20
- const NavItem = styled.div`
21
- ${reset};
22
-
23
- width: 48px;
24
- height: 48px;
25
- border-radius: 4px;
26
- background-color: ${(props) =>
27
- props.active ? props.theme.colors.darkerGray : "transparent"};
28
- transition: all 0.2s ease-in-out;
29
-
30
- &:hover {
31
- background-color: ${(props) => props.theme.colors.darkerGray};
32
- }
33
-
34
- a,
35
- button {
36
- display: flex;
37
- justify-content: center;
38
- align-items: center;
39
- width: 100%;
40
- height: 100%;
41
- }
42
- `;
43
-
44
- export { Navigation, NavItem };
package/src/P.js DELETED
@@ -1,9 +0,0 @@
1
- import styled from "styled-components";
2
- import reset from "./reset";
3
-
4
- export default styled.p`
5
- ${reset};
6
- margin: 0;
7
- padding: 0;
8
- padding-bottom: 1em;
9
- `;
package/src/Select.js DELETED
@@ -1,29 +0,0 @@
1
- import styled from "styled-components";
2
- import reset from "./reset";
3
-
4
- export default styled.select`
5
- ${reset};
6
- -webkit-appearance: none;
7
- -moz-appearance: none;
8
- border: 0;
9
- outline: 0;
10
- border-radius: 4px;
11
- border: 0;
12
- width: 100%;
13
- padding: 0.5em 0.75em;
14
- border: 1px solid ${(props) => props.theme.colors.gray};
15
- background-size: 16px;
16
- background-repeat: no-repeat;
17
- background-position: center right 0.25em;
18
- background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IiMwMDAiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBjbGFzcz0iZmVhdGhlciBmZWF0aGVyLWNoZXZyb24tZG93biI+PHBvbHlsaW5lIHBvaW50cz0iNiA5IDEyIDE1IDE4IDkiPjwvcG9seWxpbmU+PC9zdmc+);
19
- background-color: ${(props) => props.theme.colors.trueWhite};
20
- transition: all 0.2s ease-in-out;
21
-
22
- &:hover {
23
- border-color: ${(props) => props.theme.colors.darkGray};
24
- }
25
-
26
- &:focus {
27
- border-color: ${(props) => props.theme.colors.primary};
28
- }
29
- `;
package/src/Stack.js DELETED
@@ -1,8 +0,0 @@
1
- import styled from "styled-components";
2
-
3
- export default styled.div`
4
- display: flex;
5
- justify-content: ${(props) => props.h};
6
- align-items: ${(props) => props.v};
7
- gap: ${(props) => props.g};
8
- `;
package/src/Tabs.js DELETED
@@ -1,57 +0,0 @@
1
- import React from "react";
2
- import styled from "styled-components";
3
- import reset from "./reset";
4
- import buttonReset from "./buttonReset";
5
-
6
- const TabsWrapper = styled.div`
7
- ${reset};
8
- display: inline-flex;
9
- margin-bottom: 1em;
10
- border-bottom: 3px solid ${(props) => props.theme.colors.lightGray};
11
- `;
12
-
13
- const Tab = styled.button`
14
- ${buttonReset};
15
- position: relative;
16
- top: 3px;
17
- margin-right: 2em;
18
- padding: 0 0 0.5em 0;
19
- border-bottom: 3px solid
20
- ${(props) => (props.active ? props.theme.colors.black : "transparent")};
21
- color: ${(props) =>
22
- props.active ? props.theme.colors.black : props.theme.colors.darkGray};
23
- font-weight: 500;
24
-
25
- &:hover {
26
- border-color: ${(props) => props.theme.colors.black};
27
- }
28
-
29
- &:last-of-type {
30
- margin-right: 4em;
31
- }
32
- `;
33
-
34
- const Tabs = ({ initial = 0, children }) => {
35
- const [current, setCurrent] = React.useState(initial);
36
-
37
- return (
38
- <React.Fragment>
39
- <TabsWrapper>
40
- {children.map((child, idx) => (
41
- <Tab
42
- key={idx}
43
- type="button"
44
- active={idx === current}
45
- onClick={() => setCurrent(idx)}
46
- >
47
- {child.props.title}
48
- </Tab>
49
- ))}
50
- </TabsWrapper>
51
-
52
- {children[current]}
53
- </React.Fragment>
54
- );
55
- };
56
-
57
- export default Tabs;
package/src/Textarea.js DELETED
@@ -1,24 +0,0 @@
1
- import styled from "styled-components";
2
- import reset from "./reset";
3
-
4
- export default styled.textarea`
5
- ${reset};
6
- border: 0;
7
- outline: 0;
8
- border-radius: 4px;
9
- border: 0;
10
- width: 100%;
11
- height: 100px;
12
- padding: 0.5em 0.75em;
13
- border: 1px solid ${(props) => props.theme.colors.gray};
14
- background-color: ${(props) => props.theme.colors.trueWhite};
15
- transition: all 0.2s ease-in-out;
16
-
17
- &:hover {
18
- border-color: ${(props) => props.theme.colors.darkGray};
19
- }
20
-
21
- &:focus {
22
- border-color: ${(props) => props.theme.colors.primary};
23
- }
24
- `;
package/src/Toolbar.js DELETED
@@ -1,11 +0,0 @@
1
- import styled from "styled-components";
2
- import reset from "./reset";
3
-
4
- export default styled.div`
5
- ${reset};
6
-
7
- display: flex;
8
- align-items: center;
9
- gap: 0.5em;
10
- margin-bottom: ${(props) => props.mb || 0};
11
- `;
@@ -1,12 +0,0 @@
1
- import { css } from "styled-components";
2
- import reset from "./reset";
3
-
4
- const buttonReset = css`
5
- ${reset};
6
- background: none;
7
- border: 0;
8
- outline: 0;
9
- cursor: pointer;
10
- `;
11
-
12
- export default buttonReset;
package/src/reset.js DELETED
@@ -1,13 +0,0 @@
1
- import { css } from "styled-components";
2
- import theme from "./theme";
3
-
4
- const reset = css`
5
- box-sizing: border-box;
6
- color: ${theme.colors.black};
7
- font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
8
- Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
9
- font-size: ${theme.font.base};
10
- line-height: ${theme.font.line};
11
- `;
12
-
13
- export default reset;