@yakad/ui 2.0.1 → 2.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Avatar/Avatar.d.ts +14 -4
- package/dist/Avatar/Avatar.js +49 -8
- package/dist/Button/Button.d.ts +9 -13
- package/dist/Button/Button.js +28 -14
- package/dist/ButtonGroup/ButtonGroup.d.ts +12 -0
- package/dist/ButtonGroup/ButtonGroup.js +60 -0
- package/dist/Card/Card.d.ts +14 -9
- package/dist/Card/Card.js +41 -7
- package/dist/CheckBox/CheckBox.d.ts +12 -8
- package/dist/CheckBox/CheckBox.js +47 -10
- package/dist/Field/Field.d.ts +21 -0
- package/dist/Field/Field.js +154 -0
- package/dist/Label/Label.d.ts +8 -0
- package/dist/{Spacer/Spacer.js → Label/Label.js} +9 -6
- package/dist/Navigation/Navigation.d.ts +19 -9
- package/dist/Navigation/Navigation.js +158 -11
- package/dist/RadioGroup/RadioGroup.d.ts +19 -12
- package/dist/RadioGroup/RadioGroup.js +61 -14
- package/dist/Separator/Separator.d.ts +9 -0
- package/dist/Separator/Separator.js +24 -0
- package/dist/Table/Table.d.ts +18 -36
- package/dist/Table/Table.js +90 -38
- package/dist/index.d.ts +2 -8
- package/dist/index.js +2 -8
- package/package.json +12 -5
- package/dist/Avatar/Avatar.module.css +0 -32
- package/dist/Avatar/default-avatar.svg +0 -17
- package/dist/Button/Button.module.css +0 -190
- package/dist/Card/Card.module.css +0 -48
- package/dist/CheckBox/CheckBox.module.css +0 -50
- package/dist/CodeBox/CodeBox.d.ts +0 -7
- package/dist/CodeBox/CodeBox.js +0 -22
- package/dist/CodeBox/CodeBox.module.css +0 -0
- package/dist/CodeField/CodeField.d.ts +0 -10
- package/dist/CodeField/CodeField.js +0 -43
- package/dist/CodeField/CodeField.module.css +0 -27
- package/dist/Dropdown/Dropdown.d.ts +0 -8
- package/dist/Dropdown/Dropdown.js +0 -99
- package/dist/Dropdown/Dropdown.module.css +0 -39
- package/dist/Form/Form.d.ts +0 -9
- package/dist/Form/Form.js +0 -20
- package/dist/Form/Form.module.css +0 -3
- package/dist/Navigation/Navigation.module.css +0 -61
- package/dist/Popup/Popup.d.ts +0 -8
- package/dist/Popup/Popup.js +0 -40
- package/dist/Popup/Popup.module.css +0 -15
- package/dist/RadioButton/RadioButton.d.ts +0 -14
- package/dist/RadioButton/RadioButton.js +0 -31
- package/dist/RadioButton/RadioButton.module.css +0 -22
- package/dist/Spacer/Spacer.d.ts +0 -5
- package/dist/Spacer/Spacer.module.css +0 -5
- package/dist/Table/Table.module.css +0 -41
- package/dist/WithOverlay/WithOverlay.d.ts +0 -15
- package/dist/WithOverlay/WithOverlay.js +0 -40
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yakad/ui",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "Natiq",
|
|
6
6
|
"description": "UI components for NextJS/React",
|
|
@@ -34,8 +34,15 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@material/material-color-utilities": "^0.4.0",
|
|
37
|
-
"@
|
|
38
|
-
"@
|
|
37
|
+
"@radix-ui/react-avatar": "^1.2.6",
|
|
38
|
+
"@radix-ui/react-checkbox": "^1.3.12",
|
|
39
|
+
"@radix-ui/react-label": "^2.1.15",
|
|
40
|
+
"@radix-ui/react-navigation-menu": "^1.3.0",
|
|
41
|
+
"@radix-ui/react-radio-group": "^1.4.8",
|
|
42
|
+
"@radix-ui/react-separator": "^1.1.15",
|
|
43
|
+
"@radix-ui/react-slot": "^1.3.3",
|
|
44
|
+
"@yakad/lib": "1.0.32",
|
|
45
|
+
"@yakad/symbols": "1.0.43",
|
|
39
46
|
"@yakad/use-interactions": "1.0.0",
|
|
40
47
|
"class-variance-authority": "^0.7.1",
|
|
41
48
|
"classnames": "2.5.1",
|
|
@@ -50,8 +57,8 @@
|
|
|
50
57
|
"@types/css-modules": "1.0.5",
|
|
51
58
|
"@types/react": "^19.0.0",
|
|
52
59
|
"@types/react-dom": "^19.0.0",
|
|
53
|
-
"react": "^19.
|
|
54
|
-
"react-dom": "^19.
|
|
60
|
+
"react": "^19.2.0",
|
|
61
|
+
"react-dom": "^19.2.0",
|
|
55
62
|
"tsx": "^4.23.13"
|
|
56
63
|
}
|
|
57
64
|
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
.profileContainer {
|
|
2
|
-
background-image: url("./default-avatar.svg");
|
|
3
|
-
position: relative;
|
|
4
|
-
width: 60px;
|
|
5
|
-
height: 60px;
|
|
6
|
-
cursor: pointer;
|
|
7
|
-
border-radius: 50%;
|
|
8
|
-
overflow: hidden;
|
|
9
|
-
display: inline-flex;
|
|
10
|
-
align-items: center;
|
|
11
|
-
justify-content: center;
|
|
12
|
-
background-size: cover;
|
|
13
|
-
background-position: center;
|
|
14
|
-
transition: all 0.3s ease;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
.editOverlay {
|
|
19
|
-
position: absolute;
|
|
20
|
-
inset: 0;
|
|
21
|
-
background-color: rgba(0, 0, 0, 0.5);
|
|
22
|
-
display: flex;
|
|
23
|
-
align-items: center;
|
|
24
|
-
justify-content: center;
|
|
25
|
-
opacity: 0;
|
|
26
|
-
transition: opacity 0.3s ease;
|
|
27
|
-
color: white;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.profileContainer:hover .editOverlay {
|
|
31
|
-
opacity: 1;
|
|
32
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
<svg
|
|
2
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
3
|
-
width="256"
|
|
4
|
-
height="256"
|
|
5
|
-
viewBox="0 0 256 256"
|
|
6
|
-
role="img"
|
|
7
|
-
aria-label="Default avatar"
|
|
8
|
-
>
|
|
9
|
-
<rect width="100%" height="100%" rx="24" fill="#E6EEF8" />
|
|
10
|
-
<g transform="translate(48,40)" fill="none" fill-rule="evenodd">
|
|
11
|
-
<circle cx="80" cy="56" r="40" fill="#CBDFF6" />
|
|
12
|
-
<path
|
|
13
|
-
d="M0 152c0-44.18 35.82-80 80-80s80 35.82 80 80v8H0v-8z"
|
|
14
|
-
fill="#B6D0FB"
|
|
15
|
-
/>
|
|
16
|
-
</g>
|
|
17
|
-
</svg>
|
|
@@ -1,190 +0,0 @@
|
|
|
1
|
-
.button {
|
|
2
|
-
display: flex;
|
|
3
|
-
position: relative;
|
|
4
|
-
text-align: center;
|
|
5
|
-
align-items: center;
|
|
6
|
-
line-height: 2rem;
|
|
7
|
-
font-weight: 700;
|
|
8
|
-
padding: 0.5rem var(--padding);
|
|
9
|
-
border: none;
|
|
10
|
-
background: none;
|
|
11
|
-
color: inherit;
|
|
12
|
-
fill: inherit;
|
|
13
|
-
user-select: none;
|
|
14
|
-
cursor: pointer;
|
|
15
|
-
box-sizing: border-box;
|
|
16
|
-
text-decoration: none;
|
|
17
|
-
}
|
|
18
|
-
.small {
|
|
19
|
-
min-width: 3rem;
|
|
20
|
-
min-height: 3rem;
|
|
21
|
-
--padding: 2rem;
|
|
22
|
-
gap: 0.4rem;
|
|
23
|
-
font-size: 1.2rem;
|
|
24
|
-
--border-radius: 1.5rem;
|
|
25
|
-
}
|
|
26
|
-
.medium {
|
|
27
|
-
min-width: 4rem;
|
|
28
|
-
min-height: 4rem;
|
|
29
|
-
--padding: 2.4rem;
|
|
30
|
-
gap: 0.8rem;
|
|
31
|
-
font-size: 1.4rem;
|
|
32
|
-
--border-radius: 2rem;
|
|
33
|
-
}
|
|
34
|
-
.large {
|
|
35
|
-
min-width: 5rem;
|
|
36
|
-
min-height: 5rem;
|
|
37
|
-
--padding: 3.2rem;
|
|
38
|
-
gap: 1.1rem;
|
|
39
|
-
font-size: 1.8rem;
|
|
40
|
-
--border-radius: 2.5rem;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.iconButton {
|
|
44
|
-
padding: 0;
|
|
45
|
-
justify-content: center;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.none {
|
|
49
|
-
border-radius: 0;
|
|
50
|
-
}
|
|
51
|
-
.semi {
|
|
52
|
-
border-radius: 0 var(--border-radius) var(--border-radius) 0;
|
|
53
|
-
}
|
|
54
|
-
[dir="rtl"] .semi {
|
|
55
|
-
border-radius: var(--border-radius) 0 0 var(--border-radius);
|
|
56
|
-
}
|
|
57
|
-
.squircle {
|
|
58
|
-
border-radius: calc(var(--border-radius) / 2);
|
|
59
|
-
}
|
|
60
|
-
.rounded {
|
|
61
|
-
border-radius: var(--border-radius);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
@media (pointer: fine) {
|
|
65
|
-
.button:hover {
|
|
66
|
-
cursor: pointer;
|
|
67
|
-
box-shadow: inset 0 0 10rem #00000010;
|
|
68
|
-
box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
.button:active {
|
|
72
|
-
box-shadow: inset 0 0 10rem #7d7d7d30;
|
|
73
|
-
}
|
|
74
|
-
.button:invalid {
|
|
75
|
-
border: 0.1rem solid rgb(var(--errorColor, 179 38 30));
|
|
76
|
-
}
|
|
77
|
-
.text {
|
|
78
|
-
color: rgb(var(--primaryColor, 11 87 208));
|
|
79
|
-
fill: rgb(var(--primaryColor, 11 87 208));
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.outlined {
|
|
83
|
-
color: rgb(var(--primaryColor, 11 87 208));
|
|
84
|
-
fill: rgb(var(--primaryColor, 11 87 208));
|
|
85
|
-
border: 0.1rem solid #7d7d7d70;
|
|
86
|
-
}
|
|
87
|
-
.filled {
|
|
88
|
-
background: rgb(var(--primaryColor, 11 87 208));
|
|
89
|
-
color: rgb(var(--onPrimaryColor, 255 255 255));
|
|
90
|
-
fill: rgb(var(--onPrimaryColor, 255 255 255));
|
|
91
|
-
}
|
|
92
|
-
.filledtonal {
|
|
93
|
-
background: rgb(var(--primaryContainerColor, 211 227 253));
|
|
94
|
-
color: rgb(var(--onPrimaryContainerColor, 4 30 73));
|
|
95
|
-
fill: rgb(var(--onPrimaryContainerColor, 4 30 73));
|
|
96
|
-
}
|
|
97
|
-
.tonal {
|
|
98
|
-
background: rgb(var(--tertiaryColor, 196 238 208));
|
|
99
|
-
color: rgb(var(--onTertiaryColor, 7 39 17));
|
|
100
|
-
fill: rgb(var(--onTertiaryColor, 7 39 17));
|
|
101
|
-
}
|
|
102
|
-
.elevated {
|
|
103
|
-
background-color: rgb(var(--onSecondaryColor, 255 255 255));
|
|
104
|
-
color: rgb(var(--primaryColor, 11 87 208));
|
|
105
|
-
fill: rgb(var(--primaryColor, 11 87 208));
|
|
106
|
-
box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;
|
|
107
|
-
}
|
|
108
|
-
.link {
|
|
109
|
-
background: transparent;
|
|
110
|
-
display: flex;
|
|
111
|
-
position: relative;
|
|
112
|
-
transition: 0.3s;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
.small.fab {
|
|
116
|
-
border-radius: 1.1rem;
|
|
117
|
-
height: 4.6rem;
|
|
118
|
-
min-width: 4.6rem;
|
|
119
|
-
--padding: 1.2rem;
|
|
120
|
-
font-size: 1.4rem;
|
|
121
|
-
}
|
|
122
|
-
.medium.fab {
|
|
123
|
-
border-radius: 1.3rem;
|
|
124
|
-
height: 5.6rem;
|
|
125
|
-
min-width: 5.6rem;
|
|
126
|
-
--padding: 1.6rem;
|
|
127
|
-
font-size: 1.6rem;
|
|
128
|
-
}
|
|
129
|
-
.large.fab {
|
|
130
|
-
border-radius: 1.5rem;
|
|
131
|
-
height: 6.6rem;
|
|
132
|
-
min-width: 6.6rem;
|
|
133
|
-
--padding: 1.8rem;
|
|
134
|
-
font-size: 1.8rem;
|
|
135
|
-
}
|
|
136
|
-
.fab {
|
|
137
|
-
justify-content: center;
|
|
138
|
-
background: rgb(var(--primaryContainerColor, 211 227 253));
|
|
139
|
-
color: rgb(var(--onPrimaryContainerColor, 4 30 73));
|
|
140
|
-
fill: rgb(var(--onPrimaryContainerColor, 4, 30, 73));
|
|
141
|
-
}
|
|
142
|
-
.link:before {
|
|
143
|
-
content: "";
|
|
144
|
-
position: absolute;
|
|
145
|
-
bottom: 0.5rem;
|
|
146
|
-
left: 0;
|
|
147
|
-
right: 0;
|
|
148
|
-
width: 0;
|
|
149
|
-
height: 0.1rem;
|
|
150
|
-
padding: 0;
|
|
151
|
-
margin: 0 auto;
|
|
152
|
-
background-color: rgb(var(--primaryColor, 30 100 212));
|
|
153
|
-
transition: 0.3s;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
.link:hover {
|
|
157
|
-
box-shadow: none;
|
|
158
|
-
}
|
|
159
|
-
.link:hover:before {
|
|
160
|
-
width: calc(100% - var(--padding));
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
.loading.loadingPositionCenter:disabled {
|
|
164
|
-
color: transparent;
|
|
165
|
-
fill: transparent;
|
|
166
|
-
}
|
|
167
|
-
.loading.loadingPositionCenter {
|
|
168
|
-
position: absolute;
|
|
169
|
-
left: 50%;
|
|
170
|
-
transform: translate(-50%);
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
.button:disabled {
|
|
174
|
-
cursor: default;
|
|
175
|
-
box-shadow: none;
|
|
176
|
-
box-shadow: inset 0 0 10rem #7d7d7d20;
|
|
177
|
-
}
|
|
178
|
-
.button.link:disabled:before {
|
|
179
|
-
display: none;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
.loading .displayOnDisabled {
|
|
183
|
-
display: none;
|
|
184
|
-
}
|
|
185
|
-
.loading:disabled .displayOnDisabled {
|
|
186
|
-
display: block;
|
|
187
|
-
}
|
|
188
|
-
.loading:disabled .hideOnDisabled {
|
|
189
|
-
display: none;
|
|
190
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/* BackgroundColor Levels */
|
|
2
|
-
.yakadCardAutoLevel,
|
|
3
|
-
.yakadCardLowLevel {
|
|
4
|
-
--yakadCardBackgroundColor: var(--surfaceContainerColor);
|
|
5
|
-
}
|
|
6
|
-
.yakadCardAutoLevel .yakadCardAutoLevel,
|
|
7
|
-
.yakadCardLowLevel .yakadCardAutoLevel,
|
|
8
|
-
.yakadCardMidLevel {
|
|
9
|
-
--yakadCardBackgroundColor: var(--surfaceContainerHighColor);
|
|
10
|
-
--yakadCardBackgroundColor: var(--surfaceContainerHighColor);
|
|
11
|
-
}
|
|
12
|
-
.yakadCardAutoLevel .yakadCardAutoLevel .yakadCardAutoLevel,
|
|
13
|
-
.yakadCardLowLevel .yakadCardAutoLevel .yakadCardAutoLevel,
|
|
14
|
-
.yakadCardMidLevel .yakadCardAutoLevel,
|
|
15
|
-
.yakadCardHighLevel,
|
|
16
|
-
.yakadCardHighLevel .yakadCardAutoLevel {
|
|
17
|
-
--yakadCardBackgroundColor: var(--surfaceContainerHighestColor);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.card {
|
|
21
|
-
padding: 2rem;
|
|
22
|
-
border-radius: 2rem;
|
|
23
|
-
transition: box-shadow 0.3s ease, background-color 0.3s ease;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.card.elevated {
|
|
27
|
-
box-shadow: 0px 3px 3px -2px rgb(0 0 0 / 20%),
|
|
28
|
-
0px 3px 4px 0px rgb(0 0 0 / 14%), 0px 1px 8px 0px rgb(0 0 0 / 12%);
|
|
29
|
-
background-color: rgb(var(--yakadCardBackgroundColor, 230 224 233));
|
|
30
|
-
color: rgb(var(--onSurfaceColor, 28 27 31));
|
|
31
|
-
fill: rgb(var(--onSurfaceColor, 28 27 31));
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.card.hoverEffect:hover {
|
|
35
|
-
box-shadow: 0px 3px 3px -2px rgb(0 0 0 / 20%),
|
|
36
|
-
0px 3px 4px 0px rgb(0 0 0 / 14%), 0px 1px 8px 0px rgb(0 0 0 / 12%);
|
|
37
|
-
background-color: rgb(var(--surfaceContainerHighestColor, 230 224 233));
|
|
38
|
-
cursor: pointer;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.card.blur {
|
|
42
|
-
background-color: color-mix(
|
|
43
|
-
in srgb,
|
|
44
|
-
rgb(var(--yakadCardBackgroundColor, 230 224 233)) 85%,
|
|
45
|
-
transparent
|
|
46
|
-
);
|
|
47
|
-
backdrop-filter: blur(0.5rem);
|
|
48
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
.label {
|
|
2
|
-
display: flex;
|
|
3
|
-
flex-direction: row;
|
|
4
|
-
align-items: center;
|
|
5
|
-
width: 4rem;
|
|
6
|
-
height: 4rem;
|
|
7
|
-
line-height: 4rem;
|
|
8
|
-
font-size: 1.6rem;
|
|
9
|
-
box-sizing: border-box;
|
|
10
|
-
user-select: none;
|
|
11
|
-
cursor: pointer;
|
|
12
|
-
}
|
|
13
|
-
.label.disabled {
|
|
14
|
-
cursor: default;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.label .input {
|
|
18
|
-
display: none;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.label .symbolContainer {
|
|
22
|
-
display: flex;
|
|
23
|
-
align-items: center;
|
|
24
|
-
justify-content: center;
|
|
25
|
-
width: 3.6rem;
|
|
26
|
-
height: 3.6rem;
|
|
27
|
-
border-radius: 1.8rem;
|
|
28
|
-
margin: 0.1rem;
|
|
29
|
-
margin-inline-start: auto;
|
|
30
|
-
}
|
|
31
|
-
.label:hover .symbolContainer {
|
|
32
|
-
box-shadow: inset 0 0 10rem #00000010;
|
|
33
|
-
box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;
|
|
34
|
-
}
|
|
35
|
-
.label:active .symbolContainer {
|
|
36
|
-
box-shadow: inset 0 0 10rem #7d7d7d30;
|
|
37
|
-
}
|
|
38
|
-
.label.disabled .symbolContainer {
|
|
39
|
-
box-shadow: none;
|
|
40
|
-
box-shadow: inset 0 0 10rem #7d7d7d20;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.label .symbolContainer .symbolChecked,
|
|
44
|
-
.label .input:checked + .symbolContainer .symbolUnChecked {
|
|
45
|
-
display: none;
|
|
46
|
-
}
|
|
47
|
-
.label .symbolContainer .symbolUnChecked,
|
|
48
|
-
.label .input:checked + .symbolContainer .symbolChecked {
|
|
49
|
-
display: block;
|
|
50
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
export interface CodeBoxProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
-
copyButton?: boolean;
|
|
4
|
-
children?: React.ReactNode;
|
|
5
|
-
ref?: React.Ref<HTMLDivElement>;
|
|
6
|
-
}
|
|
7
|
-
export declare function CodeBox({ copyButton, className, children, ...restProps }: CodeBoxProps): React.JSX.Element;
|
package/dist/CodeBox/CodeBox.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
-
import classNames from "classnames";
|
|
14
|
-
import { Material } from "@yakad/symbols";
|
|
15
|
-
import { Button, Card } from "..";
|
|
16
|
-
import boxingStyles from "../boxing.module.css";
|
|
17
|
-
import styles from "./CodeBox.module.css";
|
|
18
|
-
export function CodeBox(_a) {
|
|
19
|
-
var { copyButton, className, children } = _a, restProps = __rest(_a, ["copyButton", "className", "children"]);
|
|
20
|
-
const joinedClassNames = classNames({ [boxingStyles.fullWidthOnParentDemand]: true }, styles.ZZZZZZZZZZ, className);
|
|
21
|
-
return (_jsxs(Card, Object.assign({}, restProps, { className: joinedClassNames, children: [_jsx("pre", { children: children }), copyButton && _jsx(Button, { icon: _jsx(Material, { icon: "copy_all" }) })] })));
|
|
22
|
-
}
|
|
File without changes
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
type ExcludedTypes = "minLength" | "maxLength" | "type";
|
|
3
|
-
export interface CodeFieldsProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, ExcludedTypes> {
|
|
4
|
-
length?: number;
|
|
5
|
-
onFilled?: () => void;
|
|
6
|
-
children?: React.ReactNode;
|
|
7
|
-
ref?: React.Ref<HTMLInputElement>;
|
|
8
|
-
}
|
|
9
|
-
export declare function CodeField({ length, onFilled, autoComplete, pattern, onInput, className, style, ...restProps }: CodeFieldsProps): import("react").JSX.Element;
|
|
10
|
-
export {};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
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
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
-
import classNames from "classnames";
|
|
15
|
-
import boxingStyles from "../boxing.module.css";
|
|
16
|
-
import styles from "./CodeField.module.css";
|
|
17
|
-
function isInputFilled(event, inputLength) {
|
|
18
|
-
const targetInputElement = event.target;
|
|
19
|
-
removeUnNumberChars(targetInputElement);
|
|
20
|
-
if (inputLength === targetInputElement.value.length)
|
|
21
|
-
return true;
|
|
22
|
-
sliceOverLength(targetInputElement, inputLength);
|
|
23
|
-
return false;
|
|
24
|
-
}
|
|
25
|
-
function sliceOverLength(inputElement, inputLength) {
|
|
26
|
-
const targetLength = inputElement.value.length;
|
|
27
|
-
if (targetLength > inputLength)
|
|
28
|
-
inputElement.value = inputElement.value.slice(0, inputLength);
|
|
29
|
-
}
|
|
30
|
-
function removeUnNumberChars(inputElement) {
|
|
31
|
-
inputElement.value = inputElement.value.replace(/[^0-9]+/, "");
|
|
32
|
-
}
|
|
33
|
-
export function CodeField(_a) {
|
|
34
|
-
var { length = 6, onFilled, autoComplete, pattern, onInput, className, style } = _a, restProps = __rest(_a, ["length", "onFilled", "autoComplete", "pattern", "onInput", "className", "style"]);
|
|
35
|
-
const joinedClassNames = classNames({ [boxingStyles.fullWidthOnParentDemand]: true }, styles.input, className);
|
|
36
|
-
const joinedStyles = Object.assign(Object.assign({}, style), { width: `calc(1.5ch * ${length})` });
|
|
37
|
-
return (_jsx("input", Object.assign({}, restProps, { className: joinedClassNames, style: joinedStyles, type: "number", minLength: length, maxLength: length, autoComplete: autoComplete || "off", pattern: pattern || "[0-9]", onInput: (event) => {
|
|
38
|
-
if (isInputFilled(event, length)) {
|
|
39
|
-
onFilled === null || onFilled === void 0 ? void 0 : onFilled();
|
|
40
|
-
}
|
|
41
|
-
onInput === null || onInput === void 0 ? void 0 : onInput(event);
|
|
42
|
-
} })));
|
|
43
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
.input {
|
|
2
|
-
box-sizing: border-box;
|
|
3
|
-
display: block;
|
|
4
|
-
border: none;
|
|
5
|
-
padding: 0;
|
|
6
|
-
margin: auto;
|
|
7
|
-
background: repeating-linear-gradient(
|
|
8
|
-
90deg,
|
|
9
|
-
#7d7d7d 0,
|
|
10
|
-
#7d7d7d 1ch,
|
|
11
|
-
transparent 0,
|
|
12
|
-
transparent 1.5ch
|
|
13
|
-
)
|
|
14
|
-
0 100%/100% 0.2rem no-repeat;
|
|
15
|
-
color: transparent;
|
|
16
|
-
text-shadow: 0 0 0 rgb(var(--secondaryColor, 98 91 113));
|
|
17
|
-
letter-spacing: 0.5ch;
|
|
18
|
-
font-size: 4rem;
|
|
19
|
-
}
|
|
20
|
-
.input:focus {
|
|
21
|
-
outline: none;
|
|
22
|
-
}
|
|
23
|
-
.input::-webkit-outer-spin-button,
|
|
24
|
-
.input::-webkit-inner-spin-button {
|
|
25
|
-
-webkit-appearance: none;
|
|
26
|
-
margin: 0;
|
|
27
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { CardProps, OverlayProps } from "..";
|
|
3
|
-
export interface DropdownProps extends CardProps, OverlayProps {
|
|
4
|
-
teleport?: boolean;
|
|
5
|
-
ref?: React.Ref<HTMLDivElement>;
|
|
6
|
-
}
|
|
7
|
-
export declare function Dropdown({ fullWidthOnParentDemand, // Def in Card is True
|
|
8
|
-
blur, level, triggerref, onClose, className, style, children, teleport, ref, ...restProps }: DropdownProps): import("react").JSX.Element;
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
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
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
-
import { useRef, useState, useEffect, useImperativeHandle } from "react";
|
|
15
|
-
import classNames from "classnames";
|
|
16
|
-
import { Card } from "..";
|
|
17
|
-
import styles from "./Dropdown.module.css";
|
|
18
|
-
import { createPortal } from "react-dom";
|
|
19
|
-
import { useOnOutsideClick } from "@yakad/use-interactions";
|
|
20
|
-
export function Dropdown(_a) {
|
|
21
|
-
var { fullWidthOnParentDemand = false, // Def in Card is True
|
|
22
|
-
blur, level = "high", triggerref, onClose, className, style, children, teleport = false, ref } = _a, restProps = __rest(_a, ["fullWidthOnParentDemand", "blur", "level", "triggerref", "onClose", "className", "style", "children", "teleport", "ref"]);
|
|
23
|
-
const fallbackTriggerRef = useRef(null);
|
|
24
|
-
const dropdownRef = useRef(null);
|
|
25
|
-
const placementTargetRef = triggerref || fallbackTriggerRef;
|
|
26
|
-
// Let the parent access our DOM node
|
|
27
|
-
useImperativeHandle(ref, () => dropdownRef.current);
|
|
28
|
-
const [arrowPosition, setArrowPosition] = useState({
|
|
29
|
-
top: 0,
|
|
30
|
-
left: 0,
|
|
31
|
-
});
|
|
32
|
-
const [dropdownPosition, setDropdownPosition] = useState({
|
|
33
|
-
top: 0,
|
|
34
|
-
left: 0,
|
|
35
|
-
});
|
|
36
|
-
const [isPlacedAbove, setIsPlacedAbove] = useState(false);
|
|
37
|
-
const [isPlaced, setIsPlaced] = useState(false);
|
|
38
|
-
useEffect(() => {
|
|
39
|
-
document.body.style.overflow = "hidden";
|
|
40
|
-
return () => {
|
|
41
|
-
document.body.style.overflow = "initial";
|
|
42
|
-
};
|
|
43
|
-
}, []);
|
|
44
|
-
const doTeleport = () => {
|
|
45
|
-
const portalRoot = document.getElementsByClassName("portalRoot")[0] || document;
|
|
46
|
-
const t = portalRoot && createPortal(dropdown(), portalRoot);
|
|
47
|
-
return t;
|
|
48
|
-
};
|
|
49
|
-
useEffect(() => {
|
|
50
|
-
if ((placementTargetRef === null || placementTargetRef === void 0 ? void 0 : placementTargetRef.current) && dropdownRef.current) {
|
|
51
|
-
const placementTarget = placementTargetRef.current.getBoundingClientRect();
|
|
52
|
-
const dropdownRect = dropdownRef.current.getBoundingClientRect();
|
|
53
|
-
const padding = 10;
|
|
54
|
-
let dropdownY = placementTarget.bottom + padding;
|
|
55
|
-
let dropdownXPos = placementTarget.left + placementTarget.width / 2;
|
|
56
|
-
let arrowY = dropdownY;
|
|
57
|
-
const arrowX = dropdownXPos;
|
|
58
|
-
// Prevent overflow bottom
|
|
59
|
-
if (dropdownY + dropdownRect.height > window.innerHeight &&
|
|
60
|
-
placementTarget.top > dropdownRect.height) {
|
|
61
|
-
dropdownY = placementTarget.top - padding;
|
|
62
|
-
arrowY = placementTarget.top - padding;
|
|
63
|
-
setIsPlacedAbove(true);
|
|
64
|
-
}
|
|
65
|
-
else
|
|
66
|
-
setIsPlacedAbove(false);
|
|
67
|
-
// Prevent overflow right
|
|
68
|
-
if (dropdownXPos + dropdownRect.width / 2 >
|
|
69
|
-
window.innerWidth - padding) {
|
|
70
|
-
dropdownXPos =
|
|
71
|
-
window.innerWidth - dropdownRect.width / 2 - padding;
|
|
72
|
-
}
|
|
73
|
-
// Prevent overflow left
|
|
74
|
-
if (dropdownXPos - dropdownRect.width / 2 < padding) {
|
|
75
|
-
dropdownXPos = dropdownRect.width / 2 + padding;
|
|
76
|
-
}
|
|
77
|
-
setDropdownPosition({
|
|
78
|
-
top: dropdownY,
|
|
79
|
-
left: dropdownXPos,
|
|
80
|
-
});
|
|
81
|
-
setArrowPosition({
|
|
82
|
-
top: arrowY,
|
|
83
|
-
left: arrowX,
|
|
84
|
-
});
|
|
85
|
-
setIsPlaced(true);
|
|
86
|
-
}
|
|
87
|
-
}, [children, placementTargetRef]);
|
|
88
|
-
useOnOutsideClick(() => {
|
|
89
|
-
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
90
|
-
}, dropdownRef);
|
|
91
|
-
const dropdown = () => (_jsxs(_Fragment, { children: [!triggerref && _jsx("div", { ref: fallbackTriggerRef }), _jsx(Card, Object.assign({ ref: dropdownRef, fullWidthOnParentDemand: fullWidthOnParentDemand, blur: blur, level: level }, restProps, { className: classNames(styles.dropdownCard, { [styles.isPlacedAbove]: isPlacedAbove }, className), style: Object.assign({ top: dropdownPosition.top, left: dropdownPosition.left, visibility: isPlaced ? "visible" : "hidden" }, style), children: children })), _jsx("span", { className: classNames(styles.arrow, {
|
|
92
|
-
[styles.isPlacedAbove]: isPlacedAbove,
|
|
93
|
-
}, { [styles.blur]: blur }), style: {
|
|
94
|
-
top: arrowPosition.top,
|
|
95
|
-
left: arrowPosition.left,
|
|
96
|
-
visibility: isPlaced ? "visible" : "hidden",
|
|
97
|
-
} })] }));
|
|
98
|
-
return teleport ? doTeleport() : dropdown();
|
|
99
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
.dropdownCard {
|
|
2
|
-
position: fixed;
|
|
3
|
-
min-width: 6rem;
|
|
4
|
-
min-height: 10rem;
|
|
5
|
-
max-width: calc(100vw - 10rem);
|
|
6
|
-
max-height: min(50vh, 40rem);
|
|
7
|
-
transform: translate(-50%, 1rem);
|
|
8
|
-
overflow-x: auto;
|
|
9
|
-
visibility: hidden;
|
|
10
|
-
z-index: 4;
|
|
11
|
-
}
|
|
12
|
-
.dropdownCard.isPlacedAbove {
|
|
13
|
-
transform: translate(-50%, calc(-100% - 1rem));
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
/* Arrow */
|
|
17
|
-
.arrow {
|
|
18
|
-
position: fixed;
|
|
19
|
-
width: 0;
|
|
20
|
-
height: 0;
|
|
21
|
-
border-left: 0.8rem solid transparent;
|
|
22
|
-
border-right: 0.8rem solid transparent;
|
|
23
|
-
border-bottom: 1rem solid
|
|
24
|
-
rgb(var(--surfaceContainerHighestColor, 230 224 233));
|
|
25
|
-
transform: translate(-50%, calc(-100% + 1rem));
|
|
26
|
-
visibility: hidden;
|
|
27
|
-
z-index: 4;
|
|
28
|
-
}
|
|
29
|
-
.arrow.isPlacedAbove {
|
|
30
|
-
transform: translate(-50%, -1rem) rotate(180deg);
|
|
31
|
-
}
|
|
32
|
-
.arrow.blur {
|
|
33
|
-
border-bottom: 1rem solid
|
|
34
|
-
color-mix(
|
|
35
|
-
in srgb,
|
|
36
|
-
rgb(var(--surfaceContainerHighestColor, 230 224 233)) 85%,
|
|
37
|
-
transparent
|
|
38
|
-
);
|
|
39
|
-
}
|
package/dist/Form/Form.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export interface FormProps extends React.HTMLAttributes<HTMLFormElement> {
|
|
3
|
-
align?: "start" | "space" | "center" | "end";
|
|
4
|
-
fullWidthOnParentDemand?: boolean;
|
|
5
|
-
children?: React.ReactNode;
|
|
6
|
-
}
|
|
7
|
-
export declare function Form({ align, fullWidthOnParentDemand, className, children, ...restProps }: FormProps & {
|
|
8
|
-
ref?: React.Ref<HTMLFormElement>;
|
|
9
|
-
}): import("react").JSX.Element;
|
package/dist/Form/Form.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import classNames from "classnames";
|
|
14
|
-
import styles from "./Form.module.css";
|
|
15
|
-
import boxingStyles from "../boxing.module.css";
|
|
16
|
-
export function Form(_a) {
|
|
17
|
-
var { align, fullWidthOnParentDemand = true, className, children } = _a, restProps = __rest(_a, ["align", "fullWidthOnParentDemand", "className", "children"]);
|
|
18
|
-
const joinedClassNames = classNames(boxingStyles.flexColumnBox, { [boxingStyles[align]]: align }, { [boxingStyles.demandChildsToBeFullWidth]: true }, { [boxingStyles.fullWidthOnParentDemand]: fullWidthOnParentDemand }, styles.form, className);
|
|
19
|
-
return (_jsx("form", Object.assign({}, restProps, { className: joinedClassNames, children: children })));
|
|
20
|
-
}
|