@ucdjs-internal/shared-ui 0.1.6 → 0.1.7

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 (49) hide show
  1. package/README.md +0 -3
  2. package/dist/components/index.d.mts +2 -1
  3. package/dist/components/index.mjs +2 -2
  4. package/dist/components/shiki-code.mjs +1 -3
  5. package/dist/components/theme-toggle.mjs +1 -3
  6. package/dist/components/ucd-logo.d.mts +10 -0
  7. package/dist/components/ucd-logo.mjs +61 -0
  8. package/dist/hooks/index.mjs +1 -2
  9. package/dist/hooks/use-clipboard.mjs +2 -4
  10. package/dist/hooks/use-mobile.mjs +1 -3
  11. package/dist/hooks/use-theme.mjs +1 -3
  12. package/dist/index.mjs +1 -2
  13. package/dist/lib/theme-script.mjs +1 -2
  14. package/dist/lib/utils.mjs +1 -3
  15. package/dist/ui/alert-dialog.mjs +2 -3
  16. package/dist/ui/avatar.mjs +2 -3
  17. package/dist/ui/badge.mjs +1 -3
  18. package/dist/ui/breadcrumb.mjs +2 -3
  19. package/dist/ui/button.d.mts +1 -1
  20. package/dist/ui/button.mjs +1 -3
  21. package/dist/ui/card.mjs +2 -3
  22. package/dist/ui/checkbox.mjs +1 -3
  23. package/dist/ui/collapsible.mjs +1 -3
  24. package/dist/ui/combobox.mjs +1 -3
  25. package/dist/ui/command.d.mts +52 -13
  26. package/dist/ui/command.mjs +327 -89
  27. package/dist/ui/context-menu.mjs +2 -3
  28. package/dist/ui/dialog.d.mts +2 -0
  29. package/dist/ui/dialog.mjs +41 -31
  30. package/dist/ui/dropdown-menu.mjs +2 -3
  31. package/dist/ui/field.mjs +1 -3
  32. package/dist/ui/input-group.mjs +2 -3
  33. package/dist/ui/input.mjs +2 -3
  34. package/dist/ui/label.mjs +2 -3
  35. package/dist/ui/scroll-area.mjs +2 -3
  36. package/dist/ui/select.mjs +2 -3
  37. package/dist/ui/separator.mjs +1 -3
  38. package/dist/ui/sheet.mjs +2 -3
  39. package/dist/ui/sidebar.d.mts +1 -1
  40. package/dist/ui/sidebar.mjs +3 -5
  41. package/dist/ui/skeleton.mjs +1 -3
  42. package/dist/ui/table.mjs +2 -3
  43. package/dist/ui/textarea.mjs +2 -3
  44. package/dist/ui/tooltip.mjs +1 -3
  45. package/dist/vscode/syntaxes/ucd.tmLanguage.mjs +1 -2
  46. package/package.json +15 -15
  47. package/dist/vendor/cmdk/command-score.mjs +0 -62
  48. package/dist/vendor/cmdk/index.d.mts +0 -181
  49. package/dist/vendor/cmdk/index.mjs +0 -713
@@ -1,9 +1,9 @@
1
1
  import { cn } from "../lib/utils.mjs";
2
+ import "react";
2
3
  import { jsx, jsxs } from "react/jsx-runtime";
3
4
  import { c } from "react/compiler-runtime";
4
5
  import { Check, ChevronRight } from "lucide-react";
5
6
  import { Menu as Menu$1 } from "@base-ui/react/menu";
6
-
7
7
  //#region src/ui/dropdown-menu.tsx
8
8
  function DropdownMenu(t0) {
9
9
  const $ = c(4);
@@ -528,6 +528,5 @@ function DropdownMenuShortcut(t0) {
528
528
  } else t2 = $[7];
529
529
  return t2;
530
530
  }
531
-
532
531
  //#endregion
533
- export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger };
532
+ export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger };
package/dist/ui/field.mjs CHANGED
@@ -4,7 +4,6 @@ import { Separator } from "./separator.mjs";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
5
  import { c } from "react/compiler-runtime";
6
6
  import { cva } from "class-variance-authority";
7
-
8
7
  //#region src/ui/field.tsx
