Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

next: Charts #1341

Open
wants to merge 69 commits into
base: next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
25d86d5
feat: Charts
shyakadavis Sep 25, 2024
ba15c22
chore: update page headers
shyakadavis Sep 25, 2024
f91c732
make sure to pick up/apply layerchart styles (thanks @techniq)
shyakadavis Sep 25, 2024
6c33d67
setup bars + add default example
shyakadavis Sep 25, 2024
6c38f6d
Bar Chart - Horizontal
shyakadavis Sep 25, 2024
1318b0f
Bar Chart - Label
shyakadavis Sep 25, 2024
afa7cea
incomplete: Bar Chart - Mixed
shyakadavis Sep 25, 2024
fe8f2d1
incomplete: Bar Chart - Stacked + Legend
shyakadavis Sep 25, 2024
df2d37a
incomplete: Bar Chart - Negative
shyakadavis Sep 25, 2024
2b5bfc0
init line charts: Line Chart, Line Chart - Linear, Line Step
shyakadavis Sep 25, 2024
995975e
Line Chart - Multiple
shyakadavis Sep 25, 2024
dc3a344
Line Chart - Dots
shyakadavis Sep 25, 2024
8544970
Line Chart - Label
shyakadavis Sep 25, 2024
47bc019
(parity): Line Chart - Label
shyakadavis Sep 25, 2024
e037d2b
init pie charts
shyakadavis Sep 25, 2024
a0565b2
incomplete: Pie Chart - Stacked
shyakadavis Sep 25, 2024
5848d47
init radar + Radar Chart - Default
shyakadavis Sep 26, 2024
e22d4ea
Radar Chart - Dots
shyakadavis Sep 26, 2024
1de3637
Radar Chart - Multiple
shyakadavis Sep 26, 2024
1ced5b4
Radar Chart - Lines Only
shyakadavis Sep 26, 2024
620567d
Radar Chart - Grid Circle
shyakadavis Sep 26, 2024
e6e5f30
init radial-chart
shyakadavis Sep 26, 2024
2f12a17
some visual organization/labels
shyakadavis Sep 27, 2024
7b12771
Area Chart - Stacked Expanded
shyakadavis Sep 27, 2024
290d47f
incomplete: Area Chart - Legend
shyakadavis Sep 27, 2024
2a57b20
incomplete: Bar Chart - Negative
shyakadavis Sep 28, 2024
40db5fb
improvements: Pie Chart - Stacked
shyakadavis Sep 28, 2024
da1df5a
init sidebar work
huntabyte Oct 20, 2024
39d1f4f
some more
huntabyte Oct 20, 2024
1827fe2
sidebar-01 ✅
huntabyte Oct 20, 2024
6778e3e
more sidebars done
huntabyte Oct 20, 2024
49ae356
9/15 😅
huntabyte Oct 20, 2024
534c350
10/15 😅
huntabyte Oct 20, 2024
369147e
11/15 😅
huntabyte Oct 20, 2024
1945a2d
12/15 💪
huntabyte Oct 20, 2024
a3e29ba
13/15 💪
huntabyte Oct 21, 2024
af501ce
14/15 💪
huntabyte Oct 21, 2024
06d8df6
15/15 💪
huntabyte Oct 21, 2024
aaab7df
add registry blocks
huntabyte Oct 21, 2024
d6a5ac0
update settings
huntabyte Oct 21, 2024
5ec3505
new registry work
huntabyte Oct 21, 2024
0553e00
update ts playground to svelte5
huntabyte Oct 21, 2024
d8354bf
more things
huntabyte Oct 21, 2024
8a6e419
more things
huntabyte Oct 21, 2024
dcce862
add additional aliases
huntabyte Oct 21, 2024
2f6fa5c
smore
huntabyte Oct 21, 2024
2dd183d
smore
huntabyte Oct 21, 2024
1fef42c
more
huntabyte Oct 21, 2024
ac57d51
more wip progress
huntabyte Oct 21, 2024
5b261a6
more stuff
huntabyte Oct 22, 2024
87dee5d
fix lockfile
AdrianGonz97 Oct 22, 2024
e81ad1a
fix hook script
AdrianGonz97 Oct 22, 2024
3401a09
fix block import paths
AdrianGonz97 Oct 22, 2024
145ed56
move to devDeps
AdrianGonz97 Oct 22, 2024
f64f4b8
remove the libs
AdrianGonz97 Oct 22, 2024
acfbd6d
infer alias
AdrianGonz97 Oct 22, 2024
f4b85bc
update schema and somewhat format errors
AdrianGonz97 Oct 22, 2024
3719286
always update the config file during commands
AdrianGonz97 Oct 22, 2024
4f92423
add registry field to the config
AdrianGonz97 Oct 22, 2024
5b44518
cleanup
AdrianGonz97 Oct 22, 2024
6dc23f7
Merge remote-tracking branch 'origin/charts-hb' into next-charts-new
huntabyte Oct 22, 2024
b93fa98
some s5 updates
huntabyte Oct 22, 2024
715b933
wip
huntabyte Oct 23, 2024
868ecd4
wip
huntabyte Oct 23, 2024
f08a406
more bar chart active work
huntabyte Oct 23, 2024
2261263
fix: new york getPayloadConfig function
huntabyte Oct 23, 2024
d029f97
merge next into charts
huntabyte Oct 28, 2024
6cfb928
i suck at dataviz
huntabyte Oct 28, 2024
916e87d
Merge branch 'next' into next-charts-new
huntabyte Nov 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"devDependencies": {
"@types/node": "^18.19.22",
"cross-env": "^7.0.3",
"deepmerge": "^4.3.1",
"get-tsconfig": "^4.7.3",
"ignore": "^5.3.1",
"package-manager-detector": "^0.2.2",
Expand Down
7 changes: 7 additions & 0 deletions packages/cli/src/utils/registry/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ export const registryItemSchema = v.object({
cssVars: v.optional(registryItemCssVarsSchema),
});

export type RegistryItem = v.InferOutput<typeof registryItemSchema>;

export const registryResolvedItemsTreeSchema = v.pick(registryItemSchema, [
"dependencies",
"files",
]);

export const registryIndexSchema = v.array(registryItemSchema);

export const registryItemWithContentSchema = v.object({
Expand Down
17 changes: 17 additions & 0 deletions playgrounds/playground-ts/components.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "https://shadcn-svelte.com/schema.json",
"style": "default",
"tailwind": {
"config": "tailwind.config.ts",
"css": "src/app.css",
"baseColor": "slate"
},
"aliases": {
"components": "$lib/components",
"utils": "$lib/utils",
"ui": "$lib/components/ui",
"lib": "$lib/",
"hooks": "$lib/hooks"
},
"typescript": true
}
6 changes: 6 additions & 0 deletions playgrounds/playground-ts/postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default {
plugins: {
tailwindcss: {},
autoprefixer: {}
}
};
78 changes: 78 additions & 0 deletions playgrounds/playground-ts/src/app.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
:root {
--background: 0 0% 100%;
--foreground: 222.2 84% 4.9%;

--muted: 210 40% 96.1%;
--muted-foreground: 215.4 16.3% 46.9%;

--popover: 0 0% 100%;
--popover-foreground: 222.2 84% 4.9%;

--card: 0 0% 100%;
--card-foreground: 222.2 84% 4.9%;

--border: 214.3 31.8% 91.4%;
--input: 214.3 31.8% 91.4%;

--primary: 222.2 47.4% 11.2%;
--primary-foreground: 210 40% 98%;

--secondary: 210 40% 96.1%;
--secondary-foreground: 222.2 47.4% 11.2%;

--accent: 210 40% 96.1%;
--accent-foreground: 222.2 47.4% 11.2%;

--destructive: 0 72.2% 50.6%;
--destructive-foreground: 210 40% 98%;

--ring: 222.2 84% 4.9%;

--radius: 0.5rem;
}

.dark {
--background: 222.2 84% 4.9%;
--foreground: 210 40% 98%;

--muted: 217.2 32.6% 17.5%;
--muted-foreground: 215 20.2% 65.1%;

--popover: 222.2 84% 4.9%;
--popover-foreground: 210 40% 98%;

--card: 222.2 84% 4.9%;
--card-foreground: 210 40% 98%;

--border: 217.2 32.6% 17.5%;
--input: 217.2 32.6% 17.5%;

--primary: 210 40% 98%;
--primary-foreground: 222.2 47.4% 11.2%;

--secondary: 217.2 32.6% 17.5%;
--secondary-foreground: 210 40% 98%;

--accent: 217.2 32.6% 17.5%;
--accent-foreground: 210 40% 98%;

--destructive: 0 62.8% 30.6%;
--destructive-foreground: 210 40% 98%;

--ring: 212.7 26.8% 83.9%;
}
}

@layer base {
* {
@apply border-border;
}
body {
@apply bg-background text-foreground;
}
}
62 changes: 62 additions & 0 deletions playgrounds/playground-ts/src/lib/utils.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import { type ClassValue, clsx } from "clsx";
import { twMerge } from "tailwind-merge";
import { cubicOut } from "svelte/easing";
import type { TransitionConfig } from "svelte/transition";

export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
}

