@lichta/core 2.0.1 → 2.2.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 +134 -13
- package/dist/index.d.mts +468 -89
- package/dist/index.d.ts +468 -89
- package/dist/index.js +583 -99
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +551 -98
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -1
- package/styles/calendar-base.css +21 -6
- package/styles/calendar-glass.css +2 -12
- package/styles/datepicker-base.css +223 -0
- package/styles/datepicker-glass.css +27 -0
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
.lich-ta-datepicker {
|
|
2
|
+
--lichta-primary: #d4a373;
|
|
3
|
+
--lichta-bg: #fffcf7;
|
|
4
|
+
--lichta-surface: #ffffff;
|
|
5
|
+
--lichta-popover-bg: #ffffff;
|
|
6
|
+
--lichta-text: #2c1810;
|
|
7
|
+
--lichta-text-muted: #8b7355;
|
|
8
|
+
--lichta-text-dim: #c4b5a0;
|
|
9
|
+
--lichta-border: #e8ddd0;
|
|
10
|
+
--lichta-hover-bg: #f5e6d3;
|
|
11
|
+
--lichta-today-text: #a0522d;
|
|
12
|
+
--lichta-selected-bg: #a0522d;
|
|
13
|
+
--lichta-selected-text: #ffffff;
|
|
14
|
+
--lichta-lunar-text: #b08968;
|
|
15
|
+
--lichta-first-lunar: #c2185b;
|
|
16
|
+
--lichta-radius: 8px;
|
|
17
|
+
--lichta-font: inherit;
|
|
18
|
+
--lichta-max-width: 420px;
|
|
19
|
+
|
|
20
|
+
position: relative;
|
|
21
|
+
display: inline-block;
|
|
22
|
+
width: 100%;
|
|
23
|
+
max-width: var(--lichta-max-width);
|
|
24
|
+
font-family: var(--lichta-font);
|
|
25
|
+
box-sizing: border-box;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.lich-ta-datepicker-input {
|
|
29
|
+
width: 100%;
|
|
30
|
+
box-sizing: border-box;
|
|
31
|
+
padding: 10px 14px;
|
|
32
|
+
border: 1px solid var(--lichta-border);
|
|
33
|
+
border-radius: var(--lichta-radius);
|
|
34
|
+
background: var(--lichta-surface);
|
|
35
|
+
color: var(--lichta-text);
|
|
36
|
+
font-family: inherit;
|
|
37
|
+
font-size: 0.95rem;
|
|
38
|
+
cursor: pointer;
|
|
39
|
+
transition: border-color 0.15s ease;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.lich-ta-datepicker-input::placeholder {
|
|
43
|
+
color: var(--lichta-text-muted);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.lich-ta-datepicker-input:disabled {
|
|
47
|
+
opacity: 0.6;
|
|
48
|
+
cursor: not-allowed;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.lich-ta-datepicker-input:focus-visible {
|
|
52
|
+
outline: 2px solid var(--lichta-primary);
|
|
53
|
+
outline-offset: 1px;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.lich-ta-datepicker-popover {
|
|
57
|
+
position: absolute;
|
|
58
|
+
top: calc(100% + 8px);
|
|
59
|
+
left: 0;
|
|
60
|
+
z-index: 50;
|
|
61
|
+
background: var(--lichta-popover-bg);
|
|
62
|
+
border: 1px solid var(--lichta-border);
|
|
63
|
+
border-radius: calc(var(--lichta-radius) + 4px);
|
|
64
|
+
box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16);
|
|
65
|
+
padding: 8px;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/* ── Lưới lịch riêng cho DatePicker (không dùng chung UI với Calendar) ──── */
|
|
69
|
+
|
|
70
|
+
.lich-ta-datepicker-calendar {
|
|
71
|
+
width: 260px;
|
|
72
|
+
max-width: 100%;
|
|
73
|
+
box-sizing: border-box;
|
|
74
|
+
padding: 8px;
|
|
75
|
+
user-select: none;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.lich-ta-datepicker-calendar-header {
|
|
79
|
+
display: flex;
|
|
80
|
+
align-items: center;
|
|
81
|
+
justify-content: space-between;
|
|
82
|
+
margin-bottom: 8px;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.lich-ta-datepicker-calendar-nav {
|
|
86
|
+
background: none;
|
|
87
|
+
border: 1px solid var(--lichta-border);
|
|
88
|
+
border-radius: var(--lichta-radius);
|
|
89
|
+
width: 26px;
|
|
90
|
+
height: 26px;
|
|
91
|
+
display: flex;
|
|
92
|
+
align-items: center;
|
|
93
|
+
justify-content: center;
|
|
94
|
+
cursor: pointer;
|
|
95
|
+
color: var(--lichta-text);
|
|
96
|
+
font-size: 0.7rem;
|
|
97
|
+
transition: all 0.15s ease;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.lich-ta-datepicker-calendar-nav:hover {
|
|
101
|
+
background: var(--lichta-hover-bg);
|
|
102
|
+
border-color: var(--lichta-primary);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.lich-ta-datepicker-calendar-title {
|
|
106
|
+
text-align: center;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.lich-ta-datepicker-calendar-month-year {
|
|
110
|
+
display: block;
|
|
111
|
+
font-size: 0.85rem;
|
|
112
|
+
font-weight: 600;
|
|
113
|
+
color: var(--lichta-text);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.lich-ta-datepicker-calendar-canchi {
|
|
117
|
+
display: block;
|
|
118
|
+
font-size: 0.68rem;
|
|
119
|
+
color: var(--lichta-text-muted);
|
|
120
|
+
margin-top: 1px;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.lich-ta-datepicker-calendar-weekdays {
|
|
124
|
+
display: grid;
|
|
125
|
+
grid-template-columns: repeat(7, minmax(0, 1fr));
|
|
126
|
+
margin-bottom: 2px;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.lich-ta-datepicker-calendar-weekday {
|
|
130
|
+
text-align: center;
|
|
131
|
+
font-size: 0.62rem;
|
|
132
|
+
font-weight: 600;
|
|
133
|
+
color: var(--lichta-text-muted);
|
|
134
|
+
padding: 4px 0;
|
|
135
|
+
text-transform: uppercase;
|
|
136
|
+
letter-spacing: 0.03em;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.lich-ta-datepicker-calendar-grid {
|
|
140
|
+
display: grid;
|
|
141
|
+
grid-template-columns: repeat(7, minmax(0, 1fr));
|
|
142
|
+
gap: 1px;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.lich-ta-datepicker-calendar-day {
|
|
146
|
+
display: flex;
|
|
147
|
+
flex-direction: column;
|
|
148
|
+
align-items: center;
|
|
149
|
+
justify-content: center;
|
|
150
|
+
gap: 1px;
|
|
151
|
+
aspect-ratio: 1;
|
|
152
|
+
overflow: hidden;
|
|
153
|
+
padding: 2px;
|
|
154
|
+
border: none;
|
|
155
|
+
border-radius: var(--lichta-radius);
|
|
156
|
+
background: transparent;
|
|
157
|
+
cursor: pointer;
|
|
158
|
+
transition: background 0.15s ease;
|
|
159
|
+
font-family: inherit;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.lich-ta-datepicker-calendar-day:hover {
|
|
163
|
+
background: var(--lichta-hover-bg);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.lich-ta-datepicker-calendar-day:focus-visible {
|
|
167
|
+
outline: 2px solid var(--lichta-primary);
|
|
168
|
+
outline-offset: 1px;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.lich-ta-datepicker-calendar-day .solar-day {
|
|
172
|
+
display: flex;
|
|
173
|
+
align-items: center;
|
|
174
|
+
justify-content: center;
|
|
175
|
+
width: 65%;
|
|
176
|
+
max-width: 26px;
|
|
177
|
+
aspect-ratio: 1;
|
|
178
|
+
border-radius: 50%;
|
|
179
|
+
border: 1px solid transparent;
|
|
180
|
+
font-size: 0.8rem;
|
|
181
|
+
font-weight: 500;
|
|
182
|
+
color: var(--lichta-text);
|
|
183
|
+
line-height: 1;
|
|
184
|
+
transition: all 0.15s ease;
|
|
185
|
+
box-sizing: border-box;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.lich-ta-datepicker-calendar-day .lunar-day {
|
|
189
|
+
font-size: 0.58rem;
|
|
190
|
+
color: var(--lichta-lunar-text);
|
|
191
|
+
line-height: 1;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.lich-ta-datepicker-calendar-day.is-today .solar-day {
|
|
195
|
+
color: var(--lichta-today-text);
|
|
196
|
+
font-weight: 700;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.lich-ta-datepicker-calendar-day.is-today .lunar-day {
|
|
200
|
+
color: var(--lichta-today-text);
|
|
201
|
+
font-weight: 600;
|
|
202
|
+
opacity: 0.85;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.lich-ta-datepicker-calendar-day.is-selected .solar-day {
|
|
206
|
+
background: var(--lichta-selected-bg);
|
|
207
|
+
color: var(--lichta-selected-text);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.lich-ta-datepicker-calendar-day.is-selected .lunar-day {
|
|
211
|
+
color: var(--lichta-selected-bg);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.lich-ta-datepicker-calendar-day.is-other-month .solar-day,
|
|
215
|
+
.lich-ta-datepicker-calendar-day.is-other-month .lunar-day {
|
|
216
|
+
color: var(--lichta-text-dim);
|
|
217
|
+
opacity: 0.6;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.lich-ta-datepicker-calendar-day.is-first-lunar .lunar-day {
|
|
221
|
+
color: var(--lichta-first-lunar);
|
|
222
|
+
font-weight: 600;
|
|
223
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/* ── LichTa DatePicker Glassmorphism Theme ───────── */
|
|
2
|
+
.lich-ta-datepicker.lichta-theme-glass {
|
|
3
|
+
--lichta-primary: #FBBF24 !important;
|
|
4
|
+
--lichta-bg: transparent !important;
|
|
5
|
+
--lichta-surface: rgba(255, 255, 255, 0.05) !important;
|
|
6
|
+
--lichta-popover-bg: rgba(24, 24, 27, 0.92) !important;
|
|
7
|
+
--lichta-text: #F8FAFC !important;
|
|
8
|
+
--lichta-text-muted: #94A3B8 !important;
|
|
9
|
+
--lichta-text-dim: rgba(255, 255, 255, 0.25) !important;
|
|
10
|
+
--lichta-border: rgba(255, 255, 255, 0.08) !important;
|
|
11
|
+
--lichta-hover-bg: rgba(255, 255, 255, 0.08) !important;
|
|
12
|
+
--lichta-today-text: #FBBF24 !important;
|
|
13
|
+
--lichta-selected-bg: rgba(251, 191, 36, 0.3) !important;
|
|
14
|
+
--lichta-selected-text: #FBBF24 !important;
|
|
15
|
+
--lichta-lunar-text: rgba(255, 255, 255, 0.55) !important;
|
|
16
|
+
--lichta-first-lunar: #FBBF24 !important;
|
|
17
|
+
--lichta-radius: 12px !important;
|
|
18
|
+
--lichta-font: 'Outfit', sans-serif !important;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.lich-ta-datepicker.lichta-theme-glass .lich-ta-datepicker-input:hover {
|
|
22
|
+
border-color: rgba(251, 191, 36, 0.3);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.lich-ta-datepicker.lichta-theme-glass .lich-ta-datepicker-calendar-nav:hover {
|
|
26
|
+
color: #FBBF24;
|
|
27
|
+
}
|