9
8
  function FieldSet(t0) {
10
9
  const $ = c(8);
@@ -420,6 +419,5 @@ function _temp2(error_0) {
420
419
  function _temp(error) {
421
420
  return [error?.message, error];
422
421
  }
423
-
424
422
  //#endregion
425
- export { Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle };
423
+ export { Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle };
@@ -2,10 +2,10 @@ import { cn } from "../lib/utils.mjs";
2
2
  import { Button } from "./button.mjs";
3
3
  import { Input } from "./input.mjs";
4
4
  import { Textarea } from "./textarea.mjs";
5
+ import "react";
5
6
  import { jsx } from "react/jsx-runtime";
6
7
  import { c } from "react/compiler-runtime";
7
8
  import { cva } from "class-variance-authority";
8
-
9
9
  //#region src/ui/input-group.tsx
10
10
  function InputGroup(t0) {
11
11
  const $ = c(8);
@@ -248,6 +248,5 @@ function InputGroupTextarea(t0) {
248
248
  } else t2 = $[7];
249
249
  return t2;
250
250
  }
251
-
252
251
  //#endregion
253
- export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea };
252
+ export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea };
package/dist/ui/input.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  import { cn } from "../lib/utils.mjs";
2
+ import "react";
2
3
  import { jsx } from "react/jsx-runtime";
3
4
  import { c } from "react/compiler-runtime";
4
5
  import { Input as Input$1 } from "@base-ui/react/input";
5
-
6
6
  //#region src/ui/input.tsx
7
7
  function Input(t0) {
8
8
  const $ = c(10);
@@ -41,6 +41,5 @@ function Input(t0) {
41
41
  } else t2 = $[9];
42
42
  return t2;
43
43
  }
44
-
45
44
  //#endregion
46
- export { Input };
45
+ export { Input };
package/dist/ui/label.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { cn } from "../lib/utils.mjs";
2
+ import "react";
2
3
  import { jsx } from "react/jsx-runtime";
3
4
  import { c } from "react/compiler-runtime";
4
-
5
5
  //#region src/ui/label.tsx
6
6
  function Label(t0) {
7
7
  const $ = c(8);
@@ -35,6 +35,5 @@ function Label(t0) {
35
35
  } else t2 = $[7];
36
36
  return t2;
37
37
  }
38
-
39
38
  //#endregion
40
- export { Label };
39
+ export { Label };
@@ -1,8 +1,8 @@
1
1
  import { cn } from "../lib/utils.mjs";
2
+ import "react";
2
3
  import { jsx, jsxs } from "react/jsx-runtime";
3
4
  import { c } from "react/compiler-runtime";
4
5
  import { ScrollArea as ScrollArea$1 } from "@base-ui/react/scroll-area";
5
-
6
6
  //#region src/ui/scroll-area.tsx
7
7
  function ScrollArea(t0) {
8
8
  const $ = c(14);
@@ -114,6 +114,5 @@ function ScrollBar(t0) {
114
114
  } else t4 = $[10];
115
115
  return t4;
116
116
  }
117
-
118
117
  //#endregion
119
- export { ScrollArea, ScrollBar };
118
+ export { ScrollArea, ScrollBar };
@@ -1,9 +1,9 @@
1
1
  import { cn } from "../lib/utils.mjs";
2
+ import "react";
2
3
  import { jsx, jsxs } from "react/jsx-runtime";
3
4
  import { c } from "react/compiler-runtime";
4
5
  import { Check, ChevronDown, ChevronUp } from "lucide-react";
5
6
  import { Select as Select$1 } from "@base-ui/react/select";
6
-
7
7
  //#region src/ui/select.tsx
8
8
  const Select = Select$1.Root;
9
9
  function SelectGroup(t0) {
@@ -408,6 +408,5 @@ function SelectScrollDownButton(t0) {
408
408
  } else t3 = $[8];
409
409
  return t3;
410
410
  }
411
-
412
411
  //#endregion
413
- export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue };
412
+ export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue };
@@ -2,7 +2,6 @@ import { cn } from "../lib/utils.mjs";
2
2
  import { jsx } from "react/jsx-runtime";
3
3
  import { c } from "react/compiler-runtime";
4
4
  import { Separator as Separator$1 } from "@base-ui/react/separator";
5
-
6
5
  //#region src/ui/separator.tsx
7
6
  function Separator(t0) {
8
7
  const $ = c(10);
@@ -42,6 +41,5 @@ function Separator(t0) {
42
41
  } else t3 = $[9];
43
42
  return t3;
44
43
  }
