@scripso-homepad/ui 0.4.30 → 0.4.31
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/index.cjs +17 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +17 -20
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Calendar.tsx +8 -13
- package/src/theme/calendar.ts +11 -9
package/dist/index.cjs
CHANGED
|
@@ -2292,7 +2292,7 @@ var CALENDAR_NAV_ICON_COLOR = colors.stormGray850;
|
|
|
2292
2292
|
var CALENDAR_FIELD_ICON_SIZE = 20;
|
|
2293
2293
|
var CALENDAR_FIELD_WIDTH = CALENDAR_PANEL_WIDTH;
|
|
2294
2294
|
var CALENDAR_FIELD_HEIGHT = 52;
|
|
2295
|
-
var CALENDAR_FIELD_PADDING =
|
|
2295
|
+
var CALENDAR_FIELD_PADDING = 14;
|
|
2296
2296
|
var CALENDAR_FIELD_GAP = spacing.sm;
|
|
2297
2297
|
var CALENDAR_FIELD_PLACEHOLDER_COLOR = colors.stormGray200;
|
|
2298
2298
|
var CALENDAR_PANEL_TOTAL_HEIGHT = CALENDAR_PANEL_PADDING * 2 + CALENDAR_HEADER_HEIGHT + CALENDAR_PANEL_GAP * 2 + CALENDAR_WEEKDAY_CELL_SIZE + CALENDAR_DAY_GRID_HEIGHT;
|
|
@@ -2454,19 +2454,20 @@ var calendarDropdownMetrics = reactNative.StyleSheet.create({
|
|
|
2454
2454
|
color: colors.stormGray300
|
|
2455
2455
|
},
|
|
2456
2456
|
dayLabelDisabled: {
|
|
2457
|
-
color: colors.stormGray300
|
|
2458
|
-
opacity: 0.5
|
|
2457
|
+
color: colors.stormGray300
|
|
2459
2458
|
},
|
|
2460
|
-
|
|
2459
|
+
todayDotWrap: {
|
|
2461
2460
|
position: "absolute",
|
|
2462
|
-
bottom:
|
|
2463
|
-
left:
|
|
2461
|
+
bottom: 4,
|
|
2462
|
+
left: 0,
|
|
2463
|
+
right: 0,
|
|
2464
|
+
alignItems: "center"
|
|
2465
|
+
},
|
|
2466
|
+
todayDot: {
|
|
2464
2467
|
width: CALENDAR_DAY_DOT_SIZE,
|
|
2465
2468
|
height: CALENDAR_DAY_DOT_SIZE,
|
|
2466
|
-
borderRadius:
|
|
2467
|
-
backgroundColor: CALENDAR_TODAY_DOT_COLOR
|
|
2468
|
-
marginLeft: -1.5,
|
|
2469
|
-
zIndex: 1
|
|
2469
|
+
borderRadius: CALENDAR_DAY_DOT_SIZE / 2,
|
|
2470
|
+
backgroundColor: CALENDAR_TODAY_DOT_COLOR
|
|
2470
2471
|
},
|
|
2471
2472
|
pickerBody: {
|
|
2472
2473
|
width: CALENDAR_DAY_GRID_WIDTH,
|
|
@@ -2567,7 +2568,8 @@ var calendarFieldMetrics = reactNative.StyleSheet.create({
|
|
|
2567
2568
|
paddingVertical: 0,
|
|
2568
2569
|
paddingHorizontal: 0,
|
|
2569
2570
|
margin: 0,
|
|
2570
|
-
|
|
2571
|
+
includeFontPadding: false,
|
|
2572
|
+
...reactNative.Platform.OS === "android" ? { textAlignVertical: "center" } : null,
|
|
2571
2573
|
...reactNative.Platform.OS === "web" ? {
|
|
2572
2574
|
outlineStyle: "none"
|
|
2573
2575
|
} : null
|
|
@@ -2954,21 +2956,16 @@ function useCalendarLocale(locale) {
|
|
|
2954
2956
|
);
|
|
2955
2957
|
}
|
|
2956
2958
|
function resolveDayCellStyle(day) {
|
|
2957
|
-
if (day.isDisabled) {
|
|
2958
|
-
return [calendarDropdownMetrics.dayCell];
|
|
2959
|
-
}
|
|
2960
2959
|
if (day.isSelected) {
|
|
2961
2960
|
return [calendarDropdownMetrics.dayCell, calendarDropdownMetrics.dayCellSelected];
|
|
2962
2961
|
}
|
|
2962
|
+
const useMutedBackground = day.inCurrentMonth && !day.isToday && (day.isPast || day.isDisabled);
|
|
2963
2963
|
return [
|
|
2964
2964
|
calendarDropdownMetrics.dayCell,
|
|
2965
|
-
|
|
2965
|
+
useMutedBackground ? calendarDropdownMetrics.dayCellPast : null
|
|
2966
2966
|
];
|
|
2967
2967
|
}
|
|
2968
2968
|
function resolveDayLabelStyle(day) {
|
|
2969
|
-
if (day.isDisabled) {
|
|
2970
|
-
return [calendarDropdownMetrics.dayLabel, calendarDropdownMetrics.dayLabelDisabled];
|
|
2971
|
-
}
|
|
2972
2969
|
if (day.isSelected) {
|
|
2973
2970
|
return [calendarDropdownMetrics.dayLabel, calendarDropdownMetrics.dayLabelSelected];
|
|
2974
2971
|
}
|
|
@@ -2978,7 +2975,7 @@ function resolveDayLabelStyle(day) {
|
|
|
2978
2975
|
if (day.isToday) {
|
|
2979
2976
|
return [calendarDropdownMetrics.dayLabel, calendarDropdownMetrics.dayLabelToday];
|
|
2980
2977
|
}
|
|
2981
|
-
if (day.isPast) {
|
|
2978
|
+
if (day.isPast || day.isDisabled) {
|
|
2982
2979
|
return [calendarDropdownMetrics.dayLabel, calendarDropdownMetrics.dayLabelMuted];
|
|
2983
2980
|
}
|
|
2984
2981
|
return [calendarDropdownMetrics.dayLabel, calendarDropdownMetrics.dayLabelFuture];
|
|
@@ -3169,7 +3166,7 @@ function Calendar(props) {
|
|
|
3169
3166
|
style: resolveDayCellStyle(day),
|
|
3170
3167
|
children: [
|
|
3171
3168
|
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: resolveDayLabelStyle(day), children: day.date.getDate() }),
|
|
3172
|
-
day.isToday && day.inCurrentMonth && !day.isSelected ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: calendarDropdownMetrics.todayDot }) : null
|
|
3169
|
+
day.isToday && day.inCurrentMonth && !day.isSelected ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: calendarDropdownMetrics.todayDotWrap, children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: calendarDropdownMetrics.todayDot }) }) : null
|
|
3173
3170
|
]
|
|
3174
3171
|
},
|
|
3175
3172
|
day.date.toISOString()
|