negodesign 0.0.1 → 0.0.2

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.
Files changed (89) hide show
  1. package/dist/components/core/breadcrumb/breadcrumb-list.svelte +31 -31
  2. package/dist/components/core/button/ButtonBack.svelte +18 -18
  3. package/dist/components/core/button/ButtonLogin.svelte +15 -15
  4. package/dist/components/core/button/ButtonLoginWith.svelte +57 -57
  5. package/dist/components/core/carousel/data/CarouselModel.d.ts +2 -1
  6. package/dist/components/core/datatable/ui/DataTableActions.svelte +28 -28
  7. package/dist/components/core/datatable/ui/DataTableCheckbox.svelte +22 -22
  8. package/dist/components/core/datatable/ui/DataTableContent.svelte +59 -59
  9. package/dist/components/core/datatable/ui/DataTableCore.svelte +144 -144
  10. package/dist/components/core/datatable/ui/DataTableDragHandle.svelte +8 -8
  11. package/dist/components/core/datatable/ui/DataTableListFilter.svelte +59 -59
  12. package/dist/components/core/datatable/ui/DataTableListPagination.svelte +35 -35
  13. package/dist/components/core/form/ui/input-base.svelte +81 -81
  14. package/dist/components/core/form/ui/input-email.svelte +22 -22
  15. package/dist/components/core/form/ui/input-password-confirm.svelte +22 -22
  16. package/dist/components/core/form/ui/input-password.svelte +22 -22
  17. package/dist/components/core/form/ui/input-phone.svelte +22 -0
  18. package/dist/components/core/form/ui/input-phone.svelte.d.ts +4 -0
  19. package/dist/components/core/form/ui/input-username.svelte +21 -21
  20. package/dist/components/core/label/LabelOr.svelte +25 -25
  21. package/dist/components/core/link/link-forget-password.svelte +12 -12
  22. package/dist/components/core/link/link-privacy-polity.svelte +12 -12
  23. package/dist/components/core/link/link-terms-of-service.svelte +12 -12
  24. package/dist/components/core/nav/ui/nav-menu-bar.svelte +97 -97
  25. package/dist/components/core/nav/ui/nav-menu-bottom-bar.svelte +33 -33
  26. package/dist/components/core/nav/ui/nav-menu-top-bar.svelte +103 -103
  27. package/dist/components/core/sidebar/menu-bar-sidebar.svelte +62 -62
  28. package/dist/components/core/tabs/ui/tab-underline.svelte +41 -41
  29. package/dist/components/pages/admin/ui/admin-content.svelte +13 -13
  30. package/dist/components/pages/admin/ui/admin-panel.svelte +40 -40
  31. package/dist/components/pages/login/admin/01/data/page-props.d.ts +10 -0
  32. package/dist/components/pages/login/admin/01/data/page-props.js +1 -0
  33. package/dist/components/pages/login/admin/01/ui/AuthCard.svelte +84 -58
  34. package/dist/components/pages/login/admin/01/ui/AuthCard.svelte.d.ts +11 -17
  35. package/dist/components/pages/login/admin/01/ui/FormLogin.svelte +25 -5
  36. package/dist/components/pages/login/admin/01/ui/FormLogin.svelte.d.ts +6 -1
  37. package/dist/components/pages/login/admin/01/ui/FormLoginEmailPassword.svelte +12 -0
  38. package/dist/components/pages/login/admin/01/ui/FormLoginEmailPassword.svelte.d.ts +7 -0
  39. package/dist/components/pages/login/admin/01/ui/FormLoginPhonePassword.svelte +12 -0
  40. package/dist/components/pages/login/admin/01/ui/FormLoginPhonePassword.svelte.d.ts +7 -0
  41. package/dist/components/pages/login/admin/01/ui/FormLoginUsernamePassword.svelte +12 -0
  42. package/dist/components/pages/login/admin/01/ui/FormLoginUsernamePassword.svelte.d.ts +7 -0
  43. package/dist/components/pages/login/admin/01/ui/FormRegister.svelte +28 -28
  44. package/dist/components/pages/login/admin/01/ui/LeftHero.svelte +105 -105
  45. package/dist/components/pages/login/admin/01/ui/PageLogin.svelte +47 -49
  46. package/dist/components/pages/login/admin/01/ui/PageLogin.svelte.d.ts +14 -17
  47. package/dist/components/ui/badge/badge.svelte +49 -49
  48. package/dist/components/ui/chart/chart-container.svelte +80 -80
  49. package/dist/components/ui/chart/chart-style.svelte +37 -37
  50. package/dist/components/ui/chart/chart-tooltip.svelte +184 -184
  51. package/dist/components/ui/checkbox/checkbox.svelte +40 -40
  52. package/dist/components/ui/data-table/flex-render.svelte +40 -40
  53. package/dist/components/ui/drawer/drawer-close.svelte +7 -7
  54. package/dist/components/ui/drawer/drawer-content.svelte +33 -33
  55. package/dist/components/ui/drawer/drawer-description.svelte +17 -17
  56. package/dist/components/ui/drawer/drawer-footer.svelte +20 -20
  57. package/dist/components/ui/drawer/drawer-header.svelte +20 -20
  58. package/dist/components/ui/drawer/drawer-nested.svelte +12 -12
  59. package/dist/components/ui/drawer/drawer-overlay.svelte +17 -17
  60. package/dist/components/ui/drawer/drawer-portal.svelte +7 -7
  61. package/dist/components/ui/drawer/drawer-title.svelte +17 -17
  62. package/dist/components/ui/drawer/drawer-trigger.svelte +7 -7
  63. package/dist/components/ui/drawer/drawer.svelte +12 -12
  64. package/dist/components/ui/select/select-content.svelte +45 -45
  65. package/dist/components/ui/select/select-group-heading.svelte +21 -21
  66. package/dist/components/ui/select/select-group.svelte +17 -17
  67. package/dist/components/ui/select/select-item.svelte +41 -41
  68. package/dist/components/ui/select/select-label.svelte +20 -20
  69. package/dist/components/ui/select/select-portal.svelte +7 -7
  70. package/dist/components/ui/select/select-scroll-down-button.svelte +21 -21
  71. package/dist/components/ui/select/select-scroll-up-button.svelte +21 -21
  72. package/dist/components/ui/select/select-separator.svelte +18 -18
  73. package/dist/components/ui/select/select-trigger.svelte +30 -30
  74. package/dist/components/ui/select/select.svelte +11 -11
  75. package/dist/components/ui/sidebar/sidebar-menu-sub-button.svelte +39 -39
  76. package/dist/components/ui/table/table-body.svelte +15 -15
  77. package/dist/components/ui/table/table-caption.svelte +20 -20
  78. package/dist/components/ui/table/table-cell.svelte +15 -15
  79. package/dist/components/ui/table/table-footer.svelte +20 -20
  80. package/dist/components/ui/table/table-head.svelte +15 -15
  81. package/dist/components/ui/table/table-header.svelte +20 -20
  82. package/dist/components/ui/table/table-row.svelte +15 -15
  83. package/dist/components/ui/table/table.svelte +17 -17
  84. package/dist/components/ui/tabs/tabs-content.svelte +17 -17
  85. package/dist/components/ui/tabs/tabs-list.svelte +40 -40
  86. package/dist/components/ui/tabs/tabs-trigger.svelte +23 -23
  87. package/dist/components/ui/tabs/tabs.svelte +19 -19
  88. package/dist/index.js +0 -1
  89. package/package.json +94 -88