45
-
46
44
  //#endregion
47
- export { Separator };
45
+ export { Separator };
package/dist/ui/sheet.mjs CHANGED
@@ -1,10 +1,10 @@
1
1
  import { cn } from "../lib/utils.mjs";
2
2
  import { Button } from "./button.mjs";
3
+ import "react";
3
4
  import { jsx, jsxs } from "react/jsx-runtime";
4
5
  import { c } from "react/compiler-runtime";
5
6
  import { X } from "lucide-react";
6
7
  import { Dialog } from "@base-ui/react/dialog";
7
-
8
8
  //#region src/ui/sheet.tsx
9
9
  function Sheet(t0) {
10
10
  const $ = c(4);
@@ -312,6 +312,5 @@ function SheetDescription(t0) {
312
312
  } else t2 = $[7];
313
313
  return t2;
314
314
  }
315
-
316
315
  //#endregion
317
- export { Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger };
316
+ export { Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger };
@@ -105,7 +105,7 @@ declare function SidebarMenuItem({
105
105
  }: React.ComponentProps<"li">): react_jsx_runtime0.JSX.Element;
106
106
  declare const sidebarMenuButtonVariants: (props?: ({
107
107
  variant?: "default" | "outline" | null | undefined;
108
- size?: "sm" | "default" | "lg" | null | undefined;
108
+ size?: "default" | "sm" | "lg" | null | undefined;
109
109
  } & class_variance_authority_types0.ClassProp) | undefined) => string;
110
110
  declare function SidebarMenuButton({
111
111
  render,
@@ -13,11 +13,10 @@ import { Menu } from "lucide-react";
13
13
  import { cva } from "class-variance-authority";
14
14
  import { mergeProps } from "@base-ui/react/merge-props";
15
15
  import { useRender } from "@base-ui/react/use-render";
16
-
17
16
  //#region src/ui/sidebar.tsx
18
17
  const SIDEBAR_COOKIE_NAME = "sidebar_state";
19
18
  const SIDEBAR_COOKIE_MAX_AGE = 3600 * 24 * 7;
20
- const SIDEBAR_WIDTH = "16rem";
19
+ const SIDEBAR_WIDTH = "18rem";
21
20
  const SIDEBAR_WIDTH_MOBILE = "18rem";
22
21
  const SIDEBAR_WIDTH_ICON = "3rem";
23
22
  const SIDEBAR_KEYBOARD_SHORTCUT = "b";
@@ -1143,7 +1142,7 @@ function SidebarMenuSub(t0) {
1143
1142
  }
1144
1143
  let t1;
1145
1144
  if ($[3] !== className) {
1146
- t1 = cn("border-sidebar-border mx-3.5 translate-x-px gap-1 border-l px-2.5 py-0.5 group-data-[collapsible=icon]:hidden flex min-w-0 flex-col", className);
1145
+ t1 = cn("border-sidebar-border ml-3 translate-x-px gap-0.5 border-l pl-2 py-0.5 group-data-[collapsible=icon]:hidden flex min-w-0 flex-col", className);
1147
1146
  $[3] = className;
1148
1147
  $[4] = t1;
1149
1148
  } else t1 = $[4];
@@ -1253,6 +1252,5 @@ function SidebarMenuSubButton(t0) {
1253
1252
  } else t5 = $[14];
1254
1253
  return t3(t5);
1255
1254
  }
1256
-
1257
1255
  //#endregion
1258
- export { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, useSidebar };
1256
+ export { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, useSidebar };
@@ -1,7 +1,6 @@
1
1
  import { cn } from "../lib/utils.mjs";
2
2
  import { jsx } from "react/jsx-runtime";
3
3
  import { c } from "react/compiler-runtime";
4
-
5
4
  //#region src/ui/skeleton.tsx
6
5
  function Skeleton(t0) {
7
6
  const $ = c(8);
@@ -35,6 +34,5 @@ function Skeleton(t0) {
35
34
  } else t2 = $[7];
36
35
  return t2;
37
36
  }
38
-
39
37
  //#endregion
40
- export { Skeleton };
38
+ export { Skeleton };
package/dist/ui/table.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { cn } from "../lib/utils.mjs";
2
+ import "react";
2
3
  import { jsx } from "react/jsx-runtime";
3
4
  import { c } from "react/compiler-runtime";
4
-
5
5
  //#region src/ui/table.tsx
6
6
  function Table(t0) {
7
7
  const $ = c(8);
@@ -263,6 +263,5 @@ function TableCaption(t0) {
263
263
  } else t2 = $[7];
264
264
  return t2;
265
265
  }
266
-
267
266
  //#endregion
268
- export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow };
267
+ export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow };
@@ -1,7 +1,7 @@
1
1
  import { cn } from "../lib/utils.mjs";
