@salesforce/webapp-template-feature-react-chart-experimental 1.44.0 → 1.45.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.
Files changed (20) hide show
  1. package/dist/CHANGELOG.md +16 -0
  2. package/dist/force-app/main/default/webapplications/feature-react-chart/package-lock.json +1183 -402
  3. package/dist/force-app/main/default/webapplications/feature-react-chart/package.json +1 -3
  4. package/dist/force-app/main/default/webapplications/feature-react-chart/src/components/ui/alert.tsx +17 -13
  5. package/dist/force-app/main/default/webapplications/feature-react-chart/src/components/ui/button.tsx +35 -22
  6. package/dist/force-app/main/default/webapplications/feature-react-chart/src/components/ui/card.tsx +27 -12
  7. package/dist/force-app/main/default/webapplications/feature-react-chart/src/components/ui/dialog.tsx +143 -0
  8. package/dist/force-app/main/default/webapplications/feature-react-chart/src/components/ui/field.tsx +157 -46
  9. package/dist/force-app/main/default/webapplications/feature-react-chart/src/components/ui/index.ts +1 -0
  10. package/dist/force-app/main/default/webapplications/feature-react-chart/src/components/ui/input.tsx +3 -3
  11. package/dist/force-app/main/default/webapplications/feature-react-chart/src/components/ui/label.tsx +2 -2
  12. package/dist/force-app/main/default/webapplications/feature-react-chart/src/components/ui/pagination.tsx +87 -74
  13. package/dist/force-app/main/default/webapplications/feature-react-chart/src/components/ui/select.tsx +156 -124
  14. package/dist/force-app/main/default/webapplications/feature-react-chart/src/components/ui/separator.tsx +26 -0
  15. package/dist/force-app/main/default/webapplications/feature-react-chart/src/components/ui/skeleton.tsx +1 -0
  16. package/dist/force-app/main/default/webapplications/feature-react-chart/src/components/ui/spinner.tsx +5 -16
  17. package/dist/force-app/main/default/webapplications/feature-react-chart/src/components/ui/table.tsx +68 -95
  18. package/dist/force-app/main/default/webapplications/feature-react-chart/src/components/ui/tabs.tsx +47 -84
  19. package/dist/package.json +1 -1
  20. package/package.json +3 -3
@@ -1,114 +1,87 @@
1
1
  import * as React from "react";
2
- import { cn } from "../../lib/utils";
3
2
 
4
- /**
5
- * Shadcn-style Table components
6
- * These components follow shadcn/ui patterns for consistent styling
7
- */
3
+ import { cn } from "../../lib/utils";
8
4
 
