@quan-erp/shared-ui 1.0.11 → 1.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/dist/components/ui/collapsible.d.ts +4 -3
- package/dist/components/ui/context-menu.d.ts +1 -1
- package/dist/components/ui/drawer.d.ts +2 -2
- package/dist/components/ui/dropdown-menu.d.ts +1 -1
- package/dist/components/ui/hover-card.d.ts +1 -1
- package/dist/components/ui/navigation-menu.d.ts +1 -1
- package/dist/components/ui/popover.d.ts +1 -1
- package/dist/components/ui/select.d.ts +1 -1
- package/dist/es/components/custom/confirm-dialog.js +19 -6
- package/dist/es/components/custom/dashboard.js +4 -1
- package/dist/es/components/custom/data-table/cursor-based-pagination.js +3 -1
- package/dist/es/components/custom/data-table/data-table-bulk-action-menu.js +4 -1
- package/dist/es/components/custom/data-table/data-table-bulk-export.js +3 -1
- package/dist/es/components/custom/data-table/data-table-column-header.js +4 -1
- package/dist/es/components/custom/data-table/data-table-grid.js +3 -1
- package/dist/es/components/custom/data-table/data-table-list-view.js +2 -0
- package/dist/es/components/custom/data-table/data-table-pagination.js +3 -1
- package/dist/es/components/custom/data-table/data-table-toolbar.js +3 -1
- package/dist/es/components/custom/data-table/data-table-view-options.js +8 -1
- package/dist/es/components/custom/data-table/data-table.js +11 -2
- package/dist/es/components/custom/error-screen.js +1 -1
- package/dist/es/components/custom/floating-action-btn.js +16 -5
- package/dist/es/components/custom/menu-tab.js +26 -17
- package/dist/es/components/custom/page.js +4 -2
- package/dist/es/components/custom/protected-page.js +0 -54
- package/dist/es/components/custom/pull-to-refresh.js +5 -3
- package/dist/es/components/custom/responsive-dialog.js +26 -25
- package/dist/es/components/custom/scrollable.js +2 -0
- package/dist/es/components/custom/setting.js +12 -9
- package/dist/es/components/ui/accordion.js +4 -0
- package/dist/es/components/ui/alert-dialog.js +6 -5
- package/dist/es/components/ui/breadcrumb.js +2 -0
- package/dist/es/components/ui/button.js +2 -1
- package/dist/es/components/ui/calendar.js +3 -1
- package/dist/es/components/ui/chart.js +2 -0
- package/dist/es/components/ui/checkbox.js +2 -0
- package/dist/es/components/ui/collapsible.js +7 -2
- package/dist/es/components/ui/command.js +4 -0
- package/dist/es/components/ui/context-menu.js +10 -2
- package/dist/es/components/ui/dialog.js +7 -6
- package/dist/es/components/ui/drawer.js +8 -3
- package/dist/es/components/ui/dropdown-menu.js +10 -2
- package/dist/es/components/ui/hover-card.js +4 -1
- package/dist/es/components/ui/input-otp.js +2 -0
- package/dist/es/components/ui/input.js +2 -1
- package/dist/es/components/ui/label.js +2 -1
- package/dist/es/components/ui/menubar.js +8 -0
- package/dist/es/components/ui/navigation-menu.js +5 -1
- package/dist/es/components/ui/pagination.js +4 -0
- package/dist/es/components/ui/popover.js +4 -1
- package/dist/es/components/ui/radio-group.js +3 -0
- package/dist/es/components/ui/resizable.js +2 -0
- package/dist/es/components/ui/select.js +8 -2
- package/dist/es/components/ui/sheet.js +6 -5
- package/dist/es/components/ui/sidebar.js +7 -0
- package/dist/es/components/ui/slider.js +3 -0
- package/dist/es/components/ui/switch.js +2 -0
- package/dist/es/components/ui/tabs.js +4 -0
- package/dist/es/components/ui/textarea.js +2 -1
- package/dist/es/components/ui/time-picker.js +4 -2
- package/dist/es/components/ui/toggle-group.js +3 -0
- package/dist/es/components/ui/toggle.js +2 -1
- package/dist/es/components/ui/tooltip.js +3 -2
- package/dist/es/index.js +2 -0
- package/dist/es/lib/macros.js +15 -0
- package/dist/lib/index.d.ts +1 -0
- package/dist/lib/macros.d.ts +8 -0
- package/package.json +3 -3
|
@@ -2,6 +2,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group";
|
|
4
4
|
import "class-variance-authority";
|
|
5
|
+
import { macrosSlot } from "../../lib/macros.js";
|
|
5
6
|
import { cn } from "../../lib/utils.js";
|
|
6
7
|
import { toggleVariants } from "./toggle.js";
|
|
7
8
|
const ToggleGroupContext = React.createContext({
|
|
@@ -12,6 +13,7 @@ const ToggleGroup = React.forwardRef(({ className, variant, size, children, ...p
|
|
|
12
13
|
ToggleGroupPrimitive.Root,
|
|
13
14
|
{
|
|
14
15
|
ref,
|
|
16
|
+
...macrosSlot("toggle-group"),
|
|
15
17
|
className: cn("shared:flex shared:items-center shared:justify-center shared:gap-1", className),
|
|
16
18
|
...props,
|
|
17
19
|
children: /* @__PURE__ */ jsx(ToggleGroupContext.Provider, { value: { variant, size }, children })
|
|
@@ -24,6 +26,7 @@ const ToggleGroupItem = React.forwardRef(({ className, children, variant, size,
|
|
|
24
26
|
ToggleGroupPrimitive.Item,
|
|
25
27
|
{
|
|
26
28
|
ref,
|
|
29
|
+
...macrosSlot("toggle-group-item"),
|
|
27
30
|
className: cn(
|
|
28
31
|
toggleVariants({
|
|
29
32
|
variant: context.variant || variant,
|
|
@@ -2,6 +2,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import "react";
|
|
3
3
|
import * as TogglePrimitive from "@radix-ui/react-toggle";
|
|
4
4
|
import { cva } from "class-variance-authority";
|
|
5
|
+
import { macrosSlot } from "../../lib/macros.js";
|
|
5
6
|
import { cn } from "../../lib/utils.js";
|
|
6
7
|
const toggleVariants = cva(
|
|
7
8
|
"shared:inline-flex shared:items-center shared:justify-center shared:gap-2 shared:rounded-md shared:text-sm shared:font-medium shared:hover:bg-muted shared:hover:text-muted-foreground shared:disabled:pointer-events-none shared:disabled:opacity-50 shared:data-[state=on]:bg-accent shared:data-[state=on]:text-accent-foreground shared:[&_svg]:pointer-events-none [&_svg:not([class*='size-'])shared:]:size-4 shared:[&_svg]:shrink-0 shared:focus-visible:border-ring shared:focus-visible:ring-ring/50 shared:focus-visible:ring-[3px] shared:outline-none shared:transition-[color,box-shadow] shared:aria-invalid:ring-destructive/20 shared:dark:aria-invalid:ring-destructive/40 shared:aria-invalid:border-destructive shared:whitespace-nowrap",
|
|
@@ -32,7 +33,7 @@ function Toggle({
|
|
|
32
33
|
return /* @__PURE__ */ jsx(
|
|
33
34
|
TogglePrimitive.Root,
|
|
34
35
|
{
|
|
35
|
-
"
|
|
36
|
+
...macrosSlot("toggle"),
|
|
36
37
|
className: cn(toggleVariants({ variant, size, className })),
|
|
37
38
|
...props
|
|
38
39
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
3
|
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
4
|
+
import { macrosSlot } from "../../lib/macros.js";
|
|
4
5
|
import { cn } from "../../lib/utils.js";
|
|
5
6
|
function TooltipProvider({
|
|
6
7
|
delayDuration = 0,
|
|
@@ -23,7 +24,7 @@ function Tooltip({
|
|
|
23
24
|
function TooltipTrigger({
|
|
24
25
|
...props
|
|
25
26
|
}) {
|
|
26
|
-
return /* @__PURE__ */ jsx(TooltipPrimitive.Trigger, { "
|
|
27
|
+
return /* @__PURE__ */ jsx(TooltipPrimitive.Trigger, { ...macrosSlot("tooltip-trigger"), ...props });
|
|
27
28
|
}
|
|
28
29
|
function TooltipContent({
|
|
29
30
|
className,
|
|
@@ -34,7 +35,7 @@ function TooltipContent({
|
|
|
34
35
|
return /* @__PURE__ */ jsx(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsxs(
|
|
35
36
|
TooltipPrimitive.Content,
|
|
36
37
|
{
|
|
37
|
-
"
|
|
38
|
+
...macrosSlot("tooltip-content"),
|
|
38
39
|
sideOffset,
|
|
39
40
|
className: cn(
|
|
40
41
|
"shared:bg-foreground shared:text-background shared:animate-in shared:fade-in-0 shared:zoom-in-95 shared:data-[state=closed]:animate-out shared:data-[state=closed]:fade-out-0 shared:data-[state=closed]:zoom-out-95 shared:data-[side=bottom]:slide-in-from-top-2 shared:data-[side=left]:slide-in-from-right-2 shared:data-[side=right]:slide-in-from-left-2 shared:data-[side=top]:slide-in-from-bottom-2 shared:z-50 shared:w-fit shared:origin-(--radix-tooltip-content-transform-origin) shared:rounded-md shared:px-3 shared:py-1.5 shared:text-xs shared:text-balance",
|
package/dist/es/index.js
CHANGED
|
@@ -98,6 +98,7 @@ import { useDebounceValue } from "./hooks/use-debounce-value.js";
|
|
|
98
98
|
import { useScrollDirection } from "./hooks/use-scroll-direction.js";
|
|
99
99
|
import { useMounted } from "./hooks/use-mounted.js";
|
|
100
100
|
import { useIsInView } from "./hooks/use-is-inview.js";
|
|
101
|
+
import { macrosSlot } from "./lib/macros.js";
|
|
101
102
|
import { groupTableRowsBy } from "./components/custom/data-table/group-table-rows.js";
|
|
102
103
|
import * as RechartsPrimitive from "recharts";
|
|
103
104
|
import { Editor } from "./components/blocks/editor-00/editor.js";
|
|
@@ -457,6 +458,7 @@ export {
|
|
|
457
458
|
groupTableRowsBy,
|
|
458
459
|
isDataTableInfiniteFromStorage,
|
|
459
460
|
loadViewPreferences,
|
|
461
|
+
macrosSlot,
|
|
460
462
|
navigationMenuTriggerStyle,
|
|
461
463
|
nodes,
|
|
462
464
|
parseDataTableRowsPerPage,
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const slotCache = /* @__PURE__ */ new Map();
|
|
2
|
+
function macrosSlot(slot) {
|
|
3
|
+
let attrs = slotCache.get(slot);
|
|
4
|
+
if (!attrs) {
|
|
5
|
+
attrs = {
|
|
6
|
+
"data-slot": slot,
|
|
7
|
+
"data-macros": slot
|
|
8
|
+
};
|
|
9
|
+
slotCache.set(slot, attrs);
|
|
10
|
+
}
|
|
11
|
+
return attrs;
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
macrosSlot
|
|
15
|
+
};
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** Stable attrs so Quan ERP Macros can record/replay shared-ui controls. */
|
|
2
|
+
type MacrosSlotAttrs = {
|
|
3
|
+
"data-slot": string;
|
|
4
|
+
"data-macros": string;
|
|
5
|
+
};
|
|
6
|
+
export declare function macrosSlot(slot: string): MacrosSlotAttrs;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=macros.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quan-erp/shared-ui",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.1.1",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "dist/es/index.js",
|
|
@@ -84,8 +84,8 @@
|
|
|
84
84
|
}
|
|
85
85
|
},
|
|
86
86
|
"peerDependencies": {
|
|
87
|
-
"@quan-erp/shared-frontend-core": "1.
|
|
88
|
-
"@quan-erp/shared-types": "1.
|
|
87
|
+
"@quan-erp/shared-frontend-core": "1.1.1",
|
|
88
|
+
"@quan-erp/shared-types": "1.1.1",
|
|
89
89
|
"motion": "^12.23.24",
|
|
90
90
|
"react": "19.2.6",
|
|
91
91
|
"react-dom": "19.2.6",
|