@exsto/ds 0.0.1-rc.5 → 0.0.1-rc.6

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.
package/dist/index.js CHANGED
@@ -12,6 +12,7 @@ import { Popover as Popover$1 } from "@base-ui/react/popover";
12
12
  import { Avatar as Avatar$1 } from "@base-ui/react/avatar";
13
13
  import { Combobox as Combobox$1 } from "@base-ui/react/combobox";
14
14
  import { ScrollArea as ScrollArea$1 } from "@base-ui/react/scroll-area";
15
+ import { Tooltip as Tooltip$1 } from "@base-ui/react/tooltip";
15
16
  import { useVirtualizer } from "@tanstack/react-virtual";
16
17
  import { Accordion as Accordion$1 } from "@base-ui/react/accordion";
17
18
  import { AlertDialog as AlertDialog$1 } from "@base-ui/react/alert-dialog";
@@ -40,7 +41,6 @@ import { Radio } from "@base-ui/react/radio";
40
41
  import { RadioGroup as RadioGroup$1 } from "@base-ui/react/radio-group";
41
42
  import * as ResizablePrimitive from "react-resizable-panels";
42
43
  import { Select as Select$1 } from "@base-ui/react/select";
43
- import { Tooltip as Tooltip$1 } from "@base-ui/react/tooltip";
44
44
  import { Switch as Switch$1 } from "@base-ui/react/switch";
45
45
  import { Tabs as Tabs$1 } from "@base-ui/react/tabs";
46
46
  import { Toast as Toast$1 } from "@base-ui/react/toast";