9
- const Table = React.forwardRef<HTMLTableElement, React.HTMLAttributes<HTMLTableElement>>(
10
- ({ className, ...props }, ref) => (
11
- <div className="relative w-full overflow-auto">
12
- <table ref={ref} className={cn("w-full caption-bottom text-sm", className)} {...props} />
5
+ function Table({ className, ...props }: React.ComponentProps<"table">) {
6
+ return (
7
+ <div data-slot="table-container" className="relative w-full overflow-x-auto">
8
+ <table
9
+ data-slot="table"
10
+ className={cn("w-full caption-bottom text-sm", className)}
11
+ {...props}
12
+ />
13
13
  </div>
14
- ),
15
- );
16
- Table.displayName = "Table";
17
-
18
- const TableHeader = React.forwardRef<
19
- HTMLTableSectionElement,
20
- React.HTMLAttributes<HTMLTableSectionElement>
21
- >(({ className, ...props }, ref) => (
22
- <thead
23
- ref={ref}
24
- className={cn(
25
- // 1. Existing border style
26
- "[&_tr]:border-b",
14
+ );
15
+ }
27
16
 
28
- // 2. Make headers sticky
29
- // We apply this to the 'th' children using the [&_th] selector
30
- // This is often more robust across browsers than applying sticky to the <thead> itself
31
- "[&_th]:sticky [&_th]:top-0 [&_th]:z-10",
32
- // 3. CRITICAL: Add background color
33
- // Without this, content scrolls "under" the transparent text
34
- "[&_th]:bg-background",
17
+ function TableHeader({ className, ...props }: React.ComponentProps<"thead">) {
18
+ return <thead data-slot="table-header" className={cn("[&_tr]:border-b", className)} {...props} />;
19
+ }
35
20
 
36
- // 4. Optional: Add a subtle shadow for better visual separation when scrolling
37
- "[&_th]:shadow-[0_1px_0_0_theme(colors.border)]",
38
- className,
39
- )}
40
- {...props}
41
- />
42
- ));
43
- TableHeader.displayName = "TableHeader";
44
-
45
- const TableBody = React.forwardRef<
46
- HTMLTableSectionElement,
47
- React.HTMLAttributes<HTMLTableSectionElement>
48
- >(({ className, ...props }, ref) => (
49
- <tbody ref={ref} className={cn("[&_tr:last-child]:border-0", className)} {...props} />
50
- ));
51
- TableBody.displayName = "TableBody";
21
+ function TableBody({ className, ...props }: React.ComponentProps<"tbody">) {
22
+ return (
23
+ <tbody
24
+ data-slot="table-body"
25
+ className={cn("[&_tr:last-child]:border-0", className)}
26
+ {...props}
27
+ />
28
+ );
29
+ }
52
30
 
53
- const TableFooter = React.forwardRef<
54
- HTMLTableSectionElement,
55
- React.HTMLAttributes<HTMLTableSectionElement>
56
- >(({ className, ...props }, ref) => (
57
- <tfoot
58
- ref={ref}
59
- className={cn("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0", className)}
60
- {...props}
61
- />
62
- ));
63
- TableFooter.displayName = "TableFooter";
31
+ function TableFooter({ className, ...props }: React.ComponentProps<"tfoot">) {
32
+ return (
33
+ <tfoot
34
+ data-slot="table-footer"
35
+ className={cn("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0", className)}
36
+ {...props}
37
+ />
38
+ );
39
+ }
64
40
 
65
- const TableRow = React.forwardRef<HTMLTableRowElement, React.HTMLAttributes<HTMLTableRowElement>>(
66
- ({ className, ...props }, ref) => (
41
+ function TableRow({ className, ...props }: React.ComponentProps<"tr">) {
42
+ return (
67
43
  <tr
68
- ref={ref}
44
+ data-slot="table-row"
69
45
  className={cn(
70
- "border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",
46
+ "hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",
71
47
  className,
72
48
  )}
73
49
  {...props}
74
50
  />
75
- ),
76
- );
77
- TableRow.displayName = "TableRow";
51
+ );
52
+ }
78
53
 
79
- const TableHead = React.forwardRef<
80
- HTMLTableCellElement,
81
- React.ThHTMLAttributes<HTMLTableCellElement>
82
- >(({ className, ...props }, ref) => (
83
- <th
84
- ref={ref}
85
- className={cn(
86
- "h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",
87
- className,
88
- )}
89
- {...props}
90
- />
91
- ));
92
- TableHead.displayName = "TableHead";
54
+ function TableHead({ className, ...props }: React.ComponentProps<"th">) {
55
+ return (
56
+ <th
57
+ data-slot="table-head"
58
+ className={cn(
59
+ "text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0",
60
+ className,
61
+ )}
62
+ {...props}
63
+ />
64
+ );
65
+ }
93
66
 
94
- const TableCell = React.forwardRef<
95
- HTMLTableCellElement,
96
- React.TdHTMLAttributes<HTMLTableCellElement>
97
- >(({ className, ...props }, ref) => (
98
- <td
99
- ref={ref}
100
- className={cn("p-4 align-middle [&:has([role=checkbox])]:pr-0", className)}
101
- {...props}
102
- />
103
- ));
104
- TableCell.displayName = "TableCell";
67
+ function TableCell({ className, ...props }: React.ComponentProps<"td">) {
68
+ return (
69
+ <td
70
+ data-slot="table-cell"
71
+ className={cn("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0", className)}
72
+ {...props}
73
+ />
74
+ );
75
+ }
105
76
 
