singularity-components 0.1.194 → 0.1.196
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/blocks/badges/category-badge.d.ts +11 -0
- package/dist/components/blocks/badges/category-badge.js +34 -0
- package/dist/components/blocks/badges/category-badge.js.map +1 -0
- package/dist/components/blocks/cards/blogpost-card.d.ts +4 -2
- package/dist/components/blocks/cards/blogpost-card.js +9 -4
- package/dist/components/blocks/cards/blogpost-card.js.map +1 -1
- package/dist/components/blocks/cards/card.d.ts +7 -8
- package/dist/components/blocks/directory/author-card.d.ts +10 -0
- package/dist/components/blocks/directory/author-card.js +50 -0
- package/dist/components/blocks/directory/author-card.js.map +1 -0
- package/dist/components/blocks/directory/category-card.d.ts +10 -0
- package/dist/components/blocks/directory/category-card.js +26 -0
- package/dist/components/blocks/directory/category-card.js.map +1 -0
- package/dist/components/blocks/empty-state/EmptyState.d.ts +2 -2
- package/dist/components/blocks/extras/extras-hub-card.d.ts +16 -0
- package/dist/components/blocks/extras/extras-hub-card.js +21 -0
- package/dist/components/blocks/extras/extras-hub-card.js.map +1 -0
- package/dist/components/blocks/gallery/image-gallery.d.ts +14 -0
- package/dist/components/blocks/gallery/image-gallery.js +211 -0
- package/dist/components/blocks/gallery/image-gallery.js.map +1 -0
- package/dist/components/blocks/index.d.ts +12 -1
- package/dist/components/blocks/index.js +11 -0
- package/dist/components/blocks/index.js.map +1 -1
- package/dist/components/blocks/loading/loading-skeletons.d.ts +15 -0
- package/dist/components/blocks/loading/loading-skeletons.js +78 -0
- package/dist/components/blocks/loading/loading-skeletons.js.map +1 -0
- package/dist/components/blocks/login/login.d.ts +78 -0
- package/dist/components/blocks/login/login.js +95 -0
- package/dist/components/blocks/login/login.js.map +1 -0
- package/dist/components/blocks/marketing/page-hero.d.ts +13 -0
- package/dist/components/blocks/marketing/page-hero.js +37 -0
- package/dist/components/blocks/marketing/page-hero.js.map +1 -0
- package/dist/components/blocks/marketing/stats-grid.d.ts +16 -0
- package/dist/components/blocks/marketing/stats-grid.js +30 -0
- package/dist/components/blocks/marketing/stats-grid.js.map +1 -0
- package/dist/components/blocks/marketing/timeline.d.ts +17 -0
- package/dist/components/blocks/marketing/timeline.js +45 -0
- package/dist/components/blocks/marketing/timeline.js.map +1 -0
- package/dist/components/blocks/marketing/values-grid.d.ts +16 -0
- package/dist/components/blocks/marketing/values-grid.js +29 -0
- package/dist/components/blocks/marketing/values-grid.js.map +1 -0
- package/dist/components/blocks/post-list/post-filters.d.ts +2 -2
- package/dist/components/blocks/post-list/post-list-with-filters.d.ts +2 -2
- package/dist/components/index.d.ts +30 -3
- package/dist/components/pages/about/about-page.d.ts +5 -0
- package/dist/components/pages/about/about-page.js +161 -0
- package/dist/components/pages/about/about-page.js.map +1 -0
- package/dist/components/pages/admin/admin-page.d.ts +2 -2
- package/dist/components/pages/admin/admin-page.js +4 -1
- package/dist/components/pages/admin/admin-page.js.map +1 -1
- package/dist/components/pages/author/author-page.d.ts +8 -0
- package/dist/components/pages/author/author-page.js +107 -0
- package/dist/components/pages/author/author-page.js.map +1 -0
- package/dist/components/pages/authors/authors-page.d.ts +5 -0
- package/dist/components/pages/authors/authors-page.js +25 -0
- package/dist/components/pages/authors/authors-page.js.map +1 -0
- package/dist/components/pages/blogpost/blogpost.d.ts +5 -2
- package/dist/components/pages/blogpost/blogpost.js +38 -18
- package/dist/components/pages/blogpost/blogpost.js.map +1 -1
- package/dist/components/pages/categories/categories-page.d.ts +5 -0
- package/dist/components/pages/categories/categories-page.js +33 -0
- package/dist/components/pages/categories/categories-page.js.map +1 -0
- package/dist/components/pages/category/category-page.d.ts +2 -2
- package/dist/components/pages/category/category-page.js +3 -1
- package/dist/components/pages/category/category-page.js.map +1 -1
- package/dist/components/pages/chat/chat-page.d.ts +2 -2
- package/dist/components/pages/contact/contact-page.d.ts +5 -0
- package/dist/components/pages/contact/contact-page.js +173 -0
- package/dist/components/pages/contact/contact-page.js.map +1 -0
- package/dist/components/pages/content-blocks/content-blocks-page.d.ts +5 -0
- package/dist/components/pages/content-blocks/content-blocks-page.js +86 -0
- package/dist/components/pages/content-blocks/content-blocks-page.js.map +1 -0
- package/dist/components/pages/extras/extras-hub-page.d.ts +10 -0
- package/dist/components/pages/extras/extras-hub-page.js +110 -0
- package/dist/components/pages/extras/extras-hub-page.js.map +1 -0
- package/dist/components/pages/index.d.ts +15 -1
- package/dist/components/pages/index.js +12 -0
- package/dist/components/pages/index.js.map +1 -1
- package/dist/components/pages/login/login-page.d.ts +2 -2
- package/dist/components/pages/login/login-page.js +19 -69
- package/dist/components/pages/login/login-page.js.map +1 -1
- package/dist/components/pages/maintenance/maintenance-page.d.ts +2 -2
- package/dist/components/pages/membership/membership-page.d.ts +5 -0
- package/dist/components/pages/membership/membership-page.js +131 -0
- package/dist/components/pages/membership/membership-page.js.map +1 -0
- package/dist/components/pages/mosaic/mosaic-page.d.ts +5 -0
- package/dist/components/pages/mosaic/mosaic-page.js +81 -0
- package/dist/components/pages/mosaic/mosaic-page.js.map +1 -0
- package/dist/components/pages/newsletter/newsletter-page.d.ts +5 -0
- package/dist/components/pages/newsletter/newsletter-page.js +148 -0
- package/dist/components/pages/newsletter/newsletter-page.js.map +1 -0
- package/dist/components/pages/not-found/not-found.d.ts +2 -2
- package/dist/components/pages/privacy/privacy-page.d.ts +2 -2
- package/dist/components/pages/resources/resources-page.d.ts +5 -0
- package/dist/components/pages/resources/resources-page.js +24 -0
- package/dist/components/pages/resources/resources-page.js.map +1 -0
- package/dist/components/pages/search/search-page.d.ts +2 -2
- package/dist/components/pages/startpage/startpage.d.ts +2 -2
- package/dist/components/pages/startpage/startpage.js +6 -4
- package/dist/components/pages/startpage/startpage.js.map +1 -1
- package/dist/components/pages/terms/terms-page.d.ts +2 -2
- package/dist/components/primitives/accordion/accordion.d.ts +5 -5
- package/dist/components/primitives/accordion/accordion.js +14 -16
- package/dist/components/primitives/accordion/accordion.js.map +1 -1
- package/dist/components/primitives/alert/alert.d.ts +4 -5
- package/dist/components/primitives/avatar/avatar.d.ts +6 -7
- package/dist/components/primitives/badge/badge.js +1 -1
- package/dist/components/primitives/badge/badge.js.map +1 -1
- package/dist/components/primitives/badge/badges.d.ts +1 -2
- package/dist/components/primitives/buttons/button.d.ts +4 -4
- package/dist/components/primitives/buttons/icon-button.d.ts +3 -3
- package/dist/components/primitives/buttons/link-button.d.ts +2 -3
- package/dist/components/primitives/collapsible/collapsible.d.ts +3 -4
- package/dist/components/primitives/collapsible/collapsible.js +4 -1
- package/dist/components/primitives/collapsible/collapsible.js.map +1 -1
- package/dist/components/primitives/dropdown-menu/dropdown-menu.d.ts +1 -2
- package/dist/components/primitives/dropdown-menu/dropdown-menu.js +6 -1
- package/dist/components/primitives/dropdown-menu/dropdown-menu.js.map +1 -1
- package/dist/components/primitives/forms/checkbox.d.ts +2 -2
- package/dist/components/primitives/forms/checkbox.js +1 -1
- package/dist/components/primitives/forms/checkbox.js.map +1 -1
- package/dist/components/primitives/forms/field.d.ts +14 -13
- package/dist/components/primitives/forms/field.js +4 -2
- package/dist/components/primitives/forms/field.js.map +1 -1
- package/dist/components/primitives/forms/form-control.d.ts +28 -0
- package/dist/components/primitives/forms/form-control.js +40 -0
- package/dist/components/primitives/forms/form-control.js.map +1 -0
- package/dist/components/primitives/forms/form.d.ts +12 -0
- package/dist/components/primitives/forms/form.js +30 -0
- package/dist/components/primitives/forms/form.js.map +1 -0
- package/dist/components/primitives/forms/input.d.ts +1 -2
- package/dist/components/primitives/forms/select.d.ts +7 -8
- package/dist/components/primitives/forms/select.js +12 -12
- package/dist/components/primitives/forms/select.js.map +1 -1
- package/dist/components/primitives/forms/textarea.d.ts +1 -2
- package/dist/components/primitives/icon/icon.d.ts +4 -4
- package/dist/components/primitives/icon/icon.js +2 -1
- package/dist/components/primitives/icon/icon.js.map +1 -1
- package/dist/components/primitives/index.d.ts +6 -3
- package/dist/components/primitives/index.js +3 -0
- package/dist/components/primitives/index.js.map +1 -1
- package/dist/components/primitives/label/label.d.ts +1 -2
- package/dist/components/primitives/layout/layout.d.ts +5 -4
- package/dist/components/primitives/layout/layout.js.map +1 -1
- package/dist/components/primitives/link/link.d.ts +4 -5
- package/dist/components/primitives/separator/separator.d.ts +2 -2
- package/dist/components/primitives/sheet/sheet.d.ts +2 -3
- package/dist/components/primitives/sheet/sheet.js +1 -1
- package/dist/components/primitives/sheet/sheet.js.map +1 -1
- package/dist/components/primitives/skeleton/skeleton.d.ts +2 -2
- package/dist/components/primitives/sonner/sonner.d.ts +2 -2
- package/dist/components/primitives/spinner/spinner.d.ts +2 -2
- package/dist/components/primitives/stack/stack.d.ts +47 -3
- package/dist/components/primitives/stack/stack.js +44 -42
- package/dist/components/primitives/stack/stack.js.map +1 -1
- package/dist/components/primitives/text/heading.d.ts +2 -3
- package/dist/components/primitives/text/internal/text-element.d.ts +9 -4
- package/dist/components/primitives/text/internal/text-element.js +3 -0
- package/dist/components/primitives/text/internal/text-element.js.map +1 -1
- package/dist/components/primitives/text/text-code.d.ts +3 -3
- package/dist/components/primitives/text/text-div.d.ts +2 -3
- package/dist/components/primitives/text/text-span.d.ts +2 -3
- package/dist/components/primitives/text/text-time.d.ts +2 -3
- package/dist/components/primitives/text/text.d.ts +2 -3
- package/dist/components/primitives/ui-image/ui-image.d.ts +2 -3
- package/dist/components/primitives/ui-link/ui-link.d.ts +2 -3
- package/dist/components/providers/SingularityContext.d.ts +0 -1
- package/dist/components/providers/auth-provider.d.ts +2 -2
- package/dist/components/providers/index.d.ts +0 -1
- package/dist/components/providers/theme-provider.d.ts +1 -2
- package/dist/components/templates/container/container.d.ts +4 -5
- package/dist/components/templates/footer/footer.d.ts +2 -2
- package/dist/components/templates/form/form.d.ts +2 -2
- package/dist/components/templates/hero/hero.d.ts +2 -2
- package/dist/components/templates/index.d.ts +1 -1
- package/dist/components/templates/index.js +1 -0
- package/dist/components/templates/index.js.map +1 -1
- package/dist/components/templates/loading-screen/loading-screen.d.ts +10 -0
- package/dist/components/templates/loading-screen/loading-screen.js +39 -0
- package/dist/components/templates/loading-screen/loading-screen.js.map +1 -0
- package/dist/components/templates/navigation/header.d.ts +1 -2
- package/dist/components/templates/navigation/index.d.ts +0 -1
- package/dist/css/variables.css +2 -0
- package/dist/css/variables.css.map +1 -1
- package/dist/data/posts.d.ts +5 -0
- package/dist/data/posts.js +37 -4
- package/dist/data/posts.js.map +1 -1
- package/dist/index.d.ts +30 -3
- package/dist/lib/forms/field-props.d.ts +60 -0
- package/dist/lib/forms/field-props.js +60 -0
- package/dist/lib/forms/field-props.js.map +1 -0
- package/dist/lib/forms/index.d.ts +11 -0
- package/dist/lib/forms/index.js +3 -0
- package/dist/lib/forms/index.js.map +1 -0
- package/dist/lib/forms/tanstack-field.d.ts +56 -0
- package/dist/lib/forms/tanstack-field.js +114 -0
- package/dist/lib/forms/tanstack-field.js.map +1 -0
- package/dist/lib/index.d.ts +11 -0
- package/dist/lib/index.js +1 -0
- package/dist/lib/index.js.map +1 -1
- package/dist/main.css +442 -117
- package/dist/main.css.map +1 -1
- package/package.json +64 -39
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/primitives/badge/badge.tsx"],"sourcesContent":["import { cn } from \"../../../utils/index\";\nimport { mergeProps } from \"@base-ui/react/merge-props\";\nimport { useRender } from \"@base-ui/react/use-render\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nconst badgeVariants = {\n variant: {\n default: \"sg:border-transparent sg:bg-primary sg:text-primary-foreground\",\n secondary:\n \"sg:border-transparent sg:bg-secondary sg:text-secondary-foreground\",\n destructive:\n \"sg:border-transparent sg:bg-destructive sg:text-destructive-foreground\",\n outline: \"\",\n },\n};\n\nconst badgeVariantsProps = cva(\n \"sg:inline-flex sg:items-center sg:rounded-full sg:border sg:px-2.5 sg:py-0.5 sg:text-xs sg:font-semibold sg:transition-colors sg:focus:outline-none sg:focus:ring-2 sg:focus:ring-ring sg:focus:ring-offset-2\",\n {\n variants: badgeVariants,\n defaultVariants: {\n variant: \"default\",\n },\n },\n);\n\nfunction Badge({\n className,\n variant = \"default\",\n render,\n ...props\n}: useRender.ComponentProps<\"span\"> & VariantProps<typeof badgeVariantsProps>) {\n return useRender({\n defaultTagName: \"span\",\n props: mergeProps<\"span\">(\n {\n className: cn(badgeVariantsProps({ className, variant })),\n },\n props,\n ),\n render,\n state: {\n slot: \"badge\",\n variant,\n },\n });\n}\n\nexport { Badge, badgeVariantsProps, badgeVariants };\n"],"mappings":"AAAA,SAAS,UAAU;AACnB,SAAS,kBAAkB;AAC3B,SAAS,iBAAiB;AAC1B,SAAS,WAA8B;AAEvC,MAAM,gBAAgB;AAAA,EACpB,SAAS;AAAA,IACP,SAAS;AAAA,IACT,WACE;AAAA,IACF,aACE;AAAA,IACF,SAAS;AAAA,EACX;AACF;AAEA,MAAM,qBAAqB;AAAA,EACzB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,IACV,iBAAiB;AAAA,MACf,SAAS;AAAA,IACX;AAAA,EACF;AACF;AAEA,SAAS,MAAM;AAAA,EACb;AAAA,EACA,UAAU;AAAA,EACV;AAAA,EACA,GAAG;AACL,GAA+E;AAC7E,SAAO,UAAU;AAAA,IACf,gBAAgB;AAAA,IAChB,OAAO;AAAA,MACL;AAAA,QACE,WAAW,GAAG,mBAAmB,EAAE,WAAW,QAAQ,CAAC,CAAC;AAAA,MAC1D;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,IACA,OAAO;AAAA,MACL,MAAM;AAAA,MACN;AAAA,IACF;AAAA,EACF,CAAC;AACH;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/primitives/badge/badge.tsx"],"sourcesContent":["import { cn } from \"../../../utils/index\";\nimport { mergeProps } from \"@base-ui/react/merge-props\";\nimport { useRender } from \"@base-ui/react/use-render\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nconst badgeVariants = {\n variant: {\n default: \"sg:border-transparent sg:bg-primary sg:text-primary-foreground\",\n secondary:\n \"sg:border-transparent sg:bg-secondary sg:text-secondary-foreground\",\n destructive:\n \"sg:border-transparent sg:bg-destructive sg:text-destructive-foreground\",\n outline: \"\",\n },\n};\n\nconst badgeVariantsProps = cva(\n \"sg:inline-flex sg:items-center sg:rounded-full sg:border sg:px-2.5 sg:py-0.5 sg:text-xs sg:font-semibold sg:transition-colors sg:focus-visible:outline-none sg:focus-visible:ring-2 sg:focus-visible:ring-ring sg:focus-visible:ring-offset-2\",\n {\n variants: badgeVariants,\n defaultVariants: {\n variant: \"default\",\n },\n },\n);\n\nfunction Badge({\n className,\n variant = \"default\",\n render,\n ...props\n}: useRender.ComponentProps<\"span\"> & VariantProps<typeof badgeVariantsProps>) {\n return useRender({\n defaultTagName: \"span\",\n props: mergeProps<\"span\">(\n {\n className: cn(badgeVariantsProps({ className, variant })),\n },\n props,\n ),\n render,\n state: {\n slot: \"badge\",\n variant,\n },\n });\n}\n\nexport { Badge, badgeVariantsProps, badgeVariants };\n"],"mappings":"AAAA,SAAS,UAAU;AACnB,SAAS,kBAAkB;AAC3B,SAAS,iBAAiB;AAC1B,SAAS,WAA8B;AAEvC,MAAM,gBAAgB;AAAA,EACpB,SAAS;AAAA,IACP,SAAS;AAAA,IACT,WACE;AAAA,IACF,aACE;AAAA,IACF,SAAS;AAAA,EACX;AACF;AAEA,MAAM,qBAAqB;AAAA,EACzB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,IACV,iBAAiB;AAAA,MACf,SAAS;AAAA,IACX;AAAA,EACF;AACF;AAEA,SAAS,MAAM;AAAA,EACb;AAAA,EACA,UAAU;AAAA,EACV;AAAA,EACA,GAAG;AACL,GAA+E;AAC7E,SAAO,UAAU;AAAA,IACf,gBAAgB;AAAA,IAChB,OAAO;AAAA,MACL;AAAA,QACE,WAAW,GAAG,mBAAmB,EAAE,WAAW,QAAQ,CAAC,CAAC;AAAA,MAC1D;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,IACA,OAAO;AAAA,MACL,MAAM;AAAA,MACN;AAAA,IACF;AAAA,EACF,CAAC;AACH;","names":[]}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
1
|
import * as React from 'react';
|
|
3
2
|
|
|
4
3
|
interface BadgesProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
5
4
|
}
|
|
6
|
-
declare const Badges: ({ children, className, ...props }: BadgesProps) =>
|
|
5
|
+
declare const Badges: ({ children, className, ...props }: BadgesProps) => React.JSX.Element;
|
|
7
6
|
|
|
8
7
|
export { Badges, type BadgesProps };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
3
3
|
import { Button as Button$1 } from '@base-ui/react/button';
|
|
4
4
|
import { VariantProps } from 'class-variance-authority';
|
|
@@ -21,8 +21,8 @@ declare const buttonVariants: {
|
|
|
21
21
|
};
|
|
22
22
|
};
|
|
23
23
|
declare const buttonVariantsProps: (props?: ({
|
|
24
|
-
variant?: "
|
|
25
|
-
size?: "
|
|
24
|
+
variant?: "default" | "secondary" | "destructive" | "outline" | "link" | "ghost" | null | undefined;
|
|
25
|
+
size?: "xs" | "sm" | "md" | "lg" | null | undefined;
|
|
26
26
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
27
27
|
type Props = Button$1.Props & VariantProps<typeof buttonVariantsProps> & {
|
|
28
28
|
loading?: boolean;
|
|
@@ -33,6 +33,6 @@ type Props = Button$1.Props & VariantProps<typeof buttonVariantsProps> & {
|
|
|
33
33
|
iconEndAnimate?: boolean;
|
|
34
34
|
iconEndFill?: boolean;
|
|
35
35
|
};
|
|
36
|
-
declare function Button({ className, variant, size, loading, iconStart, iconStartAnimate, iconStartFill, iconEnd, iconEndAnimate, iconEndFill, ...props }: Props):
|
|
36
|
+
declare function Button({ className, variant, size, loading, iconStart, iconStartAnimate, iconStartFill, iconEnd, iconEndAnimate, iconEndFill, ...props }: Props): React.JSX.Element;
|
|
37
37
|
|
|
38
38
|
export { Button, buttonVariants, buttonVariantsProps };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
3
3
|
import { Button } from '@base-ui/react/button';
|
|
4
4
|
import { VariantProps } from 'class-variance-authority';
|
|
@@ -20,7 +20,7 @@ declare const buttonIconVariants: {
|
|
|
20
20
|
};
|
|
21
21
|
};
|
|
22
22
|
declare const iconButtonVariantsProps: (props?: ({
|
|
23
|
-
variant?: "
|
|
23
|
+
variant?: "default" | "secondary" | "destructive" | "outline" | "link" | "ghost" | null | undefined;
|
|
24
24
|
size?: "sm" | "md" | "lg" | null | undefined;
|
|
25
25
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
26
26
|
type Props = Button.Props & VariantProps<typeof iconButtonVariantsProps> & {
|
|
@@ -28,6 +28,6 @@ type Props = Button.Props & VariantProps<typeof iconButtonVariantsProps> & {
|
|
|
28
28
|
iconFill?: boolean;
|
|
29
29
|
"aria-label": string;
|
|
30
30
|
};
|
|
31
|
-
declare function IconButton({ className, variant, size, icon, iconFill, "aria-label": ariaLabel, ...props }: Props):
|
|
31
|
+
declare function IconButton({ className, variant, size, icon, iconFill, "aria-label": ariaLabel, ...props }: Props): React.JSX.Element;
|
|
32
32
|
|
|
33
33
|
export { IconButton, buttonIconVariants, iconButtonVariantsProps };
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
import { BaseLinkProps } from '../../providers/LinkContext.js';
|
|
3
3
|
import { VariantProps } from 'class-variance-authority';
|
|
4
4
|
import { buttonVariantsProps } from './button.js';
|
|
5
5
|
import { icons } from 'lucide-react';
|
|
6
|
-
import 'react';
|
|
7
6
|
import 'class-variance-authority/types';
|
|
8
7
|
import '@base-ui/react/button';
|
|
9
8
|
|
|
@@ -11,6 +10,6 @@ type Props = BaseLinkProps & VariantProps<typeof buttonVariantsProps> & {
|
|
|
11
10
|
iconStart?: keyof typeof icons;
|
|
12
11
|
iconEnd?: keyof typeof icons;
|
|
13
12
|
};
|
|
14
|
-
declare const LinkButton: ({ className, variant, size, iconStart, iconEnd, ...props }: Props) =>
|
|
13
|
+
declare const LinkButton: ({ className, variant, size, iconStart, iconEnd, ...props }: Props) => React.JSX.Element;
|
|
15
14
|
|
|
16
15
|
export { LinkButton };
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
1
|
import * as React from 'react';
|
|
3
2
|
import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
|
|
4
3
|
|
|
5
|
-
declare function Collapsible({ className, ...props }: React.ComponentProps<typeof CollapsiblePrimitive.Root>):
|
|
6
|
-
declare function CollapsibleTrigger({ className, ...props }: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>):
|
|
7
|
-
declare function CollapsibleContent({ className, ...props }: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>):
|
|
4
|
+
declare function Collapsible({ className, ...props }: React.ComponentProps<typeof CollapsiblePrimitive.Root>): React.JSX.Element;
|
|
5
|
+
declare function CollapsibleTrigger({ className, ...props }: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>): React.JSX.Element;
|
|
6
|
+
declare function CollapsibleContent({ className, ...props }: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>): React.JSX.Element;
|
|
8
7
|
|
|
9
8
|
export { Collapsible, CollapsibleContent, CollapsibleTrigger };
|
|
@@ -24,7 +24,10 @@ function CollapsibleTrigger({
|
|
|
24
24
|
CollapsiblePrimitive.CollapsibleTrigger,
|
|
25
25
|
{
|
|
26
26
|
"data-slot": "collapsible-trigger",
|
|
27
|
-
className: cn(
|
|
27
|
+
className: cn(
|
|
28
|
+
"sg:relative sg:flex sg:w-full sg:cursor-pointer sg:items-center sg:rounded-sm sg:outline-none sg:transition-colors sg:focus-visible:z-10 sg:focus-visible:ring-2 sg:focus-visible:ring-inset sg:focus-visible:ring-ring sg:focus-visible:ring-offset-0",
|
|
29
|
+
className
|
|
30
|
+
),
|
|
28
31
|
...props
|
|
29
32
|
}
|
|
30
33
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/primitives/collapsible/collapsible.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as CollapsiblePrimitive from \"@radix-ui/react-collapsible\";\nimport { cn } from \"singularity-components/utils\";\n\nfunction Collapsible({\n className,\n ...props\n}: React.ComponentProps<typeof CollapsiblePrimitive.Root>) {\n return (\n <CollapsiblePrimitive.Root\n data-slot=\"collapsible\"\n className={cn(\"\", className)}\n {...props}\n />\n );\n}\n\nfunction CollapsibleTrigger({\n className,\n ...props\n}: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>) {\n return (\n <CollapsiblePrimitive.CollapsibleTrigger\n data-slot=\"collapsible-trigger\"\n className={cn(\"sg:flex sg:cursor-pointer sg:items-center\"
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/primitives/collapsible/collapsible.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport * as CollapsiblePrimitive from \"@radix-ui/react-collapsible\";\nimport { cn } from \"singularity-components/utils\";\n\nfunction Collapsible({\n className,\n ...props\n}: React.ComponentProps<typeof CollapsiblePrimitive.Root>) {\n return (\n <CollapsiblePrimitive.Root\n data-slot=\"collapsible\"\n className={cn(\"\", className)}\n {...props}\n />\n );\n}\n\nfunction CollapsibleTrigger({\n className,\n ...props\n}: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>) {\n return (\n <CollapsiblePrimitive.CollapsibleTrigger\n data-slot=\"collapsible-trigger\"\n className={cn(\n \"sg:relative sg:flex sg:w-full sg:cursor-pointer sg:items-center sg:rounded-sm sg:outline-none sg:transition-colors sg:focus-visible:z-10 sg:focus-visible:ring-2 sg:focus-visible:ring-inset sg:focus-visible:ring-ring sg:focus-visible:ring-offset-0\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction CollapsibleContent({\n className,\n ...props\n}: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>) {\n return (\n <CollapsiblePrimitive.CollapsibleContent\n data-slot=\"collapsible-content\"\n className={cn(\n \"sg:overflow-hidden sg:data-[state=open]:animate-accordion-down sg:data-[state=closed]:animate-accordion-up\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport { Collapsible, CollapsibleTrigger, CollapsibleContent };\n"],"mappings":";AAWI;AATJ,YAAY,WAAW;AACvB,YAAY,0BAA0B;AACtC,SAAS,UAAU;AAEnB,SAAS,YAAY;AAAA,EACnB;AAAA,EACA,GAAG;AACL,GAA2D;AACzD,SACE;AAAA,IAAC,qBAAqB;AAAA,IAArB;AAAA,MACC,aAAU;AAAA,MACV,WAAW,GAAG,IAAI,SAAS;AAAA,MAC1B,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,SAAS,mBAAmB;AAAA,EAC1B;AAAA,EACA,GAAG;AACL,GAAyE;AACvE,SACE;AAAA,IAAC,qBAAqB;AAAA,IAArB;AAAA,MACC,aAAU;AAAA,MACV,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,SAAS,mBAAmB;AAAA,EAC1B;AAAA,EACA,GAAG;AACL,GAAyE;AACvE,SACE;AAAA,IAAC,qBAAqB;AAAA,IAArB;AAAA,MACC,aAAU;AAAA,MACV,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;","names":[]}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
1
|
import * as React from 'react';
|
|
3
2
|
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
4
3
|
|
|
@@ -23,7 +22,7 @@ declare const DropdownMenuLabel: React.ForwardRefExoticComponent<Omit<DropdownMe
|
|
|
23
22
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
24
23
|
declare const DropdownMenuSeparator: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
25
24
|
declare const DropdownMenuShortcut: {
|
|
26
|
-
({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>):
|
|
25
|
+
({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): React.JSX.Element;
|
|
27
26
|
displayName: string;
|
|
28
27
|
};
|
|
29
28
|
|
|
@@ -3,6 +3,7 @@ import * as React from "react";
|
|
|
3
3
|
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
4
4
|
import { icons } from "lucide-react";
|
|
5
5
|
import { cn } from "../../../utils/index.js";
|
|
6
|
+
const menuItemFocusClasses = "sg:focus-visible:outline-none sg:focus-visible:ring-2 sg:focus-visible:ring-inset sg:focus-visible:ring-ring sg:focus-visible:ring-offset-0";
|
|
6
7
|
const DropdownMenu = DropdownMenuPrimitive.Root;
|
|
7
8
|
const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
|
8
9
|
const DropdownMenuGroup = DropdownMenuPrimitive.Group;
|
|
@@ -15,7 +16,8 @@ const DropdownMenuSubTrigger = React.forwardRef(({ className, inset, children, .
|
|
|
15
16
|
ref,
|
|
16
17
|
"data-slot": "dropdown-menu-sub-trigger",
|
|
17
18
|
className: cn(
|
|
18
|
-
"sg:flex sg:cursor-default sg:select-none sg:items-center sg:rounded-sm sg:px-2 sg:py-1.5 sg:text-sm sg:outline-none sg:data-[state=open]:bg-accent sg:focus:bg-accent",
|
|
19
|
+
"sg:flex sg:cursor-default sg:select-none sg:items-center sg:rounded-sm sg:px-2 sg:py-1.5 sg:text-sm sg:outline-none sg:data-[state=open]:bg-accent sg:focus:bg-accent sg:focus:text-accent-foreground",
|
|
20
|
+
menuItemFocusClasses,
|
|
19
21
|
inset && "sg:pl-8",
|
|
20
22
|
className
|
|
21
23
|
),
|
|
@@ -61,6 +63,7 @@ const DropdownMenuItem = React.forwardRef(({ className, inset, ...props }, ref)
|
|
|
61
63
|
"data-slot": "dropdown-menu-item",
|
|
62
64
|
className: cn(
|
|
63
65
|
"sg:relative sg:flex sg:cursor-default sg:select-none sg:items-center sg:rounded-sm sg:px-2 sg:py-1.5 sg:text-sm sg:outline-none sg:transition-colors sg:data-disabled:pointer-events-none sg:data-disabled:opacity-50 sg:focus:bg-accent sg:focus:text-accent-foreground",
|
|
66
|
+
menuItemFocusClasses,
|
|
64
67
|
inset && "sg:pl-8",
|
|
65
68
|
className
|
|
66
69
|
),
|
|
@@ -75,6 +78,7 @@ const DropdownMenuCheckboxItem = React.forwardRef(({ className, children, checke
|
|
|
75
78
|
"data-slot": "dropdown-menu-checkbox-item",
|
|
76
79
|
className: cn(
|
|
77
80
|
"sg:relative sg:flex sg:cursor-default sg:select-none sg:items-center sg:rounded-sm sg:py-1.5 sg:pl-8 sg:pr-2 sg:text-sm sg:outline-none sg:transition-colors sg:data-disabled:pointer-events-none sg:data-disabled:opacity-50 sg:focus:bg-accent sg:focus:text-accent-foreground",
|
|
81
|
+
menuItemFocusClasses,
|
|
78
82
|
className
|
|
79
83
|
),
|
|
80
84
|
checked,
|
|
@@ -93,6 +97,7 @@ const DropdownMenuRadioItem = React.forwardRef(({ className, children, ...props
|
|
|
93
97
|
"data-slot": "dropdown-menu-radio-item",
|
|
94
98
|
className: cn(
|
|
95
99
|
"sg:relative sg:flex sg:cursor-default sg:select-none sg:items-center sg:rounded-sm sg:py-1.5 sg:pl-8 sg:pr-2 sg:text-sm sg:outline-none sg:transition-colors sg:data-disabled:pointer-events-none sg:data-disabled:opacity-50 sg:focus:bg-accent sg:focus:text-accent-foreground",
|
|
100
|
+
menuItemFocusClasses,
|
|
96
101
|
className
|
|
97
102
|
),
|
|
98
103
|
...props,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/primitives/dropdown-menu/dropdown-menu.tsx"],"sourcesContent":["import * as React from \"react\";\nimport * as DropdownMenuPrimitive from \"@radix-ui/react-dropdown-menu\";\nimport { icons } from \"lucide-react\";\nimport { cn } from \"../../../utils/index\";\n\nconst DropdownMenu = DropdownMenuPrimitive.Root;\n\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;\n\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group;\n\nconst DropdownMenuPortal = DropdownMenuPrimitive.Portal;\n\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub;\n\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;\n\nconst DropdownMenuSubTrigger = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n }\n>(({ className, inset, children, ...props }, ref) => (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n data-slot=\"dropdown-menu-sub-trigger\"\n className={cn(\n \"sg:flex sg:cursor-default sg:select-none sg:items-center sg:rounded-sm sg:px-2 sg:py-1.5 sg:text-sm sg:outline-none sg:data-[state=open]:bg-accent sg:focus:bg-accent\",\n inset && \"sg:pl-8\",\n className,\n )}\n {...props}\n >\n {children}\n <icons.ChevronRight className=\"sg:ml-auto sg:h-4 sg:w-4\" />\n </DropdownMenuPrimitive.SubTrigger>\n));\nDropdownMenuSubTrigger.displayName =\n DropdownMenuPrimitive.SubTrigger.displayName;\n\nconst DropdownMenuSubContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n data-slot=\"dropdown-menu-sub-content\"\n className={cn(\n \"sg:z-50 sg:min-w-32 sg:overflow-hidden sg:rounded-md sg:border sg:bg-popover sg:p-1 sg:text-popover-foreground sg:shadow-lg sg:data-[state=open]:animate-in sg:data-[state=closed]:animate-out sg:data-[state=closed]:fade-out-0 sg:data-[state=open]:fade-in-0 sg:data-[state=closed]:zoom-out-95 sg:data-[state=open]:zoom-in-95 sg:data-[side=bottom]:slide-in-from-top-2 sg:data-[side=left]:slide-in-from-right-2 sg:data-[side=right]:slide-in-from-left-2 sg:data-[side=top]:slide-in-from-bottom-2\",\n className,\n )}\n {...props}\n />\n));\nDropdownMenuSubContent.displayName =\n DropdownMenuPrimitive.SubContent.displayName;\n\nconst DropdownMenuContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n data-slot=\"dropdown-menu-content\"\n className={cn(\n \"sg:z-50 sg:min-w-32 sg:overflow-hidden sg:rounded-md sg:border sg:bg-popover sg:p-1 sg:text-popover-foreground sg:shadow-md sg:data-[state=open]:animate-in sg:data-[state=closed]:animate-out sg:data-[state=closed]:fade-out-0 sg:data-[state=open]:fade-in-0 sg:data-[state=closed]:zoom-out-95 sg:data-[state=open]:zoom-in-95 sg:data-[side=bottom]:slide-in-from-top-2 sg:data-[side=left]:slide-in-from-right-2 sg:data-[side=right]:slide-in-from-left-2 sg:data-[side=top]:slide-in-from-bottom-2\",\n className,\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n));\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;\n\nconst DropdownMenuItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Item\n ref={ref}\n data-slot=\"dropdown-menu-item\"\n className={cn(\n \"sg:relative sg:flex sg:cursor-default sg:select-none sg:items-center sg:rounded-sm sg:px-2 sg:py-1.5 sg:text-sm sg:outline-none sg:transition-colors sg:data-disabled:pointer-events-none sg:data-disabled:opacity-50 sg:focus:bg-accent sg:focus:text-accent-foreground\",\n inset && \"sg:pl-8\",\n className,\n )}\n {...props}\n />\n));\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;\n\nconst DropdownMenuCheckboxItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n data-slot=\"dropdown-menu-checkbox-item\"\n className={cn(\n \"sg:relative sg:flex sg:cursor-default sg:select-none sg:items-center sg:rounded-sm sg:py-1.5 sg:pl-8 sg:pr-2 sg:text-sm sg:outline-none sg:transition-colors sg:data-disabled:pointer-events-none sg:data-disabled:opacity-50 sg:focus:bg-accent sg:focus:text-accent-foreground\",\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"sg:absolute sg:left-2 sg:flex sg:h-3.5 sg:w-3.5 sg:items-center sg:justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <icons.Check className=\"sg:h-4 sg:w-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n));\nDropdownMenuCheckboxItem.displayName =\n DropdownMenuPrimitive.CheckboxItem.displayName;\n\nconst DropdownMenuRadioItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n data-slot=\"dropdown-menu-radio-item\"\n className={cn(\n \"sg:relative sg:flex sg:cursor-default sg:select-none sg:items-center sg:rounded-sm sg:py-1.5 sg:pl-8 sg:pr-2 sg:text-sm sg:outline-none sg:transition-colors sg:data-disabled:pointer-events-none sg:data-disabled:opacity-50 sg:focus:bg-accent sg:focus:text-accent-foreground\",\n className,\n )}\n {...props}\n >\n <span className=\"sg:absolute sg:left-2 sg:flex sg:h-3.5 sg:w-3.5 sg:items-center sg:justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <icons.Circle className=\"sg:h-2 sg:w-2 sg:fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n));\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;\n\nconst DropdownMenuLabel = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Label\n ref={ref}\n data-slot=\"dropdown-menu-label\"\n className={cn(\n \"sg:px-2 sg:py-1.5 sg:text-sm sg:font-semibold\",\n inset && \"sg:pl-8\",\n className,\n )}\n {...props}\n />\n));\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;\n\nconst DropdownMenuSeparator = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Separator\n ref={ref}\n data-slot=\"dropdown-menu-separator\"\n className={cn(\"sg:-mx-1 sg:my-1 sg:h-px sg:bg-muted\", className)}\n {...props}\n />\n));\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;\n\nconst DropdownMenuShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span\n data-slot=\"dropdown-menu-shortcut\"\n className={cn(\n \"sg:ml-auto sg:text-xs sg:tracking-widest sg:opacity-60\",\n className,\n )}\n {...props}\n />\n );\n};\nDropdownMenuShortcut.displayName = \"DropdownMenuShortcut\";\n\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuGroup,\n DropdownMenuPortal,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuRadioGroup,\n};\n"],"mappings":"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","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/primitives/dropdown-menu/dropdown-menu.tsx"],"sourcesContent":["import * as React from \"react\";\nimport * as DropdownMenuPrimitive from \"@radix-ui/react-dropdown-menu\";\nimport { icons } from \"lucide-react\";\nimport { cn } from \"../../../utils/index\";\n\nconst menuItemFocusClasses =\n \"sg:focus-visible:outline-none sg:focus-visible:ring-2 sg:focus-visible:ring-inset sg:focus-visible:ring-ring sg:focus-visible:ring-offset-0\";\n\nconst DropdownMenu = DropdownMenuPrimitive.Root;\n\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;\n\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group;\n\nconst DropdownMenuPortal = DropdownMenuPrimitive.Portal;\n\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub;\n\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;\n\nconst DropdownMenuSubTrigger = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n }\n>(({ className, inset, children, ...props }, ref) => (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n data-slot=\"dropdown-menu-sub-trigger\"\n className={cn(\n \"sg:flex sg:cursor-default sg:select-none sg:items-center sg:rounded-sm sg:px-2 sg:py-1.5 sg:text-sm sg:outline-none sg:data-[state=open]:bg-accent sg:focus:bg-accent sg:focus:text-accent-foreground\",\n menuItemFocusClasses,\n inset && \"sg:pl-8\",\n className,\n )}\n {...props}\n >\n {children}\n <icons.ChevronRight className=\"sg:ml-auto sg:h-4 sg:w-4\" />\n </DropdownMenuPrimitive.SubTrigger>\n));\nDropdownMenuSubTrigger.displayName =\n DropdownMenuPrimitive.SubTrigger.displayName;\n\nconst DropdownMenuSubContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n data-slot=\"dropdown-menu-sub-content\"\n className={cn(\n \"sg:z-50 sg:min-w-32 sg:overflow-hidden sg:rounded-md sg:border sg:bg-popover sg:p-1 sg:text-popover-foreground sg:shadow-lg sg:data-[state=open]:animate-in sg:data-[state=closed]:animate-out sg:data-[state=closed]:fade-out-0 sg:data-[state=open]:fade-in-0 sg:data-[state=closed]:zoom-out-95 sg:data-[state=open]:zoom-in-95 sg:data-[side=bottom]:slide-in-from-top-2 sg:data-[side=left]:slide-in-from-right-2 sg:data-[side=right]:slide-in-from-left-2 sg:data-[side=top]:slide-in-from-bottom-2\",\n className,\n )}\n {...props}\n />\n));\nDropdownMenuSubContent.displayName =\n DropdownMenuPrimitive.SubContent.displayName;\n\nconst DropdownMenuContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n data-slot=\"dropdown-menu-content\"\n className={cn(\n \"sg:z-50 sg:min-w-32 sg:overflow-hidden sg:rounded-md sg:border sg:bg-popover sg:p-1 sg:text-popover-foreground sg:shadow-md sg:data-[state=open]:animate-in sg:data-[state=closed]:animate-out sg:data-[state=closed]:fade-out-0 sg:data-[state=open]:fade-in-0 sg:data-[state=closed]:zoom-out-95 sg:data-[state=open]:zoom-in-95 sg:data-[side=bottom]:slide-in-from-top-2 sg:data-[side=left]:slide-in-from-right-2 sg:data-[side=right]:slide-in-from-left-2 sg:data-[side=top]:slide-in-from-bottom-2\",\n className,\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n));\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;\n\nconst DropdownMenuItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Item\n ref={ref}\n data-slot=\"dropdown-menu-item\"\n className={cn(\n \"sg:relative sg:flex sg:cursor-default sg:select-none sg:items-center sg:rounded-sm sg:px-2 sg:py-1.5 sg:text-sm sg:outline-none sg:transition-colors sg:data-disabled:pointer-events-none sg:data-disabled:opacity-50 sg:focus:bg-accent sg:focus:text-accent-foreground\",\n menuItemFocusClasses,\n inset && \"sg:pl-8\",\n className,\n )}\n {...props}\n />\n));\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;\n\nconst DropdownMenuCheckboxItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n data-slot=\"dropdown-menu-checkbox-item\"\n className={cn(\n \"sg:relative sg:flex sg:cursor-default sg:select-none sg:items-center sg:rounded-sm sg:py-1.5 sg:pl-8 sg:pr-2 sg:text-sm sg:outline-none sg:transition-colors sg:data-disabled:pointer-events-none sg:data-disabled:opacity-50 sg:focus:bg-accent sg:focus:text-accent-foreground\",\n menuItemFocusClasses,\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"sg:absolute sg:left-2 sg:flex sg:h-3.5 sg:w-3.5 sg:items-center sg:justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <icons.Check className=\"sg:h-4 sg:w-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n));\nDropdownMenuCheckboxItem.displayName =\n DropdownMenuPrimitive.CheckboxItem.displayName;\n\nconst DropdownMenuRadioItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n data-slot=\"dropdown-menu-radio-item\"\n className={cn(\n \"sg:relative sg:flex sg:cursor-default sg:select-none sg:items-center sg:rounded-sm sg:py-1.5 sg:pl-8 sg:pr-2 sg:text-sm sg:outline-none sg:transition-colors sg:data-disabled:pointer-events-none sg:data-disabled:opacity-50 sg:focus:bg-accent sg:focus:text-accent-foreground\",\n menuItemFocusClasses,\n className,\n )}\n {...props}\n >\n <span className=\"sg:absolute sg:left-2 sg:flex sg:h-3.5 sg:w-3.5 sg:items-center sg:justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <icons.Circle className=\"sg:h-2 sg:w-2 sg:fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n));\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;\n\nconst DropdownMenuLabel = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean;\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Label\n ref={ref}\n data-slot=\"dropdown-menu-label\"\n className={cn(\n \"sg:px-2 sg:py-1.5 sg:text-sm sg:font-semibold\",\n inset && \"sg:pl-8\",\n className,\n )}\n {...props}\n />\n));\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;\n\nconst DropdownMenuSeparator = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Separator\n ref={ref}\n data-slot=\"dropdown-menu-separator\"\n className={cn(\"sg:-mx-1 sg:my-1 sg:h-px sg:bg-muted\", className)}\n {...props}\n />\n));\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;\n\nconst DropdownMenuShortcut = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) => {\n return (\n <span\n data-slot=\"dropdown-menu-shortcut\"\n className={cn(\n \"sg:ml-auto sg:text-xs sg:tracking-widest sg:opacity-60\",\n className,\n )}\n {...props}\n />\n );\n};\nDropdownMenuShortcut.displayName = \"DropdownMenuShortcut\";\n\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuGroup,\n DropdownMenuPortal,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuRadioGroup,\n};\n"],"mappings":"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","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as React from 'react';
|
|
2
2
|
import { Checkbox as Checkbox$1 } from '@base-ui/react';
|
|
3
3
|
|
|
4
|
-
declare function Checkbox({ className, ...props }: Checkbox$1.Root.Props):
|
|
4
|
+
declare function Checkbox({ className, ...props }: Checkbox$1.Root.Props): React.JSX.Element;
|
|
5
5
|
|
|
6
6
|
export { Checkbox };
|
|
@@ -9,7 +9,7 @@ function Checkbox({ className, ...props }) {
|
|
|
9
9
|
{
|
|
10
10
|
"data-slot": "checkbox",
|
|
11
11
|
className: cn(
|
|
12
|
-
"sg:peer sg:h-4 sg:w-4 sg:shrink-0 sg:rounded-sm sg:border sg:border-primary sg:ring-offset-background sg:data-
|
|
12
|
+
"sg:peer sg:h-4 sg:w-4 sg:shrink-0 sg:rounded-sm sg:border sg:border-primary sg:ring-offset-background sg:data-checked:bg-primary sg:data-checked:text-primary-foreground sg:focus-visible:outline-none sg:focus-visible:ring-2 sg:focus-visible:ring-ring sg:focus-visible:ring-offset-2 sg:disabled:cursor-not-allowed sg:disabled:opacity-50",
|
|
13
13
|
className
|
|
14
14
|
),
|
|
15
15
|
...props,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/primitives/forms/checkbox.tsx"],"sourcesContent":["\"use client\";\n\nimport { Checkbox as CheckboxPrimitive } from \"@base-ui/react\";\nimport { CheckIcon } from \"lucide-react\";\nimport { cn } from \"../../../utils/index\";\n\nfunction Checkbox({ className, ...props }: CheckboxPrimitive.Root.Props) {\n return (\n <CheckboxPrimitive.Root\n data-slot=\"checkbox\"\n className={cn(\n \"sg:peer sg:h-4 sg:w-4 sg:shrink-0 sg:rounded-sm sg:border sg:border-primary sg:ring-offset-background sg:data-
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/primitives/forms/checkbox.tsx"],"sourcesContent":["\"use client\";\n\nimport { Checkbox as CheckboxPrimitive } from \"@base-ui/react\";\nimport { CheckIcon } from \"lucide-react\";\nimport { cn } from \"../../../utils/index\";\n\nfunction Checkbox({ className, ...props }: CheckboxPrimitive.Root.Props) {\n return (\n <CheckboxPrimitive.Root\n data-slot=\"checkbox\"\n className={cn(\n \"sg:peer sg:h-4 sg:w-4 sg:shrink-0 sg:rounded-sm sg:border sg:border-primary sg:ring-offset-background sg:data-checked:bg-primary sg:data-checked:text-primary-foreground sg:focus-visible:outline-none sg:focus-visible:ring-2 sg:focus-visible:ring-ring sg:focus-visible:ring-offset-2 sg:disabled:cursor-not-allowed sg:disabled:opacity-50\",\n className,\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator\n data-slot=\"checkbox-indicator\"\n className=\"sg:flex sg:items-center sg:justify-center sg:text-current\"\n >\n <CheckIcon className=\"sg:h-4 sg:w-4\" />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n );\n}\n\nexport { Checkbox };\n"],"mappings":";AAoBQ;AAlBR,SAAS,YAAY,yBAAyB;AAC9C,SAAS,iBAAiB;AAC1B,SAAS,UAAU;AAEnB,SAAS,SAAS,EAAE,WAAW,GAAG,MAAM,GAAiC;AACvE,SACE;AAAA,IAAC,kBAAkB;AAAA,IAAlB;AAAA,MACC,aAAU;AAAA,MACV,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEJ;AAAA,QAAC,kBAAkB;AAAA,QAAlB;AAAA,UACC,aAAU;AAAA,UACV,WAAU;AAAA,UAEV,8BAAC,aAAU,WAAU,iBAAgB;AAAA;AAAA,MACvC;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -1,29 +1,30 @@
|
|
|
1
1
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
2
|
-
import * as
|
|
2
|
+
import * as React$1 from 'react';
|
|
3
3
|
import { VariantProps } from 'class-variance-authority';
|
|
4
4
|
import { Label } from '../label/label.js';
|
|
5
|
-
import 'react';
|
|
6
5
|
|
|
7
|
-
declare function FieldSet({ className, ...props }: React.ComponentProps<"fieldset">):
|
|
6
|
+
declare function FieldSet({ className, ...props }: React.ComponentProps<"fieldset">): React$1.JSX.Element;
|
|
8
7
|
declare function FieldLegend({ className, variant, ...props }: React.ComponentProps<"legend"> & {
|
|
9
8
|
variant?: "legend" | "label";
|
|
10
|
-
}):
|
|
11
|
-
declare function FieldGroup({ className, ...props }: React.ComponentProps<"div">):
|
|
9
|
+
}): React$1.JSX.Element;
|
|
10
|
+
declare function FieldGroup({ className, ...props }: React.ComponentProps<"div">): React$1.JSX.Element;
|
|
12
11
|
declare const fieldVariants: (props?: ({
|
|
13
|
-
orientation?: "
|
|
12
|
+
orientation?: "horizontal" | "vertical" | "responsive" | null | undefined;
|
|
14
13
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
15
|
-
declare function Field({ className, orientation, ...props }: React.ComponentProps<"div"> & VariantProps<typeof fieldVariants>
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
declare function
|
|
19
|
-
declare function
|
|
14
|
+
declare function Field({ className, orientation, invalid, ...props }: React.ComponentProps<"div"> & VariantProps<typeof fieldVariants> & {
|
|
15
|
+
invalid?: boolean;
|
|
16
|
+
}): React$1.JSX.Element;
|
|
17
|
+
declare function FieldContent({ className, ...props }: React.ComponentProps<"div">): React$1.JSX.Element;
|
|
18
|
+
declare function FieldLabel({ className, ...props }: React.ComponentProps<typeof Label>): React$1.JSX.Element;
|
|
19
|
+
declare function FieldTitle({ className, ...props }: React.ComponentProps<"div">): React$1.JSX.Element;
|
|
20
|
+
declare function FieldDescription({ className, ...props }: React.ComponentProps<"p">): React$1.JSX.Element;
|
|
20
21
|
declare function FieldSeparator({ children, className, ...props }: React.ComponentProps<"div"> & {
|
|
21
22
|
children?: React.ReactNode;
|
|
22
|
-
}):
|
|
23
|
+
}): React$1.JSX.Element;
|
|
23
24
|
declare function FieldError({ className, children, errors, ...props }: React.ComponentProps<"div"> & {
|
|
24
25
|
errors?: Array<{
|
|
25
26
|
message?: string;
|
|
26
27
|
} | undefined>;
|
|
27
|
-
}):
|
|
28
|
+
}): React$1.JSX.Element | null;
|
|
28
29
|
|
|
29
30
|
export { Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle };
|
|
@@ -49,7 +49,7 @@ function FieldGroup({ className, ...props }) {
|
|
|
49
49
|
);
|
|
50
50
|
}
|
|
51
51
|
const fieldVariants = cva(
|
|
52
|
-
"sg:group/field sg:flex sg:w-full sg:gap-3 sg:data-[invalid=true]:text-
|
|
52
|
+
"sg:group/field sg:flex sg:w-full sg:gap-3 sg:data-[invalid=true]:text-error",
|
|
53
53
|
{
|
|
54
54
|
variants: {
|
|
55
55
|
orientation: {
|
|
@@ -66,6 +66,7 @@ const fieldVariants = cva(
|
|
|
66
66
|
function Field({
|
|
67
67
|
className,
|
|
68
68
|
orientation = "vertical",
|
|
69
|
+
invalid,
|
|
69
70
|
...props
|
|
70
71
|
}) {
|
|
71
72
|
return /* @__PURE__ */ jsx(
|
|
@@ -74,6 +75,7 @@ function Field({
|
|
|
74
75
|
role: "group",
|
|
75
76
|
"data-slot": "field",
|
|
76
77
|
"data-orientation": orientation,
|
|
78
|
+
"data-invalid": invalid ? true : void 0,
|
|
77
79
|
className: cn(fieldVariants({ orientation }), className),
|
|
78
80
|
...props
|
|
79
81
|
}
|
|
@@ -197,7 +199,7 @@ function FieldError({
|
|
|
197
199
|
{
|
|
198
200
|
role: "alert",
|
|
199
201
|
"data-slot": "field-error",
|
|
200
|
-
className: cn("sg:text-sm sg:font-normal sg:text-
|
|
202
|
+
className: cn("sg:text-sm sg:font-normal sg:text-error", className),
|
|
201
203
|
...props,
|
|
202
204
|
children: content
|
|
203
205
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/primitives/forms/field.tsx"],"sourcesContent":["\"use client\";\n\nimport { useMemo } from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../../../utils/index\";\nimport { Label, Separator } from \"../index\";\n\nfunction FieldSet({ className, ...props }: React.ComponentProps<\"fieldset\">) {\n return (\n <fieldset\n data-slot=\"field-set\"\n className={cn(\n \"sg:flex sg:flex-col sg:gap-6 sg:has-[>[data-slot=checkbox-group]]:gap-3 sg:has-[>[data-slot=radio-group]]:gap-3\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction FieldLegend({\n className,\n variant = \"legend\",\n ...props\n}: React.ComponentProps<\"legend\"> & { variant?: \"legend\" | \"label\" }) {\n return (\n <legend\n data-slot=\"field-legend\"\n data-variant={variant}\n className={cn(\n \"sg:mb-3 sg:font-medium sg:data-[variant=label]:text-sm sg:data-[variant=legend]:text-base\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction FieldGroup({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"field-group\"\n className={cn(\n \"sg:group/field-group sg:@container/field-group sg:flex sg:w-full sg:flex-col sg:gap-7 sg:data-[slot=checkbox-group]:gap-3 sg:*:data-[slot=field-group]:gap-4\",\n className,\n )}\n {...props}\n />\n );\n}\n\nconst fieldVariants = cva(\n \"sg:group/field sg:flex sg:w-full sg:gap-3 sg:data-[invalid=true]:text-
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/primitives/forms/field.tsx"],"sourcesContent":["\"use client\";\n\nimport { useMemo } from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../../../utils/index\";\nimport { Label, Separator } from \"../index\";\n\nfunction FieldSet({ className, ...props }: React.ComponentProps<\"fieldset\">) {\n return (\n <fieldset\n data-slot=\"field-set\"\n className={cn(\n \"sg:flex sg:flex-col sg:gap-6 sg:has-[>[data-slot=checkbox-group]]:gap-3 sg:has-[>[data-slot=radio-group]]:gap-3\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction FieldLegend({\n className,\n variant = \"legend\",\n ...props\n}: React.ComponentProps<\"legend\"> & { variant?: \"legend\" | \"label\" }) {\n return (\n <legend\n data-slot=\"field-legend\"\n data-variant={variant}\n className={cn(\n \"sg:mb-3 sg:font-medium sg:data-[variant=label]:text-sm sg:data-[variant=legend]:text-base\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction FieldGroup({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"field-group\"\n className={cn(\n \"sg:group/field-group sg:@container/field-group sg:flex sg:w-full sg:flex-col sg:gap-7 sg:data-[slot=checkbox-group]:gap-3 sg:*:data-[slot=field-group]:gap-4\",\n className,\n )}\n {...props}\n />\n );\n}\n\nconst fieldVariants = cva(\n \"sg:group/field sg:flex sg:w-full sg:gap-3 sg:data-[invalid=true]:text-error\",\n {\n variants: {\n orientation: {\n vertical: \"sg:flex-col sg:*:w-full sg:[&>.sr-only]:w-auto\",\n horizontal:\n \"sg:flex-row sg:items-center sg:has-[>[data-slot=field-content]]:items-start sg:*:data-[slot=field-label]:flex-auto sg:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px\",\n responsive:\n \"sg:flex-col sg:*:w-full sg:@md/field-group:flex-row sg:@md/field-group:items-center sg:@md/field-group:*:w-auto sg:@md/field-group:has-[>[data-slot=field-content]]:items-start sg:@md/field-group:*:data-[slot=field-label]:flex-auto sg:[&>.sr-only]:w-auto sg:@md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px\",\n },\n },\n defaultVariants: {\n orientation: \"vertical\",\n },\n },\n);\n\nfunction Field({\n className,\n orientation = \"vertical\",\n invalid,\n ...props\n}: React.ComponentProps<\"div\"> &\n VariantProps<typeof fieldVariants> & {\n invalid?: boolean;\n }) {\n return (\n <div\n role=\"group\"\n data-slot=\"field\"\n data-orientation={orientation}\n data-invalid={invalid ? true : undefined}\n className={cn(fieldVariants({ orientation }), className)}\n {...props}\n />\n );\n}\n\nfunction FieldContent({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"field-content\"\n className={cn(\n \"sg:group/field-content sg:flex sg:flex-1 sg:flex-col sg:gap-1 sg:leading-snug\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction FieldLabel({\n className,\n ...props\n}: React.ComponentProps<typeof Label>) {\n return (\n <Label\n data-slot=\"field-label\"\n className={cn(\n \"sg:group/field-label sg:peer/field-label sg:flex sg:w-fit sg:gap-2 sg:leading-snug sg:group-data-[disabled=true]/field:opacity-50 sg:has-data-checked:border-primary/30 sg:has-data-checked:bg-primary/5 sg:has-[>[data-slot=field]]:rounded-xl sg:has-[>[data-slot=field]]:border sg:*:data-[slot=field]:p-4 sg:dark:has-data-checked:border-primary/20 sg:dark:has-data-checked:bg-primary/10\",\n \"sg:has-[>[data-slot=field]]:w-full sg:has-[>[data-slot=field]]:flex-col\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction FieldTitle({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"field-label\"\n className={cn(\n \"sg:flex sg:w-fit sg:items-center sg:gap-2 sg:text-sm sg:leading-snug sg:font-medium sg:group-data-[disabled=true]/field:opacity-50\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction FieldDescription({ className, ...props }: React.ComponentProps<\"p\">) {\n return (\n <p\n data-slot=\"field-description\"\n className={cn(\n \"sg:text-left sg:text-sm sg:leading-normal sg:font-normal sg:text-muted-foreground sg:group-has-data-horizontal/field:text-balance sg:[[data-variant=legend]+&]:-mt-1.5\",\n \"sg:last:mt-0 sg:nth-last-2:-mt-1\",\n \"sg:[&>a]:underline sg:[&>a]:underline-offset-4 sg:[&>a:hover]:text-primary\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction FieldSeparator({\n children,\n className,\n ...props\n}: React.ComponentProps<\"div\"> & {\n children?: React.ReactNode;\n}) {\n return (\n <div\n data-slot=\"field-separator\"\n data-content={!!children}\n className={cn(\n \"sg:relative sg:-my-2 sg:h-5 sg:text-sm sg:group-data-[variant=outline]/field-group:-mb-2\",\n className,\n )}\n {...props}\n >\n <Separator className=\"sg:absolute sg:inset-0 sg:top-1/2\" />\n {children && (\n <span\n className=\"sg:relative sg:mx-auto sg:block sg:w-fit sg:bg-background sg:px-2 sg:text-muted-foreground\"\n data-slot=\"field-separator-content\"\n >\n {children}\n </span>\n )}\n </div>\n );\n}\n\nfunction FieldError({\n className,\n children,\n errors,\n ...props\n}: React.ComponentProps<\"div\"> & {\n errors?: Array<{ message?: string } | undefined>;\n}) {\n const content = useMemo(() => {\n if (children) {\n return children;\n }\n\n if (!errors?.length) {\n return null;\n }\n\n const uniqueErrors = [\n ...new Map(errors.map((error) => [error?.message, error])).values(),\n ];\n\n if (uniqueErrors?.length == 1) {\n return uniqueErrors[0]?.message;\n }\n\n return (\n <ul className=\"sg:ml-4 sg:flex sg:list-disc sg:flex-col sg:gap-1\">\n {uniqueErrors.map(\n (error, index) =>\n error?.message && <li key={index}>{error.message}</li>,\n )}\n </ul>\n );\n }, [children, errors]);\n\n if (!content) {\n return null;\n }\n\n return (\n <div\n role=\"alert\"\n data-slot=\"field-error\"\n className={cn(\"sg:text-sm sg:font-normal sg:text-error\", className)}\n {...props}\n >\n {content}\n </div>\n );\n}\n\nexport {\n Field,\n FieldLabel,\n FieldDescription,\n FieldError,\n FieldGroup,\n FieldLegend,\n FieldSeparator,\n FieldSet,\n FieldContent,\n FieldTitle,\n};\n"],"mappings":"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","names":[]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as React$1 from 'react';
|
|
2
|
+
import { FieldErrorLike } from '../../../lib/forms/field-props.js';
|
|
3
|
+
import { Field } from './field.js';
|
|
4
|
+
import 'class-variance-authority/types';
|
|
5
|
+
import 'class-variance-authority';
|
|
6
|
+
import '../label/label.js';
|
|
7
|
+
|
|
8
|
+
type FormControlProps = {
|
|
9
|
+
/**
|
|
10
|
+
* Stable id shared by the label and control. Generated when omitted.
|
|
11
|
+
*/
|
|
12
|
+
id?: string;
|
|
13
|
+
label?: React.ReactNode;
|
|
14
|
+
description?: React.ReactNode;
|
|
15
|
+
errors?: FieldErrorLike[];
|
|
16
|
+
invalid?: boolean;
|
|
17
|
+
orientation?: React.ComponentProps<typeof Field>["orientation"];
|
|
18
|
+
labelClassName?: string;
|
|
19
|
+
className?: string;
|
|
20
|
+
children: React.ReactNode | ((controlId: string) => React.ReactNode);
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Composes {@link Field}, label, description, and error messaging for a single control.
|
|
24
|
+
* Works with manual state or as the layout shell inside TanStack Form fields.
|
|
25
|
+
*/
|
|
26
|
+
declare function FormControl({ id, label, description, errors, invalid, orientation, labelClassName, className, children, }: FormControlProps): React$1.JSX.Element;
|
|
27
|
+
|
|
28
|
+
export { FormControl };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useId } from "react";
|
|
4
|
+
import {
|
|
5
|
+
normalizeFieldErrors
|
|
6
|
+
} from "../../../lib/forms/field-props.js";
|
|
7
|
+
import {
|
|
8
|
+
Field,
|
|
9
|
+
FieldContent,
|
|
10
|
+
FieldDescription,
|
|
11
|
+
FieldError,
|
|
12
|
+
FieldLabel
|
|
13
|
+
} from "./field.js";
|
|
14
|
+
function FormControl({
|
|
15
|
+
id,
|
|
16
|
+
label,
|
|
17
|
+
description,
|
|
18
|
+
errors,
|
|
19
|
+
invalid,
|
|
20
|
+
orientation,
|
|
21
|
+
labelClassName,
|
|
22
|
+
className,
|
|
23
|
+
children
|
|
24
|
+
}) {
|
|
25
|
+
const generatedId = useId();
|
|
26
|
+
const controlId = id ?? generatedId;
|
|
27
|
+
const resolvedChildren = typeof children === "function" ? children(controlId) : children;
|
|
28
|
+
return /* @__PURE__ */ jsxs(Field, { orientation, invalid, className, children: [
|
|
29
|
+
label && /* @__PURE__ */ jsx(FieldLabel, { htmlFor: controlId, className: labelClassName, children: label }),
|
|
30
|
+
/* @__PURE__ */ jsxs(FieldContent, { children: [
|
|
31
|
+
resolvedChildren,
|
|
32
|
+
description && /* @__PURE__ */ jsx(FieldDescription, { children: description }),
|
|
33
|
+
/* @__PURE__ */ jsx(FieldError, { errors: normalizeFieldErrors(errors) })
|
|
34
|
+
] })
|
|
35
|
+
] });
|
|
36
|
+
}
|
|
37
|
+
export {
|
|
38
|
+
FormControl
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=form-control.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/primitives/forms/form-control.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport { useId } from \"react\";\r\nimport {\r\n normalizeFieldErrors,\r\n type FieldErrorLike,\r\n} from \"../../../lib/forms/field-props\";\r\nimport {\r\n Field,\r\n FieldContent,\r\n FieldDescription,\r\n FieldError,\r\n FieldLabel,\r\n} from \"./field\";\r\n\r\ntype FormControlProps = {\r\n /**\r\n * Stable id shared by the label and control. Generated when omitted.\r\n */\r\n id?: string;\r\n label?: React.ReactNode;\r\n description?: React.ReactNode;\r\n errors?: FieldErrorLike[];\r\n invalid?: boolean;\r\n orientation?: React.ComponentProps<typeof Field>[\"orientation\"];\r\n labelClassName?: string;\r\n className?: string;\r\n children: React.ReactNode | ((controlId: string) => React.ReactNode);\r\n};\r\n\r\n/**\r\n * Composes {@link Field}, label, description, and error messaging for a single control.\r\n * Works with manual state or as the layout shell inside TanStack Form fields.\r\n */\r\nfunction FormControl({\r\n id,\r\n label,\r\n description,\r\n errors,\r\n invalid,\r\n orientation,\r\n labelClassName,\r\n className,\r\n children,\r\n}: FormControlProps) {\r\n const generatedId = useId();\r\n const controlId = id ?? generatedId;\r\n const resolvedChildren =\r\n typeof children === \"function\" ? children(controlId) : children;\r\n\r\n return (\r\n <Field orientation={orientation} invalid={invalid} className={className}>\r\n {label && (\r\n <FieldLabel htmlFor={controlId} className={labelClassName}>\r\n {label}\r\n </FieldLabel>\r\n )}\r\n <FieldContent>\r\n {resolvedChildren}\r\n {description && <FieldDescription>{description}</FieldDescription>}\r\n <FieldError errors={normalizeFieldErrors(errors)} />\r\n </FieldContent>\r\n </Field>\r\n );\r\n}\r\n\r\nexport { FormControl };\r\n"],"mappings":";AAqDQ,cAIF,YAJE;AAnDR,SAAS,aAAa;AACtB;AAAA,EACE;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAqBP,SAAS,YAAY;AAAA,EACnB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAqB;AACnB,QAAM,cAAc,MAAM;AAC1B,QAAM,YAAY,MAAM;AACxB,QAAM,mBACJ,OAAO,aAAa,aAAa,SAAS,SAAS,IAAI;AAEzD,SACE,qBAAC,SAAM,aAA0B,SAAkB,WAChD;AAAA,aACC,oBAAC,cAAW,SAAS,WAAW,WAAW,gBACxC,iBACH;AAAA,IAEF,qBAAC,gBACE;AAAA;AAAA,MACA,eAAe,oBAAC,oBAAkB,uBAAY;AAAA,MAC/C,oBAAC,cAAW,QAAQ,qBAAqB,MAAM,GAAG;AAAA,OACpD;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React$1 from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Styled native form wrapper with consistent vertical spacing.
|
|
5
|
+
*/
|
|
6
|
+
declare function Form({ className, ...props }: React.ComponentProps<"form">): React$1.JSX.Element;
|
|
7
|
+
/**
|
|
8
|
+
* Horizontal row for primary and secondary form actions.
|
|
9
|
+
*/
|
|
10
|
+
declare function FormActions({ className, ...props }: React.ComponentProps<"div">): React$1.JSX.Element;
|
|
11
|
+
|
|
12
|
+
export { Form, FormActions };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../../utils/index.js";
|
|
3
|
+
function Form({ className, ...props }) {
|
|
4
|
+
return /* @__PURE__ */ jsx(
|
|
5
|
+
"form",
|
|
6
|
+
{
|
|
7
|
+
"data-slot": "form",
|
|
8
|
+
className: cn("sg:flex sg:w-full sg:flex-col sg:gap-6", className),
|
|
9
|
+
...props
|
|
10
|
+
}
|
|
11
|
+
);
|
|
12
|
+
}
|
|
13
|
+
function FormActions({ className, ...props }) {
|
|
14
|
+
return /* @__PURE__ */ jsx(
|
|
15
|
+
"div",
|
|
16
|
+
{
|
|
17
|
+
"data-slot": "form-actions",
|
|
18
|
+
className: cn(
|
|
19
|
+
"sg:flex sg:flex-wrap sg:items-center sg:gap-2",
|
|
20
|
+
className
|
|
21
|
+
),
|
|
22
|
+
...props
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
Form,
|
|
28
|
+
FormActions
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=form.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/primitives/forms/form.tsx"],"sourcesContent":["import { cn } from \"../../../utils/index\";\r\n\r\n/**\r\n * Styled native form wrapper with consistent vertical spacing.\r\n */\r\nfunction Form({ className, ...props }: React.ComponentProps<\"form\">) {\r\n return (\r\n <form\r\n data-slot=\"form\"\r\n className={cn(\"sg:flex sg:w-full sg:flex-col sg:gap-6\", className)}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\n/**\r\n * Horizontal row for primary and secondary form actions.\r\n */\r\nfunction FormActions({ className, ...props }: React.ComponentProps<\"div\">) {\r\n return (\r\n <div\r\n data-slot=\"form-actions\"\r\n className={cn(\r\n \"sg:flex sg:flex-wrap sg:items-center sg:gap-2\",\r\n className,\r\n )}\r\n {...props}\r\n />\r\n );\r\n}\r\n\r\nexport { Form, FormActions };\r\n"],"mappings":"AAOI;AAPJ,SAAS,UAAU;AAKnB,SAAS,KAAK,EAAE,WAAW,GAAG,MAAM,GAAiC;AACnE,SACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAW,GAAG,0CAA0C,SAAS;AAAA,MAChE,GAAG;AAAA;AAAA,EACN;AAEJ;AAKA,SAAS,YAAY,EAAE,WAAW,GAAG,MAAM,GAAgC;AACzE,SACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;","names":[]}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
1
|
import * as React from 'react';
|
|
3
2
|
|
|
4
|
-
declare function Input({ className, type, ...props }: React.ComponentProps<"input">):
|
|
3
|
+
declare function Input({ className, type, ...props }: React.ComponentProps<"input">): React.JSX.Element;
|
|
5
4
|
|
|
6
5
|
export { Input };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
1
|
import * as _base_ui_react from '@base-ui/react';
|
|
3
2
|
import { Select as Select$1 } from '@base-ui/react';
|
|
4
3
|
import * as React from 'react';
|
|
@@ -8,15 +7,15 @@ declare const SelectGroup: React.ForwardRefExoticComponent<Omit<_base_ui_react.S
|
|
|
8
7
|
declare const SelectValue: React.ForwardRefExoticComponent<Omit<_base_ui_react.SelectValueProps, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
9
8
|
declare function SelectTrigger({ className, size, children, ...props }: Select$1.Trigger.Props & {
|
|
10
9
|
size?: "sm" | "default";
|
|
11
|
-
}):
|
|
10
|
+
}): React.JSX.Element;
|
|
12
11
|
declare namespace SelectTrigger {
|
|
13
12
|
var displayName: string | undefined;
|
|
14
13
|
}
|
|
15
|
-
declare function SelectContent({ className, children, side, sideOffset, align, alignOffset, alignItemWithTrigger, ...props }: Select$1.Popup.Props & Pick<Select$1.Positioner.Props, "align" | "alignOffset" | "side" | "sideOffset" | "alignItemWithTrigger">):
|
|
16
|
-
declare function SelectLabel({ className, ...props }: Select$1.GroupLabel.Props):
|
|
17
|
-
declare function SelectItem({ className, children, ...props }: Select$1.Item.Props):
|
|
18
|
-
declare function SelectSeparator({ className, ...props }: Select$1.Separator.Props):
|
|
19
|
-
declare function SelectScrollUpButton({ className, ...props }: React.ComponentProps<typeof Select$1.ScrollUpArrow>):
|
|
20
|
-
declare function SelectScrollDownButton({ className, ...props }: React.ComponentProps<typeof Select$1.ScrollDownArrow>):
|
|
14
|
+
declare function SelectContent({ className, children, side, sideOffset, align, alignOffset, alignItemWithTrigger, ...props }: Select$1.Popup.Props & Pick<Select$1.Positioner.Props, "align" | "alignOffset" | "side" | "sideOffset" | "alignItemWithTrigger">): React.JSX.Element;
|
|
15
|
+
declare function SelectLabel({ className, ...props }: Select$1.GroupLabel.Props): React.JSX.Element;
|
|
16
|
+
declare function SelectItem({ className, children, ...props }: Select$1.Item.Props): React.JSX.Element;
|
|
17
|
+
declare function SelectSeparator({ className, ...props }: Select$1.Separator.Props): React.JSX.Element;
|
|
18
|
+
declare function SelectScrollUpButton({ className, ...props }: React.ComponentProps<typeof Select$1.ScrollUpArrow>): React.JSX.Element;
|
|
19
|
+
declare function SelectScrollDownButton({ className, ...props }: React.ComponentProps<typeof Select$1.ScrollDownArrow>): React.JSX.Element;
|
|
21
20
|
|
|
22
21
|
export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue };
|