@jgb-solutions/kit 0.2.3 → 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/CHANGELOG.md +10 -0
- package/README.md +163 -2
- package/dist/admin/blocks/ActivityFeed.d.ts +20 -0
- package/dist/admin/blocks/BarChart.d.ts +26 -0
- package/dist/admin/blocks/ChartPoints.d.ts +24 -0
- package/dist/admin/blocks/DataTable.d.ts +58 -0
- package/dist/admin/blocks/Filters.d.ts +12 -0
- package/dist/admin/blocks/Hero.d.ts +22 -0
- package/dist/admin/blocks/LineChart.d.ts +24 -0
- package/dist/admin/blocks/Pagination.d.ts +30 -0
- package/dist/admin/blocks/Segmented.d.ts +15 -0
- package/dist/admin/blocks/Stat.d.ts +35 -0
- package/dist/admin/blocks/Status.d.ts +22 -0
- package/dist/admin/blocks/Tile.d.ts +20 -0
- package/dist/admin/blocks/sorting.d.ts +29 -0
- package/dist/admin/contrast.d.ts +12 -0
- package/dist/admin/forms/ConfirmDialog.d.ts +25 -0
- package/dist/admin/forms/Field.d.ts +48 -0
- package/dist/admin/forms/People.d.ts +28 -0
- package/dist/admin/forms/Toast.d.ts +17 -0
- package/dist/admin/icons.d.ts +31 -0
- package/dist/admin/index.d.ts +33 -0
- package/dist/admin/shell/AdminShell.d.ts +31 -0
- package/dist/admin/shell/Dock.d.ts +8 -0
- package/dist/admin/shell/PageHeader.d.ts +19 -0
- package/dist/admin/shell/Sidebar.d.ts +27 -0
- package/dist/admin/shell/ThemeToggle.d.ts +10 -0
- package/dist/admin/shell/nav.d.ts +33 -0
- package/dist/admin/styles.css +1677 -0
- package/dist/admin/theme.d.ts +30 -0
- package/dist/admin/ui/Avatar.d.ts +14 -0
- package/dist/admin/ui/Button.d.ts +19 -0
- package/dist/admin.d.ts +2 -0
- package/dist/admin.js +2168 -0
- package/dist/i18n.d.ts +104 -0
- package/dist/i18n.js +218 -0
- package/package.json +40 -7
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export type ThemeChoice = 'light' | 'dark' | 'system';
|
|
2
|
+
export type Theme = 'light' | 'dark';
|
|
3
|
+
type ThemeState = {
|
|
4
|
+
/** What the person chose: light, dark, or follow the system. */
|
|
5
|
+
choice: ThemeChoice;
|
|
6
|
+
/** What is shown now. */
|
|
7
|
+
theme: Theme;
|
|
8
|
+
setChoice: (choice: ThemeChoice) => void;
|
|
9
|
+
};
|
|
10
|
+
/** Reads and writes browser storage, ignoring a blocked or private-mode store. */
|
|
11
|
+
export declare const storage: {
|
|
12
|
+
get(key: string): string | null;
|
|
13
|
+
set(key: string, value: string): void;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* The theme for AdminShell: light, dark or the system's. Controlled when `choice` is given (the app
|
|
17
|
+
* keeps it, e.g. in a cookie so the server renders it); otherwise kept in this browser under
|
|
18
|
+
* `storageKey`. Server rendering uses `defaultChoice` ("system": the CSS follows the system with no
|
|
19
|
+
* script), and the stored choice applies once the page runs.
|
|
20
|
+
*/
|
|
21
|
+
export declare function useThemeState(options: {
|
|
22
|
+
choice?: ThemeChoice | undefined;
|
|
23
|
+
defaultChoice?: ThemeChoice | undefined;
|
|
24
|
+
onChoiceChange?: ((choice: ThemeChoice) => void) | undefined;
|
|
25
|
+
storageKey?: string | undefined;
|
|
26
|
+
}): ThemeState;
|
|
27
|
+
export declare const ThemeProvider: import("react").Provider<ThemeState | null>;
|
|
28
|
+
/** The admin's theme, inside AdminShell. */
|
|
29
|
+
export declare function useAdminTheme(): ThemeState;
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** Up to two initials: "Priya Nair" → "PN", "maya" → "M". */
|
|
2
|
+
export declare function initials(name: string): string;
|
|
3
|
+
/** The same name always gets the same colour pair. */
|
|
4
|
+
export declare function toneOf(name: string): [string, string];
|
|
5
|
+
export type AvatarProps = {
|
|
6
|
+
name: string;
|
|
7
|
+
/** A picture; initials when absent or when it fails to load is up to the app (pass none). */
|
|
8
|
+
src?: string | null | undefined;
|
|
9
|
+
size?: number;
|
|
10
|
+
/** "round" (people) or "soft" (a rounded square, as in tables). */
|
|
11
|
+
shape?: 'round' | 'soft';
|
|
12
|
+
};
|
|
13
|
+
/** A person's picture or initials. Decorative: the name is always written next to it. */
|
|
14
|
+
export declare function Avatar({ name, src, size, shape }: AvatarProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ButtonHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
3
|
+
/** primary (the brand colour, one per page area), quiet (a tile), or danger. */
|
|
4
|
+
variant?: 'primary' | 'quiet' | 'danger';
|
|
5
|
+
size?: 'normal' | 'small';
|
|
6
|
+
icon?: ReactNode;
|
|
7
|
+
};
|
|
8
|
+
/** A button that says what it does ("Invite people", "Suspend Leo Martin"). */
|
|
9
|
+
export declare function Button({ variant, size, icon, className, children, type, ...rest }: ButtonProps): import("react").JSX.Element;
|
|
10
|
+
export type IconButtonProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'> & {
|
|
11
|
+
/** The accessible name: what pressing it does ("Notifications", "Switch to dark mode"). */
|
|
12
|
+
label: string;
|
|
13
|
+
icon: ReactNode;
|
|
14
|
+
/** A small red dot: something new to see. */
|
|
15
|
+
dot?: boolean;
|
|
16
|
+
tone?: 'tile' | 'night';
|
|
17
|
+
};
|
|
18
|
+
/** A round button with only an icon; `label` names it for screen readers and as its tooltip. */
|
|
19
|
+
export declare function IconButton({ label, icon, dot, tone, className, type, ...rest }: IconButtonProps): import("react").JSX.Element;
|
package/dist/admin.d.ts
ADDED