@balikjs/mobile 0.0.1 → 0.0.2
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/mobile.js +1484 -1311
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/src/DatePicker/DatePicker.jsx +276 -0
- package/src/DatePicker/DatePicker.module.css +197 -0
- package/src/DatePicker/index.js +1 -0
- package/src/Select/Select.jsx +3 -2
- package/src/index.js +1 -0
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
.backdrop {
|
|
2
|
+
position: fixed;
|
|
3
|
+
inset: 0;
|
|
4
|
+
z-index: var(--b-z-index-modal);
|
|
5
|
+
background-color: rgba(0, 0, 0, 0.35);
|
|
6
|
+
opacity: 0;
|
|
7
|
+
pointer-events: none;
|
|
8
|
+
transition: opacity 0.3s ease;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.backdrop[data-open] {
|
|
12
|
+
opacity: 1;
|
|
13
|
+
pointer-events: auto;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.root {
|
|
17
|
+
position: fixed;
|
|
18
|
+
inset-inline: 0;
|
|
19
|
+
bottom: 0;
|
|
20
|
+
z-index: var(--b-z-index-modal);
|
|
21
|
+
background-color: oklch(95% 0 0);
|
|
22
|
+
border-radius: 16px 16px 0 0;
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-direction: column;
|
|
25
|
+
transform: translateY(100%);
|
|
26
|
+
pointer-events: none;
|
|
27
|
+
transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
|
|
28
|
+
overflow: hidden;
|
|
29
|
+
user-select: none;
|
|
30
|
+
-webkit-user-select: none;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.root[data-open] {
|
|
34
|
+
transform: translateY(0);
|
|
35
|
+
pointer-events: auto;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.header {
|
|
39
|
+
display: flex;
|
|
40
|
+
align-items: center;
|
|
41
|
+
justify-content: space-between;
|
|
42
|
+
padding: 12px 16px;
|
|
43
|
+
border-bottom: 0.5px solid color-mix(in oklch, var(--base-fg) 10%, transparent);
|
|
44
|
+
flex-shrink: 0;
|
|
45
|
+
background-color: oklch(97% 0 0);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.headerTitle {
|
|
49
|
+
font-size: var(--b-comp-font-size-md);
|
|
50
|
+
font-weight: 600;
|
|
51
|
+
color: var(--base-fg);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.headerBtn {
|
|
55
|
+
font-size: var(--b-comp-font-size-md);
|
|
56
|
+
font-weight: 500;
|
|
57
|
+
color: var(--base-edge);
|
|
58
|
+
background: none;
|
|
59
|
+
border: none;
|
|
60
|
+
padding: 4px 8px;
|
|
61
|
+
cursor: pointer;
|
|
62
|
+
-webkit-tap-highlight-color: transparent;
|
|
63
|
+
border-radius: var(--b-radius-l1-md);
|
|
64
|
+
transition: background-color var(--b-transition-fast);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.headerBtn:active {
|
|
68
|
+
background-color: color-mix(in oklch, var(--base-fg) 6%, transparent);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.headerBtnConfirm {
|
|
72
|
+
font-weight: 600;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.pickerBody {
|
|
76
|
+
position: relative;
|
|
77
|
+
flex: 1;
|
|
78
|
+
display: flex;
|
|
79
|
+
flex-direction: column;
|
|
80
|
+
padding: 0 8px 16px;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.selectedBar {
|
|
84
|
+
position: absolute;
|
|
85
|
+
inset-inline: 24px;
|
|
86
|
+
top: 50%;
|
|
87
|
+
transform: translateY(calc(-50% + 8px));
|
|
88
|
+
height: 40px;
|
|
89
|
+
border-top: 1px solid color-mix(in oklch, var(--base-fg) 10%, transparent);
|
|
90
|
+
border-bottom: 1px solid color-mix(in oklch, var(--base-fg) 10%, transparent);
|
|
91
|
+
background-color: color-mix(in oklch, var(--base-fg) 2%, transparent);
|
|
92
|
+
border-radius: var(--b-radius-l2-xs);
|
|
93
|
+
pointer-events: none;
|
|
94
|
+
z-index: 0;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.columns {
|
|
98
|
+
display: flex;
|
|
99
|
+
position: relative;
|
|
100
|
+
z-index: 1;
|
|
101
|
+
padding: 20px 0;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.column {
|
|
105
|
+
flex: 1;
|
|
106
|
+
overflow: hidden;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.column:first-child {
|
|
110
|
+
flex: 1.1;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.column:last-child {
|
|
114
|
+
flex: 0.9;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.scroller {
|
|
118
|
+
height: 200px;
|
|
119
|
+
overflow-y: auto;
|
|
120
|
+
scroll-snap-type: y mandatory;
|
|
121
|
+
-webkit-overflow-scrolling: touch;
|
|
122
|
+
scrollbar-width: none;
|
|
123
|
+
mask-image: linear-gradient(
|
|
124
|
+
to bottom,
|
|
125
|
+
transparent 0%,
|
|
126
|
+
rgba(0, 0, 0, 0.2) 15%,
|
|
127
|
+
rgba(0, 0, 0, 1) 30%,
|
|
128
|
+
rgba(0, 0, 0, 1) 70%,
|
|
129
|
+
rgba(0, 0, 0, 0.2) 85%,
|
|
130
|
+
transparent 100%
|
|
131
|
+
);
|
|
132
|
+
-webkit-mask-image: linear-gradient(
|
|
133
|
+
to bottom,
|
|
134
|
+
transparent 0%,
|
|
135
|
+
rgba(0, 0, 0, 0.2) 15%,
|
|
136
|
+
rgba(0, 0, 0, 1) 30%,
|
|
137
|
+
rgba(0, 0, 0, 1) 70%,
|
|
138
|
+
rgba(0, 0, 0, 0.2) 85%,
|
|
139
|
+
transparent 100%
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.scroller::-webkit-scrollbar {
|
|
144
|
+
display: none;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.yearColumn {
|
|
148
|
+
align-items: flex-end;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.item {
|
|
152
|
+
display: flex;
|
|
153
|
+
align-items: center;
|
|
154
|
+
justify-content: center;
|
|
155
|
+
height: 40px;
|
|
156
|
+
scroll-snap-align: center;
|
|
157
|
+
font-size: var(--b-comp-font-size-lg);
|
|
158
|
+
color: color-mix(in oklch, var(--base-fg) 40%, transparent);
|
|
159
|
+
transition: color 0.2s ease, font-weight 0.2s ease;
|
|
160
|
+
cursor: pointer;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.yearItem {
|
|
164
|
+
justify-content: flex-end;
|
|
165
|
+
padding-right: 8px;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.monthItem {
|
|
169
|
+
justify-content: center;
|
|
170
|
+
min-width: 80px;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.dayItem {
|
|
174
|
+
justify-content: flex-start;
|
|
175
|
+
padding-left: 8px;
|
|
176
|
+
min-width: 48px;
|
|
177
|
+
font-variant-numeric: tabular-nums;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.itemSelected {
|
|
181
|
+
color: var(--base-fg);
|
|
182
|
+
font-weight: 600;
|
|
183
|
+
font-size: var(--b-comp-font-size-xl);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.itemDisabled {
|
|
187
|
+
color: color-mix(in oklch, var(--base-fg) 15%, transparent);
|
|
188
|
+
pointer-events: none;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.weekday {
|
|
192
|
+
text-align: center;
|
|
193
|
+
font-size: var(--b-comp-font-size-xs);
|
|
194
|
+
color: color-mix(in oklch, var(--base-fg) 40%, transparent);
|
|
195
|
+
margin: 0;
|
|
196
|
+
padding: 8px 0 0;
|
|
197
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DatePicker } from './DatePicker.jsx'
|
package/src/Select/Select.jsx
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { splitProps, mergeProps, For } from 'solid-js'
|
|
2
2
|
import { Select as ArkSelect, useSelectContext } from '@ark-ui/solid'
|
|
3
|
+
import { Portal } from 'solid-js/web'
|
|
3
4
|
import { ChevronDown } from 'lucide-solid'
|
|
4
5
|
import styles from './Select.module.css'
|
|
5
6
|
|
|
@@ -16,7 +17,7 @@ function SelectSheet(props) {
|
|
|
16
17
|
const isOpen = () => api().open
|
|
17
18
|
|
|
18
19
|
return (
|
|
19
|
-
|
|
20
|
+
<Portal mount={document.body}>
|
|
20
21
|
<div
|
|
21
22
|
class={styles.backdrop}
|
|
22
23
|
data-open={isOpen() ? '' : undefined}
|
|
@@ -43,7 +44,7 @@ function SelectSheet(props) {
|
|
|
43
44
|
</For>
|
|
44
45
|
</div>
|
|
45
46
|
</div>
|
|
46
|
-
|
|
47
|
+
</Portal>
|
|
47
48
|
)
|
|
48
49
|
}
|
|
49
50
|
|
package/src/index.js
CHANGED
|
@@ -31,4 +31,5 @@ export { Drawer } from './Drawer/Drawer.jsx'
|
|
|
31
31
|
export { Tooltip } from './Tooltip/Tooltip.jsx'
|
|
32
32
|
export { Popover } from './Popover/Popover.jsx'
|
|
33
33
|
export { Fab } from './Fab/Fab.jsx'
|
|
34
|
+
export { DatePicker } from './DatePicker/DatePicker.jsx'
|
|
34
35
|
import './styles/index.css'
|