@oddmash/ui 0.0.0-stage → 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/LICENSE +21 -0
- package/README.md +32 -2
- package/dist/accordion.d.ts +12 -0
- package/dist/accordion.js +8 -0
- package/dist/alert.d.ts +12 -0
- package/dist/alert.js +8 -0
- package/dist/avatar.d.ts +14 -0
- package/dist/avatar.js +8 -0
- package/dist/badge.d.ts +12 -0
- package/dist/badge.js +8 -0
- package/dist/breadcrumbs.d.ts +8 -0
- package/dist/breadcrumbs.js +8 -0
- package/dist/button.d.ts +14 -0
- package/dist/button.js +8 -0
- package/dist/card.d.ts +8 -0
- package/dist/card.js +8 -0
- package/dist/checkbox.d.ts +8 -0
- package/dist/checkbox.js +8 -0
- package/dist/chunk-24TAPSJO.js +14 -0
- package/dist/chunk-2YEAAOWL.js +24 -0
- package/dist/chunk-33GOGIXE.js +19 -0
- package/dist/chunk-3TIYT55P.js +14 -0
- package/dist/chunk-46VRJZNH.js +24 -0
- package/dist/chunk-4AQXNXAQ.js +16 -0
- package/dist/chunk-4VBYIXGA.js +22 -0
- package/dist/chunk-4YJMCYQW.js +23 -0
- package/dist/chunk-54STG2JB.js +8 -0
- package/dist/chunk-5NGRPREI.js +14 -0
- package/dist/chunk-7A5VK567.js +48 -0
- package/dist/chunk-AVQGR5G7.js +22 -0
- package/dist/chunk-B3VPCEGX.js +14 -0
- package/dist/chunk-CWGH75FA.js +217 -0
- package/dist/chunk-JA3X5LJF.js +14 -0
- package/dist/chunk-KU7UNDPK.js +14 -0
- package/dist/chunk-L53J65C4.js +23 -0
- package/dist/chunk-LFWQDF6U.js +25 -0
- package/dist/chunk-ME34NDSX.js +28 -0
- package/dist/chunk-QB6NCURJ.js +24 -0
- package/dist/chunk-SDU26SU7.js +43 -0
- package/dist/chunk-UJJUFR7B.js +22 -0
- package/dist/chunk-VIWYEDTD.js +14 -0
- package/dist/chunk-XYGNNGM2.js +14 -0
- package/dist/chunk-ZEQLZCOY.js +19 -0
- package/dist/dialog.d.ts +20 -0
- package/dist/dialog.js +18 -0
- package/dist/empty-state.d.ts +8 -0
- package/dist/empty-state.js +8 -0
- package/dist/field.d.ts +12 -0
- package/dist/field.js +8 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.js +118 -0
- package/dist/input.d.ts +8 -0
- package/dist/input.js +8 -0
- package/dist/pagination.d.ts +8 -0
- package/dist/pagination.js +8 -0
- package/dist/progress.d.ts +8 -0
- package/dist/progress.js +8 -0
- package/dist/radio.d.ts +8 -0
- package/dist/radio.js +8 -0
- package/dist/select.d.ts +30 -0
- package/dist/select.js +10 -0
- package/dist/separator.d.ts +8 -0
- package/dist/separator.js +8 -0
- package/dist/skeleton.d.ts +8 -0
- package/dist/skeleton.js +8 -0
- package/dist/spinner.d.ts +12 -0
- package/dist/spinner.js +8 -0
- package/dist/styles.css +775 -0
- package/dist/switch.d.ts +8 -0
- package/dist/switch.js +8 -0
- package/dist/table.d.ts +8 -0
- package/dist/table.js +8 -0
- package/dist/tabs.d.ts +9 -0
- package/dist/tabs.js +14 -0
- package/dist/textarea.d.ts +8 -0
- package/dist/textarea.js +8 -0
- package/dist/tokens.css +177 -0
- package/dist/tokens.d.ts +45 -0
- package/dist/tokens.js +7 -0
- package/package.json +173 -4
- package/tokens/primitive.json +512 -0
- package/tokens/semantic/dark.json +192 -0
- package/tokens/semantic/light.json +192 -0
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
cx
|
|
4
|
+
} from "./chunk-54STG2JB.js";
|
|
5
|
+
|
|
6
|
+
// src/select.tsx
|
|
7
|
+
import { forwardRef as forwardRef2 } from "react";
|
|
8
|
+
|
|
9
|
+
// src/select-dropdown.tsx
|
|
10
|
+
import {
|
|
11
|
+
forwardRef,
|
|
12
|
+
useEffect,
|
|
13
|
+
useId,
|
|
14
|
+
useRef,
|
|
15
|
+
useState
|
|
16
|
+
} from "react";
|
|
17
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
18
|
+
var SelectDropdown = /* @__PURE__ */ forwardRef(
|
|
19
|
+
({
|
|
20
|
+
options,
|
|
21
|
+
name,
|
|
22
|
+
value,
|
|
23
|
+
defaultValue,
|
|
24
|
+
placeholder = "Choose an option",
|
|
25
|
+
onValueChange,
|
|
26
|
+
disabled,
|
|
27
|
+
form,
|
|
28
|
+
className,
|
|
29
|
+
onClick,
|
|
30
|
+
onKeyDown,
|
|
31
|
+
onBlur,
|
|
32
|
+
...props
|
|
33
|
+
}, ref) => {
|
|
34
|
+
const listId = useId();
|
|
35
|
+
const root = useRef(null);
|
|
36
|
+
const list = useRef(null);
|
|
37
|
+
const search = useRef({ text: "", time: 0 });
|
|
38
|
+
const [internal, setInternal] = useState(defaultValue);
|
|
39
|
+
const [open, setOpen] = useState(false);
|
|
40
|
+
const [active, setActive] = useState();
|
|
41
|
+
const selected = options.findIndex(
|
|
42
|
+
(option) => option.value === (value ?? internal)
|
|
43
|
+
);
|
|
44
|
+
const enabled = options.flatMap(
|
|
45
|
+
(option, index) => option.disabled ? [] : [index]
|
|
46
|
+
);
|
|
47
|
+
const expanded = open && !disabled && enabled.length > 0;
|
|
48
|
+
const activeIndex = active !== void 0 && enabled.includes(active) ? active : void 0;
|
|
49
|
+
const close = () => {
|
|
50
|
+
setOpen(false);
|
|
51
|
+
setActive(void 0);
|
|
52
|
+
search.current.text = "";
|
|
53
|
+
};
|
|
54
|
+
useEffect(() => {
|
|
55
|
+
if (!expanded) return;
|
|
56
|
+
const container = root.current;
|
|
57
|
+
const scope = container?.getRootNode();
|
|
58
|
+
const dismiss = (event) => {
|
|
59
|
+
if (container && !event.composedPath().includes(container)) close();
|
|
60
|
+
};
|
|
61
|
+
scope?.addEventListener("pointerdown", dismiss, true);
|
|
62
|
+
return () => scope?.removeEventListener("pointerdown", dismiss, true);
|
|
63
|
+
}, [expanded]);
|
|
64
|
+
useEffect(() => {
|
|
65
|
+
const menu = list.current;
|
|
66
|
+
const item = activeIndex === void 0 ? void 0 : menu?.children[activeIndex];
|
|
67
|
+
if (!expanded || !menu || !item) return;
|
|
68
|
+
const visible = menu.getBoundingClientRect();
|
|
69
|
+
const option = item.getBoundingClientRect();
|
|
70
|
+
if (option.top < visible.top) menu.scrollTop -= visible.top - option.top;
|
|
71
|
+
if (option.bottom > visible.bottom)
|
|
72
|
+
menu.scrollTop += option.bottom - visible.bottom;
|
|
73
|
+
}, [activeIndex, expanded]);
|
|
74
|
+
useEffect(() => {
|
|
75
|
+
const owner = root.current?.querySelector("button")?.form;
|
|
76
|
+
const reset = () => {
|
|
77
|
+
if (value === void 0) setInternal(defaultValue);
|
|
78
|
+
close();
|
|
79
|
+
};
|
|
80
|
+
owner?.addEventListener("reset", reset);
|
|
81
|
+
return () => owner?.removeEventListener("reset", reset);
|
|
82
|
+
}, [defaultValue, form, value]);
|
|
83
|
+
const initial = (last = false) => enabled.includes(selected) ? selected : last ? enabled.at(-1) : enabled[0];
|
|
84
|
+
const choose = (index) => {
|
|
85
|
+
if (index === void 0 || !enabled.includes(index)) return;
|
|
86
|
+
const next = options[index].value;
|
|
87
|
+
if (value === void 0) setInternal(next);
|
|
88
|
+
if (index !== selected) onValueChange?.(next);
|
|
89
|
+
close();
|
|
90
|
+
};
|
|
91
|
+
const handleKeys = (event) => {
|
|
92
|
+
onKeyDown?.(event);
|
|
93
|
+
if (event.defaultPrevented || event.ctrlKey || event.metaKey || event.altKey || !enabled.length)
|
|
94
|
+
return;
|
|
95
|
+
const { key } = event;
|
|
96
|
+
if (key === "Escape" && expanded) {
|
|
97
|
+
event.preventDefault();
|
|
98
|
+
event.stopPropagation();
|
|
99
|
+
close();
|
|
100
|
+
} else if (key === "ArrowDown" || key === "ArrowUp" || key === "Home" || key === "End") {
|
|
101
|
+
event.preventDefault();
|
|
102
|
+
const previous = activeIndex === void 0 ? -1 : enabled.indexOf(activeIndex);
|
|
103
|
+
const next = key === "Home" ? enabled[0] : key === "End" ? enabled.at(-1) : previous < 0 ? initial(key === "ArrowUp") : enabled[Math.max(
|
|
104
|
+
0,
|
|
105
|
+
Math.min(
|
|
106
|
+
enabled.length - 1,
|
|
107
|
+
previous + (key === "ArrowDown" ? 1 : -1)
|
|
108
|
+
)
|
|
109
|
+
)];
|
|
110
|
+
setActive(next);
|
|
111
|
+
setOpen(true);
|
|
112
|
+
} else if (key === "Enter" || key === " ") {
|
|
113
|
+
event.preventDefault();
|
|
114
|
+
if (expanded) choose(activeIndex);
|
|
115
|
+
else {
|
|
116
|
+
setActive(initial());
|
|
117
|
+
setOpen(true);
|
|
118
|
+
}
|
|
119
|
+
} else if (key.length === 1) {
|
|
120
|
+
const time = Date.now();
|
|
121
|
+
const char = key.toLocaleLowerCase();
|
|
122
|
+
const previous = time - search.current.time < 500 ? search.current.text : "";
|
|
123
|
+
const text = previous + char;
|
|
124
|
+
search.current = { text, time };
|
|
125
|
+
const repeated = [...text].every((letter) => letter === char);
|
|
126
|
+
const start = enabled.indexOf(activeIndex ?? selected);
|
|
127
|
+
const first = repeated || previous === "" ? start + 1 : Math.max(0, start);
|
|
128
|
+
const ordered = [...enabled.slice(first), ...enabled.slice(0, first)];
|
|
129
|
+
const match = ordered.find(
|
|
130
|
+
(index) => options[index].label.toLocaleLowerCase().startsWith(repeated ? char : text)
|
|
131
|
+
);
|
|
132
|
+
if (match === void 0) return;
|
|
133
|
+
event.preventDefault();
|
|
134
|
+
setActive(match);
|
|
135
|
+
setOpen(true);
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
return /* @__PURE__ */ jsxs("div", { className: "om-select-dropdown", ref: root, children: [
|
|
139
|
+
/* @__PURE__ */ jsx(
|
|
140
|
+
"button",
|
|
141
|
+
{
|
|
142
|
+
...props,
|
|
143
|
+
ref,
|
|
144
|
+
type: "button",
|
|
145
|
+
role: "combobox",
|
|
146
|
+
form,
|
|
147
|
+
disabled,
|
|
148
|
+
"aria-disabled": !enabled.length || void 0,
|
|
149
|
+
"aria-expanded": expanded,
|
|
150
|
+
"aria-controls": listId,
|
|
151
|
+
"aria-activedescendant": expanded && activeIndex !== void 0 ? `${listId}-${activeIndex}` : void 0,
|
|
152
|
+
className: cx("om-select", "om-select-dropdown-trigger", className),
|
|
153
|
+
onKeyDown: handleKeys,
|
|
154
|
+
onBlur: (event) => {
|
|
155
|
+
onBlur?.(event);
|
|
156
|
+
close();
|
|
157
|
+
},
|
|
158
|
+
onClick: (event) => {
|
|
159
|
+
onClick?.(event);
|
|
160
|
+
if (event.defaultPrevented || !enabled.length) return;
|
|
161
|
+
if (expanded) close();
|
|
162
|
+
else {
|
|
163
|
+
setActive(initial());
|
|
164
|
+
setOpen(true);
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
children: options[selected]?.label ?? placeholder
|
|
168
|
+
}
|
|
169
|
+
),
|
|
170
|
+
name && selected !== -1 && /* @__PURE__ */ jsx(
|
|
171
|
+
"input",
|
|
172
|
+
{
|
|
173
|
+
type: "hidden",
|
|
174
|
+
name,
|
|
175
|
+
value: options[selected].value,
|
|
176
|
+
disabled,
|
|
177
|
+
form
|
|
178
|
+
}
|
|
179
|
+
),
|
|
180
|
+
/* @__PURE__ */ jsx(
|
|
181
|
+
"ul",
|
|
182
|
+
{
|
|
183
|
+
id: listId,
|
|
184
|
+
role: "listbox",
|
|
185
|
+
"aria-label": "Options",
|
|
186
|
+
ref: list,
|
|
187
|
+
hidden: !expanded,
|
|
188
|
+
children: options.map((option, index) => /* @__PURE__ */ jsx(
|
|
189
|
+
"li",
|
|
190
|
+
{
|
|
191
|
+
id: `${listId}-${index}`,
|
|
192
|
+
role: "option",
|
|
193
|
+
"aria-selected": selected === index,
|
|
194
|
+
"aria-disabled": option.disabled || void 0,
|
|
195
|
+
"data-active": activeIndex === index || void 0,
|
|
196
|
+
onMouseDown: (event) => event.preventDefault(),
|
|
197
|
+
onClick: () => choose(index),
|
|
198
|
+
children: option.label
|
|
199
|
+
},
|
|
200
|
+
option.value
|
|
201
|
+
))
|
|
202
|
+
}
|
|
203
|
+
)
|
|
204
|
+
] });
|
|
205
|
+
}
|
|
206
|
+
);
|
|
207
|
+
SelectDropdown.displayName = "SelectDropdown";
|
|
208
|
+
|
|
209
|
+
// src/select.tsx
|
|
210
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
211
|
+
var Select = /* @__PURE__ */ forwardRef2(({ className, ...props }, ref) => /* @__PURE__ */ jsx2("select", { ...props, ref, className: cx("om-select", className) }));
|
|
212
|
+
Select.displayName = "Select";
|
|
213
|
+
|
|
214
|
+
export {
|
|
215
|
+
SelectDropdown,
|
|
216
|
+
Select
|
|
217
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
cx
|
|
4
|
+
} from "./chunk-54STG2JB.js";
|
|
5
|
+
|
|
6
|
+
// src/separator.tsx
|
|
7
|
+
import { forwardRef } from "react";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
var Separator = /* @__PURE__ */ forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("hr", { ...props, ref, className: cx("om-separator", className) }));
|
|
10
|
+
Separator.displayName = "Separator";
|
|
11
|
+
|
|
12
|
+
export {
|
|
13
|
+
Separator
|
|
14
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
cx
|
|
4
|
+
} from "./chunk-54STG2JB.js";
|
|
5
|
+
|
|
6
|
+
// src/badge.tsx
|
|
7
|
+
import { forwardRef } from "react";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
var Badge = /* @__PURE__ */ forwardRef(({ className, tone = "neutral", ...props }, ref) => /* @__PURE__ */ jsx("span", { ...props, ref, className: cx("om-badge", `om-badge--${tone}`, className) }));
|
|
10
|
+
Badge.displayName = "Badge";
|
|
11
|
+
|
|
12
|
+
export {
|
|
13
|
+
Badge
|
|
14
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
cx
|
|
4
|
+
} from "./chunk-54STG2JB.js";
|
|
5
|
+
|
|
6
|
+
// src/breadcrumbs.tsx
|
|
7
|
+
import { forwardRef } from "react";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
var Breadcrumbs = /* @__PURE__ */ forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
10
|
+
"nav",
|
|
11
|
+
{
|
|
12
|
+
"aria-label": "Breadcrumb",
|
|
13
|
+
...props,
|
|
14
|
+
ref,
|
|
15
|
+
className: cx("om-breadcrumbs", className),
|
|
16
|
+
children: /* @__PURE__ */ jsx("ol", { role: "list", children })
|
|
17
|
+
}
|
|
18
|
+
));
|
|
19
|
+
Breadcrumbs.displayName = "Breadcrumbs";
|
|
20
|
+
|
|
21
|
+
export {
|
|
22
|
+
Breadcrumbs
|
|
23
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
cx
|
|
4
|
+
} from "./chunk-54STG2JB.js";
|
|
5
|
+
|
|
6
|
+
// src/switch.tsx
|
|
7
|
+
import { forwardRef } from "react";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
var Switch = /* @__PURE__ */ forwardRef(
|
|
10
|
+
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
11
|
+
"input",
|
|
12
|
+
{
|
|
13
|
+
...props,
|
|
14
|
+
ref,
|
|
15
|
+
type: "checkbox",
|
|
16
|
+
role: "switch",
|
|
17
|
+
className: cx("om-switch", className)
|
|
18
|
+
}
|
|
19
|
+
)
|
|
20
|
+
);
|
|
21
|
+
Switch.displayName = "Switch";
|
|
22
|
+
|
|
23
|
+
export {
|
|
24
|
+
Switch
|
|
25
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
cx
|
|
4
|
+
} from "./chunk-54STG2JB.js";
|
|
5
|
+
|
|
6
|
+
// src/dialog.tsx
|
|
7
|
+
import { forwardRef } from "react";
|
|
8
|
+
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
var Dialog = DialogPrimitive.Root;
|
|
11
|
+
var DialogTrigger = DialogPrimitive.Trigger;
|
|
12
|
+
var DialogClose = DialogPrimitive.Close;
|
|
13
|
+
var DialogTitle = DialogPrimitive.Title;
|
|
14
|
+
var DialogDescription = DialogPrimitive.Description;
|
|
15
|
+
var DialogContent = /* @__PURE__ */ forwardRef(({ className, children, container, theme, ...props }, ref) => /* @__PURE__ */ jsxs(DialogPrimitive.Portal, { container, children: [
|
|
16
|
+
/* @__PURE__ */ jsx(DialogPrimitive.Overlay, { className: "om-dialog-overlay", "data-om-theme": theme }),
|
|
17
|
+
/* @__PURE__ */ jsx(DialogPrimitive.Content, { ...props, ref, "data-om-theme": theme, className: cx("om-dialog-content", className), children })
|
|
18
|
+
] }));
|
|
19
|
+
DialogContent.displayName = "DialogContent";
|
|
20
|
+
|
|
21
|
+
export {
|
|
22
|
+
Dialog,
|
|
23
|
+
DialogTrigger,
|
|
24
|
+
DialogClose,
|
|
25
|
+
DialogTitle,
|
|
26
|
+
DialogDescription,
|
|
27
|
+
DialogContent
|
|
28
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
cx
|
|
4
|
+
} from "./chunk-54STG2JB.js";
|
|
5
|
+
|
|
6
|
+
// src/spinner.tsx
|
|
7
|
+
import { forwardRef } from "react";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
var Spinner = /* @__PURE__ */ forwardRef(({ className, label, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
10
|
+
"span",
|
|
11
|
+
{
|
|
12
|
+
role: label ? "status" : void 0,
|
|
13
|
+
"aria-hidden": label ? void 0 : true,
|
|
14
|
+
...props,
|
|
15
|
+
ref,
|
|
16
|
+
className: cx("om-spinner", className),
|
|
17
|
+
children: label && /* @__PURE__ */ jsx("span", { className: "om-spinner-label", children: label })
|
|
18
|
+
}
|
|
19
|
+
));
|
|
20
|
+
Spinner.displayName = "Spinner";
|
|
21
|
+
|
|
22
|
+
export {
|
|
23
|
+
Spinner
|
|
24
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
cx
|
|
4
|
+
} from "./chunk-54STG2JB.js";
|
|
5
|
+
|
|
6
|
+
// src/avatar.tsx
|
|
7
|
+
import { forwardRef, useState } from "react";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
var AvatarImage = ({ src }) => {
|
|
10
|
+
const [visible, setVisible] = useState(false);
|
|
11
|
+
return /* @__PURE__ */ jsx(
|
|
12
|
+
"img",
|
|
13
|
+
{
|
|
14
|
+
src,
|
|
15
|
+
alt: "",
|
|
16
|
+
hidden: !visible,
|
|
17
|
+
onLoad: () => setVisible(true),
|
|
18
|
+
onError: () => setVisible(false)
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
};
|
|
22
|
+
var Avatar = /* @__PURE__ */ forwardRef(
|
|
23
|
+
({ className, src, label, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
24
|
+
"span",
|
|
25
|
+
{
|
|
26
|
+
role: label ? "img" : void 0,
|
|
27
|
+
"aria-label": label,
|
|
28
|
+
"aria-hidden": label ? void 0 : true,
|
|
29
|
+
...props,
|
|
30
|
+
ref,
|
|
31
|
+
className: cx("om-avatar", className),
|
|
32
|
+
children: [
|
|
33
|
+
children,
|
|
34
|
+
src && /* @__PURE__ */ jsx(AvatarImage, { src }, src)
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
)
|
|
38
|
+
);
|
|
39
|
+
Avatar.displayName = "Avatar";
|
|
40
|
+
|
|
41
|
+
export {
|
|
42
|
+
Avatar
|
|
43
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
cx
|
|
4
|
+
} from "./chunk-54STG2JB.js";
|
|
5
|
+
|
|
6
|
+
// src/checkbox.tsx
|
|
7
|
+
import { forwardRef } from "react";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
var Checkbox = /* @__PURE__ */ forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
10
|
+
"input",
|
|
11
|
+
{
|
|
12
|
+
...props,
|
|
13
|
+
ref,
|
|
14
|
+
type: "checkbox",
|
|
15
|
+
className: cx("om-checkbox", className)
|
|
16
|
+
}
|
|
17
|
+
));
|
|
18
|
+
Checkbox.displayName = "Checkbox";
|
|
19
|
+
|
|
20
|
+
export {
|
|
21
|
+
Checkbox
|
|
22
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
cx
|
|
4
|
+
} from "./chunk-54STG2JB.js";
|
|
5
|
+
|
|
6
|
+
// src/card.tsx
|
|
7
|
+
import { forwardRef } from "react";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
var Card = /* @__PURE__ */ forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ...props, ref, className: cx("om-card", className) }));
|
|
10
|
+
Card.displayName = "Card";
|
|
11
|
+
|
|
12
|
+
export {
|
|
13
|
+
Card
|
|
14
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
cx
|
|
4
|
+
} from "./chunk-54STG2JB.js";
|
|
5
|
+
|
|
6
|
+
// src/empty-state.tsx
|
|
7
|
+
import { forwardRef } from "react";
|
|
8
|
+
import { jsx } from "react/jsx-runtime";
|
|
9
|
+
var EmptyState = /* @__PURE__ */ forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ...props, ref, className: cx("om-empty-state", className) }));
|
|
10
|
+
EmptyState.displayName = "EmptyState";
|
|
11
|
+
|
|
12
|
+
export {
|
|
13
|
+
EmptyState
|
|
14
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
cx
|
|
4
|
+
} from "./chunk-54STG2JB.js";
|
|
5
|
+
|
|
6
|
+
// src/field.tsx
|
|
7
|
+
import {
|
|
8
|
+
forwardRef
|
|
9
|
+
} from "react";
|
|
10
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
+
var Field = /* @__PURE__ */ forwardRef(({ className, legend, children, ...props }, ref) => /* @__PURE__ */ jsxs("fieldset", { ...props, ref, className: cx("om-field", className), children: [
|
|
12
|
+
/* @__PURE__ */ jsx("legend", { children: legend }),
|
|
13
|
+
children
|
|
14
|
+
] }));
|
|
15
|
+
Field.displayName = "Field";
|
|
16
|
+
|
|
17
|
+
export {
|
|
18
|
+
Field
|
|
19
|
+
};
|
package/dist/dialog.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ComponentPropsWithoutRef } from 'react';
|
|
3
|
+
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
4
|
+
|
|
5
|
+
declare const Dialog: react.FC<DialogPrimitive.DialogProps>;
|
|
6
|
+
declare const DialogTrigger: react.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & react.RefAttributes<HTMLButtonElement>>;
|
|
7
|
+
declare const DialogClose: react.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & react.RefAttributes<HTMLButtonElement>>;
|
|
8
|
+
declare const DialogTitle: react.ForwardRefExoticComponent<DialogPrimitive.DialogTitleProps & react.RefAttributes<HTMLHeadingElement>>;
|
|
9
|
+
declare const DialogDescription: react.ForwardRefExoticComponent<DialogPrimitive.DialogDescriptionProps & react.RefAttributes<HTMLParagraphElement>>;
|
|
10
|
+
type DialogContentProps = ComponentPropsWithoutRef<typeof DialogPrimitive.Content> & {
|
|
11
|
+
container?: ComponentPropsWithoutRef<typeof DialogPrimitive.Portal>['container'];
|
|
12
|
+
theme?: 'light' | 'dark';
|
|
13
|
+
};
|
|
14
|
+
declare const DialogContent: react.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & react.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
15
|
+
container?: ComponentPropsWithoutRef<typeof DialogPrimitive.Portal>["container"];
|
|
16
|
+
theme?: "light" | "dark";
|
|
17
|
+
} & react.RefAttributes<HTMLDivElement>>;
|
|
18
|
+
|
|
19
|
+
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogTitle, DialogTrigger };
|
|
20
|
+
export type { DialogContentProps };
|
package/dist/dialog.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
Dialog,
|
|
4
|
+
DialogClose,
|
|
5
|
+
DialogContent,
|
|
6
|
+
DialogDescription,
|
|
7
|
+
DialogTitle,
|
|
8
|
+
DialogTrigger
|
|
9
|
+
} from "./chunk-ME34NDSX.js";
|
|
10
|
+
import "./chunk-54STG2JB.js";
|
|
11
|
+
export {
|
|
12
|
+
Dialog,
|
|
13
|
+
DialogClose,
|
|
14
|
+
DialogContent,
|
|
15
|
+
DialogDescription,
|
|
16
|
+
DialogTitle,
|
|
17
|
+
DialogTrigger
|
|
18
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ComponentPropsWithoutRef } from 'react';
|
|
3
|
+
|
|
4
|
+
type EmptyStateProps = ComponentPropsWithoutRef<'div'>;
|
|
5
|
+
declare const EmptyState: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
|
|
7
|
+
export { EmptyState };
|
|
8
|
+
export type { EmptyStateProps };
|
package/dist/field.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode, ComponentPropsWithoutRef } from 'react';
|
|
3
|
+
|
|
4
|
+
type FieldProps = ComponentPropsWithoutRef<'fieldset'> & {
|
|
5
|
+
legend: ReactNode;
|
|
6
|
+
};
|
|
7
|
+
declare const Field: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProps<react.FieldsetHTMLAttributes<HTMLFieldSetElement>, HTMLFieldSetElement>, "ref"> & {
|
|
8
|
+
legend: ReactNode;
|
|
9
|
+
} & react.RefAttributes<HTMLFieldSetElement>>;
|
|
10
|
+
|
|
11
|
+
export { Field };
|
|
12
|
+
export type { FieldProps };
|
package/dist/field.js
ADDED
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export { Button, ButtonProps } from './button.js';
|
|
2
|
+
export { Input, InputProps } from './input.js';
|
|
3
|
+
export { Card, CardProps } from './card.js';
|
|
4
|
+
export { Badge, BadgeProps } from './badge.js';
|
|
5
|
+
export { Tabs, TabsContent, TabsList, TabsTrigger } from './tabs.js';
|
|
6
|
+
export { Dialog, DialogClose, DialogContent, DialogContentProps, DialogDescription, DialogTitle, DialogTrigger } from './dialog.js';
|
|
7
|
+
export { Textarea, TextareaProps } from './textarea.js';
|
|
8
|
+
export { Select, SelectDropdown, SelectDropdownOption, SelectDropdownProps, SelectProps } from './select.js';
|
|
9
|
+
export { Checkbox, CheckboxProps } from './checkbox.js';
|
|
10
|
+
export { Radio, RadioProps } from './radio.js';
|
|
11
|
+
export { Switch, SwitchProps } from './switch.js';
|
|
12
|
+
export { Separator, SeparatorProps } from './separator.js';
|
|
13
|
+
export { Skeleton, SkeletonProps } from './skeleton.js';
|
|
14
|
+
export { Progress, ProgressProps } from './progress.js';
|
|
15
|
+
export { Table, TableProps } from './table.js';
|
|
16
|
+
export { Field, FieldProps } from './field.js';
|
|
17
|
+
export { Accordion, AccordionProps } from './accordion.js';
|
|
18
|
+
export { Alert, AlertProps } from './alert.js';
|
|
19
|
+
export { Avatar, AvatarProps } from './avatar.js';
|
|
20
|
+
export { Spinner, SpinnerProps } from './spinner.js';
|
|
21
|
+
export { Breadcrumbs, BreadcrumbsProps } from './breadcrumbs.js';
|
|
22
|
+
export { Pagination, PaginationProps } from './pagination.js';
|
|
23
|
+
export { EmptyState, EmptyStateProps } from './empty-state.js';
|
|
24
|
+
export { TokenName, tokens } from './tokens.js';
|
|
25
|
+
import 'react';
|
|
26
|
+
import '@radix-ui/react-tabs';
|
|
27
|
+
import '@radix-ui/react-dialog';
|