@schandlergarcia/sf-web-components 1.9.38 → 1.9.39

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 (109) hide show
  1. package/package.json +4 -1
  2. package/scripts/postinstall.mjs +36 -17
  3. package/src/components/library/cards/ActionList.jsx +38 -0
  4. package/src/components/library/cards/ActivityCard.jsx +56 -0
  5. package/src/components/library/cards/BaseCard.jsx +109 -0
  6. package/src/components/library/cards/CalloutCard.jsx +37 -0
  7. package/src/components/library/cards/ChartCard.jsx +105 -0
  8. package/src/components/library/cards/FeedPanel.jsx +39 -0
  9. package/src/components/library/cards/ListCard.jsx +193 -0
  10. package/src/components/library/cards/MetricCard.jsx +109 -0
  11. package/src/components/library/cards/MetricsStrip.jsx +78 -0
  12. package/src/components/library/cards/SectionCard.jsx +83 -0
  13. package/src/components/library/cards/SemanticMetricCard.jsx +52 -0
  14. package/src/components/library/cards/SemanticMetricCardWithLoading.jsx +23 -0
  15. package/src/components/library/cards/SemanticTableCard.jsx +48 -0
  16. package/src/components/library/cards/SemanticTableCardWithLoading.jsx +22 -0
  17. package/src/components/library/cards/StatusCard.jsx +220 -0
  18. package/src/components/library/cards/TableCard.jsx +337 -0
  19. package/src/components/library/cards/WidgetCard.jsx +90 -0
  20. package/src/components/library/charts/D3Chart.jsx +109 -0
  21. package/src/components/library/charts/D3ChartTemplates.jsx +126 -0
  22. package/src/components/library/charts/GeoMap.jsx +293 -0
  23. package/src/components/library/chat/ChatBar.jsx +256 -0
  24. package/src/components/library/chat/ChatInput.jsx +89 -0
  25. package/src/components/library/chat/ChatMessage.jsx +178 -0
  26. package/src/components/library/chat/ChatMessageList.jsx +73 -0
  27. package/src/components/library/chat/ChatPanel.jsx +97 -0
  28. package/src/components/library/chat/ChatSuggestions.jsx +28 -0
  29. package/src/components/library/chat/ChatToolCall.jsx +100 -0
  30. package/src/components/library/chat/ChatTypingIndicator.jsx +23 -0
  31. package/src/components/library/chat/ChatWelcome.jsx +43 -0
  32. package/src/components/library/chat/index.jsx +10 -0
  33. package/src/components/library/chat/useChatState.jsx +130 -0
  34. package/src/components/library/data/DataModeProvider.jsx +67 -0
  35. package/src/components/library/data/DataModeToggle.jsx +36 -0
  36. package/src/components/library/data/chartDataProvider.jsx +61 -0
  37. package/src/components/library/data/filterUtils.jsx +141 -0
  38. package/src/components/library/data/useDataSource.jsx +33 -0
  39. package/src/components/library/data/usePageFilters.jsx +99 -0
  40. package/src/components/library/filters/FilterBar.jsx +95 -0
  41. package/src/components/library/filters/SearchFilter.jsx +36 -0
  42. package/src/components/library/filters/SelectFilter.jsx +55 -0
  43. package/src/components/library/filters/ToggleFilter.jsx +52 -0
  44. package/src/components/library/filters/index.jsx +4 -0
  45. package/src/components/library/forms/FormField.jsx +291 -0
  46. package/src/components/library/forms/FormModal.jsx +201 -0
  47. package/src/components/library/forms/FormRenderer.jsx +46 -0
  48. package/src/components/library/forms/FormSection.jsx +69 -0
  49. package/src/components/library/forms/index.jsx +5 -0
  50. package/src/components/library/forms/useFormState.jsx +165 -0
  51. package/src/components/library/heroui/Accordion.jsx +26 -0
  52. package/src/components/library/heroui/Alert.jsx +8 -0
  53. package/src/components/library/heroui/Badge.jsx +8 -0
  54. package/src/components/library/heroui/Breadcrumbs.jsx +22 -0
  55. package/src/components/library/heroui/Button.jsx +58 -0
  56. package/src/components/library/heroui/Card.jsx +8 -0
  57. package/src/components/library/heroui/Collapsible.jsx +42 -0
  58. package/src/components/library/heroui/DatePicker.jsx +34 -0
  59. package/src/components/library/heroui/Dialog.jsx +37 -0
  60. package/src/components/library/heroui/Drawer.jsx +32 -0
  61. package/src/components/library/heroui/Dropdown.jsx +28 -0
  62. package/src/components/library/heroui/Field.jsx +51 -0
  63. package/src/components/library/heroui/Input.jsx +6 -0
  64. package/src/components/library/heroui/Kbd.jsx +8 -0
  65. package/src/components/library/heroui/Meter.jsx +8 -0
  66. package/src/components/library/heroui/Modal.jsx +32 -0
  67. package/src/components/library/heroui/Pagination.jsx +8 -0
  68. package/src/components/library/heroui/Popover.jsx +64 -0
  69. package/src/components/library/heroui/ProgressBar.jsx +8 -0
  70. package/src/components/library/heroui/ProgressCircle.jsx +8 -0
  71. package/src/components/library/heroui/ScrollShadow.jsx +8 -0
  72. package/src/components/library/heroui/Select.jsx +37 -0
  73. package/src/components/library/heroui/Separator.jsx +8 -0
  74. package/src/components/library/heroui/Skeleton.jsx +8 -0
  75. package/src/components/library/heroui/Tabs.jsx +26 -0
  76. package/src/components/library/heroui/Toast.jsx +25 -0
  77. package/src/components/library/heroui/Toggle.jsx +14 -0
  78. package/src/components/library/heroui/Tooltip.jsx +21 -0
  79. package/src/components/library/index.jsx +146 -0
  80. package/src/components/library/layout/PageContainer.jsx +11 -0
  81. package/src/components/library/skeletons/CardSkeleton.jsx +30 -0
  82. package/src/components/library/theme/AppThemeProvider.jsx +67 -0
  83. package/src/components/library/theme/tokens.jsx +72 -0
  84. package/src/components/library/ui/Alert.jsx +80 -0
  85. package/src/components/library/ui/Avatar.jsx +44 -0
  86. package/src/components/library/ui/BreadcrumbExtras.tsx +120 -0
  87. package/src/components/library/ui/Button.jsx +61 -0
  88. package/src/components/library/ui/Card.jsx +117 -0
  89. package/src/components/library/ui/Checkbox.jsx +17 -0
  90. package/src/components/library/ui/Chip.jsx +38 -0
  91. package/src/components/library/ui/Collapsible.tsx +31 -0
  92. package/src/components/library/ui/Container.jsx +56 -0
  93. package/src/components/library/ui/DatePicker.tsx +34 -0
  94. package/src/components/library/ui/Dialog.tsx +141 -0
  95. package/src/components/library/ui/EmptyState.jsx +46 -0
  96. package/src/components/library/ui/Field.tsx +82 -0
  97. package/src/components/library/ui/FieldGroup.jsx +17 -0
  98. package/src/components/library/ui/Input.jsx +21 -0
  99. package/src/components/library/ui/Label.jsx +22 -0
  100. package/src/components/library/ui/PaginationExtras.tsx +142 -0
  101. package/src/components/library/ui/Popover.tsx +39 -0
  102. package/src/components/library/ui/Select.tsx +113 -0
  103. package/src/components/library/ui/Spinner.d.ts +10 -0
  104. package/src/components/library/ui/Spinner.jsx +64 -0
  105. package/src/components/library/ui/Text.jsx +46 -0
  106. package/src/components/library/ui/Toggle.jsx +42 -0
  107. package/src/components/workspace/ComponentRegistry.jsx +297 -0
  108. package/src/lib/index.ts +1 -0
  109. package/src/lib/utils.ts +6 -0