@@ -650,7 +650,7 @@ var useIsMobile = () => {
650
650
  var dayToDate = (value) => value === void 0 ? void 0 : /* @__PURE__ */ new Date(`${value}T12:00:00`);
651
651
  var dateToDay = (date) => date === void 0 ? void 0 : `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, "0")}-${String(date.getDate()).padStart(2, "0")}`;
652
652
  /** A range of calendar days, either end optional; two months side by side, one on a phone. */
653
- var DateRangePicker = ({ id, value, onValueChange, placeholder = "Select date range", locale = "en-GB", "aria-label": ariaLabel, className }) => {
653
+ var DateRangePicker = ({ id, value, onValueChange, placeholder = "Select date range", locale = "en-GB", summary = "range", "aria-label": ariaLabel, className }) => {
654
654
  const isMobile = useIsMobile();
655
655
  const from = dayToDate(value.from);
656
656
  const to = dayToDate(value.to);
@@ -665,12 +665,13 @@ var DateRangePicker = ({ id, value, onValueChange, placeholder = "Select date ra
665
665
  id,
666
666
  "aria-label": ariaLabel,
667
667
  "data-slot": "date-range-picker-trigger",
668
+ "data-set": ends.length > 0 ? "" : void 0,
668
669
  variant: "outline",
669
670
  className: cn("w-full min-w-0 justify-start font-normal", ends.length === 0 && "text-muted-foreground", className)
670
671
  }),
671
672
  children: [/* @__PURE__ */ jsx(IconCalendar, { "aria-hidden": "true" }), /* @__PURE__ */ jsx("span", {
672
673
  className: "truncate",
673
- children: ends.length === 0 ? placeholder : ends.join(" – ")
674
+ children: ends.length === 0 || summary === "label" ? placeholder : ends.join(" – ")
674
675
  })]
675
676
  }), /* @__PURE__ */ jsx(PopoverContent, {
676
677
  align: "start",
@@ -833,7 +834,7 @@ var ScrollBar = ({ className, orientation = "vertical", visibility = "hover", ..
833
834
  return /* @__PURE__ */ jsx(ScrollArea$1.Scrollbar, {
834
835
  "data-slot": "scroll-area-scrollbar",
835
836
  orientation,
836
- className: cn("peer/scrollbar z-100 flex touch-none select-none motion-safe:transition-opacity motion-safe:duration-150", orientation === "vertical" && "h-full w-2 border-l border-l-transparent p-px", orientation === "horizontal" && "h-2 flex-col border-t border-t-transparent p-px", visibility !== "always" && "opacity-0 data-scrolling:opacity-100", visibility === "hover" && "data-hovering:opacity-100 group-hover/scroll-area:opacity-100", className),
837
+ className: cn("peer/scrollbar z-100 flex touch-none select-none motion-safe:transition-opacity motion-safe:duration-150", orientation === "vertical" && "h-(--scroll-bar-length) w-(--scroll-bar-size) me-(--scroll-bar-gap) mt-(--scroll-bar-offset-top) border-l border-l-transparent p-px", orientation === "horizontal" && "h-(--scroll-bar-size) ms-(--scroll-bar-gap) me-(--scroll-bar-gap) mb-(--scroll-bar-gap) flex-col border-t border-t-transparent p-px", visibility !== "always" && "opacity-0 data-scrolling:opacity-100", visibility === "hover" && "data-hovering:opacity-100 group-hover/scroll-area:opacity-100", className),
837
838
  ...props,
838
839
  children: /* @__PURE__ */ jsx(ScrollArea$1.Thumb, { className: "relative flex-1 rounded-full bg-muted-foreground/50 transition-colors hover:bg-muted-foreground/70 data-scrolling:bg-muted-foreground/70" })
839
840
  });
@@ -939,6 +940,42 @@ var ScrollArea = ({ className, children, orientation = "vertical", type = "hover
939
940
  });
940
941
  };
941
942
  //#endregion
943
+ //#region ../ui/src/components/ui/tooltip/tooltip.tsx
944
+ var TooltipProvider = ({ delay = 0, ...props }) => {
945
+ return /* @__PURE__ */ jsx(Tooltip$1.Provider, {
946
+ "data-slot": "tooltip-provider",
947
+ delay,
948
+ ...props
949
+ });
950
+ };
951
+ var Tooltip = ({ ...props }) => {
952
+ return /* @__PURE__ */ jsx(Tooltip$1.Root, {
953
+ "data-slot": "tooltip",
954
+ ...props
955
+ });
956
+ };
957
+ var TooltipTrigger = ({ ...props }) => {
958
+ return /* @__PURE__ */ jsx(Tooltip$1.Trigger, {
959
+ "data-slot": "tooltip-trigger",
960
+ ...props
961
+ });
962
+ };
963
+ var TooltipContent = ({ className, side = "top", sideOffset = 4, align = "center", alignOffset = 0, children, ...props }) => {
964
+ return /* @__PURE__ */ jsx(Tooltip$1.Portal, { children: /* @__PURE__ */ jsx(Tooltip$1.Positioner, {
965
+ align,
966
+ alignOffset,
967
+ side,
968
+ sideOffset,
969
+ className: "isolate z-50",
970
+ children: /* @__PURE__ */ jsxs(Tooltip$1.Popup, {
971
+ "data-slot": "tooltip-content",
972
+ className: cn("z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", "motion-reduce:animate-none", className),
973
+ ...props,
974
+ children: [children, /* @__PURE__ */ jsx(Tooltip$1.Arrow, { className: "z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5" })]
975
+ })
976
+ }) });
977
+ };
978
+ //#endregion
942
979
  //#region ../ui/src/lib/popup-list.ts
943
980
  var ITEM_BASE = "relative flex min-h-8 cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm text-foreground outline-none select-none [&>svg]:pointer-events-none [&>svg]:shrink-0 [&>svg]:text-muted-foreground [&>svg:not([class*='size-'])]:size-4";
944
981
  var ITEM_STATES = {
@@ -983,42 +1020,68 @@ var resolveChosen = (value, options, selectedOptions = []) => {
983
1020
  });
984
1021
  };
985
1022
  /** What the trigger says: the placeholder, the one picked, or a count. */
986
- var summarize = (chosen, placeholder, labels) => {
1023
+ var summarize = (chosen, placeholder, labels, summary = "selection") => {
987
1024
  if (chosen.length === 0) return placeholder;
1025
+ if (summary === "label") return labels.selectedCount(chosen.length);
988
1026
  return chosen.length === 1 ? chosen[0]?.label ?? "" : labels.selectedCount(chosen.length);
989
1027
  };
1028
+ /** Every chosen name, for a tooltip on a trigger whose text is cut. With `label` the names are not shown, so it is the text itself. */
1029
+ var fullSelection = (chosen, placeholder, labels, summary = "selection") => summary === "selection" && chosen.length > 0 ? chosen.map((option) => option.label).join(", ") : summarize(chosen, placeholder, labels, summary);
990
1030
  var POPUP = "flex max-h-(--available-height) w-(--anchor-width) min-w-64 max-w-sm origin-(--transform-origin) flex-col overflow-hidden rounded-lg border border-border bg-popover text-popover-foreground shadow-md outline-none duration-100 motion-reduce:animate-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95";
991
1031
  var TRIGGER = "flex h-8 w-full min-w-0 cursor-pointer items-center justify-between gap-2 rounded-lg border border-input bg-transparent px-2.5 text-sm text-foreground transition-colors outline-none focus-visible:border-ring disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive data-popup-open:border-ring dark:bg-input/30";
992
- var Option = ({ option, index, style, measure }) => /* @__PURE__ */ jsxs(Combobox$1.Item, {
993
- value: option,
994
- index,
995
- ref: measure,
996
- "data-index": index,
997
- style,
998
- "data-slot": "multi-select-item",
999
- className: cn(popupItemClass("base-ui"), "group"),
1000
- children: [
1001
- /* @__PURE__ */ jsx("span", {
1002
- "data-slot": "multi-select-item-indicator",
1003
- "aria-hidden": "true",
1004
- className: "flex size-4 shrink-0 items-center justify-center rounded-sm border border-input text-primary-foreground transition-colors group-data-[selected]:border-primary group-data-[selected]:bg-primary",
1005
- children: /* @__PURE__ */ jsx(IconCheck, {
1006
- className: "size-3 opacity-0 group-data-[selected]:opacity-100",
1007
- stroke: 3
1032
+ var Option = ({ option, index, style, measure, highlighted }) => {
1033
+ const [cut, setCut] = useState(false);
1034
+ const measureLabel = useCallback((element) => {
1035
+ if (!element) return;
1036
+ const measureCut = () => setCut(element.scrollWidth > element.clientWidth);
1037
+ measureCut();
1038
+ if (typeof ResizeObserver === "undefined") return;
1039
+ const observer = new ResizeObserver(measureCut);
1040
+ observer.observe(element);
1041
+ return () => observer.disconnect();
1042
+ }, []);
1043
+ return /* @__PURE__ */ jsxs(Combobox$1.Item, {
1044
+ value: option,
1045
+ index,
1046
+ ref: measure,
1047
+ "data-index": index,
1048
+ style,
1049
+ "data-slot": "multi-select-item",
1050
+ className: cn(popupItemClass("base-ui"), "group"),
1051
+ children: [
1052
+ /* @__PURE__ */ jsx("span", {
1053
+ "data-slot": "multi-select-item-indicator",
1054
+ "aria-hidden": "true",
1055
+ className: "flex size-4 shrink-0 items-center justify-center rounded-sm border border-input text-primary-foreground transition-colors group-data-[selected]:border-primary group-data-[selected]:bg-primary",
1056
+ children: /* @__PURE__ */ jsx(IconCheck, {
1057
+ className: "size-3 opacity-0 group-data-[selected]:opacity-100",
1058
+ stroke: 3
1059
+ })
1060
+ }),
1061
+ option.leading,
1062
+ /* @__PURE__ */ jsxs(Tooltip, {
1063
+ open: highlighted && cut,
1064
+ children: [/* @__PURE__ */ jsx(TooltipTrigger, {
1065
+ "data-slot": "multi-select-item-label",
1066
+ "data-overflowing": cut ? "" : void 0,
1067
+ render: /* @__PURE__ */ jsx("span", {
1068
+ ref: measureLabel,
1069
+ className: "min-w-0 flex-1 truncate"
1070
+ }),
1071
+ children: option.label
1072
+ }, option.label), /* @__PURE__ */ jsx(TooltipContent, {
1073
+ side: "right",
1074
+ children: option.label
1075
+ })]
1076
+ }),
1077
+ option.count !== void 0 && /* @__PURE__ */ jsx("span", {
1078
+ className: "text-xs text-muted-foreground tabular-nums",
1079
+ children: option.count
1008
1080
  })
1009
- }),
1010
- option.leading,
1011
- /* @__PURE__ */ jsx("span", {
1012
- className: "min-w-0 flex-1 truncate",
1013
- children: option.label
1014
- }),
1015
- option.count !== void 0 && /* @__PURE__ */ jsx("span", {
1016
- className: "text-xs text-muted-foreground tabular-nums",
1017
- children: option.count
1018
- })
1019
- ]
1020
- });
1021
- var Options = ({ scroller, scrollTo, busy }) => {
1081
+ ]
1082
+ });
1083
+ };
1084
+ var Options = ({ scroller, scrollTo, busy, highlightedValue }) => {
1022
1085
  const items = Combobox$1.useFilteredItems();
1023
1086
  const virtual = items.length > 100;
1024
1087
  const [mounted, setMounted] = useState(false);
@@ -1042,7 +1105,8 @@ var Options = ({ scroller, scrollTo, busy }) => {
1042
1105
  className: "p-1 outline-none",
1043
1106
  children: items.map((option, index) => /* @__PURE__ */ jsx(Option, {
1044
1107
  option,
1045
- index
1108
+ index,
1109
+ highlighted: highlightedValue === option.value
1046
1110
  }, option.value))
1047
1111
  });
1048
1112
  return /* @__PURE__ */ jsx(Combobox$1.List, {
@@ -1055,6 +1119,7 @@ var Options = ({ scroller, scrollTo, busy }) => {
1055
1119
  return option === void 0 ? null : /* @__PURE__ */ jsx(Option, {
1056
1120
  option,
1057
1121
  index: row.index,
1122
+ highlighted: highlightedValue === option.value,
1058
1123
  measure: virtualizer.measureElement,
1059
1124
  style: {
1060
1125
  position: "absolute",
@@ -1078,7 +1143,7 @@ var Options = ({ scroller, scrollTo, busy }) => {
1078
1143
  * server: the caller fetches the options for the typed text, and says when they are loading,
1079
1144
  * failed, or have another page.
1080
1145
  */
1081
- var MultiSelect = ({ placeholder, searchPlaceholder, options, value, onValueChange, id, disabled = false, className, onSearchChange, searchDelay = 250, selectedOptions, loading = false, error = false, onRetry, hasMore = false, onLoadMore, loadingMore = false, labels: labelOverrides, ...rest }) => {
1146
+ var MultiSelect = ({ placeholder, searchPlaceholder, options, value, onValueChange, id, disabled = false, className, onSearchChange, searchDelay = 250, selectedOptions, loading = false, error = false, onRetry, hasMore = false, onLoadMore, loadingMore = false, labels: labelOverrides, summary = "selection", ...rest }) => {
1082
1147
  const labels = useMemo(() => ({
1083
1148
  ...DEFAULT_MULTI_SELECT_LABELS,
1084
1149
  ...labelOverrides
@@ -1096,6 +1161,9 @@ var MultiSelect = ({ placeholder, searchPlaceholder, options, value, onValueChan
1096
1161
  const refScroller = useRef(null);
1097
1162
  const refScrollTo = useRef(() => void 0);
1098
1163
  const refTimer = useRef(void 0);
1164
+ const refTriggerText = useRef(null);
1165
+ const [popupOpen, setPopupOpen] = useState(false);
1166
+ const [highlightedValue, setHighlightedValue] = useState(null);
1099
1167
  const refReported = useRef(void 0);
1100
1168
  const refOpen = useRef(false);
1101
1169
  const errorMessage = typeof error === "string" ? error : labels.error;
@@ -1119,6 +1187,8 @@ var MultiSelect = ({ placeholder, searchPlaceholder, options, value, onValueChan
1119
1187
  },
1120
1188
  onOpenChange: (open) => {
1121
1189
  window.clearTimeout(refTimer.current);
1190
+ setPopupOpen(open);
1191
+ if (!open) setHighlightedValue(null);
1122
1192
  refOpen.current = open;
1123
1193
  refReported.current = open ? "" : void 0;
1124
1194
  if (open && onSearchChange !== void 0) onSearchChange("");
@@ -1126,21 +1196,33 @@ var MultiSelect = ({ placeholder, searchPlaceholder, options, value, onValueChan
1126
1196
  itemToStringLabel: (option) => option.label,
1127
1197
  isItemEqualToValue: (a, b) => a.value === b.value,
1128
1198
  virtualized: items.length > 100,
1129
- onItemHighlighted: (_, details) => {
1199
+ onItemHighlighted: (item, details) => {
1200
+ setHighlightedValue(item?.value ?? null);
1130
1201
  if (details.reason === "keyboard" && details.index >= 0) refScrollTo.current(details.index);
1131
1202
  },
1132
- children: [/* @__PURE__ */ jsxs(Combobox$1.Trigger, {
1133
- id,
1134
- "aria-label": rest["aria-label"],
1135
- "data-slot": "multi-select-trigger",
1136
- className: cn(TRIGGER, className),
1137
- children: [/* @__PURE__ */ jsx("span", {
1138
- className: cn("min-w-0 flex-1 truncate text-left", chosen.length === 0 && "text-muted-foreground"),
1139
- children: summarize(chosen, placeholder, labels)
1140
- }), /* @__PURE__ */ jsx(IconChevronDown, {
1141
- "aria-hidden": "true",
1142
- className: "size-4 shrink-0 text-muted-foreground"
1143
- })]
1203
+ children: [/* @__PURE__ */ jsxs(Tooltip, {
1204
+ disabled: popupOpen,
1205
+ onOpenChange: (open, details) => {
1206
+ const element = refTriggerText.current;
1207
+ if (open && !(element && element.scrollWidth > element.clientWidth)) details.cancel();
1208
+ },
1209
+ children: [/* @__PURE__ */ jsxs(TooltipTrigger, {
1210
+ "data-slot": "multi-select-trigger",
1211
+ render: /* @__PURE__ */ jsx(Combobox$1.Trigger, {
1212
+ id,
1213
+ "aria-label": rest["aria-label"],
1214
+ "data-set": chosen.length > 0 ? "" : void 0,
1215
+ className: cn(TRIGGER, className)
1216
+ }),
1217
+ children: [/* @__PURE__ */ jsx("span", {
1218
+ ref: refTriggerText,
1219
+ className: cn("min-w-0 flex-1 truncate text-left", chosen.length === 0 && "text-muted-foreground"),
1220
+ children: summarize(chosen, placeholder, labels, summary)
1221
+ }), /* @__PURE__ */ jsx(IconChevronDown, {
1222
+ "aria-hidden": "true",
1223
+ className: "size-4 shrink-0 text-muted-foreground"
1224
+ })]
1225
+ }), /* @__PURE__ */ jsx(TooltipContent, { children: fullSelection(chosen, placeholder, labels, summary) })]
1144
1226
  }), /* @__PURE__ */ jsx(Combobox$1.Portal, { children: /* @__PURE__ */ jsx(Combobox$1.Positioner, {
1145
1227
  sideOffset: 4,
1146
1228
  align: "start",
@@ -1185,7 +1267,8 @@ var MultiSelect = ({ placeholder, searchPlaceholder, options, value, onValueChan
1185
1267
  children: /* @__PURE__ */ jsx(Options, {
1186
1268
  scroller: refScroller,
1187
1269
  scrollTo: refScrollTo,
1188
- busy: loading
1270
+ busy: loading,
1271
+ highlightedValue
1189
1272
  })
1190
1273
  }),
1191
1274
  hasMore && onLoadMore !== void 0 && /* @__PURE__ */ jsx("div", {
@@ -2583,7 +2666,7 @@ var CommandInput = ({ className, ...props }) => {
2583
2666
  "data-slot": "command-input-wrapper",
2584
2667
  className: "border-b border-border p-1",
2585
2668
  children: /* @__PURE__ */ jsxs(InputGroup, {
2586
- className: "h-8 border-transparent bg-transparent shadow-none *:data-[slot=input-group-addon]:pl-2",
2669
+ className: "h-8 border-transparent bg-transparent shadow-none *:data-[slot=input-group-addon]:pl-2 dark:bg-transparent",
2587
2670
  children: [/* @__PURE__ */ jsx(Command$1.Input, {
2588
2671
  "data-slot": "command-input",
2589
2672
  className: cn("w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50", className),
@@ -3877,31 +3960,48 @@ var Pagination = ({ page, count, onPageChange, siblingCount = 1, className }) =>
3877
3960
  //#endregion
3878
3961
  //#region ../ui/src/components/ui/progress/progress.tsx
3879
3962
  /**
3880
- * The fill's colour, and the track's tint of the same colour. A closed set of semantic
3881
- * tones rather than a class string, so a bar cannot carry a colour the theme does not
3882
- * define and dark mode and a re-theme keep working.
3963
+ * The tones: a closed set of semantic colours rather than a class string, so a bar cannot carry a
3964
+ * colour the theme does not define and dark mode and a re-theme keep working. Each is the theme token
3965
+ * the fill uses; the track is a 20% tint of the same token.
3883
3966
  */
3884
- var progressTrackVariants = cva("relative h-2 w-full overflow-hidden rounded-full", {
3885
- variants: { tone: {
3886
- default: "bg-primary/20",
3887
- info: "bg-info/20",
3888
- success: "bg-success/20",
3889
- warning: "bg-warning/20",
3890
- destructive: "bg-destructive/20"
3891
- } },
3892
- defaultVariants: { tone: "default" }
3893
- });
3894
- var progressIndicatorVariants = cva("h-full rounded-full transition-[width] duration-300 ease-in-out motion-reduce:transition-none motion-reduce:animate-none data-indeterminate:w-1/3 data-indeterminate:animate-[progress-indeterminate_1.5s_ease-in-out_infinite]", {
3895
- variants: { tone: {
3896
- default: "bg-primary",
3897
- info: "bg-info",
3898
- success: "bg-success",
3899
- warning: "bg-warning",
3900
- destructive: "bg-destructive"
3967
+ var TONE_TOKEN = {
3968
+ default: "var(--primary)",
3969
+ info: "var(--info)",
3970
+ success: "var(--success)",
3971
+ warning: "var(--warning)",
3972
+ destructive: "var(--destructive)"
3973
+ };
3974
+ /**
3975
+ * Colours an app can set without a class string. --progress-color replaces the fill (any colour, such as an
3976
+ * app's own status tokens); --progress-track replaces the track, which does not follow the fill: an app
3977
+ * that wants a neutral track sets it to var(--muted). Both are read where the bar is, so they follow the
3978
+ * theme and can be set on :root or on any ancestor.
3979
+ */
3980
+ var progressFill = (tone) => `var(--progress-color, ${TONE_TOKEN[tone]})`;
3981
+ var progressTrack = (tone) => `var(--progress-track, color-mix(in oklab, ${TONE_TOKEN[tone]} 20%, transparent))`;
3982
+ /**
3983
+ * How the fill eases its width. The defaults are the 300ms ease-in-out it always had; an app retunes them
3984
+ * with --progress-duration and --progress-ease, or turns the easing off with `animated={false}` when the
3985
+ * number it shows is itself animated and the bar is driven from the same clock.
3986
+ */
3987
+ var PROGRESS_DURATION = "var(--progress-duration, 300ms)";
3988
+ var PROGRESS_EASE = "var(--progress-ease, cubic-bezier(0.4, 0, 0.2, 1))";
3989
+ var progressTrackVariants = cva("relative w-full overflow-hidden rounded-full", {
3990
+ variants: { size: {
3991
+ sm: "h-1",
3992
+ default: "h-2"
3901
3993
  } },
3902
- defaultVariants: { tone: "default" }
3994
+ defaultVariants: { size: "default" }
3903
3995
  });
3904
- var Progress = ({ value = null, tone, className, ...props }) => {
3996
+ var Progress = ({ value = null, tone = "default", size, animated = true, className, ...props }) => {
3997
+ const fillStyle = {
3998
+ backgroundColor: progressFill(tone),
3999
+ ...value != null ? { width: `${value}%` } : null,
4000
+ ...animated ? {
4001
+ transitionDuration: PROGRESS_DURATION,
4002
+ transitionTimingFunction: PROGRESS_EASE
4003
+ } : null
4004
+ };
3905
4005
  return /* @__PURE__ */ jsx(Progress$1.Root, {
3906
4006
  "data-slot": "progress",
3907
4007
  value: value ?? null,
@@ -3909,12 +4009,13 @@ var Progress = ({ value = null, tone, className, ...props }) => {
3909
4009
  ...props,
3910
4010
  children: /* @__PURE__ */ jsx(Progress$1.Track, {
3911
4011
  "data-slot": "progress-track",
3912
- className: progressTrackVariants({ tone }),
4012
+ className: progressTrackVariants({ size }),
4013
+ style: { backgroundColor: progressTrack(tone) },
3913
4014
  children: /* @__PURE__ */ jsx(Progress$1.Indicator, {
3914
4015
  "data-slot": "progress-indicator",
3915
- "data-tone": tone ?? "default",
3916
- className: progressIndicatorVariants({ tone }),
3917
- style: value != null ? { width: `${value}%` } : void 0
4016
+ "data-tone": tone,
4017
+ className: cn("h-full rounded-full motion-reduce:transition-none motion-reduce:animate-none data-indeterminate:w-1/3 data-indeterminate:animate-[progress-indeterminate_1.5s_ease-in-out_infinite]", animated ? "transition-[width] duration-300 ease-in-out" : "transition-none"),
4018
+ style: fillStyle
3918
4019
  })
3919
4020
  })
3920
4021
  });
@@ -4306,42 +4407,6 @@ var Skeleton = ({ className, ...props }) => {
4306
4407
  });
4307
4408
  };
4308
4409
  //#endregion
4309
- //#region ../ui/src/components/ui/tooltip/tooltip.tsx
4310
- var TooltipProvider = ({ delay = 0, ...props }) => {
4311
- return /* @__PURE__ */ jsx(Tooltip$1.Provider, {
4312
- "data-slot": "tooltip-provider",
4313
- delay,
4314
- ...props
4315
- });
4316
- };
4317
- var Tooltip = ({ ...props }) => {
4318
- return /* @__PURE__ */ jsx(Tooltip$1.Root, {
4319
- "data-slot": "tooltip",
4320
- ...props
4321
- });
4322
- };
4323
- var TooltipTrigger = ({ ...props }) => {
4324
- return /* @__PURE__ */ jsx(Tooltip$1.Trigger, {
4325
- "data-slot": "tooltip-trigger",
4326
- ...props
4327
- });
4328
- };
4329
- var TooltipContent = ({ className, side = "top", sideOffset = 4, align = "center", alignOffset = 0, children, ...props }) => {
4330
- return /* @__PURE__ */ jsx(Tooltip$1.Portal, { children: /* @__PURE__ */ jsx(Tooltip$1.Positioner, {
4331
- align,
4332
- alignOffset,
4333
- side,
4334
- sideOffset,
4335
- className: "isolate z-50",
4336
- children: /* @__PURE__ */ jsxs(Tooltip$1.Popup, {
4337
- "data-slot": "tooltip-content",
4338
- className: cn("z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", "motion-reduce:animate-none", className),
4339
- ...props,
4340
- children: [children, /* @__PURE__ */ jsx(Tooltip$1.Arrow, { className: "z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5" })]
4341
- })
4342
- }) });
4343
- };
4344
- //#endregion
4345
4410
  //#region ../ui/src/components/ui/sidebar/sidebar.tsx
4346
4411
  var SIDEBAR_COOKIE_NAME = "sidebar_state";
4347
4412
  var SIDEBAR_COOKIE_MAX_AGE = 604800;
@@ -5037,6 +5102,6 @@ var ToggleGroupItem = ({ className, variant, size, ...props }) => {
5037
5102
  });
5038
5103
  };
5039
5104
  //#endregion
5040
- export { AVATAR_TONES, Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertAction, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AnimatedNumber, AspectRatio, Attachment, AttachmentAction, AttachmentActions, AttachmentContent, AttachmentDescription, AttachmentGroup, AttachmentMedia, AttachmentTitle, AttachmentTrigger, AudioPlayer, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Bubble, BubbleContent, BubbleGroup, BubbleReactions, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, Calendar, CalendarDayButton, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, ComboboxContent, ComboboxEmpty, ComboboxInput, ComboboxItem, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, DEFAULT_MULTI_SELECT_LABELS, DateRangePicker, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DirectionProvider, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, Field, FieldDescription, FieldError, FieldLabel, HoverCard, HoverCardContent, HoverCardTrigger, Indicator, InitialsAvatar, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemSeparator, ItemTitle, Kbd, KbdGroup, Label, Marker, MarkerContent, MarkerIcon, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, Message, MessageAvatar, MessageContent, MessageFooter, MessageGroup, MessageHeader, MessageScroller, MessageScrollerButton, MessageScrollerContent, MessageScrollerItem, MessageScrollerProvider, MessageScrollerViewport, MultiSelect, NativeSelect, NativeSelectOptGroup, NativeSelectOption, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuPositioner, NavigationMenuTrigger, NumberText, PROGRESS_LINE_COLOR, Pagination, Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, Progress, ProgressLine, Questionnaire, QuestionnaireActions, QuestionnaireChoice, QuestionnaireChoiceDescription, QuestionnaireChoices, QuestionnaireDescription, QuestionnaireError, QuestionnaireInput, QuestionnaireItem, QuestionnaireNext, QuestionnairePrevious, QuestionnaireProgress, QuestionnaireSkip, QuestionnaireSubmit, QuestionnaireTitle, RadioGroup, RadioGroupItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Slider, Spinner, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Toast, ToastAction, ToastClose, ToastContent, ToastDescription, ToastPortal, ToastProvider, ToastTitle, ToastViewport, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, VIRTUALIZE_FROM, VideoPlayer, avatarTone, badgeVariants, buttonVariants, clampPage, cn, createToastManager, dateToDay, dayToDate, formatCount, formatMediaTime, getPaginationRange, indicatorVariants, initialsOf, markerVariants, navigationMenuTriggerStyle, resolveChosen, spinnerVariants, summarize, tabsListVariants, toast, toggleVariants, useAnimatedValues, useCarousel, useDirection, useIsMobile, useMediaPlayer, useMergedRefs, useMessageScroller, useMessageScrollerScrollable, useMessageScrollerVisibility, useSidebar, useToastManager };
5105
+ export { AVATAR_TONES, Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertAction, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AnimatedNumber, AspectRatio, Attachment, AttachmentAction, AttachmentActions, AttachmentContent, AttachmentDescription, AttachmentGroup, AttachmentMedia, AttachmentTitle, AttachmentTrigger, AudioPlayer, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Bubble, BubbleContent, BubbleGroup, BubbleReactions, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, Calendar, CalendarDayButton, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, ComboboxContent, ComboboxEmpty, ComboboxInput, ComboboxItem, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, DEFAULT_MULTI_SELECT_LABELS, DateRangePicker, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DirectionProvider, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, Field, FieldDescription, FieldError, FieldLabel, HoverCard, HoverCardContent, HoverCardTrigger, Indicator, InitialsAvatar, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemSeparator, ItemTitle, Kbd, KbdGroup, Label, Marker, MarkerContent, MarkerIcon, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, Message, MessageAvatar, MessageContent, MessageFooter, MessageGroup, MessageHeader, MessageScroller, MessageScrollerButton, MessageScrollerContent, MessageScrollerItem, MessageScrollerProvider, MessageScrollerViewport, MultiSelect, NativeSelect, NativeSelectOptGroup, NativeSelectOption, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuPositioner, NavigationMenuTrigger, NumberText, PROGRESS_DURATION, PROGRESS_EASE, PROGRESS_LINE_COLOR, Pagination, Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, Progress, ProgressLine, Questionnaire, QuestionnaireActions, QuestionnaireChoice, QuestionnaireChoiceDescription, QuestionnaireChoices, QuestionnaireDescription, QuestionnaireError, QuestionnaireInput, QuestionnaireItem, QuestionnaireNext, QuestionnairePrevious, QuestionnaireProgress, QuestionnaireSkip, QuestionnaireSubmit, QuestionnaireTitle, RadioGroup, RadioGroupItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Slider, Spinner, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Toast, ToastAction, ToastClose, ToastContent, ToastDescription, ToastPortal, ToastProvider, ToastTitle, ToastViewport, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, VIRTUALIZE_FROM, VideoPlayer, avatarTone, badgeVariants, buttonVariants, clampPage, cn, createToastManager, dateToDay, dayToDate, formatCount, formatMediaTime, fullSelection, getPaginationRange, indicatorVariants, initialsOf, markerVariants, navigationMenuTriggerStyle, progressFill, progressTrack, resolveChosen, spinnerVariants, summarize, tabsListVariants, toast, toggleVariants, useAnimatedValues, useCarousel, useDirection, useIsMobile, useMediaPlayer, useMergedRefs, useMessageScroller, useMessageScrollerScrollable, useMessageScrollerVisibility, useSidebar, useToastManager };
5041
5106
 
5042
5107
  //# sourceMappingURL=index.js.map