type FlyAndScaleParams = {
y?: number;
x?: number;
start?: number;
duration?: number;
};

export const flyAndScale = (
node: Element,
params: FlyAndScaleParams = { y: -8, x: 0, start: 0.95, duration: 150 }
): TransitionConfig => {
const style = getComputedStyle(node);
const transform = style.transform === "none" ? "" : style.transform;

const scaleConversion = (
valueA: number,
scaleA: [number, number],
scaleB: [number, number]
) => {
const [minA, maxA] = scaleA;
const [minB, maxB] = scaleB;

const percentage = (valueA - minA) / (maxA - minA);
const valueB = percentage * (maxB - minB) + minB;

return valueB;
};

const styleToString = (
style: Record<string, number | string | undefined>
): string => {
return Object.keys(style).reduce((str, key) => {
if (style[key] === undefined) return str;
return str + `${key}:${style[key]};`;
}, "");
};

return {
duration: params.duration ?? 200,
delay: 0,
css: (t) => {
const y = scaleConversion(t, [0, 1], [params.y ?? 5, 0]);
const x = scaleConversion(t, [0, 1], [params.x ?? 0, 0]);
const scale = scaleConversion(t, [0, 1], [params.start ?? 0.95, 1]);

return styleToString({
transform: `${transform} translate3d(${x}px, ${y}px, 0) scale(${scale})`,
opacity: t
});
},
easing: cubicOut
};
};
64 changes: 64 additions & 0 deletions playgrounds/playground-ts/tailwind.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import { fontFamily } from "tailwindcss/defaultTheme";
import type { Config } from "tailwindcss";

