@jackcrane/ui 0.1.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.
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Button component.
3
+ *
4
+ * @param {Object} props
5
+ * @param {React.ReactNode} props.children - Content rendered inside the button.
6
+ * @param {string} props.variant - Visual style variant key used to resolve CSS module classes.
7
+ * @param {boolean} props.chamfer - Whether to apply a chamfer effect to the button.
8
+ * @param {string} props.size - Size of the button. Either large or small. Defaults to medium.
9
+ * @param {boolean} props.disabled - Whether the button is disabled.
10
+ * @returns {JSX.Element}
11
+ */
12
+ export default function Button({ children, variant, chamfer, size, disabled, loading, ...props }: {
13
+ children: React.ReactNode;
14
+ variant: string;
15
+ chamfer: boolean;
16
+ size: string;
17
+ disabled: boolean;
18
+ }): JSX.Element;
19
+ export function ColorSwitcher(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ export default function Card({ children, variant, chamfer, size, footerHeight, ...props }: {
2
+ [x: string]: any;
3
+ children: any;
4
+ variant: any;
5
+ chamfer?: boolean;
6
+ size: any;
7
+ footerHeight?: number;
8
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ export default function Checkbox({ children, label, variant, chamfer, size, disabled, className, ...props }: {
2
+ [x: string]: any;
3
+ children: any;
4
+ label: any;
5
+ variant: any;
6
+ chamfer?: boolean;
7
+ size: any;
8
+ disabled: any;
9
+ className: any;
10
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,47 @@
1
+ /**
2
+ * @typedef DropdownItem
3
+ * @type {object}
4
+ * @property {string} [key]
5
+ * @property {import("react").ReactNode} label
6
+ * @property {string} [value]
7
+ * @property {boolean} [disabled]
8
+ * @property {import("react").ReactNode} [icon]
9
+ * @property {() => void} [onSelect]
10
+ * @property {"item" | "separator"} [type]
11
+ */
12
+ /**
13
+ * Dropdown menu that matches the rest of the JC/UI kit treatment.
14
+ *
15
+ * @param {Object} props
16
+ * @param {DropdownItem[]} [props.items]
17
+ * @param {import("react").ReactNode} [props.trigger]
18
+ * @param {import("react").ReactNode} [props.triggerLabel]
19
+ * @param {string} [props.variant]
20
+ * @param {string} [props.size]
21
+ * @param {boolean} [props.chamfer]
22
+ * @param {boolean} [props.disabled]
23
+ * @param {string} [props.align]
24
+ * @param {string} [props.side]
25
+ * @param {(value: string | undefined, item: DropdownItem) => void} [props.onItemSelect]
26
+ */
27
+ export default function Dropdown({ items, trigger, triggerLabel, variant, size, chamfer, disabled, align, side, onItemSelect, showArrow, triggerProps, contentProps, loading, triggerClassName: _triggerClassName, ...props }: {
28
+ items?: DropdownItem[];
29
+ trigger?: import("react").ReactNode;
30
+ triggerLabel?: import("react").ReactNode;
31
+ variant?: string;
32
+ size?: string;
33
+ chamfer?: boolean;
34
+ disabled?: boolean;
35
+ align?: string;
36
+ side?: string;
37
+ onItemSelect?: (value: string | undefined, item: DropdownItem) => void;
38
+ }): import("react/jsx-runtime").JSX.Element;
39
+ export type DropdownItem = {
40
+ key?: string;
41
+ label: import("react").ReactNode;
42
+ value?: string;
43
+ disabled?: boolean;
44
+ icon?: import("react").ReactNode;
45
+ onSelect?: () => void;
46
+ type?: "item" | "separator";
47
+ };
@@ -0,0 +1,7 @@
1
+ export default function Input({ variant, chamfer, size, disabled, ...props }: {
2
+ [x: string]: any;
3
+ variant: any;
4
+ chamfer?: boolean;
5
+ size: any;
6
+ disabled: any;
7
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ export function Layout({ children }: {
2
+ children: any;
3
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export function Loader(props: any): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,15 @@
1
+ export function Radio({ value, label, variant, chamfer, size, disabled, className, ...props }: {
2
+ [x: string]: any;
3
+ value: any;
4
+ label: any;
5
+ variant: any;
6
+ chamfer?: boolean;
7
+ size: any;
8
+ disabled: any;
9
+ className: any;
10
+ }): import("react/jsx-runtime").JSX.Element;
11
+ export function RadioGroup({ className, children, ...props }: {
12
+ [x: string]: any;
13
+ className: any;
14
+ children: any;
15
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Select component.
3
+ *
4
+ * @param {Object} props
5
+ * @param {Array<{ value: string, label: string, disabled?: boolean }>} props.options
6
+ * @param {string} props.value
7
+ * @param {(value: string) => void} props.onValueChange
8
+ * @param {string} props.variant
9
+ * @param {string} props.size
10
+ * @param {boolean} props.disabled
11
+ */
12
+ export default function SelectInput({ options, value, onValueChange, variant, size, disabled, chamfer, loading, }: {
13
+ options: Array<{
14
+ value: string;
15
+ label: string;
16
+ disabled?: boolean;
17
+ }>;
18
+ value: string;
19
+ onValueChange: (value: string) => void;
20
+ variant: string;
21
+ size: string;
22
+ disabled: boolean;
23
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,13 @@
1
+ export function toast(content: any, options?: {}): string;
2
+ export namespace toast {
3
+ function primary(content: any, options?: {}): string;
4
+ function secondary(content: any, options?: {}): string;
5
+ function success(content: any, options?: {}): string;
6
+ function warning(content: any, options?: {}): string;
7
+ function danger(content: any, options?: {}): string;
8
+ function info(content: any, options?: {}): string;
9
+ function loading(content: any, options?: {}): string;
10
+ let dismiss: (toastId?: string, toasterId?: string) => void;
11
+ function removeAll(): void;
12
+ function promise(promise: any, messages: any, options?: {}): Promise<any>;
13
+ }
@@ -0,0 +1,14 @@
1
+ export function BarChart({ data, width, height, marginLeft, x, y, colorOptions, hatchRotate, extraMarks, plotOptions, className, style, }: {
2
+ data: any;
3
+ width?: number;
4
+ height?: number;
5
+ marginLeft?: number;
6
+ x?: {};
7
+ y?: {};
8
+ colorOptions: any;
9
+ hatchRotate?: number;
10
+ extraMarks?: any[];
11
+ plotOptions?: {};
12
+ className: any;
13
+ style: any;
14
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,13 @@
1
+ export const DEFAULT_COLOR_DOMAIN: string[];
2
+ export const DEFAULT_COLOR_RANGE: string[];
3
+ export function buildColorConfig({ domain, range, legend, }?: {
4
+ domain?: string[];
5
+ range?: string[];
6
+ legend?: boolean;
7
+ }): {
8
+ domain: string[];
9
+ range: string[];
10
+ legend: boolean;
11
+ };
12
+ export function createHatchDefs(domain: any, range: any, rotate?: number): () => any;
13
+ export function withHatchFill(valueFn: any): (datum: any) => string;
@@ -0,0 +1,3 @@
1
+ export { BarChart } from "./bar";
2
+ export { LineChart } from "./line";
3
+ export { RadarChart } from "./radar";
@@ -0,0 +1,16 @@
1
+ export function LineChart({ data, width, height, marginBottom, x, y, curve, pointRadius, colorOptions, hatchRotate, extraMarks, plotOptions, className, style, }: {
2
+ data: any;
3
+ width?: number;
4
+ height?: number;
5
+ marginBottom?: number;
6
+ x?: {};
7
+ y?: {};
8
+ curve?: string;
9
+ pointRadius?: number;
10
+ colorOptions: any;
11
+ hatchRotate?: number;
12
+ extraMarks?: any[];
13
+ plotOptions?: {};
14
+ className: any;
15
+ style: any;
16
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ export function ObservablePlot({ options, className, style }: {
2
+ options: any;
3
+ className: any;
4
+ style: any;
5
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,12 @@
1
+ export function RadarChart({ data, width, height, colorOptions, hatchRotate, extraMarks, plotOptions, projectionOptions, className, style, }: {
2
+ data: any;
3
+ width?: number;
4
+ height?: number;
5
+ colorOptions: any;
6
+ hatchRotate?: number;
7
+ extraMarks?: any[];
8
+ plotOptions?: {};
9
+ projectionOptions?: {};
10
+ className: any;
11
+ style: any;
12
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ export function JCUIProvider({ children, theme: initialTheme, className, ...props }: {
2
+ [x: string]: any;
3
+ children: any;
4
+ theme?: string;
5
+ className: any;
6
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ export const DEFAULT_THEME: "light";
2
+ export const ThemeContext: import("react").Context<{
3
+ theme: string;
4
+ setTheme: () => void;
5
+ }>;
6
+ export function useJCUITheme(): {
7
+ theme: string;
8
+ setTheme: () => void;
9
+ };
@@ -0,0 +1,10 @@
1
+ export function useModal({ title, content, footer }: {
2
+ title?: React.ReactNode;
3
+ content: React.ReactNode;
4
+ }): {
5
+ Modal: () => import("react/jsx-runtime").JSX.Element;
6
+ trigger: (node: any) => import("react/jsx-runtime").JSX.Element;
7
+ open: boolean;
8
+ setOpen: React.Dispatch<React.SetStateAction<boolean>>;
9
+ };
10
+ import * as React from "react";
@@ -0,0 +1,14 @@
1
+ export { default as Button, ColorSwitcher } from "./components/Button/button";
2
+ export { default as Card } from "./components/Card/card";
3
+ export { default as Checkbox } from "./components/Checkbox/checkbox";
4
+ export { BarChart, LineChart, RadarChart } from "./components/charts";
5
+ export { default as Input } from "./components/Input/Input";
6
+ export { Loader } from "./components/Loader/loader";
7
+ export { Radio, RadioGroup } from "./components/Radio/radio";
8
+ export { default as Select } from "./components/Select/select";
9
+ export { default as Dropdown } from "./components/Dropdown/dropdown";
10
+ export { toast } from "./components/Toast/toast";
11
+ export { useModal } from "./components/modal/useModal";
12
+ export { JCUIProvider } from "./components/jcui/provider";
13
+ export { useJCUITheme } from "./components/jcui/theme-context";
14
+ export { Layout } from "./components/Layout/layout";