@rettangoli/ui 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +49 -0
- package/dist/rettangoli-iife-layout.min.js +728 -0
- package/dist/rettangoli-iife-ui.min.js +830 -0
- package/package.json +53 -0
- package/src/common/BaseElement.js +182 -0
- package/src/common.js +190 -0
- package/src/components/dialog/dialog.handlers.js +5 -0
- package/src/components/dialog/dialog.store.js +25 -0
- package/src/components/dialog/dialog.view.yaml +44 -0
- package/src/components/dropdownMenu/dropdownMenu.handlers.js +18 -0
- package/src/components/dropdownMenu/dropdownMenu.store.js +25 -0
- package/src/components/dropdownMenu/dropdownMenu.view.yaml +54 -0
- package/src/components/form/form.handlers.js +63 -0
- package/src/components/form/form.store.js +45 -0
- package/src/components/form/form.view.yaml +174 -0
- package/src/components/navbar/navbar.examples.yaml +86 -0
- package/src/components/navbar/navbar.handlers.js +10 -0
- package/src/components/navbar/navbar.store.js +46 -0
- package/src/components/navbar/navbar.view.yaml +74 -0
- package/src/components/pageOutline/pageOutline.handlers.js +69 -0
- package/src/components/pageOutline/pageOutline.store.js +40 -0
- package/src/components/pageOutline/pageOutline.view.yaml +34 -0
- package/src/components/popover/popover.handlers.js +5 -0
- package/src/components/popover/popover.store.js +12 -0
- package/src/components/popover/popover.view.yaml +57 -0
- package/src/components/select/select.handlers.js +61 -0
- package/src/components/select/select.store.js +65 -0
- package/src/components/select/select.view.yaml +50 -0
- package/src/components/sidebar/sidebar.handlers.js +36 -0
- package/src/components/sidebar/sidebar.store.js +142 -0
- package/src/components/sidebar/sidebar.view.yaml +190 -0
- package/src/components/table/table.handlers.js +55 -0
- package/src/components/table/table.store.js +72 -0
- package/src/components/table/table.view.yaml +103 -0
- package/src/entry-iife-layout.js +15 -0
- package/src/entry-iife-ui.js +22 -0
- package/src/index.js +17 -0
- package/src/lib/uhtml.js +9 -0
- package/src/primitives/button.js +306 -0
- package/src/primitives/colorPicker.js +213 -0
- package/src/primitives/image.js +234 -0
- package/src/primitives/input.js +218 -0
- package/src/primitives/slider.js +269 -0
- package/src/primitives/svg.js +95 -0
- package/src/primitives/text.js +141 -0
- package/src/primitives/textarea.js +103 -0
- package/src/primitives/view.js +217 -0
- package/src/setup.js +16 -0
- package/src/styles/anchorStyles.js +13 -0
- package/src/styles/buttonMarginStyles.js +84 -0
- package/src/styles/cursorStyles.js +12 -0
- package/src/styles/flexChildStyles.js +43 -0
- package/src/styles/flexDirectionStyles.js +74 -0
- package/src/styles/marginStyles.js +13 -0
- package/src/styles/paddingSvgStyles.js +120 -0
- package/src/styles/scrollStyles.js +22 -0
- package/src/styles/textColorStyles.js +14 -0
- package/src/styles/textStyles.js +62 -0
- package/src/styles/viewStyles.js +114 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { css } from '../common.js'
|
|
2
|
+
|
|
3
|
+
export default css`
|
|
4
|
+
:host([flex="0"]) {
|
|
5
|
+
flex: 0;
|
|
6
|
+
}
|
|
7
|
+
:host([flex="1"]) {
|
|
8
|
+
flex: 1;
|
|
9
|
+
}
|
|
10
|
+
:host([flex="2"]) {
|
|
11
|
+
flex: 2;
|
|
12
|
+
}
|
|
13
|
+
:host([flex="3"]) {
|
|
14
|
+
flex: 3;
|
|
15
|
+
}
|
|
16
|
+
:host([flex="4"]) {
|
|
17
|
+
flex: 4;
|
|
18
|
+
}
|
|
19
|
+
:host([flex="5"]) {
|
|
20
|
+
flex: 5;
|
|
21
|
+
}
|
|
22
|
+
:host([flex="6"]) {
|
|
23
|
+
flex: 6;
|
|
24
|
+
}
|
|
25
|
+
:host([flex="7"]) {
|
|
26
|
+
flex: 7;
|
|
27
|
+
}
|
|
28
|
+
:host([flex="8"]) {
|
|
29
|
+
flex: 8;
|
|
30
|
+
}
|
|
31
|
+
:host([flex="9"]) {
|
|
32
|
+
flex: 9;
|
|
33
|
+
}
|
|
34
|
+
:host([flex="10"]) {
|
|
35
|
+
flex: 10;
|
|
36
|
+
}
|
|
37
|
+
:host([flex="11"]) {
|
|
38
|
+
flex: 11;
|
|
39
|
+
}
|
|
40
|
+
:host([flex="12"]) {
|
|
41
|
+
flex: 12;
|
|
42
|
+
}
|
|
43
|
+
`
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { css } from "../common.js";
|
|
2
|
+
|
|
3
|
+
export default css`
|
|
4
|
+
|
|
5
|
+
:host([d="h"]) {
|
|
6
|
+
flex-direction: row;
|
|
7
|
+
}
|
|
8
|
+
:host([d="v"]) {
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
}
|
|
11
|
+
:host([d="h"]:not([ah])) {
|
|
12
|
+
justify-content: flex-start;
|
|
13
|
+
}
|
|
14
|
+
:host([d="h"][ah="c"]) {
|
|
15
|
+
justify-content: center;
|
|
16
|
+
}
|
|
17
|
+
:host([d="h"][ah="e"]) {
|
|
18
|
+
justify-content: flex-end;
|
|
19
|
+
}
|
|
20
|
+
:host([d="h"]:not([av])) {
|
|
21
|
+
align-items: flex-start;
|
|
22
|
+
}
|
|
23
|
+
:host([d="h"][av="c"]) {
|
|
24
|
+
align-items: center;
|
|
25
|
+
align-content: center;
|
|
26
|
+
}
|
|
27
|
+
:host([d="h"][av="e"]) {
|
|
28
|
+
align-items: flex-end;
|
|
29
|
+
align-content: flex-end;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/* Default/vertical direction - horizontal alignment */
|
|
33
|
+
:host(:not([d]):not([ah])),
|
|
34
|
+
:host([d="v"]:not([ah])) {
|
|
35
|
+
align-items: flex-start;
|
|
36
|
+
}
|
|
37
|
+
:host(:not([d])[ah="c"]),
|
|
38
|
+
:host([d="v"][ah="c"]) {
|
|
39
|
+
align-items: center;
|
|
40
|
+
}
|
|
41
|
+
:host(:not([d])[ah="e"]),
|
|
42
|
+
:host([d="v"][ah="e"]) {
|
|
43
|
+
align-items: flex-end;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
:host(:not([d]):not([av])),
|
|
47
|
+
:host([d="v"]:not([av])) {
|
|
48
|
+
justify-content: flex-start;
|
|
49
|
+
}
|
|
50
|
+
:host(:not([d])[av="c"]),
|
|
51
|
+
:host([d="v"][av="c"]) {
|
|
52
|
+
justify-content: center;
|
|
53
|
+
}
|
|
54
|
+
:host(:not([d])[av="e"]),
|
|
55
|
+
:host([d="v"][av="e"]) {
|
|
56
|
+
justify-content: flex-end;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
@media screen and (max-width: 640px) {
|
|
60
|
+
:host([s-d="v"]) {
|
|
61
|
+
flex-direction: column;
|
|
62
|
+
}
|
|
63
|
+
:host([s-d="h"]) {
|
|
64
|
+
flex-direction: row;
|
|
65
|
+
}
|
|
66
|
+
:host([s-d="h"][s-av="c"]) {
|
|
67
|
+
align-items: center;
|
|
68
|
+
align-content: center;
|
|
69
|
+
}
|
|
70
|
+
:host([s-d="v"][s-av="c"]) {
|
|
71
|
+
justify-content: center;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
`;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
|
|
2
|
+
import { css } from '../common.js'
|
|
3
|
+
|
|
4
|
+
export default css`
|
|
5
|
+
:host([pt="xs"]) svg {
|
|
6
|
+
padding-top: var(--spacing-xs);
|
|
7
|
+
}
|
|
8
|
+
:host([pt="sm"]) svg {
|
|
9
|
+
padding-top: var(--spacing-sm);
|
|
10
|
+
}
|
|
11
|
+
:host([pt="md"]) svg {
|
|
12
|
+
padding-top: var(--spacing-md);
|
|
13
|
+
}
|
|
14
|
+
:host([pt="lg"]) svg {
|
|
15
|
+
padding-top: var(--spacing-lg);
|
|
16
|
+
}
|
|
17
|
+
:host([pt="xl"]) svg {
|
|
18
|
+
padding-top: var(--spacing-xl);
|
|
19
|
+
}
|
|
20
|
+
:host([pr="xs"]) svg {
|
|
21
|
+
padding-right: var(--spacing-xs);
|
|
22
|
+
}
|
|
23
|
+
:host([pr="sm"]) svg {
|
|
24
|
+
padding-right: var(--spacing-sm);
|
|
25
|
+
}
|
|
26
|
+
:host([pr="md"]) svg {
|
|
27
|
+
padding-right: var(--spacing-md);
|
|
28
|
+
}
|
|
29
|
+
:host([pr="lg"]) svg {
|
|
30
|
+
padding-right: var(--spacing-lg);
|
|
31
|
+
}
|
|
32
|
+
:host([pr="xl"]) svg {
|
|
33
|
+
padding-right: var(--spacing-xl);
|
|
34
|
+
}
|
|
35
|
+
:host([pb="xs"]) svg {
|
|
36
|
+
padding-bottom: var(--spacing-xs);
|
|
37
|
+
}
|
|
38
|
+
:host([pb="sm"]) svg {
|
|
39
|
+
padding-bottom: var(--spacing-sm);
|
|
40
|
+
}
|
|
41
|
+
:host([pb="md"]) svg {
|
|
42
|
+
padding-bottom: var(--spacing-md);
|
|
43
|
+
}
|
|
44
|
+
:host([pb="lg"]) svg {
|
|
45
|
+
padding-bottom: var(--spacing-lg);
|
|
46
|
+
}
|
|
47
|
+
:host([pb="xl"]) svg {
|
|
48
|
+
padding-bottom: var(--spacing-xl);
|
|
49
|
+
}
|
|
50
|
+
:host([pl="xs"]) svg {
|
|
51
|
+
padding-left: var(--spacing-xs);
|
|
52
|
+
}
|
|
53
|
+
:host([pl="sm"]) svg {
|
|
54
|
+
padding-left: var(--spacing-sm);
|
|
55
|
+
}
|
|
56
|
+
:host([pl="md"]) svg {
|
|
57
|
+
padding-left: var(--spacing-md);
|
|
58
|
+
}
|
|
59
|
+
:host([pl="lg"]) svg {
|
|
60
|
+
padding-left: var(--spacing-lg);
|
|
61
|
+
}
|
|
62
|
+
:host([pl="xl"]) svg {
|
|
63
|
+
padding-left: var(--spacing-xl);
|
|
64
|
+
}
|
|
65
|
+
:host([p="xs"]) svg {
|
|
66
|
+
padding: var(--spacing-xs);
|
|
67
|
+
}
|
|
68
|
+
:host([p="sm"]) svg {
|
|
69
|
+
padding: var(--spacing-sm);
|
|
70
|
+
}
|
|
71
|
+
:host([p="md"]) svg {
|
|
72
|
+
padding: var(--spacing-md);
|
|
73
|
+
}
|
|
74
|
+
:host([p="lg"]) svg {
|
|
75
|
+
padding: var(--spacing-lg);
|
|
76
|
+
}
|
|
77
|
+
:host([p="xl"]) svg {
|
|
78
|
+
padding: var(--spacing-xl);
|
|
79
|
+
}
|
|
80
|
+
:host([ph="xs"]) svg {
|
|
81
|
+
padding-left: var(--spacing-xs);
|
|
82
|
+
padding-right: var(--spacing-xs);
|
|
83
|
+
}
|
|
84
|
+
:host([ph="sm"]) svg {
|
|
85
|
+
padding-left: var(--spacing-sm);
|
|
86
|
+
padding-right: var(--spacing-sm);
|
|
87
|
+
}
|
|
88
|
+
:host([ph="md"]) svg {
|
|
89
|
+
padding-left: var(--spacing-md);
|
|
90
|
+
padding-right: var(--spacing-md);
|
|
91
|
+
}
|
|
92
|
+
:host([ph="lg"]) svg {
|
|
93
|
+
padding-left: var(--spacing-lg);
|
|
94
|
+
padding-right: var(--spacing-lg);
|
|
95
|
+
}
|
|
96
|
+
:host([ph="xl"]) svg {
|
|
97
|
+
padding-left: var(--spacing-xl);
|
|
98
|
+
padding-right: var(--spacing-xl);
|
|
99
|
+
}
|
|
100
|
+
:host([pv="xs"]) svg {
|
|
101
|
+
padding-top: var(--spacing-xs);
|
|
102
|
+
padding-bottom: var(--spacing-xs);
|
|
103
|
+
}
|
|
104
|
+
:host([pv="sm"]) svg {
|
|
105
|
+
padding-top: var(--spacing-sm);
|
|
106
|
+
padding-bottom: var(--spacing-sm);
|
|
107
|
+
}
|
|
108
|
+
:host([pv="md"]) svg {
|
|
109
|
+
padding-top: var(--spacing-md);
|
|
110
|
+
padding-bottom: var(--spacing-md);
|
|
111
|
+
}
|
|
112
|
+
:host([pv="lg"]) svg {
|
|
113
|
+
padding-top: var(--spacing-lg);
|
|
114
|
+
padding-bottom: var(--spacing-lg);
|
|
115
|
+
}
|
|
116
|
+
:host([pv="xl"]) svg {
|
|
117
|
+
padding-top: var(--spacing-xl);
|
|
118
|
+
padding-bottom: var(--spacing-xl);
|
|
119
|
+
}
|
|
120
|
+
`
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
|
|
2
|
+
import { css } from '../common.js'
|
|
3
|
+
|
|
4
|
+
export default css`
|
|
5
|
+
:host([sh]:not([sv])) {
|
|
6
|
+
overflow-x: scroll;
|
|
7
|
+
flex-wrap: nowrap;
|
|
8
|
+
}
|
|
9
|
+
:host([sv]:not([sh])) {
|
|
10
|
+
overflow-y: scroll;
|
|
11
|
+
flex-wrap: nowrap;
|
|
12
|
+
}
|
|
13
|
+
:host([sh][sv]) {
|
|
14
|
+
overflow: scroll;
|
|
15
|
+
flex-wrap: nowrap;
|
|
16
|
+
}
|
|
17
|
+
:host([overflow="hidden"]) {
|
|
18
|
+
overflow: hidden;
|
|
19
|
+
flex-wrap: nowrap;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
`
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { generateCSS } from "../common.js";
|
|
2
|
+
|
|
3
|
+
const styles = {
|
|
4
|
+
c: {
|
|
5
|
+
"fg": "--foreground",
|
|
6
|
+
"de": "--destructive",
|
|
7
|
+
"pr-fg": "--primary-foreground",
|
|
8
|
+
"se-fg": "--secondary-foreground",
|
|
9
|
+
"mu-fg": "--muted-foreground",
|
|
10
|
+
"ac-fg": "--accent-foreground",
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export default generateCSS(styles);
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { generateCSS } from "../common.js";
|
|
2
|
+
|
|
3
|
+
const styles = {
|
|
4
|
+
ta: {
|
|
5
|
+
s: 'start',
|
|
6
|
+
c: 'center',
|
|
7
|
+
e: 'end',
|
|
8
|
+
j: 'justify'
|
|
9
|
+
},
|
|
10
|
+
s: {
|
|
11
|
+
h1: `
|
|
12
|
+
font-size: var(--h1-font-size);
|
|
13
|
+
font-weight: var(--h1-font-weight);
|
|
14
|
+
line-height: var(--h1-line-height);
|
|
15
|
+
letter-spacing: var(--h1-letter-spacing);
|
|
16
|
+
`,
|
|
17
|
+
h2: `
|
|
18
|
+
font-size: var(--h2-font-size);
|
|
19
|
+
font-weight: var(--h2-font-weight);
|
|
20
|
+
line-height: var(--h2-line-height);
|
|
21
|
+
letter-spacing: var(--h2-letter-spacing);
|
|
22
|
+
`,
|
|
23
|
+
h3: `
|
|
24
|
+
font-size: var(--h3-font-size);
|
|
25
|
+
font-weight: var(--h3-font-weight);
|
|
26
|
+
line-height: var(--h3-line-height);
|
|
27
|
+
letter-spacing: var(--h3-letter-spacing);
|
|
28
|
+
`,
|
|
29
|
+
h4: `
|
|
30
|
+
font-size: var(--h4-font-size);
|
|
31
|
+
font-weight: var(--h4-font-weight);
|
|
32
|
+
line-height: var(--h4-line-height);
|
|
33
|
+
letter-spacing: var(--h4-letter-spacing);
|
|
34
|
+
`,
|
|
35
|
+
lg: `
|
|
36
|
+
font-size: var(--lg-font-size);
|
|
37
|
+
font-weight: var(--lg-font-weight);
|
|
38
|
+
line-height: var(--lg-line-height);
|
|
39
|
+
letter-spacing: var(--lg-letter-spacing);
|
|
40
|
+
`,
|
|
41
|
+
md: `
|
|
42
|
+
font-size: var(--md-font-size);
|
|
43
|
+
font-weight: var(--md-font-weight);
|
|
44
|
+
line-height: var(--md-line-height);
|
|
45
|
+
letter-spacing: var(--md-letter-spacing);
|
|
46
|
+
`,
|
|
47
|
+
sm: `
|
|
48
|
+
font-size: var(--sm-font-size);
|
|
49
|
+
font-weight: var(--sm-font-weight);
|
|
50
|
+
line-height: var(--sm-line-height);
|
|
51
|
+
letter-spacing: var(--sm-letter-spacing);
|
|
52
|
+
`,
|
|
53
|
+
xs: `
|
|
54
|
+
font-size: var(--xs-font-size);
|
|
55
|
+
font-weight: var(--xs-font-weight);
|
|
56
|
+
line-height: var(--xs-line-height);
|
|
57
|
+
letter-spacing: var(--xs-letter-spacing);
|
|
58
|
+
`,
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export default generateCSS(styles);
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { generateCSS, spacing } from "../common.js";
|
|
2
|
+
|
|
3
|
+
const borderWidth = {
|
|
4
|
+
xs: "--border-width-xs",
|
|
5
|
+
sm: "--border-width-sm",
|
|
6
|
+
md: "--border-width-md",
|
|
7
|
+
lg: "--border-width-lg",
|
|
8
|
+
xl: "--border-width-xl",
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const styles = {
|
|
12
|
+
bgc: {
|
|
13
|
+
pr: `
|
|
14
|
+
background-color: var(--primary);
|
|
15
|
+
`,
|
|
16
|
+
se: `
|
|
17
|
+
background-color: var(--secondary);
|
|
18
|
+
`,
|
|
19
|
+
de: `
|
|
20
|
+
background-color: var(--destructive);
|
|
21
|
+
`,
|
|
22
|
+
fg: `
|
|
23
|
+
background-color: var(--foreground);
|
|
24
|
+
`,
|
|
25
|
+
bg: `
|
|
26
|
+
background-color: var(--background);
|
|
27
|
+
`,
|
|
28
|
+
mu: `
|
|
29
|
+
background-color: var(--muted);
|
|
30
|
+
`,
|
|
31
|
+
ac: `
|
|
32
|
+
background-color: var(--accent);
|
|
33
|
+
`,
|
|
34
|
+
bo: `
|
|
35
|
+
background-color: var(--border);
|
|
36
|
+
`,
|
|
37
|
+
},
|
|
38
|
+
pos: {
|
|
39
|
+
rel: "relative",
|
|
40
|
+
abs: "absolute",
|
|
41
|
+
fix: "fixed",
|
|
42
|
+
},
|
|
43
|
+
cor: {
|
|
44
|
+
full: `
|
|
45
|
+
top: 0;
|
|
46
|
+
right: 0;
|
|
47
|
+
bottom: 0;
|
|
48
|
+
left: 0;
|
|
49
|
+
height: 100%;
|
|
50
|
+
`,
|
|
51
|
+
top: `
|
|
52
|
+
top: 0;
|
|
53
|
+
right: 0;
|
|
54
|
+
left: 0;
|
|
55
|
+
`,
|
|
56
|
+
right: `
|
|
57
|
+
top: 0;
|
|
58
|
+
right: 0;
|
|
59
|
+
bottom: 0;
|
|
60
|
+
height: 100%;
|
|
61
|
+
`,
|
|
62
|
+
bottom: `
|
|
63
|
+
right: 0;
|
|
64
|
+
bottom: 0;
|
|
65
|
+
left: 0;
|
|
66
|
+
`,
|
|
67
|
+
left: `
|
|
68
|
+
bottom: 0;
|
|
69
|
+
left: 0;
|
|
70
|
+
top: 0;
|
|
71
|
+
height: 100%;
|
|
72
|
+
`,
|
|
73
|
+
},
|
|
74
|
+
shadow: {
|
|
75
|
+
sm: "--shadow-sm",
|
|
76
|
+
md: "--shadow-md",
|
|
77
|
+
lg: "--shadow-lg",
|
|
78
|
+
},
|
|
79
|
+
pt: spacing,
|
|
80
|
+
pr: spacing,
|
|
81
|
+
pb:spacing,
|
|
82
|
+
pl: spacing,
|
|
83
|
+
p: spacing,
|
|
84
|
+
ph: spacing,
|
|
85
|
+
pv: spacing,
|
|
86
|
+
g: spacing,
|
|
87
|
+
gv: spacing,
|
|
88
|
+
gh: spacing,
|
|
89
|
+
bw: borderWidth,
|
|
90
|
+
bwt: borderWidth,
|
|
91
|
+
bwr: borderWidth,
|
|
92
|
+
bwb: borderWidth,
|
|
93
|
+
bwl: borderWidth,
|
|
94
|
+
bc: {
|
|
95
|
+
pr: "--primary",
|
|
96
|
+
se: "--secondary",
|
|
97
|
+
de: "--destructive",
|
|
98
|
+
fg: "--foreground",
|
|
99
|
+
bg: "--background",
|
|
100
|
+
mu: "--muted",
|
|
101
|
+
ac: "--accent",
|
|
102
|
+
bo: "--border",
|
|
103
|
+
},
|
|
104
|
+
br: {
|
|
105
|
+
xs: "--border-radius-xs",
|
|
106
|
+
sm: "--border-radius-sm",
|
|
107
|
+
md: "--border-radius-md",
|
|
108
|
+
lg: "--border-radius-lg",
|
|
109
|
+
xl: "--border-radius-xl",
|
|
110
|
+
f: "--border-radius-f",
|
|
111
|
+
},
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
export default generateCSS(styles)
|