@milktop/react-ui 0.2.0 → 0.2.1
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
CHANGED
|
@@ -106,7 +106,8 @@ the words of the app's provider.
|
|
|
106
106
|
(`classes={{ itemText: 'font-mono' }}`).
|
|
107
107
|
- Slots replace a part's content: a node, or a function given its state
|
|
108
108
|
(`indicator={({ indeterminate }) => …}`, `renderItem={(item) => …}`).
|
|
109
|
-
-
|
|
109
|
+
- Tokens for one instance or a section: a class (`className="[--ui-accent:#16a34a]"` with
|
|
110
|
+
Tailwind) or `style={{ '--ui-accent': … }}`; on `:root` for the whole app.
|
|
110
111
|
- Typed: written in TypeScript, shipped as JS with `.d.ts` types, so TSX apps
|
|
111
112
|
get checked props (Select's value is the type of your items' `valueKey`)
|
|
112
113
|
and JSX apps get autocomplete, with no errors either way.
|
|
@@ -301,13 +301,14 @@ export function EventCalendar({ events = [], resources = null, resourceViews = n
|
|
|
301
301
|
const refocus = useRef(null);
|
|
302
302
|
const suppressClick = useRef(false);
|
|
303
303
|
// `byMinutes` kept to the day's hours: an event moves or grows no further than
|
|
304
|
-
// the grid shows (one already past an edge doesn't go further past it)
|
|
304
|
+
// the grid shows (one already past an edge doesn't go further past it), and
|
|
305
|
+
// shrinks to a slot at the shortest (one already shorter doesn't shrink).
|
|
305
306
|
function withinHours(event, kind, byMinutes) {
|
|
306
307
|
const start = parse(event.start);
|
|
307
308
|
const from = minutesOfDay(start);
|
|
308
|
-
const
|
|
309
|
-
const latest = Math.max(0, endHour * 60 -
|
|
310
|
-
const earliest = kind === 'move' ? Math.min(0, startHour * 60 - from) : -
|
|
309
|
+
const length = minutesBetween(start, parse(event.end));
|
|
310
|
+
const latest = Math.max(0, endHour * 60 - from - length);
|
|
311
|
+
const earliest = kind === 'move' ? Math.min(0, startHour * 60 - from) : Math.min(0, slotMinutes - length);
|
|
311
312
|
return Math.max(earliest, Math.min(latest, byMinutes));
|
|
312
313
|
}
|
|
313
314
|
// Where a pinned event placed at `minute` starts: on a slot, ending by the day's last hour.
|