@xwadex/fesd-next 0.3.4-7.9 → 0.3.4-8

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 (55) hide show
  1. package/dist/components/anchors/anchors.d.ts +0 -2
  2. package/dist/components/anchors/anchors.js +7 -10
  3. package/dist/components/embla-carousels/embla-carousels-hooks.d.ts +36 -0
  4. package/dist/components/embla-carousels/embla-carousels-hooks.js +83 -0
  5. package/dist/components/embla-carousels/embla-carousels.d.ts +23 -0
  6. package/dist/components/embla-carousels/embla-carousels.js +58 -0
  7. package/dist/components/embla-carousels/index.d.ts +2 -0
  8. package/dist/components/embla-carousels/index.js +2 -0
  9. package/dist/components/emblas/embla-container.d.ts +8 -0
  10. package/dist/components/emblas/embla-container.js +12 -0
  11. package/dist/components/emblas/embla-context.d.ts +21 -0
  12. package/dist/components/emblas/embla-context.js +12 -0
  13. package/dist/components/emblas/embla.d.ts +20 -0
  14. package/dist/components/emblas/embla.js +124 -0
  15. package/dist/components/emblas/emblas-pagination.d.ts +11 -0
  16. package/dist/components/emblas/emblas-pagination.js +89 -0
  17. package/dist/components/emblas/index.d.ts +4 -0
  18. package/dist/components/emblas/index.js +4 -0
  19. package/dist/components/index.d.ts +3 -0
  20. package/dist/components/index.js +3 -0
  21. package/dist/components/scroll-containers/index.d.ts +3 -0
  22. package/dist/components/scroll-containers/index.js +3 -0
  23. package/dist/components/scroll-containers/lenis-scroll.d.ts +20 -0
  24. package/dist/components/scroll-containers/lenis-scroll.js +65 -0
  25. package/dist/components/scroll-containers/native-scroll.d.ts +6 -0
  26. package/dist/components/scroll-containers/native-scroll.js +23 -0
  27. package/dist/components/scroll-containers/scroll-containers.d.ts +25 -0
  28. package/dist/components/scroll-containers/scroll-containers.js +46 -0
  29. package/dist/components/tests/tests.js +0 -1
  30. package/dist/hooks/useAnchors.d.ts +25 -17
  31. package/dist/hooks/useAnchors.js +73 -40
  32. package/dist/hooks/useAsyncFetcher.js +0 -1
  33. package/dist/hooks/useCookies.js +24 -1
  34. package/dist/hooks/useDebounce.js +0 -1
  35. package/dist/hooks/useDebounceValue.js +0 -1
  36. package/dist/hooks/useDragResize.js +0 -1
  37. package/dist/hooks/useEffectLeave.js +0 -1
  38. package/dist/hooks/useEffectOne.js +0 -1
  39. package/dist/hooks/useHash.js +0 -1
  40. package/dist/hooks/useLocations.js +0 -1
  41. package/dist/hooks/useMounted.js +0 -1
  42. package/dist/shadcns/components/ui/button-group.d.ts +11 -0
  43. package/dist/shadcns/components/ui/button-group.js +26 -0
  44. package/dist/shadcns/components/ui/button.js +0 -1
  45. package/dist/shadcns/components/ui/field.d.ts +24 -0
  46. package/dist/shadcns/components/ui/field.js +75 -0
  47. package/dist/shadcns/components/ui/item.d.ts +23 -0
  48. package/dist/shadcns/components/ui/item.js +65 -0
  49. package/dist/shadcns/components/ui/native-select.d.ts +7 -0
  50. package/dist/shadcns/components/ui/native-select.js +13 -0
  51. package/dist/shadcns/components/ui/navigation-menu.js +0 -1
  52. package/dist/shadcns/components/ui/textarea.js +0 -1
  53. package/package.json +6 -2
  54. package/dist/hooks/useScrollContainers.d.ts +0 -27
  55. package/dist/hooks/useScrollContainers.js +0 -53