@@ -1,49 +1,47 @@
1
- <script lang="ts">
2
- import { t } from "../../../../../../i18n";
3
- import AuthCard from "./AuthCard.svelte";
4
- import LeftHero from "./LeftHero.svelte";
5
- </script>
6
-
7
- <main class="h-screen w-screen flex items-center">
8
- <div class="hidden md:block md:w-8/12">
9
- <LeftHero
10
- title="Negodesign"
11
- varient="POINTER"
12
- items={[
13
- {
14
- buttonText: $t("label.next"),
15
- title: "ALorem Ipsum is simply dummy text of the printing and",
16
- description:
17
- "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since 1966, when designers at Letraset and James Mosley, the librarian at St Bride Printing Library in London, took a 1914 Cicero translation and scrambled",
18
- },
19
- {
20
- buttonText: $t("label.next"),
21
- title: "BLorem Ipsum is simply dummy text of the printing and",
22
- description:
23
- "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since 1966, when designers at Letraset and James Mosley, the librarian at St Bride Printing Library in London, took a 1914 Cicero translation and scrambled",
24
- },
25
- {
26
- buttonText: $t("label.next"),
27
- title: "CLorem Ipsum is simply dummy text of the printing and",
28
- description:
29
- "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since 1966, when designers at Letraset and James Mosley, the librarian at St Bride Printing Library in London, took a 1914 Cicero translation and scrambled",
30
- },
31
- ]}
32
- />
33
- </div>
34
- <div class="w-full md:px-0 md:w-4/12 border-gray-900">
35
- <AuthCard />
36
- </div>
37
- </main>
38
-
39
- <style>
40
- :global(.grid-pattern) {
41
- background-size: 40px 40px;
42
- background-image: linear-gradient(
43
- to right,
44
- rgba(0, 0, 0, 0.1) 1px,
45
- transparent 1px
46
- ),
47
- linear-gradient(to bottom, rgba(0, 0, 0, 0.1) 1px, transparent 1px);
48
- }
49
- </style>
1
+ <script lang="ts">
2
+ import type {
3
+ CarouselItem,
4
+ CarouselItemType,
5
+ } from "../../../../../core/carousel/data/CarouselModel";
6
+ import type { Snippet } from "svelte";
7
+ import AuthCard from "./AuthCard.svelte";
8
+ import LeftHero from "./LeftHero.svelte";
9
+ import type { AuthFormType, LinkProps } from "../data/page-props";
10
+
11
+ type Props = {
12
+ carousel?: CarouselItem[];
13
+ varient?: CarouselItemType;
14
+ title?: string;
15
+ children?: Snippet;
16
+ formType?: AuthFormType;
17
+ privacyPolicy?: LinkProps;
18
+ termsOfService?: LinkProps;
19
+ };
20
+
21
+ let { carousel, varient, title, formType, children, privacyPolicy, termsOfService }: Props = $props();
22
+ </script>
23
+
24
+ <main class="h-screen w-screen flex items-center">
25
+ <div class="hidden md:block md:w-8/12">
26
+ <LeftHero {title} varient={varient ?? "POINTER"} items={carousel ?? []} />
27
+ </div>
28
+ <div class="w-full md:px-0 md:w-4/12 border-gray-900">
29
+ {#if children}
30
+ {@render children()}
31
+ {:else}
32
+ <AuthCard {formType} {privacyPolicy} {termsOfService} />
33
+ {/if}
34
+ </div>
35
+ </main>
36
+
37
+ <style>
38
+ :global(.grid-pattern) {
39
+ background-size: 40px 40px;
40
+ background-image: linear-gradient(
41
+ to right,
42
+ rgba(0, 0, 0, 0.1) 1px,
43
+ transparent 1px
44
+ ),
45
+ linear-gradient(to bottom, rgba(0, 0, 0, 0.1) 1px, transparent 1px);
46
+ }
47
+ </style>
@@ -1,18 +1,15 @@
1
- interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
2
- new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
- $$bindings?: Bindings;
4
- } & Exports;
5
- (internal: unknown, props: {
6
- $$events?: Events;
7
- $$slots?: Slots;
8
- }): Exports & {
9
- $set?: any;
10
- $on?: any;
11
- };
12
- z_$$bindings?: Bindings;
13
- }
14
- declare const PageLogin: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
15
- [evt: string]: CustomEvent<any>;
16
- }, {}, {}, string>;
17
- type PageLogin = InstanceType<typeof PageLogin>;
1
+ import type { CarouselItem, CarouselItemType } from "../../../../../core/carousel/data/CarouselModel";
2
+ import type { Snippet } from "svelte";
3
+ import type { AuthFormType, LinkProps } from "../data/page-props";
4
+ type Props = {
5
+ carousel?: CarouselItem[];
6
+ varient?: CarouselItemType;
7
+ title?: string;
8
+ children?: Snippet;
9
+ formType?: AuthFormType;
10
+ privacyPolicy?: LinkProps;
11
+ termsOfService?: LinkProps;
12
+ };
13
+ declare const PageLogin: import("svelte").Component<Props, {}, "">;
14
+ type PageLogin = ReturnType<typeof PageLogin>;
18
15
  export default PageLogin;
