@alea-design/ui 0.0.0-stage → 0.1.1
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/LICENSE +21 -0
- package/README.md +17 -2
- package/dist/components/accordion/Accordion.d.ts +29 -0
- package/dist/components/ai/AI.d.ts +157 -0
- package/dist/components/app/AppParts.d.ts +105 -0
- package/dist/components/button/Button.d.ts +95 -0
- package/dist/components/button/Groups.d.ts +91 -0
- package/dist/components/card/Card.d.ts +61 -0
- package/dist/components/chat/Chat.d.ts +191 -0
- package/dist/components/choice/Choice.d.ts +87 -0
- package/dist/components/color/Color.d.ts +77 -0
- package/dist/components/combobox/Autocomplete.d.ts +76 -0
- package/dist/components/combobox/ComboBox.d.ts +81 -0
- package/dist/components/combobox/Highlight.d.ts +27 -0
- package/dist/components/command/CommandPalette.d.ts +35 -0
- package/dist/components/content/Content.d.ts +120 -0
- package/dist/components/data/Data.d.ts +85 -0
- package/dist/components/date/Date.d.ts +48 -0
- package/dist/components/display/Display.d.ts +114 -0
- package/dist/components/display/Display2.d.ts +54 -0
- package/dist/components/emoji/EmojiPicker.d.ts +16 -0
- package/dist/components/emoji/emoji-data.d.ts +12 -0
- package/dist/components/extras/CodeSteps.d.ts +24 -0
- package/dist/components/extras/Extras.d.ts +84 -0
- package/dist/components/feedback/Feedback.d.ts +136 -0
- package/dist/components/feedback/Spinner.d.ts +12 -0
- package/dist/components/feedback/Status.d.ts +45 -0
- package/dist/components/field/Field.d.ts +130 -0
- package/dist/components/field/FieldLoading.d.ts +7 -0
- package/dist/components/filter/FilterBar.d.ts +48 -0
- package/dist/components/form/Form.d.ts +32 -0
- package/dist/components/icon/Icon.d.ts +47 -0
- package/dist/components/icon/icon-cells.d.ts +23 -0
- package/dist/components/icon/icon-contexts.d.ts +19 -0
- package/dist/components/icon/icon-names.d.ts +8 -0
- package/dist/components/layout/Bento.d.ts +42 -0
- package/dist/components/layout/Layout.d.ts +76 -0
- package/dist/components/layout/Layout2.d.ts +120 -0
- package/dist/components/layout/Layout3.d.ts +65 -0
- package/dist/components/layout/Responsive.d.ts +21 -0
- package/dist/components/list/List.d.ts +41 -0
- package/dist/components/list/Lists2.d.ts +79 -0
- package/dist/components/media/Media.d.ts +133 -0
- package/dist/components/menu/Menu.d.ts +87 -0
- package/dist/components/more/More.d.ts +176 -0
- package/dist/components/navigation/Navbar.d.ts +23 -0
- package/dist/components/navigation/Navigation.d.ts +88 -0
- package/dist/components/navigation/Navigation2.d.ts +152 -0
- package/dist/components/overlay/Drawer.d.ts +40 -0
- package/dist/components/overlay/Modal.d.ts +41 -0
- package/dist/components/overlay/Overlay.d.ts +95 -0
- package/dist/components/overlay/Sheet.d.ts +55 -0
- package/dist/components/page/Page.d.ts +91 -0
- package/dist/components/page/PageParts.d.ts +94 -0
- package/dist/components/picker/Picker.d.ts +136 -0
- package/dist/components/picker/Wheel.d.ts +63 -0
- package/dist/components/rating/Rating.d.ts +35 -0
- package/dist/components/select/Select.d.ts +116 -0
- package/dist/components/shell/AppShell.d.ts +52 -0
- package/dist/components/shell/AppSidebar.d.ts +55 -0
- package/dist/components/slider/Slider.d.ts +27 -0
- package/dist/components/table/Table.d.ts +45 -0
- package/dist/components/tabs/Tabs.d.ts +59 -0
- package/dist/components/theme/Theme.d.ts +94 -0
- package/dist/components/theme/lens.d.ts +18 -0
- package/dist/components/tree/Tree.d.ts +125 -0
- package/dist/components/typography/Typography.d.ts +59 -0
- package/dist/components/upload/Upload.d.ts +63 -0
- package/dist/components/work/Ops.d.ts +29 -0
- package/dist/components/work/Work.d.ts +216 -0
- package/dist/i18n/strings.d.ts +429 -0
- package/dist/index.d.ts +72 -0
- package/dist/index.js +7439 -0
- package/dist/styles.css +1 -0
- package/dist/utils/Blueprint.d.ts +12 -0
- package/dist/utils/DotField.d.ts +6 -0
- package/dist/utils/attr.d.ts +2 -0
- package/dist/utils/blueprintScene.d.ts +81 -0
- package/dist/utils/controlled.d.ts +2 -0
- package/dist/utils/cx.d.ts +2 -0
- package/dist/utils/inert.d.ts +2 -0
- package/dist/utils/responsive.d.ts +9 -0
- package/dist/utils/scrollEdges.d.ts +9 -0
- package/dist/utils/space.d.ts +2 -0
- package/package.json +68 -4
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
export interface SkeletonBlueprintProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'children'> {
|
|
3
|
+
shape: 'text' | 'rect' | 'circle';
|
|
4
|
+
width?: number | string;
|
|
5
|
+
height?: number | string;
|
|
6
|
+
rows?: number;
|
|
7
|
+
isLoaded?: boolean;
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
/** The blueprint skeleton: the real content is laid out but hidden; its shapes are measured and drawn, dot by dot, as dotted outlines over a faint grid that sparks;
|
|
11
|
+
* it stays alive while it loads, and when isLoaded turns true the content is revealed by a soft edge that sweeps down the block. */
|
|
12
|
+
export declare function SkeletonBlueprint({ shape, width, height, rows, isLoaded, children, className, style, 'aria-label': label, ...rest }: SkeletonBlueprintProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** The field of twinkling dots behind a loading state (Skeleton matrix, Image generating): a grid that fills its box edge to edge, each dot with its own speed and phase.
|
|
2
|
+
* It measures the box once per size change to know how many dots fit (at most 600: the pitch grows when the box is huge). Decorative: hidden from screen readers. Styled by feedback.css. */
|
|
3
|
+
export declare function DotField({ rows, cols }: {
|
|
4
|
+
rows?: number;
|
|
5
|
+
cols?: number;
|
|
6
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/** Sets an attribute React Aria does not pass through (aria-busy, aria-keyshortcuts) on the element a ref points at, or on the control `pick` finds inside it. It is a callback ref because collections (Menu, Tree) mount their items in two passes, so the element can arrive after the first effect. A value of undefined removes the attribute. */
|
|
2
|
+
export declare function useAttrRef<T extends HTMLElement>(name: string, value: string | undefined, pick?: (root: T) => HTMLElement | null): (node: T | null) => void;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
export type Shape = {
|
|
2
|
+
k: 'box';
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
w: number;
|
|
6
|
+
h: number;
|
|
7
|
+
r: number;
|
|
8
|
+
label?: string;
|
|
9
|
+
} | {
|
|
10
|
+
k: 'ring';
|
|
11
|
+
x: number;
|
|
12
|
+
y: number;
|
|
13
|
+
w: number;
|
|
14
|
+
h: number;
|
|
15
|
+
label?: string;
|
|
16
|
+
} | {
|
|
17
|
+
k: 'line';
|
|
18
|
+
x: number;
|
|
19
|
+
y: number;
|
|
20
|
+
w: number;
|
|
21
|
+
} | {
|
|
22
|
+
k: 'mark';
|
|
23
|
+
x: number;
|
|
24
|
+
y: number;
|
|
25
|
+
w: number;
|
|
26
|
+
h: number;
|
|
27
|
+
label?: string;
|
|
28
|
+
};
|
|
29
|
+
export interface Style {
|
|
30
|
+
color: string;
|
|
31
|
+
font: string;
|
|
32
|
+
gap: number;
|
|
33
|
+
pitch: number;
|
|
34
|
+
stroke: number;
|
|
35
|
+
}
|
|
36
|
+
interface Item {
|
|
37
|
+
pts: Float32Array;
|
|
38
|
+
n: number;
|
|
39
|
+
start: number;
|
|
40
|
+
dur: number;
|
|
41
|
+
handles: Array<[number, number, number]>;
|
|
42
|
+
label?: {
|
|
43
|
+
text: string;
|
|
44
|
+
w: number;
|
|
45
|
+
h: number;
|
|
46
|
+
x: number;
|
|
47
|
+
y: number;
|
|
48
|
+
};
|
|
49
|
+
pen: {
|
|
50
|
+
period: number;
|
|
51
|
+
off: number;
|
|
52
|
+
} | null;
|
|
53
|
+
popAt?: number;
|
|
54
|
+
}
|
|
55
|
+
export interface Scene {
|
|
56
|
+
items: Item[];
|
|
57
|
+
w: number;
|
|
58
|
+
h: number;
|
|
59
|
+
sparks: Array<{
|
|
60
|
+
x: number;
|
|
61
|
+
y: number;
|
|
62
|
+
period: number;
|
|
63
|
+
off: number;
|
|
64
|
+
r: number;
|
|
65
|
+
}>;
|
|
66
|
+
end: number;
|
|
67
|
+
frame: Item;
|
|
68
|
+
}
|
|
69
|
+
export declare function buildScene(shapes: Shape[], w: number, h: number, st: Style): Scene;
|
|
70
|
+
export interface Paint {
|
|
71
|
+
ctx: CanvasRenderingContext2D;
|
|
72
|
+
pad: number;
|
|
73
|
+
st: Style;
|
|
74
|
+
t: number;
|
|
75
|
+
elapsed: number;
|
|
76
|
+
still: boolean;
|
|
77
|
+
seed: number;
|
|
78
|
+
}
|
|
79
|
+
/** One frame. `t` is the scene time in seconds (already scaled by the speed). `still` paints the finished blueprint with nothing moving. */
|
|
80
|
+
export declare function paint(sc: Scene, p: Paint): void;
|
|
81
|
+
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/** Props that set the DOM `inert` attribute in React 18 and 19. React 19 maps the boolean to the attribute; React 18 does not know the prop, so it gets the attribute as an empty string (present = inert). Spread the result on an element: `<div {...inertProps(busy)}>`. It is typed loosely on purpose, so it compiles with the React 18 types, which have no `inert`. */
|
|
2
|
+
export declare function inertProps(on: boolean | undefined): Record<string, unknown>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Breakpoints (min-width): sm 640, md 768, lg 1024, xl 1280, as --alea-breakpoint-*. */
|
|
2
|
+
export type Breakpoint = 'base' | 'sm' | 'md' | 'lg' | 'xl';
|
|
3
|
+
/** A value, or one per breakpoint: { base: 1, md: 2, lg: 4 }. Unset breakpoints use the one below. */
|
|
4
|
+
export type Responsive<T> = T | Partial<Record<Breakpoint, T>>;
|
|
5
|
+
/** Data attributes for a responsive prop: data-{name} for the base value and data-{name}-{bp} for each breakpoint that changes it.
|
|
6
|
+
* The component CSS repeats its rules inside min-width media queries for those attributes. */
|
|
7
|
+
export declare function responsiveAttrs<T extends string | boolean>(name: string, value: Responsive<T> | undefined, fallback?: T): Record<string, string | undefined>;
|
|
8
|
+
/** The base value of a responsive prop. */
|
|
9
|
+
export declare const baseOf: <T>(value: Responsive<T> | undefined, fallback: T) => T;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type RefObject } from 'react';
|
|
2
|
+
/** Whether a horizontal scroller (found inside box by selector) has hidden content at its start and end, and a function to page it. */
|
|
3
|
+
export declare function useScrollEdges(box: RefObject<HTMLElement | null>, selector: string, enabled?: boolean): {
|
|
4
|
+
edges: {
|
|
5
|
+
start: boolean;
|
|
6
|
+
end: boolean;
|
|
7
|
+
};
|
|
8
|
+
scroll: (dir: 1 | -1) => void;
|
|
9
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,70 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alea-design/ui",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Alea: the complete React design system. Accessible components from forms to AI, charts and editors, Alea Motion, and W3C design tokens for dark, light and high contrast.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"react",
|
|
7
|
+
"react components",
|
|
8
|
+
"ui",
|
|
9
|
+
"design system",
|
|
10
|
+
"component library",
|
|
11
|
+
"react aria",
|
|
12
|
+
"accessibility",
|
|
13
|
+
"a11y",
|
|
14
|
+
"design tokens",
|
|
15
|
+
"dark mode",
|
|
16
|
+
"motion",
|
|
17
|
+
"animation",
|
|
18
|
+
"figma"
|
|
19
|
+
],
|
|
20
|
+
"homepage": "https://alea.alevasquez.dev",
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "https://github.com/alevascha/alea-design.git",
|
|
24
|
+
"directory": "packages/react"
|
|
25
|
+
},
|
|
26
|
+
"bugs": {
|
|
27
|
+
"url": "https://github.com/alevascha/alea-design/issues"
|
|
28
|
+
},
|
|
29
|
+
"author": "Alejandro Vasquez (https://alevasquez.dev)",
|
|
30
|
+
"license": "MIT",
|
|
31
|
+
"type": "module",
|
|
32
|
+
"main": "dist/index.js",
|
|
33
|
+
"types": "dist/index.d.ts",
|
|
34
|
+
"exports": {
|
|
35
|
+
".": {
|
|
36
|
+
"types": "./dist/index.d.ts",
|
|
37
|
+
"default": "./dist/index.js"
|
|
38
|
+
},
|
|
39
|
+
"./styles.css": "./dist/styles.css"
|
|
40
|
+
},
|
|
41
|
+
"sideEffects": [
|
|
42
|
+
"*.css"
|
|
43
|
+
],
|
|
44
|
+
"files": [
|
|
45
|
+
"dist",
|
|
46
|
+
"!dist/**/*.map",
|
|
47
|
+
"LICENSE",
|
|
48
|
+
"README.md"
|
|
49
|
+
],
|
|
50
|
+
"publishConfig": {
|
|
51
|
+
"access": "public"
|
|
52
|
+
},
|
|
53
|
+
"scripts": {
|
|
54
|
+
"build": "vite build && tsc -p tsconfig.build.json",
|
|
55
|
+
"test": "vitest run",
|
|
56
|
+
"typecheck": "tsc --noEmit"
|
|
57
|
+
},
|
|
58
|
+
"peerDependencies": {
|
|
59
|
+
"react": ">=18.3",
|
|
60
|
+
"react-dom": ">=18.3"
|
|
61
|
+
},
|
|
62
|
+
"dependencies": {
|
|
63
|
+
"@alea-design/motion": "0.1.0",
|
|
64
|
+
"@alea-design/tokens": "0.1.0",
|
|
65
|
+
"@internationalized/date": "^3.8.0",
|
|
66
|
+
"lucide-react": "^0.525.0",
|
|
67
|
+
"qrcode-generator": "^1.5.2",
|
|
68
|
+
"react-aria-components": "^1.22.1"
|
|
69
|
+
}
|
|
70
|
+
}
|