@nextlyhq/ui 0.0.2-alpha.57 → 0.0.2-alpha.58
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.cjs +126 -54
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +99 -20
- package/dist/index.d.ts +99 -20
- package/dist/index.mjs +126 -55
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.scoped.css +1 -1
- package/dist/tailwind-preset.cjs +55 -7
- package/dist/tailwind-preset.cjs.map +1 -1
- package/dist/tailwind-preset.d.cts +37 -1
- package/dist/tailwind-preset.d.ts +37 -1
- package/dist/tailwind-preset.mjs +55 -7
- package/dist/tailwind-preset.mjs.map +1 -1
- package/dist/theme.css +65 -15
- package/package.json +8 -7
package/dist/index.mjs
CHANGED
|
@@ -33,8 +33,9 @@ var buttonVariants = cva(
|
|
|
33
33
|
destructive: "bg-destructive-solid text-destructive-foreground border border-transparent hover:bg-destructive-600",
|
|
34
34
|
// border-border is the decorative separator token, and it is the right
|
|
35
35
|
// one here: a button is identified by its label and fill, so its edge
|
|
36
|
-
// carries no meaning on its own
|
|
37
|
-
//
|
|
36
|
+
// carries no meaning on its own, unlike border-input, which is the
|
|
37
|
+
// token for controls identified by their boundary (that token is now
|
|
38
|
+
// below 1.4.11's 3:1 in light mode; see contrast/accepted.ts). It is
|
|
38
39
|
// still used in preference to a faint primary alpha, which reads as a
|
|
39
40
|
// tint of the brand colour rather than as an edge.
|
|
40
41
|
outline: "border border-border text-foreground hover-unified bg-background",
|
|
@@ -91,11 +92,22 @@ import { cva as cva2 } from "class-variance-authority";
|
|
|
91
92
|
import { forwardRef as forwardRef2 } from "react";
|
|
92
93
|
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
93
94
|
var inputVariants = cva2(
|
|
94
|
-
|
|
95
|
+
// `text-foreground` is explicit rather than inherited. Tailwind's preflight
|
|
96
|
+
// sets `color: inherit` on form controls, so without it the typed value takes
|
|
97
|
+
// whatever colour an ancestor happens to carry -- muted inside a
|
|
98
|
+
// `text-muted-foreground` block, red inside a `text-destructive` one. Select
|
|
99
|
+
// and Textarea have always pinned it; Input was the one control that did not,
|
|
100
|
+
// and callers were compensating by putting the token on a wrapper.
|
|
101
|
+
"file:text-foreground text-foreground placeholder:text-muted-foreground placeholder:opacity-50 selection:bg-primary selection:text-primary-foreground w-full min-w-0 rounded-md border border-input bg-background text-sm transition-all duration-150 outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 focus:ring-0 focus:ring-offset-0 focus:outline-none focus:border-primary! focus-visible:border-primary! aria-invalid:border-destructive aria-invalid:focus:border-destructive! data-[invalid=true]:border-destructive data-[invalid=true]:focus:border-destructive!",
|
|
95
102
|
{
|
|
96
103
|
variants: {
|
|
97
104
|
size: {
|
|
98
|
-
|
|
105
|
+
// `-md` rather than `-sm`, so that a small input is the same height as
|
|
106
|
+
// a small button standing beside it in a toolbar or a filter row.
|
|
107
|
+
// Button's `sm` has always used this step; an input reading `-sm` made
|
|
108
|
+
// `size="sm"` mean 36px on one control and 32px on another, and a form
|
|
109
|
+
// row mixing them sat 4px out of line.
|
|
110
|
+
sm: "h-[var(--nx-control-height-md)] px-2.5 py-2 text-sm",
|
|
99
111
|
default: "h-[var(--nx-control-height)] px-3 py-2.5 text-sm",
|
|
100
112
|
lg: "h-[var(--nx-control-height-lg)] px-4 py-3 text-base"
|
|
101
113
|
}
|
|
@@ -677,9 +689,12 @@ var Checkbox = forwardRef11(({ className, indeterminate, ...props }, ref) => /*
|
|
|
677
689
|
ref,
|
|
678
690
|
"data-slot": "checkbox",
|
|
679
691
|
className: cn(
|
|
680
|
-
// Resting border uses border-
|
|
681
|
-
//
|
|
682
|
-
|
|
692
|
+
// Resting border uses border-control-border, NOT border-input. An
|
|
693
|
+
// unchecked box has no label, value or focus ring to identify it -- the
|
|
694
|
+
// border is the whole control -- so it is held to 1.4.11's 3:1, which
|
|
695
|
+
// border-input deliberately no longer meets. The checked state switches
|
|
696
|
+
// to border-primary below, keeping the two states distinct.
|
|
697
|
+
"peer relative h-4 w-4 shrink-0 rounded-sm border border-control-border ring-offset-background before:absolute before:left-1/2 before:top-1/2 before:h-6 before:w-6 before:-translate-x-1/2 before:-translate-y-1/2 before:content-[''] focus:border-primary! focus-visible:border-primary! focus:outline-none focus-visible:outline-none aria-invalid:border-destructive aria-invalid:focus:border-destructive! aria-invalid:focus-visible:border-destructive! disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=checked]:border-primary data-[state=indeterminate]:bg-primary data-[state=indeterminate]:text-primary-foreground data-[state=indeterminate]:border-primary transition-all duration-200",
|
|
683
698
|
className
|
|
684
699
|
),
|
|
685
700
|
...props,
|
|
@@ -719,13 +734,15 @@ var RadioGroupItem = forwardRef12(({ className, ...props }, ref) => {
|
|
|
719
734
|
className: cn(
|
|
720
735
|
// Unchecked outline uses primary/40 (clearly visible) instead of primary/5
|
|
721
736
|
// (~5% opacity, effectively invisible); hover strengthens above the resting state.
|
|
722
|
-
// Resting border uses border-
|
|
723
|
-
//
|
|
737
|
+
// Resting border uses border-control-border, NOT border-input. An
|
|
738
|
+
// unchecked radio is only its ring, with nothing else to identify it,
|
|
739
|
+
// so it is held to 1.4.11's 3:1 -- which border-input deliberately no
|
|
740
|
+
// longer meets. The checked state switches to border-primary below.
|
|
724
741
|
// rounded-full is fixed rather than derived from --radius: the circle is
|
|
725
742
|
// what tells the user only one option can be chosen. The thick checked
|
|
726
743
|
// border leaves a background-coloured core, and because the border's
|
|
727
744
|
// inner edge is curved too that core reads as a round dot.
|
|
728
|
-
"peer h-4 w-4 shrink-0 rounded-full border border-
|
|
745
|
+
"peer h-4 w-4 shrink-0 rounded-full border border-control-border bg-background cursor-pointer transition-all duration-150 focus:border-primary! focus-visible:border-primary! focus:outline-none focus-visible:outline-none aria-invalid:border-destructive aria-invalid:focus:border-destructive! aria-invalid:focus-visible:border-destructive! disabled:cursor-not-allowed disabled:opacity-50 hover:border-primary/70 data-[state=checked]:border-primary data-[state=checked]:border-[5px]",
|
|
729
746
|
className
|
|
730
747
|
),
|
|
731
748
|
...props,
|
|
@@ -749,7 +766,21 @@ function Switch({ className, ...props }) {
|
|
|
749
766
|
className: cn(
|
|
750
767
|
"peer inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-border transition-all outline-none focus-visible:border-primary aria-invalid:border-destructive aria-invalid:focus-visible:border-destructive! disabled:cursor-not-allowed disabled:opacity-50",
|
|
751
768
|
"data-[state=checked]:bg-primary data-[state=checked]:border-primary!",
|
|
752
|
-
|
|
769
|
+
// An unchecked switch is a track and a thumb and nothing else -- no
|
|
770
|
+
// label inside it, no value, no glyph -- so 1.4.11 applies to both the
|
|
771
|
+
// track against the page and the thumb against the track. `bg-input`
|
|
772
|
+
// cannot serve here: it is the FIELD border weight, deliberately below
|
|
773
|
+
// the minimum, and at that value the pill and its thumb both vanish
|
|
774
|
+
// into a light page. The control token is the same answer used for the
|
|
775
|
+
// checkbox and radio boundary, for the same reason.
|
|
776
|
+
// At full strength in both modes. A `/80` here read as a softening of
|
|
777
|
+
// the dark track and was in fact a removal of the guarantee the token
|
|
778
|
+
// carries: composited over the surfaces the switch renders on it
|
|
779
|
+
// measures 3.02 on the page, 2.94 on a card, 2.85 on a popover or the
|
|
780
|
+
// sidebar and 2.65 on muted, so three of the four fall under the 3:1
|
|
781
|
+
// this token exists to hold. Opaque, the same four are 4.23, 4.01,
|
|
782
|
+
// 3.79 and 3.40.
|
|
783
|
+
"data-[state=unchecked]:bg-control-border data-[state=unchecked]:border-control-border",
|
|
753
784
|
className
|
|
754
785
|
),
|
|
755
786
|
...props,
|
|
@@ -914,41 +945,57 @@ AvatarFallback.displayName = "AvatarFallback";
|
|
|
914
945
|
|
|
915
946
|
// src/components/tabs.tsx
|
|
916
947
|
import { Root as Root7, List, Trigger as Trigger3, Content as Content3 } from "@radix-ui/react-tabs";
|
|
948
|
+
import { cva as cva8 } from "class-variance-authority";
|
|
917
949
|
import { forwardRef as forwardRef15 } from "react";
|
|
918
950
|
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
919
951
|
var Tabs = Root7;
|
|
920
|
-
var
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
}
|
|
933
|
-
|
|
952
|
+
var TABS_LIST_VARIANTS = {
|
|
953
|
+
default: "h-10",
|
|
954
|
+
ghost: "h-8 bg-transparent"
|
|
955
|
+
};
|
|
956
|
+
var tabsListVariants = cva8(
|
|
957
|
+
// Square corners: underline tabs, so the list never draws a rounded surface.
|
|
958
|
+
// `gap-1` and `p-0` are invariant across the variants, so they belong here —
|
|
959
|
+
// repeating them in each arm gives any future adjustment two sites to change
|
|
960
|
+
// and one to forget.
|
|
961
|
+
"inline-flex items-center justify-center gap-1 rounded-none p-0 text-muted-foreground",
|
|
962
|
+
{
|
|
963
|
+
variants: { variant: TABS_LIST_VARIANTS },
|
|
964
|
+
defaultVariants: { variant: "default" }
|
|
965
|
+
}
|
|
934
966
|
);
|
|
967
|
+
var TabsList = forwardRef15(({ className, variant, ...props }, ref) => /* @__PURE__ */ jsx20(
|
|
968
|
+
List,
|
|
969
|
+
{
|
|
970
|
+
ref,
|
|
971
|
+
"data-slot": "tabs-list",
|
|
972
|
+
className: cn(tabsListVariants({ variant }), className),
|
|
973
|
+
...props
|
|
974
|
+
}
|
|
975
|
+
));
|
|
935
976
|
TabsList.displayName = List.displayName;
|
|
936
|
-
var
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
...props
|
|
949
|
-
}
|
|
950
|
-
)
|
|
977
|
+
var TABS_TRIGGER_SIZES = {
|
|
978
|
+
default: "text-sm",
|
|
979
|
+
sm: "text-xs"
|
|
980
|
+
};
|
|
981
|
+
var tabsTriggerVariants = cva8(
|
|
982
|
+
// Square corners: the active state is a 2px bottom border that has to run the
|
|
983
|
+
// full width of the trigger.
|
|
984
|
+
"inline-flex items-center justify-center whitespace-nowrap rounded-none bg-transparent px-4 py-2 font-medium cursor-pointer transition-all duration-200 border-b-2 relative -mb-0.5 data-[state=active]:border-b-primary! data-[state=active]:text-primary data-[state=inactive]:border-transparent data-[state=inactive]:text-muted-foreground hover:text-primary hover:border-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed",
|
|
985
|
+
{
|
|
986
|
+
variants: { size: TABS_TRIGGER_SIZES },
|
|
987
|
+
defaultVariants: { size: "default" }
|
|
988
|
+
}
|
|
951
989
|
);
|
|
990
|
+
var TabsTrigger = forwardRef15(({ className, size, ...props }, ref) => /* @__PURE__ */ jsx20(
|
|
991
|
+
Trigger3,
|
|
992
|
+
{
|
|
993
|
+
ref,
|
|
994
|
+
"data-slot": "tabs-trigger",
|
|
995
|
+
className: cn(tabsTriggerVariants({ size }), className),
|
|
996
|
+
...props
|
|
997
|
+
}
|
|
998
|
+
));
|
|
952
999
|
TabsTrigger.displayName = Trigger3.displayName;
|
|
953
1000
|
var TabsContent = forwardRef15(
|
|
954
1001
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx20(
|
|
@@ -994,7 +1041,7 @@ PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
|
994
1041
|
|
|
995
1042
|
// src/components/dialog.tsx
|
|
996
1043
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
997
|
-
import { cva as
|
|
1044
|
+
import { cva as cva9 } from "class-variance-authority";
|
|
998
1045
|
import { X } from "lucide-react";
|
|
999
1046
|
import { forwardRef as forwardRef17 } from "react";
|
|
1000
1047
|
import { jsx as jsx22, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
@@ -1020,7 +1067,7 @@ var DialogOverlay = forwardRef17(({ className, ...props }, ref) => /* @__PURE__
|
|
|
1020
1067
|
}
|
|
1021
1068
|
));
|
|
1022
1069
|
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
1023
|
-
var dialogContentVariants =
|
|
1070
|
+
var dialogContentVariants = cva9("", {
|
|
1024
1071
|
variants: {
|
|
1025
1072
|
size: {
|
|
1026
1073
|
sm: "max-w-sm",
|
|
@@ -1379,7 +1426,7 @@ DropdownMenuShortcut.displayName = "DropdownMenuShortcut";
|
|
|
1379
1426
|
|
|
1380
1427
|
// src/components/select.tsx
|
|
1381
1428
|
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
1382
|
-
import { cva as
|
|
1429
|
+
import { cva as cva10 } from "class-variance-authority";
|
|
1383
1430
|
import { Check as Check3, ChevronDown as ChevronDown2, ChevronUp } from "lucide-react";
|
|
1384
1431
|
import { forwardRef as forwardRef20 } from "react";
|
|
1385
1432
|
import { jsx as jsx25, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
@@ -1396,14 +1443,17 @@ function SelectValue({
|
|
|
1396
1443
|
}) {
|
|
1397
1444
|
return /* @__PURE__ */ jsx25(SelectPrimitive.Value, { "data-slot": "select-value", ...props });
|
|
1398
1445
|
}
|
|
1399
|
-
var selectTriggerVariants =
|
|
1446
|
+
var selectTriggerVariants = cva10(
|
|
1400
1447
|
// hover:border-primary (full strength) keeps the hover boundary more visible
|
|
1401
1448
|
// than the resting border-input, not a fainter alpha of it.
|
|
1402
1449
|
"flex w-full items-center justify-between gap-2 rounded-md border border-input bg-background px-3 text-sm text-foreground cursor-pointer transition-all duration-150 focus:border-primary! focus-visible:border-primary! focus:outline-none hover:border-primary disabled:cursor-not-allowed disabled:opacity-50 disabled:bg-primary/5 data-[placeholder]:text-muted-foreground aria-[invalid=true]:border-destructive aria-[invalid=true]:focus:border-destructive! [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:size-4",
|
|
1403
1450
|
{
|
|
1404
1451
|
variants: {
|
|
1405
1452
|
size: {
|
|
1406
|
-
|
|
1453
|
+
// `-md`, matching Button and Input: one height for one size name. A
|
|
1454
|
+
// select sitting beside a small button in a filter row is the case that
|
|
1455
|
+
// makes a 4px difference visible.
|
|
1456
|
+
sm: "h-[var(--nx-control-height-md)] text-sm",
|
|
1407
1457
|
default: "h-[var(--nx-control-height)] text-sm",
|
|
1408
1458
|
lg: "h-[var(--nx-control-height-lg)] text-base"
|
|
1409
1459
|
}
|
|
@@ -1548,7 +1598,7 @@ function SelectScrollDownButton({
|
|
|
1548
1598
|
|
|
1549
1599
|
// src/components/sheet.tsx
|
|
1550
1600
|
import * as DialogPrimitive2 from "@radix-ui/react-dialog";
|
|
1551
|
-
import { cva as
|
|
1601
|
+
import { cva as cva11 } from "class-variance-authority";
|
|
1552
1602
|
import * as React7 from "react";
|
|
1553
1603
|
import { jsx as jsx26, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1554
1604
|
var Sheet = DialogPrimitive2.Root;
|
|
@@ -1574,7 +1624,7 @@ var SheetOverlay = React7.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
1574
1624
|
}
|
|
1575
1625
|
));
|
|
1576
1626
|
SheetOverlay.displayName = DialogPrimitive2.Overlay.displayName;
|
|
1577
|
-
var sheetVariants =
|
|
1627
|
+
var sheetVariants = cva11(
|
|
1578
1628
|
"fixed z-50 gap-4 bg-background p-6 shadow-lg will-change-transform transition ease-in-out data-[state=closed]:duration-150 data-[state=open]:duration-150 data-[state=open]:animate-in data-[state=closed]:animate-out",
|
|
1579
1629
|
{
|
|
1580
1630
|
variants: {
|
|
@@ -1656,7 +1706,7 @@ SheetDescription.displayName = DialogPrimitive2.Description.displayName;
|
|
|
1656
1706
|
|
|
1657
1707
|
// src/components/command.tsx
|
|
1658
1708
|
import * as DialogPrimitive3 from "@radix-ui/react-dialog";
|
|
1659
|
-
import { Command as CommandPrimitive } from "cmdk";
|
|
1709
|
+
import { Command as CommandPrimitive, defaultFilter } from "cmdk";
|
|
1660
1710
|
import { Search } from "lucide-react";
|
|
1661
1711
|
import { forwardRef as forwardRef22 } from "react";
|
|
1662
1712
|
import { jsx as jsx27, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
@@ -1694,13 +1744,19 @@ var CommandDialogOverlay = forwardRef22(({ className, ...props }, ref) => /* @__
|
|
|
1694
1744
|
}
|
|
1695
1745
|
));
|
|
1696
1746
|
CommandDialogOverlay.displayName = "CommandDialogOverlay";
|
|
1697
|
-
var CommandDialog = ({
|
|
1747
|
+
var CommandDialog = ({
|
|
1748
|
+
children,
|
|
1749
|
+
commandProps,
|
|
1750
|
+
contentProps,
|
|
1751
|
+
...props
|
|
1752
|
+
}) => {
|
|
1698
1753
|
const portalContainer = usePortalContainer();
|
|
1699
1754
|
return /* @__PURE__ */ jsx27(DialogPrimitive3.Root, { ...props, children: /* @__PURE__ */ jsxs9(DialogPrimitive3.Portal, { container: portalContainer, children: [
|
|
1700
1755
|
/* @__PURE__ */ jsx27(CommandDialogOverlay, {}),
|
|
1701
1756
|
/* @__PURE__ */ jsx27(
|
|
1702
1757
|
DialogPrimitive3.Content,
|
|
1703
1758
|
{
|
|
1759
|
+
...contentProps,
|
|
1704
1760
|
"data-slot": "command-content",
|
|
1705
1761
|
className: cn(
|
|
1706
1762
|
// Position
|
|
@@ -1726,7 +1782,19 @@ var CommandDialog = ({ children, ...props }) => {
|
|
|
1726
1782
|
"data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
|
|
1727
1783
|
"data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-top-[48%]"
|
|
1728
1784
|
),
|
|
1729
|
-
children: /* @__PURE__ */ jsx27(
|
|
1785
|
+
children: /* @__PURE__ */ jsx27(
|
|
1786
|
+
Command,
|
|
1787
|
+
{
|
|
1788
|
+
...commandProps,
|
|
1789
|
+
className: cn(
|
|
1790
|
+
"[&_[cmdk-group-heading]]:px-3 [&_[cmdk-group-heading]]:py-2 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-semibold [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group-heading]]:uppercase [&_[cmdk-group-heading]]:tracking-wide [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:mb-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-3 [&_[cmdk-item]]:py-2 [&_[cmdk-item]_svg]:h-4 [&_[cmdk-item]_svg]:w-4",
|
|
1791
|
+
// Merged rather than overridden: a caller passing `className` for its own reason
|
|
1792
|
+
// would otherwise silently drop every layout rule this dialog depends on.
|
|
1793
|
+
commandProps?.className
|
|
1794
|
+
),
|
|
1795
|
+
children
|
|
1796
|
+
}
|
|
1797
|
+
)
|
|
1730
1798
|
}
|
|
1731
1799
|
)
|
|
1732
1800
|
] }) });
|
|
@@ -1864,13 +1932,14 @@ var CommandShortcut = forwardRef22(
|
|
|
1864
1932
|
}
|
|
1865
1933
|
);
|
|
1866
1934
|
CommandShortcut.displayName = "CommandShortcut";
|
|
1935
|
+
var commandDefaultFilter = defaultFilter;
|
|
1867
1936
|
|
|
1868
1937
|
// src/components/spinner.tsx
|
|
1869
|
-
import { cva as
|
|
1938
|
+
import { cva as cva12 } from "class-variance-authority";
|
|
1870
1939
|
import { Loader2 } from "lucide-react";
|
|
1871
1940
|
import { forwardRef as forwardRef23 } from "react";
|
|
1872
1941
|
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
1873
|
-
var spinnerVariants =
|
|
1942
|
+
var spinnerVariants = cva12("animate-spin motion-reduce:animate-none", {
|
|
1874
1943
|
variants: {
|
|
1875
1944
|
size: {
|
|
1876
1945
|
sm: "h-4 w-4",
|
|
@@ -3322,7 +3391,7 @@ function createShortcutManager(options = {}) {
|
|
|
3322
3391
|
let pendingKey = null;
|
|
3323
3392
|
function layerShape(bindings, options2) {
|
|
3324
3393
|
const keys = bindings.map((b) => b.binding.keys).join("\0");
|
|
3325
|
-
return `${keys}${options2.depth}${options2.blocking === true}${options2.enabled !== false}`;
|
|
3394
|
+
return `${keys}${options2.depth}${options2.priority ?? 0}${options2.blocking === true}${options2.enabled !== false}`;
|
|
3326
3395
|
}
|
|
3327
3396
|
function blocking() {
|
|
3328
3397
|
return ordered().some((layer) => layer.options.blocking === true);
|
|
@@ -3341,7 +3410,7 @@ function createShortcutManager(options = {}) {
|
|
|
3341
3410
|
}
|
|
3342
3411
|
function ordered() {
|
|
3343
3412
|
return [...layers].filter((layer) => layer.options.enabled !== false).sort(
|
|
3344
|
-
(a, b) => b.options.depth - a.options.depth || b.sequence - a.sequence
|
|
3413
|
+
(a, b) => (b.options.priority ?? 0) - (a.options.priority ?? 0) || b.options.depth - a.options.depth || b.sequence - a.sequence
|
|
3345
3414
|
);
|
|
3346
3415
|
}
|
|
3347
3416
|
function matchDepth(prepared, pressed) {
|
|
@@ -3792,7 +3861,8 @@ function useShortcuts(bindings, options) {
|
|
|
3792
3861
|
name: options.name,
|
|
3793
3862
|
depth,
|
|
3794
3863
|
enabled: options.enabled,
|
|
3795
|
-
blocking: options.blocking
|
|
3864
|
+
blocking: options.blocking,
|
|
3865
|
+
priority: options.priority
|
|
3796
3866
|
});
|
|
3797
3867
|
});
|
|
3798
3868
|
}
|
|
@@ -3970,6 +4040,7 @@ export {
|
|
|
3970
4040
|
badgeVariants,
|
|
3971
4041
|
buttonVariants,
|
|
3972
4042
|
cardVariants,
|
|
4043
|
+
commandDefaultFilter,
|
|
3973
4044
|
createShortcutManager,
|
|
3974
4045
|
dialogContentVariants,
|
|
3975
4046
|
inputVariants,
|