@@ -1,49 +1,49 @@
1
- <script lang="ts" module>
2
- import { type VariantProps, tv } from "tailwind-variants";
3
-
4
- export const badgeVariants = tv({
5
- base: "h-5 gap-1 rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium transition-all has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:size-3! focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive group/badge inline-flex w-fit shrink-0 items-center justify-center overflow-hidden whitespace-nowrap transition-colors focus-visible:ring-[3px] [&>svg]:pointer-events-none",
6
- variants: {
7
- variant: {
8
- default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80",
9
- secondary: "bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",
10
- destructive: "bg-destructive/10 [a]:hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 text-destructive dark:bg-destructive/20",
11
- outline: "border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground bg-input/30",
12
- ghost: "hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",
13
- link: "text-primary underline-offset-4 hover:underline",
14
- },
15
- },
16
- defaultVariants: {
17
- variant: "default",
18
- },
19
- });
20
-
21
- export type BadgeVariant = VariantProps<typeof badgeVariants>["variant"];
22
- </script>
23
-
24
- <script lang="ts">
25
- import type { HTMLAnchorAttributes } from "svelte/elements";
26
- import { cn, type WithElementRef } from "../../../utils.js";
27
-
28
- let {
29
- ref = $bindable(null),
30
- href,
31
- class: className,
32
- variant = "default",
33
- children,
34
- ...restProps
35
- }: WithElementRef<HTMLAnchorAttributes> & {
36
- variant?: BadgeVariant;
37
- } = $props();
38
- </script>
39
-
40
- <svelte:element
41
- this={href ? "a" : "span"}
42
- bind:this={ref}
43
- data-slot="badge"
44
- {href}
45
- class={cn(badgeVariants({ variant }), className)}
46
- {...restProps}
47
- >
48
- {@render children?.()}
49
- </svelte:element>
1
+ <script lang="ts" module>
2
+ import { type VariantProps, tv } from "tailwind-variants";
3
+
4
+ export const badgeVariants = tv({
5
+ base: "h-5 gap-1 rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium transition-all has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:size-3! focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive group/badge inline-flex w-fit shrink-0 items-center justify-center overflow-hidden whitespace-nowrap transition-colors focus-visible:ring-[3px] [&>svg]:pointer-events-none",
6
+ variants: {
7
+ variant: {
8
+ default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80",
9
+ secondary: "bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",
10
+ destructive: "bg-destructive/10 [a]:hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 text-destructive dark:bg-destructive/20",
11
+ outline: "border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground bg-input/30",
12
+ ghost: "hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",
13
+ link: "text-primary underline-offset-4 hover:underline",
14
+ },
15
+ },
16
+ defaultVariants: {
17
+ variant: "default",
18
+ },
19
+ });
20
+
21
+ export type BadgeVariant = VariantProps<typeof badgeVariants>["variant"];
22
+ </script>
23
+
24
+ <script lang="ts">
25
+ import type { HTMLAnchorAttributes } from "svelte/elements";
26
+ import { cn, type WithElementRef } from "../../../utils.js";
27
+
28
+ let {
29
+ ref = $bindable(null),
30
+ href,
31
+ class: className,
32
+ variant = "default",
33
+ children,
34
+ ...restProps
35
+ }: WithElementRef<HTMLAnchorAttributes> & {
36
+ variant?: BadgeVariant;
37
+ } = $props();
38
+ </script>
39
+
40
+ <svelte:element
41
+ this={href ? "a" : "span"}
42
+ bind:this={ref}
43
+ data-slot="badge"
44
+ {href}
45
+ class={cn(badgeVariants({ variant }), className)}
46
+ {...restProps}
47
+ >
48
+ {@render children?.()}
49
+ </svelte:element>
@@ -1,80 +1,80 @@
1
- <script lang="ts">
2
- import { cn, type WithElementRef } from "../../../utils.js";
3
- import type { HTMLAttributes } from "svelte/elements";
4
- import ChartStyle from "./chart-style.svelte";
5
- import { setChartContext, type ChartConfig } from "./chart-utils.js";
6
-
7
- const uid = $props.id();
8
-
9
- let {
10
- ref = $bindable(null),
11
- id = uid,
12
- class: className,
13
- children,
14
- config,
15
- ...restProps
16
- }: WithElementRef<HTMLAttributes<HTMLElement>> & {
17
- config: ChartConfig;
18
- } = $props();
19
-
20
- const chartId = $derived(`chart-${id || uid.replace(/:/g, "")}`);
21
-
22
- setChartContext({
23
- get config() {
24
- return config;
25
- },
26
- });
27
- </script>
28
-
29
- <div
30
- bind:this={ref}
31
- data-chart={chartId}
32
- data-slot="chart"
33
- class={cn(
34
- "flex aspect-video justify-center overflow-visible text-xs",
35
- // Overrides
36
- //
37
- // Stroke around dots/marks when hovering
38
- "[&_.lc-highlight-point]:stroke-transparent",
39
- // override the default stroke color of lines
40
- "[&_.lc-line]:stroke-border/50",
41
-
42
- // by default, layerchart shows a line intersecting the point when hovering, this hides that
43
- "[&_.lc-highlight-line]:stroke-0",
44
-
45
- // by default, when you hover a point on a stacked series chart, it will drop the opacity
46
- // of the other series, this overrides that
47
- "[&_.lc-area-path]:opacity-100 [&_.lc-highlight-line]:opacity-100 [&_.lc-highlight-point]:opacity-100 [&_.lc-spline-path]:opacity-100 [&_.lc-text]:text-xs [&_.lc-text-svg]:overflow-visible",
48
-
49
- // We don't want the little tick lines between the axis labels and the chart, so we remove
50
- // the stroke. The alternative is to manually disable `tickMarks` on the x/y axis of every
51
- // chart.
52
- "[&_.lc-axis-tick]:stroke-0",
53
-
54
- // We don't want to display the rule on the x/y axis, as there is already going to be
55
- // a grid line there and rule ends up overlapping the marks because it is rendered after
56
- // the marks
57
- "[&_.lc-rule-x-line:not(.lc-grid-x-rule)]:stroke-0 [&_.lc-rule-y-line:not(.lc-grid-y-rule)]:stroke-0",
58
- "[&_.lc-grid-x-radial-line]:stroke-border [&_.lc-grid-x-radial-circle]:stroke-border",
59
- "[&_.lc-grid-y-radial-line]:stroke-border [&_.lc-grid-y-radial-circle]:stroke-border",
60
-
61
- // Legend adjustments
62
- "[&_.lc-legend-swatch-button]:items-center [&_.lc-legend-swatch-button]:gap-1.5",
63
- "[&_.lc-legend-swatch-group]:items-center [&_.lc-legend-swatch-group]:gap-4",
64
- "[&_.lc-legend-swatch]:size-2.5 [&_.lc-legend-swatch]:rounded-[2px]",
65
-
66
- // Labels
67
- "[&_.lc-labels-text:not([fill])]:fill-foreground [&_text]:stroke-transparent",
68
-
69
- // Tick labels on th x/y axes
70
- "[&_.lc-axis-tick-label]:fill-muted-foreground [&_.lc-axis-tick-label]:font-normal",
71
- "[&_.lc-tooltip-rects-g]:fill-transparent",
72
- "[&_.lc-layout-svg-g]:fill-transparent",
73
- "[&_.lc-root-container]:w-full",
74
- className
75
- )}
76
- {...restProps}
77
- >
78
- <ChartStyle id={chartId} {config} />
79
- {@render children?.()}
80
- </div>
1
+ <script lang="ts">
2
+ import { cn, type WithElementRef } from "../../../utils.js";
3
+ import type { HTMLAttributes } from "svelte/elements";
4
+ import ChartStyle from "./chart-style.svelte";
5
+ import { setChartContext, type ChartConfig } from "./chart-utils.js";
6
+
7
+ const uid = $props.id();
8
+
9
+ let {
10
+ ref = $bindable(null),
11
+ id = uid,
12
+ class: className,
13
+ children,
14
+ config,
15
+ ...restProps
16
+ }: WithElementRef<HTMLAttributes<HTMLElement>> & {
17
+ config: ChartConfig;
18
+ } = $props();
19
+
20
+ const chartId = $derived(`chart-${id || uid.replace(/:/g, "")}`);
21
+
22
+ setChartContext({
23
+ get config() {
24
+ return config;
25
+ },
26
+ });
27
+ </script>
28
+
29
+ <div
30
+ bind:this={ref}
31
+ data-chart={chartId}
32
+ data-slot="chart"
33
+ class={cn(
34
+ "flex aspect-video justify-center overflow-visible text-xs",
35
+ // Overrides
36
+ //
37
+ // Stroke around dots/marks when hovering
38
+ "[&_.lc-highlight-point]:stroke-transparent",
39
+ // override the default stroke color of lines
40
+ "[&_.lc-line]:stroke-border/50",
41
+
42
+ // by default, layerchart shows a line intersecting the point when hovering, this hides that
43
+ "[&_.lc-highlight-line]:stroke-0",
44
+
45
+ // by default, when you hover a point on a stacked series chart, it will drop the opacity
46
+ // of the other series, this overrides that
47
+ "[&_.lc-area-path]:opacity-100 [&_.lc-highlight-line]:opacity-100 [&_.lc-highlight-point]:opacity-100 [&_.lc-spline-path]:opacity-100 [&_.lc-text]:text-xs [&_.lc-text-svg]:overflow-visible",
48
+
49
+ // We don't want the little tick lines between the axis labels and the chart, so we remove
50
+ // the stroke. The alternative is to manually disable `tickMarks` on the x/y axis of every
51
+ // chart.
52
+ "[&_.lc-axis-tick]:stroke-0",
53
+
54
+ // We don't want to display the rule on the x/y axis, as there is already going to be
55
+ // a grid line there and rule ends up overlapping the marks because it is rendered after
56
+ // the marks
57
+ "[&_.lc-rule-x-line:not(.lc-grid-x-rule)]:stroke-0 [&_.lc-rule-y-line:not(.lc-grid-y-rule)]:stroke-0",
58
+ "[&_.lc-grid-x-radial-line]:stroke-border [&_.lc-grid-x-radial-circle]:stroke-border",
59
+ "[&_.lc-grid-y-radial-line]:stroke-border [&_.lc-grid-y-radial-circle]:stroke-border",
60
+
61
+ // Legend adjustments
62
+ "[&_.lc-legend-swatch-button]:items-center [&_.lc-legend-swatch-button]:gap-1.5",
63
+ "[&_.lc-legend-swatch-group]:items-center [&_.lc-legend-swatch-group]:gap-4",
64
+ "[&_.lc-legend-swatch]:size-2.5 [&_.lc-legend-swatch]:rounded-[2px]",
65
+
66
+ // Labels
67
+ "[&_.lc-labels-text:not([fill])]:fill-foreground [&_text]:stroke-transparent",
68
+
69
+ // Tick labels on th x/y axes
70
+ "[&_.lc-axis-tick-label]:fill-muted-foreground [&_.lc-axis-tick-label]:font-normal",
71
+ "[&_.lc-tooltip-rects-g]:fill-transparent",
72
+ "[&_.lc-layout-svg-g]:fill-transparent",
73
+ "[&_.lc-root-container]:w-full",
74
+ className
75
+ )}
76
+ {...restProps}
77
+ >
78
+ <ChartStyle id={chartId} {config} />
79
+ {@render children?.()}
80
+ </div>
@@ -1,37 +1,37 @@
1
- <script lang="ts">
2
- import { THEMES, type ChartConfig } from "./chart-utils.js";
3
-
4
- let { id, config }: { id: string; config: ChartConfig } = $props();
5
-
6
- const colorConfig = $derived(
7
- config ? Object.entries(config).filter(([, config]) => config.theme || config.color) : null
8
- );
9
-
10
- const themeContents = $derived.by(() => {
11
- if (!colorConfig || !colorConfig.length) return;
12
-
13
- const themeContents = [];
14
- for (const [_theme, prefix] of Object.entries(THEMES)) {
15
- let content = `${prefix} [data-chart=${id}] {\n`;
16
- const color = colorConfig.map(([key, itemConfig]) => {
17
- const theme = _theme as keyof typeof itemConfig.theme;
18
- const color = itemConfig.theme?.[theme] || itemConfig.color;
19
- return color ? `\t--color-${key}: ${color};` : null;
20
- });
21
-
22
- content += color.join("\n") + "\n}";
23
-
24
- themeContents.push(content);
25
- }
26
-
27
- return themeContents.join("\n");
28
- });
29
- </script>
30
-
31
- {#if themeContents}
32
- {#key id}
33
- <svelte:element this={"style"}>
34
- {themeContents}
35
- </svelte:element>
36
- {/key}
37
- {/if}
1
+ <script lang="ts">
2
+ import { THEMES, type ChartConfig } from "./chart-utils.js";
3
+
4
+ let { id, config }: { id: string; config: ChartConfig } = $props();
5
+
6
+ const colorConfig = $derived(
7
+ config ? Object.entries(config).filter(([, config]) => config.theme || config.color) : null
8
+ );
9
+
10
+ const themeContents = $derived.by(() => {
11
+ if (!colorConfig || !colorConfig.length) return;
12
+
13
+ const themeContents = [];
14
+ for (const [_theme, prefix] of Object.entries(THEMES)) {
15
+ let content = `${prefix} [data-chart=${id}] {\n`;
16
+ const color = colorConfig.map(([key, itemConfig]) => {
17
+ const theme = _theme as keyof typeof itemConfig.theme;
18
+ const color = itemConfig.theme?.[theme] || itemConfig.color;
19
+ return color ? `\t--color-${key}: ${color};` : null;
20
+ });
21
+
22
+ content += color.join("\n") + "\n}";
23
+
24
+ themeContents.push(content);
25
+ }
26
+
27
+ return themeContents.join("\n");
28
+ });
29
+ </script>
30
+
31
+ {#if themeContents}
32
+ {#key id}
33
+ <svelte:element this={"style"}>
34
+ {themeContents}
35
+ </svelte:element>
36
+ {/key}
37
+ {/if}