@@ -0,0 +1,82 @@
1
+ import * as React from "react";
2
+
3
+ function Field({
4
+ className,
5
+ children,
6
+ ...props
7
+ }: React.ComponentProps<"div">) {
8
+ return (
9
+ <div
10
+ className={[
11
+ "flex flex-col gap-1.5",
12
+ className
13
+ ].filter(Boolean).join(" ")}
14
+ {...props}
15
+ >
16
+ {children}
17
+ </div>
18
+ );
19
+ }
20
+
21
+ function FieldLabel({
22
+ className,
23
+ htmlFor,
24
+ children,
25
+ ...props
26
+ }: React.ComponentProps<"label">) {
27
+ return (
28
+ <label
29
+ htmlFor={htmlFor}
30
+ className={[
31
+ "block text-sm font-medium text-slate-700 dark:text-slate-200",
32
+ className
33
+ ].filter(Boolean).join(" ")}
34
+ {...props}
35
+ >
36
+ {children}
37
+ </label>
38
+ );
39
+ }
40
+
41
+ function FieldDescription({
42
+ className,
43
+ children,
44
+ ...props
45
+ }: React.ComponentProps<"p">) {
46
+ return (
47
+ <p
48
+ className={[
49
+ "text-xs text-slate-500 dark:text-slate-400",
50
+ className
51
+ ].filter(Boolean).join(" ")}
52
+ {...props}
53
+ >
54
+ {children}
55
+ </p>
56
+ );
57
+ }
58
+
59
+ function FieldError({
60
+ className,
61
+ children,
62
+ ...props
63
+ }: React.ComponentProps<"p">) {
64
+ return (
65
+ <p
66
+ className={[
67
+ "text-xs text-red-600 dark:text-red-400",
68
+ className
69
+ ].filter(Boolean).join(" ")}
70
+ {...props}
71
+ >
72
+ {children}
73
+ </p>
74
+ );
75
+ }
76
+
77
+ export {
78
+ Field,
79
+ FieldLabel,
80
+ FieldDescription,
81
+ FieldError,
82
+ };
@@ -0,0 +1,17 @@
1
+ import React from "react";
2
+
3
+ export default function FieldGroup({ className = "", children, ...rest }) {
4
+ return (
5
+ <div
6
+ className={[
7
+ "flex flex-col gap-1.5",
8
+ className
9
+ ]
10
+ .filter(Boolean)
11
+ .join(" ")}
12
+ {...rest}
13
+ >
14
+ {children}
15
+ </div>
16
+ );
17
+ }
@@ -0,0 +1,21 @@
1
+ import React from "react";
2
+
3
+ export default function UIInput({ style = undefined, className = "", ...rest }) {
4
+ return (
5
+ <input
6
+ style={style}
7
+ className={[
8
+ "h-10 w-full rounded-lg border border-slate-200 bg-white px-3 text-sm text-slate-900 shadow-sm",
9
+ "placeholder:text-slate-400",
10
+ "focus:outline-none focus:ring-2 focus:ring-brand-500 focus:ring-offset-2 dark:focus:ring-offset-slate-950",
11
+ "dark:border-slate-800 dark:bg-slate-900 dark:text-slate-50 dark:placeholder:text-slate-500",
12
+ className
13
+ ]
14
+ .filter(Boolean)
15
+ .join(" ")}
16
+ {...rest}
17
+ />
18
+ );
19
+ }
20
+
21
+
@@ -0,0 +1,22 @@
1
+ import React from "react";
2
+
3
+ export default function Label({ children, htmlFor, required, className = "", ...rest }) {
4
+ // If no htmlFor provided, render as div for compatibility
5
+ const Tag = htmlFor ? 'label' : 'div';
6
+ const props = htmlFor ? { htmlFor, ...rest } : rest;
7
+
8
+ return (
9
+ <Tag
10
+ {...props}
11
+ className={[
12
+ "text-sm font-medium text-slate-700 dark:text-slate-200",
13
+ className
14
+ ]
15
+ .filter(Boolean)
16
+ .join(" ")}
17
+ >
18
+ {children}
19
+ {required && <span className="ml-0.5 text-red-500">*</span>}
20
+ </Tag>
21
+ );
22
+ }
@@ -0,0 +1,142 @@
1
+ import * as React from "react";
2
+ import { Link } from "react-router-dom";
3
+
4
+ // Shadcn-style Pagination subcomponents
5
+
6
+ function PaginationContent({ className, children, ...props }: React.ComponentProps<"ul">) {
7
+ return (
8
+ <ul
9
+ className={[
10
+ "flex flex-row items-center gap-1",
11
+ className
12
+ ].filter(Boolean).join(" ")}
13
+ {...props}
14
+ >
15
+ {children}
16
+ </ul>
17
+ );
18
+ }
19
+
20
+ function PaginationItem({ className, children, ...props }: React.ComponentProps<"li">) {
21
+ return (
22
+ <li
23
+ className={className}
24
+ {...props}
25
+ >
26
+ {children}
27
+ </li>
28
+ );
29
+ }
30
+
31
+ function PaginationLink({
32
+ className,
33
+ isActive,
34
+ size = "default",
35
+ ...props
36
+ }: React.ComponentProps<typeof Link> & {
37
+ isActive?: boolean;
38
+ size?: "default" | "sm" | "lg";
39
+ }) {
40
+ const sizeClasses = {
41
+ default: "h-9 min-w-9 px-4 py-2",
42
+ sm: "h-8 min-w-8 px-3 py-1.5 text-sm",
43
+ lg: "h-11 min-w-11 px-8 py-3"
44
+ };
45
+
46
+ return (
47
+ <Link
48
+ aria-current={isActive ? "page" : undefined}
49
+ className={[
50
+ "inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors",
51
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-500",
52
+ "disabled:pointer-events-none disabled:opacity-50",
53
+ isActive
54
+ ? "bg-slate-900 text-white dark:bg-slate-50 dark:text-slate-900"
55
+ : "hover:bg-slate-100 dark:hover:bg-slate-800",
56
+ sizeClasses[size],
57
+ className
58
+ ].filter(Boolean).join(" ")}
59
+ {...props}
60
+ />
61
+ );
62
+ }
63
+
64
+ function PaginationPrevious({
65
+ className,
66
+ ...props
67
+ }: React.ComponentProps<typeof PaginationLink>) {
68
+ return (
69
+ <PaginationLink
70
+ aria-label="Go to previous page"
71
+ size="default"
72
+ className={[
73
+ "gap-1 pl-2.5",
74
+ className
75
+ ].filter(Boolean).join(" ")}
76
+ {...props}
77
+ >
78
+ <svg width="15" height="15" viewBox="0 0 15 15" fill="none">
79
+ <path
80
+ d="M8.84182 3.13514C9.04327 3.32401 9.05348 3.64042 8.86462 3.84188L5.43521 7.49991L8.86462 11.1579C9.05348 11.3594 9.04327 11.6758 8.84182 11.8647C8.64036 12.0535 8.32394 12.0433 8.13508 11.8419L4.38508 7.84188C4.20477 7.64955 4.20477 7.35027 4.38508 7.15794L8.13508 3.15794C8.32394 2.95648 8.64036 2.94628 8.84182 3.13514Z"
81
+ fill="currentColor"
82
+ />
83
+ </svg>
84
+ <span>Previous</span>
85
+ </PaginationLink>
86
+ );
87
+ }
88
+
89
+ function PaginationNext({
90
+ className,
91
+ ...props
92
+ }: React.ComponentProps<typeof PaginationLink>) {
93
+ return (
94
+ <PaginationLink
95
+ aria-label="Go to next page"
96
+ size="default"
97
+ className={[
98
+ "gap-1 pr-2.5",
99
+ className
100
+ ].filter(Boolean).join(" ")}
101
+ {...props}
102
+ >
103
+ <span>Next</span>
104
+ <svg width="15" height="15" viewBox="0 0 15 15" fill="none">
105
+ <path
106
+ d="M6.1584 3.13514C6.35985 2.94628 6.67627 2.95648 6.86513 3.15794L10.6151 7.15794C10.7954 7.35027 10.7954 7.64955 10.6151 7.84188L6.86513 11.8419C6.67627 12.0433 6.35985 12.0535 6.1584 11.8647C5.95694 11.6758 5.94673 11.3594 6.13559 11.1579L9.565 7.49991L6.13559 3.84188C5.94673 3.64042 5.95694 3.32401 6.1584 3.13514Z"
107
+ fill="currentColor"
108
+ />
109
+ </svg>
110
+ </PaginationLink>
111
+ );
112
+ }
113
+
114
+ function PaginationEllipsis({ className, ...props }: React.ComponentProps<"span">) {
115
+ return (
116
+ <span
117
+ aria-hidden
118
+ className={[
119
+ "flex h-9 w-9 items-center justify-center",
120
+ className
121
+ ].filter(Boolean).join(" ")}
122
+ {...props}
123
+ >
124
+ <svg width="15" height="15" viewBox="0 0 15 15" fill="none">
125
+ <path
126
+ d="M3.625 7.5C3.625 8.12132 3.12132 8.625 2.5 8.625C1.87868 8.625 1.375 8.12132 1.375 7.5C1.375 6.87868 1.87868 6.375 2.5 6.375C3.12132 6.375 3.625 6.87868 3.625 7.5ZM8.625 7.5C8.625 8.12132 8.12132 8.625 7.5 8.625C6.87868 8.625 6.375 8.12132 6.375 7.5C6.375 6.87868 6.87868 6.375 7.5 6.375C8.12132 6.375 8.625 6.87868 8.625 7.5ZM12.5 8.625C13.1213 8.625 13.625 8.12132 13.625 7.5C13.625 6.87868 13.1213 6.375 12.5 6.375C11.8787 6.375 11.375 6.87868 11.375 7.5C11.375 8.12132 11.8787 8.625 12.5 8.625Z"
127
+ fill="currentColor"
128
+ />
129
+ </svg>
130
+ <span className="sr-only">More pages</span>
131
+ </span>
132
+ );
133
+ }
134
+
135
+ export {
136
+ PaginationContent,
137
+ PaginationItem,
138
+ PaginationLink,
139
+ PaginationPrevious,
140
+ PaginationNext,
141
+ PaginationEllipsis,
142
+ };
@@ -0,0 +1,39 @@
1
+ import * as React from "react";
2
+ import { Popover as PopoverPrimitive } from "radix-ui";
3
+
4
+ function Popover({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Root>) {
5
+ return <PopoverPrimitive.Root {...props} />;
6
+ }
7
+
8
+ function PopoverTrigger({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {
9
+ return <PopoverPrimitive.Trigger {...props} />;
10
+ }
11
+
12
+ function PopoverContent({
13
+ className,
14
+ align = "center",
15
+ sideOffset = 4,
16
+ ...props
17
+ }: React.ComponentProps<typeof PopoverPrimitive.Content>) {
18
+ return (
19
+ <PopoverPrimitive.Portal>
20
+ <PopoverPrimitive.Content
21
+ align={align}
22
+ sideOffset={sideOffset}
23
+ className={[
24
+ "z-50 w-72 rounded-md border border-slate-200 bg-white p-4 text-slate-900 shadow-md outline-none",
25
+ "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
26
+ "dark:border-slate-800 dark:bg-slate-900 dark:text-slate-50",
27
+ className
28
+ ].filter(Boolean).join(" ")}
29
+ {...props}
30
+ />
31
+ </PopoverPrimitive.Portal>
32
+ );
33
+ }
34
+
35
+ export {
36
+ Popover,
37
+ PopoverTrigger,
38
+ PopoverContent,
39
+ };
@@ -0,0 +1,113 @@
1
+ import * as React from "react";
2
+ import { Select as SelectPrimitive } from "radix-ui";
3
+
4
+ function Select({ ...props }: React.ComponentProps<typeof SelectPrimitive.Root>) {
5
+ return <SelectPrimitive.Root {...props} />;
6
+ }
7
+
8
+ function SelectTrigger({
9
+ className,
10
+ children,
11
+ ...props
12
+ }: React.ComponentProps<typeof SelectPrimitive.Trigger>) {
13
+ return (
14
+ <SelectPrimitive.Trigger
15
+ className={[
16
+ "flex h-10 w-full items-center justify-between rounded-lg border border-slate-200 bg-white px-3 py-2",
17
+ "text-sm text-slate-900 placeholder:text-slate-400",
18
+ "focus:outline-none focus:ring-2 focus:ring-brand-500 focus:ring-offset-2",
19
+ "disabled:cursor-not-allowed disabled:opacity-50",
20
+ "dark:border-slate-800 dark:bg-slate-900 dark:text-slate-50 dark:focus:ring-offset-slate-950",
21
+ className
22
+ ].filter(Boolean).join(" ")}
23
+ {...props}
24
+ >
25
+ {children}
26
+ <SelectPrimitive.Icon asChild>
27
+ <svg width="15" height="15" viewBox="0 0 15 15" fill="none">
28
+ <path
29
+ d="M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.26618 11.9026 7.38064 11.95 7.49999 11.95C7.61933 11.95 7.73379 11.9026 7.81819 11.8182L10.0682 9.56819Z"
30
+ fill="currentColor"
31
+ />
32
+ </svg>
33
+ </SelectPrimitive.Icon>
34
+ </SelectPrimitive.Trigger>
35
+ );
36
+ }
37
+
38
+ function SelectValue({ ...props }: React.ComponentProps<typeof SelectPrimitive.Value>) {
39
+ return <SelectPrimitive.Value {...props} />;
40
+ }
41
+
42
+ function SelectContent({
43
+ className,
44
+ children,
45
+ position = "popper",
46
+ ...props
47
+ }: React.ComponentProps<typeof SelectPrimitive.Content>) {
48
+ return (
49
+ <SelectPrimitive.Portal>
50
+ <SelectPrimitive.Content
51
+ className={[
52
+ "relative z-50 min-w-[8rem] overflow-hidden rounded-md border border-slate-200 bg-white text-slate-900 shadow-md",
53
+ "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
54
+ "dark:border-slate-800 dark:bg-slate-900 dark:text-slate-50",
55
+ position === "popper" &&
56
+ "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
57
+ className
58
+ ].filter(Boolean).join(" ")}
59
+ position={position}
60
+ {...props}
61
+ >
62
+ <SelectPrimitive.Viewport
63
+ className={[
64
+ "p-1",
65
+ position === "popper" &&
66
+ "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
67
+ ].filter(Boolean).join(" ")}
68
+ >
69
+ {children}
70
+ </SelectPrimitive.Viewport>
71
+ </SelectPrimitive.Content>
72
+ </SelectPrimitive.Portal>
73
+ );
74
+ }
75
+
76
+ function SelectItem({
77
+ className,
78
+ children,
79
+ ...props
80
+ }: React.ComponentProps<typeof SelectPrimitive.Item>) {
81
+ return (
82
+ <SelectPrimitive.Item
83
+ className={[
84
+ "relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none",
85
+ "focus:bg-slate-100 focus:text-slate-900",
86
+ "data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
87
+ "dark:focus:bg-slate-800 dark:focus:text-slate-50",
88
+ className
89
+ ].filter(Boolean).join(" ")}
90
+ {...props}
91
+ >
92
+ <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
93
+ <SelectPrimitive.ItemIndicator>
94
+ <svg width="15" height="15" viewBox="0 0 15 15" fill="none">
95
+ <path
96
+ d="M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z"
97
+ fill="currentColor"
98
+ />
99
+ </svg>
100
+ </SelectPrimitive.ItemIndicator>
101
+ </span>
102
+ <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
103
+ </SelectPrimitive.Item>
104
+ );
105
+ }
106
+
107
+ export {
108
+ Select,
109
+ SelectTrigger,
110
+ SelectValue,
111
+ SelectContent,
112
+ SelectItem,
113
+ };
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+
3
+ interface SpinnerProps extends React.SVGAttributes<SVGSVGElement> {
4
+ size?: "xs" | "sm" | "md" | "lg" | "xl";
5
+ tone?: "brand" | "white" | "muted" | "current";
6
+ label?: string;
7
+ className?: string;
8
+ }
9
+
10
+ export default function Spinner(props: SpinnerProps): React.JSX.Element;
@@ -0,0 +1,64 @@
1
+ import React from "react";
2
+
3
+ const SIZE_CLASSES = {
4
+ xs: "h-3 w-3",
5
+ sm: "h-4 w-4",
6
+ md: "h-5 w-5",
7
+ lg: "h-6 w-6",
8
+ xl: "h-8 w-8",
9
+ };
10
+
11
+ const TONE_CLASSES = {
12
+ brand: "text-brand-500",
13
+ white: "text-white",
14
+ muted: "text-slate-400 dark:text-slate-500",
15
+ current: "text-current",
16
+ };
17
+
18
+ /**
19
+ * Animated spinner.
20
+ *
21
+ * @param {"xs"|"sm"|"md"|"lg"|"xl"} size
22
+ * @param {"brand"|"white"|"muted"|"current"} tone
23
+ * @param {string} label — screen-reader label
24
+ */
25
+ export default function Spinner({
26
+ size = "md",
27
+ tone = "brand",
28
+ label = "Loading",
29
+ className = "",
30
+ ...rest
31
+ }) {
32
+ return (
33
+ <svg
34
+ {...rest}
35
+ className={[
36
+ "animate-spin",
37
+ SIZE_CLASSES[size] ?? SIZE_CLASSES.md,
38
+ TONE_CLASSES[tone] ?? TONE_CLASSES.brand,
39
+ className,
40
+ ]
41
+ .filter(Boolean)
42
+ .join(" ")}
43
+ xmlns="http://www.w3.org/2000/svg"
44
+ fill="none"
45
+ viewBox="0 0 24 24"
46
+ role="status"
47
+ aria-label={label}
48
+ >
49
+ <circle
50
+ className="opacity-25"
51
+ cx="12"
52
+ cy="12"
53
+ r="10"
54
+ stroke="currentColor"
55
+ strokeWidth="4"
56
+ />
57
+ <path
58
+ className="opacity-75"
59
+ fill="currentColor"
60
+ d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
61
+ />
62
+ </svg>
63
+ );
64
+ }
@@ -0,0 +1,46 @@
1
+ import React from "react";
2
+
3
+ const SIZE_CLASSES = {
4
+ xs: "text-xs",
5
+ sm: "text-sm",
6
+ md: "text-base",
7
+ lg: "text-lg",
8
+ xl: "text-xl",
9
+ xxl: "text-2xl"
10
+ };
11
+
12
+ const WEIGHT_CLASSES = {
13
+ regular: "font-normal",
14
+ medium: "font-medium",
15
+ bold: "font-semibold"
16
+ };
17
+
18
+ export default function UIText({
19
+ as: Comp = "span",
20
+ size = "md",
21
+ weight = "regular",
22
+ muted = false,
23
+ style,
24
+ className = "",
25
+ children,
26
+ ...rest
27
+ }) {
28
+ return (
29
+ <Comp
30
+ style={style}
31
+ className={[
32
+ SIZE_CLASSES[size] ?? SIZE_CLASSES.md,
33
+ WEIGHT_CLASSES[weight] ?? WEIGHT_CLASSES.regular,
34
+ muted ? "text-slate-600 dark:text-slate-300" : "text-slate-900 dark:text-slate-50",
35
+ className
36
+ ]
37
+ .filter(Boolean)
38
+ .join(" ")}
39
+ {...rest}
40
+ >
41
+ {children}
42
+ </Comp>
43
+ );
44
+ }
45
+
46
+
@@ -0,0 +1,42 @@
1
+ import React from "react";
2
+ import { useThemeMode } from "../theme/AppThemeProvider";
3
+
4
+ export default function UIToggle({ label = "Dark mode", style, className = "" }) {
5
+ const { mode, toggle } = useThemeMode();
6
+ const isDark = mode === "dark";
7
+
8
+ return (
9
+ <button
10
+ type="button"
11
+ onClick={toggle}
12
+ style={style}
13
+ className={[
14
+ "inline-flex items-center gap-2 rounded-lg border border-slate-200 bg-white px-3 py-2 text-sm font-medium text-slate-900 shadow-sm",
15
+ "hover:bg-slate-50 focus:outline-none focus-visible:ring-2 focus-visible:ring-brand-500 focus-visible:ring-offset-2 dark:focus-visible:ring-offset-slate-950",
16
+ "dark:border-slate-800 dark:bg-slate-900 dark:text-slate-50 dark:hover:bg-slate-800",
17
+ className
18
+ ]
19
+ .filter(Boolean)
20
+ .join(" ")}
21
+ aria-pressed={isDark}
22
+ aria-label={label}
23
+ >
24
+ <span
25
+ className={[
26
+ "inline-flex h-5 w-9 items-center rounded-full border transition",
27
+ isDark ? "border-brand-400 bg-brand-500" : "border-slate-300 bg-slate-200"
28
+ ].join(" ")}
29
+ >
30
+ <span
31
+ className={[
32
+ "h-4 w-4 rounded-full bg-white shadow-sm transition",
33
+ isDark ? "translate-x-4" : "translate-x-1"
34
+ ].join(" ")}
35
+ />
36
+ </span>
37
+ <span className="hidden sm:inline">{label}</span>
38
+ </button>
39
+ );
40
+ }
41
+
42
+