diff --git a/.editorConfig b/.editorConfig index c05d0021..ff6c8395 100644 --- a/.editorConfig +++ b/.editorConfig @@ -14,4 +14,9 @@ indent_size = 2 # Markdown files [*.md] -trim_trailing_whitespace = false \ No newline at end of file +trim_trailing_whitespace = false + +# Style files +[*.css] +indent_size = 4 + \ No newline at end of file diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 5a7652a4..f2b7945d 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -21,11 +21,14 @@ jobs: - name: Checkout repository uses: actions/checkout@v6 + - name: Install pnpm + uses: pnpm/action-setup@v4 + - name: Setup Node.js uses: actions/setup-node@v6 with: node-version-file: '.nvmrc' - cache: 'npm' + cache: 'pnpm' - name: Install dependencies run: | @@ -33,10 +36,10 @@ jobs: pwd rm -rf **/node_modules rm -rf package-lock.json - npm install || true + pnpm install || true - name: Build Storybook - run: npm run build-storybook + run: pnpm build-storybook - name: Setup Pages uses: actions/configure-pages@v5 diff --git a/.npmrc b/.npmrc new file mode 100644 index 00000000..c42da845 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +engine-strict = true diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 00000000..eb858cce --- /dev/null +++ b/.prettierignore @@ -0,0 +1,3 @@ +.github +pnpm-lock.yaml +storybook-static diff --git a/.storybook/main.ts b/.storybook/main.ts index dc8f6a7d..0ce6d8e0 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -40,7 +40,8 @@ const config: StorybookConfig = { check: true, skipCompiler: true, reactDocgenTypescriptOptions: { - propFilter: (prop) => (prop.parent ? !/node_modules/.test(prop.parent.fileName) : true), + propFilter: (prop) => + prop.parent ? !/node_modules/.test(prop.parent.fileName) : true, }, }, }; diff --git a/.storybook/manager.ts b/.storybook/manager.ts index cca2bf42..3f85f86b 100644 --- a/.storybook/manager.ts +++ b/.storybook/manager.ts @@ -1,21 +1,21 @@ -import { addons } from 'storybook/manager-api'; -import { create } from 'storybook/theming'; +import { addons } from "storybook/manager-api"; +import { create } from "storybook/theming"; addons.setConfig({ theme: create({ - base: 'light', + base: "light", brandTitle: '
- { eventTime?.from_time &&
+ {eventTime?.from_time &&
eventTime?.to_time &&
formattedDuration(
eventTime.from_time,
diff --git a/packages/frappe-ui-react/src/components/calendar/calendarMonthly.tsx b/packages/frappe-ui-react/src/components/calendar/calendarMonthly.tsx
index 43b4cc8c..c0f997d2 100644
--- a/packages/frappe-ui-react/src/components/calendar/calendarMonthly.tsx
+++ b/packages/frappe-ui-react/src/components/calendar/calendarMonthly.tsx
@@ -106,7 +106,9 @@ export const CalendarMonthly = () => {
? "text-ink-gray-7"
: "text-ink-gray-3"
)}
- onDoubleClick={(e) => handleCellDblClick(e, date.toLocaleDateString("en-CA"))}
+ onDoubleClick={(e) =>
+ handleCellDblClick(e, date.toLocaleDateString("en-CA"))
+ }
>
(
fn: (item: T) => string
): { [key: string]: T[] } {
if (typeof fn !== "function") throw new Error(`${fn} should be a function`);
- return obj.reduce((acc, item) => {
- const group = fn(item);
- if (!acc[group]) {
- acc[group] = [];
- }
- acc[group].push(item);
- return acc;
- }, {} as { [key: string]: T[] });
+ return obj.reduce(
+ (acc, item) => {
+ const group = fn(item);
+ if (!acc[group]) {
+ acc[group] = [];
+ }
+ acc[group].push(item);
+ return acc;
+ },
+ {} as { [key: string]: T[] }
+ );
}
export function calculateMinutes(time: string): number {
@@ -361,12 +364,14 @@ export function sortMonthlyEvents(events: CalendarEvent[]) {
.filter((event) => !event.isFullDay)
.sort((a, b) =>
a.from_time !== b.from_time
- ? calculateMinutes(a.from_time || '00:00') > calculateMinutes(b.from_time || '00:00')
+ ? calculateMinutes(a.from_time || "00:00") >
+ calculateMinutes(b.from_time || "00:00")
+ ? 1
+ : -1
+ : calculateMinutes(a.to_time || "00:00") >
+ calculateMinutes(b.to_time || "00:00")
? 1
: -1
- : calculateMinutes(a.to_time || '00:00') > calculateMinutes(b.to_time || '00:00')
- ? 1
- : -1
);
return [...fullDayEvents, ...timedEvents];
diff --git a/packages/frappe-ui-react/src/components/calendar/calendarWeekly.tsx b/packages/frappe-ui-react/src/components/calendar/calendarWeekly.tsx
index e64f64f0..2426a666 100644
--- a/packages/frappe-ui-react/src/components/calendar/calendarWeekly.tsx
+++ b/packages/frappe-ui-react/src/components/calendar/calendarWeekly.tsx
@@ -1,5 +1,5 @@
import { ChevronDown, ChevronUp } from "lucide-react";
-import { useContext, useEffect, useRef, useState } from "react";
+import { useContext, useEffect, useMemo, useRef, useState } from "react";
import clsx from "clsx";
import {
@@ -26,8 +26,6 @@ export const CalendarWeekly = ({ weeklyDates }: CalendarWeeklyProps) => {
const { timedEvents, fullDayEvents } = useCalendarData(events, "Week");
const [isCollapsed, setIsCollapsed] = useState(false);
- const [showCollapsable, setShowCollapsable] = useState(true);
-
const gridRef = useRef
This is the main content of the card.
+Content above
+Content below
+Content above
+Content below
+