2
+ import "react";
2
3
  import { jsx } from "react/jsx-runtime";
3
4
  import { c } from "react/compiler-runtime";
4
-
5
5
  //#region src/ui/textarea.tsx
6
6
  function Textarea(t0) {
7
7
  const $ = c(8);
@@ -35,6 +35,5 @@ function Textarea(t0) {
35
35
  } else t2 = $[7];
36
36
  return t2;
37
37
  }
38
-
39
38
  //#endregion
40
- export { Textarea };
39
+ export { Textarea };
@@ -2,7 +2,6 @@ import { cn } from "../lib/utils.mjs";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import { c } from "react/compiler-runtime";
4
4
  import { Tooltip as Tooltip$1 } from "@base-ui/react/tooltip";
5
-
6
5
  //#region src/ui/tooltip.tsx
7
6
  function TooltipProvider(t0) {
8
7
  const $ = c(6);
@@ -144,6 +143,5 @@ function TooltipContent(t0) {
144
143
  } else t8 = $[20];
145
144
  return t8;
146
145
  }
147
-
148
146
  //#endregion
149
- export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };
147
+ export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };
@@ -38,6 +38,5 @@ var ucd_tmLanguage_default = {
38
38
  }
39
39
  }
40
40
  };
41
-
42
41
  //#endregion
