@designa8/vibedesign-v6 1.15.1 → 1.15.3
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/README.md +1 -1
- package/dist/index.cjs +11 -5
- package/dist/index.js +11 -5
- package/dist/styles.css +3 -0
- package/package.json +1 -1
- package/src/atoms/FilterTabBar/FilterTabBar.tsx +22 -8
- package/src/atoms/FilterTabBar/preview.tsx +21 -0
- package/src/atoms/Icon/icons.data.ts +1 -0
package/README.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -3602,7 +3602,8 @@ var ICON_REGISTRY = {
|
|
|
3602
3602
|
"atom": { viewBox: "0 0 24 24", paths: ["M12 12m-1.5 0a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 -3 0", "M12 3.5c4 0 8 3.6 8 8.5s-4 8.5-8 8.5", "M12 3.5c-4 1.8-8 5.6-8 8.5s4 6.7 8 8.5", "M4 8.5c1.8-4 5.6-5 8-5s6.2 1 8 5"] },
|
|
3603
3603
|
"layers": { viewBox: "0 0 24 24", paths: ["M12 3l8 4.5-8 4.5-8-4.5 8-4.5z", "M4 12l8 4.5 8-4.5", "M4 16.5l8 4.5 8-4.5"] },
|
|
3604
3604
|
"star": { viewBox: "0 0 24 24", paths: ["M12 3l2.6 5.6 6.1.7-4.5 4.2 1.2 6-5.4-3-5.4 3 1.2-6-4.5-4.2 6.1-.7L12 3z"] },
|
|
3605
|
-
"archive": { viewBox: "0 0 24 24", paths: ["M3 4h18v4H3z", "M4.5 8v11a1 1 0 0 0 1 1h13a1 1 0 0 0 1-1V8", "M10 12.5h4"] }
|
|
3605
|
+
"archive": { viewBox: "0 0 24 24", paths: ["M3 4h18v4H3z", "M4.5 8v11a1 1 0 0 0 1 1h13a1 1 0 0 0 1-1V8", "M10 12.5h4"] },
|
|
3606
|
+
"list-view": { viewBox: "0 0 24 24", paths: ["M4 6h16", "M4 12h16", "M4 18h16"] }
|
|
3606
3607
|
};
|
|
3607
3608
|
|
|
3608
3609
|
// virtual-pkg:src/atoms/Icon/Icon.tsx
|
|
@@ -4556,7 +4557,8 @@ ExportDesignMdModal.displayName = "ExportDesignMdModal";
|
|
|
4556
4557
|
var import_react19 = __toESM(require("react"));
|
|
4557
4558
|
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
4558
4559
|
var FilterTabBar = import_react19.default.forwardRef(
|
|
4559
|
-
({ tabs, value, onChange, className = "", ...rest }, ref) => {
|
|
4560
|
+
({ tabs, value, onChange, size = "md", className = "", ...rest }, ref) => {
|
|
4561
|
+
const isSm = size === "sm";
|
|
4560
4562
|
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
4561
4563
|
"div",
|
|
4562
4564
|
{
|
|
@@ -4564,8 +4566,8 @@ var FilterTabBar = import_react19.default.forwardRef(
|
|
|
4564
4566
|
role: "tablist",
|
|
4565
4567
|
"aria-label": "Filter tabs",
|
|
4566
4568
|
className: [
|
|
4567
|
-
"inline-flex
|
|
4568
|
-
"
|
|
4569
|
+
"inline-flex bg-canvas border border-hairline shadow-sm",
|
|
4570
|
+
isSm ? "items-stretch h-8 p-xxs rounded-lg gap-xxs" : "items-center p-xs rounded-xl gap-xs",
|
|
4569
4571
|
className
|
|
4570
4572
|
].filter(Boolean).join(" "),
|
|
4571
4573
|
...rest,
|
|
@@ -4581,7 +4583,11 @@ var FilterTabBar = import_react19.default.forwardRef(
|
|
|
4581
4583
|
variant: isActive ? "primary" : "ghost",
|
|
4582
4584
|
size: "sm",
|
|
4583
4585
|
onClick: () => onChange(tab.value),
|
|
4584
|
-
className:
|
|
4586
|
+
className: [
|
|
4587
|
+
"gap-xs leading-none",
|
|
4588
|
+
isSm ? "!h-full !py-0" : "",
|
|
4589
|
+
isIconOnly ? isSm ? "!px-xxs aspect-square" : "p-xs aspect-square" : ""
|
|
4590
|
+
].filter(Boolean).join(" "),
|
|
4585
4591
|
children: [
|
|
4586
4592
|
tab.icon && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "inline-flex items-center justify-center shrink-0", "aria-hidden": "true", children: tab.icon }),
|
|
4587
4593
|
tab.label && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { children: tab.label }),
|
package/dist/index.js
CHANGED
|
@@ -3545,7 +3545,8 @@ var ICON_REGISTRY = {
|
|
|
3545
3545
|
"atom": { viewBox: "0 0 24 24", paths: ["M12 12m-1.5 0a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 -3 0", "M12 3.5c4 0 8 3.6 8 8.5s-4 8.5-8 8.5", "M12 3.5c-4 1.8-8 5.6-8 8.5s4 6.7 8 8.5", "M4 8.5c1.8-4 5.6-5 8-5s6.2 1 8 5"] },
|
|
3546
3546
|
"layers": { viewBox: "0 0 24 24", paths: ["M12 3l8 4.5-8 4.5-8-4.5 8-4.5z", "M4 12l8 4.5 8-4.5", "M4 16.5l8 4.5 8-4.5"] },
|
|
3547
3547
|
"star": { viewBox: "0 0 24 24", paths: ["M12 3l2.6 5.6 6.1.7-4.5 4.2 1.2 6-5.4-3-5.4 3 1.2-6-4.5-4.2 6.1-.7L12 3z"] },
|
|
3548
|
-
"archive": { viewBox: "0 0 24 24", paths: ["M3 4h18v4H3z", "M4.5 8v11a1 1 0 0 0 1 1h13a1 1 0 0 0 1-1V8", "M10 12.5h4"] }
|
|
3548
|
+
"archive": { viewBox: "0 0 24 24", paths: ["M3 4h18v4H3z", "M4.5 8v11a1 1 0 0 0 1 1h13a1 1 0 0 0 1-1V8", "M10 12.5h4"] },
|
|
3549
|
+
"list-view": { viewBox: "0 0 24 24", paths: ["M4 6h16", "M4 12h16", "M4 18h16"] }
|
|
3549
3550
|
};
|
|
3550
3551
|
|
|
3551
3552
|
// virtual-pkg:src/atoms/Icon/Icon.tsx
|
|
@@ -4499,7 +4500,8 @@ ExportDesignMdModal.displayName = "ExportDesignMdModal";
|
|
|
4499
4500
|
import React20 from "react";
|
|
4500
4501
|
import { jsx as jsx20, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
4501
4502
|
var FilterTabBar = React20.forwardRef(
|
|
4502
|
-
({ tabs, value, onChange, className = "", ...rest }, ref) => {
|
|
4503
|
+
({ tabs, value, onChange, size = "md", className = "", ...rest }, ref) => {
|
|
4504
|
+
const isSm = size === "sm";
|
|
4503
4505
|
return /* @__PURE__ */ jsx20(
|
|
4504
4506
|
"div",
|
|
4505
4507
|
{
|
|
@@ -4507,8 +4509,8 @@ var FilterTabBar = React20.forwardRef(
|
|
|
4507
4509
|
role: "tablist",
|
|
4508
4510
|
"aria-label": "Filter tabs",
|
|
4509
4511
|
className: [
|
|
4510
|
-
"inline-flex
|
|
4511
|
-
"
|
|
4512
|
+
"inline-flex bg-canvas border border-hairline shadow-sm",
|
|
4513
|
+
isSm ? "items-stretch h-8 p-xxs rounded-lg gap-xxs" : "items-center p-xs rounded-xl gap-xs",
|
|
4512
4514
|
className
|
|
4513
4515
|
].filter(Boolean).join(" "),
|
|
4514
4516
|
...rest,
|
|
@@ -4524,7 +4526,11 @@ var FilterTabBar = React20.forwardRef(
|
|
|
4524
4526
|
variant: isActive ? "primary" : "ghost",
|
|
4525
4527
|
size: "sm",
|
|
4526
4528
|
onClick: () => onChange(tab.value),
|
|
4527
|
-
className:
|
|
4529
|
+
className: [
|
|
4530
|
+
"gap-xs leading-none",
|
|
4531
|
+
isSm ? "!h-full !py-0" : "",
|
|
4532
|
+
isIconOnly ? isSm ? "!px-xxs aspect-square" : "p-xs aspect-square" : ""
|
|
4533
|
+
].filter(Boolean).join(" "),
|
|
4528
4534
|
children: [
|
|
4529
4535
|
tab.icon && /* @__PURE__ */ jsx20("span", { className: "inline-flex items-center justify-center shrink-0", "aria-hidden": "true", children: tab.icon }),
|
|
4530
4536
|
tab.label && /* @__PURE__ */ jsx20("span", { children: tab.label }),
|
package/dist/styles.css
CHANGED
package/package.json
CHANGED
|
@@ -12,24 +12,36 @@ export interface FilterTab {
|
|
|
12
12
|
icon?: React.ReactNode;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
+
export type FilterTabBarSize = "sm" | "md";
|
|
16
|
+
|
|
15
17
|
export interface FilterTabBarProps
|
|
16
18
|
extends Omit<React.ComponentPropsWithoutRef<"div">, "onChange"> {
|
|
17
19
|
tabs: FilterTab[];
|
|
18
20
|
/** Currently active tab value */
|
|
19
21
|
value: string;
|
|
20
22
|
onChange: (value: string) => void;
|
|
23
|
+
/**
|
|
24
|
+
* Compact "sm" matches Input size="sm" total height (h-8 / 32px including
|
|
25
|
+
* border) so an icon-only tab bar can sit flush next to a sm input.
|
|
26
|
+
* Defaults to "md".
|
|
27
|
+
*/
|
|
28
|
+
size?: FilterTabBarSize;
|
|
21
29
|
}
|
|
22
30
|
|
|
23
31
|
export const FilterTabBar = React.forwardRef<HTMLDivElement, FilterTabBarProps>(
|
|
24
|
-
({ tabs, value, onChange, className = "", ...rest }, ref) => {
|
|
32
|
+
({ tabs, value, onChange, size = "md", className = "", ...rest }, ref) => {
|
|
33
|
+
const isSm = size === "sm";
|
|
34
|
+
|
|
25
35
|
return (
|
|
26
36
|
<div
|
|
27
37
|
ref={ref}
|
|
28
38
|
role="tablist"
|
|
29
39
|
aria-label="Filter tabs"
|
|
30
40
|
className={[
|
|
31
|
-
"inline-flex
|
|
32
|
-
|
|
41
|
+
"inline-flex bg-canvas border border-hairline shadow-sm",
|
|
42
|
+
isSm
|
|
43
|
+
? "items-stretch h-8 p-xxs rounded-lg gap-xxs"
|
|
44
|
+
: "items-center p-xs rounded-xl gap-xs",
|
|
33
45
|
className,
|
|
34
46
|
]
|
|
35
47
|
.filter(Boolean)
|
|
@@ -49,11 +61,13 @@ export const FilterTabBar = React.forwardRef<HTMLDivElement, FilterTabBarProps>(
|
|
|
49
61
|
variant={isActive ? "primary" : "ghost"}
|
|
50
62
|
size="sm"
|
|
51
63
|
onClick={() => onChange(tab.value)}
|
|
52
|
-
className={
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
64
|
+
className={[
|
|
65
|
+
"gap-xs leading-none",
|
|
66
|
+
isSm ? "!h-full !py-0" : "",
|
|
67
|
+
isIconOnly ? (isSm ? "!px-xxs aspect-square" : "p-xs aspect-square") : "",
|
|
68
|
+
]
|
|
69
|
+
.filter(Boolean)
|
|
70
|
+
.join(" ")}
|
|
57
71
|
>
|
|
58
72
|
{tab.icon && (
|
|
59
73
|
<span className="inline-flex items-center justify-center shrink-0" aria-hidden="true">
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { useState } from "react";
|
|
2
2
|
import { FilterTabBar } from "./FilterTabBar";
|
|
3
3
|
import { Icon } from "../Icon";
|
|
4
|
+
import { Input } from "../Input";
|
|
4
5
|
|
|
5
6
|
const tabsWithCounts = [
|
|
6
7
|
{ value: "all", label: "All", count: 15 },
|
|
@@ -21,6 +22,7 @@ export default function FilterTabBarPreview() {
|
|
|
21
22
|
const [active3, setActive3] = useState("all");
|
|
22
23
|
const [active4, setActive4] = useState("all");
|
|
23
24
|
const [active5, setActive5] = useState("all");
|
|
25
|
+
const [view, setView] = useState("grid");
|
|
24
26
|
|
|
25
27
|
return (
|
|
26
28
|
<div className="w-full max-w-3xl mx-auto p-xl flex flex-col items-start gap-xl bg-canvas py-xxl">
|
|
@@ -77,6 +79,25 @@ export default function FilterTabBarPreview() {
|
|
|
77
79
|
onChange={setActive5}
|
|
78
80
|
/>
|
|
79
81
|
</div>
|
|
82
|
+
|
|
83
|
+
{/* size="sm" — icon-only view switcher sharing the same 32px edge as Input size="sm" */}
|
|
84
|
+
<div className="flex flex-col gap-sm w-full">
|
|
85
|
+
<p className="text-caption text-muted uppercase tracking-wide">
|
|
86
|
+
size="sm" (flush with Input size="sm")
|
|
87
|
+
</p>
|
|
88
|
+
<div className="flex items-center gap-sm w-full">
|
|
89
|
+
<Input size="sm" placeholder="Search components..." className="flex-1" />
|
|
90
|
+
<FilterTabBar
|
|
91
|
+
size="sm"
|
|
92
|
+
tabs={[
|
|
93
|
+
{ value: "grid", icon: <Icon name="grid" size={14} /> },
|
|
94
|
+
{ value: "list", icon: <Icon name="list-view" size={14} /> },
|
|
95
|
+
]}
|
|
96
|
+
value={view}
|
|
97
|
+
onChange={setView}
|
|
98
|
+
/>
|
|
99
|
+
</div>
|
|
100
|
+
</div>
|
|
80
101
|
</div>
|
|
81
102
|
);
|
|
82
103
|
}
|
|
@@ -8,6 +8,7 @@ export const ICON_REGISTRY = {
|
|
|
8
8
|
"layers": { viewBox: "0 0 24 24", paths: ["M12 3l8 4.5-8 4.5-8-4.5 8-4.5z", "M4 12l8 4.5 8-4.5", "M4 16.5l8 4.5 8-4.5"] },
|
|
9
9
|
"star": { viewBox: "0 0 24 24", paths: ["M12 3l2.6 5.6 6.1.7-4.5 4.2 1.2 6-5.4-3-5.4 3 1.2-6-4.5-4.2 6.1-.7L12 3z"] },
|
|
10
10
|
"archive": { viewBox: "0 0 24 24", paths: ["M3 4h18v4H3z", "M4.5 8v11a1 1 0 0 0 1 1h13a1 1 0 0 0 1-1V8", "M10 12.5h4"] },
|
|
11
|
+
"list-view": { viewBox: "0 0 24 24", paths: ["M4 6h16", "M4 12h16", "M4 18h16"] },
|
|
11
12
|
} as const;
|
|
12
13
|
|
|
13
14
|
export type IconName = keyof typeof ICON_REGISTRY;
|