@trainvent/arcubic 0.3.2 → 0.4.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/dist/core/design.d.ts +63 -0
- package/dist/index.js +26 -4
- package/package.json +1 -1
- /package/dist/{CodeBlock.d.ts → components/CodeBlock.d.ts} +0 -0
- /package/dist/{DirectionSwitch.d.ts → components/DirectionSwitch.d.ts} +0 -0
- /package/dist/{LoadingButton.d.ts → components/LoadingButton.d.ts} +0 -0
- /package/dist/{NativeSelect.d.ts → components/NativeSelect.d.ts} +0 -0
- /package/dist/{Spinner.d.ts → components/Spinner.d.ts} +0 -0
- /package/dist/{index.d.ts → components/index.d.ts} +0 -0
- /package/dist/{portals.d.ts → components/portals.d.ts} +0 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/** Platform-independent Arcubic defaults. Adapters map these roles to their UI. */
|
|
2
|
+
export declare const typography: {
|
|
3
|
+
interface: string;
|
|
4
|
+
reading: string;
|
|
5
|
+
code: string;
|
|
6
|
+
caption: number;
|
|
7
|
+
ui: number;
|
|
8
|
+
body: number;
|
|
9
|
+
noteHeading: number;
|
|
10
|
+
uiLineHeight: number;
|
|
11
|
+
bodyLineHeight: number;
|
|
12
|
+
};
|
|
13
|
+
export declare const geometry: {
|
|
14
|
+
radius: number;
|
|
15
|
+
border: number;
|
|
16
|
+
switchHeight: number;
|
|
17
|
+
switchWidthRatio: number;
|
|
18
|
+
switchRimRatio: number;
|
|
19
|
+
switchThumbRatio: number;
|
|
20
|
+
switchInsetRatio: number;
|
|
21
|
+
switchTravelRatio: number;
|
|
22
|
+
switchTriangleWidthRatio: number;
|
|
23
|
+
switchTriangleHeightRatio: number;
|
|
24
|
+
switchSlantRatio: number;
|
|
25
|
+
};
|
|
26
|
+
export declare function designTokens(): Record<string, string>;
|
|
27
|
+
/** Raised and sunken edges of controls such as the switch. Gray values are steps of the neutral
|
|
28
|
+
* scale; accent values are steps of the control's accent family. Mirrors `.arcubic-ui` in
|
|
29
|
+
* src/components/base.css. */
|
|
30
|
+
export declare const bevel: {
|
|
31
|
+
readonly dark: {
|
|
32
|
+
readonly high: {
|
|
33
|
+
readonly gray: 7;
|
|
34
|
+
};
|
|
35
|
+
readonly low: {
|
|
36
|
+
readonly gray: 1;
|
|
37
|
+
};
|
|
38
|
+
readonly face: {
|
|
39
|
+
readonly gray: 4;
|
|
40
|
+
};
|
|
41
|
+
readonly accentHigh: 11;
|
|
42
|
+
readonly accentLow: 7;
|
|
43
|
+
};
|
|
44
|
+
readonly light: {
|
|
45
|
+
readonly high: "#fff";
|
|
46
|
+
readonly low: {
|
|
47
|
+
readonly gray: 8;
|
|
48
|
+
};
|
|
49
|
+
readonly face: {
|
|
50
|
+
readonly gray: 3;
|
|
51
|
+
};
|
|
52
|
+
readonly accentHigh: 6;
|
|
53
|
+
readonly accentLow: 10;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
/** Triangle portion of the Le Logo continuous fuse route (no enclosing circle), traced by every
|
|
57
|
+
* Arcubic loader. The fuse is a dash of `fuseDash` out of a path length of 100. */
|
|
58
|
+
export declare const loader: {
|
|
59
|
+
readonly viewBox: "20 -40 860 760";
|
|
60
|
+
readonly route: "M450 9.45 L548.3474 179.7927 L831.5275 670.275 L634.8327 670.275 L68.4725 670.275 L166.8199 499.9323 L514.1917 626.3653 L634.8327 670.275 L570.641 306.2257 L548.3474 179.7927 L265.1673 417.409 L343.9101 388.749 L570.641 306.2257 L556.0899 388.749 L514.1917 626.3653 L450 572.502 L556.0899 388.749 L343.9101 388.749 L450 572.502 L265.1673 417.409 L166.8199 499.9323 L450 9.45";
|
|
61
|
+
readonly fuseDash: 26;
|
|
62
|
+
readonly durationSeconds: 1.8;
|
|
63
|
+
};
|
package/dist/index.js
CHANGED
|
@@ -72,14 +72,36 @@ function CodeBlock({ code, language = "text", filename, lineNumbers = true }) {
|
|
|
72
72
|
// src/components/Spinner.tsx
|
|
73
73
|
import { forwardRef as forwardRef3 } from "react";
|
|
74
74
|
import { Box } from "@radix-ui/themes";
|
|
75
|
+
|
|
76
|
+
// src/core/design.ts
|
|
77
|
+
var geometry = {
|
|
78
|
+
radius: 0,
|
|
79
|
+
border: 1,
|
|
80
|
+
switchHeight: 22,
|
|
81
|
+
switchWidthRatio: 42 / 22,
|
|
82
|
+
switchRimRatio: 2 / 22,
|
|
83
|
+
switchThumbRatio: 18 / 22,
|
|
84
|
+
switchInsetRatio: 4 / 22,
|
|
85
|
+
switchTravelRatio: 16 / 22,
|
|
86
|
+
switchTriangleWidthRatio: 16 / 22,
|
|
87
|
+
switchTriangleHeightRatio: 16 / 22 * Math.sqrt(3) / 2,
|
|
88
|
+
switchSlantRatio: Math.tan(Math.PI / 6)
|
|
89
|
+
};
|
|
90
|
+
var loader = {
|
|
91
|
+
viewBox: "20 -40 860 760",
|
|
92
|
+
route: "M450 9.45 L548.3474 179.7927 L831.5275 670.275 L634.8327 670.275 L68.4725 670.275 L166.8199 499.9323 L514.1917 626.3653 L634.8327 670.275 L570.641 306.2257 L548.3474 179.7927 L265.1673 417.409 L343.9101 388.749 L570.641 306.2257 L556.0899 388.749 L514.1917 626.3653 L450 572.502 L556.0899 388.749 L343.9101 388.749 L450 572.502 L265.1673 417.409 L166.8199 499.9323 L450 9.45",
|
|
93
|
+
fuseDash: 26,
|
|
94
|
+
durationSeconds: 1.8
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
// src/components/Spinner.tsx
|
|
75
98
|
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
76
|
-
var route = "M450 9.45 L548.3474 179.7927 L831.5275 670.275 L634.8327 670.275 L68.4725 670.275 L166.8199 499.9323 L514.1917 626.3653 L634.8327 670.275 L570.641 306.2257 L548.3474 179.7927 L265.1673 417.409 L343.9101 388.749 L570.641 306.2257 L556.0899 388.749 L514.1917 626.3653 L450 572.502 L556.0899 388.749 L343.9101 388.749 L450 572.502 L265.1673 417.409 L166.8199 499.9323 L450 9.45";
|
|
77
99
|
var Spinner = forwardRef3(({ loading = true, size = "2", children, className, style, "aria-label": label = "Loading", ...props }, ref) => {
|
|
78
100
|
if (!loading) return children;
|
|
79
101
|
const sizes = typeof size === "string" ? `arc-spinner-size-${size}` : Object.entries(size).map(([breakpoint, value]) => `arc-spinner-${breakpoint}-${value}`).join(" ");
|
|
80
|
-
const indicator = /* @__PURE__ */ jsx4(Box, { ...props, asChild: true, children: /* @__PURE__ */ jsx4("span", { ref, className: `arc-triangle-spinner ${sizes} ${className || ""}`, style, role: props["aria-hidden"] ? void 0 : "status", "aria-label": props["aria-hidden"] ? void 0 : label, children: /* @__PURE__ */ jsxs3("svg", { viewBox:
|
|
81
|
-
/* @__PURE__ */ jsx4("path", { className: "arc-spinner-guide", d: route }),
|
|
82
|
-
/* @__PURE__ */ jsx4("path", { className: "arc-spinner-fuse", d: route, pathLength: "100" })
|
|
102
|
+
const indicator = /* @__PURE__ */ jsx4(Box, { ...props, asChild: true, children: /* @__PURE__ */ jsx4("span", { ref, className: `arc-triangle-spinner ${sizes} ${className || ""}`, style, role: props["aria-hidden"] ? void 0 : "status", "aria-label": props["aria-hidden"] ? void 0 : label, children: /* @__PURE__ */ jsxs3("svg", { viewBox: loader.viewBox, "aria-hidden": "true", fill: "none", children: [
|
|
103
|
+
/* @__PURE__ */ jsx4("path", { className: "arc-spinner-guide", d: loader.route }),
|
|
104
|
+
/* @__PURE__ */ jsx4("path", { className: "arc-spinner-fuse", d: loader.route, pathLength: "100" })
|
|
83
105
|
] }) }) });
|
|
84
106
|
return children === void 0 ? indicator : /* @__PURE__ */ jsxs3("span", { className: "arc-spinner-wrap", children: [
|
|
85
107
|
/* @__PURE__ */ jsx4("span", { "aria-hidden": "true", style: { visibility: "hidden" }, children }),
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|