@softure-ai/theme-notion 0.2.0 → 0.3.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/CHANGELOG.md +136 -0
- package/README.md +167 -16
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/messages/en.d.ts +17 -0
- package/dist/messages/en.d.ts.map +1 -1
- package/dist/messages/en.js +10 -0
- package/dist/messages/en.js.map +1 -1
- package/dist/messages/index.d.ts +17 -0
- package/dist/messages/index.d.ts.map +1 -1
- package/dist/notion/Code.d.ts +8 -0
- package/dist/notion/Code.d.ts.map +1 -0
- package/dist/notion/Code.js +12 -0
- package/dist/notion/Code.js.map +1 -0
- package/dist/notion/FilterChip.d.ts +24 -0
- package/dist/notion/FilterChip.d.ts.map +1 -0
- package/dist/notion/FilterChip.js +18 -0
- package/dist/notion/FilterChip.js.map +1 -0
- package/dist/notion/Sortable.d.ts +36 -0
- package/dist/notion/Sortable.d.ts.map +1 -0
- package/dist/notion/Sortable.js +83 -0
- package/dist/notion/Sortable.js.map +1 -0
- package/dist/notion/Stats.d.ts +4 -0
- package/dist/notion/Stats.d.ts.map +1 -1
- package/dist/notion/Stats.js +10 -3
- package/dist/notion/Stats.js.map +1 -1
- package/dist/notion/Steps.d.ts +18 -0
- package/dist/notion/Steps.d.ts.map +1 -0
- package/dist/notion/Steps.js +32 -0
- package/dist/notion/Steps.js.map +1 -0
- package/dist/page.css +22 -0
- package/dist/theme.css +55 -46
- package/dist/tokens.d.ts +82 -64
- package/dist/tokens.d.ts.map +1 -1
- package/dist/tokens.js +22 -19
- package/dist/tokens.js.map +1 -1
- package/dist/ui/alert.js +1 -1
- package/dist/ui/alert.js.map +1 -1
- package/dist/ui/badge.d.ts +1 -1
- package/dist/ui/badge.d.ts.map +1 -1
- package/dist/ui/badge.js +33 -13
- package/dist/ui/badge.js.map +1 -1
- package/dist/ui/button-group.js +1 -1
- package/dist/ui/button-group.js.map +1 -1
- package/dist/ui/button.d.ts +1 -1
- package/dist/ui/button.js +3 -3
- package/dist/ui/button.js.map +1 -1
- package/dist/ui/checkbox.js +1 -1
- package/dist/ui/checkbox.js.map +1 -1
- package/dist/ui/dropdown-menu.js +1 -1
- package/dist/ui/empty.js +1 -1
- package/dist/ui/empty.js.map +1 -1
- package/dist/ui/field.js +2 -2
- package/dist/ui/field.js.map +1 -1
- package/dist/ui/item.d.ts.map +1 -1
- package/dist/ui/item.js +8 -3
- package/dist/ui/item.js.map +1 -1
- package/dist/ui/progress.d.ts +4 -1
- package/dist/ui/progress.d.ts.map +1 -1
- package/dist/ui/progress.js +9 -2
- package/dist/ui/progress.js.map +1 -1
- package/dist/ui/radio-group.d.ts +6 -0
- package/dist/ui/radio-group.d.ts.map +1 -0
- package/dist/ui/radio-group.js +14 -0
- package/dist/ui/radio-group.js.map +1 -0
- package/dist/ui/scroll-area.d.ts +3 -1
- package/dist/ui/scroll-area.d.ts.map +1 -1
- package/dist/ui/scroll-area.js +2 -2
- package/dist/ui/scroll-area.js.map +1 -1
- package/dist/ui/select.js +2 -2
- package/dist/ui/select.js.map +1 -1
- package/dist/ui/sidebar.js +4 -4
- package/dist/ui/sidebar.js.map +1 -1
- package/dist/ui/tabs.js +1 -1
- package/dist/ui/tabs.js.map +1 -1
- package/package.json +16 -5
- package/src/index.ts +15 -0
- package/src/messages/en.ts +11 -0
- package/src/notion/Code.tsx +39 -0
- package/src/notion/FilterChip.tsx +71 -0
- package/src/notion/Sortable.tsx +235 -0
- package/src/notion/Stats.tsx +23 -3
- package/src/notion/Steps.tsx +102 -0
- package/src/page.css +22 -0
- package/src/tokens.ts +22 -19
- package/src/ui/alert.tsx +1 -1
- package/src/ui/badge.tsx +35 -13
- package/src/ui/button-group.tsx +1 -1
- package/src/ui/button.tsx +3 -3
- package/src/ui/checkbox.tsx +1 -1
- package/src/ui/dropdown-menu.tsx +1 -1
- package/src/ui/empty.tsx +1 -1
- package/src/ui/field.tsx +2 -2
- package/src/ui/item.tsx +16 -7
- package/src/ui/progress.tsx +19 -2
- package/src/ui/radio-group.tsx +44 -0
- package/src/ui/scroll-area.tsx +11 -2
- package/src/ui/select.tsx +2 -2
- package/src/ui/sidebar.tsx +4 -4
- package/src/ui/tabs.tsx +3 -3
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
export declare function Code({ className, ...props }: ComponentProps<"code">): import("react").JSX.Element;
|
|
3
|
+
export interface CodeBlockProps extends ComponentProps<"pre"> {
|
|
4
|
+
readonly label?: string;
|
|
5
|
+
readonly wrap?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function CodeBlock({ label, wrap, className, ...props }: CodeBlockProps): import("react").JSX.Element;
|
|
8
|
+
//# sourceMappingURL=Code.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Code.d.ts","sourceRoot":"","sources":["../../src/notion/Code.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAK5C,wBAAgB,IAAI,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,CAAC,MAAM,CAAC,+BAQnE;AAED,MAAM,WAAW,cAAe,SAAQ,cAAc,CAAC,KAAK,CAAC;IAE3D,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAExB,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;CACzB;AAGD,wBAAgB,SAAS,CAAC,EAAE,KAAK,EAAE,IAAY,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,+BAerF"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../lib/utils.js";
|
|
3
|
+
// Inline code: the `code` text style in mono, red on the grey `secondary` background, as in Notion.
|
|
4
|
+
export function Code({ className, ...props }) {
|
|
5
|
+
return (_jsx("code", { "data-slot": "code", className: cn("rounded-xs bg-secondary px-1 font-mono text-code text-code-foreground", className), ...props }));
|
|
6
|
+
}
|
|
7
|
+
// A mono block for logs and file paths, without syntax highlighting.
|
|
8
|
+
export function CodeBlock({ label, wrap = false, className, ...props }) {
|
|
9
|
+
const region = label === undefined ? {} : { role: "region", "aria-label": label, tabIndex: 0 };
|
|
10
|
+
return (_jsx("pre", { "data-slot": "code-block", "data-wrap": wrap ? "" : undefined, className: cn("overflow-x-auto rounded-lg bg-muted px-4 py-3 font-mono text-code", wrap ? "whitespace-pre-wrap break-words" : "whitespace-pre", className), ...region, ...props }));
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=Code.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Code.js","sourceRoot":"","sources":["../../src/notion/Code.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAErC,oGAAoG;AACpG,MAAM,UAAU,IAAI,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAA0B;IAClE,OAAO,CACL,4BACY,MAAM,EAChB,SAAS,EAAE,EAAE,CAAC,uEAAuE,EAAE,SAAS,CAAC,KAC7F,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AASD,qEAAqE;AACrE,MAAM,UAAU,SAAS,CAAC,EAAE,KAAK,EAAE,IAAI,GAAG,KAAK,EAAE,SAAS,EAAE,GAAG,KAAK,EAAkB;IACpF,MAAM,MAAM,GAAG,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,YAAY,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC;IAC/F,OAAO,CACL,2BACY,YAAY,eACX,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,EAChC,SAAS,EAAE,EAAE,CACX,mEAAmE,EACnE,IAAI,CAAC,CAAC,CAAC,iCAAiC,CAAC,CAAC,CAAC,gBAAgB,EAC3D,SAAS,CACV,KACG,MAAM,KACN,KAAK,GACT,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export interface FilterChipProps {
|
|
3
|
+
/** The filtered field, as shown before the value: "Status:". */
|
|
4
|
+
readonly label: string;
|
|
5
|
+
/** The chosen option's text; the app's word for "all" when none is chosen. */
|
|
6
|
+
readonly value: string;
|
|
7
|
+
/** Drawn before the label; the caller hides it from assistive technology. */
|
|
8
|
+
readonly icon?: ReactNode;
|
|
9
|
+
/** A non-default value is chosen: the pill turns into the blue tag. */
|
|
10
|
+
readonly isActive?: boolean;
|
|
11
|
+
/** The options, as `DropdownMenu` items (radio items for one choice). */
|
|
12
|
+
readonly children: ReactNode;
|
|
13
|
+
readonly className?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface FilterChipAddProps {
|
|
16
|
+
/** The pill's text; default "Add filter". */
|
|
17
|
+
readonly label?: string;
|
|
18
|
+
/** The fields that can be filtered, as `DropdownMenu` items. */
|
|
19
|
+
readonly children: ReactNode;
|
|
20
|
+
readonly className?: string;
|
|
21
|
+
}
|
|
22
|
+
export declare function FilterChip({ label, value, icon, isActive, children, className }: FilterChipProps): import("react").JSX.Element;
|
|
23
|
+
export declare function FilterChipAdd({ label, children, className }: FilterChipAddProps): import("react").JSX.Element;
|
|
24
|
+
//# sourceMappingURL=FilterChip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterChip.d.ts","sourceRoot":"","sources":["../../src/notion/FilterChip.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAQvC,MAAM,WAAW,eAAe;IAC9B,gEAAgE;IAChE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,8EAA8E;IAC9E,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,6EAA6E;IAC7E,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC;IAC1B,uEAAuE;IACvE,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,yEAAyE;IACzE,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;IAC7B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,kBAAkB;IACjC,6CAA6C;IAC7C,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,gEAAgE;IAChE,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;IAC7B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAUD,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,QAAgB,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,eAAe,+BAkBxG;AAGD,wBAAgB,aAAa,CAAC,EAAE,KAA+B,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,kBAAkB,+BAUzG"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ChevronDown, Plus } from "lucide-react";
|
|
3
|
+
import { en as messages } from "../messages/en.js";
|
|
4
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuTrigger } from "../ui/dropdown-menu.js";
|
|
5
|
+
import { cn } from "../lib/utils.js";
|
|
6
|
+
import { ICON_STROKE_WIDTH } from "./icon-stroke.js";
|
|
7
|
+
const PILL_CLASS = "inline-flex h-6 shrink-0 cursor-pointer items-center gap-1 rounded-full px-2 text-sm whitespace-nowrap text-muted-foreground transition-colors duration-120 outline-none hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5";
|
|
8
|
+
const ACTIVE_CLASS = "data-[active]:bg-blue-tag data-[active]:text-blue-tag-foreground data-[active]:hover:bg-blue-tag data-[active]:data-[state=open]:bg-blue-tag";
|
|
9
|
+
// A list filter drawn the way a Notion database view draws it: a small pill `icon · Label: value ▾` above a table
|
|
10
|
+
// that opens a menu of options in the design system's popover.
|
|
11
|
+
export function FilterChip({ label, value, icon, isActive = false, children, className }) {
|
|
12
|
+
return (_jsxs(DropdownMenu, { children: [_jsxs(DropdownMenuTrigger, { "data-slot": "filter-chip", "data-active": isActive ? "" : undefined, className: cn(PILL_CLASS, ACTIVE_CLASS, className), children: [icon, _jsx("span", { children: label }), _jsx("span", { "data-slot": "filter-chip-value", className: "font-medium", children: value }), _jsx(ChevronDown, { "aria-hidden": "true", strokeWidth: ICON_STROKE_WIDTH })] }), _jsx(DropdownMenuContent, { align: "start", children: children })] }));
|
|
13
|
+
}
|
|
14
|
+
// The "+ Add filter" pill next to the filters: the same height, a ghost look, a menu of the fields to filter by.
|
|
15
|
+
export function FilterChipAdd({ label = messages.filterChip.add, children, className }) {
|
|
16
|
+
return (_jsxs(DropdownMenu, { children: [_jsxs(DropdownMenuTrigger, { "data-slot": "filter-chip-add", className: cn(PILL_CLASS, className), children: [_jsx(Plus, { "aria-hidden": "true", strokeWidth: ICON_STROKE_WIDTH }), _jsx("span", { children: label })] }), _jsx(DropdownMenuContent, { align: "start", children: children })] }));
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=FilterChip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterChip.js","sourceRoot":"","sources":["../../src/notion/FilterChip.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAGjD,OAAO,EAAE,EAAE,IAAI,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,mB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ACtD,CAChB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type ComponentProps, type ReactNode } from "react";
|
|
2
|
+
import { Button } from "../ui/button.js";
|
|
3
|
+
export interface SortableAnnouncements {
|
|
4
|
+
readonly pickedUp: string;
|
|
5
|
+
readonly moved: string;
|
|
6
|
+
readonly dropped: string;
|
|
7
|
+
readonly cancelled: string;
|
|
8
|
+
}
|
|
9
|
+
export interface SortableMove {
|
|
10
|
+
readonly id: string;
|
|
11
|
+
readonly from: number;
|
|
12
|
+
readonly to: number;
|
|
13
|
+
}
|
|
14
|
+
export type SortableDragBy = "row" | "handle";
|
|
15
|
+
export interface SortableListProps extends Omit<ComponentProps<"ul">, "children"> {
|
|
16
|
+
readonly label: string;
|
|
17
|
+
readonly items: readonly string[];
|
|
18
|
+
readonly onReorder: (next: string[], move: SortableMove) => void;
|
|
19
|
+
readonly dragBy?: SortableDragBy;
|
|
20
|
+
readonly holdDelay?: number;
|
|
21
|
+
readonly tolerance?: number;
|
|
22
|
+
readonly instructions?: string;
|
|
23
|
+
readonly announcements?: Partial<SortableAnnouncements>;
|
|
24
|
+
readonly getItemLabel?: (id: string) => string;
|
|
25
|
+
readonly children: ReactNode;
|
|
26
|
+
}
|
|
27
|
+
export declare function SortableList({ label, items, onReorder, dragBy, holdDelay, tolerance, instructions, announcements, getItemLabel, className, children, ...props }: SortableListProps): import("react").JSX.Element;
|
|
28
|
+
export interface SortableItemProps extends ComponentProps<"li"> {
|
|
29
|
+
readonly id: string;
|
|
30
|
+
}
|
|
31
|
+
export declare function SortableItem({ id, className, style, children, ...props }: SortableItemProps): import("react").JSX.Element;
|
|
32
|
+
export interface SortableHandleProps extends Omit<ComponentProps<typeof Button>, "children"> {
|
|
33
|
+
readonly label?: string;
|
|
34
|
+
}
|
|
35
|
+
export declare function SortableHandle({ label, className, ...props }: SortableHandleProps): import("react").JSX.Element;
|
|
36
|
+
//# sourceMappingURL=Sortable.d.ts.map
|
|
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,CAAC,YAAY,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,MAAM,CAAC;IAC/C,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;CAC9B;AAwBD,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,KAAK,EACL,SAAS,EACT,MAAc,EACd,SAAe,EACf,SAAa,EACb,YAA6C,EAC7C,aAAa,EACb,YAAyB,EACzB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,iBAAiB,+BAkEnB;AAED,MAAM,WAAW,iBAAkB,SAAQ,cAAc,CAAC,IAAI,CAAC;IAE7D,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;CACrB;AAQD,wBAAgB,YAAY,CAAC,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,iBAAiB,+BAuB3F;AAED,MAAM,WAAW,mBAAoB,SAAQ,IAAI,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,EAAE,UAAU,CAAC;IAE1F,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB;AAGD,wBAAgB,cAAc,CAAC,EAAE,KAAgC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,mBAAmB,+BAqB5G"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { closestCenter, DndContext, KeyboardSensor, MouseSensor, TouchSensor, useSensor, useSensors, } from "@dnd-kit/core";
|
|
4
|
+
import { arrayMove, SortableContext, sortableKeyboardCoordinates, useSortable, verticalListSortingStrategy, } from "@dnd-kit/sortable";
|
|
5
|
+
import { CSS } from "@dnd-kit/utilities";
|
|
6
|
+
import { GripVertical } from "lucide-react";
|
|
7
|
+
import { createContext, useContext, useId, useRef } from "react";
|
|
8
|
+
import { en as messages } from "../messages/en.js";
|
|
9
|
+
import { cn } from "../lib/utils.js";
|
|
10
|
+
import { Button } from "../ui/button.js";
|
|
11
|
+
import { ICON_STROKE_WIDTH } from "./icon-stroke.js";
|
|
12
|
+
const HANDLE_MOUSE_DISTANCE = 4;
|
|
13
|
+
// The row follows the pointer up and down only.
|
|
14
|
+
const restrictToVerticalAxis = ({ transform }) => ({ ...transform, x: 0 });
|
|
15
|
+
function fillAnnouncement(template, values) {
|
|
16
|
+
return template.replace(/\{(\w+)\}/g, (match, key) => (key in values ? String(values[key]) : match));
|
|
17
|
+
}
|
|
18
|
+
const SortableListContext = createContext({ dragBy: "row" });
|
|
19
|
+
const SortableHandleContext = createContext(null);
|
|
20
|
+
// A list whose rows are reordered by dragging: a long press lifts a row on a touch screen (a swipe before the hold
|
|
21
|
+
// still scrolls, a tap still activates the row), a mouse drags it, the keyboard picks it up with Space or Enter and
|
|
22
|
+
// moves it with the arrows. The order stays with the app: `onReorder` gets the new one.
|
|
23
|
+
export function SortableList({ label, items, onReorder, dragBy = "row", holdDelay = 500, tolerance = 8, instructions = messages.sortable.instructions, announcements, getItemLabel = (id) => id, className, children, ...props }) {
|
|
24
|
+
const contextId = useId();
|
|
25
|
+
const hold = { delay: holdDelay, tolerance };
|
|
26
|
+
const sensors = useSensors(useSensor(MouseSensor, {
|
|
27
|
+
activationConstraint: dragBy === "handle" ? { distance: HANDLE_MOUSE_DISTANCE } : hold,
|
|
28
|
+
}), useSensor(TouchSensor, { activationConstraint: hold }), useSensor(KeyboardSensor, { coordinateGetter: sortableKeyboardCoordinates }));
|
|
29
|
+
const copy = { ...messages.sortable, ...announcements };
|
|
30
|
+
const lastOverId = useRef(null);
|
|
31
|
+
const total = items.length;
|
|
32
|
+
function announce(template, id, overId) {
|
|
33
|
+
const position = items.indexOf(String(overId ?? id)) + 1;
|
|
34
|
+
return fillAnnouncement(template, { item: getItemLabel(String(id)), position, total });
|
|
35
|
+
}
|
|
36
|
+
const liveAnnouncements = {
|
|
37
|
+
onDragStart: ({ active }) => {
|
|
38
|
+
lastOverId.current = active.id;
|
|
39
|
+
return announce(copy.pickedUp, active.id);
|
|
40
|
+
},
|
|
41
|
+
onDragOver: ({ active, over }) => {
|
|
42
|
+
// The first `over` of a drag is the row's own place: keep the "picked up" announcement.
|
|
43
|
+
if (!over || over.id === lastOverId.current)
|
|
44
|
+
return undefined;
|
|
45
|
+
lastOverId.current = over.id;
|
|
46
|
+
return announce(copy.moved, active.id, over.id);
|
|
47
|
+
},
|
|
48
|
+
onDragEnd: ({ active, over }) => announce(over ? copy.dropped : copy.cancelled, active.id, over?.id),
|
|
49
|
+
onDragCancel: ({ active }) => announce(copy.cancelled, active.id),
|
|
50
|
+
};
|
|
51
|
+
function handleDragEnd({ active, over }) {
|
|
52
|
+
if (!over || active.id === over.id)
|
|
53
|
+
return;
|
|
54
|
+
const from = items.indexOf(String(active.id));
|
|
55
|
+
const to = items.indexOf(String(over.id));
|
|
56
|
+
if (from < 0 || to < 0)
|
|
57
|
+
return;
|
|
58
|
+
onReorder(arrayMove([...items], from, to), { id: String(active.id), from, to });
|
|
59
|
+
}
|
|
60
|
+
return (_jsx(DndContext, { id: contextId, sensors: sensors, collisionDetection: closestCenter, modifiers: [restrictToVerticalAxis], accessibility: { announcements: liveAnnouncements, screenReaderInstructions: { draggable: instructions } }, onDragEnd: handleDragEnd, children: _jsx(SortableContext, { items: [...items], strategy: verticalListSortingStrategy, children: _jsx(SortableListContext.Provider, { value: { dragBy }, children: _jsx("ul", { "aria-label": label, "data-slot": "sortable-list", "data-drag-by": dragBy, className: cn("flex flex-col", className), ...props, children: children }) }) }) }));
|
|
61
|
+
}
|
|
62
|
+
// The lifted row floats on `accent-strong` with `shadow-menu`, above its siblings; `data-dragging` marks it.
|
|
63
|
+
const SORTABLE_ITEM = "rounded-md bg-background outline-none touch-manipulation select-none [-webkit-touch-callout:none] focus-visible:ring-2 focus-visible:ring-ring data-[dragging]:relative data-[dragging]:z-10 data-[dragging]:bg-accent-strong data-[dragging]:shadow-menu";
|
|
64
|
+
// One row of a `SortableList`. In `row` mode the row itself is the drag target and is focusable; in `handle` mode a
|
|
65
|
+
// `SortableHandle` inside it is. The drag's own pointer and key handlers win over the same props on the drag target.
|
|
66
|
+
export function SortableItem({ id, className, style, children, ...props }) {
|
|
67
|
+
const { dragBy } = useContext(SortableListContext);
|
|
68
|
+
const { attributes, listeners, setNodeRef, setActivatorNodeRef, transform, transition, isDragging } = useSortable({
|
|
69
|
+
id,
|
|
70
|
+
attributes: { role: "listitem" },
|
|
71
|
+
});
|
|
72
|
+
const rowBinding = dragBy === "row" ? { ...attributes, ...listeners } : {};
|
|
73
|
+
return (_jsx(SortableHandleContext.Provider, { value: { attributes, listeners, setActivatorNodeRef }, children: _jsx("li", { ref: setNodeRef, "data-slot": "sortable-item", "data-id": id, "data-dragging": isDragging ? "" : undefined, className: cn(SORTABLE_ITEM, className), style: { ...style, transform: CSS.Translate.toString(transform), transition }, ...props, ...rowBinding, children: children }) }));
|
|
74
|
+
}
|
|
75
|
+
// A grip button that drags its row, for a list with `dragBy="handle"`.
|
|
76
|
+
export function SortableHandle({ label = messages.sortable.handle, className, ...props }) {
|
|
77
|
+
const binding = useContext(SortableHandleContext);
|
|
78
|
+
if (!binding)
|
|
79
|
+
throw new Error("SortableHandle failed: it must be rendered inside a SortableItem");
|
|
80
|
+
const { attributes, listeners, setActivatorNodeRef } = binding;
|
|
81
|
+
return (_jsx(Button, { ref: setActivatorNodeRef, type: "button", variant: "ghost", size: "icon-sm", "data-slot": "sortable-handle", className: cn("cursor-grab touch-none text-muted-foreground active:cursor-grabbing", className), ...props, ...attributes, ...listeners, role: "button", "aria-label": label, children: _jsx(GripVertical, { "aria-hidden": "true", strokeWidth: ICON_STROKE_WIDTH }) }));
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=Sortable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Sortable.js","sourceRoot":"","sources":["../../src/notion/Sortable.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAE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IAAI,EAAC,SAAS,eACJ,iBAAiB,EAC3B,SAAS,EAAE,EAAE,CAAC,qEAAqE,EAAE,SAAS,CAAC,KAC3F,KAAK,KACL,UAAU,KACV,SAAS,EACb,IAAI,EAAC,QAAQ,gBACD,KAAK,YAEjB,KAAC,YAAY,mBAAa,MAAM,EAAC,WAAW,EAAE,iBAAiB,GAAI,GAC5D,CACV,CAAC;AACJ,CAAC"}
|
package/dist/notion/Stats.d.ts
CHANGED
|
@@ -19,6 +19,10 @@ export interface StatCard {
|
|
|
19
19
|
readonly hint?: string;
|
|
20
20
|
readonly tone?: Tone;
|
|
21
21
|
readonly aside?: StatCardAside;
|
|
22
|
+
/** A bar under the figure, 0–100 (clamped); in the card's `tone` when it has one, primary otherwise. */
|
|
23
|
+
readonly progress?: number;
|
|
24
|
+
/** The bar's accessible name; defaults to `label`. */
|
|
25
|
+
readonly progressLabel?: string;
|
|
22
26
|
}
|
|
23
27
|
export interface StatCardsProps {
|
|
24
28
|
/** The list's accessible name. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stats.d.ts","sourceRoot":"","sources":["../../src/notion/Stats.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Stats.d.ts","sourceRoot":"","sources":["../../src/notion/Stats.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAOvC,OAAO,EAAqC,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AAE1E,MAAM,WAAW,cAAc;IAC7B,6BAA6B;IAC7B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;IAC7B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAID,wBAAgB,SAAS,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,E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QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,SAAS,QAAQ,EAAE,CAAC;CACrC;AAGD,wBAAgB,SAAS,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,cAAc,+BAYzD"}
|
package/dist/notion/Stats.js
CHANGED
|
@@ -1,27 +1,34 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { ChevronRight } from "lucide-react";
|
|
3
3
|
import { Badge } from "../ui/badge.js";
|
|
4
|
+
import { Progress } from "../ui/progress.js";
|
|
4
5
|
import { cn } from "../lib/utils.js";
|
|
5
6
|
import { ICON_STROKE_WIDTH } from "./icon-stroke.js";
|
|
6
|
-
import { TONE_COLORS, TONE_TEXT } from "./tones.js";
|
|
7
|
+
import { TONE_COLORS, TONE_FILL, TONE_TEXT } from "./tones.js";
|
|
7
8
|
// A screen's summary figures folded under a heading, closed by default: the design system's collapsible (a ghost row
|
|
8
9
|
// with a chevron that turns when open, the content indented under it), on native `<details>` so it needs no client.
|
|
9
10
|
export function StatsFold({ title, children, className }) {
|
|
10
11
|
return (_jsxs("details", { "data-slot": "stats-fold", className: cn("group/stats-fold", className), children: [_jsxs("summary", { "data-slot": "stats-fold-summary", className: "flex h-row-height cursor-pointer list-none items-center gap-1 rounded-md px-1 text-foreground transition-colors duration-120 hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none [&::-webkit-details-marker]:hidden", children: [_jsx(ChevronRight, { "aria-hidden": "true", strokeWidth: ICON_STROKE_WIDTH, className: "size-4 shrink-0 text-muted-foreground transition-transform duration-150 group-open/stats-fold:rotate-90" }), _jsx("h2", { className: "text-ui-medium", children: title })] }), _jsx("div", { "data-slot": "stats-fold-content", className: "flex flex-col gap-3 pt-2 pb-1 pl-6", children: children })] }));
|
|
11
12
|
}
|
|
13
|
+
function clampProgress(progress) {
|
|
14
|
+
if (!Number.isFinite(progress))
|
|
15
|
+
return 0;
|
|
16
|
+
return Math.min(100, Math.max(0, progress));
|
|
17
|
+
}
|
|
12
18
|
function getStatCardsLayout(isFullWidth, isOneRow) {
|
|
13
19
|
if (isOneRow)
|
|
14
20
|
return "row";
|
|
15
21
|
return isFullWidth ? "full" : "grid";
|
|
16
22
|
}
|
|
17
23
|
// Summary figures as a row of cards wrapping on a narrow screen: the label, the figure in its tone's colour (never
|
|
18
|
-
// broken, tabular numbers), an optional
|
|
24
|
+
// broken, tabular numbers), an optional bar under it, an optional note and an optional short figure on its right as a
|
|
25
|
+
// tag.
|
|
19
26
|
export function StatCards({ label, cards, isFullWidth = false, isOneRow = false }) {
|
|
20
27
|
return (_jsx("ul", { "aria-label": label, "data-slot": "stat-cards", "data-layout": getStatCardsLayout(isFullWidth, isOneRow), className: cn("grid gap-2", isFullWidth
|
|
21
28
|
? "grid-cols-[repeat(auto-fit,minmax(min(14rem,100%),1fr))]"
|
|
22
29
|
: "grid-cols-[repeat(auto-fill,minmax(min(10rem,100%),1fr))]", isOneRow && "sm:auto-cols-fr sm:grid-flow-col sm:grid-cols-none"), children: cards.map((card) => {
|
|
23
30
|
const tone = card.tone ?? "default";
|
|
24
|
-
return (_jsxs("li", { "data-stat": card.key, className: "flex min-w-0 items-start justify-between gap-2 rounded-lg bg-card p-3 text-card-foreground shadow-card", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("div", { className: "text-section-label text-muted-foreground", children: card.label }), _jsx("div", { "data-tone": tone, className: cn("mt-1 text-heading-3 whitespace-nowrap tabular-nums", TONE_TEXT[tone]), children: card.value }), card.hint === undefined ? null : _jsx("div", { className: "mt-1 text-small text-muted-foreground", children: card.hint })] }), card.aside === undefined ? null : (_jsx(Badge, { variant: "tag", color: TONE_COLORS[card.aside.tone ?? "default"] ?? "default", "data-slot": "stat-card-aside", "data-tone": card.aside.tone ?? "default", className: "text-small", children: card.aside.text }))] }, card.key));
|
|
31
|
+
return (_jsxs("li", { "data-stat": card.key, className: "flex min-w-0 items-start justify-between gap-2 rounded-lg bg-card p-3 text-card-foreground shadow-card", children: [_jsxs("div", { className: cn("min-w-0", card.progress !== undefined && "flex-1"), children: [_jsx("div", { className: "text-section-label text-muted-foreground", children: card.label }), _jsx("div", { "data-tone": tone, className: cn("mt-1 text-heading-3 whitespace-nowrap tabular-nums", TONE_TEXT[tone]), children: card.value }), card.progress === undefined ? null : (_jsx(Progress, { value: clampProgress(card.progress), "aria-label": card.progressLabel ?? card.label, "data-slot": "stat-card-progress", className: "mt-2", indicatorClassName: card.tone === undefined ? undefined : TONE_FILL[card.tone] })), card.hint === undefined ? null : _jsx("div", { className: "mt-1 text-small text-muted-foreground", children: card.hint })] }), card.aside === undefined ? null : (_jsx(Badge, { variant: "tag", color: TONE_COLORS[card.aside.tone ?? "default"] ?? "default", "data-slot": "stat-card-aside", "data-tone": card.aside.tone ?? "default", className: "text-small", children: card.aside.text }))] }, card.key));
|
|
25
32
|
}) }));
|
|
26
33
|
}
|
|
27
34
|
// Small counts as "label **value**" tags in one row, wrapping only on a phone, each in its tone's colour.
|
package/dist/notion/Stats.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stats.js","sourceRoot":"","sources":["../../src/notion/Stats.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAG5C,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAErC,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,SAAS,EAAa,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"Stats.js","sourceRoot":"","sources":["../../src/notion/Stats.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAG5C,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;A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IAAI,GAAO,IACtG,EACL,IAAI,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CACjC,KAAC,KAAK,IACJ,OAAO,EAAC,KAAK,EACb,KAAK,EAAE,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,SAAS,CAAC,IAAI,SAAS,eACnD,iBAAiB,eAChB,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,SAAS,EACvC,SAAS,EAAC,YAAY,YAErB,IAAI,CAAC,KAAK,CAAC,IAAI,GACV,CACT,KA9BI,IAAI,CAAC,GAAG,CA+BV,CACN,CAAC;QACJ,CAAC,CAAC,GACC,CACN,CAAC;AACJ,CAAC;AAeD,0GAA0G;AAC1G,MAAM,UAAU,SAAS,CAAC,EAAE,KAAK,EAAE,KAAK,EAAkB;IACxD,OAAO,CACL,2BAAgB,KAAK,eAAY,YAAY,EAAC,SAAS,EAAC,0DAA0D,YAC/G,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACnB,0BAA8B,IAAI,CAAC,GAAG,eAAa,IAAI,CAAC,IAAI,IAAI,SAAS,YACvE,MAAC,KAAK,IAAC,OAAO,EAAC,KAAK,EAAC,KAAK,EAAE,WAAW,CAAC,IAAI,CAAC,IAAI,IAAI,SAAS,CAAC,IAAI,SAAS,aACzE,IAAI,CAAC,KAAK,OAAE,iBAAQ,SAAS,EAAC,0BAA0B,YAAE,IAAI,CAAC,KAAK,GAAU,IACzE,IAHD,IAAI,CAAC,GAAG,CAIZ,CACN,CAAC,GACC,CACN,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export type StepState = "done" | "current" | "todo" | "failed";
|
|
3
|
+
export interface StepItem {
|
|
4
|
+
readonly key: string;
|
|
5
|
+
readonly title: string;
|
|
6
|
+
readonly note?: ReactNode;
|
|
7
|
+
readonly state?: StepState;
|
|
8
|
+
readonly aside?: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export type StepsLayout = "row" | "list";
|
|
11
|
+
export interface StepsProps {
|
|
12
|
+
readonly label: string;
|
|
13
|
+
readonly steps: readonly StepItem[];
|
|
14
|
+
readonly layout?: StepsLayout;
|
|
15
|
+
readonly stateLabels?: Partial<Readonly<Record<StepState, string>>>;
|
|
16
|
+
}
|
|
17
|
+
export declare function Steps({ label, steps, layout, stateLabels }: StepsProps): import("react").JSX.Element;
|
|
18
|
+
//# sourceMappingURL=Steps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Steps.d.ts","sourceRoot":"","sources":["../../src/notion/Steps.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKvC,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,QAAQ,CAAC;AAE/D,MAAM,WAAW,QAAQ;IAEvB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC;IAE1B,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC;IAE3B,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC;CAC5B;AAGD,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,MAAM,CAAC;AAEzC,MAAM,WAAW,UAAU;IAEzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,SAAS,QAAQ,EAAE,CAAC;IACpC,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC;IAE9B,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;CACrE;AA2BD,wBAAgB,KAAK,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,MAAc,EAAE,WAAW,EAAE,EAAE,UAAU,+BA8C9E"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { en as messages } from "../messages/en.js";
|
|
3
|
+
import { cn } from "../lib/utils.js";
|
|
4
|
+
// Literal class names per state, so Tailwind generates each one (the theme's `@source` covers this folder).
|
|
5
|
+
const STEP_NUMBER_STATE = {
|
|
6
|
+
done: "bg-green-tag text-green-tag-foreground",
|
|
7
|
+
current: "bg-primary text-primary-foreground",
|
|
8
|
+
todo: "bg-muted text-muted-foreground",
|
|
9
|
+
failed: "bg-red-tag text-red-tag-foreground",
|
|
10
|
+
};
|
|
11
|
+
const STEPS_LIST = {
|
|
12
|
+
row: "grid grid-cols-[repeat(auto-fill,minmax(min(12rem,100%),1fr))] gap-2",
|
|
13
|
+
list: "flex flex-col",
|
|
14
|
+
};
|
|
15
|
+
const STEP_ITEM = {
|
|
16
|
+
row: "flex min-w-0 items-start gap-2 rounded-lg bg-card p-3 text-card-foreground shadow-card data-[state=current]:bg-blue-bg",
|
|
17
|
+
list: "flex min-w-0 items-start gap-2 rounded-md px-2 py-1.5 transition-colors duration-120 hover:bg-accent",
|
|
18
|
+
};
|
|
19
|
+
const STEP_NUMBER_SHAPE = {
|
|
20
|
+
row: "rounded-full",
|
|
21
|
+
list: "rounded-sm",
|
|
22
|
+
};
|
|
23
|
+
// An ordered process: each step's number in a badge coloured by its state, its title, an optional note under it and
|
|
24
|
+
// an optional aside at its end. The state is also a word for assistive technology, so it never reads by colour alone.
|
|
25
|
+
export function Steps({ label, steps, layout = "row", stateLabels }) {
|
|
26
|
+
const words = { ...messages.steps, ...stateLabels };
|
|
27
|
+
return (_jsx("ol", { "aria-label": label, "data-slot": "steps", "data-layout": layout, className: STEPS_LIST[layout], children: steps.map((step, index) => {
|
|
28
|
+
const state = step.state ?? "todo";
|
|
29
|
+
return (_jsxs("li", { "data-step": step.key, "data-state": state, "aria-current": state === "current" ? "step" : undefined, className: STEP_ITEM[layout], children: [_jsx("span", { "aria-hidden": "true", "data-slot": "step-number", className: cn("mt-px flex size-5 shrink-0 items-center justify-center text-small font-medium tabular-nums", STEP_NUMBER_SHAPE[layout], STEP_NUMBER_STATE[state]), children: index + 1 }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsxs("div", { className: "text-sm font-medium", children: [step.title, _jsxs("span", { className: "sr-only", children: [", ", words[state]] })] }), step.note === undefined ? null : (_jsx("div", { "data-slot": "step-note", className: "mt-0.5 text-small text-muted-foreground", children: step.note }))] }), step.aside === undefined ? null : (_jsx("div", { "data-slot": "step-aside", className: "shrink-0", children: step.aside }))] }, step.key));
|
|
30
|
+
}) }));
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=Steps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Steps.js","sourceRoot":"","sources":["../../src/notion/Steps.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,EAAE,IAAI,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AA2BrC,4GAA4G;AAC5G,MAAM,iBAAiB,GAAwC;IAC7D,IAAI,EAAE,wCAAwC;IAC9C,OAAO,EAAE,oCAAoC;IAC7C,IAAI,EAAE,gCAAgC;IACtC,MAAM,EAAE,oCAAoC;CAC7C,CAAC;AAEF,MAAM,UAAU,GAA0C;IACxD,GAAG,EAAE,sEAAsE;IAC3E,IAAI,EAAE,eAAe;CACtB,CAAC;AAEF,MAAM,SAAS,GAA0C;IACvD,GAAG,EAAE,wHAAwH;IAC7H,IAAI,EAAE,sGAAsG;CAC7G,CAAC;AAEF,MAAM,iBAAiB,GAA0C;IAC/D,GAAG,EAAE,cAAc;IACnB,IAAI,EAAE,YAAY;CACnB,CAAC;AAEF,oHAAoH;AACpH,sHAAsH;AACtH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AI,CAAC,GAAG,CAiCV,CACN,CAAC;QACJ,CAAC,CAAC,GACC,CACN,CAAC;AACJ,CAAC"}
|
package/dist/page.css
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The Notion page base: the rules of the design system's base layer that the kit's `base.css` leaves to the theme.
|
|
3
|
+
* Text outside the components takes the panel size (14 px, `text-sm`), selected text the blue tag colour, and the page
|
|
4
|
+
* greyscale font smoothing on macOS. In `@layer base`, so every component and utility overrides it.
|
|
5
|
+
*
|
|
6
|
+
* Import it after `theme.css` and the kit's `base.css`, through the app's Tailwind (it reads the type scale with
|
|
7
|
+
* `--theme()`).
|
|
8
|
+
*/
|
|
9
|
+
@layer base {
|
|
10
|
+
html {
|
|
11
|
+
-webkit-font-smoothing: antialiased;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
body {
|
|
15
|
+
font-size: --theme(--text-sm);
|
|
16
|
+
line-height: --theme(--text-sm--line-height);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
::selection {
|
|
20
|
+
background: var(--blue-tag);
|
|
21
|
+
}
|
|
22
|
+
}
|