const config: Config = {
darkMode: ["class"],
content: ["./src/**/*.{html,js,svelte,ts}"],
safelist: ["dark"],
theme: {
container: {
center: true,
padding: "2rem",
screens: {
"2xl": "1400px"
}
},
extend: {
colors: {
border: "hsl(var(--border) / <alpha-value>)",
input: "hsl(var(--input) / <alpha-value>)",
ring: "hsl(var(--ring) / <alpha-value>)",
background: "hsl(var(--background) / <alpha-value>)",
foreground: "hsl(var(--foreground) / <alpha-value>)",
primary: {
DEFAULT: "hsl(var(--primary) / <alpha-value>)",
foreground: "hsl(var(--primary-foreground) / <alpha-value>)"
},
secondary: {
DEFAULT: "hsl(var(--secondary) / <alpha-value>)",
foreground: "hsl(var(--secondary-foreground) / <alpha-value>)"
},
destructive: {
DEFAULT: "hsl(var(--destructive) / <alpha-value>)",
foreground: "hsl(var(--destructive-foreground) / <alpha-value>)"
},
muted: {
DEFAULT: "hsl(var(--muted) / <alpha-value>)",
foreground: "hsl(var(--muted-foreground) / <alpha-value>)"
},
accent: {
DEFAULT: "hsl(var(--accent) / <alpha-value>)",
foreground: "hsl(var(--accent-foreground) / <alpha-value>)"
},
popover: {
DEFAULT: "hsl(var(--popover) / <alpha-value>)",
foreground: "hsl(var(--popover-foreground) / <alpha-value>)"
},
card: {
DEFAULT: "hsl(var(--card) / <alpha-value>)",
foreground: "hsl(var(--card-foreground) / <alpha-value>)"
}
},
borderRadius: {
lg: "var(--radius)",
md: "calc(var(--radius) - 2px)",
sm: "calc(var(--radius) - 4px)"
},
fontFamily: {
sans: [...fontFamily.sans]
}
}
},
};

export default config;
Loading