@locusgraph/components 0.2.0 → 0.2.2
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/action/button-group.js +45 -17
- package/dist/action/button.js +44 -27
- package/dist/action/toggle-group.js +176 -12
- package/dist/action/toggle.js +70 -17
- package/dist/display/avatar.js +118 -7
- package/dist/display/badge.js +33 -20
- package/dist/display/chart/chart-container.js +205 -45
- package/dist/display/chart/chart-legend.js +79 -14
- package/dist/display/chart/chart-tooltip.js +211 -40
- package/dist/display/chat/attachment/attachment-parts.js +56 -13
- package/dist/display/chat/attachment/attachment.js +70 -28
- package/dist/display/chat/bubble.js +80 -37
- package/dist/display/chat/marker.js +44 -15
- package/dist/display/chat/message-scroller.js +276 -14
- package/dist/display/chat/message.js +58 -13
- package/dist/display/content/item.js +134 -47
- package/dist/display/content/kbd.js +19 -5
- package/dist/display/media/aspect-ratio.js +27 -3
- package/dist/display/media/carousel-controls.js +162 -11
- package/dist/display/media/carousel.js +325 -65
- package/dist/display/rule-grid/rule-grid.js +86 -29
- package/dist/display/separator.js +56 -3
- package/dist/display/skeletons/layouts/skeleton-rule-grid.js +30 -6
- package/dist/display/skeletons/layouts/skeleton-table.js +44 -6
- package/dist/display/skeletons/shapes/skeleton-avatar.js +31 -13
- package/dist/display/skeletons/shapes/skeleton-button.js +31 -13
- package/dist/display/skeletons/shapes/skeleton-text.js +25 -7
- package/dist/display/skeletons/skeleton-parts.js +22 -6
- package/dist/display/status/alert.js +44 -18
- package/dist/display/status/empty.js +69 -22
- package/dist/display/status/progress.js +116 -16
- package/dist/display/status/skeleton.js +10 -3
- package/dist/display/status/spinner.js +11 -3
- package/dist/display/table.js +77 -17
- package/dist/feedback/toaster.js +98 -21
- package/dist/form/advanced/calendar-day-button.js +89 -12
- package/dist/form/advanced/calendar.js +349 -56
- package/dist/form/advanced/combobox/combobox-chips.js +151 -8
- package/dist/form/advanced/combobox/combobox-items.js +239 -14
- package/dist/form/advanced/combobox/combobox.js +386 -13
- package/dist/form/advanced/input-otp.js +201 -11
- package/dist/form/choice/checkbox.js +58 -3
- package/dist/form/choice/radio-group.js +94 -5
- package/dist/form/choice/select.js +479 -25
- package/dist/form/choice/slider.js +118 -4
- package/dist/form/choice/switch.js +53 -3
- package/dist/form/field/field-error.js +34 -14
- package/dist/form/field/field-separator.js +19 -3
- package/dist/form/field/field-set.js +21 -5
- package/dist/form/field/field-text.js +28 -7
- package/dist/form/field/field.js +43 -25
- package/dist/form/hook-form/form.js +338 -40
- package/dist/form/input-group.js +297 -47
- package/dist/form/input.js +13 -3
- package/dist/form/label.js +42 -3
- package/dist/form/native-select.js +39 -7
- package/dist/form/textarea.js +11 -3
- package/dist/layout/accordion.js +165 -8
- package/dist/layout/collapsible.js +75 -7
- package/dist/layout/resizable.js +122 -7
- package/dist/layout/scroll/direction.js +25 -3
- package/dist/layout/scroll/scroll-area.js +138 -5
- package/dist/layout/sidebar/sidebar-context.js +184 -51
- package/dist/layout/sidebar/sidebar-menu-sub.js +219 -14
- package/dist/layout/sidebar/sidebar-menu.js +319 -38
- package/dist/layout/sidebar/sidebar-sections.js +369 -22
- package/dist/layout/sidebar/sidebar.js +384 -28
- package/dist/layout/tabs.js +183 -18
- package/dist/layout/use-mobile.js +11 -11
- package/dist/navigation/breadcrumb.js +82 -17
- package/dist/navigation/menubar/menubar-items.js +322 -16
- package/dist/navigation/menubar/menubar-sub.js +125 -7
- package/dist/navigation/menubar/menubar.js +213 -13
- package/dist/navigation/navigation-menu.js +90 -18
- package/dist/navigation/pagination.js +91 -20
- package/dist/overlay/alert-dialog.js +485 -26
- package/dist/overlay/context-menu/context-menu-items.js +322 -16
- package/dist/overlay/context-menu/context-menu-sub.js +125 -7
- package/dist/overlay/context-menu/context-menu.js +140 -11
- package/dist/overlay/dialog.js +405 -24
- package/dist/overlay/floating/command.js +423 -20
- package/dist/overlay/floating/drawer.js +354 -22
- package/dist/overlay/floating/hover-card.js +107 -7
- package/dist/overlay/menu/dropdown-menu-choice.js +149 -7
- package/dist/overlay/menu/dropdown-menu-item.js +174 -9
- package/dist/overlay/menu/dropdown-menu-sub.js +124 -7
- package/dist/overlay/menu/dropdown-menu.js +147 -12
- package/dist/overlay/popover.js +106 -7
- package/dist/overlay/sheet.js +379 -26
- package/dist/overlay/tooltip.js +145 -9
- package/dist/shell/app-header.js +29 -5
- package/dist/shell/app-shell.js +19 -3
- package/dist/shell/breadcrumbs.js +46 -14
- package/dist/shell/docs/docs-header.js +210 -10
- package/dist/shell/docs/docs-shell.js +36 -3
- package/dist/shell/docs/docs-sidebar.js +41 -7
- package/dist/shell/docs/on-this-page.js +78 -7
- package/dist/shell/docs/use-active-section.js +44 -42
- package/dist/shell/navigation/app-sidebar.js +66 -6
- package/dist/shell/navigation/nav-group.js +53 -11
- package/dist/shell/theme-toggle.js +51 -4
- package/package.json +2 -2
|
@@ -1,17 +1,59 @@
|
|
|
1
|
-
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
1
|
import { SidebarMenu, SidebarMenuButton, SidebarMenuItem } from "../../layout/sidebar/sidebar-menu.js";
|
|
3
|
-
import { SidebarGroup, SidebarGroupContent, SidebarGroupLabel
|
|
2
|
+
import { SidebarGroup, SidebarGroupContent, SidebarGroupLabel } from "../../layout/sidebar/sidebar-sections.js";
|
|
3
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
4
|
function isActiveHref(itemHref, activeHref) {
|
|
5
|
-
|
|
5
|
+
return activeHref === itemHref || activeHref.startsWith(`${itemHref}/`);
|
|
6
6
|
}
|
|
7
|
-
function NavItemLink({
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
function NavItemLink({
|
|
8
|
+
item,
|
|
9
|
+
Link,
|
|
10
|
+
...props
|
|
11
|
+
}) {
|
|
12
|
+
const content = /*#__PURE__*/_jsxs(_Fragment, {
|
|
13
|
+
children: [/*#__PURE__*/_jsx(item.icon, {}), /*#__PURE__*/_jsx("span", {
|
|
14
|
+
children: item.title
|
|
15
|
+
})]
|
|
16
|
+
});
|
|
17
|
+
if (item.external) {
|
|
18
|
+
return /*#__PURE__*/_jsx("a", {
|
|
19
|
+
...props,
|
|
20
|
+
href: item.href,
|
|
21
|
+
target: "_blank",
|
|
22
|
+
rel: "noreferrer",
|
|
23
|
+
children: content
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
return /*#__PURE__*/_jsx(Link, {
|
|
27
|
+
...props,
|
|
28
|
+
href: item.href,
|
|
29
|
+
children: content
|
|
30
|
+
});
|
|
13
31
|
}
|
|
14
|
-
function NavGroup({
|
|
15
|
-
|
|
32
|
+
function NavGroup({
|
|
33
|
+
group,
|
|
34
|
+
activeHref,
|
|
35
|
+
Link,
|
|
36
|
+
className
|
|
37
|
+
}) {
|
|
38
|
+
return /*#__PURE__*/_jsxs(SidebarGroup, {
|
|
39
|
+
className: className,
|
|
40
|
+
children: [group.label && /*#__PURE__*/_jsx(SidebarGroupLabel, {
|
|
41
|
+
children: group.label
|
|
42
|
+
}), /*#__PURE__*/_jsx(SidebarGroupContent, {
|
|
43
|
+
children: /*#__PURE__*/_jsx(SidebarMenu, {
|
|
44
|
+
children: group.items.map(item => /*#__PURE__*/_jsx(SidebarMenuItem, {
|
|
45
|
+
children: /*#__PURE__*/_jsx(SidebarMenuButton, {
|
|
46
|
+
asChild: true,
|
|
47
|
+
isActive: isActiveHref(item.href, activeHref),
|
|
48
|
+
tooltip: item.title,
|
|
49
|
+
children: /*#__PURE__*/_jsx(NavItemLink, {
|
|
50
|
+
item: item,
|
|
51
|
+
Link: Link
|
|
52
|
+
})
|
|
53
|
+
})
|
|
54
|
+
}, item.href))
|
|
55
|
+
})
|
|
56
|
+
})]
|
|
57
|
+
});
|
|
16
58
|
}
|
|
17
59
|
export { isActiveHref, NavGroup };
|
|
@@ -1,9 +1,56 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
import { c as _c } from "react/compiler-runtime";
|
|
3
4
|
import { Moon as MoonIcon, Sun as SunIcon } from "@carbon/icons-react";
|
|
4
5
|
import { Button } from "../action/button.js";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
function ThemeToggle(t0) {
|
|
8
|
+
const $ = _c(8);
|
|
9
|
+
const {
|
|
10
|
+
theme,
|
|
11
|
+
onThemeChange
|
|
12
|
+
} = t0;
|
|
13
|
+
const nextTheme = theme === "dark" ? "light" : "dark";
|
|
14
|
+
const t1 = `Switch to ${nextTheme} theme`;
|
|
15
|
+
let t2;
|
|
16
|
+
if ($[0] !== nextTheme || $[1] !== onThemeChange) {
|
|
17
|
+
t2 = () => onThemeChange(nextTheme);
|
|
18
|
+
$[0] = nextTheme;
|
|
19
|
+
$[1] = onThemeChange;
|
|
20
|
+
$[2] = t2;
|
|
21
|
+
} else {
|
|
22
|
+
t2 = $[2];
|
|
23
|
+
}
|
|
24
|
+
let t3;
|
|
25
|
+
let t4;
|
|
26
|
+
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
|
27
|
+
t3 = /*#__PURE__*/_jsx(SunIcon, {
|
|
28
|
+
className: "scale-100 rotate-0 transition-all dark:scale-0 dark:-rotate-90"
|
|
29
|
+
});
|
|
30
|
+
t4 = /*#__PURE__*/_jsx(MoonIcon, {
|
|
31
|
+
className: "absolute scale-0 rotate-90 transition-all dark:scale-100 dark:rotate-0"
|
|
32
|
+
});
|
|
33
|
+
$[3] = t3;
|
|
34
|
+
$[4] = t4;
|
|
35
|
+
} else {
|
|
36
|
+
t3 = $[3];
|
|
37
|
+
t4 = $[4];
|
|
38
|
+
}
|
|
39
|
+
let t5;
|
|
40
|
+
if ($[5] !== t1 || $[6] !== t2) {
|
|
41
|
+
t5 = /*#__PURE__*/_jsxs(Button, {
|
|
42
|
+
variant: "ghost",
|
|
43
|
+
size: "icon-sm",
|
|
44
|
+
"aria-label": t1,
|
|
45
|
+
onClick: t2,
|
|
46
|
+
children: [t3, t4]
|
|
47
|
+
});
|
|
48
|
+
$[5] = t1;
|
|
49
|
+
$[6] = t2;
|
|
50
|
+
$[7] = t5;
|
|
51
|
+
} else {
|
|
52
|
+
t5 = $[7];
|
|
53
|
+
}
|
|
54
|
+
return t5;
|
|
8
55
|
}
|
|
9
56
|
export { ThemeToggle };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@locusgraph/components",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Radix and shadcn based React components, shells and theme for LocusGraph apps.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
},
|
|
62
62
|
"homepage": "https://design.locusgraph.com",
|
|
63
63
|
"scripts": {
|
|
64
|
-
"build": "rm -rf dist && tsc -p tsconfig.build.json && cp -R src/styles dist/styles && node ../../scripts/esm-extensions.mjs dist",
|
|
64
|
+
"build": "rm -rf dist && tsc -p tsconfig.build.json && cp -R src/styles dist/styles && node ../../scripts/react-compiler.mjs dist && node ../../scripts/esm-extensions.mjs dist",
|
|
65
65
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
66
66
|
"test": "vitest run"
|
|
67
67
|
}
|