@still-void/ui 3.1.0 → 3.2.0

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.
@@ -11,18 +11,21 @@ function cn(...inputs) {
11
11
  // src/components/ui/icon-set.ts
12
12
  import {
13
13
  Bars3Icon,
14
+ CameraIcon,
14
15
  CheckCircleIcon,
15
16
  CheckIcon,
16
17
  ChevronDownIcon,
17
18
  ChevronLeftIcon,
18
19
  ChevronRightIcon,
19
20
  ChevronUpIcon,
21
+ ClockIcon,
20
22
  DocumentDuplicateIcon,
21
23
  ExclamationCircleIcon,
22
24
  ExclamationTriangleIcon,
23
25
  InformationCircleIcon,
24
26
  MagnifyingGlassIcon,
25
27
  MoonIcon,
28
+ NoSymbolIcon,
26
29
  SunIcon,
27
30
  XMarkIcon
28
31
  } from "@heroicons/react/24/outline";
@@ -41,7 +44,10 @@ var ICON_GLYPHS = {
41
44
  sun: SunIcon,
42
45
  moon: MoonIcon,
43
46
  search: MagnifyingGlassIcon,
44
- menu: Bars3Icon
47
+ menu: Bars3Icon,
48
+ camera: CameraIcon,
49
+ blocked: NoSymbolIcon,
50
+ pending: ClockIcon
45
51
  };
46
52
  var ICON_NAMES = Object.keys(ICON_GLYPHS);
47
53
  var ICON_FALLBACK_NAME = "alert-circle";
@@ -762,12 +768,239 @@ var Checkbox = React11.forwardRef(
762
768
  );
763
769
  Checkbox.displayName = "Checkbox";
764
770
 
765
- // src/components/ui/radio-group.tsx
771
+ // src/components/ui/separator.tsx
766
772
  import * as React12 from "react";
767
- import { jsx as jsx15, jsxs as jsxs4 } from "react/jsx-runtime";
768
- var RadioGroupItem = React12.forwardRef(
769
- ({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs4("label", { className: fieldClasses.choice, children: [
770
- /* @__PURE__ */ jsx15(
773
+ import { jsx as jsx15 } from "react/jsx-runtime";
774
+ var Separator = React12.forwardRef(
775
+ ({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */ jsx15(
776
+ "div",
777
+ {
778
+ ...props,
779
+ ref,
780
+ role: decorative ? void 0 : "separator",
781
+ "aria-orientation": !decorative && orientation === "vertical" ? "vertical" : void 0,
782
+ className: cn(
783
+ "sv-separator",
784
+ orientation === "vertical" && "sv-separator--vertical",
785
+ className
786
+ )
787
+ }
788
+ )
789
+ );
790
+ Separator.displayName = "Separator";
791
+
792
+ // src/components/ui/progress.tsx
793
+ import * as React13 from "react";
794
+ import { jsx as jsx16 } from "react/jsx-runtime";
795
+ function clamp(value, max) {
796
+ return Math.min(Math.max(value, 0), max);
797
+ }
798
+ function normalizeMax(max) {
799
+ return Number.isFinite(max) && max > 0 ? max : 0;
800
+ }
801
+ var Progress = React13.forwardRef(
802
+ ({ className, value = 0, max = 100, ...props }, ref) => {
803
+ const safeMax = normalizeMax(max);
804
+ const clamped = clamp(value, safeMax);
805
+ const percent = safeMax === 0 ? 0 : clamped / safeMax * 100;
806
+ return /* @__PURE__ */ jsx16(
807
+ "div",
808
+ {
809
+ ...props,
810
+ ref,
811
+ role: "progressbar",
812
+ "aria-valuenow": clamped,
813
+ "aria-valuemin": 0,
814
+ "aria-valuemax": safeMax,
815
+ className: cn("sv-progress", className),
816
+ children: /* @__PURE__ */ jsx16("div", { className: "sv-progress__indicator", style: { width: `${percent}%` } })
817
+ }
818
+ );
819
+ }
820
+ );
821
+ Progress.displayName = "Progress";
822
+
823
+ // src/components/ui/pagination.tsx
824
+ import * as React14 from "react";
825
+ import { jsx as jsx17, jsxs as jsxs4 } from "react/jsx-runtime";
826
+ var Pagination = ({ className, ...props }) => /* @__PURE__ */ jsx17("nav", { ...props, "aria-label": "pagination", className: cn("sv-pagination", className) });
827
+ Pagination.displayName = "Pagination";
828
+ var PaginationContent = React14.forwardRef(
829
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx17("ul", { ref, className: cn("sv-pagination__content", className), ...props })
830
+ );
831
+ PaginationContent.displayName = "PaginationContent";
832
+ var PaginationItem = React14.forwardRef(
833
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx17("li", { ref, className: cn("sv-pagination__item", className), ...props })
834
+ );
835
+ PaginationItem.displayName = "PaginationItem";
836
+ var PaginationLink = React14.forwardRef(
837
+ ({ className, isActive = false, href, ...props }, ref) => {
838
+ const sharedClassName = cn(
839
+ "sv-pagination__link",
840
+ isActive && "sv-pagination__link--active",
841
+ className
842
+ );
843
+ const sharedAria = isActive ? { "aria-current": "page" } : {};
844
+ if (href !== void 0) {
845
+ return /* @__PURE__ */ jsx17(
846
+ "a",
847
+ {
848
+ ref,
849
+ href,
850
+ className: sharedClassName,
851
+ ...sharedAria,
852
+ ...props
853
+ }
854
+ );
855
+ }
856
+ return /* @__PURE__ */ jsx17(
857
+ "button",
858
+ {
859
+ ref,
860
+ type: "button",
861
+ className: sharedClassName,
862
+ ...sharedAria,
863
+ ...props
864
+ }
865
+ );
866
+ }
867
+ );
868
+ PaginationLink.displayName = "PaginationLink";
869
+ var PaginationPrevious = React14.forwardRef(({ className, label = "Previous", ...props }, ref) => /* @__PURE__ */ jsxs4(
870
+ PaginationLink,
871
+ {
872
+ ref,
873
+ "aria-label": label,
874
+ className: cn("sv-pagination__link--previous", className),
875
+ ...props,
876
+ children: [
877
+ /* @__PURE__ */ jsx17(Icon, { name: "chevron-left" }),
878
+ /* @__PURE__ */ jsx17("span", { children: label })
879
+ ]
880
+ }
881
+ ));
882
+ PaginationPrevious.displayName = "PaginationPrevious";
883
+ var PaginationNext = React14.forwardRef(
884
+ ({ className, label = "Next", ...props }, ref) => /* @__PURE__ */ jsxs4(
885
+ PaginationLink,
886
+ {
887
+ ref,
888
+ "aria-label": label,
889
+ className: cn("sv-pagination__link--next", className),
890
+ ...props,
891
+ children: [
892
+ /* @__PURE__ */ jsx17("span", { children: label }),
893
+ /* @__PURE__ */ jsx17(Icon, { name: "chevron-right" })
894
+ ]
895
+ }
896
+ )
897
+ );
898
+ PaginationNext.displayName = "PaginationNext";
899
+ var PaginationEllipsis = ({ className, ...props }) => /* @__PURE__ */ jsx17("span", { "aria-hidden": "true", className: cn("sv-pagination__ellipsis", className), ...props, children: "\u2026" });
900
+ PaginationEllipsis.displayName = "PaginationEllipsis";
901
+
902
+ // src/components/ui/chart.tsx
903
+ import * as React15 from "react";
904
+ import { Fragment as Fragment3, jsx as jsx18, jsxs as jsxs5 } from "react/jsx-runtime";
905
+ var ChartContainer = React15.forwardRef(
906
+ ({ width, height, className, children, ...props }, ref) => /* @__PURE__ */ jsx18(
907
+ "svg",
908
+ {
909
+ ref,
910
+ role: "img",
911
+ viewBox: `0 0 ${width} ${height}`,
912
+ width,
913
+ height,
914
+ className: cn("sv-chart", className),
915
+ ...props,
916
+ children
917
+ }
918
+ )
919
+ );
920
+ ChartContainer.displayName = "ChartContainer";
921
+ var ChartGrid = ({ orientation, positions, width, className }) => /* @__PURE__ */ jsx18(Fragment3, { children: positions.map(
922
+ (position) => orientation === "horizontal" ? /* @__PURE__ */ jsx18(
923
+ "line",
924
+ {
925
+ x1: 0,
926
+ y1: position,
927
+ x2: width,
928
+ y2: position,
929
+ className: cn("sv-chart__grid-line", className)
930
+ },
931
+ position
932
+ ) : /* @__PURE__ */ jsx18(
933
+ "line",
934
+ {
935
+ x1: position,
936
+ y1: 0,
937
+ x2: position,
938
+ y2: width,
939
+ className: cn("sv-chart__grid-line", className)
940
+ },
941
+ position
942
+ )
943
+ ) });
944
+ ChartGrid.displayName = "ChartGrid";
945
+ var ChartAxis = ({ orientation, ticks, length, className }) => /* @__PURE__ */ jsxs5(Fragment3, { children: [
946
+ orientation === "bottom" ? /* @__PURE__ */ jsx18("line", { x1: 0, y1: 0, x2: length, y2: 0, className: cn("sv-chart__axis", className) }) : /* @__PURE__ */ jsx18("line", { x1: 0, y1: 0, x2: 0, y2: length, className: cn("sv-chart__axis", className) }),
947
+ ticks.map(
948
+ (tick) => orientation === "bottom" ? /* @__PURE__ */ jsx18(
949
+ "text",
950
+ {
951
+ x: tick.position,
952
+ y: 16,
953
+ textAnchor: "middle",
954
+ className: "sv-chart__axis-label",
955
+ children: tick.label
956
+ },
957
+ tick.position
958
+ ) : /* @__PURE__ */ jsx18(
959
+ "text",
960
+ {
961
+ x: -8,
962
+ y: tick.position,
963
+ textAnchor: "end",
964
+ dominantBaseline: "middle",
965
+ className: "sv-chart__axis-label",
966
+ children: tick.label
967
+ },
968
+ tick.position
969
+ )
970
+ )
971
+ ] });
972
+ ChartAxis.displayName = "ChartAxis";
973
+ var ChartLine = ({ points, color, className }) => /* @__PURE__ */ jsx18(
974
+ "polyline",
975
+ {
976
+ points: points.map(({ x, y }) => `${x},${y}`).join(" "),
977
+ fill: "none",
978
+ stroke: color,
979
+ strokeWidth: 2,
980
+ className: cn("sv-chart__line", className)
981
+ }
982
+ );
983
+ ChartLine.displayName = "ChartLine";
984
+ var ChartBar = ({ bars, color, className }) => /* @__PURE__ */ jsx18(Fragment3, { children: bars.map((bar) => /* @__PURE__ */ jsx18(
985
+ "rect",
986
+ {
987
+ x: bar.x,
988
+ y: bar.y,
989
+ width: bar.width,
990
+ height: bar.height,
991
+ fill: color,
992
+ className: cn("sv-chart__bar", className)
993
+ },
994
+ `${bar.x},${bar.y}`
995
+ )) });
996
+ ChartBar.displayName = "ChartBar";
997
+
998
+ // src/components/ui/radio-group.tsx
999
+ import * as React16 from "react";
1000
+ import { jsx as jsx19, jsxs as jsxs6 } from "react/jsx-runtime";
1001
+ var RadioGroupItem = React16.forwardRef(
1002
+ ({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs6("label", { className: fieldClasses.choice, children: [
1003
+ /* @__PURE__ */ jsx19(
771
1004
  "input",
772
1005
  {
773
1006
  className: cn("sv-radio", className),
@@ -780,19 +1013,19 @@ var RadioGroupItem = React12.forwardRef(
780
1013
  ] })
781
1014
  );
782
1015
  RadioGroupItem.displayName = "RadioGroupItem";
783
- var RadioGroup = React12.forwardRef(
1016
+ var RadioGroup = React16.forwardRef(
784
1017
  ({ className, legend, legendHidden, orientation = "vertical", name, children, ...props }, ref) => {
785
- const items = React12.Children.map(children, (child) => {
786
- if (!React12.isValidElement(child) || child.type !== RadioGroupItem) {
1018
+ const items = React16.Children.map(children, (child) => {
1019
+ if (!React16.isValidElement(child) || child.type !== RadioGroupItem) {
787
1020
  return child;
788
1021
  }
789
1022
  const itemProps = child.props;
790
1023
  if (itemProps.name !== void 0) {
791
1024
  return child;
792
1025
  }
793
- return React12.cloneElement(child, { name });
1026
+ return React16.cloneElement(child, { name });
794
1027
  });
795
- return /* @__PURE__ */ jsxs4(
1028
+ return /* @__PURE__ */ jsxs6(
796
1029
  "fieldset",
797
1030
  {
798
1031
  className: cn(
@@ -803,7 +1036,7 @@ var RadioGroup = React12.forwardRef(
803
1036
  ref,
804
1037
  ...props,
805
1038
  children: [
806
- legend !== void 0 && /* @__PURE__ */ jsx15("legend", { className: cn("sv-radio-group__legend", legendHidden && fieldClasses.srOnly), children: legend }),
1039
+ legend !== void 0 && /* @__PURE__ */ jsx19("legend", { className: cn("sv-radio-group__legend", legendHidden && fieldClasses.srOnly), children: legend }),
807
1040
  items
808
1041
  ]
809
1042
  }
@@ -813,7 +1046,7 @@ var RadioGroup = React12.forwardRef(
813
1046
  RadioGroup.displayName = "RadioGroup";
814
1047
 
815
1048
  // src/components/ui/table.tsx
816
- import * as React13 from "react";
1049
+ import * as React17 from "react";
817
1050
 
818
1051
  // src/recipes/table.ts
819
1052
  function table() {
@@ -831,37 +1064,37 @@ var tableClasses = {
831
1064
  };
832
1065
 
833
1066
  // src/components/ui/table.tsx
834
- import { jsx as jsx16 } from "react/jsx-runtime";
835
- var Table = React13.forwardRef(
836
- ({ className, containerClassName, ...props }, ref) => /* @__PURE__ */ jsx16("div", { className: cn(tableClasses.container, containerClassName), children: /* @__PURE__ */ jsx16("table", { className: cn(table(), className), ref, ...props }) })
1067
+ import { jsx as jsx20 } from "react/jsx-runtime";
1068
+ var Table = React17.forwardRef(
1069
+ ({ className, containerClassName, ...props }, ref) => /* @__PURE__ */ jsx20("div", { className: cn(tableClasses.container, containerClassName), children: /* @__PURE__ */ jsx20("table", { className: cn(table(), className), ref, ...props }) })
837
1070
  );
838
1071
  Table.displayName = "Table";
839
- var TableHeader = React13.forwardRef(
840
- ({ className, ...props }, ref) => /* @__PURE__ */ jsx16("thead", { className: cn(tableClasses.head, className), ref, ...props })
1072
+ var TableHeader = React17.forwardRef(
1073
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx20("thead", { className: cn(tableClasses.head, className), ref, ...props })
841
1074
  );
842
1075
  TableHeader.displayName = "TableHeader";
843
- var TableBody = React13.forwardRef(
844
- ({ className, ...props }, ref) => /* @__PURE__ */ jsx16("tbody", { className: cn(tableClasses.body, className), ref, ...props })
1076
+ var TableBody = React17.forwardRef(
1077
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx20("tbody", { className: cn(tableClasses.body, className), ref, ...props })
845
1078
  );
846
1079
  TableBody.displayName = "TableBody";
847
- var TableFooter = React13.forwardRef(
848
- ({ className, ...props }, ref) => /* @__PURE__ */ jsx16("tfoot", { className: cn(tableClasses.foot, className), ref, ...props })
1080
+ var TableFooter = React17.forwardRef(
1081
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx20("tfoot", { className: cn(tableClasses.foot, className), ref, ...props })
849
1082
  );
850
1083
  TableFooter.displayName = "TableFooter";
851
- var TableRow = React13.forwardRef(
852
- ({ className, ...props }, ref) => /* @__PURE__ */ jsx16("tr", { className: cn(tableClasses.row, className), ref, ...props })
1084
+ var TableRow = React17.forwardRef(
1085
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx20("tr", { className: cn(tableClasses.row, className), ref, ...props })
853
1086
  );
854
1087
  TableRow.displayName = "TableRow";
855
- var TableHead = React13.forwardRef(
856
- ({ className, ...props }, ref) => /* @__PURE__ */ jsx16("th", { className: cn(tableClasses.th, className), ref, ...props })
1088
+ var TableHead = React17.forwardRef(
1089
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx20("th", { className: cn(tableClasses.th, className), ref, ...props })
857
1090
  );
858
1091
  TableHead.displayName = "TableHead";
859
- var TableCell = React13.forwardRef(
860
- ({ className, ...props }, ref) => /* @__PURE__ */ jsx16("td", { className: cn(tableClasses.td, className), ref, ...props })
1092
+ var TableCell = React17.forwardRef(
1093
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx20("td", { className: cn(tableClasses.td, className), ref, ...props })
861
1094
  );
862
1095
  TableCell.displayName = "TableCell";
863
- var TableCaption = React13.forwardRef(
864
- ({ className, ...props }, ref) => /* @__PURE__ */ jsx16("caption", { className: cn(tableClasses.caption, className), ref, ...props })
1096
+ var TableCaption = React17.forwardRef(
1097
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx20("caption", { className: cn(tableClasses.caption, className), ref, ...props })
865
1098
  );
866
1099
  TableCaption.displayName = "TableCaption";
867
1100
 
@@ -968,6 +1201,11 @@ export {
968
1201
  CardSkeleton,
969
1202
  CardTitle,
970
1203
  CategoryPill,
1204
+ ChartAxis,
1205
+ ChartBar,
1206
+ ChartContainer,
1207
+ ChartGrid,
1208
+ ChartLine,
971
1209
  Checkbox,
972
1210
  CodeBlock,
973
1211
  DEFAULT_ACCENT,
@@ -983,12 +1221,21 @@ export {
983
1221
  Lead,
984
1222
  Logo,
985
1223
  NativeSelect,
1224
+ Pagination,
1225
+ PaginationContent,
1226
+ PaginationEllipsis,
1227
+ PaginationItem,
1228
+ PaginationLink,
1229
+ PaginationNext,
1230
+ PaginationPrevious,
986
1231
  PostCard,
987
1232
  PostGrid,
1233
+ Progress,
988
1234
  Prose,
989
1235
  READING_PROGRESS_VAR,
990
1236
  RadioGroup,
991
1237
  RadioGroupItem,
1238
+ Separator,
992
1239
  Sidebar,
993
1240
  SidebarSection,
994
1241
  Skeleton,