@viliha/vui-ui 1.0.8 → 1.0.9
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/package.json +1 -1
- package/src/button.tsx +1 -1
- package/src/dropdown-menu.tsx +5 -1
- package/src/record-view.tsx +7 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@viliha/vui-ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.9",
|
|
4
4
|
"description": "Vui UI — a clean, token-driven React admin/CRM component library built on Tailwind CSS v4, shadcn-style patterns, and Radix Icons. Ships as TypeScript source (Just-in-Time), compiled by the consuming app.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Suman Bonakurthi",
|
package/src/button.tsx
CHANGED
|
@@ -23,7 +23,7 @@ const NEUTRAL =
|
|
|
23
23
|
const VARIANTS: Record<ButtonVariant, string> = {
|
|
24
24
|
default: NEUTRAL,
|
|
25
25
|
primary:
|
|
26
|
-
"border border-transparent bg-[var(--button-primary)] text-[var(--button-primary-foreground)] shadow-[var(--button-shadow)] hover:bg-[var(--button-primary-hover)] [&_svg]:border-
|
|
26
|
+
"border border-transparent bg-[var(--button-primary)] text-[var(--button-primary-foreground)] shadow-[var(--button-shadow)] hover:bg-[var(--button-primary-hover)] [&_svg]:border-[var(--button-primary-hover)]",
|
|
27
27
|
secondary: NEUTRAL,
|
|
28
28
|
outline: NEUTRAL,
|
|
29
29
|
ghost: "hover:bg-accent hover:text-accent-foreground",
|
package/src/dropdown-menu.tsx
CHANGED
|
@@ -14,6 +14,9 @@ interface DropdownProps {
|
|
|
14
14
|
ariaLabel?: string;
|
|
15
15
|
/** Render the trigger as a compact toolbar button (default) or a plain one. */
|
|
16
16
|
active?: boolean;
|
|
17
|
+
/** Extra classes on the label text — e.g. `hidden sm:inline` to hide it on
|
|
18
|
+
* mobile so the trigger collapses to an icon-only button. */
|
|
19
|
+
labelClassName?: string;
|
|
17
20
|
}
|
|
18
21
|
|
|
19
22
|
/** Minimal click-to-open menu with outside-click + Escape to close. */
|
|
@@ -24,6 +27,7 @@ export function Dropdown({
|
|
|
24
27
|
children,
|
|
25
28
|
ariaLabel,
|
|
26
29
|
active,
|
|
30
|
+
labelClassName,
|
|
27
31
|
}: DropdownProps) {
|
|
28
32
|
const [open, setOpen] = React.useState(false);
|
|
29
33
|
const ref = React.useRef<HTMLDivElement>(null);
|
|
@@ -62,7 +66,7 @@ export function Dropdown({
|
|
|
62
66
|
)}
|
|
63
67
|
>
|
|
64
68
|
{icon}
|
|
65
|
-
{label}
|
|
69
|
+
{label && <span className={cn("truncate", labelClassName)}>{label}</span>}
|
|
66
70
|
</button>
|
|
67
71
|
{open && (
|
|
68
72
|
<div
|
package/src/record-view.tsx
CHANGED
|
@@ -708,16 +708,6 @@ export function RecordView<T extends { id: RowId }>({
|
|
|
708
708
|
<div className="flex h-12 items-center justify-between border-b border-border px-4">
|
|
709
709
|
<div className="flex items-center gap-2">{titleLeading}</div>
|
|
710
710
|
<div className="flex items-center gap-1.5">
|
|
711
|
-
<Button
|
|
712
|
-
variant="link"
|
|
713
|
-
size="sm"
|
|
714
|
-
onClick={addRow}
|
|
715
|
-
className="px-1 no-underline hover:no-underline"
|
|
716
|
-
>
|
|
717
|
-
<Plus className="size-4 text-emerald-500" />
|
|
718
|
-
<span>{singular}</span>
|
|
719
|
-
</Button>
|
|
720
|
-
|
|
721
711
|
<input
|
|
722
712
|
ref={importRef}
|
|
723
713
|
type="file"
|
|
@@ -728,6 +718,7 @@ export function RecordView<T extends { id: RowId }>({
|
|
|
728
718
|
/>
|
|
729
719
|
<Dropdown
|
|
730
720
|
label="Import"
|
|
721
|
+
labelClassName="hidden sm:inline"
|
|
731
722
|
icon={<Upload className="size-3.5 text-sky-500" />}
|
|
732
723
|
align="end"
|
|
733
724
|
>
|
|
@@ -751,6 +742,7 @@ export function RecordView<T extends { id: RowId }>({
|
|
|
751
742
|
|
|
752
743
|
<Dropdown
|
|
753
744
|
label="Export"
|
|
745
|
+
labelClassName="hidden sm:inline"
|
|
754
746
|
icon={<Download className="size-3.5 text-violet-500" />}
|
|
755
747
|
align="end"
|
|
756
748
|
>
|
|
@@ -790,6 +782,11 @@ export function RecordView<T extends { id: RowId }>({
|
|
|
790
782
|
Show all columns
|
|
791
783
|
</DropdownItem>
|
|
792
784
|
</Dropdown>
|
|
785
|
+
|
|
786
|
+
<Button variant="primary" size="sm" onClick={addRow} className="ml-1">
|
|
787
|
+
<Plus className="size-4" />
|
|
788
|
+
<span className="hidden sm:inline">{singular}</span>
|
|
789
|
+
</Button>
|
|
793
790
|
</div>
|
|
794
791
|
</div>
|
|
795
792
|
|