periplo-ui 4.16.0 → 4.16.2
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/components/data-display/DataTable/components/DataTableCell.js +1 -1
- package/dist/components/data-display/DataTable/components/DataTableCell.js.map +1 -1
- package/dist/components/data-display/DataTable/components/DataTableGroupRow.js +1 -1
- package/dist/components/data-display/DataTable/components/DataTableGroupRow.js.map +1 -1
- package/dist/components/data-display/Marquee/Marquee.js +2 -2
- package/dist/components/data-display/Marquee/Marquee.js.map +1 -1
- package/dist/components/data-display/NotificationBadge/NotificationBadge.js +1 -1
- package/dist/components/data-display/NotificationBadge/NotificationBadge.js.map +1 -1
- package/dist/components/data-display/Tooltip/Tooltip.js +1 -1
- package/dist/components/data-display/Tooltip/Tooltip.js.map +1 -1
- package/dist/components/feedback/Dialog/Dialog.js +2 -2
- package/dist/components/feedback/Dialog/Dialog.js.map +1 -1
- package/dist/components/feedback/Progress/Progress.js +1 -1
- package/dist/components/feedback/Progress/Progress.js.map +1 -1
- package/dist/components/feedback/Skeleton/Skeleton.js +1 -1
- package/dist/components/feedback/Skeleton/Skeleton.js.map +1 -1
- package/dist/components/inputs/Button/Button.js +1 -1
- package/dist/components/inputs/Button/Button.js.map +1 -1
- package/dist/components/inputs/Checkbox/Checkbox.js +1 -1
- package/dist/components/inputs/Checkbox/Checkbox.js.map +1 -1
- package/dist/components/inputs/Combobox/Combobox.js +2 -1
- package/dist/components/inputs/Combobox/Combobox.js.map +1 -1
- package/dist/components/inputs/Combobox/StaticComboboxList.js +1 -2
- package/dist/components/inputs/Combobox/StaticComboboxList.js.map +1 -1
- package/dist/components/inputs/Combobox/VirtualizedComboboxList.js +1 -2
- package/dist/components/inputs/Combobox/VirtualizedComboboxList.js.map +1 -1
- package/dist/components/inputs/InlineMultiSelect/InlineMultiSelect.js +12 -13
- package/dist/components/inputs/InlineMultiSelect/InlineMultiSelect.js.map +1 -1
- package/dist/components/inputs/Input/Input.js +1 -1
- package/dist/components/inputs/Input/Input.js.map +1 -1
- package/dist/components/inputs/InputDate/InputDate.js +1 -1
- package/dist/components/inputs/InputDate/InputDate.js.map +1 -1
- package/dist/components/inputs/LazyDatePicker/LazyDatePicker.js +1 -1
- package/dist/components/inputs/LazyDatePicker/LazyDatePicker.js.map +1 -1
- package/dist/components/inputs/MultiSelect/MultiSelect.js +12 -13
- package/dist/components/inputs/MultiSelect/MultiSelect.js.map +1 -1
- package/dist/components/inputs/PhoneInput/PhoneInput.js +2 -1
- package/dist/components/inputs/PhoneInput/PhoneInput.js.map +1 -1
- package/dist/components/inputs/RadioGroup/RadioGroup.js +1 -1
- package/dist/components/inputs/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/components/inputs/Select/Select.js +6 -5
- package/dist/components/inputs/Select/Select.js.map +1 -1
- package/dist/components/inputs/Textarea/Textarea.js +1 -1
- package/dist/components/inputs/Textarea/Textarea.js.map +1 -1
- package/dist/components/inputs/Toggle/Toggle.js +1 -1
- package/dist/components/inputs/Toggle/Toggle.js.map +1 -1
- package/dist/components/navigation/DropdownMenu/DropdownMenu.js +7 -6
- package/dist/components/navigation/DropdownMenu/DropdownMenu.js.map +1 -1
- package/dist/components/navigation/Sheet/Sheet.js +2 -2
- package/dist/components/navigation/Sheet/Sheet.js.map +1 -1
- package/dist/components/navigation/Sidebar/Sidebar.js +6 -2
- package/dist/components/navigation/Sidebar/Sidebar.js.map +1 -1
- package/dist/components/navigation/Sidebar/SidebarMenu.js +29 -55
- package/dist/components/navigation/Sidebar/SidebarMenu.js.map +1 -1
- package/dist/components/navigation/Sidebar/SidebarUser.d.ts +3 -1
- package/dist/components/navigation/Sidebar/SidebarUser.js +18 -5
- package/dist/components/navigation/Sidebar/SidebarUser.js.map +1 -1
- package/dist/components/navigation/Sidebar/index.js +2 -2
- package/dist/components/navigation/Sidebar/styles.d.ts +2 -2
- package/dist/components/navigation/Sidebar/styles.js +4 -2
- package/dist/components/navigation/Sidebar/styles.js.map +1 -1
- package/dist/components/navigation/Tabs/Tabs.js +1 -1
- package/dist/components/navigation/Tabs/Tabs.js.map +1 -1
- package/dist/components/surface/Accordion/Accordion.js +3 -3
- package/dist/components/surface/Accordion/Accordion.js.map +1 -1
- package/dist/components/utils/Command/Command.js +8 -7
- package/dist/components/utils/Command/Command.js.map +1 -1
- package/dist/components/utils/Popover/Popover.js +2 -1
- package/dist/components/utils/Popover/Popover.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/lib/surface.d.ts +5 -0
- package/dist/lib/surface.js +10 -0
- package/dist/lib/surface.js.map +1 -0
- package/dist/lib/useSlidingIndicator.d.ts +22 -0
- package/dist/lib/useSlidingIndicator.js +65 -0
- package/dist/lib/useSlidingIndicator.js.map +1 -0
- package/dist/theme.css +46 -26
- package/package.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
"use client";
|
|
3
3
|
import { cn } from "../../../lib/utils.js";
|
|
4
|
+
import { SURFACE_ITEM, SURFACE_LIST } from "../../../lib/surface.js";
|
|
4
5
|
import { Dialog, DialogContent } from "../../feedback/Dialog/Dialog.js";
|
|
5
6
|
import * as React$1 from "react";
|
|
6
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -9,7 +10,7 @@ import { Command as Command$1 } from "cmdk";
|
|
|
9
10
|
//#region src/components/utils/Command/Command.tsx
|
|
10
11
|
var Command = React$1.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(Command$1, {
|
|
11
12
|
ref,
|
|
12
|
-
className: cn("text-popover-foreground flex h-full w-full flex-col overflow-hidden
|
|
13
|
+
className: cn("text-popover-foreground flex h-full w-full flex-col overflow-hidden bg-white", className),
|
|
13
14
|
...props
|
|
14
15
|
}));
|
|
15
16
|
Command.displayName = Command$1.displayName;
|
|
@@ -17,7 +18,7 @@ var CommandDialog = ({ children, ...props }) => {
|
|
|
17
18
|
return /* @__PURE__ */ jsx(Dialog, {
|
|
18
19
|
...props,
|
|
19
20
|
children: /* @__PURE__ */ jsx(DialogContent, {
|
|
20
|
-
className: "overflow-hidden p-0",
|
|
21
|
+
className: cn(SURFACE_LIST, "overflow-hidden p-0"),
|
|
21
22
|
children: /* @__PURE__ */ jsx(Command, {
|
|
22
23
|
className: "[&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5 **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-neutral-400 **:[[cmdk-group]]:px-2 **:[[cmdk-input]]:h-12 **:[[cmdk-item]]:px-2 **:[[cmdk-item]]:py-3",
|
|
23
24
|
children
|
|
@@ -26,7 +27,7 @@ var CommandDialog = ({ children, ...props }) => {
|
|
|
26
27
|
});
|
|
27
28
|
};
|
|
28
29
|
var CommandInput = React$1.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs("div", {
|
|
29
|
-
className: "
|
|
30
|
+
className: "m-[calc(var(--surface-inset)*2)] flex h-12 items-center rounded-lg border border-neutral-200 px-3",
|
|
30
31
|
children: [
|
|
31
32
|
/* @__PURE__ */ jsx(Command$1.Input, {
|
|
32
33
|
ref,
|
|
@@ -43,7 +44,7 @@ var CommandInput = React$1.forwardRef(({ className, children, ...props }, ref) =
|
|
|
43
44
|
CommandInput.displayName = Command$1.Input.displayName;
|
|
44
45
|
var CommandList = React$1.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(Command$1.List, {
|
|
45
46
|
ref,
|
|
46
|
-
className: cn("relative max-h-75 overflow-x-hidden overflow-y-auto", className),
|
|
47
|
+
className: cn("relative max-h-75 overflow-x-hidden overflow-y-auto px-(--surface-inset) pb-(--surface-inset)", className),
|
|
47
48
|
...props
|
|
48
49
|
}));
|
|
49
50
|
CommandList.displayName = Command$1.List.displayName;
|
|
@@ -55,19 +56,19 @@ var CommandEmpty = React$1.forwardRef((props, ref) => /* @__PURE__ */ jsx(Comman
|
|
|
55
56
|
CommandEmpty.displayName = Command$1.Empty.displayName;
|
|
56
57
|
var CommandGroup = React$1.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(Command$1.Group, {
|
|
57
58
|
ref,
|
|
58
|
-
className: cn("text-foreground overflow-hidden
|
|
59
|
+
className: cn("text-foreground overflow-hidden text-left **:[[cmdk-group-heading]]:px-3 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-sm **:[[cmdk-group-heading]]:font-normal **:[[cmdk-group-heading]]:text-neutral-400", className),
|
|
59
60
|
...props
|
|
60
61
|
}));
|
|
61
62
|
CommandGroup.displayName = Command$1.Group.displayName;
|
|
62
63
|
var CommandSeparator = React$1.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(Command$1.Separator, {
|
|
63
64
|
ref,
|
|
64
|
-
className: cn("bg-border h-px", className),
|
|
65
|
+
className: cn("bg-border my-1 h-px", className),
|
|
65
66
|
...props
|
|
66
67
|
}));
|
|
67
68
|
CommandSeparator.displayName = Command$1.Separator.displayName;
|
|
68
69
|
var CommandItem = React$1.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(Command$1.Item, {
|
|
69
70
|
ref,
|
|
70
|
-
className: cn("data-[selected=true]:text-accent-foreground relative flex min-h-
|
|
71
|
+
className: cn(SURFACE_ITEM, "data-[selected=true]:text-accent-foreground relative flex min-h-10 items-center gap-2 px-3 py-2 text-sm outline-none select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-neutral-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", className),
|
|
71
72
|
...props
|
|
72
73
|
}));
|
|
73
74
|
CommandItem.displayName = Command$1.Item.displayName;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Command.js","names":["React","CommandPrimitive"],"sources":["../../../../src/components/utils/Command/Command.tsx"],"sourcesContent":["'use client'\n\nimport { MagnifyingGlassIcon } from '@phosphor-icons/react/dist/ssr/MagnifyingGlass'\nimport { type DialogProps } from '@radix-ui/react-dialog'\nimport { Command as CommandPrimitive } from 'cmdk'\nimport * as React from 'react'\n\nimport { Dialog, DialogContent } from '../../feedback/Dialog'\n\nimport { cn } from '@/lib/utils'\n\nconst Command = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive\n ref={ref}\n className={cn('text-popover-foreground flex h-full w-full flex-col overflow-hidden
|
|
1
|
+
{"version":3,"file":"Command.js","names":["React","CommandPrimitive"],"sources":["../../../../src/components/utils/Command/Command.tsx"],"sourcesContent":["'use client'\n\nimport { MagnifyingGlassIcon } from '@phosphor-icons/react/dist/ssr/MagnifyingGlass'\nimport { type DialogProps } from '@radix-ui/react-dialog'\nimport { Command as CommandPrimitive } from 'cmdk'\nimport * as React from 'react'\n\nimport { Dialog, DialogContent } from '../../feedback/Dialog'\n\nimport { SURFACE_ITEM, SURFACE_LIST } from '@/lib/surface'\nimport { cn } from '@/lib/utils'\n\nconst Command = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive\n ref={ref}\n className={cn('text-popover-foreground flex h-full w-full flex-col overflow-hidden bg-white', className)}\n {...props}\n />\n))\nCommand.displayName = CommandPrimitive.displayName\n\nconst CommandDialog = ({ children, ...props }: DialogProps) => {\n return (\n <Dialog {...props}>\n <DialogContent className={cn(SURFACE_LIST, 'overflow-hidden p-0')}>\n <Command className=\"[&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5 **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-neutral-400 **:[[cmdk-group]]:px-2 **:[[cmdk-input]]:h-12 **:[[cmdk-item]]:px-2 **:[[cmdk-item]]:py-3\">\n {children}\n </Command>\n </DialogContent>\n </Dialog>\n )\n}\n\nconst CommandInput = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.Input>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input>\n>(({ className, children, ...props }, ref) => (\n <div className=\"m-[calc(var(--surface-inset)*2)] flex h-12 items-center rounded-lg border border-neutral-200 px-3\">\n <CommandPrimitive.Input\n ref={ref}\n className={cn(\n 'flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-neutral-400 disabled:cursor-not-allowed disabled:opacity-50',\n className,\n )}\n {...props}\n />\n {children && <div className=\"ml-2\">{children}</div>}\n <MagnifyingGlassIcon className=\"ml-2 h-4 w-4 shrink-0 opacity-50\" />\n </div>\n))\n\nCommandInput.displayName = CommandPrimitive.Input.displayName\n\nconst CommandList = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.List\n ref={ref}\n className={cn(\n 'relative max-h-75 overflow-x-hidden overflow-y-auto px-(--surface-inset) pb-(--surface-inset)',\n className,\n )}\n {...props}\n />\n))\n\nCommandList.displayName = CommandPrimitive.List.displayName\n\nconst CommandEmpty = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.Empty>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>\n>((props, ref) => <CommandPrimitive.Empty ref={ref} className=\"py-6 text-center text-sm\" {...props} />)\n\nCommandEmpty.displayName = CommandPrimitive.Empty.displayName\n\nconst CommandGroup = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.Group>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Group\n ref={ref}\n className={cn(\n 'text-foreground overflow-hidden text-left **:[[cmdk-group-heading]]:px-3 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-sm **:[[cmdk-group-heading]]:font-normal **:[[cmdk-group-heading]]:text-neutral-400',\n className,\n )}\n {...props}\n />\n))\n\nCommandGroup.displayName = CommandPrimitive.Group.displayName\n\nconst CommandSeparator = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Separator ref={ref} className={cn('bg-border my-1 h-px', className)} {...props} />\n))\nCommandSeparator.displayName = CommandPrimitive.Separator.displayName\n\nconst CommandItem = React.forwardRef<\n React.ComponentRef<typeof CommandPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>\n>(({ className, ...props }, ref) => (\n <CommandPrimitive.Item\n ref={ref}\n className={cn(\n SURFACE_ITEM,\n 'data-[selected=true]:text-accent-foreground relative flex min-h-10 items-center gap-2 px-3 py-2 text-sm outline-none select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-neutral-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0',\n className,\n )}\n {...props}\n />\n))\n\nCommandItem.displayName = CommandPrimitive.Item.displayName\n\nconst CommandShortcut = ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => {\n return <span className={cn('ml-auto text-xs tracking-widest text-neutral-400', className)} {...props} />\n}\nCommandShortcut.displayName = 'CommandShortcut'\n\nexport {\n Command,\n CommandDialog,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n CommandSeparator,\n CommandShortcut,\n}\n"],"mappings":";;;;;;;;;;AAYA,IAAA,UAAA,QAAA,YAAA,EAAA,WAAA,GAAA,SAAA,QAAA,oBAAA,WAAA;CAKS;CACL,WAAA,GAAA,gFAAA,SAAA;CACA,GAAA;AACD,CAAA,CAAA;AAEH,QAAA,cAAA,UAAA;AAEA,IAAA,iBAAA,EAAA,UAAA,GAAA,YAAA;CACE,OAAA,oBAAA,QAAA;EACU,GAAA;EACN,UAAA,oBAAA,eAAA;GAAe,WAAA,GAAA,cAAA,qBAAA;GACb,UAAA,oBAAA,SAAA;IAAS,WAAA;IACN;GACM,CAAA;EACI,CAAA;CACT,CAAA;AAEZ;AAEA,IAAA,eAAA,QAAA,YAAA,EAAA,WAAA,UAAA,GAAA,SAAA,QAAA,qBAAA,OAAA;CAIO,WAAA;CAAL,UAAA;EACE,oBAAA,UAAA,OAAA;GACO;GACL,WAAA,GAAA,qJAAA,SAAA;GAIA,GAAA;EACD,CAAA;EACA,YAAA,oBAAA,OAAA;GAAiB,WAAA;GAAkB;EAAc,CAAA;EAClD,oBAAA,qBAAA,EAAA,WAAA,mCAAA,CAAA;CACG;AACN,CAAA,CAAA;AAED,aAAA,cAAA,UAAA,MAAA;AAEA,IAAA,cAAA,QAAA,YAAA,EAAA,WAAA,GAAA,SAAA,QAAA,oBAAA,UAAA,MAAA;CAKS;CACL,WAAA,GAAA,iGAAA,SAAA;CAIA,GAAA;AACD,CAAA,CAAA;AAGH,YAAA,cAAA,UAAA,KAAA;AAEA,IAAA,eAAA,QAAA,YAAA,OAAA,QAAA,oBAAA,UAAA,OAAA;CAG+C;CAAK,WAAA;CAAqC,GAAA;AAAY,CAAA,CAAA;AAErG,aAAA,cAAA,UAAA,MAAA;AAEA,IAAA,eAAA,QAAA,YAAA,EAAA,WAAA,GAAA,SAAA,QAAA,oBAAA,UAAA,OAAA;CAKS;CACL,WAAA,GAAA,gOAAA,SAAA;CAIA,GAAA;AACD,CAAA,CAAA;AAGH,aAAA,cAAA,UAAA,MAAA;AAEA,IAAA,mBAAA,QAAA,YAAA,EAAA,WAAA,GAAA,SAAA,QAAA,oBAAA,UAAA,WAAA;CAImC;CAAK,WAAA,GAAA,uBAAA,SAAA;CAAiD,GAAA;AAAY,CAAA,CAAA;AAErG,iBAAA,cAAA,UAAA,UAAA;AAEA,IAAA,cAAA,QAAA,YAAA,EAAA,WAAA,GAAA,SAAA,QAAA,oBAAA,UAAA,MAAA;CAKS;CACL,WAAA,GAAA,cAAA,4SAAA,SAAA;CAKA,GAAA;AACD,CAAA,CAAA;AAGH,YAAA,cAAA,UAAA,KAAA;AAEA,IAAA,mBAAA,EAAA,WAAA,GAAA,YAAA;CACE,OAAA,oBAAA,QAAA;EAAa,WAAA,GAAA,oDAAA,SAAA;EAA8E,GAAA;CAAY,CAAA;AACzG;AACA,gBAAA,cAAA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { cn } from "../../../lib/utils.js";
|
|
2
|
+
import { SURFACE } from "../../../lib/surface.js";
|
|
2
3
|
import * as React$1 from "react";
|
|
3
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
5
|
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
@@ -30,7 +31,7 @@ var PopoverContent = React$1.forwardRef(({ className, align = "center", sideOffs
|
|
|
30
31
|
sideOffset,
|
|
31
32
|
side,
|
|
32
33
|
collisionPadding,
|
|
33
|
-
className: cn("
|
|
34
|
+
className: cn(SURFACE, "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-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 ease-out-strong motion-reduce:data-[state=closed]:zoom-out-100 motion-reduce:data-[state=open]:zoom-in-100 motion-reduce:data-[side=bottom]:slide-in-from-top-0 motion-reduce:data-[side=left]:slide-in-from-right-0 motion-reduce:data-[side=right]:slide-in-from-left-0 motion-reduce:data-[side=top]:slide-in-from-bottom-0", "text-popover-foreground z-50 max-h-[--radix-popover-content-available-height] w-(--radix-popover-trigger-width) min-w-50 origin-(--radix-popover-content-transform-origin) border bg-white p-4 text-center shadow-md outline-none", className),
|
|
34
35
|
...props
|
|
35
36
|
})
|
|
36
37
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Popover.js","names":["React"],"sources":["../../../../src/components/utils/Popover/Popover.tsx"],"sourcesContent":["import * as PopoverPrimitive from '@radix-ui/react-popover'\nimport * as React from 'react'\n\nimport { cn } from '@/lib/utils'\n\n/**\n * Root component for the Popover.\n * Manages the state and accessibility of the popover dialog.\n */\nconst PopoverRoot = PopoverPrimitive.Root\n\n/**\n * The button that triggers the popover to open/close.\n * Must be wrapped in a Popover component.\n */\nconst PopoverTrigger = PopoverPrimitive.Trigger\n\n/**\n * Optional anchor element that positions the popover.\n * Useful when the trigger element is not where you want the popover to be anchored.\n */\nconst PopoverAnchor = PopoverPrimitive.Anchor\n\nexport type PopoverProps = {\n /**\n * Content to be displayed inside the popover.\n * Can be either a React element or a string.\n */\n children: React.ReactElement | string\n\n /**\n * Element that triggers the popover when interacted with.\n * Can be either a React element or a string.\n * @example <PopoverComponent triggerElement={<Button>Click me</Button>} />\n */\n triggerElement: React.ReactElement | string\n\n /**\n * Position of the popover relative to the trigger element.\n * @default bottom\n */\n side?: 'top' | 'right' | 'bottom' | 'left'\n\n /**\n * Additional CSS classes to be applied to the popover content.\n */\n className?: string\n\n /**\n * Alignment of the popover relative to the trigger element.\n * @default center\n */\n align?: 'start' | 'center' | 'end'\n\n /**\n * Distance in pixels between the trigger element and the popover.\n * @default 4\n */\n sideOffset?: number\n\n /**\n * Container element to position the popover relative to.\n * @default document.body\n */\n container?: HTMLElement\n\n /**\n * The minimum distance in pixels to keep between the popover and the boundary (usually the viewport) edges.\n * Can be a single number applied to all sides, or an object to configure each side individually.\n * @default 8\n */\n collisionPadding?: number | Partial<Record<'top' | 'right' | 'bottom' | 'left', number>>\n}\n\n/**\n * PopoverContent component that renders the actual popover content.\n * Handled internally by the PopoverComponent.\n */\nconst PopoverContent = React.forwardRef<\n React.ComponentRef<typeof PopoverPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content> & { container?: HTMLElement }\n>(\n (\n { className, align = 'center', sideOffset = 4, side = 'bottom', collisionPadding = 8, container, ...props },\n ref,\n ) => (\n <PopoverPrimitive.Portal container={container}>\n <PopoverPrimitive.Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n side={side}\n collisionPadding={collisionPadding}\n className={cn(\n '
|
|
1
|
+
{"version":3,"file":"Popover.js","names":["React"],"sources":["../../../../src/components/utils/Popover/Popover.tsx"],"sourcesContent":["import * as PopoverPrimitive from '@radix-ui/react-popover'\nimport * as React from 'react'\n\nimport { SURFACE } from '@/lib/surface'\nimport { cn } from '@/lib/utils'\n\n/**\n * Root component for the Popover.\n * Manages the state and accessibility of the popover dialog.\n */\nconst PopoverRoot = PopoverPrimitive.Root\n\n/**\n * The button that triggers the popover to open/close.\n * Must be wrapped in a Popover component.\n */\nconst PopoverTrigger = PopoverPrimitive.Trigger\n\n/**\n * Optional anchor element that positions the popover.\n * Useful when the trigger element is not where you want the popover to be anchored.\n */\nconst PopoverAnchor = PopoverPrimitive.Anchor\n\nexport type PopoverProps = {\n /**\n * Content to be displayed inside the popover.\n * Can be either a React element or a string.\n */\n children: React.ReactElement | string\n\n /**\n * Element that triggers the popover when interacted with.\n * Can be either a React element or a string.\n * @example <PopoverComponent triggerElement={<Button>Click me</Button>} />\n */\n triggerElement: React.ReactElement | string\n\n /**\n * Position of the popover relative to the trigger element.\n * @default bottom\n */\n side?: 'top' | 'right' | 'bottom' | 'left'\n\n /**\n * Additional CSS classes to be applied to the popover content.\n */\n className?: string\n\n /**\n * Alignment of the popover relative to the trigger element.\n * @default center\n */\n align?: 'start' | 'center' | 'end'\n\n /**\n * Distance in pixels between the trigger element and the popover.\n * @default 4\n */\n sideOffset?: number\n\n /**\n * Container element to position the popover relative to.\n * @default document.body\n */\n container?: HTMLElement\n\n /**\n * The minimum distance in pixels to keep between the popover and the boundary (usually the viewport) edges.\n * Can be a single number applied to all sides, or an object to configure each side individually.\n * @default 8\n */\n collisionPadding?: number | Partial<Record<'top' | 'right' | 'bottom' | 'left', number>>\n}\n\n/**\n * PopoverContent component that renders the actual popover content.\n * Handled internally by the PopoverComponent.\n */\nconst PopoverContent = React.forwardRef<\n React.ComponentRef<typeof PopoverPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content> & { container?: HTMLElement }\n>(\n (\n { className, align = 'center', sideOffset = 4, side = 'bottom', collisionPadding = 8, container, ...props },\n ref,\n ) => (\n <PopoverPrimitive.Portal container={container}>\n <PopoverPrimitive.Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n side={side}\n collisionPadding={collisionPadding}\n className={cn(\n SURFACE,\n 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-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 ease-out-strong motion-reduce:data-[state=closed]:zoom-out-100 motion-reduce:data-[state=open]:zoom-in-100 motion-reduce:data-[side=bottom]:slide-in-from-top-0 motion-reduce:data-[side=left]:slide-in-from-right-0 motion-reduce:data-[side=right]:slide-in-from-left-0 motion-reduce:data-[side=top]:slide-in-from-bottom-0',\n 'text-popover-foreground z-50 max-h-[--radix-popover-content-available-height] w-(--radix-popover-trigger-width) min-w-50 origin-(--radix-popover-content-transform-origin) border bg-white p-4 text-center shadow-md outline-none',\n className,\n )}\n {...props}\n />\n </PopoverPrimitive.Portal>\n ),\n)\nPopoverContent.displayName = PopoverPrimitive.Content.displayName\n\n/**\n * A versatile Popover component that displays floating content when triggered.\n * Built on top of Radix UI's Popover primitives.\n *\n * @example\n * // Basic usage\n * <PopoverComponent\n * triggerElement={<Button>Click me</Button>}\n * side=\"bottom\"\n * >\n * Popover content\n * </PopoverComponent>\n *\n * // With custom alignment and offset\n * <PopoverComponent\n * triggerElement={<Button>Settings</Button>}\n * side=\"right\"\n * align=\"start\"\n * sideOffset={8}\n * >\n * <div>Custom content</div>\n * </PopoverComponent>\n */\nexport const Popover = ({\n side,\n triggerElement,\n children,\n className,\n align = 'center',\n sideOffset = 4,\n container,\n collisionPadding,\n}: Readonly<PopoverProps>) => {\n return (\n <PopoverRoot>\n <PopoverTrigger asChild>\n {typeof triggerElement === 'string' ? <span className=\"cursor-pointer\">{triggerElement}</span> : triggerElement}\n </PopoverTrigger>\n <PopoverContent\n container={container}\n side={side}\n className={className}\n align={align}\n sideOffset={sideOffset}\n collisionPadding={collisionPadding}\n >\n {children}\n </PopoverContent>\n </PopoverRoot>\n )\n}\n\nexport { PopoverAnchor, PopoverContent, PopoverRoot, PopoverTrigger }\n"],"mappings":";;;;;;;;;;AAUA,IAAM,cAAc,iBAAiB;;;;;AAMrC,IAAM,iBAAiB,iBAAiB;;;;;AAMxC,IAAM,gBAAgB,iBAAiB;;;;;AAyDvC,IAAM,iBAAiBA,QAAM,YAKzB,EAAE,WAAW,QAAQ,UAAU,aAAa,GAAG,OAAO,UAAU,mBAAmB,GAAG,WAAW,GAAG,SACpG,QAEA,oBAAC,iBAAiB,QAAlB;CAAoC;CAClC,UAAA,oBAAC,iBAAiB,SAAlB;EACO;EACE;EACK;EACN;EACY;EAClB,WAAW,GACT,SACA,mpBACA,qOACA,SACF;EACA,GAAI;CACL,CAAA;AACsB,CAAA,CAE7B;AACA,eAAe,cAAc,iBAAiB,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;AAyBtD,IAAa,WAAW,EACtB,MACA,gBACA,UACA,WACA,QAAQ,UACR,aAAa,GACb,WACA,uBAC4B;CAC5B,OACE,qBAAC,aAAD,EAAA,UAAA,CACE,oBAAC,gBAAD;EAAgB,SAAA;EACb,UAAA,OAAO,mBAAmB,WAAW,oBAAC,QAAD;GAAM,WAAU;GAAkB,UAAA;EAAqB,CAAA,IAAI;CACnF,CAAA,GAChB,oBAAC,gBAAD;EACa;EACL;EACK;EACJ;EACK;EACM;EAEjB;CACa,CAAA,CACL,EAAA,CAAA;AAEjB"}
|
package/dist/index.js
CHANGED
|
@@ -53,6 +53,6 @@ import { useSidebar } from "./components/navigation/Sidebar/context.js";
|
|
|
53
53
|
import { SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarHeaderTrigger, SidebarInput, SidebarLogo, SidebarProvider, SidebarRoot, SidebarSeparator, SidebarTrigger, sidebarGroupActionVariants, sidebarGroupLabelVariants } from "./components/navigation/Sidebar/Sidebar.js";
|
|
54
54
|
import { SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuCollapsible, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, sidebarMenuActionVariants, sidebarMenuBadgeVariants, sidebarMenuButtonVariants, sidebarMenuSubButtonVariants, sidebarMenuSubVariants } from "./components/navigation/Sidebar/SidebarMenu.js";
|
|
55
55
|
import { SidebarInset, SidebarPageContent, SidebarPageHeader } from "./components/navigation/Sidebar/SidebarPage.js";
|
|
56
|
-
import { SidebarUser, SidebarUserMenuContent, SidebarUserMenuItem, SidebarUserMenuLabel, SidebarUserMenuSeparator, SidebarUserMenuSubContent, SidebarUserMenuSubTrigger } from "./components/navigation/Sidebar/SidebarUser.js";
|
|
56
|
+
import { SidebarUser, SidebarUserMenuContent, SidebarUserMenuItem, SidebarUserMenuLabel, SidebarUserMenuRadioGroup, SidebarUserMenuRadioItem, SidebarUserMenuSeparator, SidebarUserMenuSubContent, SidebarUserMenuSubTrigger } from "./components/navigation/Sidebar/SidebarUser.js";
|
|
57
57
|
import { Tabs, TabsContent, TabsLink, TabsList, TabsTrigger } from "./components/navigation/Tabs/Tabs.js";
|
|
58
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Avatar, AvatarFallback, AvatarGroup, AvatarImage, Badge, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbRoot, BreadcrumbSeparator, Button, Calendar, Card, CardContent, CardMedia, Carousel, CarouselContent, CarouselContext, CarouselItem, CarouselNext, CarouselPrevious, Checkbox, Chip, CollapsibleContent, CollapsibleRoot, CollapsibleTrigger, Combobox, ComboboxOptionWithTooltip, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, CountrySelect, DataTable, DatePicker, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Flag, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, InlineMultiSelect, Input, InputDate, Label, LazyDatePicker, Marquee, MultiSelect, NavigationBreadcrumb, NotificationBadge, PagesBreadcrumb, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, PaginationRoot, PhoneInput, Popover, PopoverAnchor, PopoverContent, PopoverRoot, PopoverTrigger, Progress, RadioGroup, RadioGroupItem, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectRoot, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetRoot, SheetTitle, SheetTrigger, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarHeaderTrigger, SidebarInput, SidebarInset, SidebarLogo, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuCollapsible, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarPageContent, SidebarPageHeader, SidebarProvider, SidebarRoot, SidebarSeparator, SidebarTrigger, SidebarUser, SidebarUserMenuContent, SidebarUserMenuItem, SidebarUserMenuLabel, SidebarUserMenuSeparator, SidebarUserMenuSubContent, SidebarUserMenuSubTrigger, Skeleton, StarRating, StaticComboboxList, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsLink, TabsList, TabsTrigger, Textarea, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipPortal, TooltipProvider, TooltipRoot, TooltipTrigger, TruncatedTypographyWithTooltip, Typography, VirtualizedComboboxList, badgeVariants, buttonVariants, chipVariants, flagVariants, isValidPhone, isoFromDialCode, notificationBadgeVariants, sidebarGroupActionVariants, sidebarGroupLabelVariants, sidebarMenuActionVariants, sidebarMenuBadgeVariants, sidebarMenuButtonVariants, sidebarMenuSubButtonVariants, sidebarMenuSubVariants, splitE164, toast, toggleVariants, typographyVariants, useCombobox, useFormField, useSidebar };
|
|
58
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Avatar, AvatarFallback, AvatarGroup, AvatarImage, Badge, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbRoot, BreadcrumbSeparator, Button, Calendar, Card, CardContent, CardMedia, Carousel, CarouselContent, CarouselContext, CarouselItem, CarouselNext, CarouselPrevious, Checkbox, Chip, CollapsibleContent, CollapsibleRoot, CollapsibleTrigger, Combobox, ComboboxOptionWithTooltip, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, CountrySelect, DataTable, DatePicker, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Flag, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, InlineMultiSelect, Input, InputDate, Label, LazyDatePicker, Marquee, MultiSelect, NavigationBreadcrumb, NotificationBadge, PagesBreadcrumb, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, PaginationRoot, PhoneInput, Popover, PopoverAnchor, PopoverContent, PopoverRoot, PopoverTrigger, Progress, RadioGroup, RadioGroupItem, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectRoot, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetRoot, SheetTitle, SheetTrigger, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarHeaderTrigger, SidebarInput, SidebarInset, SidebarLogo, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuCollapsible, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarPageContent, SidebarPageHeader, SidebarProvider, SidebarRoot, SidebarSeparator, SidebarTrigger, SidebarUser, SidebarUserMenuContent, SidebarUserMenuItem, SidebarUserMenuLabel, SidebarUserMenuRadioGroup, SidebarUserMenuRadioItem, SidebarUserMenuSeparator, SidebarUserMenuSubContent, SidebarUserMenuSubTrigger, Skeleton, StarRating, StaticComboboxList, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsLink, TabsList, TabsTrigger, Textarea, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipPortal, TooltipProvider, TooltipRoot, TooltipTrigger, TruncatedTypographyWithTooltip, Typography, VirtualizedComboboxList, badgeVariants, buttonVariants, chipVariants, flagVariants, isValidPhone, isoFromDialCode, notificationBadgeVariants, sidebarGroupActionVariants, sidebarGroupLabelVariants, sidebarMenuActionVariants, sidebarMenuBadgeVariants, sidebarMenuButtonVariants, sidebarMenuSubButtonVariants, sidebarMenuSubVariants, splitE164, toast, toggleVariants, typographyVariants, useCombobox, useFormField, useSidebar };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
declare const SURFACE = "[--surface-radius:0.5rem] rounded-(--surface-radius)";
|
|
2
|
+
declare const SURFACE_INSET = "[--surface-inset:0.25rem] p-(--surface-inset) [--surface-item-radius:max(0px,calc(var(--surface-radius)-var(--surface-inset)))]";
|
|
3
|
+
declare const SURFACE_LIST = "[--surface-radius:1rem] rounded-(--surface-radius) [--surface-inset:0.5rem] [--surface-item-radius:max(0px,calc(var(--surface-radius)-var(--surface-inset)))]";
|
|
4
|
+
declare const SURFACE_ITEM = "rounded-(--surface-item-radius)";
|
|
5
|
+
export { SURFACE, SURFACE_INSET, SURFACE_ITEM, SURFACE_LIST };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
//#region src/lib/surface.ts
|
|
2
|
+
var SURFACE_ITEM_RADIUS = "[--surface-item-radius:max(0px,calc(var(--surface-radius)-var(--surface-inset)))]";
|
|
3
|
+
var SURFACE = "[--surface-radius:0.5rem] rounded-(--surface-radius)";
|
|
4
|
+
var SURFACE_INSET = `[--surface-inset:0.25rem] p-(--surface-inset) ${SURFACE_ITEM_RADIUS}`;
|
|
5
|
+
var SURFACE_LIST = `[--surface-radius:1rem] rounded-(--surface-radius) [--surface-inset:0.5rem] ${SURFACE_ITEM_RADIUS}`;
|
|
6
|
+
var SURFACE_ITEM = "rounded-(--surface-item-radius)";
|
|
7
|
+
//#endregion
|
|
8
|
+
export { SURFACE, SURFACE_INSET, SURFACE_ITEM, SURFACE_LIST };
|
|
9
|
+
|
|
10
|
+
//# sourceMappingURL=surface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"surface.js","names":[],"sources":["../../src/lib/surface.ts"],"sourcesContent":["const SURFACE_ITEM_RADIUS = '[--surface-item-radius:max(0px,calc(var(--surface-radius)-var(--surface-inset)))]'\n\nconst SURFACE = '[--surface-radius:0.5rem] rounded-(--surface-radius)'\n\nconst SURFACE_INSET = `[--surface-inset:0.25rem] p-(--surface-inset) ${SURFACE_ITEM_RADIUS}`\n\nconst SURFACE_LIST = `[--surface-radius:1rem] rounded-(--surface-radius) [--surface-inset:0.5rem] ${SURFACE_ITEM_RADIUS}`\n\nconst SURFACE_ITEM = 'rounded-(--surface-item-radius)'\n\nexport { SURFACE, SURFACE_INSET, SURFACE_ITEM, SURFACE_LIST }\n"],"mappings":";AAAA,IAAM,sBAAsB;AAE5B,IAAM,UAAU;AAEhB,IAAM,gBAAgB,iDAAiD;AAEvE,IAAM,eAAe,+EAA+E;AAEpG,IAAM,eAAe"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
type Measurement = Record<string, number | string | undefined>;
|
|
3
|
+
type SlidingIndicator<M extends Measurement> = M & {
|
|
4
|
+
visible: boolean;
|
|
5
|
+
slide: boolean;
|
|
6
|
+
};
|
|
7
|
+
type SlidingIndicatorOptions<M extends Measurement> = {
|
|
8
|
+
activeSelector: string;
|
|
9
|
+
stateAttribute: string;
|
|
10
|
+
measure: (active: HTMLElement) => M;
|
|
11
|
+
};
|
|
12
|
+
declare function useSlidingIndicator<M extends Measurement>(listRef: React.RefObject<HTMLElement | null>, { activeSelector, stateAttribute, measure }: SlidingIndicatorOptions<M>): SlidingIndicator<M> | null;
|
|
13
|
+
declare function slidingIndicatorProps(indicator: {
|
|
14
|
+
visible: boolean;
|
|
15
|
+
slide: boolean;
|
|
16
|
+
} | null): {
|
|
17
|
+
readonly 'data-indicator': "hidden" | "visible";
|
|
18
|
+
readonly 'data-indicator-slide': boolean | undefined;
|
|
19
|
+
};
|
|
20
|
+
declare const SLIDING_INDICATOR_VERTICAL = "before:opacity-0 before:ease-out-strong before:transition-opacity data-[indicator=visible]:before:opacity-100 data-[indicator-slide=true]:before:transition-[opacity,translate,height] motion-reduce:before:transition-none";
|
|
21
|
+
export { useSlidingIndicator, slidingIndicatorProps, SLIDING_INDICATOR_VERTICAL };
|
|
22
|
+
export type { SlidingIndicator };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
//#region src/lib/useSlidingIndicator.ts
|
|
3
|
+
function isSameMeasurement(current, next) {
|
|
4
|
+
return Object.keys(next).every((key) => current[key] === next[key]);
|
|
5
|
+
}
|
|
6
|
+
function useSlidingIndicator(listRef, { activeSelector, stateAttribute, measure }) {
|
|
7
|
+
const measureRef = React$1.useRef(measure);
|
|
8
|
+
React$1.useEffect(() => {
|
|
9
|
+
measureRef.current = measure;
|
|
10
|
+
});
|
|
11
|
+
const [indicator, setIndicator] = React$1.useState(null);
|
|
12
|
+
React$1.useLayoutEffect(() => {
|
|
13
|
+
const list = listRef.current;
|
|
14
|
+
if (!list) return;
|
|
15
|
+
const resizeObserver = new ResizeObserver(() => update());
|
|
16
|
+
const observeChildren = () => Array.from(list.children).forEach((child) => resizeObserver.observe(child));
|
|
17
|
+
const update = () => {
|
|
18
|
+
observeChildren();
|
|
19
|
+
const active = list.querySelector(activeSelector);
|
|
20
|
+
setIndicator((prev) => {
|
|
21
|
+
if (!active) return prev?.visible ? {
|
|
22
|
+
...prev,
|
|
23
|
+
visible: false,
|
|
24
|
+
slide: false
|
|
25
|
+
} : prev;
|
|
26
|
+
const next = measureRef.current(active);
|
|
27
|
+
if (prev?.visible && isSameMeasurement(prev, next)) return prev;
|
|
28
|
+
return {
|
|
29
|
+
...next,
|
|
30
|
+
visible: true,
|
|
31
|
+
slide: Boolean(prev?.visible)
|
|
32
|
+
};
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
update();
|
|
36
|
+
const mutationObserver = new MutationObserver(update);
|
|
37
|
+
mutationObserver.observe(list, {
|
|
38
|
+
subtree: true,
|
|
39
|
+
childList: true,
|
|
40
|
+
attributes: true,
|
|
41
|
+
attributeFilter: [stateAttribute]
|
|
42
|
+
});
|
|
43
|
+
resizeObserver.observe(list);
|
|
44
|
+
return () => {
|
|
45
|
+
mutationObserver.disconnect();
|
|
46
|
+
resizeObserver.disconnect();
|
|
47
|
+
};
|
|
48
|
+
}, [
|
|
49
|
+
listRef,
|
|
50
|
+
activeSelector,
|
|
51
|
+
stateAttribute
|
|
52
|
+
]);
|
|
53
|
+
return indicator;
|
|
54
|
+
}
|
|
55
|
+
function slidingIndicatorProps(indicator) {
|
|
56
|
+
return {
|
|
57
|
+
"data-indicator": indicator?.visible ? "visible" : "hidden",
|
|
58
|
+
"data-indicator-slide": indicator?.slide
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
var SLIDING_INDICATOR_VERTICAL = "before:opacity-0 before:ease-out-strong before:transition-opacity data-[indicator=visible]:before:opacity-100 data-[indicator-slide=true]:before:transition-[opacity,translate,height] motion-reduce:before:transition-none";
|
|
62
|
+
//#endregion
|
|
63
|
+
export { SLIDING_INDICATOR_VERTICAL, slidingIndicatorProps, useSlidingIndicator };
|
|
64
|
+
|
|
65
|
+
//# sourceMappingURL=useSlidingIndicator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSlidingIndicator.js","names":["React"],"sources":["../../src/lib/useSlidingIndicator.ts"],"sourcesContent":["import * as React from 'react'\n\ntype Measurement = Record<string, number | string | undefined>\n\ntype SlidingIndicator<M extends Measurement> = M & { visible: boolean; slide: boolean }\n\ntype SlidingIndicatorOptions<M extends Measurement> = {\n activeSelector: string\n stateAttribute: string\n measure: (active: HTMLElement) => M\n}\n\nfunction isSameMeasurement(current: Measurement, next: Measurement) {\n return Object.keys(next).every((key) => current[key] === next[key])\n}\n\nfunction useSlidingIndicator<M extends Measurement>(\n listRef: React.RefObject<HTMLElement | null>,\n { activeSelector, stateAttribute, measure }: SlidingIndicatorOptions<M>,\n) {\n const measureRef = React.useRef(measure)\n React.useEffect(() => {\n measureRef.current = measure\n })\n const [indicator, setIndicator] = React.useState<SlidingIndicator<M> | null>(null)\n\n React.useLayoutEffect(() => {\n const list = listRef.current\n if (!list) {\n return\n }\n\n const resizeObserver = new ResizeObserver(() => update())\n const observeChildren = () => Array.from(list.children).forEach((child) => resizeObserver.observe(child))\n\n const update = () => {\n observeChildren()\n const active = list.querySelector<HTMLElement>(activeSelector)\n setIndicator((prev) => {\n if (!active) {\n return prev?.visible ? { ...prev, visible: false, slide: false } : prev\n }\n const next = measureRef.current(active)\n if (prev?.visible && isSameMeasurement(prev, next)) {\n return prev\n }\n return { ...next, visible: true, slide: Boolean(prev?.visible) }\n })\n }\n\n update()\n const mutationObserver = new MutationObserver(update)\n mutationObserver.observe(list, {\n subtree: true,\n childList: true,\n attributes: true,\n attributeFilter: [stateAttribute],\n })\n resizeObserver.observe(list)\n return () => {\n mutationObserver.disconnect()\n resizeObserver.disconnect()\n }\n }, [listRef, activeSelector, stateAttribute])\n\n return indicator\n}\n\nfunction slidingIndicatorProps(indicator: { visible: boolean; slide: boolean } | null) {\n return {\n 'data-indicator': indicator?.visible ? 'visible' : 'hidden',\n 'data-indicator-slide': indicator?.slide,\n } as const\n}\n\nconst SLIDING_INDICATOR_VERTICAL =\n 'before:opacity-0 before:ease-out-strong before:transition-opacity data-[indicator=visible]:before:opacity-100 data-[indicator-slide=true]:before:transition-[opacity,translate,height] motion-reduce:before:transition-none'\n\nexport { useSlidingIndicator, slidingIndicatorProps, SLIDING_INDICATOR_VERTICAL }\nexport type { SlidingIndicator }\n"],"mappings":";;AAYA,SAAS,kBAAkB,SAAsB,MAAmB;CAClE,OAAO,OAAO,KAAK,IAAI,CAAC,CAAC,OAAO,QAAQ,QAAQ,SAAS,KAAK,IAAI;AACpE;AAEA,SAAS,oBACP,SACA,EAAE,gBAAgB,gBAAgB,WAClC;CACA,MAAM,aAAaA,QAAM,OAAO,OAAO;CACvC,QAAM,gBAAgB;EACpB,WAAW,UAAU;CACvB,CAAC;CACD,MAAM,CAAC,WAAW,gBAAgBA,QAAM,SAAqC,IAAI;CAEjF,QAAM,sBAAsB;EAC1B,MAAM,OAAO,QAAQ;EACrB,IAAI,CAAC,MACH;EAGF,MAAM,iBAAiB,IAAI,qBAAqB,OAAO,CAAC;EACxD,MAAM,wBAAwB,MAAM,KAAK,KAAK,QAAQ,CAAC,CAAC,SAAS,UAAU,eAAe,QAAQ,KAAK,CAAC;EAExG,MAAM,eAAe;GACnB,gBAAgB;GAChB,MAAM,SAAS,KAAK,cAA2B,cAAc;GAC7D,cAAc,SAAS;IACrB,IAAI,CAAC,QACH,OAAO,MAAM,UAAU;KAAE,GAAG;KAAM,SAAS;KAAO,OAAO;IAAM,IAAI;IAErE,MAAM,OAAO,WAAW,QAAQ,MAAM;IACtC,IAAI,MAAM,WAAW,kBAAkB,MAAM,IAAI,GAC/C,OAAO;IAET,OAAO;KAAE,GAAG;KAAM,SAAS;KAAM,OAAO,QAAQ,MAAM,OAAO;IAAE;GACjE,CAAC;EACH;EAEA,OAAO;EACP,MAAM,mBAAmB,IAAI,iBAAiB,MAAM;EACpD,iBAAiB,QAAQ,MAAM;GAC7B,SAAS;GACT,WAAW;GACX,YAAY;GACZ,iBAAiB,CAAC,cAAc;EAClC,CAAC;EACD,eAAe,QAAQ,IAAI;EAC3B,aAAa;GACX,iBAAiB,WAAW;GAC5B,eAAe,WAAW;EAC5B;CACF,GAAG;EAAC;EAAS;EAAgB;CAAc,CAAC;CAE5C,OAAO;AACT;AAEA,SAAS,sBAAsB,WAAwD;CACrF,OAAO;EACL,kBAAkB,WAAW,UAAU,YAAY;EACnD,wBAAwB,WAAW;CACrC;AACF;AAEA,IAAM,6BACJ"}
|
package/dist/theme.css
CHANGED
|
@@ -135,15 +135,17 @@
|
|
|
135
135
|
--shadow-tooltip: 0 2px 5px 2px rgba(0, 0, 0, 0.1);
|
|
136
136
|
--shadow-toast: 0 4px 12px #0000001a;
|
|
137
137
|
|
|
138
|
+
--ease-out-strong: cubic-bezier(0.23, 1, 0.32, 1);
|
|
139
|
+
--ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
|
|
140
|
+
--default-transition-timing-function: ease;
|
|
141
|
+
|
|
138
142
|
--border-width-1_5: 1.5px;
|
|
139
143
|
|
|
140
144
|
--animate-marquee: marquee 60s infinite linear;
|
|
141
145
|
--animate-marquee-vertical: marquee-vertical 60s linear infinite;
|
|
142
|
-
--animate-accordion-down: accordion-down 0.2s ease-out;
|
|
143
|
-
--animate-accordion-up: accordion-up 0.2s ease-out;
|
|
144
|
-
--animate-
|
|
145
|
-
--animate-shine-infinite: shine-infinite 10s ease infinite;
|
|
146
|
-
--animate-icon-down-up: icon-down-up 0.2s ease-out;
|
|
146
|
+
--animate-accordion-down: accordion-down 0.2s var(--ease-out-strong);
|
|
147
|
+
--animate-accordion-up: accordion-up 0.2s var(--ease-out-strong);
|
|
148
|
+
--animate-icon-down-up: icon-down-up 0.2s var(--ease-out-strong);
|
|
147
149
|
--animate-indeterminate: indeterminate 2s infinite linear;
|
|
148
150
|
|
|
149
151
|
@keyframes marquee {
|
|
@@ -182,27 +184,6 @@
|
|
|
182
184
|
}
|
|
183
185
|
}
|
|
184
186
|
|
|
185
|
-
@keyframes shine {
|
|
186
|
-
0% {
|
|
187
|
-
background-position: 200% 0;
|
|
188
|
-
}
|
|
189
|
-
100% {
|
|
190
|
-
background-position: -100% 0;
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
@keyframes shine-infinite {
|
|
195
|
-
0% {
|
|
196
|
-
background-position: 200% 0;
|
|
197
|
-
}
|
|
198
|
-
10% {
|
|
199
|
-
background-position: -100% 0;
|
|
200
|
-
}
|
|
201
|
-
100% {
|
|
202
|
-
background-position: -100% 0;
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
|
|
206
187
|
@keyframes icon-down-up {
|
|
207
188
|
0% {
|
|
208
189
|
transform: translateY(0%);
|
|
@@ -248,6 +229,45 @@
|
|
|
248
229
|
@apply border-border outline-ring/50;
|
|
249
230
|
}
|
|
250
231
|
|
|
232
|
+
html {
|
|
233
|
+
-webkit-tap-highlight-color: transparent;
|
|
234
|
+
-webkit-text-size-adjust: 100%;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
:where(
|
|
238
|
+
button,
|
|
239
|
+
a,
|
|
240
|
+
summary,
|
|
241
|
+
[role='button'],
|
|
242
|
+
[role='tab'],
|
|
243
|
+
[role='checkbox'],
|
|
244
|
+
[role='radio'],
|
|
245
|
+
[role='switch'],
|
|
246
|
+
[role='menuitem'],
|
|
247
|
+
[role='menuitemcheckbox'],
|
|
248
|
+
[role='menuitemradio'],
|
|
249
|
+
[role='option']
|
|
250
|
+
) {
|
|
251
|
+
touch-action: manipulation;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
:where(
|
|
255
|
+
button,
|
|
256
|
+
summary,
|
|
257
|
+
[role='button'],
|
|
258
|
+
[role='tab'],
|
|
259
|
+
[role='checkbox'],
|
|
260
|
+
[role='radio'],
|
|
261
|
+
[role='switch'],
|
|
262
|
+
[role='menuitem'],
|
|
263
|
+
[role='menuitemcheckbox'],
|
|
264
|
+
[role='menuitemradio']
|
|
265
|
+
) {
|
|
266
|
+
-webkit-user-select: none;
|
|
267
|
+
user-select: none;
|
|
268
|
+
-webkit-touch-callout: none;
|
|
269
|
+
}
|
|
270
|
+
|
|
251
271
|
/* Enabled clickable controls get the hand, the common web convention (Tailwind v4's preflight leaves buttons with the arrow). */
|
|
252
272
|
:where(
|
|
253
273
|
button,
|