@me1a/ui 2.2.1 → 2.2.3
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/accordion/index.d.mts +94 -0
- package/dist/accordion/index.mjs +2 -0
- package/dist/accordion/index.mjs.map +1 -0
- package/dist/avatar/index.d.mts +34 -0
- package/dist/avatar/index.mjs +2 -0
- package/dist/avatar/index.mjs.map +1 -0
- package/dist/badge/index.d.mts +41 -0
- package/dist/badge/index.mjs +2 -0
- package/dist/badge/index.mjs.map +1 -0
- package/dist/box/index.d.mts +50 -0
- package/dist/box/index.mjs +2 -0
- package/dist/box/index.mjs.map +1 -0
- package/dist/breadcrumb/index.d.mts +35 -0
- package/dist/breadcrumb/index.mjs +2 -0
- package/dist/breadcrumb/index.mjs.map +1 -0
- package/dist/{tooltip-B4jzaurK.d.mts → button/index.d.mts} +3 -25
- package/dist/button/index.mjs +2 -0
- package/dist/button/index.mjs.map +1 -0
- package/dist/card/index.d.mts +127 -0
- package/dist/card/index.mjs +2 -0
- package/dist/card/index.mjs.map +1 -0
- package/dist/checkbox/index.d.mts +21 -0
- package/dist/checkbox/index.mjs +2 -0
- package/dist/checkbox/index.mjs.map +1 -0
- package/dist/collapsible/index.d.mts +26 -0
- package/dist/collapsible/index.mjs +2 -0
- package/dist/collapsible/index.mjs.map +1 -0
- package/dist/command/index.d.mts +122 -0
- package/dist/command/index.mjs +2 -0
- package/dist/command/index.mjs.map +1 -0
- package/dist/container/index.d.mts +33 -0
- package/dist/container/index.mjs +2 -0
- package/dist/container/index.mjs.map +1 -0
- package/dist/dialog/index.d.mts +35 -0
- package/dist/dialog/index.mjs +2 -0
- package/dist/dialog/index.mjs.map +1 -0
- package/dist/drawer/index.d.mts +63 -0
- package/dist/drawer/index.mjs +2 -0
- package/dist/drawer/index.mjs.map +1 -0
- package/dist/dropdown-menu/index.d.mts +335 -0
- package/dist/dropdown-menu/index.mjs +2 -0
- package/dist/dropdown-menu/index.mjs.map +1 -0
- package/dist/form/index.d.mts +96 -0
- package/dist/form/index.mjs +2 -0
- package/dist/form/index.mjs.map +1 -0
- package/dist/{hooks.d.mts → hooks/index.d.mts} +10 -4
- package/dist/hooks/index.mjs +2 -0
- package/dist/hooks/index.mjs.map +1 -0
- package/dist/index.d.mts +2739 -30
- package/dist/index.mjs +47 -0
- package/dist/{index.esm.js.map → index.mjs.map} +1 -1
- package/dist/input/index.d.mts +12 -0
- package/dist/input/index.mjs +2 -0
- package/dist/input/index.mjs.map +1 -0
- package/dist/label/index.d.mts +18 -0
- package/dist/label/index.mjs +2 -0
- package/dist/label/index.mjs.map +1 -0
- package/dist/navigation-menu/index.d.mts +104 -0
- package/dist/navigation-menu/index.mjs +2 -0
- package/dist/navigation-menu/index.mjs.map +1 -0
- package/dist/page-loader/index.d.mts +29 -0
- package/dist/page-loader/index.mjs +2 -0
- package/dist/page-loader/index.mjs.map +1 -0
- package/dist/pagination/index.d.mts +105 -0
- package/dist/pagination/index.mjs +2 -0
- package/dist/pagination/index.mjs.map +1 -0
- package/dist/popover/index.d.mts +30 -0
- package/dist/popover/index.mjs +2 -0
- package/dist/popover/index.mjs.map +1 -0
- package/dist/{checkbox-DxgDKaHx.d.mts → radio-group/index.d.mts} +5 -51
- package/dist/radio-group/index.mjs +2 -0
- package/dist/radio-group/index.mjs.map +1 -0
- package/dist/resizable/index.d.mts +53 -0
- package/dist/resizable/index.mjs +2 -0
- package/dist/resizable/index.mjs.map +1 -0
- package/dist/rhf-checkbox/index.d.mts +57 -0
- package/dist/rhf-checkbox/index.mjs +2 -0
- package/dist/rhf-checkbox/index.mjs.map +1 -0
- package/dist/rhf-multi-select/index.d.mts +84 -0
- package/dist/rhf-multi-select/index.mjs +2 -0
- package/dist/rhf-multi-select/index.mjs.map +1 -0
- package/dist/rhf-radio-button-group/index.d.mts +73 -0
- package/dist/rhf-radio-button-group/index.mjs +2 -0
- package/dist/rhf-radio-button-group/index.mjs.map +1 -0
- package/dist/rhf-radio-group/index.d.mts +103 -0
- package/dist/rhf-radio-group/index.mjs +2 -0
- package/dist/rhf-radio-group/index.mjs.map +1 -0
- package/dist/rhf-select/index.d.mts +80 -0
- package/dist/rhf-select/index.mjs +2 -0
- package/dist/rhf-select/index.mjs.map +1 -0
- package/dist/rhf-switch/index.d.mts +57 -0
- package/dist/rhf-switch/index.mjs +2 -0
- package/dist/rhf-switch/index.mjs.map +1 -0
- package/dist/rhf-textarea/index.d.mts +66 -0
- package/dist/rhf-textarea/index.mjs +2 -0
- package/dist/rhf-textarea/index.mjs.map +1 -0
- package/dist/separator/index.d.mts +13 -0
- package/dist/separator/index.mjs +2 -0
- package/dist/separator/index.mjs.map +1 -0
- package/dist/sheet/index.d.mts +42 -0
- package/dist/sheet/index.mjs +2 -0
- package/dist/sheet/index.mjs.map +1 -0
- package/dist/sidebar/index.d.mts +328 -0
- package/dist/sidebar/index.mjs +2 -0
- package/dist/sidebar/index.mjs.map +1 -0
- package/dist/skeleton/index.d.mts +17 -0
- package/dist/skeleton/index.mjs +2 -0
- package/dist/skeleton/index.mjs.map +1 -0
- package/dist/stack/index.d.mts +121 -0
- package/dist/stack/index.mjs +2 -0
- package/dist/stack/index.mjs.map +1 -0
- package/dist/switch/index.d.mts +21 -0
- package/dist/switch/index.mjs +2 -0
- package/dist/switch/index.mjs.map +1 -0
- package/dist/table/index.d.mts +53 -0
- package/dist/table/index.mjs +2 -0
- package/dist/table/index.mjs.map +1 -0
- package/dist/tabs/index.d.mts +97 -0
- package/dist/tabs/index.mjs +2 -0
- package/dist/tabs/index.mjs.map +1 -0
- package/dist/text-field/index.d.mts +65 -0
- package/dist/text-field/index.mjs +2 -0
- package/dist/text-field/index.mjs.map +1 -0
- package/dist/textarea/index.d.mts +24 -0
- package/dist/textarea/index.mjs +2 -0
- package/dist/textarea/index.mjs.map +1 -0
- package/dist/{toast-2xT7L1tJ.d.mts → toast/index.d.mts} +3 -3
- package/dist/toast/index.mjs +2 -0
- package/dist/toast/index.mjs.map +1 -0
- package/dist/toaster/index.d.mts +26 -0
- package/dist/toaster/index.mjs +2 -0
- package/dist/toaster/index.mjs.map +1 -0
- package/dist/tooltip/index.d.mts +25 -0
- package/dist/tooltip/index.mjs +2 -0
- package/dist/tooltip/index.mjs.map +1 -0
- package/dist/types/index.mjs +2 -0
- package/dist/{index.cjs.js.map → types/index.mjs.map} +1 -1
- package/dist/typography/index.d.mts +24 -0
- package/dist/typography/index.mjs +2 -0
- package/dist/typography/index.mjs.map +1 -0
- package/dist/utils/index.mjs +2 -0
- package/dist/utils/index.mjs.map +1 -0
- package/package.json +199 -34
- package/dist/atoms.cjs.js +0 -2
- package/dist/atoms.cjs.js.map +0 -1
- package/dist/atoms.d.mts +0 -1051
- package/dist/atoms.d.ts +0 -1051
- package/dist/atoms.esm.js +0 -2
- package/dist/atoms.esm.js.map +0 -1
- package/dist/checkbox-DxgDKaHx.d.ts +0 -108
- package/dist/chunk-23T2PH5G.esm.js +0 -2
- package/dist/chunk-23T2PH5G.esm.js.map +0 -1
- package/dist/chunk-2QG3QTSW.cjs.js +0 -2
- package/dist/chunk-2QG3QTSW.cjs.js.map +0 -1
- package/dist/chunk-C26U3FL4.esm.js +0 -2
- package/dist/chunk-C26U3FL4.esm.js.map +0 -1
- package/dist/chunk-DTM5LZHM.cjs.js +0 -2
- package/dist/chunk-DTM5LZHM.cjs.js.map +0 -1
- package/dist/chunk-HW32JE75.cjs.js +0 -2
- package/dist/chunk-HW32JE75.cjs.js.map +0 -1
- package/dist/chunk-JIRS6MWF.cjs.js +0 -2
- package/dist/chunk-JIRS6MWF.cjs.js.map +0 -1
- package/dist/chunk-JKTYFZ5M.esm.js +0 -2
- package/dist/chunk-JKTYFZ5M.esm.js.map +0 -1
- package/dist/chunk-JUZG25DH.esm.js +0 -2
- package/dist/chunk-JUZG25DH.esm.js.map +0 -1
- package/dist/chunk-KOYJODOP.cjs.js +0 -2
- package/dist/chunk-KOYJODOP.cjs.js.map +0 -1
- package/dist/chunk-M4S5YZ56.esm.js +0 -2
- package/dist/chunk-M4S5YZ56.esm.js.map +0 -1
- package/dist/chunk-MOYOCJW6.esm.js +0 -2
- package/dist/chunk-MOYOCJW6.esm.js.map +0 -1
- package/dist/chunk-MVWMLXLL.cjs.js +0 -2
- package/dist/chunk-MVWMLXLL.cjs.js.map +0 -1
- package/dist/chunk-SL2ZUI4G.cjs.js +0 -2
- package/dist/chunk-SL2ZUI4G.cjs.js.map +0 -1
- package/dist/chunk-STRDPP3B.esm.js +0 -2
- package/dist/chunk-STRDPP3B.esm.js.map +0 -1
- package/dist/chunk-U4NMIMU7.esm.js +0 -2
- package/dist/chunk-U4NMIMU7.esm.js.map +0 -1
- package/dist/chunk-UK47BFA3.cjs.js +0 -2
- package/dist/chunk-UK47BFA3.cjs.js.map +0 -1
- package/dist/chunk-UTVXFZLD.esm.js +0 -2
- package/dist/chunk-UTVXFZLD.esm.js.map +0 -1
- package/dist/chunk-WJNYKJP6.cjs.js +0 -2
- package/dist/chunk-WJNYKJP6.cjs.js.map +0 -1
- package/dist/chunk-YEZB7AOJ.esm.js +0 -2
- package/dist/chunk-YEZB7AOJ.esm.js.map +0 -1
- package/dist/chunk-YGLYFSF6.cjs.js +0 -2
- package/dist/chunk-YGLYFSF6.cjs.js.map +0 -1
- package/dist/hooks.cjs.js +0 -2
- package/dist/hooks.cjs.js.map +0 -1
- package/dist/hooks.d.ts +0 -51
- package/dist/hooks.esm.js +0 -2
- package/dist/hooks.esm.js.map +0 -1
- package/dist/index.cjs.js +0 -2
- package/dist/index.d.ts +0 -30
- package/dist/index.esm.js +0 -2
- package/dist/molecules.cjs.js +0 -2
- package/dist/molecules.cjs.js.map +0 -1
- package/dist/molecules.d.mts +0 -201
- package/dist/molecules.d.ts +0 -201
- package/dist/molecules.esm.js +0 -2
- package/dist/molecules.esm.js.map +0 -1
- package/dist/organisms.cjs.js +0 -2
- package/dist/organisms.cjs.js.map +0 -1
- package/dist/organisms.d.mts +0 -673
- package/dist/organisms.d.ts +0 -673
- package/dist/organisms.esm.js +0 -2
- package/dist/organisms.esm.js.map +0 -1
- package/dist/rhf.cjs.js +0 -2
- package/dist/rhf.cjs.js.map +0 -1
- package/dist/rhf.d.mts +0 -408
- package/dist/rhf.d.ts +0 -408
- package/dist/rhf.esm.js +0 -2
- package/dist/rhf.esm.js.map +0 -1
- package/dist/toast-2xT7L1tJ.d.ts +0 -18
- package/dist/tooltip-B4jzaurK.d.ts +0 -104
- package/dist/types.cjs.js +0 -2
- package/dist/types.cjs.js.map +0 -1
- package/dist/types.d.ts +0 -2
- package/dist/types.esm.js +0 -2
- package/dist/types.esm.js.map +0 -1
- package/dist/utils.cjs.js +0 -2
- package/dist/utils.cjs.js.map +0 -1
- package/dist/utils.d.ts +0 -5
- package/dist/utils.esm.js +0 -2
- package/dist/utils.esm.js.map +0 -1
- /package/dist/{types.d.mts → types/index.d.mts} +0 -0
- /package/dist/{utils.d.mts → utils/index.d.mts} +0 -0
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export * from "./hooks/index.mjs"
|
|
2
|
+
export * from "./utils/index.mjs"
|
|
3
|
+
export * from "./types/index.mjs"
|
|
4
|
+
export * from "./typography/index.mjs"
|
|
5
|
+
export * from "./tooltip/index.mjs"
|
|
6
|
+
export * from "./toaster/index.mjs"
|
|
7
|
+
export * from "./toast/index.mjs"
|
|
8
|
+
export * from "./textarea/index.mjs"
|
|
9
|
+
export * from "./text-field/index.mjs"
|
|
10
|
+
export * from "./table/index.mjs"
|
|
11
|
+
export * from "./switch/index.mjs"
|
|
12
|
+
export * from "./stack/index.mjs"
|
|
13
|
+
export * from "./skeleton/index.mjs"
|
|
14
|
+
export * from "./sheet/index.mjs"
|
|
15
|
+
export * from "./separator/index.mjs"
|
|
16
|
+
export * from "./resizable/index.mjs"
|
|
17
|
+
export * from "./radio-group/index.mjs"
|
|
18
|
+
export * from "./popover/index.mjs"
|
|
19
|
+
export * from "./pagination/index.mjs"
|
|
20
|
+
export * from "./page-loader/index.mjs"
|
|
21
|
+
export * from "./label/index.mjs"
|
|
22
|
+
export * from "./input/index.mjs"
|
|
23
|
+
export * from "./dialog/index.mjs"
|
|
24
|
+
export * from "./container/index.mjs"
|
|
25
|
+
export * from "./command/index.mjs"
|
|
26
|
+
export * from "./collapsible/index.mjs"
|
|
27
|
+
export * from "./checkbox/index.mjs"
|
|
28
|
+
export * from "./button/index.mjs"
|
|
29
|
+
export * from "./breadcrumb/index.mjs"
|
|
30
|
+
export * from "./box/index.mjs"
|
|
31
|
+
export * from "./badge/index.mjs"
|
|
32
|
+
export * from "./avatar/index.mjs"
|
|
33
|
+
export * from "./accordion/index.mjs"
|
|
34
|
+
export * from "./tabs/index.mjs"
|
|
35
|
+
export * from "./navigation-menu/index.mjs"
|
|
36
|
+
export * from "./card/index.mjs"
|
|
37
|
+
export * from "./sidebar/index.mjs"
|
|
38
|
+
export * from "./dropdown-menu/index.mjs"
|
|
39
|
+
export * from "./drawer/index.mjs"
|
|
40
|
+
export * from "./rhf-textarea/index.mjs"
|
|
41
|
+
export * from "./rhf-switch/index.mjs"
|
|
42
|
+
export * from "./rhf-select/index.mjs"
|
|
43
|
+
export * from "./rhf-radio-group/index.mjs"
|
|
44
|
+
export * from "./rhf-radio-button-group/index.mjs"
|
|
45
|
+
export * from "./rhf-multi-select/index.mjs"
|
|
46
|
+
export * from "./rhf-checkbox/index.mjs"
|
|
47
|
+
export * from "./form/index.mjs"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.mjs","sourcesContent":[]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Input component for creating accessible input fields.
|
|
5
|
+
* Built on top of shadcn/ui's Input component.
|
|
6
|
+
*
|
|
7
|
+
* @url https://sergii-melnykov.github.io/ui/?path=/docs/atoms-input--docs
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
declare const Input: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
11
|
+
|
|
12
|
+
export { Input };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import*as r from'react';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {jsx}from'react/jsx-runtime';function t(...e){return twMerge(clsx(e))}var a=r.forwardRef(({className:e,type:o,...n},i)=>jsx("input",{type:o,className:t("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:i,...n}));a.displayName="Input";export{a as Input};//# sourceMappingURL=index.mjs.map
|
|
2
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utils/cn.ts","../../src/components/atoms/input/input.tsx"],"names":["cn","inputs","twMerge","clsx","Input","className","type","props","ref","jsx"],"mappings":"yHAGO,SAASA,CAAAA,CAAAA,GAAMC,EAAsB,CAC1C,OAAOC,OAAQC,CAAAA,IAAAA,CAAKF,CAAM,CAAC,CAC7B,CCMMG,IAAAA,CAAAA,CAAc,aAClB,CAAC,CAAE,SAAAC,CAAAA,CAAAA,CAAW,IAAAC,CAAAA,CAAAA,CAAM,GAAGC,CAAM,CAAA,CAAGC,CAE5BC,GAAAA,GAAAA,CAAC,OACC,CAAA,CAAA,IAAA,CAAMH,EACN,SAAWN,CAAAA,CAAAA,CACT,yWACAK,CAAAA,CACF,CACA,CAAA,GAAA,CAAKG,CACJ,CAAA,GAAGD,CACN,CAAA,CAGN,EACAH,CAAAA,CAAM,WAAc,CAAA,OAAA","file":"index.mjs","sourcesContent":["import { type ClassValue, clsx } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n","import * as React from \"react\"\n\nimport { cn } from \"@/utils/cn\"\n\n/**\n * Input component for creating accessible input fields.\n * Built on top of shadcn/ui's Input component.\n *\n * @url https://sergii-melnykov.github.io/ui/?path=/docs/atoms-input--docs\n *\n */\nconst Input = React.forwardRef<HTMLInputElement, React.ComponentProps<\"input\">>(\n ({ className, type, ...props }, ref) => {\n return (\n <input\n type={type}\n className={cn(\n \"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\",\n className\n )}\n ref={ref}\n {...props}\n />\n )\n }\n)\nInput.displayName = \"Input\"\n\nexport { Input }\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as class_variance_authority_dist_types from 'class-variance-authority/dist/types';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
4
|
+
import { VariantProps } from 'class-variance-authority';
|
|
5
|
+
|
|
6
|
+
declare const labelVariants: (props?: class_variance_authority_dist_types.ClassProp | undefined) => string;
|
|
7
|
+
interface LabelProps extends React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>, VariantProps<typeof labelVariants> {
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Label component for creating accessible labels.
|
|
11
|
+
* Built on top of Radix UI's Label primitive.
|
|
12
|
+
*
|
|
13
|
+
* @url https://sergii-melnykov.github.io/ui/?path=/docs/atoms-label--docs
|
|
14
|
+
*
|
|
15
|
+
*/
|
|
16
|
+
declare const Label: React.ForwardRefExoticComponent<LabelProps & React.RefAttributes<HTMLLabelElement>>;
|
|
17
|
+
|
|
18
|
+
export { Label, type LabelProps };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import*as a from'react';import*as t from'@radix-ui/react-label';import {cva}from'class-variance-authority';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {jsx}from'react/jsx-runtime';function o(...e){return twMerge(clsx(e))}var n=cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),r=a.forwardRef(({className:e,...i},p)=>jsx(t.Root,{ref:p,className:o(n(),e),...i}));r.displayName=t.Root.displayName;export{r as Label};//# sourceMappingURL=index.mjs.map
|
|
2
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utils/cn.ts","../../src/components/atoms/label/label.tsx"],"names":["cn","inputs","twMerge","clsx","labelVariants","cva","Label","className","props","ref","jsx"],"mappings":"4MAGO,SAASA,CAAMC,CAAAA,GAAAA,CAAAA,CAAsB,CAC1C,OAAOC,OAAQC,CAAAA,IAAAA,CAAKF,CAAM,CAAC,CAC7B,CCCMG,IAAAA,CAAAA,CAAgBC,GACpB,CAAA,4FACF,CAaMC,CAAAA,CAAAA,CAAc,CAClB,CAAA,UAAA,CAAA,CAAC,CAAE,SAAA,CAAAC,CAAW,CAAA,GAAGC,CAAM,CAAA,CAAGC,IACxBC,GAAgB,CAAA,CAAA,CAAA,IAAA,CAAf,CAAoB,GAAA,CAAKD,CAAK,CAAA,SAAA,CAAWT,CAAGI,CAAAA,CAAAA,EAAiBG,CAAAA,CAAS,CAAI,CAAA,GAAGC,CAAO,CAAA,CAEzF,EACAF,CAAAA,CAAM,YAA6B,CAAK,CAAA,IAAA,CAAA,WAAA","file":"index.mjs","sourcesContent":["import { type ClassValue, clsx } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n","import * as React from \"react\"\nimport * as LabelPrimitive from \"@radix-ui/react-label\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/utils/index\"\n\nconst labelVariants = cva(\n \"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\"\n)\n\nexport interface LabelProps\n extends React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>,\n VariantProps<typeof labelVariants> {}\n\n/**\n * Label component for creating accessible labels.\n * Built on top of Radix UI's Label primitive.\n *\n * @url https://sergii-melnykov.github.io/ui/?path=/docs/atoms-label--docs\n *\n */\nconst Label = React.forwardRef<React.ElementRef<typeof LabelPrimitive.Root>, LabelProps>(\n ({ className, ...props }, ref) => (\n <LabelPrimitive.Root ref={ref} className={cn(labelVariants(), className)} {...props} />\n )\n)\nLabel.displayName = LabelPrimitive.Root.displayName\n\nexport { Label }\n"]}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu';
|
|
4
|
+
import { VariantProps } from 'class-variance-authority';
|
|
5
|
+
import * as class_variance_authority_dist_types from 'class-variance-authority/dist/types';
|
|
6
|
+
|
|
7
|
+
declare const navigationMenuTriggerStyle: (props?: ({
|
|
8
|
+
variant?: "default" | "ghost" | "link" | "mobile" | null | undefined;
|
|
9
|
+
} & class_variance_authority_dist_types.ClassProp) | undefined) => string;
|
|
10
|
+
|
|
11
|
+
interface NavigationMenuProps extends React__default.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Root> {
|
|
12
|
+
/**
|
|
13
|
+
* The content of the navigation menu
|
|
14
|
+
*/
|
|
15
|
+
children: React__default.ReactNode;
|
|
16
|
+
/**
|
|
17
|
+
* Optional className for the root element
|
|
18
|
+
*/
|
|
19
|
+
className?: string;
|
|
20
|
+
}
|
|
21
|
+
interface NavigationMenuListProps extends React__default.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.List> {
|
|
22
|
+
/**
|
|
23
|
+
* Optional className for the list element
|
|
24
|
+
*/
|
|
25
|
+
className?: string;
|
|
26
|
+
}
|
|
27
|
+
interface NavigationMenuItemProps extends React__default.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Item> {
|
|
28
|
+
/**
|
|
29
|
+
* Optional className for the item element
|
|
30
|
+
*/
|
|
31
|
+
className?: string;
|
|
32
|
+
}
|
|
33
|
+
interface NavigationMenuTriggerProps extends React__default.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Trigger>, VariantProps<typeof navigationMenuTriggerStyle> {
|
|
34
|
+
/**
|
|
35
|
+
* Optional className for the trigger element
|
|
36
|
+
*/
|
|
37
|
+
className?: string;
|
|
38
|
+
}
|
|
39
|
+
interface NavigationMenuContentProps extends React__default.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Content> {
|
|
40
|
+
/**
|
|
41
|
+
* Optional className for the content element
|
|
42
|
+
*/
|
|
43
|
+
className?: string;
|
|
44
|
+
}
|
|
45
|
+
interface NavigationMenuLinkProps extends React__default.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Link> {
|
|
46
|
+
/**
|
|
47
|
+
* Optional className for the link element
|
|
48
|
+
*/
|
|
49
|
+
className?: string;
|
|
50
|
+
}
|
|
51
|
+
interface NavigationMenuViewportProps extends React__default.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Viewport> {
|
|
52
|
+
/**
|
|
53
|
+
* Optional className for the viewport element
|
|
54
|
+
*/
|
|
55
|
+
className?: string;
|
|
56
|
+
}
|
|
57
|
+
interface NavigationMenuIndicatorProps extends React__default.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Indicator> {
|
|
58
|
+
/**
|
|
59
|
+
* Optional className for the indicator element
|
|
60
|
+
*/
|
|
61
|
+
className?: string;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* NavigationMenu component for creating accessible navigation menus with dropdowns.
|
|
66
|
+
* Built on top of Radix UI's NavigationMenu primitive.
|
|
67
|
+
*
|
|
68
|
+
* @url https://sergii-melnykov.github.io/ui/?path=/docs/molecules-navigation-menu--docs
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* ```
|
|
72
|
+
* <NavigationMenu>
|
|
73
|
+
* <NavigationMenuList>
|
|
74
|
+
* <NavigationMenuItem>
|
|
75
|
+
* <NavigationMenuTrigger>Getting Started</NavigationMenuTrigger>
|
|
76
|
+
* <NavigationMenuContent>
|
|
77
|
+
* <ul className="grid gap-3 p-4 md:w-[400px] lg:w-[500px]">
|
|
78
|
+
* <li className="row-span-3">
|
|
79
|
+
* <NavigationMenuLink asChild>
|
|
80
|
+
* <a className="flex h-full w-full select-none flex-col justify-end rounded-md bg-gradient-to-b from-muted/50 to-muted p-6 no-underline outline-none focus:shadow-md">
|
|
81
|
+
* <div className="mb-2 mt-4 text-lg font-medium">shadcn/ui</div>
|
|
82
|
+
* <p className="text-sm leading-tight text-muted-foreground">
|
|
83
|
+
* Beautifully designed components built with Radix UI and Tailwind CSS.
|
|
84
|
+
* </p>
|
|
85
|
+
* </a>
|
|
86
|
+
* </NavigationMenuLink>
|
|
87
|
+
* </li>
|
|
88
|
+
* </ul>
|
|
89
|
+
* </NavigationMenuContent>
|
|
90
|
+
* </NavigationMenuItem>
|
|
91
|
+
* </NavigationMenuList>
|
|
92
|
+
* </NavigationMenu>
|
|
93
|
+
* ```
|
|
94
|
+
*/
|
|
95
|
+
declare const NavigationMenu: React.ForwardRefExoticComponent<NavigationMenuProps & React.RefAttributes<HTMLElement>>;
|
|
96
|
+
declare const NavigationMenuList: React.ForwardRefExoticComponent<NavigationMenuListProps & React.RefAttributes<HTMLUListElement>>;
|
|
97
|
+
declare const NavigationMenuItem: React.ForwardRefExoticComponent<NavigationMenuPrimitive.NavigationMenuItemProps & React.RefAttributes<HTMLLIElement>>;
|
|
98
|
+
declare const NavigationMenuTrigger: React.ForwardRefExoticComponent<NavigationMenuTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
99
|
+
declare const NavigationMenuContent: React.ForwardRefExoticComponent<NavigationMenuContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
100
|
+
declare const NavigationMenuLink: React.ForwardRefExoticComponent<NavigationMenuPrimitive.NavigationMenuLinkProps & React.RefAttributes<HTMLAnchorElement>>;
|
|
101
|
+
declare const NavigationMenuViewport: React.ForwardRefExoticComponent<NavigationMenuViewportProps & React.RefAttributes<HTMLDivElement>>;
|
|
102
|
+
declare const NavigationMenuIndicator: React.ForwardRefExoticComponent<NavigationMenuIndicatorProps & React.RefAttributes<HTMLDivElement>>;
|
|
103
|
+
|
|
104
|
+
export { NavigationMenu, NavigationMenuContent, type NavigationMenuContentProps, NavigationMenuIndicator, type NavigationMenuIndicatorProps, NavigationMenuItem, type NavigationMenuItemProps, NavigationMenuLink, type NavigationMenuLinkProps, NavigationMenuList, type NavigationMenuListProps, type NavigationMenuProps, NavigationMenuTrigger, type NavigationMenuTriggerProps, NavigationMenuViewport, type NavigationMenuViewportProps };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import*as r from'react';import*as e from'@radix-ui/react-navigation-menu';import {ChevronDown}from'lucide-react';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {cva}from'class-variance-authority';import {jsxs,jsx}from'react/jsx-runtime';function o(...t){return twMerge(clsx(t))}var v=cva("group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[state=open]:bg-accent/50",{variants:{variant:{default:"text-foreground",ghost:"hover:bg-transparent hover:underline",link:"text-primary underline-offset-4 hover:underline",mobile:"w-full justify-between border-b border-border py-4 text-base font-medium"}},defaultVariants:{variant:"default"}});var u=r.forwardRef(({className:t,children:i,...a},s)=>jsxs(e.Root,{ref:s,className:o("relative z-10 flex max-w-max flex-1 items-center justify-center",t),...a,children:[i,jsx(m,{})]}));u.displayName=e.Root.displayName;var g=r.forwardRef(({className:t,...i},a)=>jsx(e.List,{ref:a,className:o("group flex flex-1 list-none items-center justify-center space-x-1",t),...i}));g.displayName=e.List.displayName;var w=e.Item,d=r.forwardRef(({className:t,children:i,variant:a,...s},N)=>jsxs(e.Trigger,{ref:N,className:o(v({variant:a}),t),...s,children:[i," ",jsx(ChevronDown,{className:"relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180","aria-hidden":"true"})]}));d.displayName=e.Trigger.displayName;var p=r.forwardRef(({className:t,...i},a)=>jsx(e.Content,{ref:a,className:o("left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto",t),...i}));p.displayName=e.Content.displayName;var R=e.Link,m=r.forwardRef(({className:t,...i},a)=>jsx("div",{className:o("absolute left-0 top-full flex justify-center"),children:jsx(e.Viewport,{className:o("origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]",t),ref:a,...i})}));m.displayName=e.Viewport.displayName;var f=r.forwardRef(({className:t,...i},a)=>jsx(e.Indicator,{ref:a,className:o("top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in",t),...i,children:jsx("div",{className:"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md"})}));f.displayName=e.Indicator.displayName;export{u as NavigationMenu,p as NavigationMenuContent,f as NavigationMenuIndicator,w as NavigationMenuItem,R as NavigationMenuLink,g as NavigationMenuList,d as NavigationMenuTrigger,m as NavigationMenuViewport};//# sourceMappingURL=index.mjs.map
|
|
2
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utils/cn.ts","../../src/components/molecules/navigation-menu/navigation-menu.variants.ts","../../src/components/molecules/navigation-menu/navigation-menu.tsx"],"names":["cn","inputs","twMerge","clsx","navigationMenuTriggerStyle","cva","NavigationMenu","className","children","props","ref","jsxs","jsx","NavigationMenuViewport","NavigationMenuList","NavigationMenuItem","NavigationMenuTrigger","variant","ChevronDown","NavigationMenuContent","NavigationMenuLink","NavigationMenuIndicator"],"mappings":"kQAGO,SAASA,CAAAA,CAAAA,GAAMC,CAAsB,CAAA,CAC1C,OAAOC,OAAQC,CAAAA,IAAAA,CAAKF,CAAM,CAAC,CAC7B,CCHO,IAAMG,CAA6BC,CAAAA,GAAAA,CACxC,2VACA,CAAA,CACE,QAAU,CAAA,CACR,QAAS,CACP,OAAA,CAAS,iBACT,CAAA,KAAA,CAAO,sCACP,CAAA,IAAA,CAAM,iDACN,CAAA,MAAA,CAAQ,0EACV,CACF,CAAA,CACA,eAAiB,CAAA,CACf,OAAS,CAAA,SACX,CACF,CACF,EC8BMC,IAAAA,CAAAA,CAAuB,aAG3B,CAAC,CAAE,SAAAC,CAAAA,CAAAA,CAAW,QAAAC,CAAAA,CAAAA,CAAU,GAAGC,CAAM,EAAGC,CACpCC,GAAAA,IAAAA,CAAyB,CAAxB,CAAA,IAAA,CAAA,CACC,GAAKD,CAAAA,CAAAA,CACL,SAAWV,CAAAA,CAAAA,CAAG,kEAAmEO,CAAS,CAAA,CACzF,GAAGE,CAAAA,CAEH,QAAAD,CAAAA,CAAAA,CAAAA,CACDI,GAACC,CAAAA,CAAAA,CAAA,EAAuB,CAC1B,CAAA,CAAA,CACD,EACDP,CAAAA,CAAe,WAAsC,CAAA,CAAA,CAAA,IAAA,CAAK,WAE1D,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,CAAA,CAAA,CAAA,OAAA,CAAQ,YAE9DC,IAAAA,CAAAA,CAA6C,CAE7CP,CAAAA,IAAAA,CAAAA,CAAAA,CAA+B,CAGnC,CAAA,UAAA,CAAA,CAAC,CAAE,SAAA,CAAAN,EAAW,GAAGE,CAAM,CAAGC,CAAAA,CAAAA,GAC1BE,GAAC,CAAA,KAAA,CAAA,CAAI,SAAWZ,CAAAA,CAAAA,CAAG,8CAA8C,CAC/D,CAAA,QAAA,CAAAY,GAAyB,CAAA,CAAA,CAAA,QAAA,CAAxB,CACC,SAAA,CAAWZ,CACT,CAAA,uVAAA,CACAO,CACF,CACA,CAAA,GAAA,CAAKG,CACJ,CAAA,GAAGD,CACN,CAAA,CAAA,CACF,CACD,EACDI,EAAuB,WAAsC,CAAA,CAAA,CAAA,QAAA,CAAS,WAEtE,CAAA,IAAMQ,CAAgC,CAAA,CAAA,CAAA,UAAA,CAGpC,CAAC,CAAE,UAAAd,CAAW,CAAA,GAAGE,CAAM,CAAA,CAAGC,CAC1BE,GAAAA,GAAAA,CAAyB,CAAxB,CAAA,SAAA,CAAA,CACC,IAAKF,CACL,CAAA,SAAA,CAAWV,CACT,CAAA,8LAAA,CACAO,CACF,CAAA,CACC,GAAGE,CAAAA,CAEJ,SAAAG,GAAC,CAAA,KAAA,CAAA,CAAI,SAAU,CAAA,wEAAA,CAAyE,CAC1F,CAAA,CACD,EACDS,CAAAA,CAAwB,YAAsC,CAAU,CAAA,SAAA,CAAA,WAAA","file":"index.mjs","sourcesContent":["import { type ClassValue, clsx } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n","import { cva } from \"class-variance-authority\"\n\nexport const navigationMenuTriggerStyle = cva(\n \"group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[state=open]:bg-accent/50\",\n {\n variants: {\n variant: {\n default: \"text-foreground\",\n ghost: \"hover:bg-transparent hover:underline\",\n link: \"text-primary underline-offset-4 hover:underline\",\n mobile: \"w-full justify-between border-b border-border py-4 text-base font-medium\"\n }\n },\n defaultVariants: {\n variant: \"default\"\n }\n }\n)\n","import * as React from \"react\"\nimport * as NavigationMenuPrimitive from \"@radix-ui/react-navigation-menu\"\nimport { ChevronDown } from \"lucide-react\"\nimport { cn } from \"@/utils/index\"\nimport { navigationMenuTriggerStyle } from \"./navigation-menu.variants\"\nimport type {\n NavigationMenuProps,\n NavigationMenuListProps,\n NavigationMenuItemProps,\n NavigationMenuTriggerProps,\n NavigationMenuContentProps,\n NavigationMenuLinkProps,\n NavigationMenuViewportProps,\n NavigationMenuIndicatorProps\n} from \"./navigation-menu.types\"\n\n/**\n * NavigationMenu component for creating accessible navigation menus with dropdowns.\n * Built on top of Radix UI's NavigationMenu primitive.\n *\n * @url https://sergii-melnykov.github.io/ui/?path=/docs/molecules-navigation-menu--docs\n *\n * @example\n * ```\n * <NavigationMenu>\n * <NavigationMenuList>\n * <NavigationMenuItem>\n * <NavigationMenuTrigger>Getting Started</NavigationMenuTrigger>\n * <NavigationMenuContent>\n * <ul className=\"grid gap-3 p-4 md:w-[400px] lg:w-[500px]\">\n * <li className=\"row-span-3\">\n * <NavigationMenuLink asChild>\n * <a className=\"flex h-full w-full select-none flex-col justify-end rounded-md bg-gradient-to-b from-muted/50 to-muted p-6 no-underline outline-none focus:shadow-md\">\n * <div className=\"mb-2 mt-4 text-lg font-medium\">shadcn/ui</div>\n * <p className=\"text-sm leading-tight text-muted-foreground\">\n * Beautifully designed components built with Radix UI and Tailwind CSS.\n * </p>\n * </a>\n * </NavigationMenuLink>\n * </li>\n * </ul>\n * </NavigationMenuContent>\n * </NavigationMenuItem>\n * </NavigationMenuList>\n * </NavigationMenu>\n * ```\n */\nconst NavigationMenu = React.forwardRef<\n React.ElementRef<typeof NavigationMenuPrimitive.Root>,\n NavigationMenuProps\n>(({ className, children, ...props }, ref) => (\n <NavigationMenuPrimitive.Root\n ref={ref}\n className={cn(\"relative z-10 flex max-w-max flex-1 items-center justify-center\", className)}\n {...props}\n >\n {children}\n <NavigationMenuViewport />\n </NavigationMenuPrimitive.Root>\n))\nNavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName\n\nconst NavigationMenuList = React.forwardRef<\n React.ElementRef<typeof NavigationMenuPrimitive.List>,\n NavigationMenuListProps\n>(({ className, ...props }, ref) => (\n <NavigationMenuPrimitive.List\n ref={ref}\n className={cn(\"group flex flex-1 list-none items-center justify-center space-x-1\", className)}\n {...props}\n />\n))\nNavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName\n\nconst NavigationMenuItem = NavigationMenuPrimitive.Item\n\nconst NavigationMenuTrigger = React.forwardRef<\n React.ElementRef<typeof NavigationMenuPrimitive.Trigger>,\n NavigationMenuTriggerProps\n>(({ className, children, variant, ...props }, ref) => (\n <NavigationMenuPrimitive.Trigger\n ref={ref}\n className={cn(navigationMenuTriggerStyle({ variant }), className)}\n {...props}\n >\n {children}{\" \"}\n <ChevronDown\n className=\"relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180\"\n aria-hidden=\"true\"\n />\n </NavigationMenuPrimitive.Trigger>\n))\nNavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName\n\nconst NavigationMenuContent = React.forwardRef<\n React.ElementRef<typeof NavigationMenuPrimitive.Content>,\n NavigationMenuContentProps\n>(({ className, ...props }, ref) => (\n <NavigationMenuPrimitive.Content\n ref={ref}\n className={cn(\n \"left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto\",\n className\n )}\n {...props}\n />\n))\nNavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName\n\nconst NavigationMenuLink = NavigationMenuPrimitive.Link\n\nconst NavigationMenuViewport = React.forwardRef<\n React.ElementRef<typeof NavigationMenuPrimitive.Viewport>,\n NavigationMenuViewportProps\n>(({ className, ...props }, ref) => (\n <div className={cn(\"absolute left-0 top-full flex justify-center\")}>\n <NavigationMenuPrimitive.Viewport\n className={cn(\n \"origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]\",\n className\n )}\n ref={ref}\n {...props}\n />\n </div>\n))\nNavigationMenuViewport.displayName = NavigationMenuPrimitive.Viewport.displayName\n\nconst NavigationMenuIndicator = React.forwardRef<\n React.ElementRef<typeof NavigationMenuPrimitive.Indicator>,\n NavigationMenuIndicatorProps\n>(({ className, ...props }, ref) => (\n <NavigationMenuPrimitive.Indicator\n ref={ref}\n className={cn(\n \"top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in\",\n className\n )}\n {...props}\n >\n <div className=\"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md\" />\n </NavigationMenuPrimitive.Indicator>\n))\nNavigationMenuIndicator.displayName = NavigationMenuPrimitive.Indicator.displayName\n\nexport {\n NavigationMenu,\n NavigationMenuList,\n NavigationMenuItem,\n NavigationMenuContent,\n NavigationMenuTrigger,\n NavigationMenuLink,\n NavigationMenuIndicator,\n NavigationMenuViewport\n}\n"]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
type PageLoaderProps = {
|
|
4
|
+
/**
|
|
5
|
+
* Optional className to extend the component's styles
|
|
6
|
+
*/
|
|
7
|
+
className?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Optional size of the loader (default: "default")
|
|
10
|
+
*/
|
|
11
|
+
size?: "sm" | "default" | "lg";
|
|
12
|
+
/**
|
|
13
|
+
* Optional text to display below the loader
|
|
14
|
+
*/
|
|
15
|
+
text?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Optional color of the loader (default: "primary")
|
|
18
|
+
*/
|
|
19
|
+
color?: "primary" | "secondary" | "accent" | "muted" | "destructive" | string;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* PageLoader component for displaying a loading indicator.
|
|
23
|
+
*
|
|
24
|
+
* @url https://sergii-melnykov.github.io/ui/?path=/docs/atoms-page-loader--docs
|
|
25
|
+
*
|
|
26
|
+
*/
|
|
27
|
+
declare function PageLoader({ className, size, text, color }: PageLoaderProps): react_jsx_runtime.JSX.Element;
|
|
28
|
+
|
|
29
|
+
export { PageLoader, type PageLoaderProps };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {Loader2}from'lucide-react';import {jsxs,jsx}from'react/jsx-runtime';function e(...r){return twMerge(clsx(r))}function b({className:r,size:o="default",text:t,color:s="primary"}){let c={sm:"h-4 w-4",default:"h-8 w-8",lg:"h-12 w-12"},i={primary:"text-primary",secondary:"text-secondary",accent:"text-accent",muted:"text-muted-foreground",destructive:"text-destructive"}[s]||`text-[${s}]`;return jsxs("div",{className:e("fixed inset-0 z-50 flex min-h-screen flex-col items-center justify-center bg-background/80 backdrop-blur-sm",r),role:"alert","aria-live":"assertive",children:[jsx(Loader2,{className:e("animate-spin",i,c[o]),"aria-hidden":"true"}),t&&jsx("p",{className:"mt-4 text-sm text-muted-foreground","aria-label":t,children:t})]})}export{b as PageLoader};//# sourceMappingURL=index.mjs.map
|
|
2
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utils/cn.ts","../../src/components/atoms/page-loader/page-loader.tsx"],"names":["cn","inputs","twMerge","clsx","PageLoader","className","size","text","color","sizeClasses","loaderColor","jsxs","jsx","Loader2"],"mappings":"yIAGO,SAASA,CAAMC,CAAAA,GAAAA,CAAAA,CAAsB,CAC1C,OAAOC,QAAQC,IAAKF,CAAAA,CAAM,CAAC,CAC7B,CCwBO,SAASG,CAAW,CAAA,CACzB,SAAAC,CAAAA,CAAAA,CACA,KAAAC,CAAO,CAAA,SAAA,CACP,IAAAC,CAAAA,CAAAA,CACA,KAAAC,CAAAA,CAAAA,CAAQ,SACV,CAAoB,CAAA,CAClB,IAAMC,CAAAA,CAAc,CAClB,EAAA,CAAI,UACJ,OAAS,CAAA,SAAA,CACT,EAAI,CAAA,WACN,CAUMC,CAAAA,CAAAA,CARe,CACnB,OAAS,CAAA,cAAA,CACT,SAAW,CAAA,gBAAA,CACX,MAAQ,CAAA,aAAA,CACR,MAAO,uBACP,CAAA,WAAA,CAAa,kBACf,CAAA,CAEiCF,CAAkC,CAAA,EAAK,SAASA,CAAK,CAAA,CAAA,CAAA,CAEtF,OACEG,IAAAA,CAAC,KACC,CAAA,CAAA,SAAA,CAAWX,EACT,6GACAK,CAAAA,CACF,CACA,CAAA,IAAA,CAAK,OACL,CAAA,WAAA,CAAU,YAEV,QAAAO,CAAAA,CAAAA,GAAAA,CAACC,OAAA,CAAA,CAAQ,SAAWb,CAAAA,CAAAA,CAAG,eAAgBU,CAAaD,CAAAA,CAAAA,CAAYH,CAAI,CAAC,CAAG,CAAA,aAAA,CAAY,OAAO,CAC1FC,CAAAA,CAAAA,EACCK,GAAC,CAAA,GAAA,CAAA,CAAE,SAAU,CAAA,oCAAA,CAAqC,aAAYL,CAC3D,CAAA,QAAA,CAAAA,CACH,CAAA,CAAA,CAAA,CAEJ,CAEJ","file":"index.mjs","sourcesContent":["import { type ClassValue, clsx } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n","import { cn } from \"@/utils\"\nimport { Loader2 } from \"lucide-react\"\n\nexport type PageLoaderProps = {\n /**\n * Optional className to extend the component's styles\n */\n className?: string\n /**\n * Optional size of the loader (default: \"default\")\n */\n size?: \"sm\" | \"default\" | \"lg\"\n /**\n * Optional text to display below the loader\n */\n text?: string\n /**\n * Optional color of the loader (default: \"primary\")\n */\n color?: \"primary\" | \"secondary\" | \"accent\" | \"muted\" | \"destructive\" | string\n}\n\n/**\n * PageLoader component for displaying a loading indicator.\n *\n * @url https://sergii-melnykov.github.io/ui/?path=/docs/atoms-page-loader--docs\n *\n */\n\nexport function PageLoader({\n className,\n size = \"default\",\n text,\n color = \"primary\"\n}: PageLoaderProps) {\n const sizeClasses = {\n sm: \"h-4 w-4\",\n default: \"h-8 w-8\",\n lg: \"h-12 w-12\"\n }\n\n const colorClasses = {\n primary: \"text-primary\",\n secondary: \"text-secondary\",\n accent: \"text-accent\",\n muted: \"text-muted-foreground\",\n destructive: \"text-destructive\"\n }\n\n const loaderColor = colorClasses[color as keyof typeof colorClasses] || `text-[${color}]`\n\n return (\n <div\n className={cn(\n \"fixed inset-0 z-50 flex min-h-screen flex-col items-center justify-center bg-background/80 backdrop-blur-sm\",\n className\n )}\n role=\"alert\"\n aria-live=\"assertive\"\n >\n <Loader2 className={cn(\"animate-spin\", loaderColor, sizeClasses[size])} aria-hidden=\"true\" />\n {text && (\n <p className=\"mt-4 text-sm text-muted-foreground\" aria-label={text}>\n {text}\n </p>\n )}\n </div>\n )\n}\n"]}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { VariantProps } from 'class-variance-authority';
|
|
4
|
+
import * as class_variance_authority_dist_types from 'class-variance-authority/dist/types';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Props interface for the Button component.
|
|
8
|
+
* Extends the native button HTML attributes and adds support for variants and asChild prop.
|
|
9
|
+
* Implements proper accessibility features and follows WCAG 2.1 Level AA guidelines.
|
|
10
|
+
*
|
|
11
|
+
* @interface ButtonProps
|
|
12
|
+
* @extends {React.ButtonHTMLAttributes<HTMLButtonElement>}
|
|
13
|
+
* @extends {VariantProps<typeof buttonVariants>}
|
|
14
|
+
*
|
|
15
|
+
* @property {boolean} [asChild] - When true, renders the button as a child component using Radix UI's Slot.
|
|
16
|
+
* @property {ButtonVariant} [variant] - The visual style variant of the button.
|
|
17
|
+
* @property {ButtonSize} [size] - The size variant of the button.
|
|
18
|
+
* @property {string} [className] - Additional CSS classes to apply to the button.
|
|
19
|
+
* @property {React.ReactNode} [startIcon] - Icon to display before the button text.
|
|
20
|
+
* @property {React.ReactNode} [endIcon] - Icon to display after the button text.
|
|
21
|
+
* @property {boolean} [loading] - Whether the button is in a loading state.
|
|
22
|
+
* @property {string} [type] - The type of button (button, submit, reset). Defaults to "button".
|
|
23
|
+
* @property {string} [aria-label] - Accessible label for the button. Falls back to button text if not provided.
|
|
24
|
+
*/
|
|
25
|
+
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
26
|
+
asChild?: boolean;
|
|
27
|
+
startIcon?: React.ReactNode;
|
|
28
|
+
endIcon?: React.ReactNode;
|
|
29
|
+
loading?: boolean;
|
|
30
|
+
type?: "button" | "submit" | "reset";
|
|
31
|
+
"aria-label"?: string;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Button variant styles using class-variance-authority.
|
|
36
|
+
* Defines the visual styles for different button variants and sizes.
|
|
37
|
+
* Follows WCAG 2.1 Level AA guidelines for accessibility.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```tsx
|
|
41
|
+
* <Button variant="primary" size="lg">Click me</Button>
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
declare const buttonVariants: (props?: ({
|
|
45
|
+
variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | null | undefined;
|
|
46
|
+
size?: "default" | "sm" | "lg" | "icon" | null | undefined;
|
|
47
|
+
} & class_variance_authority_dist_types.ClassProp) | undefined) => string;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Pagination component that provides navigation controls for paginated content.
|
|
51
|
+
* Built on top of shadcn/ui's button component.
|
|
52
|
+
*
|
|
53
|
+
* @url https://sergii-melnykov.github.io/ui/?path=/docs/atoms-pagination--docs
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```tsx
|
|
57
|
+
* <Pagination>
|
|
58
|
+
* <PaginationContent>
|
|
59
|
+
* <PaginationItem>
|
|
60
|
+
* <PaginationPrevious href="#" />
|
|
61
|
+
* </PaginationItem>
|
|
62
|
+
* <PaginationItem>
|
|
63
|
+
* <PaginationLink href="#" isActive>1</PaginationLink>
|
|
64
|
+
* </PaginationItem>
|
|
65
|
+
* <PaginationItem>
|
|
66
|
+
* <PaginationEllipsis />
|
|
67
|
+
* </PaginationItem>
|
|
68
|
+
* <PaginationItem>
|
|
69
|
+
* <PaginationNext href="#" />
|
|
70
|
+
* </PaginationItem>
|
|
71
|
+
* </PaginationContent>
|
|
72
|
+
* </Pagination>
|
|
73
|
+
* ```
|
|
74
|
+
*/
|
|
75
|
+
declare const Pagination: {
|
|
76
|
+
({ className, ...props }: React.ComponentProps<"nav">): react_jsx_runtime.JSX.Element;
|
|
77
|
+
displayName: string;
|
|
78
|
+
};
|
|
79
|
+
declare const PaginationContent: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLUListElement>, HTMLUListElement>, "ref"> & React.RefAttributes<HTMLUListElement>>;
|
|
80
|
+
declare const PaginationItem: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & React.RefAttributes<HTMLLIElement>>;
|
|
81
|
+
type PaginationLinkProps$1 = {
|
|
82
|
+
isActive?: boolean;
|
|
83
|
+
} & Pick<ButtonProps, "size"> & React.ComponentProps<"a">;
|
|
84
|
+
declare const PaginationLink: {
|
|
85
|
+
({ className, isActive, size, children, ...props }: PaginationLinkProps$1): react_jsx_runtime.JSX.Element;
|
|
86
|
+
displayName: string;
|
|
87
|
+
};
|
|
88
|
+
declare const PaginationPrevious: {
|
|
89
|
+
({ className, ...props }: React.ComponentProps<typeof PaginationLink>): react_jsx_runtime.JSX.Element;
|
|
90
|
+
displayName: string;
|
|
91
|
+
};
|
|
92
|
+
declare const PaginationNext: {
|
|
93
|
+
({ className, ...props }: React.ComponentProps<typeof PaginationLink>): react_jsx_runtime.JSX.Element;
|
|
94
|
+
displayName: string;
|
|
95
|
+
};
|
|
96
|
+
declare const PaginationEllipsis: {
|
|
97
|
+
({ className, ...props }: React.ComponentProps<"span">): react_jsx_runtime.JSX.Element;
|
|
98
|
+
displayName: string;
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
type PaginationLinkProps = {
|
|
102
|
+
isActive?: boolean;
|
|
103
|
+
} & Pick<ButtonProps, "size"> & React.ComponentProps<"a">;
|
|
104
|
+
|
|
105
|
+
export { Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, type PaginationLinkProps, PaginationNext, PaginationPrevious };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import*as g from'react';import {Loader2,ChevronLeft,ChevronRight,MoreHorizontal}from'lucide-react';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {Slot}from'@radix-ui/react-slot';import {cva}from'class-variance-authority';import {jsx,jsxs}from'react/jsx-runtime';function n(...a){return twMerge(clsx(a))}var u=cva("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),G=g.forwardRef(({className:a,variant:e,size:o,asChild:s=false,startIcon:r,endIcon:b,loading:l=false,disabled:B,children:p,type:y="button","aria-label":M,...m},v)=>{let h=s?Slot:"button",i=B||l,x=M||(typeof p=="string"?p:void 0),z=c=>{(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),!i&&m.onClick&&m.onClick(c));};return s?jsx(h,{className:n(u({variant:e,size:o,className:a})),ref:v,disabled:i,type:y,"aria-label":x,"aria-disabled":i,...m,children:p}):jsxs(h,{className:n(u({variant:e,size:o,className:a})),ref:v,disabled:i,type:y,"aria-label":x,"aria-disabled":i,onKeyDown:z,...m,children:[l&&jsx(Loader2,{className:"mr-2 h-4 w-4 animate-spin",role:"status","aria-label":"Loading","aria-hidden":"true"}),!l&&r&&jsx("span",{className:"mr-2","aria-hidden":"true",children:r}),p,!l&&b&&jsx("span",{className:"ml-2","aria-hidden":"true",children:b})]})});G.displayName="Button";var w=({className:a,...e})=>jsx("nav",{role:"navigation","aria-label":"pagination",className:n("mx-auto flex w-full justify-center",a),...e});w.displayName="Pagination";var L=g.forwardRef(({className:a,...e},o)=>jsx("ul",{ref:o,className:n("flex flex-row items-center gap-1",a),...e}));L.displayName="PaginationContent";var k=g.forwardRef(({className:a,...e},o)=>jsx("li",{ref:o,className:n("",a),...e}));k.displayName="PaginationItem";var f=({className:a,isActive:e,size:o="icon",children:s,...r})=>jsx("a",{"aria-current":e?"page":void 0,className:n(u({variant:e?"outline":"ghost",size:o}),a),...r,children:s});f.displayName="PaginationLink";var C=({className:a,...e})=>jsxs(f,{"aria-label":"Go to previous page",size:"default",className:n("gap-1 pl-2.5",a),...e,children:[jsx(ChevronLeft,{className:"h-4 w-4"}),jsx("span",{children:"Previous"})]});C.displayName="PaginationPrevious";var R=({className:a,...e})=>jsxs(f,{"aria-label":"Go to next page",size:"default",className:n("gap-1 pr-2.5",a),...e,children:[jsx("span",{children:"Next"}),jsx(ChevronRight,{className:"h-4 w-4"})]});R.displayName="PaginationNext";var E=({className:a,...e})=>jsxs("span",{"aria-hidden":true,className:n("flex h-9 w-9 items-center justify-center",a),...e,children:[jsx(MoreHorizontal,{className:"h-4 w-4"}),jsx("span",{className:"sr-only",children:"More pages"})]});E.displayName="PaginationEllipsis";export{w as Pagination,L as PaginationContent,E as PaginationEllipsis,k as PaginationItem,f as PaginationLink,R as PaginationNext,C as PaginationPrevious};//# sourceMappingURL=index.mjs.map
|
|
2
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utils/cn.ts","../../src/components/atoms/button/button.tsx","../../src/components/atoms/pagination/pagination.tsx"],"names":["cn","inputs","twMerge","clsx","buttonVariants","cva","Button","N","className","variant","size","asChild","startIcon","endIcon","loading","disabled","children","type","ariaLabel","props","ref","Comp","Slot","isDisabled","buttonAriaLabel","handleKeyDown","event","jsx","jsxs","Loader2","Pagination","PaginationContent","PaginationItem","PaginationLink","isActive","PaginationPrevious","ChevronLeft","PaginationNext","ChevronRight","PaginationEllipsis","MoreHorizontal"],"mappings":"4RAGO,SAASA,CAAAA,CAAAA,GAAMC,CAAsB,CAAA,CAC1C,OAAOC,OAAAA,CAAQC,IAAKF,CAAAA,CAAM,CAAC,CAC7B,CCYA,IAAMG,CAAiBC,CAAAA,GAAAA,CACrB,wRACA,CAAA,CACE,QAAU,CAAA,CACR,OAAS,CAAA,CACP,OAAS,CAAA,+DAAA,CACT,WAAa,CAAA,8EA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AA,IAAAA,CAAC,MACC,CAAA,CAAA,aAAA,CAAW,IACX,CAAA,SAAA,CAAW5B,CAAG,CAAA,0CAAA,CAA4CQ,CAAS,CAAA,CAClE,GAAGW,CAAAA,CAEJ,QAAAQ,CAAAA,CAAAA,GAAAA,CAACa,cAAA,CAAA,CAAe,SAAU,CAAA,SAAA,CAAU,CACpCb,CAAAA,GAAAA,CAAC,MAAK,CAAA,CAAA,SAAA,CAAU,SAAU,CAAA,QAAA,CAAA,YAAA,CAAU,CACtC,CAAA,CAAA,EAEFY,EAAmB,WAAc,CAAA,oBAAA","file":"index.mjs","sourcesContent":["import { type ClassValue, clsx } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n","import * as React from \"react\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport { cva } from \"class-variance-authority\"\nimport { cn } from \"@/utils/cn\"\nimport { Loader2 } from \"lucide-react\"\nimport { ButtonProps } from \"./button.types\"\n\n/**\n * Button variant styles using class-variance-authority.\n * Defines the visual styles for different button variants and sizes.\n * Follows WCAG 2.1 Level AA guidelines for accessibility.\n *\n * @example\n * ```tsx\n * <Button variant=\"primary\" size=\"lg\">Click me</Button>\n * ```\n */\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground shadow hover:bg-primary/90\",\n destructive: \"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90\",\n outline:\n \"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground\",\n secondary: \"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80\",\n ghost: \"hover:bg-accent hover:text-accent-foreground\",\n link: \"text-primary underline-offset-4 hover:underline\"\n } as const,\n size: {\n default: \"h-9 px-4 py-2\",\n sm: \"h-8 rounded-md px-3 text-xs\",\n lg: \"h-10 rounded-md px-8\",\n icon: \"h-9 w-9\"\n } as const\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\"\n }\n }\n)\n\n/**\n * A versatile button component that supports multiple variants, sizes, and can be rendered as a child component.\n * Built on top of Radix UI's Slot primitive for maximum flexibility.\n * Implements proper accessibility features and follows WCAG 2.1 Level AA guidelines.\n *\n * @url https://sergii-melnykov.github.io/ui/?path=/docs/atoms-button--docs\n *\n * @component\n * @example\n * ```tsx\n * // Default button\n * <Button>Click me</Button>\n *\n * // Destructive button with small size\n * <Button variant=\"destructive\" size=\"sm\">Delete</Button>\n *\n * // As a link\n * <Button variant=\"link\" asChild>\n * <a href=\"/about\">About</a>\n * </Button>\n *\n * // With icons\n * <Button startIcon={<Icon />}>With Start Icon</Button>\n * <Button endIcon={<Icon />}>With End Icon</Button>\n *\n * // Loading state\n * <Button loading>Loading</Button>\n * ```\n *\n * @param {ButtonProps} props - The component props\n * @param {React.Ref<HTMLButtonElement>} ref - Forwarded ref\n * @returns {JSX.Element} A button element\n */\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n className,\n variant,\n size,\n asChild = false,\n startIcon,\n endIcon,\n loading = false,\n disabled,\n children,\n type = \"button\",\n \"aria-label\": ariaLabel,\n ...props\n },\n ref\n ) => {\n const Comp = asChild ? Slot : \"button\"\n const isDisabled = disabled || loading\n const buttonAriaLabel = ariaLabel || (typeof children === \"string\" ? children : undefined)\n\n // Handle keyboard interaction\n const handleKeyDown = (event: React.KeyboardEvent) => {\n if (event.key === \"Enter\" || event.key === \" \") {\n event.preventDefault()\n if (!isDisabled && props.onClick) {\n props.onClick(event as unknown as React.MouseEvent<HTMLButtonElement>)\n }\n }\n }\n\n if (asChild) {\n return (\n <Comp\n className={cn(buttonVariants({ variant, size, className }))}\n ref={ref}\n disabled={isDisabled}\n type={type}\n aria-label={buttonAriaLabel}\n aria-disabled={isDisabled}\n {...props}\n >\n {children}\n </Comp>\n )\n }\n\n return (\n <Comp\n className={cn(buttonVariants({ variant, size, className }))}\n ref={ref}\n disabled={isDisabled}\n type={type}\n aria-label={buttonAriaLabel}\n aria-disabled={isDisabled}\n onKeyDown={handleKeyDown}\n {...props}\n >\n {loading && (\n <Loader2\n className=\"mr-2 h-4 w-4 animate-spin\"\n role=\"status\"\n aria-label=\"Loading\"\n aria-hidden=\"true\"\n />\n )}\n {!loading && startIcon && (\n <span className=\"mr-2\" aria-hidden=\"true\">\n {startIcon}\n </span>\n )}\n {children}\n {!loading && endIcon && (\n <span className=\"ml-2\" aria-hidden=\"true\">\n {endIcon}\n </span>\n )}\n </Comp>\n )\n }\n)\nButton.displayName = \"Button\"\n\nexport { Button, buttonVariants }\n","import * as React from \"react\"\nimport { ChevronLeft, ChevronRight, MoreHorizontal } from \"lucide-react\"\n\nimport { cn } from \"@/utils/index\"\nimport { ButtonProps, buttonVariants } from \"@/components/atoms/button\"\n\n/**\n * Pagination component that provides navigation controls for paginated content.\n * Built on top of shadcn/ui's button component.\n *\n * @url https://sergii-melnykov.github.io/ui/?path=/docs/atoms-pagination--docs\n *\n * @example\n * ```tsx\n * <Pagination>\n * <PaginationContent>\n * <PaginationItem>\n * <PaginationPrevious href=\"#\" />\n * </PaginationItem>\n * <PaginationItem>\n * <PaginationLink href=\"#\" isActive>1</PaginationLink>\n * </PaginationItem>\n * <PaginationItem>\n * <PaginationEllipsis />\n * </PaginationItem>\n * <PaginationItem>\n * <PaginationNext href=\"#\" />\n * </PaginationItem>\n * </PaginationContent>\n * </Pagination>\n * ```\n */\nconst Pagination = ({ className, ...props }: React.ComponentProps<\"nav\">) => (\n <nav\n role=\"navigation\"\n aria-label=\"pagination\"\n className={cn(\"mx-auto flex w-full justify-center\", className)}\n {...props}\n />\n)\nPagination.displayName = \"Pagination\"\n\nconst PaginationContent = React.forwardRef<HTMLUListElement, React.ComponentProps<\"ul\">>(\n ({ className, ...props }, ref) => (\n <ul ref={ref} className={cn(\"flex flex-row items-center gap-1\", className)} {...props} />\n )\n)\nPaginationContent.displayName = \"PaginationContent\"\n\nconst PaginationItem = React.forwardRef<HTMLLIElement, React.ComponentProps<\"li\">>(\n ({ className, ...props }, ref) => <li ref={ref} className={cn(\"\", className)} {...props} />\n)\nPaginationItem.displayName = \"PaginationItem\"\n\ntype PaginationLinkProps = {\n isActive?: boolean\n} & Pick<ButtonProps, \"size\"> &\n React.ComponentProps<\"a\">\n\nconst PaginationLink = ({\n className,\n isActive,\n size = \"icon\",\n children,\n ...props\n}: PaginationLinkProps) => (\n <a\n aria-current={isActive ? \"page\" : undefined}\n className={cn(\n buttonVariants({\n variant: isActive ? \"outline\" : \"ghost\",\n size\n }),\n className\n )}\n {...props}\n >\n {children}\n </a>\n)\nPaginationLink.displayName = \"PaginationLink\"\n\nconst PaginationPrevious = ({\n className,\n ...props\n}: React.ComponentProps<typeof PaginationLink>) => (\n <PaginationLink\n aria-label=\"Go to previous page\"\n size=\"default\"\n className={cn(\"gap-1 pl-2.5\", className)}\n {...props}\n >\n <ChevronLeft className=\"h-4 w-4\" />\n <span>Previous</span>\n </PaginationLink>\n)\nPaginationPrevious.displayName = \"PaginationPrevious\"\n\nconst PaginationNext = ({ className, ...props }: React.ComponentProps<typeof PaginationLink>) => (\n <PaginationLink\n aria-label=\"Go to next page\"\n size=\"default\"\n className={cn(\"gap-1 pr-2.5\", className)}\n {...props}\n >\n <span>Next</span>\n <ChevronRight className=\"h-4 w-4\" />\n </PaginationLink>\n)\nPaginationNext.displayName = \"PaginationNext\"\n\nconst PaginationEllipsis = ({ className, ...props }: React.ComponentProps<\"span\">) => (\n <span\n aria-hidden\n className={cn(\"flex h-9 w-9 items-center justify-center\", className)}\n {...props}\n >\n <MoreHorizontal className=\"h-4 w-4\" />\n <span className=\"sr-only\">More pages</span>\n </span>\n)\nPaginationEllipsis.displayName = \"PaginationEllipsis\"\n\nexport {\n Pagination,\n PaginationContent,\n PaginationLink,\n PaginationItem,\n PaginationPrevious,\n PaginationNext,\n PaginationEllipsis\n}\n"]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Popover component that displays content in a floating panel.
|
|
6
|
+
* Built on top of Radix UI's Popover primitive.
|
|
7
|
+
*
|
|
8
|
+
* @url https://sergii-melnykov.github.io/ui/?path=/docs/atoms-popover--docs
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```tsx
|
|
12
|
+
* <Popover>
|
|
13
|
+
* <PopoverTrigger>Open Popover</PopoverTrigger>
|
|
14
|
+
* <PopoverContent>
|
|
15
|
+
* <p>Popover content goes here</p>
|
|
16
|
+
* </PopoverContent>
|
|
17
|
+
* </Popover>
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
declare const Popover: React.FC<PopoverPrimitive.PopoverProps>;
|
|
21
|
+
declare const PopoverTrigger: React.ForwardRefExoticComponent<PopoverPrimitive.PopoverTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
22
|
+
declare const PopoverAnchor: React.ForwardRefExoticComponent<PopoverPrimitive.PopoverAnchorProps & React.RefAttributes<HTMLDivElement>>;
|
|
23
|
+
declare const PopoverContent: React.ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
24
|
+
|
|
25
|
+
type PopoverProps = React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Root>;
|
|
26
|
+
type PopoverTriggerProps = React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Trigger>;
|
|
27
|
+
type PopoverContentProps = React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>;
|
|
28
|
+
type PopoverAnchorProps = React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Anchor>;
|
|
29
|
+
|
|
30
|
+
export { Popover, PopoverAnchor, type PopoverAnchorProps, PopoverContent, type PopoverContentProps, type PopoverProps, PopoverTrigger, type PopoverTriggerProps };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import*as i from'react';import*as o from'@radix-ui/react-popover';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {jsx}from'react/jsx-runtime';function t(...e){return twMerge(clsx(e))}var C=o.Root,R=o.Trigger,x=o.Anchor,f=i.forwardRef(({className:e,align:a="center",sideOffset:n=4,...p},m)=>jsx(o.Portal,{children:jsx(o.Content,{ref:m,align:a,sideOffset:n,className:t("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-popover-content-transform-origin]",e),...p})}));f.displayName=o.Content.displayName;export{C as Popover,x as PopoverAnchor,f as PopoverContent,R as PopoverTrigger};//# sourceMappingURL=index.mjs.map
|
|
2
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utils/cn.ts","../../src/components/atoms/popover/popover.tsx"],"names":["cn","inputs","twMerge","clsx","Popover","PopoverTrigger","PopoverAnchor","PopoverContent","className","align","sideOffset","props","ref","jsx"],"mappings":"mKAGO,SAASA,KAAMC,CAAsB,CAAA,CAC1C,OAAOC,OAAAA,CAAQC,KAAKF,CAAM,CAAC,CAC7B,CCgBMG,IAAAA,CAAAA,CAA2B,OAE3BC,CAAkC,CAAA,CAAA,CAAA,OAAA,CAElCC,CAAiC,CAAA,CAAA,CAAA,MAAA,CAEjCC,EAAuB,CAG3B,CAAA,UAAA,CAAA,CAAC,CAAE,SAAA,CAAAC,EAAW,KAAAC,CAAAA,CAAAA,CAAQ,QAAU,CAAA,UAAA,CAAAC,EAAa,CAAG,CAAA,GAAGC,CAAM,CAAA,CAAGC,IAC5DC,GAAkB,CAAA,CAAA,CAAA,MAAA,CAAjB,CACC,QAAA,CAAAA,IAAkB,CAAjB,CAAA,OAAA,CAAA,CACC,GAAKD,CAAAA,CAAAA,CACL,MAAOH,CACP,CAAA,UAAA,CAAYC,CACZ,CAAA,SAAA,CAAWV,EACT,8dACAQ,CAAAA,CACF,CACC,CAAA,GAAGG,EACN,CACF,CAAA,CACD,EACDJ,CAAAA,CAAe,YAA+B,CAAQ,CAAA,OAAA,CAAA,WAAA","file":"index.mjs","sourcesContent":["import { type ClassValue, clsx } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n","import * as React from \"react\"\nimport * as PopoverPrimitive from \"@radix-ui/react-popover\"\n\nimport { cn } from \"@/utils/index\"\n\n/**\n * Popover component that displays content in a floating panel.\n * Built on top of Radix UI's Popover primitive.\n *\n * @url https://sergii-melnykov.github.io/ui/?path=/docs/atoms-popover--docs\n *\n * @example\n * ```tsx\n * <Popover>\n * <PopoverTrigger>Open Popover</PopoverTrigger>\n * <PopoverContent>\n * <p>Popover content goes here</p>\n * </PopoverContent>\n * </Popover>\n * ```\n */\nconst Popover = PopoverPrimitive.Root\n\nconst PopoverTrigger = PopoverPrimitive.Trigger\n\nconst PopoverAnchor = PopoverPrimitive.Anchor\n\nconst PopoverContent = React.forwardRef<\n React.ElementRef<typeof PopoverPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>\n>(({ className, align = \"center\", sideOffset = 4, ...props }, ref) => (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n className={cn(\n \"z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-popover-content-transform-origin]\",\n className\n )}\n {...props}\n />\n </PopoverPrimitive.Portal>\n))\nPopoverContent.displayName = PopoverPrimitive.Content.displayName\n\nexport { Popover, PopoverTrigger, PopoverContent, PopoverAnchor }\n"]}
|
|
@@ -1,46 +1,12 @@
|
|
|
1
|
+
import * as class_variance_authority_dist_types from 'class-variance-authority/dist/types';
|
|
1
2
|
import * as React from 'react';
|
|
2
|
-
import * as SwitchPrimitives from '@radix-ui/react-switch';
|
|
3
|
-
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
4
3
|
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
5
4
|
import { VariantProps } from 'class-variance-authority';
|
|
6
5
|
import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
|
|
7
|
-
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
* Input component for creating accessible input fields.
|
|
11
|
-
* Built on top of shadcn/ui's Input component.
|
|
12
|
-
*
|
|
13
|
-
* @url https://sergii-melnykov.github.io/ui/?path=/docs/atoms-input--docs
|
|
14
|
-
*
|
|
15
|
-
*/
|
|
16
|
-
declare const Input: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
17
|
-
|
|
18
|
-
declare const labelVariants: (props?: class_variance_authority_types.ClassProp | undefined) => string;
|
|
7
|
+
declare const labelVariants: (props?: class_variance_authority_dist_types.ClassProp | undefined) => string;
|
|
19
8
|
interface LabelProps extends React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>, VariantProps<typeof labelVariants> {
|
|
20
9
|
}
|
|
21
|
-
/**
|
|
22
|
-
* Label component for creating accessible labels.
|
|
23
|
-
* Built on top of Radix UI's Label primitive.
|
|
24
|
-
*
|
|
25
|
-
* @url https://sergii-melnykov.github.io/ui/?path=/docs/atoms-label--docs
|
|
26
|
-
*
|
|
27
|
-
*/
|
|
28
|
-
declare const Label: React.ForwardRefExoticComponent<LabelProps & React.RefAttributes<HTMLLabelElement>>;
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Switch component that provides a toggle input control.
|
|
32
|
-
* Built on top of Radix UI's Switch primitive.
|
|
33
|
-
*
|
|
34
|
-
* @url https://sergii-melnykov.github.io/ui/?path=/docs/atoms-switch--docs
|
|
35
|
-
*
|
|
36
|
-
* @example
|
|
37
|
-
* ```tsx
|
|
38
|
-
* <Switch />
|
|
39
|
-
* <Switch defaultChecked />
|
|
40
|
-
* <Switch disabled />
|
|
41
|
-
* ```
|
|
42
|
-
*/
|
|
43
|
-
declare const Switch: React.ForwardRefExoticComponent<Omit<SwitchPrimitives.SwitchProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
44
10
|
|
|
45
11
|
/**
|
|
46
12
|
* RadioGroup component that allows users to select a single option from a list.
|
|
@@ -90,19 +56,7 @@ declare const RadioItemContainer: React.ForwardRefExoticComponent<React.HTMLAttr
|
|
|
90
56
|
*/
|
|
91
57
|
declare const RadioItemLabel: React.ForwardRefExoticComponent<Omit<LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & React.RefAttributes<HTMLLabelElement>>;
|
|
92
58
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
* Provides a customizable checkbox input with proper accessibility and keyboard navigation.
|
|
96
|
-
*
|
|
97
|
-
* @url https://sergii-melnykov.github.io/ui/?path=/docs/atoms-checkbox--docs
|
|
98
|
-
*
|
|
99
|
-
* @example
|
|
100
|
-
* ```tsx
|
|
101
|
-
* <Checkbox id="terms" name="terms" />
|
|
102
|
-
* <label htmlFor="terms">Accept terms and conditions</label>
|
|
103
|
-
* ```
|
|
104
|
-
*/
|
|
105
|
-
|
|
106
|
-
declare const Checkbox: React.ForwardRefExoticComponent<Omit<CheckboxPrimitive.CheckboxProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
59
|
+
type RadioGroupProps = React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>;
|
|
60
|
+
type RadioGroupItemProps = React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>;
|
|
107
61
|
|
|
108
|
-
export {
|
|
62
|
+
export { RadioGroup, RadioGroupItem, type RadioGroupItemProps, type RadioGroupProps, RadioItemContainer, RadioItemLabel };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import*as m from'react';import*as i from'@radix-ui/react-radio-group';import {Circle}from'lucide-react';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import*as s from'@radix-ui/react-label';import {cva}from'class-variance-authority';import {jsx}from'react/jsx-runtime';function r(...e){return twMerge(clsx(e))}var y=cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),p=m.forwardRef(({className:e,...o},t)=>jsx(s.Root,{ref:t,className:r(y(),e),...o}));p.displayName=s.Root.displayName;var d=m.forwardRef(({className:e,...o},t)=>jsx(i.Root,{className:r("grid gap-3",e),...o,ref:t}));d.displayName=i.Root.displayName;var n=m.forwardRef(({className:e,...o},t)=>jsx(i.Item,{ref:t,className:r("aspect-square h-4 w-4 rounded-full border border-primary text-primary shadow focus:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),...o,children:jsx(i.Indicator,{className:"flex items-center justify-center",children:jsx(Circle,{className:"h-3.5 w-3.5 fill-primary"})})}));n.displayName=i.Item.displayName;var R=m.forwardRef(({className:e,...o},t)=>jsx("div",{ref:t,className:r("flex items-center gap-2",e),...o}));R.displayName="RadioItemContainer";var f=m.forwardRef(({className:e,...o},t)=>jsx(p,{ref:t,className:r("text-sm font-medium leading-none cursor-pointer peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...o}));f.displayName="RadioItemLabel";export{d as RadioGroup,n as RadioGroupItem,R as RadioItemContainer,f as RadioItemLabel};//# sourceMappingURL=index.mjs.map
|
|
2
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utils/cn.ts","../../src/components/atoms/label/label.tsx","../../src/components/atoms/radio-group/radio-group.tsx"],"names":["cn","inputs","twMerge","clsx","labelVariants","cva","Label","l","className","props","ref","jsx","RadioGroup","RadioGroupItem","Circle","RadioItemContainer","RadioItemLabel"],"mappings":"4RAGO,SAASA,CAAAA,CAAAA,GAAMC,CAAsB,CAAA,CAC1C,OAAOC,OAAAA,CAAQC,KAAKF,CAAM,CAAC,CAC7B,CCCA,IAAMG,EAAgBC,GACpB,CAAA,4FACF,CAaMC,CAAAA,CAAAA,CAAcC,CAClB,CAAA,UAAA,CAAA,CAAC,CAAE,SAAAC,CAAAA,CAAAA,CAAW,GAAGC,CAAM,CAAA,CAAGC,IACxBC,GAAgB,CAAA,CAAA,CAAA,IAAA,CAAf,CAAoB,GAAA,CAAKD,CAAK,CAAA,SAAA,CAAWV,EAAGI,CAAc,EAAA,CAAGI,CAAS,CAAI,CAAA,GAAGC,EAAO,CAEzF,CAAA,CACAH,CAAM,CAAA,WAAA,CAA6B,CAAK,CAAA,IAAA,CAAA,WAAA,KCLlCM,CAAmB,CAAA,CAAA,CAAA,UAAA,CAGvB,CAAC,CAAE,SAAA,CAAAJ,CAAW,CAAA,GAAGC,CAAM,CAAA,CAAGC,IACnBC,GAAqB,CAAA,CAAA,CAAA,IAAA,CAApB,CAAyB,SAAWX,CAAAA,CAAAA,CAAG,aAAcQ,CAAS,CAAA,CAAI,GAAGC,CAAAA,CAAO,GAAKC,CAAAA,CAAAA,CAAK,CAC/F,EACDE,CAAAA,CAAW,YAAkC,CAAK,CAAA,IAAA,CAAA,WAAA,KAW5CC,CAAuB,CAAA,CAAA,CAAA,UAAA,CAG3B,CAAC,CAAE,SAAAL,CAAAA,CAAAA,CAAW,GAAGC,CAAM,CAAA,CAAGC,IAExBC,GAAqB,CAAA,CAAA,CAAA,IAAA,CAApB,CACC,GAAKD,CAAAA,CAAAA,CACL,SAAWV,CAAAA,CAAAA,CACT,8LACAQ,CAAAA,CACF,EACC,GAAGC,CAAAA,CAEJ,SAAAE,GAAqB,CAAA,CAAA,CAAA,SAAA,CAApB,CAA8B,SAAU,CAAA,kCAAA,CACvC,QAAAA,CAAAA,GAAAA,CAACG,MAAA,CAAA,CAAO,UAAU,0BAA2B,CAAA,CAAA,CAC/C,EACF,CAEH,EACDD,EAAe,WAAkC,CAAA,CAAA,CAAA,IAAA,CAAK,WAatD,CAAA,IAAME,CAA2B,CAAA,CAAA,CAAA,UAAA,CAC/B,CAAC,CAAE,SAAA,CAAAP,EAAW,GAAGC,CAAM,EAAGC,CACjBC,GAAAA,GAAAA,CAAC,KAAI,CAAA,CAAA,GAAA,CAAKD,CAAK,CAAA,SAAA,CAAWV,EAAG,yBAA2BQ,CAAAA,CAAS,EAAI,GAAGC,CAAAA,CAAO,CAE1F,EACAM,CAAAA,CAAmB,WAAc,CAAA,oBAAA,CAW3BC,IAAAA,CAAAA,CAAuB,aAG3B,CAAC,CAAE,UAAAR,CAAW,CAAA,GAAGC,CAAM,CAAGC,CAAAA,CAAAA,GAExBC,GAACL,CAAAA,CAAAA,CAAA,CACC,GAAA,CAAKI,EACL,SAAWV,CAAAA,CAAAA,CACT,4GACAQ,CACF,CAAA,CACC,GAAGC,CACN,CAAA,CAEH,EACDO,CAAAA,CAAe,WAAc,CAAA,gBAAA","file":"index.mjs","sourcesContent":["import { type ClassValue, clsx } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n","import * as React from \"react\"\nimport * as LabelPrimitive from \"@radix-ui/react-label\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/utils/index\"\n\nconst labelVariants = cva(\n \"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\"\n)\n\nexport interface LabelProps\n extends React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>,\n VariantProps<typeof labelVariants> {}\n\n/**\n * Label component for creating accessible labels.\n * Built on top of Radix UI's Label primitive.\n *\n * @url https://sergii-melnykov.github.io/ui/?path=/docs/atoms-label--docs\n *\n */\nconst Label = React.forwardRef<React.ElementRef<typeof LabelPrimitive.Root>, LabelProps>(\n ({ className, ...props }, ref) => (\n <LabelPrimitive.Root ref={ref} className={cn(labelVariants(), className)} {...props} />\n )\n)\nLabel.displayName = LabelPrimitive.Root.displayName\n\nexport { Label }\n","import * as React from \"react\"\nimport * as RadioGroupPrimitive from \"@radix-ui/react-radio-group\"\nimport { Circle } from \"lucide-react\"\n\nimport { cn } from \"@/utils\"\nimport { Label } from \"@/components/atoms/label\"\n\n/**\n * RadioGroup component that allows users to select a single option from a list.\n * Built on top of Radix UI's RadioGroup primitive.\n *\n * @url https://sergii-melnykov.github.io/ui/?path=/docs/atoms-radio-group--docs\n *\n * @example\n * ```tsx\n * <RadioGroup defaultValue=\"option-1\">\n * <RadioGroupItem value=\"option-1\">Option 1</RadioGroupItem>\n * <RadioGroupItem value=\"option-2\">Option 2</RadioGroupItem>\n * </RadioGroup>\n * ```\n */\nconst RadioGroup = React.forwardRef<\n React.ElementRef<typeof RadioGroupPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>\n>(({ className, ...props }, ref) => {\n return <RadioGroupPrimitive.Root className={cn(\"grid gap-3\", className)} {...props} ref={ref} />\n})\nRadioGroup.displayName = RadioGroupPrimitive.Root.displayName\n\n/**\n * RadioGroupItem component that represents a single option in a RadioGroup.\n * Built on top of Radix UI's RadioGroupItem primitive.\n *\n * @example\n * ```tsx\n * <RadioGroupItem value=\"option-1\">Option 1</RadioGroupItem>\n * ```\n */\nconst RadioGroupItem = React.forwardRef<\n React.ElementRef<typeof RadioGroupPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>\n>(({ className, ...props }, ref) => {\n return (\n <RadioGroupPrimitive.Item\n ref={ref}\n className={cn(\n \"aspect-square h-4 w-4 rounded-full border border-primary text-primary shadow focus:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50\",\n className\n )}\n {...props}\n >\n <RadioGroupPrimitive.Indicator className=\"flex items-center justify-center\">\n <Circle className=\"h-3.5 w-3.5 fill-primary\" />\n </RadioGroupPrimitive.Indicator>\n </RadioGroupPrimitive.Item>\n )\n})\nRadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName\n\n/**\n * RadioItemContainer component that provides a container for radio group items with proper spacing and layout.\n *\n * @example\n * ```tsx\n * <RadioItemContainer>\n * <RadioGroupItem value=\"option-1\">Option 1</RadioGroupItem>\n * <RadioGroupItem value=\"option-2\">Option 2</RadioGroupItem>\n * </RadioItemContainer>\n * ```\n */\nconst RadioItemContainer = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(\n ({ className, ...props }, ref) => {\n return <div ref={ref} className={cn(\"flex items-center gap-2\", className)} {...props} />\n }\n)\nRadioItemContainer.displayName = \"RadioItemContainer\"\n\n/**\n * RadioItemLabel component that provides a label for individual radio items.\n * Built on top of the Label component.\n *\n * @example\n * ```tsx\n * <RadioItemLabel>Select an option</RadioItemLabel>\n * ```\n */\nconst RadioItemLabel = React.forwardRef<\n React.ElementRef<typeof Label>,\n React.ComponentPropsWithoutRef<typeof Label>\n>(({ className, ...props }, ref) => {\n return (\n <Label\n ref={ref}\n className={cn(\n \"text-sm font-medium leading-none cursor-pointer peer-disabled:cursor-not-allowed peer-disabled:opacity-70\",\n className\n )}\n {...props}\n />\n )\n})\nRadioItemLabel.displayName = \"RadioItemLabel\"\n\nexport { RadioGroup, RadioGroupItem, RadioItemContainer, RadioItemLabel }\n"]}
|