106
- const TableCaption = React.forwardRef<
107
- HTMLTableCaptionElement,
108
- React.HTMLAttributes<HTMLTableCaptionElement>
109
- >(({ className, ...props }, ref) => (
110
- <caption ref={ref} className={cn("mt-4 text-sm text-muted-foreground", className)} {...props} />
111
- ));
112
- TableCaption.displayName = "TableCaption";
77
+ function TableCaption({ className, ...props }: React.ComponentProps<"caption">) {
78
+ return (
79
+ <caption
80
+ data-slot="table-caption"
81
+ className={cn("text-muted-foreground mt-4 text-sm", className)}
82
+ {...props}
83
+ />
84
+ );
85
+ }
113
86
 
114
87
  export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption };
@@ -1,115 +1,78 @@
1
1
  import * as React from "react";
2
- import { cn } from "../../lib/utils";
3
-
4
- interface TabsContextValue {
5
- value: string;
6
- onValueChange: (value: string) => void;
7
- }
8
-
9
- const TabsContext = React.createContext<TabsContextValue | undefined>(undefined);
10
-
11
- interface TabsProps extends React.ComponentProps<"div"> {
12
- value?: string;
13
- defaultValue?: string;
14
- onValueChange?: (value: string) => void;
15
- }
16
-
17
- function Tabs({ value, defaultValue, onValueChange, className, children, ...props }: TabsProps) {
18
- const [internalValue, setInternalValue] = React.useState(defaultValue || "");
19
- const controlled = value !== undefined;
20
- const currentValue = controlled ? value : internalValue;
2
+ import { cva, type VariantProps } from "class-variance-authority";
3
+ import { Tabs as TabsPrimitive } from "radix-ui";
21
4
 
22
- const handleValueChange = React.useCallback(
23
- (newValue: string) => {
24
- if (!controlled) {
25
- setInternalValue(newValue);
26
- }
27
- onValueChange?.(newValue);
28
- },
29
- [controlled, onValueChange],
30
- );
5
+ import { cn } from "../../lib/utils";
31
6
 
7
+ function Tabs({
8
+ className,
9
+ orientation = "horizontal",
10
+ ...props
11
+ }: React.ComponentProps<typeof TabsPrimitive.Root>) {
32
12
  return (
33
- <TabsContext.Provider value={{ value: currentValue, onValueChange: handleValueChange }}>
34
- <div data-slot="tabs" className={cn("w-full", className)} {...props}>
35
- {children}
36
- </div>
37
- </TabsContext.Provider>
13
+ <TabsPrimitive.Root
14
+ data-slot="tabs"
15
+ data-orientation={orientation}
16
+ className={cn("gap-2 group/tabs flex data-horizontal:flex-col", className)}
17
+ {...props}
18
+ />
38
19
  );
39
20
  }
40
21
 
41
- function useTabsContext() {
42
- const context = React.useContext(TabsContext);
43
- if (!context) {
44
- throw new Error("Tabs components must be used within a Tabs component");
45
- }
46
- return context;
47
- }
22
+ const tabsListVariants = cva(
23
+ "rounded-lg p-[3px] group-data-horizontal/tabs:h-8 data-[variant=line]:rounded-none group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col",
24
+ {
25
+ variants: {
26
+ variant: {
27
+ default: "bg-muted",
28
+ line: "gap-1 bg-transparent",
29
+ },
30
+ },
31
+ defaultVariants: {
32
+ variant: "default",
33
+ },
34
+ },
35
+ );
48
36
 
49
- function TabsList({ className, ...props }: React.ComponentProps<"div">) {
37
+ function TabsList({
38
+ className,
39
+ variant = "default",
40
+ ...props
41
+ }: React.ComponentProps<typeof TabsPrimitive.List> & VariantProps<typeof tabsListVariants>) {
50
42
  return (
51
- <div
43
+ <TabsPrimitive.List
52
44
  data-slot="tabs-list"
53
- className={cn(
54
- "inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",
55
- className,
56
- )}
45
+ data-variant={variant}
46
+ className={cn(tabsListVariants({ variant }), className)}
57
47
  {...props}
58
48
  />
59
49
  );
60
50
  }
61
51
 
62
- interface TabsTriggerProps extends React.ComponentProps<"button"> {
63
- value: string;
64
- }
65
-
66
- function TabsTrigger({ className, value, ...props }: TabsTriggerProps) {
67
- const { value: selectedValue, onValueChange } = useTabsContext();
68
- const isSelected = selectedValue === value;
69
-
52
+ function TabsTrigger({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Trigger>) {
70
53
  return (
71
- <button
54
+ <TabsPrimitive.Trigger
72
55
  data-slot="tabs-trigger"
73
- data-selected={isSelected}
74
- type="button"
75
- role="tab"
76
- aria-selected={isSelected}
77
56
  className={cn(
78
- "inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
79
- isSelected
80
- ? "bg-background text-foreground shadow-sm"
81
- : "text-muted-foreground hover:bg-background/50",
57
+ "gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg:not([class*='size-'])]:size-4 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center whitespace-nowrap transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
58
+ "group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent",
59
+ "data-active:bg-background dark:data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 data-active:text-foreground",
60
+ "after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100",
82
61
  className,
83
62
  )}
84
- onClick={() => onValueChange(value)}
85
63
  {...props}
86
64
  />
87
65
  );
88
66
  }
89
67
 
90
- interface TabsContentProps extends React.ComponentProps<"div"> {
91
- value: string;
92
- }
93
-
94
- function TabsContent({ className, value, children, ...props }: TabsContentProps) {
95
- const { value: selectedValue } = useTabsContext();
96
- if (selectedValue !== value) {
97
- return null;
98
- }
99
-
68
+ function TabsContent({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Content>) {
100
69
  return (
101
- <div
70
+ <TabsPrimitive.Content
102
71
  data-slot="tabs-content"
103
- role="tabpanel"
104
- className={cn(
105
- "mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
106
- className,
107
- )}
72
+ className={cn("text-sm flex-1 outline-none", className)}
108
73
  {...props}
109
- >
110
- {children}
111
- </div>
74
+ />
112
75
  );
113
76
  }
114
77
 
115
- export { Tabs, TabsList, TabsTrigger, TabsContent };
78
+ export { Tabs, TabsList, TabsTrigger, TabsContent, tabsListVariants };
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/webapp-template-base-sfdx-project-experimental",
3
- "version": "1.44.0",
3
+ "version": "1.45.1",
4
4
  "description": "Base SFDX project template",
5
5
  "private": true,
6
6
  "files": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/webapp-template-feature-react-chart-experimental",
3
- "version": "1.44.0",
3
+ "version": "1.45.1",
4
4
  "description": "Chart feature with analytics chart components, agent skills, and rules (Recharts)",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "author": "",
@@ -27,7 +27,7 @@
27
27
  "clean": "rm -rf dist"
28
28
  },
29
29
  "devDependencies": {
30
- "@salesforce/webapp-experimental": "^1.44.0",
30
+ "@salesforce/webapp-experimental": "^1.45.1",
31
31
  "@types/react": "^19.2.7",
32
32
  "@types/react-dom": "^19.2.3",
33
33
  "react-dom": "^19.2.1",
@@ -51,5 +51,5 @@
51
51
  }
52
52
  }
53
53
  },
54
- "gitHead": "00f5b3b58d400b13a1b1130d11f571c2e1366cb4"
54
+ "gitHead": "091ae5ef0b936a7d51ca59a06c10ae4c301022c4"
55
55
  }