@omkarux/vela 0.2.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 +57 -0
- package/LICENSE +21 -0
- package/README.md +112 -0
- package/dist/components/Button/Button.d.ts +32 -0
- package/dist/components/Button/Button.js +51 -0
- package/dist/components/Button/index.d.ts +2 -0
- package/dist/components/ContextualAlert/ContextualAlert.d.ts +18 -0
- package/dist/components/ContextualAlert/ContextualAlert.js +49 -0
- package/dist/components/ContextualAlert/index.d.ts +2 -0
- package/dist/components/Input/Input.d.ts +12 -0
- package/dist/components/Input/Input.js +31 -0
- package/dist/components/Input/index.d.ts +2 -0
- package/dist/components/StatusIndicator/StatusIndicator.d.ts +14 -0
- package/dist/components/StatusIndicator/StatusIndicator.js +31 -0
- package/dist/components/StatusIndicator/index.d.ts +2 -0
- package/dist/components/Tabs/Tabs.d.ts +44 -0
- package/dist/components/Tabs/Tabs.js +94 -0
- package/dist/components/Tabs/index.d.ts +2 -0
- package/dist/components/Toggle/Toggle.d.ts +23 -0
- package/dist/components/Toggle/Toggle.js +55 -0
- package/dist/components/Toggle/index.d.ts +2 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.js +16 -0
- package/dist/lib/cn.d.ts +5 -0
- package/dist/lib/cn.js +6 -0
- package/dist/lib/icons.d.ts +7 -0
- package/dist/lib/icons.js +32 -0
- package/dist/tokens.css +610 -0
- package/dist/vela.css +897 -0
- package/guidelines/components/button.md +104 -0
- package/guidelines/components/contextual-alert.md +59 -0
- package/guidelines/components/input.md +65 -0
- package/guidelines/components/status-indicator.md +48 -0
- package/guidelines/components/tabs.md +71 -0
- package/guidelines/components/toggle.md +53 -0
- package/guidelines/foundations/color.md +67 -0
- package/guidelines/foundations/radius.md +17 -0
- package/guidelines/foundations/sizing.md +35 -0
- package/guidelines/foundations/spacing.md +28 -0
- package/guidelines/foundations/typography.md +34 -0
- package/guidelines/llms.txt +33 -0
- package/guidelines/overview.md +48 -0
- package/guidelines/setup.md +64 -0
- package/guidelines/tokens.md +69 -0
- package/package.json +84 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { jsxs as I, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import * as o from "react";
|
|
3
|
+
import { cn as N } from "../../lib/cn.js";
|
|
4
|
+
const y = o.forwardRef(
|
|
5
|
+
function({
|
|
6
|
+
checked: s,
|
|
7
|
+
defaultChecked: i = !1,
|
|
8
|
+
onChange: e,
|
|
9
|
+
disabled: l = !1,
|
|
10
|
+
label: f,
|
|
11
|
+
labelPosition: m = "right",
|
|
12
|
+
size: u = "regular",
|
|
13
|
+
id: r,
|
|
14
|
+
name: v,
|
|
15
|
+
className: d
|
|
16
|
+
}, p) {
|
|
17
|
+
const c = s !== void 0, [b, _] = o.useState(i), t = c ? s : b, k = o.useId(), n = `${r ?? k}-label`, g = () => {
|
|
18
|
+
l || (c || _(!t), e == null || e(!t));
|
|
19
|
+
};
|
|
20
|
+
return /* @__PURE__ */ I(
|
|
21
|
+
"span",
|
|
22
|
+
{
|
|
23
|
+
className: N(
|
|
24
|
+
"vela-toggle",
|
|
25
|
+
`vela-toggle--${u}`,
|
|
26
|
+
m === "left" && "vela-toggle--left",
|
|
27
|
+
l && "vela-toggle--disabled",
|
|
28
|
+
d
|
|
29
|
+
),
|
|
30
|
+
children: [
|
|
31
|
+
/* @__PURE__ */ a(
|
|
32
|
+
"button",
|
|
33
|
+
{
|
|
34
|
+
ref: p,
|
|
35
|
+
id: r,
|
|
36
|
+
name: v,
|
|
37
|
+
type: "button",
|
|
38
|
+
role: "switch",
|
|
39
|
+
"aria-checked": t,
|
|
40
|
+
"aria-labelledby": n,
|
|
41
|
+
disabled: l,
|
|
42
|
+
onClick: g,
|
|
43
|
+
className: "vela-toggle__track",
|
|
44
|
+
children: /* @__PURE__ */ a("span", { className: "vela-toggle__knob" })
|
|
45
|
+
}
|
|
46
|
+
),
|
|
47
|
+
/* @__PURE__ */ a("span", { id: n, className: "vela-toggle__label", onClick: g, children: f })
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
export {
|
|
54
|
+
y as Toggle
|
|
55
|
+
};
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @omkarux/vela — public API.
|
|
3
|
+
*
|
|
4
|
+
* Everything exported here is a promise: renaming or removing any of it is a
|
|
5
|
+
* MAJOR version. Anything not exported here is internal and free to change.
|
|
6
|
+
*
|
|
7
|
+
* Styles are NOT imported by this file. Consumers import them explicitly:
|
|
8
|
+
* import '@omkarux/vela/styles.css'
|
|
9
|
+
* That keeps the JS bundle free of CSS side effects and leaves SSR and
|
|
10
|
+
* style ordering under the consuming app's control.
|
|
11
|
+
*/
|
|
12
|
+
export { Button } from './components/Button';
|
|
13
|
+
export type { ButtonProps, ButtonVariant, ButtonSize, SolidButtonProps, TextLinkButtonProps, } from './components/Button';
|
|
14
|
+
export { Toggle } from './components/Toggle';
|
|
15
|
+
export type { ToggleProps } from './components/Toggle';
|
|
16
|
+
export { Input } from './components/Input';
|
|
17
|
+
export type { InputProps } from './components/Input';
|
|
18
|
+
export { ContextualAlert } from './components/ContextualAlert';
|
|
19
|
+
export type { ContextualAlertProps, Severity } from './components/ContextualAlert';
|
|
20
|
+
export { StatusIndicator } from './components/StatusIndicator';
|
|
21
|
+
export type { StatusIndicatorProps, Status } from './components/StatusIndicator';
|
|
22
|
+
export { Tabs } from './components/Tabs';
|
|
23
|
+
export type { TabsProps, TabListProps, TabTriggerProps, TabPanelProps } from './components/Tabs';
|
|
24
|
+
export { cn } from './lib/cn';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { cn as t } from "./lib/cn.js";
|
|
2
|
+
import { Button as p } from "./components/Button/Button.js";
|
|
3
|
+
import { ContextualAlert as f } from "./components/ContextualAlert/ContextualAlert.js";
|
|
4
|
+
import { Input as n } from "./components/Input/Input.js";
|
|
5
|
+
import { StatusIndicator as u } from "./components/StatusIndicator/StatusIndicator.js";
|
|
6
|
+
import { Tabs as c } from "./components/Tabs/Tabs.js";
|
|
7
|
+
import { Toggle as s } from "./components/Toggle/Toggle.js";
|
|
8
|
+
export {
|
|
9
|
+
p as Button,
|
|
10
|
+
f as ContextualAlert,
|
|
11
|
+
n as Input,
|
|
12
|
+
u as StatusIndicator,
|
|
13
|
+
c as Tabs,
|
|
14
|
+
s as Toggle,
|
|
15
|
+
t as cn
|
|
16
|
+
};
|
package/dist/lib/cn.d.ts
ADDED
package/dist/lib/cn.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export declare const CheckCircleIcon: (p: React.SVGProps<SVGSVGElement>) => React.JSX.Element;
|
|
3
|
+
export declare const InfoCircleIcon: (p: React.SVGProps<SVGSVGElement>) => React.JSX.Element;
|
|
4
|
+
export declare const WarningTriangleIcon: (p: React.SVGProps<SVGSVGElement>) => React.JSX.Element;
|
|
5
|
+
export declare const CriticalOctagonIcon: (p: React.SVGProps<SVGSVGElement>) => React.JSX.Element;
|
|
6
|
+
export declare const CloseIcon: (p: React.SVGProps<SVGSVGElement>) => React.JSX.Element;
|
|
7
|
+
export declare const PlusIcon: (p: React.SVGProps<SVGSVGElement>) => React.JSX.Element;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsxs as n, jsx as c } from "react/jsx-runtime";
|
|
2
|
+
const o = {
|
|
3
|
+
viewBox: "0 0 16 16",
|
|
4
|
+
fill: "none",
|
|
5
|
+
stroke: "currentColor",
|
|
6
|
+
strokeWidth: 1.5,
|
|
7
|
+
strokeLinecap: "round",
|
|
8
|
+
strokeLinejoin: "round",
|
|
9
|
+
"aria-hidden": !0
|
|
10
|
+
}, l = (r) => /* @__PURE__ */ n("svg", { ...o, ...r, children: [
|
|
11
|
+
/* @__PURE__ */ c("circle", { cx: "8", cy: "8", r: "6.25" }),
|
|
12
|
+
/* @__PURE__ */ c("path", { d: "M5.5 8.2 7.2 9.9l3.3-3.6" })
|
|
13
|
+
] }), t = (r) => /* @__PURE__ */ n("svg", { ...o, ...r, children: [
|
|
14
|
+
/* @__PURE__ */ c("circle", { cx: "8", cy: "8", r: "6.25" }),
|
|
15
|
+
/* @__PURE__ */ c("path", { d: "M8 7.4v3.4" }),
|
|
16
|
+
/* @__PURE__ */ c("circle", { cx: "8", cy: "5.2", r: ".85", fill: "currentColor", stroke: "none" })
|
|
17
|
+
] }), i = (r) => /* @__PURE__ */ n("svg", { ...o, ...r, children: [
|
|
18
|
+
/* @__PURE__ */ c("path", { d: "M8 2.2 14.4 13.3H1.6z" }),
|
|
19
|
+
/* @__PURE__ */ c("path", { d: "M8 6.4v3.1" }),
|
|
20
|
+
/* @__PURE__ */ c("circle", { cx: "8", cy: "11.4", r: ".8", fill: "currentColor", stroke: "none" })
|
|
21
|
+
] }), s = (r) => /* @__PURE__ */ n("svg", { ...o, ...r, children: [
|
|
22
|
+
/* @__PURE__ */ c("path", { d: "M5.3 1.8h5.4l3.5 3.5v5.4l-3.5 3.5H5.3l-3.5-3.5V5.3z" }),
|
|
23
|
+
/* @__PURE__ */ c("path", { d: "M8 4.9v3.4" }),
|
|
24
|
+
/* @__PURE__ */ c("circle", { cx: "8", cy: "10.9", r: ".8", fill: "currentColor", stroke: "none" })
|
|
25
|
+
] }), d = (r) => /* @__PURE__ */ c("svg", { ...o, ...r, children: /* @__PURE__ */ c("path", { d: "M4 4l8 8M12 4l-8 8" }) });
|
|
26
|
+
export {
|
|
27
|
+
l as CheckCircleIcon,
|
|
28
|
+
d as CloseIcon,
|
|
29
|
+
s as CriticalOctagonIcon,
|
|
30
|
+
t as InfoCircleIcon,
|
|
31
|
+
i as WarningTriangleIcon
|
|
32
|
+
};
|