43
- export { ucd_tmLanguage_default as default };
42
+ export { ucd_tmLanguage_default as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ucdjs-internal/shared-ui",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "type": "module",
5
5
  "author": {
6
6
  "name": "Lucas Nørgård",
@@ -21,8 +21,7 @@
21
21
  "#components/*": "./src/components/*.tsx",
22
22
  "#ui/*": "./src/ui/*.tsx",
23
23
  "#lib/*": "./src/lib/*.ts",
24
- "#hooks/*": "./src/hooks/*.ts",
25
- "#vendor/cmdk": "./src/vendor/cmdk/index.tsx"
24
+ "#hooks/*": "./src/hooks/*.ts"
26
25
  },
27
26
  "exports": {
28
27
  ".": "./dist/index.mjs",
@@ -67,34 +66,35 @@
67
66
  "node": ">=24.13"
68
67
  },
69
68
  "dependencies": {
70
- "@base-ui/react": "1.2.0",
71
- "@base-ui/utils": "0.2.5",
69
+ "@base-ui/react": "1.3.0",
70
+ "@base-ui/utils": "0.2.6",
71
+ "@cmdi/base-ui": "0.0.1",
72
72
  "@fontsource-variable/inter": "5.2.8",
73
73
  "class-variance-authority": "0.7.1",
74
74
  "clsx": "2.1.1",
75
- "lucide-react": "0.575.0",
75
+ "lucide-react": "1.6.0",
76
76
  "react": "19.2.4",
77
77
  "react-dom": "19.2.4",
78
- "shiki": "3.23.0",
78
+ "shiki": "4.0.2",
79
79
  "tailwind-merge": "3.5.0",
80
- "tailwindcss": "4.2.1",
80
+ "tailwindcss": "4.2.2",
81
81
  "tw-animate-css": "1.4.0",
82
82
  "zod": "4.3.6"
83
83
  },
84
84
  "devDependencies": {
85
- "@eslint-react/eslint-plugin": "2.13.0",
86
- "@luxass/eslint-config": "7.2.1",
87
- "@rollup/plugin-babel": "6.1.0",
85
+ "@eslint-react/eslint-plugin": "3.0.0",
86
+ "@luxass/eslint-config": "7.4.1",
87
+ "@rollup/plugin-babel": "7.0.0",
88
88
  "@types/react": "19.2.14",
89
89
  "@types/react-dom": "19.2.3",
90
90
  "babel-plugin-react-compiler": "1.0.0",
91
- "eslint": "10.0.2",
91
+ "eslint": "10.1.0",
92
92
  "eslint-plugin-format": "2.0.1",
93
93
  "eslint-plugin-react-hooks": "7.0.1",
94
94
  "eslint-plugin-react-refresh": "0.5.2",
95
- "publint": "0.3.17",
96
- "tsdown": "0.20.3",
97
- "typescript": "5.9.3",
95
+ "publint": "0.3.18",
96
+ "tsdown": "0.21.4",
97
+ "typescript": "6.0.2",
98
98
  "@ucdjs-tooling/tsconfig": "1.0.0",
99
99
  "@ucdjs-tooling/tsdown-config": "1.0.0"
100
100
  },
@@ -1,62 +0,0 @@
1
- //#region src/vendor/cmdk/command-score.ts
2
- const SCORE_CONTINUE_MATCH = 1;
3
- const SCORE_SPACE_WORD_JUMP = .9;
4
- const SCORE_NON_SPACE_WORD_JUMP = .8;
5
- const SCORE_CHARACTER_JUMP = .17;
6
- const SCORE_TRANSPOSITION = .1;
7
- const PENALTY_SKIPPED = .999;
8
- const PENALTY_CASE_MISMATCH = .9999;
9
- const PENALTY_NOT_COMPLETE = .99;
10
- const IS_GAP_REGEXP = /[\\/_+.#"@[({&]/;
11
- const COUNT_GAPS_REGEXP = /[\\/_+.#"@[({&]/g;
12
- const IS_SPACE_REGEXP = /[\s-]/;
13
- const COUNT_SPACE_REGEXP = /[\s-]/g;
14
- function commandScoreInner(value, abbreviation, lowerString, lowerAbbreviation, stringIndex, abbreviationIndex, memoizedResults) {
15
- if (abbreviationIndex === abbreviation.length) {
16
- if (stringIndex === value.length) return SCORE_CONTINUE_MATCH;
17
- return PENALTY_NOT_COMPLETE;
18
- }
19
- const memoizeKey = `${stringIndex},${abbreviationIndex}`;
20
- if (memoizedResults[memoizeKey] !== void 0) return memoizedResults[memoizeKey];
21
- const abbreviationChar = lowerAbbreviation.charAt(abbreviationIndex);
22
- let index = lowerString.indexOf(abbreviationChar, stringIndex);
23
- let highScore = 0;
24
- let score, transposedScore, wordBreaks, spaceBreaks;
25
- while (index >= 0) {
26
- score = commandScoreInner(value, abbreviation, lowerString, lowerAbbreviation, index + 1, abbreviationIndex + 1, memoizedResults);
27
- if (score > highScore) {
28
- if (index === stringIndex) score *= SCORE_CONTINUE_MATCH;
29
- else if (IS_GAP_REGEXP.test(value.charAt(index - 1))) {
30
- score *= SCORE_NON_SPACE_WORD_JUMP;
31
- wordBreaks = value.slice(stringIndex, index - 1).match(COUNT_GAPS_REGEXP);
32
- if (wordBreaks && stringIndex > 0) score *= PENALTY_SKIPPED ** wordBreaks.length;
33
- } else if (IS_SPACE_REGEXP.test(value.charAt(index - 1))) {
34
- score *= SCORE_SPACE_WORD_JUMP;
35
- spaceBreaks = value.slice(stringIndex, index - 1).match(COUNT_SPACE_REGEXP);
36
- if (spaceBreaks && stringIndex > 0) score *= PENALTY_SKIPPED ** spaceBreaks.length;
37
- } else {
38
- score *= SCORE_CHARACTER_JUMP;
39
- if (stringIndex > 0) score *= PENALTY_SKIPPED ** (index - stringIndex);
40
- }
41
- if (value.charAt(index) !== abbreviation.charAt(abbreviationIndex)) score *= PENALTY_CASE_MISMATCH;
42
- }
43
- if (score < SCORE_TRANSPOSITION && lowerString.charAt(index - 1) === lowerAbbreviation.charAt(abbreviationIndex + 1) || lowerAbbreviation.charAt(abbreviationIndex + 1) === lowerAbbreviation.charAt(abbreviationIndex) && lowerString.charAt(index - 1) !== lowerAbbreviation.charAt(abbreviationIndex)) {
44
- transposedScore = commandScoreInner(value, abbreviation, lowerString, lowerAbbreviation, index + 1, abbreviationIndex + 2, memoizedResults);
45
- if (transposedScore * SCORE_TRANSPOSITION > score) score = transposedScore * SCORE_TRANSPOSITION;
46
- }
47
- if (score > highScore) highScore = score;
48
- index = lowerString.indexOf(abbreviationChar, index + 1);
49
- }
50
- memoizedResults[memoizeKey] = highScore;
51
- return highScore;
52
- }
53
- function formatInput(value) {
54
- return value.toLowerCase().replace(COUNT_SPACE_REGEXP, " ");
55
- }
56
- function commandScore(string, abbreviation, aliases) {
57
- string = aliases && aliases.length > 0 ? `${`${string} ${aliases.join(" ")}`}` : string;
58
- return commandScoreInner(string, abbreviation, formatInput(string), formatInput(abbreviation), 0, 0, {});
59
- }
60
-
61
- //#endregion
62
- export { commandScore };
@@ -1,181 +0,0 @@
1
- import * as React from "react";
2
- import * as react_jsx_runtime0 from "react/jsx-runtime";
3
- import { Dialog } from "@base-ui/react";
4
-
5
- //#region src/vendor/cmdk/index.d.ts
6
- interface Children {
7
- children?: React.ReactNode;
8
- }
9
- type DivProps = React.ComponentPropsWithoutRef<"div">;
10
- interface RefProp<T> {
11
- ref?: React.Ref<T>;
12
- }
13
- type LoadingProps = Children & DivProps & {
14
- /** Estimated progress of loading asynchronous options. */progress?: number;
15
- /**
16
- * Accessible label for this loading progressbar. Not shown visibly.
17
- */
18
- label?: string;
19
- };
20
- type EmptyProps = Children & DivProps & {};
21
- type SeparatorProps = DivProps & {
22
- /** Whether this separator should always be rendered. Useful if you disable automatic filtering. */alwaysRender?: boolean;
23
- };
24
- type DialogProps = Dialog.Root.Props & CommandProps & {
25
- /** Provide a className to the Dialog overlay. */overlayClassName?: string; /** Provide a className to the Dialog content. */
26
- contentClassName?: string; /** Provide a custom element the Dialog should portal into. */
27
- container?: HTMLElement;
28
- };
29
- type ListProps = Children & DivProps & {
30
- /**
31
- * Accessible label for this List of suggestions. Not shown visibly.
32
- */
33
- label?: string;
34
- };
35
- type ItemProps = Children & Omit<DivProps, "disabled" | "onSelect" | "value"> & {
36
- /** Whether this item is currently disabled. */disabled?: boolean; /** Event handler for when this item is selected, either via click or keyboard selection. */
37
- onSelect?: (value: string) => void;
38
- /**
39
- * A unique value for this item.
40
- * If no value is provided, it will be inferred from `children` or the rendered `textContent`. If your `textContent` changes between renders, you _must_ provide a stable, unique `value`.
41
- */
42
- value?: string; /** Optional keywords to match against when filtering. */
43
- keywords?: string[]; /** Whether this item is forcibly rendered regardless of filtering. */
44
- forceMount?: boolean;
45
- };
46
- type GroupProps = Children & Omit<DivProps, "heading" | "value"> & {
47
- /** Optional heading to render for this group. */heading?: React.ReactNode; /** If no heading is provided, you must provide a value that is unique for this group. */
48
- value?: string; /** Whether this group is forcibly rendered regardless of filtering. */
49
- forceMount?: boolean;
50
- };
51
- type InputProps = Omit<React.ComponentPropsWithoutRef<"input">, "value" | "onChange" | "type"> & {
52
- /**
53
- * Optional controlled state for the value of the search input.
54
- */
55
- value?: string;
56
- /**
57
- * Event handler called when the search value changes.
58
- */
59
- onValueChange?: (search: string) => void;
60
- };
61
- type CommandFilter = (value: string, search: string, keywords?: string[]) => number;
62
- type CommandProps = Children & DivProps & {
63
- /**
64
- * Accessible label for this command menu. Not shown visibly.
65
- */
66
- label?: string;
67
- /**
68
- * Optionally set to `false` to turn off the automatic filtering and sorting.
69
- * If `false`, you must conditionally render valid items based on the search query yourself.
70
- */
71
- shouldFilter?: boolean;
72
- /**
73
- * Custom filter function for whether each command menu item should matches the given search query.
74
- * It should return a number between 0 and 1, with 1 being the best match and 0 being hidden entirely.
75
- * By default, uses the `command-score` library.
76
- */
77
- filter?: CommandFilter;
78
- /**
79
- * Optional default item value when it is initially rendered.
80
- */
81
- defaultValue?: string;
82
- /**
83
- * Optional controlled state of the selected command menu item.
84
- */
85
- value?: string;
86
- /**
87
- * Event handler called when the selected item of the menu changes.
88
- */
89
- onValueChange?: (value: string) => void;
90
- /**
91
- * Optionally set to `true` to turn on looping around when using the arrow keys.
92
- */
93
- loop?: boolean;
94
- /**
95
- * Optionally set to `true` to disable selection via pointer events.
96
- */
97
- disablePointerSelection?: boolean;
98
- /**
99
- * Set to `false` to disable ctrl+n/j/p/k shortcuts. Defaults to `true`.
100
- */
101
- vimBindings?: boolean;
102
- };
103
- declare function Command({
104
- ref: forwardedRef,
105
- ...props
106
- }: CommandProps & RefProp<HTMLDivElement>): react_jsx_runtime0.JSX.Element;
107
- /**
108
- * Command menu item. Becomes active on pointer enter or through keyboard navigation.
109
- * Preferably pass a `value`, otherwise the value will be inferred from `children` or
110
- * the rendered item's `textContent`.
111
- */
112
- declare function Item({
113
- ref: forwardedRef,
114
- ...props
115
- }: ItemProps & RefProp<HTMLDivElement>): react_jsx_runtime0.JSX.Element | null;
116
- /**
117
- * Group command menu items together with a heading.
118
- * Grouped items are always shown together.
119
- */
120
- declare function Group({
121
- ref: forwardedRef,
122
- ...props
123
- }: GroupProps & RefProp<HTMLDivElement>): react_jsx_runtime0.JSX.Element;
124
- /**
125
- * A visual and semantic separator between items or groups.
126
- * Visible when the search query is empty or `alwaysRender` is true, hidden otherwise.
127
- */
128
- declare function Separator({
129
- ref: forwardedRef,
130
- ...props
131
- }: SeparatorProps & RefProp<HTMLDivElement>): react_jsx_runtime0.JSX.Element | null;
132
- /**
133
- * Command menu input.
134
- * All props are forwarded to the underyling `input` element.
135
- */
136
- declare function Input({
137
- ref: forwardedRef,
138
- ...props
139
- }: InputProps & RefProp<HTMLInputElement>): react_jsx_runtime0.JSX.Element;
140
- /**
141
- * Contains `Item`, `Group`, and `Separator`.
142
- * Use the `--cmdk-list-height` CSS variable to animate height based on the number of results.
143
- */
144
- declare function List({
145
- ref: forwardedRef,
146
- ...props
147
- }: ListProps & RefProp<HTMLDivElement>): react_jsx_runtime0.JSX.Element;
148
- /**
149
- * Renders the command menu in a Base UI Dialog.
150
- */
151
- declare function Dialog$1({
152
- ref: forwardedRef,
153
- ...props
154
- }: DialogProps & RefProp<HTMLDivElement>): react_jsx_runtime0.JSX.Element;
155
- /**
156
- * Automatically renders when there are no results for the search query.
157
- */
158
- declare function Empty({
159
- ref: forwardedRef,
160
- ...props
161
- }: EmptyProps & RefProp<HTMLDivElement>): react_jsx_runtime0.JSX.Element | null;
162
- /**
163
- * You should conditionally render this with `progress` while loading asynchronous items.
164
- */
165
- declare function Loading({
166
- ref: forwardedRef,
167
- ...props
168
- }: LoadingProps & RefProp<HTMLDivElement>): react_jsx_runtime0.JSX.Element;
169
- declare const pkg: typeof Command & {
170
- List: typeof List;
171
- Item: typeof Item;
172
- Input: typeof Input;
173
- Group: typeof Group;
174
- Separator: typeof Separator;
175
- Dialog: typeof Dialog$1;
176
- Empty: typeof Empty;
177
- Loading: typeof Loading;
178
- };
179
- /** Run a selector against the store state. */
180
- //#endregion
181
- export { pkg };