@squadbase/vantage 0.1.0 → 0.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/README.md +4 -1
- package/dist/{chunk-PRFBSQA4.js → chunk-5L2MH2NG.js} +9 -4
- package/dist/chunk-5L2MH2NG.js.map +1 -0
- package/dist/chunk-7IPAXPPY.js +51 -0
- package/dist/chunk-7IPAXPPY.js.map +1 -0
- package/dist/chunk-DTDVSFRY.js +29 -0
- package/dist/chunk-DTDVSFRY.js.map +1 -0
- package/dist/cli.js +1 -1
- package/dist/client/index.d.ts +2 -1
- package/dist/client/index.js +3 -1
- package/dist/client/index.js.map +1 -1
- package/dist/components/index.d.ts +23 -2
- package/dist/components/index.js +115 -1
- package/dist/components/index.js.map +1 -1
- package/dist/{define-page-B6y9TOfZ.d.ts → define-page-BfhrK99G.d.ts} +5 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/query/index.d.ts +69 -2
- package/dist/query/index.js +85 -2
- package/dist/query/index.js.map +1 -1
- package/dist/router/index.d.ts +86 -1
- package/dist/router/index.js +71 -7
- package/dist/router/index.js.map +1 -1
- package/dist/vite/index.js +1 -1
- package/docs/en/components.md +2 -0
- package/docs/en/data-fetching.md +77 -13
- package/docs/en/pages-and-metadata.md +6 -3
- package/docs/en/parts/placeholder.md +38 -0
- package/docs/en/parts/sparkline.md +47 -0
- package/docs/en/routing.md +82 -0
- package/docs/index.json +50 -10
- package/docs/ja/components.md +2 -0
- package/docs/ja/data-fetching.md +76 -12
- package/docs/ja/pages-and-metadata.md +6 -3
- package/docs/ja/parts/placeholder.md +37 -0
- package/docs/ja/parts/sparkline.md +47 -0
- package/docs/ja/routing.md +80 -0
- package/package.json +1 -1
- package/skills/vantage-add-feature/SKILL.md +14 -11
- package/skills/vantage-app/SKILL.md +54 -21
- package/skills/vantage-pitfalls/SKILL.md +26 -2
- package/templates/AGENTS.md +62 -17
- package/dist/chunk-ATYZ45XL.js +0 -19
- package/dist/chunk-ATYZ45XL.js.map +0 -1
- package/dist/chunk-PRFBSQA4.js.map +0 -1
package/dist/components/index.js
CHANGED
|
@@ -815,6 +815,108 @@ var FunnelSteps = forwardRef(function FunnelSteps2({
|
|
|
815
815
|
);
|
|
816
816
|
});
|
|
817
817
|
FunnelSteps.displayName = "FunnelSteps";
|
|
818
|
+
var VB_WIDTH = 100;
|
|
819
|
+
function normalizeData(values, height, vPad = 2) {
|
|
820
|
+
const min = Math.min(...values);
|
|
821
|
+
const max = Math.max(...values);
|
|
822
|
+
const range = max - min;
|
|
823
|
+
const drawHeight = height - vPad * 2;
|
|
824
|
+
if (range === 0) return values.map(() => vPad + drawHeight / 2);
|
|
825
|
+
return values.map((v) => height - vPad - (v - min) / range * drawHeight);
|
|
826
|
+
}
|
|
827
|
+
function buildLinePath(ys) {
|
|
828
|
+
if (ys.length === 0) return "";
|
|
829
|
+
const step = ys.length > 1 ? VB_WIDTH / (ys.length - 1) : 0;
|
|
830
|
+
return ys.map((y, i) => `${i === 0 ? "M" : "L"}${(i * step).toFixed(2)},${y.toFixed(2)}`).join(" ");
|
|
831
|
+
}
|
|
832
|
+
function buildAreaPath(ys, height) {
|
|
833
|
+
if (ys.length === 0) return "";
|
|
834
|
+
const step = ys.length > 1 ? VB_WIDTH / (ys.length - 1) : 0;
|
|
835
|
+
const lastX = ((ys.length - 1) * step).toFixed(2);
|
|
836
|
+
return `${buildLinePath(ys)} L${lastX},${height} L0,${height} Z`;
|
|
837
|
+
}
|
|
838
|
+
function buildBarRects(ys, height, gap = 1) {
|
|
839
|
+
const barW = Math.max(1, VB_WIDTH / ys.length - gap);
|
|
840
|
+
return ys.map((y, i) => ({ x: i * (barW + gap), y, w: barW, h: height - y }));
|
|
841
|
+
}
|
|
842
|
+
var Sparkline = forwardRef(function Sparkline2({
|
|
843
|
+
data,
|
|
844
|
+
variant = "line",
|
|
845
|
+
height = 40,
|
|
846
|
+
color = "text-chart-1",
|
|
847
|
+
area = false,
|
|
848
|
+
animate = false,
|
|
849
|
+
className,
|
|
850
|
+
...props
|
|
851
|
+
}, ref) {
|
|
852
|
+
const [mounted, setMounted] = useState(false);
|
|
853
|
+
useEffect(() => {
|
|
854
|
+
if (animate) setMounted(true);
|
|
855
|
+
}, [animate]);
|
|
856
|
+
if (data.length === 0) return null;
|
|
857
|
+
const ys = normalizeData(
|
|
858
|
+
data.map((d) => d.value),
|
|
859
|
+
height
|
|
860
|
+
);
|
|
861
|
+
return /* @__PURE__ */ jsxs(
|
|
862
|
+
"svg",
|
|
863
|
+
{
|
|
864
|
+
ref,
|
|
865
|
+
"data-slot": "sparkline",
|
|
866
|
+
viewBox: `0 0 ${VB_WIDTH} ${height}`,
|
|
867
|
+
preserveAspectRatio: "none",
|
|
868
|
+
width: "100%",
|
|
869
|
+
height,
|
|
870
|
+
"aria-hidden": "true",
|
|
871
|
+
className: cn("overflow-visible", className),
|
|
872
|
+
...props,
|
|
873
|
+
children: [
|
|
874
|
+
variant === "line" && /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
875
|
+
area && /* @__PURE__ */ jsx(
|
|
876
|
+
"path",
|
|
877
|
+
{
|
|
878
|
+
d: buildAreaPath(ys, height),
|
|
879
|
+
strokeWidth: 0,
|
|
880
|
+
className: cn("fill-current opacity-15", color)
|
|
881
|
+
}
|
|
882
|
+
),
|
|
883
|
+
/* @__PURE__ */ jsx(
|
|
884
|
+
"path",
|
|
885
|
+
{
|
|
886
|
+
d: buildLinePath(ys),
|
|
887
|
+
fill: "none",
|
|
888
|
+
strokeWidth: 1.5,
|
|
889
|
+
strokeLinecap: "round",
|
|
890
|
+
strokeLinejoin: "round",
|
|
891
|
+
vectorEffect: "non-scaling-stroke",
|
|
892
|
+
pathLength: animate ? 1 : void 0,
|
|
893
|
+
strokeDasharray: animate ? 1 : void 0,
|
|
894
|
+
strokeDashoffset: animate ? mounted ? 0 : 1 : void 0,
|
|
895
|
+
className: cn("stroke-current", color),
|
|
896
|
+
style: animate ? { transition: "stroke-dashoffset 0.6s ease-in-out" } : void 0
|
|
897
|
+
}
|
|
898
|
+
)
|
|
899
|
+
] }),
|
|
900
|
+
variant === "bar" && buildBarRects(ys, height).map((rect, i) => /* @__PURE__ */ jsx(
|
|
901
|
+
"rect",
|
|
902
|
+
{
|
|
903
|
+
x: rect.x,
|
|
904
|
+
y: animate ? mounted ? rect.y : height : rect.y,
|
|
905
|
+
width: rect.w,
|
|
906
|
+
height: animate ? mounted ? rect.h : 0 : rect.h,
|
|
907
|
+
rx: 0.5,
|
|
908
|
+
className: cn("fill-current", color),
|
|
909
|
+
style: animate ? {
|
|
910
|
+
transition: `height 0.4s ease-out ${i * 0.02}s, y 0.4s ease-out ${i * 0.02}s`
|
|
911
|
+
} : void 0
|
|
912
|
+
},
|
|
913
|
+
i
|
|
914
|
+
))
|
|
915
|
+
]
|
|
916
|
+
}
|
|
917
|
+
);
|
|
918
|
+
});
|
|
919
|
+
Sparkline.displayName = "Sparkline";
|
|
818
920
|
function useControlledState(controlledValue, defaultValue, onChange) {
|
|
819
921
|
const [internalValue, setInternalValue] = useState(defaultValue);
|
|
820
922
|
const isControlled = controlledValue !== void 0;
|
|
@@ -1977,7 +2079,19 @@ var StatusBadge = forwardRef(function StatusBadge2({ status, label, colorMap, cl
|
|
|
1977
2079
|
);
|
|
1978
2080
|
});
|
|
1979
2081
|
StatusBadge.displayName = "StatusBadge";
|
|
2082
|
+
var Placeholder = forwardRef(function Placeholder2({ className, ...props }, ref) {
|
|
2083
|
+
return /* @__PURE__ */ jsx(
|
|
2084
|
+
"span",
|
|
2085
|
+
{
|
|
2086
|
+
ref,
|
|
2087
|
+
"data-slot": "placeholder",
|
|
2088
|
+
className: cn("inline-block animate-pulse text-muted-foreground", className),
|
|
2089
|
+
...props
|
|
2090
|
+
}
|
|
2091
|
+
);
|
|
2092
|
+
});
|
|
2093
|
+
Placeholder.displayName = "Placeholder";
|
|
1980
2094
|
|
|
1981
|
-
export { AppShell, DashboardCard, DashboardCardAction, DashboardCardContent, DashboardCardDescription, DashboardCardFooter, DashboardCardHeader, DashboardCardPreset, DashboardCardSkeleton, DashboardCardTitle, DataTable, DataTableColumnVisibility, DataTableContent, DataTablePagination, DataTablePreset, DataTableToolbar, DateRangePicker, EChart, FilterBar, FilterBarActiveChips, FilterBarClearButton, FilterBarMultiSelect, FilterBarPreset, FilterBarSelect, FunnelSteps, MetricUnit, MetricValue, MultiSelect, PageShell, PageShellActions, PageShellContent, PageShellDescription, PageShellHeader, PageShellHeaderEnd, PageShellHeading, PageShellMeta, PageShellSummary, PageShellSummaryCard, PageShellTitle, SearchableSelect, SectionHeader, SegmentedControl, StatusBadge, TrendIndicator, defaultPresets, flattenOptions, funnelStepsVariants, isGroupedOptions, metricValueVariants, pageShellSummaryCardVariants, useDataTable };
|
|
2095
|
+
export { AppShell, DashboardCard, DashboardCardAction, DashboardCardContent, DashboardCardDescription, DashboardCardFooter, DashboardCardHeader, DashboardCardPreset, DashboardCardSkeleton, DashboardCardTitle, DataTable, DataTableColumnVisibility, DataTableContent, DataTablePagination, DataTablePreset, DataTableToolbar, DateRangePicker, EChart, FilterBar, FilterBarActiveChips, FilterBarClearButton, FilterBarMultiSelect, FilterBarPreset, FilterBarSelect, FunnelSteps, MetricUnit, MetricValue, MultiSelect, PageShell, PageShellActions, PageShellContent, PageShellDescription, PageShellHeader, PageShellHeaderEnd, PageShellHeading, PageShellMeta, PageShellSummary, PageShellSummaryCard, PageShellTitle, Placeholder, SearchableSelect, SectionHeader, SegmentedControl, Sparkline, StatusBadge, TrendIndicator, defaultPresets, flattenOptions, funnelStepsVariants, isGroupedOptions, metricValueVariants, pageShellSummaryCardVariants, useDataTable };
|
|
1982
2096
|
//# sourceMappingURL=index.js.map
|
|
1983
2097
|
//# sourceMappingURL=index.js.map
|