@rinzai/zen 0.3.2 → 0.4.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/dist/actions-menu/index.d.ts.map +1 -1
- package/dist/animated-number/index.d.ts +25 -0
- package/dist/animated-number/index.d.ts.map +1 -0
- package/dist/avatar/index.d.ts +24 -0
- package/dist/avatar/index.d.ts.map +1 -0
- package/dist/backdrop/index.d.ts.map +1 -1
- package/dist/badge/index.d.ts +1 -1
- package/dist/base.css +100 -0
- package/dist/button/index.d.ts +2 -2
- package/dist/button/index.d.ts.map +1 -1
- package/dist/collapse/index.d.ts.map +1 -1
- package/dist/dialog/index.d.ts.map +1 -1
- package/dist/dropdown/index.d.ts.map +1 -1
- package/dist/editable-cell/index.d.ts +24 -0
- package/dist/editable-cell/index.d.ts.map +1 -0
- package/dist/field/index.d.ts +25 -0
- package/dist/field/index.d.ts.map +1 -0
- package/dist/header/index.d.ts.map +1 -1
- package/dist/icons/chevron-left.d.ts +3 -0
- package/dist/icons/chevron-left.d.ts.map +1 -0
- package/dist/icons/chevron-right.d.ts +3 -0
- package/dist/icons/chevron-right.d.ts.map +1 -0
- package/dist/icons/index.d.ts +4 -0
- package/dist/icons/index.d.ts.map +1 -1
- package/dist/icons/status.d.ts +2 -0
- package/dist/icons/status.d.ts.map +1 -0
- package/dist/index.d.ts +21 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/input-group/index.d.ts +17 -0
- package/dist/input-group/index.d.ts.map +1 -0
- package/dist/lib.d.ts +2 -0
- package/dist/lib.d.ts.map +1 -0
- package/dist/meter/index.d.ts +25 -0
- package/dist/meter/index.d.ts.map +1 -0
- package/dist/money-input/index.d.ts +70 -0
- package/dist/money-input/index.d.ts.map +1 -0
- package/dist/month-picker/index.d.ts +28 -0
- package/dist/month-picker/index.d.ts.map +1 -0
- package/dist/popover/index.d.ts.map +1 -1
- package/dist/segmented/index.d.ts +2 -1
- package/dist/segmented/index.d.ts.map +1 -1
- package/dist/select/index.d.ts +32 -0
- package/dist/select/index.d.ts.map +1 -0
- package/dist/slider/index.d.ts +25 -0
- package/dist/slider/index.d.ts.map +1 -0
- package/dist/tab-bar/index.d.ts +23 -0
- package/dist/tab-bar/index.d.ts.map +1 -0
- package/dist/table/index.d.ts +76 -7
- package/dist/table/index.d.ts.map +1 -1
- package/dist/tailwind.css +7 -0
- package/dist/theme.css +888 -0
- package/dist/toast/index.d.ts +11 -3
- package/dist/toast/index.d.ts.map +1 -1
- package/dist/tree/index.d.ts +79 -0
- package/dist/tree/index.d.ts.map +1 -0
- package/dist/utils/cx.d.ts +5 -0
- package/dist/utils/cx.d.ts.map +1 -1
- package/dist/utils/field-chevron.d.ts +6 -0
- package/dist/utils/field-chevron.d.ts.map +1 -0
- package/dist/utils/graphics.d.ts +20 -0
- package/dist/utils/graphics.d.ts.map +1 -0
- package/dist/utils/merge.d.ts +12 -0
- package/dist/utils/merge.d.ts.map +1 -0
- package/dist/utils/money.d.ts +30 -0
- package/dist/utils/money.d.ts.map +1 -0
- package/dist/utils/month.d.ts +16 -0
- package/dist/utils/month.d.ts.map +1 -0
- package/dist/utils/status-icons.d.ts +11 -0
- package/dist/utils/status-icons.d.ts.map +1 -0
- package/dist/utils/styles.d.ts +6 -0
- package/dist/utils/styles.d.ts.map +1 -1
- package/dist/utils/theme.d.ts +92 -0
- package/dist/utils/theme.d.ts.map +1 -0
- package/dist/utils/useAnchoredPopup.d.ts +36 -0
- package/dist/utils/useAnchoredPopup.d.ts.map +1 -0
- package/dist/utils/useHydrated.d.ts +3 -0
- package/dist/utils/useHydrated.d.ts.map +1 -0
- package/dist/utils/useVirtualList.d.ts +4 -0
- package/dist/utils/useVirtualList.d.ts.map +1 -1
- package/dist/variables.css +90 -0
- package/dist/zen.css +1 -1
- package/dist/zen.js +2107 -532
- package/package.json +9 -1
package/dist/toast/index.d.ts
CHANGED
|
@@ -11,10 +11,18 @@ export interface ToastOptions {
|
|
|
11
11
|
/** Milliseconds before it goes away; 0 keeps it until dismissed. */
|
|
12
12
|
timeout?: number;
|
|
13
13
|
}
|
|
14
|
-
|
|
15
|
-
export default function ToastProvider({ children }: {
|
|
14
|
+
export interface ToastProviderProps {
|
|
16
15
|
children: ReactNode;
|
|
17
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Gap between the toasts and the bottom of the screen on phones (a CSS
|
|
18
|
+
* length, default 1rem), e.g. "5.5rem" to clear a bottom tab bar.
|
|
19
|
+
*/
|
|
20
|
+
offset?: string;
|
|
21
|
+
/** Classes for the column the toasts stack in (position, width…). */
|
|
22
|
+
viewportClassName?: string;
|
|
23
|
+
}
|
|
24
|
+
/** Mount once near the root; `useToast()` works anywhere inside. */
|
|
25
|
+
export default function ToastProvider({ children, offset, viewportClassName }: ToastProviderProps): import('react').JSX.Element;
|
|
18
26
|
/** Returns `toast(title, options)`, which shows a toast and returns its id. */
|
|
19
27
|
export declare function useToast(): (title: string, options?: ToastOptions) => number;
|
|
20
28
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/toast/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/toast/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAgC,SAAS,EAAwD,MAAM,OAAO,CAAC;AAKtH,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;AAErD,MAAM,WAAW,YAAY;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,sCAAsC;IACtC,MAAM,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,IAAI,CAAA;KAAE,CAAC;IAChD,oEAAoE;IACpE,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAgBD,MAAM,WAAW,kBAAkB;IAC/B,QAAQ,EAAE,SAAS,CAAC;IACpB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,qEAAqE;IACrE,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,oEAAoE;AACpE,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,iBAAiB,EAAE,EAAE,kBAAkB,+BAiDhG;AAED,+EAA+E;AAC/E,wBAAgB,QAAQ,YAlEoB,MAAM,YAAY,YAAY,KAAK,MAAM,CAsEpF"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { TableCellProps } from '../table';
|
|
2
|
+
import { ComponentProps, CSSProperties, ReactNode } from 'react';
|
|
3
|
+
/** One visible row of a tree. */
|
|
4
|
+
export interface TreeRowData<T> {
|
|
5
|
+
item: T;
|
|
6
|
+
key: string;
|
|
7
|
+
/** 0 for top-level rows. */
|
|
8
|
+
depth: number;
|
|
9
|
+
parentKey: string | null;
|
|
10
|
+
hasChildren: boolean;
|
|
11
|
+
expanded: boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Headless tree for tables and lists: turns nested items into the rows that
|
|
15
|
+
* are visible (children of collapsed rows are skipped), and expands/collapses
|
|
16
|
+
* them. With the Tree* parts, children grow in and shrink away smoothly.
|
|
17
|
+
*/
|
|
18
|
+
export declare function useTree<T>({ items, getKey, getChildren, defaultExpanded, rowHeight }: UseTreeOptions<T>): {
|
|
19
|
+
rows: TreeRowData<T>[];
|
|
20
|
+
toggle: (key: string) => void;
|
|
21
|
+
isExpanded: (key: string) => boolean;
|
|
22
|
+
expand: (key: string) => void;
|
|
23
|
+
collapse: (key: string) => void;
|
|
24
|
+
/** Opens every row that has children. */
|
|
25
|
+
expandAll: () => void;
|
|
26
|
+
/** Closes every row. */
|
|
27
|
+
collapseAll: () => void;
|
|
28
|
+
rowProps: (row: TreeRowData<T>) => {
|
|
29
|
+
'aria-level': number;
|
|
30
|
+
'aria-expanded': boolean | undefined;
|
|
31
|
+
'data-depth': number;
|
|
32
|
+
className: string;
|
|
33
|
+
style: CSSProperties;
|
|
34
|
+
onAnimationEnd: (e: {
|
|
35
|
+
animationName: string;
|
|
36
|
+
}) => void;
|
|
37
|
+
};
|
|
38
|
+
toggleProps: (row: TreeRowData<T>) => {
|
|
39
|
+
expanded: boolean;
|
|
40
|
+
onToggle: () => void;
|
|
41
|
+
};
|
|
42
|
+
rowHeight: number;
|
|
43
|
+
};
|
|
44
|
+
export type Tree<T> = ReturnType<typeof useTree<T>>;
|
|
45
|
+
/** A table row wired to useTree: tree semantics (aria-level, aria-expanded) and the open/close animation. */
|
|
46
|
+
export declare function TreeRow<T>({ row, tree, className, style, ...rest }: TreeRowProps<T>): import('react').JSX.Element;
|
|
47
|
+
/** A cell in a TreeRow: its content sits in a box whose height animates as groups open and close. */
|
|
48
|
+
export declare function TreeCell({ numeric, className, children, ...rest }: TableCellProps): import('react').JSX.Element;
|
|
49
|
+
/** The first column's content: indented by depth, with the row's toggle (or a spacer, so labels line up). */
|
|
50
|
+
export declare function TreeLabel<T>({ row, tree, indent, children, className }: TreeLabelProps<T>): import('react').JSX.Element;
|
|
51
|
+
/** Chevron button that opens and closes a row: points right when closed, down when open. */
|
|
52
|
+
export declare function TreeToggle({ expanded, onToggle, className, ...rest }: TreeToggleProps): import('react').JSX.Element;
|
|
53
|
+
export interface UseTreeOptions<T> {
|
|
54
|
+
items: readonly T[];
|
|
55
|
+
getKey: (item: T) => string;
|
|
56
|
+
/** Children of an item (undefined or empty for a leaf). */
|
|
57
|
+
getChildren: (item: T) => readonly T[] | undefined;
|
|
58
|
+
/** Whether rows start open. */
|
|
59
|
+
defaultExpanded?: boolean;
|
|
60
|
+
/** Row height in px, for the open/close animation. */
|
|
61
|
+
rowHeight?: number;
|
|
62
|
+
}
|
|
63
|
+
export interface TreeRowProps<T> extends ComponentProps<'tr'> {
|
|
64
|
+
row: TreeRowData<T>;
|
|
65
|
+
tree: Tree<T>;
|
|
66
|
+
}
|
|
67
|
+
export interface TreeLabelProps<T> {
|
|
68
|
+
row: TreeRowData<T>;
|
|
69
|
+
tree: Tree<T>;
|
|
70
|
+
/** Indent per level, in px. */
|
|
71
|
+
indent?: number;
|
|
72
|
+
children?: ReactNode;
|
|
73
|
+
className?: string;
|
|
74
|
+
}
|
|
75
|
+
export interface TreeToggleProps extends Omit<ComponentProps<'button'>, 'onToggle'> {
|
|
76
|
+
expanded: boolean;
|
|
77
|
+
onToggle: () => void;
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/tree/index.tsx"],"names":[],"mappings":"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"}
|
package/dist/utils/cx.d.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Joins class names (strings, arrays, { name: condition } objects), skipping
|
|
3
|
+
* falsy ones. Conflicting Tailwind classes resolve to the last one, so a
|
|
4
|
+
* className passed in overrides a component's defaults (see mergeClasses).
|
|
5
|
+
*/
|
|
1
6
|
export declare const cx: (...args: ClassValue[]) => string;
|
|
2
7
|
export type ClassValue = ClassArray | ClassDictionary | string | number | null | boolean | undefined;
|
|
3
8
|
export type ClassDictionary = Record<string, unknown>;
|
package/dist/utils/cx.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cx.d.ts","sourceRoot":"","sources":["../../packages/utils/cx.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cx.d.ts","sourceRoot":"","sources":["../../packages/utils/cx.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,EAAE,GAAI,GAAG,MAAM,UAAU,EAAE,KAAG,MAAkC,CAAC;AAsB9E,MAAM,MAAM,UAAU,GAAG,UAAU,GAAG,eAAe,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,OAAO,GAAG,SAAS,CAAC;AACrG,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACtD,MAAM,MAAM,UAAU,GAAG,UAAU,EAAE,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Chevron for popup fields (select, month picker): turns over while the popup is open. */
|
|
2
|
+
export declare function FieldChevron({ open, className }: {
|
|
3
|
+
open?: boolean;
|
|
4
|
+
className?: string;
|
|
5
|
+
}): import('react').JSX.Element;
|
|
6
|
+
//# sourceMappingURL=field-chevron.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field-chevron.d.ts","sourceRoot":"","sources":["../../packages/utils/field-chevron.tsx"],"names":[],"mappings":"AAEA,2FAA2F;AAC3F,wBAAgB,YAAY,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,+BAmBvF"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Graphics mode: with hardware acceleration off, the browser draws on the CPU,
|
|
3
|
+
* where live blurs, full-screen masks and constant animation turn every frame
|
|
4
|
+
* into a stall. Zen then switches to "lite": solid tints instead of blur, a
|
|
5
|
+
* still backdrop, no pointer light (see the html[data-zen-graphics='lite'] rules
|
|
6
|
+
* in index.css). Set data-zen-graphics on <html> yourself to force a mode.
|
|
7
|
+
*/
|
|
8
|
+
export type GraphicsMode = 'full' | 'lite';
|
|
9
|
+
/** Whether the GPU is doing the drawing, checked once (a throwaway WebGL context). */
|
|
10
|
+
export declare function detectGraphicsMode(): GraphicsMode;
|
|
11
|
+
/**
|
|
12
|
+
* Marks <html> with the graphics mode, unless the app already set one. Called by
|
|
13
|
+
* the components with costly effects; cheap after the first call.
|
|
14
|
+
*/
|
|
15
|
+
export declare function applyGraphicsMode(): GraphicsMode;
|
|
16
|
+
/** For tests: forget the cached detection. */
|
|
17
|
+
export declare function resetGraphicsMode(): void;
|
|
18
|
+
/** Applies the graphics mode after mount (in components whose effects are costly without a GPU). */
|
|
19
|
+
export declare function useGraphicsMode(): void;
|
|
20
|
+
//# sourceMappingURL=graphics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graphics.d.ts","sourceRoot":"","sources":["../../packages/utils/graphics.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,MAAM,CAAC;AAS3C,sFAAsF;AACtF,wBAAgB,kBAAkB,IAAI,YAAY,CAuBjD;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,YAAY,CAQhD;AAED,8CAA8C;AAC9C,wBAAgB,iBAAiB,SAEhC;AAED,oGAAoG;AACpG,wBAAgB,eAAe,SAI9B"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolves Tailwind class conflicts: when two classes set the same property
|
|
3
|
+
* (under the same variants), the later one wins and the earlier one is
|
|
4
|
+
* dropped, so `cx('w-full px-3', className)` with className "w-40 p-1" gives
|
|
5
|
+
* "w-40 p-1". A class that covers several others (p over px, rounded over
|
|
6
|
+
* rounded-t, border over border-t) removes them when it comes later.
|
|
7
|
+
*
|
|
8
|
+
* It knows the core utilities, not every one: classes it doesn't recognise
|
|
9
|
+
* (your own, plugins, zen__ hooks) are always kept, in order.
|
|
10
|
+
*/
|
|
11
|
+
export declare function mergeClasses(classes: string): string;
|
|
12
|
+
//# sourceMappingURL=merge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merge.d.ts","sourceRoot":"","sources":["../../packages/utils/merge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CA0BpD"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Money as an integer number of minor units (paise, cents). Never do arithmetic
|
|
3
|
+
* on floats; only formatting converts to a decimal for display.
|
|
4
|
+
*/
|
|
5
|
+
export type Money = number;
|
|
6
|
+
/** Decimal places the currency uses: 2 for USD and INR, 0 for JPY. */
|
|
7
|
+
export declare function minorDigits(currency: string): number;
|
|
8
|
+
/** With symbol: en-IN gives lakh/crore grouping (₹1,52,000.00); en-US gives $152,000.00. */
|
|
9
|
+
export declare function formatMoney(amount: Money, currency: string, locale: string, { showDecimals }?: {
|
|
10
|
+
showDecimals?: boolean;
|
|
11
|
+
}): string;
|
|
12
|
+
/** Number without symbol, e.g. "1,52,000" or "32,740.50". Decimals only when non-zero. */
|
|
13
|
+
export declare function formatAmount(amount: Money, currency: string, locale: string): string;
|
|
14
|
+
/** The currency's symbol in a locale: "₹", "$", "US$", "€". */
|
|
15
|
+
export declare function currencySymbol(currency: string, locale: string): string;
|
|
16
|
+
export declare class MoneyParseError extends Error {
|
|
17
|
+
constructor(input: string);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Parses user input to minor units using string arithmetic (no float rounding).
|
|
21
|
+
* Accepts grouping separators (commas, spaces, underscores), a leading sign or
|
|
22
|
+
* currency symbol, and at most the currency's number of decimals.
|
|
23
|
+
*/
|
|
24
|
+
export declare function parseMoney(input: string, currency: string): Money;
|
|
25
|
+
/**
|
|
26
|
+
* Like parseMoney, plus shorthand: "1.5L" (lakh), "2cr" (crore), "10k",
|
|
27
|
+
* "1.2m". Scaling is done by shifting the decimal string, so it stays exact.
|
|
28
|
+
*/
|
|
29
|
+
export declare function parseMoneyInput(input: string, currency: string): Money;
|
|
30
|
+
//# sourceMappingURL=money.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"money.d.ts","sourceRoot":"","sources":["../../packages/utils/money.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,KAAK,GAAG,MAAM,CAAC;AAE3B,sEAAsE;AACtE,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED,4FAA4F;AAC5F,wBAAgB,WAAW,CACvB,MAAM,EAAE,KAAK,EACb,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,EAAE,YAAmB,EAAE,GAAE;IAAE,YAAY,CAAC,EAAE,OAAO,CAAA;CAAO,GACzD,MAAM,CAQR;AAED,0FAA0F;AAC1F,wBAAgB,YAAY,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAOpF;AAED,+DAA+D;AAC/D,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAMvE;AAED,qBAAa,eAAgB,SAAQ,KAAK;gBAC1B,KAAK,EAAE,MAAM;CAI5B;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,KAAK,CAajE;AAiBD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,KAAK,CAiBtE"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** Calendar month as "YYYY-MM". Compares correctly as a string. */
|
|
2
|
+
export type Month = string;
|
|
3
|
+
export declare function isMonth(value: unknown): value is Month;
|
|
4
|
+
/** Months since year 0; lets month arithmetic be plain integer maths. */
|
|
5
|
+
export declare function monthIndex(month: Month): number;
|
|
6
|
+
export declare function fromMonthIndex(index: number): Month;
|
|
7
|
+
export declare function addMonths(month: Month, n: number): Month;
|
|
8
|
+
/** Every month from `from` to `to`, inclusive. Empty if `to` is before `from`. */
|
|
9
|
+
export declare function monthRange(from: Month, to: Month): Month[];
|
|
10
|
+
export declare function monthsBetween(from: Month, to: Month): number;
|
|
11
|
+
export declare function currentMonth(now?: Date): Month;
|
|
12
|
+
/** "Sep 2026" (or the locale's equivalent); "September 2026" with style "long". */
|
|
13
|
+
export declare function formatMonth(month: Month, locale: string, style?: 'short' | 'long'): string;
|
|
14
|
+
/** Short month names for a locale, January first. */
|
|
15
|
+
export declare function monthNames(locale: string): string[];
|
|
16
|
+
//# sourceMappingURL=month.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"month.d.ts","sourceRoot":"","sources":["../../packages/utils/month.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,MAAM,MAAM,KAAK,GAAG,MAAM,CAAC;AAI3B,wBAAgB,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,KAAK,CAEtD;AAED,yEAAyE;AACzE,wBAAgB,UAAU,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAI/C;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,CAGnD;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,GAAG,KAAK,CAExD;AAED,kFAAkF;AAClF,wBAAgB,UAAU,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,GAAG,KAAK,EAAE,CAI1D;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,KAAK,GAAG,MAAM,CAE5D;AAED,wBAAgB,YAAY,CAAC,GAAG,GAAE,IAAiB,GAAG,KAAK,CAE1D;AAED,mFAAmF;AACnF,wBAAgB,WAAW,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,GAAE,OAAO,GAAG,MAAgB,GAAG,MAAM,CAKnG;AAED,qDAAqD;AACrD,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAGnD"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Small 16px status icons in the current text colour (toasts, field errors). */
|
|
2
|
+
export declare function CheckIcon({ className }: {
|
|
3
|
+
className?: string;
|
|
4
|
+
}): import('react').JSX.Element;
|
|
5
|
+
export declare function AlertIcon({ className }: {
|
|
6
|
+
className?: string;
|
|
7
|
+
}): import('react').JSX.Element;
|
|
8
|
+
export declare function InfoIcon({ className }: {
|
|
9
|
+
className?: string;
|
|
10
|
+
}): import('react').JSX.Element;
|
|
11
|
+
//# sourceMappingURL=status-icons.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status-icons.d.ts","sourceRoot":"","sources":["../../packages/utils/status-icons.tsx"],"names":[],"mappings":"AAEA,iFAAiF;AACjF,wBAAgB,SAAS,CAAC,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,+BAe9D;AAED,wBAAgB,SAAS,CAAC,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,+BAgB9D;AAED,wBAAgB,QAAQ,CAAC,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,+BAe7D"}
|
package/dist/utils/styles.d.ts
CHANGED
|
@@ -12,4 +12,10 @@ export declare const PILL_TRACK = "relative flex w-fit items-center gap-1 rounde
|
|
|
12
12
|
export declare const PILL_INDICATOR = "absolute top-1 bottom-1 left-0 rounded-full bg-primary/15 shadow-[inset_0_0_0_1px_oklch(var(--glow)/0.35),0_0_24px_-4px_oklch(var(--glow)/0.6)] transition-[translate,width] duration-500 ease-[cubic-bezier(0.2,0.8,0.2,1)]";
|
|
13
13
|
/** …and items that sit above it. */
|
|
14
14
|
export declare const PILL_ITEM = "relative z-10 rounded-full px-3.5 py-1.5 text-sm whitespace-nowrap outline-hidden transition-colors duration-300 select-none focus-visible:ring-2 focus-visible:ring-ring/40";
|
|
15
|
+
/**
|
|
16
|
+
* For a wrapper whose child input takes focus (InputGroup): FIELD, lit by
|
|
17
|
+
* focus-within. Written out in full rather than derived from FIELD, because
|
|
18
|
+
* Tailwind only generates classes that appear literally in the source.
|
|
19
|
+
*/
|
|
20
|
+
export declare const FIELD_WITHIN: string;
|
|
15
21
|
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../packages/utils/styles.ts"],"names":[],"mappings":"AAEA,6EAA6E;AAC7E,eAAO,MAAM,KAAK,QAKmC,CAAC;AAEtD,sDAAsD;AACtD,eAAO,MAAM,YAAY,mGAC2E,CAAC;AAErG,0EAA0E;AAC1E,eAAO,MAAM,OAAO,QAAgF,CAAC;AAErG,oEAAoE;AACpE,eAAO,MAAM,KAAK,kIACiH,CAAC;AAEpI,2EAA2E;AAC3E,eAAO,MAAM,UAAU,gGAAgG,CAAC;AAExH,sDAAsD;AACtD,eAAO,MAAM,cAAc,iOACuM,CAAC;AAEnO,oCAAoC;AACpC,eAAO,MAAM,SAAS,iLAC4J,CAAC"}
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../packages/utils/styles.ts"],"names":[],"mappings":"AAEA,6EAA6E;AAC7E,eAAO,MAAM,KAAK,QAKmC,CAAC;AAEtD,sDAAsD;AACtD,eAAO,MAAM,YAAY,mGAC2E,CAAC;AAErG,0EAA0E;AAC1E,eAAO,MAAM,OAAO,QAAgF,CAAC;AAErG,oEAAoE;AACpE,eAAO,MAAM,KAAK,kIACiH,CAAC;AAEpI,2EAA2E;AAC3E,eAAO,MAAM,UAAU,gGAAgG,CAAC;AAExH,sDAAsD;AACtD,eAAO,MAAM,cAAc,iOACuM,CAAC;AAEnO,oCAAoC;AACpC,eAAO,MAAM,SAAS,iLAC4J,CAAC;AAEnL;;;;GAIG;AACH,eAAO,MAAM,YAAY,QAK4B,CAAC"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Theme generation: a few inputs → every colour token, in OKLCH. Lightness is
|
|
3
|
+
* fixed per UI role and the inputs only move hue and chroma, so contrast holds
|
|
4
|
+
* for any colour (the tests sweep every hue and check WCAG). Roles run from the
|
|
5
|
+
* app background through surfaces and borders to solid colour and text. Colour
|
|
6
|
+
* is used sparingly: neutrals carry the UI, the accent marks what matters.
|
|
7
|
+
*/
|
|
8
|
+
export declare const INTENSITIES: readonly ["mono", "muted", "balanced", "vivid"];
|
|
9
|
+
export type Intensity = (typeof INTENSITIES)[number];
|
|
10
|
+
export type Appearance = 'dark' | 'light';
|
|
11
|
+
export interface ThemeSettings {
|
|
12
|
+
preset: PresetId | 'custom';
|
|
13
|
+
/** OKLCH hue angle, 0–359. */
|
|
14
|
+
hue: number;
|
|
15
|
+
intensity: Intensity;
|
|
16
|
+
/** Neutral greys, or greys faintly tinted with the accent hue. */
|
|
17
|
+
tint: 'neutral' | 'tinted';
|
|
18
|
+
contrast: 'standard' | 'high';
|
|
19
|
+
glow: 'off' | 'soft' | 'bright';
|
|
20
|
+
/** Strength of the Backdrop's pattern (contours or dots). */
|
|
21
|
+
topography: 'off' | 'subtle' | 'visible';
|
|
22
|
+
}
|
|
23
|
+
export declare const PRESETS: readonly [{
|
|
24
|
+
readonly id: "violet";
|
|
25
|
+
readonly label: "Violet";
|
|
26
|
+
readonly hue: 295;
|
|
27
|
+
readonly intensity: "balanced";
|
|
28
|
+
readonly tint: "tinted";
|
|
29
|
+
}, {
|
|
30
|
+
readonly id: "ocean";
|
|
31
|
+
readonly label: "Ocean";
|
|
32
|
+
readonly hue: 250;
|
|
33
|
+
readonly intensity: "balanced";
|
|
34
|
+
readonly tint: "tinted";
|
|
35
|
+
}, {
|
|
36
|
+
readonly id: "teal";
|
|
37
|
+
readonly label: "Teal";
|
|
38
|
+
readonly hue: 195;
|
|
39
|
+
readonly intensity: "balanced";
|
|
40
|
+
readonly tint: "tinted";
|
|
41
|
+
}, {
|
|
42
|
+
readonly id: "forest";
|
|
43
|
+
readonly label: "Forest";
|
|
44
|
+
readonly hue: 150;
|
|
45
|
+
readonly intensity: "muted";
|
|
46
|
+
readonly tint: "tinted";
|
|
47
|
+
}, {
|
|
48
|
+
readonly id: "amber";
|
|
49
|
+
readonly label: "Amber";
|
|
50
|
+
readonly hue: 75;
|
|
51
|
+
readonly intensity: "balanced";
|
|
52
|
+
readonly tint: "neutral";
|
|
53
|
+
}, {
|
|
54
|
+
readonly id: "rose";
|
|
55
|
+
readonly label: "Rose";
|
|
56
|
+
readonly hue: 15;
|
|
57
|
+
readonly intensity: "muted";
|
|
58
|
+
readonly tint: "neutral";
|
|
59
|
+
}, {
|
|
60
|
+
readonly id: "graphite";
|
|
61
|
+
readonly label: "Graphite";
|
|
62
|
+
readonly hue: 270;
|
|
63
|
+
readonly intensity: "mono";
|
|
64
|
+
readonly tint: "neutral";
|
|
65
|
+
}];
|
|
66
|
+
export type PresetId = (typeof PRESETS)[number]['id'];
|
|
67
|
+
/** Zen's default: violet, balanced, tinted greys, soft glow. */
|
|
68
|
+
export declare const DEFAULT_THEME: ThemeSettings;
|
|
69
|
+
/** A preset's colour inputs, keeping the other settings. */
|
|
70
|
+
export declare function applyPreset(theme: ThemeSettings, id: PresetId): ThemeSettings;
|
|
71
|
+
/** Any edit to the colour inputs makes it a custom theme. */
|
|
72
|
+
export declare function customize(theme: ThemeSettings, patch: Partial<Pick<ThemeSettings, 'hue' | 'intensity' | 'tint'>>): ThemeSettings;
|
|
73
|
+
/** The CSS custom properties (without the leading --) for a theme, dark or light. */
|
|
74
|
+
export declare function themeVars(theme: ThemeSettings, appearance?: Appearance): Record<string, string>;
|
|
75
|
+
/**
|
|
76
|
+
* Applies a theme's tokens to an element (default <html>) as inline custom
|
|
77
|
+
* properties, overriding the stylesheet's defaults below it. Pass the
|
|
78
|
+
* appearance that element shows (dark unless it or an ancestor is .light).
|
|
79
|
+
*/
|
|
80
|
+
export declare function applyTheme(theme: ThemeSettings, { appearance, target }?: {
|
|
81
|
+
appearance?: Appearance;
|
|
82
|
+
target?: HTMLElement;
|
|
83
|
+
}): void;
|
|
84
|
+
/** Removes an applied theme, back to the stylesheet's defaults. */
|
|
85
|
+
export declare function resetTheme(target?: HTMLElement): void;
|
|
86
|
+
/** Coerces stored (possibly older or edited) data into a valid theme. */
|
|
87
|
+
export declare function normalizeTheme(raw: unknown): ThemeSettings;
|
|
88
|
+
/** OKLCH triplet → linear sRGB (clamped to gamut). */
|
|
89
|
+
export declare function oklchToLinearRgb(triplet: string): [number, number, number];
|
|
90
|
+
/** WCAG 2 contrast ratio between two OKLCH triplets. */
|
|
91
|
+
export declare function contrastRatio(a: string, b: string): number;
|
|
92
|
+
//# sourceMappingURL=theme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../packages/utils/theme.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,eAAO,MAAM,WAAW,iDAAkD,CAAC;AAC3E,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AACrD,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,OAAO,CAAC;AAE1C,MAAM,WAAW,aAAa;IAC1B,MAAM,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC5B,8BAA8B;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,SAAS,CAAC;IACrB,kEAAkE;IAClE,IAAI,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC3B,QAAQ,EAAE,UAAU,GAAG,MAAM,CAAC;IAC9B,IAAI,EAAE,KAAK,GAAG,MAAM,GAAG,QAAQ,CAAC;IAChC,6DAA6D;IAC7D,UAAU,EAAE,KAAK,GAAG,QAAQ,GAAG,SAAS,CAAC;CAC5C;AAED,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAcjB,CAAC;AACJ,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC;AAEtD,gEAAgE;AAChE,eAAO,MAAM,aAAa,EAAE,aAQ3B,CAAC;AAEF,4DAA4D;AAC5D,wBAAgB,WAAW,CAAC,KAAK,EAAE,aAAa,EAAE,EAAE,EAAE,QAAQ,GAAG,aAAa,CAG7E;AAED,6DAA6D;AAC7D,wBAAgB,SAAS,CACrB,KAAK,EAAE,aAAa,EACpB,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,KAAK,GAAG,WAAW,GAAG,MAAM,CAAC,CAAC,GAClE,aAAa,CAEf;AAQD,qFAAqF;AACrF,wBAAgB,SAAS,CAAC,KAAK,EAAE,aAAa,EAAE,UAAU,GAAE,UAAmB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAmEvG;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CACtB,KAAK,EAAE,aAAa,EACpB,EAAE,UAAmB,EAAE,MAAM,EAAE,GAAE;IAAE,UAAU,CAAC,EAAE,UAAU,CAAC;IAAC,MAAM,CAAC,EAAE,WAAW,CAAA;CAAO,GACxF,IAAI,CAGN;AAED,mEAAmE;AACnE,wBAAgB,UAAU,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,IAAI,CAGrD;AAED,yEAAyE;AACzE,wBAAgB,cAAc,CAAC,GAAG,EAAE,OAAO,GAAG,aAAa,CAkB1D;AAID,sDAAsD;AACtD,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAa1E;AAED,wDAAwD;AACxD,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAO1D"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* A popup anchored to a trigger, on the native Popover API: opens below the
|
|
4
|
+
* trigger (flipping above if there's no room), closes on outside click and
|
|
5
|
+
* Escape, and returns focus to the trigger. Spread `triggerProps` on the
|
|
6
|
+
* trigger button and `popupProps` on the popup element.
|
|
7
|
+
*/
|
|
8
|
+
export declare function useAnchoredPopup<T extends HTMLElement = HTMLDivElement>({ align, offset, matchWidth, onOpenChange, }?: AnchoredPopupOptions): {
|
|
9
|
+
id: string;
|
|
10
|
+
open: boolean;
|
|
11
|
+
setOpen: (next: boolean) => void;
|
|
12
|
+
triggerProps: {
|
|
13
|
+
popoverTarget: string;
|
|
14
|
+
'aria-expanded': boolean;
|
|
15
|
+
'aria-controls': string;
|
|
16
|
+
'data-popup-open': true | undefined;
|
|
17
|
+
style: CSSProperties;
|
|
18
|
+
};
|
|
19
|
+
popupProps: {
|
|
20
|
+
ref: import('react').RefObject<T | null>;
|
|
21
|
+
id: string;
|
|
22
|
+
popover: "auto";
|
|
23
|
+
style: CSSProperties;
|
|
24
|
+
};
|
|
25
|
+
popupRef: import('react').RefObject<T | null>;
|
|
26
|
+
};
|
|
27
|
+
export interface AnchoredPopupOptions {
|
|
28
|
+
/** Line the popup up with the trigger's start (default) or end edge. */
|
|
29
|
+
align?: 'start' | 'end';
|
|
30
|
+
/** Gap below the trigger, in px. */
|
|
31
|
+
offset?: number;
|
|
32
|
+
/** At least as wide as the trigger (e.g. a select's list). */
|
|
33
|
+
matchWidth?: boolean;
|
|
34
|
+
onOpenChange?: (open: boolean) => void;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=useAnchoredPopup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAnchoredPopup.d.ts","sourceRoot":"","sources":["../../packages/utils/useAnchoredPopup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAmD,MAAM,OAAO,CAAC;AAEvF;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,WAAW,GAAG,cAAc,EAAE,EACrE,KAAe,EACf,MAAU,EACV,UAAkB,EAClB,YAAY,GACf,GAAE,oBAAyB;;;oBAgBb,OAAO;;;;;;eA4BsB,aAAa;;;;;;eAe5C,aAAa;;;EAIzB;AAED,MAAM,WAAW,oBAAoB;IACjC,wEAAwE;IACxE,KAAK,CAAC,EAAE,OAAO,GAAG,KAAK,CAAC;IACxB,oCAAoC;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,8DAA8D;IAC9D,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CAC1C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useHydrated.d.ts","sourceRoot":"","sources":["../../packages/utils/useHydrated.ts"],"names":[],"mappings":"AAIA,mGAAmG;AACnG,wBAAgB,WAAW,IAAI,OAAO,CAMrC"}
|
|
@@ -13,6 +13,10 @@ export interface VirtualItem {
|
|
|
13
13
|
export declare function useVirtualList({ count, itemHeight, scrollRef, overscan }: VirtualListOptions): {
|
|
14
14
|
items: VirtualItem[];
|
|
15
15
|
totalSize: number;
|
|
16
|
+
/** Space above the rendered rows (for a table: a TableSpacerRow of this height). */
|
|
17
|
+
paddingTop: number;
|
|
18
|
+
/** Space below the rendered rows. */
|
|
19
|
+
paddingBottom: number;
|
|
16
20
|
};
|
|
17
21
|
export interface VirtualListOptions {
|
|
18
22
|
count: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useVirtualList.d.ts","sourceRoot":"","sources":["../../packages/utils/useVirtualList.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAA6B,MAAM,OAAO,CAAC;AAE7D,MAAM,WAAW,WAAW;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,8CAA8C;IAC9C,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,QAAY,EAAE,EAAE,kBAAkB;;;
|
|
1
|
+
{"version":3,"file":"useVirtualList.d.ts","sourceRoot":"","sources":["../../packages/utils/useVirtualList.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAA6B,MAAM,OAAO,CAAC;AAE7D,MAAM,WAAW,WAAW;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,8CAA8C;IAC9C,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,QAAY,EAAE,EAAE,kBAAkB;;;IAyCzF,oFAAoF;;IAEpF,qCAAqC;;EAG5C;AAED,MAAM,WAAW,kBAAkB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,kCAAkC;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,gCAAgC;IAChC,SAAS,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IACzC,iGAAiG;IACjG,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Colour tokens are OKLCH "L C H" triplets, used as oklch(var(--x)) or
|
|
3
|
+
* oklch(var(--x) / alpha). Lightness is fixed per role, so contrast holds
|
|
4
|
+
* whatever hue a theme picks; only hue and chroma carry the brand.
|
|
5
|
+
*
|
|
6
|
+
* Dark glass is the default. Add `light` (or data-theme="light") to an
|
|
7
|
+
* element for the light palette, and `dark` to switch back inside it.
|
|
8
|
+
*/
|
|
9
|
+
:root,
|
|
10
|
+
:is(.dark, [data-theme='dark']) {
|
|
11
|
+
color-scheme: dark;
|
|
12
|
+
--radius: 0.625rem;
|
|
13
|
+
|
|
14
|
+
--background: 0.155 0.014 295;
|
|
15
|
+
--foreground: 0.97 0.004 295;
|
|
16
|
+
--card: 0.195 0.014 295;
|
|
17
|
+
--card-foreground: 0.97 0.004 295;
|
|
18
|
+
--popover: 0.21 0.014 295;
|
|
19
|
+
--popover-foreground: 0.97 0.004 295;
|
|
20
|
+
|
|
21
|
+
--primary: 0.72 0.13 295; /* violet */
|
|
22
|
+
--primary-foreground: 0.17 0.03 295;
|
|
23
|
+
--secondary: 0.25 0.014 295;
|
|
24
|
+
--secondary-foreground: 0.97 0.004 295;
|
|
25
|
+
--muted: 0.235 0.014 295;
|
|
26
|
+
--muted-foreground: 0.72 0.021 295;
|
|
27
|
+
--accent: 0.3 0.046 295;
|
|
28
|
+
--accent-foreground: 0.88 0.065 295;
|
|
29
|
+
--destructive: 0.64 0.2 25;
|
|
30
|
+
--destructive-foreground: 0.985 0 0;
|
|
31
|
+
|
|
32
|
+
--border: 0.28 0.021 295;
|
|
33
|
+
--input: 0.28 0.021 295;
|
|
34
|
+
--ring: 0.72 0.13 295;
|
|
35
|
+
|
|
36
|
+
/* Light that surfaces pick up: focus halos, primary buttons, lit edges. */
|
|
37
|
+
--glow: 0.7 0.13 295;
|
|
38
|
+
--glow-2: 0.72 0.098 325; /* analogous, a little further round the wheel */
|
|
39
|
+
--glow-strength: 0.55; /* 0 turns every glow off */
|
|
40
|
+
|
|
41
|
+
/*
|
|
42
|
+
* Ink for translucent overlays (hairlines, glass fills, hover tints), used as
|
|
43
|
+
* oklch(var(--tint) / alpha): white on dark, deep violet-grey on light.
|
|
44
|
+
*/
|
|
45
|
+
--tint: 1 0 0;
|
|
46
|
+
--glass-shadow: 0 10px 40px -12px hsl(0 0% 0% / 0.6);
|
|
47
|
+
--popup-shadow: 0 20px 60px -20px hsl(0 0% 0% / 0.8);
|
|
48
|
+
--toast-shadow: 0 18px 50px -20px oklch(0 0 0 / 0.8);
|
|
49
|
+
--backdrop-scrim: oklch(0 0 0 / 0.5);
|
|
50
|
+
--topo-strength: 0.55;
|
|
51
|
+
--mx: -9999px; /* pointer position, set by <Backdrop> */
|
|
52
|
+
--my: -9999px;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
:is(.light, [data-theme='light']) {
|
|
56
|
+
color-scheme: light;
|
|
57
|
+
|
|
58
|
+
--background: 0.985 0.006 295;
|
|
59
|
+
--foreground: 0.21 0.02 295;
|
|
60
|
+
--card: 1 0 0;
|
|
61
|
+
--card-foreground: 0.21 0.02 295;
|
|
62
|
+
--popover: 1 0 0;
|
|
63
|
+
--popover-foreground: 0.21 0.02 295;
|
|
64
|
+
|
|
65
|
+
--primary: 0.48 0.195 295;
|
|
66
|
+
--primary-foreground: 0.985 0 0;
|
|
67
|
+
--secondary: 0.955 0.008 295;
|
|
68
|
+
--secondary-foreground: 0.21 0.02 295;
|
|
69
|
+
--muted: 0.96 0.007 295;
|
|
70
|
+
--muted-foreground: 0.5 0.021 295;
|
|
71
|
+
--accent: 0.95 0.033 295;
|
|
72
|
+
--accent-foreground: 0.42 0.117 295;
|
|
73
|
+
--destructive: 0.55 0.22 25;
|
|
74
|
+
--destructive-foreground: 0.985 0 0;
|
|
75
|
+
|
|
76
|
+
--border: 0.91 0.011 295;
|
|
77
|
+
--input: 0.91 0.011 295;
|
|
78
|
+
--ring: 0.48 0.195 295;
|
|
79
|
+
|
|
80
|
+
--glow: 0.62 0.182 295;
|
|
81
|
+
--glow-2: 0.65 0.137 325;
|
|
82
|
+
--glow-strength: 0.4;
|
|
83
|
+
|
|
84
|
+
--tint: 0.21 0.02 295;
|
|
85
|
+
--glass-shadow: 0 10px 30px -14px oklch(0.3 0.05 295 / 0.25);
|
|
86
|
+
--popup-shadow: 0 20px 50px -20px oklch(0.3 0.05 295 / 0.35);
|
|
87
|
+
--toast-shadow: 0 18px 50px -20px oklch(0.3 0.05 295 / 0.35);
|
|
88
|
+
--backdrop-scrim: oklch(0.21 0.02 295 / 0.3);
|
|
89
|
+
--topo-strength: 0.55;
|
|
90
|
+
}
|