@me1a/ui 2.6.5 → 2.6.7

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.
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
1
+ import * as react from 'react';
2
2
 
3
3
  interface MarkdownEditorProps {
4
4
  /**
@@ -33,8 +33,16 @@ interface MarkdownEditorProps {
33
33
  * whether to immediately render the editor
34
34
  */
35
35
  immediatelyRender?: boolean;
36
+ /**
37
+ * callback when editor loses focus
38
+ */
39
+ onBlur?: (event: FocusEvent) => void;
40
+ /**
41
+ * callback when editor gains focus
42
+ */
43
+ onFocus?: (event: FocusEvent) => void;
36
44
  }
37
45
 
38
- declare function MarkdownEditor({ value, onChange, className, placeholder, disabled, onKeyDown, autoFocus, immediatelyRender }: MarkdownEditorProps): react_jsx_runtime.JSX.Element | null;
46
+ declare const MarkdownEditor: react.ForwardRefExoticComponent<MarkdownEditorProps & react.RefAttributes<HTMLDivElement>>;
39
47
 
40
48
  export { MarkdownEditor, type MarkdownEditorProps };
@@ -1,2 +1,2 @@
1
- import{useEditor as g,EditorContent as w}from"@tiptap/react";import b from"@tiptap/extension-placeholder";import k from"@tiptap/starter-kit";import{Markdown as x}from"tiptap-markdown";import{useEffect as d}from"react";import{clsx as u}from"clsx";import{twMerge as c}from"tailwind-merge";function n(...o){return c(u(o))}import{jsx as y}from"react/jsx-runtime";function q({value:o,onChange:a,className:f,placeholder:m,disabled:t,onKeyDown:i,autoFocus:p,immediatelyRender:l}){let r=g({extensions:[k,x,b.configure({placeholder:m??"Write something..."})],content:o,editable:!t,autofocus:p,immediatelyRender:l||!1,onUpdate:({editor:s})=>{a?.(s.storage.markdown.getMarkdown())},editorProps:{attributes:{class:n("prose prose-sm dark:prose-invert max-w-none w-full min-h-[60px] rounded-md border border-input bg-transparent px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",f)},handleKeyDown:(s,e)=>e.key==="Enter"&&!e.shiftKey?(i?.(e),!0):(i?.(e),!1)}});return d(()=>{r&&o!==void 0&&o!==r.storage.markdown.getMarkdown()&&r.commands.setContent(o)},[o,r]),d(()=>{r?.setEditable(!t)},[r,t]),r?y(w,{editor:r}):null}export{q as MarkdownEditor};
1
+ import{useEditor as b,EditorContent as x}from"@tiptap/react";import E from"@tiptap/extension-placeholder";import y from"@tiptap/starter-kit";import{Markdown as M}from"tiptap-markdown";import{useEffect as d,forwardRef as h}from"react";import{clsx as w}from"clsx";import{twMerge as k}from"tailwind-merge";function i(...o){return k(w(o))}import{jsx as P}from"react/jsx-runtime";var C=h(({value:o,onChange:a,className:f,placeholder:m,disabled:n,onKeyDown:s,autoFocus:p,immediatelyRender:l,onBlur:u,onFocus:c},g)=>{let r=b({extensions:[y,M,E.configure({placeholder:m??"Write something..."})],content:o,editable:!n,autofocus:p,immediatelyRender:l||!1,onUpdate:({editor:e})=>{a?.(e.storage.markdown.getMarkdown())},onBlur:({event:e})=>{u?.(e)},onFocus:({event:e})=>{c?.(e)},editorProps:{attributes:{class:i("prose prose-sm dark:prose-invert max-w-none w-full min-h-[60px] rounded-md border border-input bg-transparent px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",f)},handleKeyDown:(e,t)=>t.key==="Enter"&&!t.shiftKey?(s?.(t),!0):(s?.(t),!1)}});return d(()=>{r&&o!==void 0&&o!==r.storage.markdown.getMarkdown()&&r.commands.setContent(o)},[o,r]),d(()=>{r?.setEditable(!n)},[r,n]),r?P(x,{editor:r,ref:g}):null});C.displayName="MarkdownEditor";export{C as MarkdownEditor};
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/molecules/markdown-editor/markdown-editor.tsx","../../src/utils/cn.ts"],"sourcesContent":["import { useEditor, EditorContent } from \"@tiptap/react\"\nimport Placeholder from \"@tiptap/extension-placeholder\"\nimport StarterKit from \"@tiptap/starter-kit\"\nimport { Markdown } from \"tiptap-markdown\"\nimport { useEffect } from \"react\"\nimport { cn } from \"@/utils\"\nimport { MarkdownEditorProps } from \"./markdown-editor.types\"\n\nexport function MarkdownEditor({\n value,\n onChange,\n className,\n placeholder,\n disabled,\n onKeyDown,\n autoFocus,\n immediatelyRender\n}: MarkdownEditorProps) {\n const editor = useEditor({\n extensions: [\n StarterKit,\n Markdown,\n Placeholder.configure({\n placeholder: placeholder ?? \"Write something...\"\n })\n ],\n content: value,\n editable: !disabled,\n autofocus: autoFocus,\n immediatelyRender: immediatelyRender || false,\n onUpdate: ({ editor: e }) => {\n onChange?.((e.storage as any).markdown.getMarkdown())\n },\n editorProps: {\n attributes: {\n class: cn(\n \"prose prose-sm dark:prose-invert max-w-none w-full min-h-[60px] rounded-md border border-input bg-transparent px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50\",\n className\n )\n },\n handleKeyDown: (view, event) => {\n if (event.key === \"Enter\" && !event.shiftKey) {\n onKeyDown?.(event)\n return true\n }\n onKeyDown?.(event)\n return false\n }\n }\n })\n\n // Sync value changes from outside\n useEffect(() => {\n if (editor && value !== undefined && value !== (editor.storage as any).markdown.getMarkdown()) {\n editor.commands.setContent(value)\n }\n }, [value, editor])\n\n useEffect(() => {\n editor?.setEditable(!disabled)\n }, [editor, disabled])\n\n if (!editor) {\n return null\n }\n\n return <EditorContent editor={editor} />\n}\n","import { type ClassValue, clsx } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n"],"mappings":"AAAA,OAAS,aAAAA,EAAW,iBAAAC,MAAqB,gBACzC,OAAOC,MAAiB,gCACxB,OAAOC,MAAgB,sBACvB,OAAS,YAAAC,MAAgB,kBACzB,OAAS,aAAAC,MAAiB,QCJ1B,OAA0B,QAAAC,MAAY,OACtC,OAAS,WAAAC,MAAe,iBAEjB,SAASC,KAAMC,EAAsB,CAC1C,OAAOF,EAAQD,EAAKG,CAAM,CAAC,CAC7B,CD6DS,cAAAC,MAAA,oBA1DF,SAASC,EAAe,CAC7B,MAAAC,EACA,SAAAC,EACA,UAAAC,EACA,YAAAC,EACA,SAAAC,EACA,UAAAC,EACA,UAAAC,EACA,kBAAAC,CACF,EAAwB,CACtB,IAAMC,EAASC,EAAU,CACvB,WAAY,CACVC,EACAC,EACAC,EAAY,UAAU,CACpB,YAAaT,GAAe,oBAC9B,CAAC,CACH,EACA,QAASH,EACT,SAAU,CAACI,EACX,UAAWE,EACX,kBAAmBC,GAAqB,GACxC,SAAU,CAAC,CAAE,OAAQM,CAAE,IAAM,CAC3BZ,IAAYY,EAAE,QAAgB,SAAS,YAAY,CAAC,CACtD,EACA,YAAa,CACX,WAAY,CACV,MAAOC,EACL,+UACAZ,CACF,CACF,EACA,cAAe,CAACa,EAAMC,IAChBA,EAAM,MAAQ,SAAW,CAACA,EAAM,UAClCX,IAAYW,CAAK,EACV,KAETX,IAAYW,CAAK,EACV,GAEX,CACF,CAAC,EAaD,OAVAC,EAAU,IAAM,CACVT,GAAUR,IAAU,QAAaA,IAAWQ,EAAO,QAAgB,SAAS,YAAY,GAC1FA,EAAO,SAAS,WAAWR,CAAK,CAEpC,EAAG,CAACA,EAAOQ,CAAM,CAAC,EAElBS,EAAU,IAAM,CACdT,GAAQ,YAAY,CAACJ,CAAQ,CAC/B,EAAG,CAACI,EAAQJ,CAAQ,CAAC,EAEhBI,EAIEV,EAACoB,EAAA,CAAc,OAAQV,EAAQ,EAH7B,IAIX","names":["useEditor","EditorContent","Placeholder","StarterKit","Markdown","useEffect","clsx","twMerge","cn","inputs","jsx","MarkdownEditor","value","onChange","className","placeholder","disabled","onKeyDown","autoFocus","immediatelyRender","editor","useEditor","StarterKit","Markdown","Placeholder","e","cn","view","event","useEffect","EditorContent"]}
1
+ {"version":3,"sources":["../../src/components/molecules/markdown-editor/markdown-editor.tsx","../../src/utils/cn.ts"],"sourcesContent":["import { useEditor, EditorContent } from \"@tiptap/react\"\nimport Placeholder from \"@tiptap/extension-placeholder\"\nimport StarterKit from \"@tiptap/starter-kit\"\nimport { Markdown } from \"tiptap-markdown\"\nimport { useEffect, forwardRef } from \"react\"\nimport { cn } from \"@/utils\"\nimport { MarkdownEditorProps } from \"./markdown-editor.types\"\n\nexport const MarkdownEditor = forwardRef<HTMLDivElement, MarkdownEditorProps>(\n (\n {\n value,\n onChange,\n className,\n placeholder,\n disabled,\n onKeyDown,\n autoFocus,\n immediatelyRender,\n onBlur,\n onFocus\n },\n ref\n ) => {\n const editor = useEditor({\n extensions: [\n StarterKit,\n Markdown,\n Placeholder.configure({\n placeholder: placeholder ?? \"Write something...\"\n })\n ],\n content: value,\n editable: !disabled,\n autofocus: autoFocus,\n immediatelyRender: immediatelyRender || false,\n onUpdate: ({ editor: e }) => {\n onChange?.((e.storage as any).markdown.getMarkdown())\n },\n onBlur: ({ event }) => {\n onBlur?.(event)\n },\n onFocus: ({ event }) => {\n onFocus?.(event)\n },\n editorProps: {\n attributes: {\n class: cn(\n \"prose prose-sm dark:prose-invert max-w-none w-full min-h-[60px] rounded-md border border-input bg-transparent px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50\",\n className\n )\n },\n handleKeyDown: (view, event) => {\n if (event.key === \"Enter\" && !event.shiftKey) {\n onKeyDown?.(event)\n return true\n }\n onKeyDown?.(event)\n return false\n }\n }\n })\n\n // Sync value changes from outside\n useEffect(() => {\n if (\n editor &&\n value !== undefined &&\n value !== (editor.storage as any).markdown.getMarkdown()\n ) {\n editor.commands.setContent(value)\n }\n }, [value, editor])\n\n useEffect(() => {\n editor?.setEditable(!disabled)\n }, [editor, disabled])\n\n if (!editor) {\n return null\n }\n\n return <EditorContent editor={editor} ref={ref} />\n }\n)\n\nMarkdownEditor.displayName = \"MarkdownEditor\"\n","import { type ClassValue, clsx } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n"],"mappings":"AAAA,OAAS,aAAAA,EAAW,iBAAAC,MAAqB,gBACzC,OAAOC,MAAiB,gCACxB,OAAOC,MAAgB,sBACvB,OAAS,YAAAC,MAAgB,kBACzB,OAAS,aAAAC,EAAW,cAAAC,MAAkB,QCJtC,OAA0B,QAAAC,MAAY,OACtC,OAAS,WAAAC,MAAe,iBAEjB,SAASC,KAAMC,EAAsB,CAC1C,OAAOF,EAAQD,EAAKG,CAAM,CAAC,CAC7B,CD6EW,cAAAC,MAAA,oBA1EJ,IAAMC,EAAiBC,EAC5B,CACE,CACE,MAAAC,EACA,SAAAC,EACA,UAAAC,EACA,YAAAC,EACA,SAAAC,EACA,UAAAC,EACA,UAAAC,EACA,kBAAAC,EACA,OAAAC,EACA,QAAAC,CACF,EACAC,IACG,CACH,IAAMC,EAASC,EAAU,CACvB,WAAY,CACVC,EACAC,EACAC,EAAY,UAAU,CACpB,YAAaZ,GAAe,oBAC9B,CAAC,CACH,EACA,QAASH,EACT,SAAU,CAACI,EACX,UAAWE,EACX,kBAAmBC,GAAqB,GACxC,SAAU,CAAC,CAAE,OAAQ,CAAE,IAAM,CAC3BN,IAAY,EAAE,QAAgB,SAAS,YAAY,CAAC,CACtD,EACA,OAAQ,CAAC,CAAE,MAAAe,CAAM,IAAM,CACrBR,IAASQ,CAAK,CAChB,EACA,QAAS,CAAC,CAAE,MAAAA,CAAM,IAAM,CACtBP,IAAUO,CAAK,CACjB,EACA,YAAa,CACX,WAAY,CACV,MAAOC,EACL,+UACAf,CACF,CACF,EACA,cAAe,CAACgB,EAAMF,IAChBA,EAAM,MAAQ,SAAW,CAACA,EAAM,UAClCX,IAAYW,CAAK,EACV,KAETX,IAAYW,CAAK,EACV,GAEX,CACF,CAAC,EAiBD,OAdAG,EAAU,IAAM,CAEZR,GACAX,IAAU,QACVA,IAAWW,EAAO,QAAgB,SAAS,YAAY,GAEvDA,EAAO,SAAS,WAAWX,CAAK,CAEpC,EAAG,CAACA,EAAOW,CAAM,CAAC,EAElBQ,EAAU,IAAM,CACdR,GAAQ,YAAY,CAACP,CAAQ,CAC/B,EAAG,CAACO,EAAQP,CAAQ,CAAC,EAEhBO,EAIEd,EAACuB,EAAA,CAAc,OAAQT,EAAQ,IAAKD,EAAK,EAHvC,IAIX,CACF,EAEAZ,EAAe,YAAc","names":["useEditor","EditorContent","Placeholder","StarterKit","Markdown","useEffect","forwardRef","clsx","twMerge","cn","inputs","jsx","MarkdownEditor","forwardRef","value","onChange","className","placeholder","disabled","onKeyDown","autoFocus","immediatelyRender","onBlur","onFocus","ref","editor","useEditor","StarterKit","Markdown","Placeholder","event","cn","view","useEffect","EditorContent"]}
@@ -0,0 +1,118 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as React from 'react';
3
+
4
+ type SelectOption<T extends string | number = string | number> = {
5
+ id: T;
6
+ label: string;
7
+ startIcon?: React.ReactNode;
8
+ endIcon?: React.ReactNode;
9
+ className?: string;
10
+ disabled?: boolean;
11
+ };
12
+ type SelectProps<T extends string | number = string | number> = {
13
+ /** Whether the select is searchable */
14
+ searchable?: boolean;
15
+ /** Whether the select should take up the full width of its container */
16
+ fullWidth?: boolean;
17
+ /** Currently selected value */
18
+ value: T;
19
+ /** Array of options to display in the select */
20
+ options: SelectOption<T>[];
21
+ /** Callback fired when the value changes */
22
+ onChange: (value: T) => void;
23
+ /** Render a custom CommandList for the select, if not provided, the select will render a default CommandList with the options */
24
+ renderCommandList?: (options: SelectOption<T>[]) => React.ReactNode;
25
+ /** Placeholder text to show when no value is selected */
26
+ placeholder?: string;
27
+ /** Whether the select is disabled */
28
+ disabled?: boolean;
29
+ /** Whether the select is required */
30
+ required?: boolean;
31
+ /** Error message to display */
32
+ error?: string;
33
+ /** Additional class name for the select */
34
+ className?: string;
35
+ /** ID for the select element */
36
+ id?: string;
37
+ };
38
+ /**
39
+ * SearchableSelect component that provides a searchable dropdown select input.
40
+ * Built on top of Radix UI's Select primitive.
41
+ *
42
+ * @url https://sergii-melnykov.github.io/ui/?path=/docs-atoms-select--docs
43
+ *
44
+ * @example
45
+ * ```tsx
46
+ * <Select
47
+ * options={[
48
+ * { id: "1", label: "Option 1" },
49
+ * { id: "2", label: "Option 2" }
50
+ * ]}
51
+ * value="1"
52
+ * onChange={setValue}
53
+ * required
54
+ * />
55
+ * ```
56
+ */
57
+ declare function Select<T extends string | number = string | number>({ options, value, onChange, placeholder, disabled, required, error, className, fullWidth, searchable, id, renderCommandList }: SelectProps<T>): react_jsx_runtime.JSX.Element;
58
+
59
+ type MultiSelectOption = {
60
+ id: string;
61
+ label: string;
62
+ startIcon?: React.ReactNode;
63
+ endIcon?: React.ReactNode;
64
+ className?: string;
65
+ disabled?: boolean;
66
+ };
67
+ type MultiSelectProps = {
68
+ /** Whether the select is searchable */
69
+ searchable?: boolean;
70
+ /** Whether the select should take up the full width of its container */
71
+ fullWidth?: boolean;
72
+ /** Array of options to display in the select */
73
+ options: MultiSelectOption[];
74
+ /** Currently selected values */
75
+ value: string[];
76
+ /** Callback fired when the values change */
77
+ onChange: (value: string[]) => void;
78
+ /** Render a custom CommandList for the select, if not provided, the select will render a default CommandList with the options */
79
+ renderCommandList?: (options: MultiSelectOption[]) => React.ReactNode;
80
+ /** Placeholder text to show when no value is selected */
81
+ placeholder?: string;
82
+ /** Whether the select is disabled */
83
+ disabled?: boolean;
84
+ /** Whether the select is required */
85
+ required?: boolean;
86
+ /** Error message to display */
87
+ error?: string;
88
+ /** Additional class name for the select */
89
+ className?: string;
90
+ /** ID for the select element */
91
+ id?: string;
92
+ /** Maximum number of selections allowed */
93
+ maxSelections?: number;
94
+ /** Whether to show the select all option */
95
+ showSelectAll?: boolean;
96
+ };
97
+ /**
98
+ * MultiSelect component that provides a searchable dropdown select input with multiple selection.
99
+ * Built on top of Radix UI's Select primitive.
100
+ *
101
+ * @url https://sergii-melnykov.github.io/ui/?path=/docs-atoms-multiselect--docs
102
+ *
103
+ * @example
104
+ * ```tsx
105
+ * <MultiSelect
106
+ * options={[
107
+ * { id: "1", label: "Option 1" },
108
+ * { id: "2", label: "Option 2" }
109
+ * ]}
110
+ * value={["1"]}
111
+ * onChange={setValue}
112
+ * showSelectAll
113
+ * />
114
+ * ```
115
+ */
116
+ declare function MultiSelect({ options, value, onChange, placeholder, disabled, required, error, className, fullWidth, searchable, id, maxSelections, showSelectAll, renderCommandList }: MultiSelectProps): react_jsx_runtime.JSX.Element;
117
+
118
+ export { MultiSelect, type MultiSelectOption, type MultiSelectProps, Select, type SelectOption, type SelectProps };
@@ -0,0 +1,2 @@
1
+ import*as S from"react";import{ChevronDown as ne}from"lucide-react";import{clsx as F}from"clsx";import{twMerge as J}from"tailwind-merge";function o(...t){return J(F(t))}import{Popover as me,PopoverContent as se,PopoverTrigger as de}from"@radix-ui/react-popover";import*as A from"react";import{Slot as Q}from"@radix-ui/react-slot";import{cva as U}from"class-variance-authority";import{Loader2 as Y}from"lucide-react";import{jsx as V,jsxs as Z}from"react/jsx-runtime";var q=U("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"}}),B=A.forwardRef(({className:t,variant:e,size:r,asChild:g=!1,startIcon:l,endIcon:v,loading:c=!1,disabled:O,children:d,type:I="button","aria-label":p,...u},C)=>{let N=g?Q:"button",i=O||c,T=p||(typeof d=="string"?d:void 0),w=y=>{(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),!i&&u.onClick&&u.onClick(y))};return g?V(N,{className:o(q({variant:e,size:r,className:t})),ref:C,disabled:i,type:I,"aria-label":T,"aria-disabled":i,...u,children:d}):Z(N,{className:o(q({variant:e,size:r,className:t})),ref:C,disabled:i,type:I,"aria-label":T,"aria-disabled":i,onKeyDown:w,...u,children:[c&&V(Y,{className:"mr-2 h-4 w-4 animate-spin",role:"status","aria-label":"Loading","aria-hidden":"true"}),!c&&l&&V("span",{className:"mr-2","aria-hidden":"true",children:l}),d,!c&&v&&V("span",{className:"ml-2","aria-hidden":"true",children:v})]})});B.displayName="Button";import*as R from"react";import{Command as s}from"cmdk";import{Search as ee}from"lucide-react";import{jsx as h,jsxs as te}from"react/jsx-runtime";var _=R.forwardRef(({className:t,...e},r)=>h(s,{ref:r,className:o("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",t),...e}));_.displayName=s.displayName;var E=R.forwardRef(({className:t,...e},r)=>te("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[h(ee,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),h(s.Input,{ref:r,className:o("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",t),...e})]}));E.displayName=s.Input.displayName;var L=R.forwardRef(({className:t,...e},r)=>h(s.List,{ref:r,className:o("max-h-[300px] overflow-y-auto overflow-x-hidden",t),...e}));L.displayName=s.List.displayName;var M=R.forwardRef((t,e)=>h(s.Empty,{ref:e,className:"py-6 text-center text-sm",...t}));M.displayName=s.Empty.displayName;var k=R.forwardRef(({className:t,...e},r)=>h(s.Group,{ref:r,className:o("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",t),...e}));k.displayName=s.Group.displayName;var H=R.forwardRef(({className:t,...e},r)=>h(s.Separator,{ref:r,className:o("-mx-1 h-px bg-border",t),...e}));H.displayName=s.Separator.displayName;var P=R.forwardRef(({className:t,...e},r)=>h(s.Item,{ref:r,className:o("relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t),...e}));P.displayName=s.Item.displayName;var j=({className:t,...e})=>h("span",{className:o("ml-auto text-xs tracking-widest text-muted-foreground",t),...e});j.displayName="CommandShortcut";import*as K from"react";import{cva as ae}from"class-variance-authority";import{jsx as re}from"react/jsx-runtime";var oe=ae("",{variants:{variant:{h1:"scroll-m-5 text-4xl font-extrabold tracking-tight lg:text-5xl",h2:"scroll-m-5 text-3xl font-semibold tracking-tight",h3:"scroll-m-5 text-2xl font-semibold tracking-tight",h4:"scroll-m-5 text-xl font-semibold tracking-tight",h5:"scroll-m-5 text-lg font-semibold tracking-tight",h6:"scroll-m-5 text-base font-semibold tracking-tight",p:"leading-7 [&:not(:first-child)]:mt-6",blockquote:"mt-6 border-l-2 border-slate-300 pl-6 italic",list:"my-6 ml-6 list-disc [&>li]:mt-2",lead:"text-xl text-muted-foreground",large:"text-lg font-semibold",small:"text-sm font-medium leading-none",muted:"text-sm text-muted-foreground"},align:{left:"text-left",center:"text-center",right:"text-right",justify:"text-justify"}},defaultVariants:{variant:"p",align:"left"}}),D=K.forwardRef(({className:t,variant:e,align:r,as:g="p",...l},v)=>re(g,{className:o(oe({variant:e,align:r,className:t})),ref:v,...l}));D.displayName="Typography";import{jsx as x,jsxs as G}from"react/jsx-runtime";function $e({options:t,value:e,onChange:r,placeholder:g="Select an option",disabled:l,required:v,error:c,className:O,fullWidth:d,searchable:I,id:p,renderCommandList:u}){let[C,N]=S.useState(!1),[i,T]=S.useState(void 0),w=S.useRef(null),y=t?.find(m=>m.id===e);return S.useEffect(()=>{w.current&&T(w.current.offsetWidth)},[]),x("div",{className:o(d&&"w-full"),children:G(me,{open:C,onOpenChange:N,children:[x(de,{asChild:!0,children:G(B,{ref:w,variant:"outline",role:"combobox","aria-expanded":C,"aria-controls":p?`${p}-content`:void 0,"aria-required":v,"aria-invalid":!!c,disabled:l,className:o("w-[13rem] justify-between",!e&&"text-muted-foreground",d&&"w-full",c&&"border-destructive focus-visible:ring-destructive",O),children:[y?y.label:g,x(ne,{className:o("opacity-50",C&&"rotate-180")})]})}),x(se,{className:o("p-0 rounded-md border bg-popover text-popover-foreground shadow-md",d&&"w-full"),style:{width:i},align:"start",children:G(_,{children:[I&&x(E,{placeholder:"Search...",className:"h-9",disabled:l}),G(L,{className:"max-h-[12rem] overflow-y-auto",children:[x(M,{children:"No items found."}),u?u(t):x(k,{children:t?.map(m=>G(P,{value:m.label,onSelect:()=>{r(m.id),N(!1)},disabled:m.disabled,className:o("flex items-center justify-between cursor-pointer my-1",e===m.id&&"bg-accent text-accent-foreground",m.disabled&&"opacity-50 cursor-not-allowed",m.className),children:[G("div",{className:"flex items-center gap-1",children:[m.startIcon&&m.startIcon,x(D,{variant:"small",children:m.label})]}),m.endIcon&&x("div",{className:"ml-2",children:m.endIcon})]},m.id))})]})]})})]})})}import*as z from"react";import{Check as $,ChevronDown as ie,X as le}from"lucide-react";import{Popover as ce,PopoverContent as pe,PopoverTrigger as ue}from"@radix-ui/react-popover";import{jsx as n,jsxs as f}from"react/jsx-runtime";function Ze({options:t,value:e,onChange:r,placeholder:g="Select options",disabled:l,required:v,error:c,className:O,fullWidth:d,searchable:I,id:p,maxSelections:u,showSelectAll:C,renderCommandList:N}){let[i,T]=z.useState(!1),w=t.filter(a=>e.includes(a.id)),y=a=>{if(e.includes(a))r(e.filter(b=>b!==a));else{if(u&&e.length>=u)return;r([...e,a])}},m=()=>{let a=t.filter(b=>!b.disabled);e.length===a.length?r([]):r(a.map(b=>b.id))},W=(a,b)=>{b.stopPropagation(),r(e.filter(X=>X!==a))};return n("div",{className:o(d&&"w-full"),children:f(ce,{open:i,onOpenChange:T,children:[n(ue,{asChild:!0,children:f(B,{variant:"outline",role:"combobox","aria-expanded":i,"aria-controls":p?`${p}-content`:void 0,"aria-label":g,"aria-required":v,"aria-invalid":!!c,disabled:l,id:p,className:o("w-[13rem] justify-between min-h-[2.5rem] h-auto",!e.length&&"text-muted-foreground",d&&"w-full",c&&"border-destructive focus-visible:ring-destructive",O),children:[n("div",{className:"flex flex-wrap gap-1",children:w.length>0?w.map(a=>f("div",{className:"flex items-center gap-1 bg-secondary text-secondary-foreground px-2 py-0.5 rounded-md text-sm",children:[n("span",{children:a.label}),n("span",{onClick:b=>W(a.id,b),className:"hover:bg-secondary-foreground/20 rounded-sm",children:n(le,{className:"h-3 w-3"})})]},a.id)):n("span",{children:g})}),n(ie,{className:o("opacity-50",i&&"rotate-180")})]})}),n(pe,{id:p?`${p}-content`:void 0,className:o("w-[13rem] p-0 rounded-md border bg-popover text-popover-foreground shadow-md",d&&"w-full"),align:"start",children:f(_,{children:[I&&n(E,{placeholder:"Search...",className:"h-9",disabled:l}),f(L,{className:"max-h-[12rem] overflow-y-auto",children:[n(M,{children:"No items found."}),f(k,{children:[C&&f(P,{onSelect:m,className:"flex items-center gap-2 cursor-pointer my-1",children:[n("div",{className:"flex h-4 w-4 items-center justify-center rounded border border-primary",children:e.length===t.filter(a=>!a.disabled).length&&n($,{className:"h-3 w-3"})}),n(D,{variant:"small",children:"Select All"})]}),n(H,{})]}),N?N(t):n(k,{children:t.map(a=>f(P,{value:a.id,onSelect:()=>y(a.id),disabled:a.disabled,className:o("flex items-center justify-between cursor-pointer my-1",a.disabled&&"opacity-50 cursor-not-allowed",a.className),children:[f("div",{className:"flex items-center gap-2",children:[n("div",{className:"flex h-4 w-4 items-center justify-center rounded border border-primary",children:e.includes(a.id)&&n($,{className:"h-3 w-3"})}),f("div",{className:"flex items-center gap-1",children:[a.startIcon&&a.startIcon,n(D,{variant:"small",children:a.label})]})]}),a.endIcon&&n("div",{className:"ml-2",children:a.endIcon})]},a.id))})]})]})})]})})}export{Ze as MultiSelect,$e as Select};
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/components/atoms/select/select.tsx","../../src/utils/cn.ts","../../src/components/atoms/button/button.tsx","../../src/components/atoms/command/command.tsx","../../src/components/atoms/typography/typography.tsx","../../src/components/atoms/select/multi-select.tsx"],"sourcesContent":["\"use client\";\n\"use client\"\n\nimport * as React from \"react\"\nimport { ChevronDown } from \"lucide-react\"\n\nimport { cn } from \"@/utils\"\n\nimport { Popover, PopoverContent, PopoverTrigger } from \"@radix-ui/react-popover\"\nimport { Button } from \"../button\"\nimport {\n Command,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList\n} from \"../command\"\nimport { Typography } from \"../typography\"\n\nexport type SelectOption<T extends string | number = string | number> = {\n id: T\n label: string\n startIcon?: React.ReactNode\n endIcon?: React.ReactNode\n className?: string\n disabled?: boolean\n}\n\nexport type SelectProps<T extends string | number = string | number> = {\n /** Whether the select is searchable */\n searchable?: boolean\n /** Whether the select should take up the full width of its container */\n fullWidth?: boolean\n /** Currently selected value */\n value: T\n /** Array of options to display in the select */\n options: SelectOption<T>[]\n /** Callback fired when the value changes */\n // eslint-disable-next-line no-unused-vars\n onChange: (value: T) => void\n /** Render a custom CommandList for the select, if not provided, the select will render a default CommandList with the options */\n // eslint-disable-next-line no-unused-vars\n renderCommandList?: (options: SelectOption<T>[]) => React.ReactNode\n /** Placeholder text to show when no value is selected */\n placeholder?: string\n /** Whether the select is disabled */\n disabled?: boolean\n /** Whether the select is required */\n required?: boolean\n /** Error message to display */\n error?: string\n /** Additional class name for the select */\n className?: string\n /** ID for the select element */\n id?: string\n}\n\n/**\n * SearchableSelect component that provides a searchable dropdown select input.\n * Built on top of Radix UI's Select primitive.\n *\n * @url https://sergii-melnykov.github.io/ui/?path=/docs-atoms-select--docs\n *\n * @example\n * ```tsx\n * <Select\n * options={[\n * { id: \"1\", label: \"Option 1\" },\n * { id: \"2\", label: \"Option 2\" }\n * ]}\n * value=\"1\"\n * onChange={setValue}\n * required\n * />\n * ```\n */\nexport function Select<T extends string | number = string | number>({\n options,\n value,\n onChange,\n placeholder = \"Select an option\",\n disabled,\n required,\n error,\n className,\n fullWidth,\n searchable,\n id,\n renderCommandList\n}: SelectProps<T>) {\n const [open, setOpen] = React.useState(false)\n const [triggerWidth, setTriggerWidth] = React.useState<number | undefined>(undefined)\n const triggerRef = React.useRef<HTMLButtonElement>(null)\n const selectedOption = options?.find((option) => option.id === value)\n\n React.useEffect(() => {\n if (triggerRef.current) {\n setTriggerWidth(triggerRef.current.offsetWidth)\n }\n }, [])\n\n return (\n <div className={cn(fullWidth && \"w-full\")}>\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n <Button\n ref={triggerRef}\n variant=\"outline\"\n role=\"combobox\"\n aria-expanded={open}\n aria-controls={id ? `${id}-content` : undefined}\n aria-required={required}\n aria-invalid={!!error}\n disabled={disabled}\n className={cn(\n \"w-[13rem] justify-between\",\n !value && \"text-muted-foreground\",\n fullWidth && \"w-full\",\n error && \"border-destructive focus-visible:ring-destructive\",\n className\n )}\n >\n {selectedOption ? selectedOption.label : placeholder}\n <ChevronDown className={cn(\"opacity-50\", open && \"rotate-180\")} />\n </Button>\n </PopoverTrigger>\n <PopoverContent\n className={cn(\n \"p-0 rounded-md border bg-popover text-popover-foreground shadow-md\",\n fullWidth && \"w-full\"\n )}\n style={{ width: triggerWidth }}\n align=\"start\"\n >\n <Command>\n {searchable && (\n <CommandInput placeholder=\"Search...\" className=\"h-9\" disabled={disabled} />\n )}\n <CommandList className=\"max-h-[12rem] overflow-y-auto\">\n <CommandEmpty>No items found.</CommandEmpty>\n {renderCommandList ? (\n renderCommandList(options)\n ) : (\n <CommandGroup>\n {options?.map((option) => (\n <CommandItem\n value={option.label}\n key={option.id}\n onSelect={() => {\n onChange(option.id)\n setOpen(false)\n }}\n disabled={option.disabled}\n className={cn(\n \"flex items-center justify-between cursor-pointer my-1\",\n value === option.id && \"bg-accent text-accent-foreground\",\n option.disabled && \"opacity-50 cursor-not-allowed\",\n option.className\n )}\n >\n <div className=\"flex items-center gap-1\">\n {option.startIcon && option.startIcon}\n <Typography variant=\"small\">{option.label}</Typography>\n </div>\n {option.endIcon && <div className=\"ml-2\">{option.endIcon}</div>}\n </CommandItem>\n ))}\n </CommandGroup>\n )}\n </CommandList>\n </Command>\n </PopoverContent>\n </Popover>\n </div>\n )\n}\n","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 { Command as CommandPrimitive } from \"cmdk\"\nimport { Search } from \"lucide-react\"\n\nimport { cn } from \"@/utils/index\"\nimport { Dialog, DialogContent } from \"@/components/atoms/dialog\"\nimport {\n type CommandProps,\n type CommandRef,\n type CommandDialogProps,\n type CommandInputProps,\n type CommandInputRef,\n type CommandListProps,\n type CommandListRef,\n type CommandEmptyProps,\n type CommandEmptyRef,\n type CommandGroupProps,\n type CommandGroupRef,\n type CommandSeparatorProps,\n type CommandSeparatorRef,\n type CommandItemProps,\n type CommandItemRef,\n type CommandShortcutProps\n} from \"./command.types\"\n\n/**\n * Command component that provides a command palette interface.\n * Built on top of cmdk and Radix UI's Dialog primitive.\n *\n * @url https://sergii-melnykov.github.io/ui/?path=/docs/atoms-command--docs\n *\n * @example\n * ```tsx\n * <Command>\n * <CommandInput placeholder=\"Search...\" />\n * <CommandList>\n * <CommandEmpty>No results found.</CommandEmpty>\n * <CommandGroup heading=\"Suggestions\">\n * <CommandItem>Calendar</CommandItem>\n * <CommandItem>Search</CommandItem>\n * </CommandGroup>\n * </CommandList>\n * </Command>\n * ```\n */\nconst Command = React.forwardRef<CommandRef, CommandProps>(({ className, ...props }, ref) => (\n <CommandPrimitive\n ref={ref}\n className={cn(\n \"flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground\",\n className\n )}\n {...props}\n />\n))\nCommand.displayName = CommandPrimitive.displayName\n\nconst CommandDialog = ({ children, ...props }: CommandDialogProps) => {\n return (\n <Dialog {...props}>\n <DialogContent className=\"overflow-hidden p-0\">\n <Command className=\"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5\">\n {children}\n </Command>\n </DialogContent>\n </Dialog>\n )\n}\n\nconst CommandInput = React.forwardRef<CommandInputRef, CommandInputProps>(\n ({ className, ...props }, ref) => (\n <div className=\"flex items-center border-b px-3\" cmdk-input-wrapper=\"\">\n <Search className=\"mr-2 h-4 w-4 shrink-0 opacity-50\" />\n <CommandPrimitive.Input\n ref={ref}\n className={cn(\n \"flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50\",\n className\n )}\n {...props}\n />\n </div>\n )\n)\nCommandInput.displayName = CommandPrimitive.Input.displayName\n\nconst CommandList = React.forwardRef<CommandListRef, CommandListProps>(\n ({ className, ...props }, ref) => (\n <CommandPrimitive.List\n ref={ref}\n className={cn(\"max-h-[300px] overflow-y-auto overflow-x-hidden\", className)}\n {...props}\n />\n )\n)\nCommandList.displayName = CommandPrimitive.List.displayName\n\nconst CommandEmpty = React.forwardRef<CommandEmptyRef, CommandEmptyProps>((props, ref) => (\n <CommandPrimitive.Empty ref={ref} className=\"py-6 text-center text-sm\" {...props} />\n))\nCommandEmpty.displayName = CommandPrimitive.Empty.displayName\n\nconst CommandGroup = React.forwardRef<CommandGroupRef, CommandGroupProps>(\n ({ className, ...props }, ref) => (\n <CommandPrimitive.Group\n ref={ref}\n className={cn(\n \"overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground\",\n className\n )}\n {...props}\n />\n )\n)\nCommandGroup.displayName = CommandPrimitive.Group.displayName\n\nconst CommandSeparator = React.forwardRef<CommandSeparatorRef, CommandSeparatorProps>(\n ({ className, ...props }, ref) => (\n <CommandPrimitive.Separator\n ref={ref}\n className={cn(\"-mx-1 h-px bg-border\", className)}\n {...props}\n />\n )\n)\nCommandSeparator.displayName = CommandPrimitive.Separator.displayName\n\nconst CommandItem = React.forwardRef<CommandItemRef, CommandItemProps>(\n ({ className, ...props }, ref) => (\n <CommandPrimitive.Item\n ref={ref}\n className={cn(\n \"relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\n className\n )}\n {...props}\n />\n )\n)\nCommandItem.displayName = CommandPrimitive.Item.displayName\n\nconst CommandShortcut = ({ className, ...props }: CommandShortcutProps) => {\n return (\n <span\n className={cn(\"ml-auto text-xs tracking-widest text-muted-foreground\", className)}\n {...props}\n />\n )\n}\nCommandShortcut.displayName = \"CommandShortcut\"\n\nexport {\n Command,\n CommandDialog,\n CommandInput,\n CommandList,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandShortcut,\n CommandSeparator\n}\n","import * as React from \"react\"\nimport { cn } from \"@/utils\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\n\nconst typographyVariants = cva(\"\", {\n variants: {\n variant: {\n h1: \"scroll-m-5 text-4xl font-extrabold tracking-tight lg:text-5xl\",\n h2: \"scroll-m-5 text-3xl font-semibold tracking-tight\",\n h3: \"scroll-m-5 text-2xl font-semibold tracking-tight\",\n h4: \"scroll-m-5 text-xl font-semibold tracking-tight\",\n h5: \"scroll-m-5 text-lg font-semibold tracking-tight\",\n h6: \"scroll-m-5 text-base font-semibold tracking-tight\",\n p: \"leading-7 [&:not(:first-child)]:mt-6\",\n blockquote: \"mt-6 border-l-2 border-slate-300 pl-6 italic\",\n list: \"my-6 ml-6 list-disc [&>li]:mt-2\",\n lead: \"text-xl text-muted-foreground\",\n large: \"text-lg font-semibold\",\n small: \"text-sm font-medium leading-none\",\n muted: \"text-sm text-muted-foreground\"\n },\n align: {\n left: \"text-left\",\n center: \"text-center\",\n right: \"text-right\",\n justify: \"text-justify\"\n }\n },\n defaultVariants: {\n variant: \"p\",\n align: \"left\"\n }\n})\n\nexport interface TypographyProps\n extends React.HTMLAttributes<HTMLElement>,\n VariantProps<typeof typographyVariants> {\n as?: React.ElementType\n}\n\n/**\n * Typography component for creating accessible text elements.\n * Built on top of shadcn/ui's Typography component.\n *\n * @url https://sergii-melnykov.github.io/ui/?path=/docs/atoms-typography--docs\n *\n */\nconst Typography = React.forwardRef<HTMLElement, TypographyProps>(\n ({ className, variant, align, as: Component = \"p\", ...props }, ref) => {\n return (\n <Component\n className={cn(typographyVariants({ variant, align, className }))}\n ref={ref}\n {...props}\n />\n )\n }\n)\n\nTypography.displayName = \"Typography\"\n\nexport { Typography, typographyVariants }\n","\"use client\";\n\"use client\"\n\nimport * as React from \"react\"\nimport { Check, ChevronDown, X } from \"lucide-react\"\n\nimport { cn } from \"@/utils\"\n\nimport { Popover, PopoverContent, PopoverTrigger } from \"@radix-ui/react-popover\"\nimport { Button } from \"../button\"\nimport {\n Command,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n CommandSeparator\n} from \"../command\"\nimport { Typography } from \"../typography\"\n\nexport type MultiSelectOption = {\n id: string\n label: string\n startIcon?: React.ReactNode\n endIcon?: React.ReactNode\n className?: string\n disabled?: boolean\n}\n\nexport type MultiSelectProps = {\n /** Whether the select is searchable */\n searchable?: boolean\n /** Whether the select should take up the full width of its container */\n fullWidth?: boolean\n /** Array of options to display in the select */\n options: MultiSelectOption[]\n /** Currently selected values */\n value: string[]\n /** Callback fired when the values change */\n // eslint-disable-next-line no-unused-vars\n onChange: (value: string[]) => void\n /** Render a custom CommandList for the select, if not provided, the select will render a default CommandList with the options */\n // eslint-disable-next-line no-unused-vars\n renderCommandList?: (options: MultiSelectOption[]) => React.ReactNode\n /** Placeholder text to show when no value is selected */\n placeholder?: string\n /** Whether the select is disabled */\n disabled?: boolean\n /** Whether the select is required */\n required?: boolean\n /** Error message to display */\n error?: string\n /** Additional class name for the select */\n className?: string\n /** ID for the select element */\n id?: string\n /** Maximum number of selections allowed */\n maxSelections?: number\n /** Whether to show the select all option */\n showSelectAll?: boolean\n}\n\n/**\n * MultiSelect component that provides a searchable dropdown select input with multiple selection.\n * Built on top of Radix UI's Select primitive.\n *\n * @url https://sergii-melnykov.github.io/ui/?path=/docs-atoms-multiselect--docs\n *\n * @example\n * ```tsx\n * <MultiSelect\n * options={[\n * { id: \"1\", label: \"Option 1\" },\n * { id: \"2\", label: \"Option 2\" }\n * ]}\n * value={[\"1\"]}\n * onChange={setValue}\n * showSelectAll\n * />\n * ```\n */\nexport function MultiSelect({\n options,\n value,\n onChange,\n placeholder = \"Select options\",\n disabled,\n required,\n error,\n className,\n fullWidth,\n searchable,\n id,\n maxSelections,\n showSelectAll,\n renderCommandList\n}: MultiSelectProps) {\n const [open, setOpen] = React.useState(false)\n const selectedOptions = options.filter((option) => value.includes(option.id))\n\n const handleSelect = (optionId: string) => {\n if (value.includes(optionId)) {\n onChange(value.filter((selectedId) => selectedId !== optionId))\n } else {\n if (maxSelections && value.length >= maxSelections) {\n return\n }\n onChange([...value, optionId])\n }\n }\n\n const handleSelectAll = () => {\n const enabledOptions = options.filter((option) => !option.disabled)\n if (value.length === enabledOptions.length) {\n onChange([])\n } else {\n onChange(enabledOptions.map((option) => option.id))\n }\n }\n\n const handleRemove = (optionId: string, e: React.MouseEvent) => {\n e.stopPropagation()\n onChange(value.filter((selectedId) => selectedId !== optionId))\n }\n\n return (\n <div className={cn(fullWidth && \"w-full\")}>\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n <Button\n variant=\"outline\"\n role=\"combobox\"\n aria-expanded={open}\n aria-controls={id ? `${id}-content` : undefined}\n aria-label={placeholder}\n aria-required={required}\n aria-invalid={!!error}\n disabled={disabled}\n id={id}\n className={cn(\n \"w-[13rem] justify-between min-h-[2.5rem] h-auto\",\n !value.length && \"text-muted-foreground\",\n fullWidth && \"w-full\",\n error && \"border-destructive focus-visible:ring-destructive\",\n className\n )}\n >\n <div className=\"flex flex-wrap gap-1\">\n {selectedOptions.length > 0 ? (\n selectedOptions.map((option) => (\n <div\n key={option.id}\n className=\"flex items-center gap-1 bg-secondary text-secondary-foreground px-2 py-0.5 rounded-md text-sm\"\n >\n <span>{option.label}</span>\n <span\n onClick={(e) => handleRemove(option.id, e)}\n className=\"hover:bg-secondary-foreground/20 rounded-sm\"\n >\n <X className=\"h-3 w-3\" />\n </span>\n </div>\n ))\n ) : (\n <span>{placeholder}</span>\n )}\n </div>\n <ChevronDown className={cn(\"opacity-50\", open && \"rotate-180\")} />\n </Button>\n </PopoverTrigger>\n <PopoverContent\n id={id ? `${id}-content` : undefined}\n className={cn(\n \"w-[13rem] p-0 rounded-md border bg-popover text-popover-foreground shadow-md\",\n fullWidth && \"w-full\"\n )}\n align=\"start\"\n >\n <Command>\n {searchable && (\n <CommandInput placeholder=\"Search...\" className=\"h-9\" disabled={disabled} />\n )}\n <CommandList className=\"max-h-[12rem] overflow-y-auto\">\n <CommandEmpty>No items found.</CommandEmpty>\n <CommandGroup>\n {showSelectAll && (\n <CommandItem\n onSelect={handleSelectAll}\n className=\"flex items-center gap-2 cursor-pointer my-1\"\n >\n <div className=\"flex h-4 w-4 items-center justify-center rounded border border-primary\">\n {value.length === options.filter((o) => !o.disabled).length && (\n <Check className=\"h-3 w-3\" />\n )}\n </div>\n <Typography variant=\"small\">Select All</Typography>\n </CommandItem>\n )}\n <CommandSeparator />\n </CommandGroup>\n {renderCommandList ? (\n renderCommandList(options)\n ) : (\n <CommandGroup>\n {options.map((option) => (\n <CommandItem\n value={option.id}\n key={option.id}\n onSelect={() => handleSelect(option.id)}\n disabled={option.disabled}\n className={cn(\n \"flex items-center justify-between cursor-pointer my-1\",\n option.disabled && \"opacity-50 cursor-not-allowed\",\n option.className\n )}\n >\n <div className=\"flex items-center gap-2\">\n <div className=\"flex h-4 w-4 items-center justify-center rounded border border-primary\">\n {value.includes(option.id) && <Check className=\"h-3 w-3\" />}\n </div>\n <div className=\"flex items-center gap-1\">\n {option.startIcon && option.startIcon}\n <Typography variant=\"small\">{option.label}</Typography>\n </div>\n </div>\n {option.endIcon && <div className=\"ml-2\">{option.endIcon}</div>}\n </CommandItem>\n ))}\n </CommandGroup>\n )}\n </CommandList>\n </Command>\n </PopoverContent>\n </Popover>\n </div>\n )\n}\n"],"mappings":"AAGA,UAAYA,MAAW,QACvB,OAAS,eAAAC,OAAmB,eCJ5B,OAA0B,QAAAC,MAAY,OACtC,OAAS,WAAAC,MAAe,iBAEjB,SAASC,KAAMC,EAAsB,CAC1C,OAAOF,EAAQD,EAAKG,CAAM,CAAC,CAC7B,CDGA,OAAS,WAAAC,GAAS,kBAAAC,GAAgB,kBAAAC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EAAC0C,EAAA,CAAM,UAAU,UAAU,EAC3D,EACAzC,EAAC,OAAI,UAAU,0BACZ,UAAAmB,EAAO,WAAaA,EAAO,UAC5BpB,EAAC2C,EAAA,CAAW,QAAQ,QAAS,SAAAvB,EAAO,MAAM,GAC5C,GACF,EACCA,EAAO,SAAWpB,EAAC,OAAI,UAAU,OAAQ,SAAAoB,EAAO,QAAQ,IAlBpDA,EAAO,EAmBd,CACD,EACH,GAEJ,GACF,EACF,GACF,EACF,CAEJ","names":["React","ChevronDown","clsx","twMerge","cn","inputs","Popover","PopoverContent","PopoverTrigger","React","Slot","cva","Loader2","jsx","jsxs","buttonVariants","cva","Button","className","variant","size","asChild","startIcon","endIcon","loading","disabled","children","type","ariaLabel","props","ref","Comp","Slot","isDisabled","buttonAriaLabel","handleKeyDown","event","cn","React","CommandPrimitive","Search","jsx","jsxs","Command","className","props","ref","CommandPrimitive","cn","CommandInput","className","props","ref","jsxs","jsx","Search","CommandPrimitive","cn","CommandList","CommandEmpty","CommandGroup","CommandSeparator","CommandItem","CommandShortcut","React","cva","jsx","typographyVariants","Typography","className","variant","align","Component","props","ref","cn","jsx","jsxs","Select","options","value","onChange","placeholder","disabled","required","error","className","fullWidth","searchable","id","renderCommandList","open","setOpen","triggerWidth","setTriggerWidth","triggerRef","selectedOption","option","cn","Popover","PopoverTrigger","Button","ChevronDown","PopoverContent","Command","CommandInput","CommandList","CommandEmpty","CommandGroup","CommandItem","Typography","React","Check","ChevronDown","X","Popover","PopoverContent","PopoverTrigger","jsx","jsxs","MultiSelect","options","value","onChange","placeholder","disabled","required","error","className","fullWidth","searchable","id","maxSelections","showSelectAll","renderCommandList","open","setOpen","selectedOptions","option","handleSelect","optionId","selectedId","handleSelectAll","enabledOptions","handleRemove","e","cn","Popover","PopoverTrigger","Button","X","ChevronDown","PopoverContent","Command","CommandInput","CommandList","CommandEmpty","CommandGroup","CommandItem","o","Check","Typography","CommandSeparator"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@me1a/ui",
3
- "version": "2.6.5",
3
+ "version": "2.6.7",
4
4
  "private": false,
5
5
  "main": "./dist/index.mjs",
6
6
  "module": "./dist/index.mjs",
@@ -77,6 +77,10 @@
77
77
  "types": "./dist/separator/index.d.mts",
78
78
  "import": "./dist/separator/index.mjs"
79
79
  },
80
+ "./select": {
81
+ "types": "./dist/select/index.d.mts",
82
+ "import": "./dist/select/index.mjs"
83
+ },
80
84
  "./scroll-area": {
81
85
  "types": "./dist/scroll-area/index.d.mts",
82
86
  "import": "./dist/scroll-area/index.mjs"