@@ -0,0 +1,75 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useMemo } from "react";
3
+ import { cva } from "class-variance-authority";
4
+ import { cn } from '../../index.js';
5
+ import { Label } from "../../index.js";
6
+ import { Separator } from "../../index.js";
7
+ function FieldSet({ className, ...props }) {
8
+ return (_jsx("fieldset", { "data-slot": "field-set", className: cn("flex flex-col gap-6", "has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3", className), ...props }));
9
+ }
10
+ function FieldLegend({ className, variant = "legend", ...props }) {
11
+ return (_jsx("legend", { "data-slot": "field-legend", "data-variant": variant, className: cn("mb-3 font-medium", "data-[variant=legend]:text-base", "data-[variant=label]:text-sm", className), ...props }));
12
+ }
13
+ function FieldGroup({ className, ...props }) {
14
+ return (_jsx("div", { "data-slot": "field-group", className: cn("group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4", className), ...props }));
15
+ }
16
+ const fieldVariants = cva("group/field flex w-full gap-3 data-[invalid=true]:text-destructive", {
17
+ variants: {
18
+ orientation: {
19
+ vertical: ["flex-col [&>*]:w-full [&>.sr-only]:w-auto"],
20
+ horizontal: [
21
+ "flex-row items-center",
22
+ "[&>[data-slot=field-label]]:flex-auto",
23
+ "has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
24
+ ],
25
+ responsive: [
26
+ "flex-col [&>*]:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto",
27
+ "@md/field-group:[&>[data-slot=field-label]]:flex-auto",
28
+ "@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
29
+ ],
30
+ },
31
+ },
32
+ defaultVariants: {
33
+ orientation: "vertical",
34
+ },
35
+ });
36
+ function Field({ className, orientation = "vertical", ...props }) {
37
+ return (_jsx("div", { role: "group", "data-slot": "field", "data-orientation": orientation, className: cn(fieldVariants({ orientation }), className), ...props }));
38
+ }
39
+ function FieldContent({ className, ...props }) {
40
+ return (_jsx("div", { "data-slot": "field-content", className: cn("group/field-content flex flex-1 flex-col gap-1.5 leading-snug", className), ...props }));
41
+ }
42
+ function FieldLabel({ className, ...props }) {
43
+ return (_jsx(Label, { "data-slot": "field-label", className: cn("group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50", "has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-4", "has-data-[state=checked]:bg-primary/5 has-data-[state=checked]:border-primary dark:has-data-[state=checked]:bg-primary/10", className), ...props }));
44
+ }
45
+ function FieldTitle({ className, ...props }) {
46
+ return (_jsx("div", { "data-slot": "field-label", className: cn("flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50", className), ...props }));
47
+ }
48
+ function FieldDescription({ className, ...props }) {
49
+ return (_jsx("p", { "data-slot": "field-description", className: cn("text-muted-foreground text-sm leading-normal font-normal group-has-[[data-orientation=horizontal]]/field:text-balance", "last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5", "[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4", className), ...props }));
50
+ }
51
+ function FieldSeparator({ children, className, ...props }) {
52
+ return (_jsxs("div", { "data-slot": "field-separator", "data-content": !!children, className: cn("relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2", className), ...props, children: [_jsx(Separator, { className: "absolute inset-0 top-1/2" }), children && (_jsx("span", { className: "bg-background text-muted-foreground relative mx-auto block w-fit px-2", "data-slot": "field-separator-content", children: children }))] }));
53
+ }
54
+ function FieldError({ className, children, errors, ...props }) {
55
+ const content = useMemo(() => {
56
+ if (children) {
57
+ return children;
58
+ }
59
+ if (!errors?.length) {
60
+ return null;
61
+ }
62
+ const uniqueErrors = [
63
+ ...new Map(errors.map((error) => [error?.message, error])).values(),
64
+ ];
65
+ if (uniqueErrors?.length == 1) {
66
+ return uniqueErrors[0]?.message;
67
+ }
68
+ return (_jsx("ul", { className: "ml-4 flex list-disc flex-col gap-1", children: uniqueErrors.map((error, index) => error?.message && _jsx("li", { children: error.message }, index)) }));
69
+ }, [children, errors]);
70
+ if (!content) {
71
+ return null;
72
+ }
73
+ return (_jsx("div", { role: "alert", "data-slot": "field-error", className: cn("text-destructive text-sm font-normal", className), ...props, children: content }));
74
+ }
75
+ export { Field, FieldLabel, FieldDescription, FieldError, FieldGroup, FieldLegend, FieldSeparator, FieldSet, FieldContent, FieldTitle, };
@@ -0,0 +1,23 @@
1
+ import * as React from "react";
2
+ import { type VariantProps } from "class-variance-authority";
3
+ import { Separator } from "../../index.js";
4
+ declare function ItemGroup({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
5
+ declare function ItemSeparator({ className, ...props }: React.ComponentProps<typeof Separator>): import("react/jsx-runtime").JSX.Element;
6
+ declare const itemVariants: (props?: ({
7
+ variant?: "default" | "outline" | "muted" | null | undefined;
8
+ size?: "default" | "sm" | null | undefined;
9
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
10
+ declare function Item({ className, variant, size, asChild, ...props }: React.ComponentProps<"div"> & VariantProps<typeof itemVariants> & {
11
+ asChild?: boolean;
12
+ }): import("react/jsx-runtime").JSX.Element;
13
+ declare const itemMediaVariants: (props?: ({
14
+ variant?: "default" | "image" | "icon" | null | undefined;
15
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
16
+ declare function ItemMedia({ className, variant, ...props }: React.ComponentProps<"div"> & VariantProps<typeof itemMediaVariants>): import("react/jsx-runtime").JSX.Element;
17
+ declare function ItemContent({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
18
+ declare function ItemTitle({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
19
+ declare function ItemDescription({ className, ...props }: React.ComponentProps<"p">): import("react/jsx-runtime").JSX.Element;
20
+ declare function ItemActions({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
21
+ declare function ItemHeader({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
22
+ declare function ItemFooter({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
23
+ export { Item, ItemMedia, ItemContent, ItemActions, ItemGroup, ItemSeparator, ItemTitle, ItemDescription, ItemHeader, ItemFooter, };
@@ -0,0 +1,65 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Slot } from "@radix-ui/react-slot";
3
+ import { cva } from "class-variance-authority";
4
+ import { cn, Separator } from "../../index.js";
5
+ function ItemGroup({ className, ...props }) {
6
+ return (_jsx("div", { role: "list", "data-slot": "item-group", className: cn("group/item-group flex flex-col", className), ...props }));
7
+ }
8
+ function ItemSeparator({ className, ...props }) {
9
+ return (_jsx(Separator, { "data-slot": "item-separator", orientation: "horizontal", className: cn("my-0", className), ...props }));
10
+ }
11
+ const itemVariants = cva("group/item flex items-center border border-transparent text-sm rounded-md transition-colors [a]:hover:bg-accent/50 [a]:transition-colors duration-100 flex-wrap outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]", {
12
+ variants: {
13
+ variant: {
14
+ default: "bg-transparent",
15
+ outline: "border-border",
16
+ muted: "bg-muted/50",
17
+ },
18
+ size: {
19
+ default: "p-4 gap-4 ",
20
+ sm: "py-3 px-4 gap-2.5",
21
+ },
22
+ },
23
+ defaultVariants: {
24
+ variant: "default",
25
+ size: "default",
26
+ },
27
+ });
28
+ function Item({ className, variant = "default", size = "default", asChild = false, ...props }) {
29
+ const Comp = asChild ? Slot : "div";
30
+ return (_jsx(Comp, { "data-slot": "item", "data-variant": variant, "data-size": size, className: cn(itemVariants({ variant, size, className })), ...props }));
31
+ }
32
+ const itemMediaVariants = cva("flex shrink-0 items-center justify-center gap-2 group-has-[[data-slot=item-description]]/item:self-start [&_svg]:pointer-events-none group-has-[[data-slot=item-description]]/item:translate-y-0.5", {
33
+ variants: {
34
+ variant: {
35
+ default: "bg-transparent",
36
+ icon: "size-8 border rounded-sm bg-muted [&_svg:not([class*='size-'])]:size-4",
37
+ image: "size-10 rounded-sm overflow-hidden [&_img]:size-full [&_img]:object-cover",
38
+ },
39
+ },
40
+ defaultVariants: {
41
+ variant: "default",
42
+ },
43
+ });
44
+ function ItemMedia({ className, variant = "default", ...props }) {
45
+ return (_jsx("div", { "data-slot": "item-media", "data-variant": variant, className: cn(itemMediaVariants({ variant, className })), ...props }));
46
+ }
47
+ function ItemContent({ className, ...props }) {
48
+ return (_jsx("div", { "data-slot": "item-content", className: cn("flex flex-1 flex-col gap-1 [&+[data-slot=item-content]]:flex-none", className), ...props }));
49
+ }
50
+ function ItemTitle({ className, ...props }) {
51
+ return (_jsx("div", { "data-slot": "item-title", className: cn("flex w-fit items-center gap-2 text-sm leading-snug font-medium", className), ...props }));
52
+ }
53
+ function ItemDescription({ className, ...props }) {
54
+ return (_jsx("p", { "data-slot": "item-description", className: cn("text-muted-foreground line-clamp-2 text-sm leading-normal font-normal text-balance", "[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4", className), ...props }));
55
+ }
56
+ function ItemActions({ className, ...props }) {
57
+ return (_jsx("div", { "data-slot": "item-actions", className: cn("flex items-center gap-2", className), ...props }));
58
+ }
59
+ function ItemHeader({ className, ...props }) {
60
+ return (_jsx("div", { "data-slot": "item-header", className: cn("flex basis-full items-center justify-between gap-2", className), ...props }));
61
+ }
62
+ function ItemFooter({ className, ...props }) {
63
+ return (_jsx("div", { "data-slot": "item-footer", className: cn("flex basis-full items-center justify-between gap-2", className), ...props }));
64
+ }
65
+ export { Item, ItemMedia, ItemContent, ItemActions, ItemGroup, ItemSeparator, ItemTitle, ItemDescription, ItemHeader, ItemFooter, };
@@ -0,0 +1,7 @@
1
+ import * as React from "react";
2
+ declare function NativeSelect({ className, size, ...props }: Omit<React.ComponentProps<"select">, "size"> & {
3
+ size?: "sm" | "default";
4
+ }): import("react/jsx-runtime").JSX.Element;
5
+ declare function NativeSelectOption({ ...props }: React.ComponentProps<"option">): import("react/jsx-runtime").JSX.Element;
6
+ declare function NativeSelectOptGroup({ className, ...props }: React.ComponentProps<"optgroup">): import("react/jsx-runtime").JSX.Element;
7
+ export { NativeSelect, NativeSelectOptGroup, NativeSelectOption };
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { ChevronDownIcon } from "lucide-react";
3
+ import { cn } from "../../index.js";
4
+ function NativeSelect({ className, size = "default", ...props }) {
5
+ return (_jsxs("div", { className: "group/native-select relative w-fit has-[select:disabled]:opacity-50", "data-slot": "native-select-wrapper", children: [_jsx("select", { "data-slot": "native-select", "data-size": size, className: cn("border-input placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 dark:hover:bg-input/50 h-9 w-full min-w-0 appearance-none rounded-md border bg-transparent px-3 py-2 pr-9 text-sm shadow-xs transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed data-[size=sm]:h-8 data-[size=sm]:py-1", "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]", "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive", className), ...props }), _jsx(ChevronDownIcon, { className: "text-muted-foreground pointer-events-none absolute top-1/2 right-3.5 size-4 -translate-y-1/2 opacity-50 select-none", "aria-hidden": "true", "data-slot": "native-select-icon" })] }));
6
+ }
7
+ function NativeSelectOption({ ...props }) {
8
+ return _jsx("option", { "data-slot": "native-select-option", ...props });
9
+ }
10
+ function NativeSelectOptGroup({ className, ...props }) {
11
+ return (_jsx("optgroup", { "data-slot": "native-select-optgroup", className: cn(className), ...props }));
12
+ }
13
+ export { NativeSelect, NativeSelectOptGroup, NativeSelectOption };
@@ -1,4 +1,3 @@
1
- "use client";
2
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
2
  import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu';
4
3
  import { cva } from 'class-variance-authority';
@@ -1,4 +1,3 @@
1
- "use client";
2
1
  import { jsx as _jsx } from "react/jsx-runtime";
3
2
  import { cn } from '../../index.js';
4
3
  function Textarea({ className, ...props }) {
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "@xwadex/fesd-next",
3
- "version": "0.3.4-7.9",
3
+ "version": "0.3.4-8",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
+ "type": "module",
7
8
  "exports": {
8
9
  ".": {
9
10
  "import": "./dist/index.js",
@@ -28,6 +29,9 @@
28
29
  "./types": {
29
30
  "import": "./dist/types/index.js",
30
31
  "types": "./dist/types/index.d.ts"
32
+ },
33
+ "./styles": {
34
+ "import": "./dist/styles/tailwind.css"
31
35
  }
32
36
  },
33
37
  "files": [
@@ -40,7 +44,7 @@
40
44
  "peerDependencies": {
41
45
  "react": ">=18",
42
46
  "react-dom": ">=18",
43
- "next": ">=13",
47
+ "next": ">=16",
44
48
  "@radix-ui/react-accordion": "^1.2.11",
45
49
  "@radix-ui/react-slot": "^1.2.3",
46
50
  "tailwindcss": ">=3",
@@ -1,27 +0,0 @@
1
- export interface UseScrollContainers {
2
- container?: string;
3
- }
4
- export declare function useScrollContainers(options?: UseScrollContainers): {
5
- container: HTMLElement | (Window & typeof globalThis);
6
- setStores: (options: AnchorStoreOptions) => void;
7
- getStores: () => ScrollContainersStores;
8
- registerContainers: typeof registerContainers;
9
- };
10
- export declare function registration({ name, node }: RegistrationDatas): void;
11
- export declare function registerContainers(name: string): {
12
- ref: (node: HTMLDivElement | null) => void;
13
- "data-scroll-container": string;
14
- };
15
- export interface ScrollContainersStores {
16
- containers: Map<string, HTMLElement | null>;
17
- }
18
- export declare const useScrollContainersStores: import("zustand").UseBoundStore<import("zustand").StoreApi<ScrollContainersStores>>;
19
- export declare const getScrollContainersStores: () => ScrollContainersStores;
20
- export interface RegistrationDatas {
21
- name: string;
22
- node: HTMLDivElement | null;
23
- }
24
- export interface AnchorStoreOptions extends RegistrationDatas {
25
- action: "add" | "remove";
26
- }
27
- export declare const setScrollContainerStore: (options: AnchorStoreOptions) => void;
@@ -1,53 +0,0 @@
1
- "use client";
2
- // update: 2025.11.07
3
- // version: 0.0.1.bate
4
- // dev: wade
5
- import { useCallback } from "react";
6
- import { create } from "zustand";
7
- const CONTAINER_ATTRIBUTE = "data-scroll-container";
8
- export function useScrollContainers(options) {
9
- const { container: containerName } = options || {};
10
- const stores = getScrollContainersStores();
11
- const isScrollContainer = containerName && containerName !== "window";
12
- const containerDom = isScrollContainer
13
- ? stores.containers.get(containerName)
14
- : window;
15
- return {
16
- container: containerDom,
17
- setStores: setScrollContainerStore,
18
- getStores: getScrollContainersStores,
19
- registerContainers
20
- };
21
- }
22
- export function registration({ name, node }) {
23
- if (!node)
24
- return;
25
- if (node instanceof Window || node.tagName === "BODY" || node.tagName === "HTML") {
26
- console.error(`Cannot register scroll container 'body' or 'html' `);
27
- return;
28
- }
29
- setScrollContainerStore({ name, node, action: node ? "add" : "remove" });
30
- }
31
- export function registerContainers(name) {
32
- const register = useCallback((node) => registration({ name, node }), [name]);
33
- return { ref: register, [CONTAINER_ATTRIBUTE]: name };
34
- }
35
- export const useScrollContainersStores = create()(() => ({
36
- containers: new Map(),
37
- }));
38
- export const getScrollContainersStores = () => useScrollContainersStores.getState();
39
- export const setScrollContainerStore = (options) => {
40
- const { action, name, node } = options;
41
- useScrollContainersStores.setState(stores => {
42
- const containerDom = stores.containers?.get(name);
43
- if (action == "add" && node instanceof HTMLElement) {
44
- if (containerDom == node)
45
- return stores;
46
- stores.containers?.set(name, node);
47
- }
48
- else if (action == "remove" && containerDom) {
49
- stores.containers?.delete(name);
50
- }
51
- return { containers: stores.containers };
52
- });
53
- };