@incognia/cosmik 0.35.0-beta.9 → 0.35.1
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/Filter/index.d.ts.map +1 -1
- package/dist/TagInput/index.d.ts.map +1 -1
- package/dist/index.cjs15.js +1 -1
- package/dist/index.cjs15.js.map +1 -1
- package/dist/index.cjs32.js +1 -1
- package/dist/index.cjs32.js.map +1 -1
- package/dist/index.es15.js +51 -38
- package/dist/index.es15.js.map +1 -1
- package/dist/index.es32.js +22 -21
- package/dist/index.es32.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Filter/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Filter/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,KAAK,eAAe,CAAC,CAAC,IAAI;IACxB,IAAI,EAAE;QACJ,KAAK,CAAC,EAAE,MAAM,CAAA;QACd,KAAK,CAAC,EAAE,MAAM,CAAA;KACf,CAAA;IACD,KAAK,CAAC,EAAE,CAAC,CAAA;IACT,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACtC,OAAO,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,IAAI,CAAA;IAC5B,QAAQ,EAAE,CAAC,KAAK,EAAE;QAChB,cAAc,EAAE,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI,KAAK,IAAI,CAAA;QACzC,WAAW,EAAE,CAAC,GAAG,IAAI,CAAA;KACtB,KAAK,KAAK,CAAC,SAAS,CAAA;CACtB,CAAA;AAED,KAAK,oBAAoB,CAAC,CAAC,IAAI,eAAe,CAAC,CAAC,CAAC,GAAG;IAClD,KAAK,EAAE,MAAM,CAAA;IACb,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,KAAK,CAAC,SAAS,CAAA;IAC7C,OAAO,CAAC,EAAE,KAAK,CAAA;CAChB,CAAA;AAED,KAAK,sBAAsB,CAAC,CAAC,IAAI,eAAe,CAAC,CAAC,CAAC,GAAG;IACpD,OAAO,EAAE,KAAK,CAAC,SAAS,CAAA;IACxB,KAAK,CAAC,EAAE,KAAK,CAAA;IACb,aAAa,CAAC,EAAE,KAAK,CAAA;CACtB,CAAA;AAED,KAAK,WAAW,CAAC,CAAC,IAAI,oBAAoB,CAAC,CAAC,CAAC,GAAG,sBAAsB,CAAC,CAAC,CAAC,CAAA;AAEzE,iBAAS,MAAM,CAAC,CAAC,EAAE,EACjB,QAAQ,EACR,KAAK,EACL,aAAa,EACb,OAAO,EACP,IAAI,EACJ,KAAK,EACL,YAAY,EACZ,OAAO,EACP,GAAG,KAAK,EACT,EAAE,WAAW,CAAC,CAAC,CAAC,2CAuFhB;AAED,OAAO,EAAE,MAAM,EAAE,CAAA;AACjB,YAAY,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/TagInput/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAK9B,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,cAAc,CAAC,gBAAgB,CAAC,GAAG;IACnE,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;IAChB,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAA;IACxC,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAA;AAED,QAAA,MAAM,QAAQ;;2BAJW,MAAM,EAAE,KAAK,IAAI;;0CAqFzC,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/TagInput/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAK9B,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,cAAc,CAAC,gBAAgB,CAAC,GAAG;IACnE,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;IAChB,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAA;IACxC,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAA;AAED,QAAA,MAAM,QAAQ;;2BAJW,MAAM,EAAE,KAAK,IAAI;;0CAqFzC,CAAA;AAgCD,OAAO,EAAE,QAAQ,EAAE,CAAA"}
|
package/dist/index.cjs15.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index.cjs42.js"),E=require("lucide-react"),x=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index.cjs42.js"),E=require("lucide-react"),x=require("react"),l=require("./index.cjs8.js"),c=require("./index.cjs22.js"),v=require("./index.cjs43.js");function b({children:p,label:d,selectedLabel:a,trigger:m,i18n:n,value:t,onOpenChange:j,onApply:r,...f}){const[h,u]=x.useState(!1),[i,o]=x.useState(t||null),R=t?a?a(t):t.toString():d,g=e.jsxRuntimeExports.jsxs(l.Button,{variant:t?"filled":"outline",intent:t?"filter":"secondary",size:"sm",className:v.cn("font-normal flex items-center whitespace-nowrap gap-x-4",{"pr-12":!!t}),children:[R,t&&e.jsxRuntimeExports.jsx(E.LucideX,{className:"w-16 h-16 rounded hover:bg-purple-100 shrink-0",onClick:s=>{s.preventDefault(),o(null),r?.(void 0)}})]});return e.jsxRuntimeExports.jsxs(c.Popover,{open:h,onOpenChange:s=>{j?.(s),s||r?.(i||void 0),u(s)},...f,children:[e.jsxRuntimeExports.jsx(c.PopoverTrigger,{asChild:!0,children:m||g}),e.jsxRuntimeExports.jsx(c.PopoverContent,{align:"start",className:"w-full",children:e.jsxRuntimeExports.jsxs("form",{onSubmit:s=>{s.preventDefault(),r?.(i||void 0),u(!1)},children:[e.jsxRuntimeExports.jsx("div",{className:"p-8",children:p({onFilterChange:o,filterValue:i})}),e.jsxRuntimeExports.jsxs("div",{className:"w-full flex justify-between mt-16",children:[i&&n.clear&&e.jsxRuntimeExports.jsx(l.Button,{variant:"link",intent:"secondary",size:"fit-content",type:"button",onClick:()=>{o(null)},children:n.clear}),n.apply&&e.jsxRuntimeExports.jsx(l.Button,{className:"ml-auto",variant:"link",size:"fit-content",type:"submit",children:n.apply})]})]})})]})}exports.Filter=b;
|
|
2
2
|
//# sourceMappingURL=index.cjs15.js.map
|
package/dist/index.cjs15.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs15.js","sources":["../src/Filter/index.tsx"],"sourcesContent":["import { LucideX } from 'lucide-react'\nimport React from 'react'\nimport { Button } from '../Button'\nimport { Popover, PopoverContent, PopoverTrigger } from '../Popover'\n\ntype FilterPropsBase<T> = {\n i18n: {\n apply?: string\n clear?: string\n }\n value?: T\n onOpenChange?: (open: boolean) => void\n onApply: (value?: T) => void\n children: (props: {\n onFilterChange: (value: T | null) => void\n filterValue: T | null\n }) => React.ReactNode\n}\n\ntype FilterPropsWithLabel<T> = FilterPropsBase<T> & {\n label: string\n selectedLabel?: (value: T) => React.ReactNode\n trigger?: never\n}\n\ntype FilterPropsWithTrigger<T> = FilterPropsBase<T> & {\n trigger: React.ReactNode\n label?: never\n selectedLabel?: never\n}\n\ntype FilterProps<T> = FilterPropsWithLabel<T> | FilterPropsWithTrigger<T>\n\nfunction Filter<T>({\n children,\n label,\n selectedLabel,\n trigger,\n i18n,\n value,\n onOpenChange,\n onApply,\n ...props\n}: FilterProps<T>) {\n const [isOpen, setIsOpen] = React.useState(false)\n const [localValue, setLocalValue] = React.useState<T | null>(value || null)\n\n const filterLabel = value\n ? selectedLabel\n ? selectedLabel(value)\n : value.toString()\n : label\n\n const defaultTrigger = (\n <Button\n variant={value ? 'filled' : 'outline'}\n intent={value ? 'filter' : 'secondary'}\n size=\"sm\"\n className
|
|
1
|
+
{"version":3,"file":"index.cjs15.js","sources":["../src/Filter/index.tsx"],"sourcesContent":["import { LucideX } from 'lucide-react'\nimport React from 'react'\nimport { Button } from '../Button'\nimport { Popover, PopoverContent, PopoverTrigger } from '../Popover'\nimport { cn } from '../lib/utils'\n\ntype FilterPropsBase<T> = {\n i18n: {\n apply?: string\n clear?: string\n }\n value?: T\n onOpenChange?: (open: boolean) => void\n onApply: (value?: T) => void\n children: (props: {\n onFilterChange: (value: T | null) => void\n filterValue: T | null\n }) => React.ReactNode\n}\n\ntype FilterPropsWithLabel<T> = FilterPropsBase<T> & {\n label: string\n selectedLabel?: (value: T) => React.ReactNode\n trigger?: never\n}\n\ntype FilterPropsWithTrigger<T> = FilterPropsBase<T> & {\n trigger: React.ReactNode\n label?: never\n selectedLabel?: never\n}\n\ntype FilterProps<T> = FilterPropsWithLabel<T> | FilterPropsWithTrigger<T>\n\nfunction Filter<T>({\n children,\n label,\n selectedLabel,\n trigger,\n i18n,\n value,\n onOpenChange,\n onApply,\n ...props\n}: FilterProps<T>) {\n const [isOpen, setIsOpen] = React.useState(false)\n const [localValue, setLocalValue] = React.useState<T | null>(value || null)\n\n const filterLabel = value\n ? selectedLabel\n ? selectedLabel(value)\n : value.toString()\n : label\n\n const defaultTrigger = (\n <Button\n variant={value ? 'filled' : 'outline'}\n intent={value ? 'filter' : 'secondary'}\n size=\"sm\"\n className={cn('font-normal flex items-center whitespace-nowrap gap-x-4', {\n 'pr-12': !!value\n })}\n >\n {filterLabel}\n {value && (\n <LucideX\n className=\"w-16 h-16 rounded hover:bg-purple-100 shrink-0\"\n onClick={e => {\n e.preventDefault()\n setLocalValue(null)\n onApply?.(undefined)\n }}\n />\n )}\n </Button>\n )\n\n return (\n <Popover\n open={isOpen}\n onOpenChange={open => {\n onOpenChange?.(open)\n if (!open) onApply?.(localValue || undefined)\n setIsOpen(open)\n }}\n {...props}\n >\n <PopoverTrigger asChild>{trigger || defaultTrigger}</PopoverTrigger>\n <PopoverContent align=\"start\" className=\"w-full\">\n <form\n onSubmit={event => {\n event.preventDefault()\n onApply?.(localValue || undefined)\n setIsOpen(false)\n }}\n >\n <div className=\"p-8\">\n {children({\n onFilterChange: setLocalValue,\n filterValue: localValue\n })}\n </div>\n <div className=\"w-full flex justify-between mt-16\">\n {localValue && i18n.clear && (\n <Button\n variant=\"link\"\n intent=\"secondary\"\n size=\"fit-content\"\n type=\"button\"\n onClick={() => {\n setLocalValue(null)\n }}\n >\n {i18n.clear}\n </Button>\n )}\n {i18n.apply && (\n <Button\n className=\"ml-auto\"\n variant=\"link\"\n size=\"fit-content\"\n type=\"submit\"\n >\n {i18n.apply}\n </Button>\n )}\n </div>\n </form>\n </PopoverContent>\n </Popover>\n )\n}\n\nexport { Filter }\nexport type { FilterProps }\n"],"names":["Filter","children","label","selectedLabel","trigger","i18n","value","onOpenChange","onApply","props","isOpen","setIsOpen","React","localValue","setLocalValue","filterLabel","defaultTrigger","jsxs","Button","cn","jsx","LucideX","e","Popover","open","PopoverTrigger","PopoverContent","event"],"mappings":"0PAkCA,SAASA,EAAU,CACjB,SAAAC,EACA,MAAAC,EACA,cAAAC,EACA,QAAAC,EACA,KAAAC,EACA,MAAAC,EACA,aAAAC,EACA,QAAAC,EACA,GAAGC,CACL,EAAmB,CACjB,KAAM,CAACC,EAAQC,CAAS,EAAIC,EAAM,SAAS,EAAK,EAC1C,CAACC,EAAYC,CAAa,EAAIF,EAAM,SAAmBN,GAAS,IAAI,EAEpES,EAAcT,EAChBH,EACEA,EAAcG,CAAK,EACnBA,EAAM,SACR,EAAAJ,EAEEc,EACJC,EAAA,kBAAA,KAACC,EAAA,OAAA,CACC,QAASZ,EAAQ,SAAW,UAC5B,OAAQA,EAAQ,SAAW,YAC3B,KAAK,KACL,UAAWa,KAAG,0DAA2D,CACvE,QAAS,CAAC,CAACb,CAAA,CACZ,EAEA,SAAA,CAAAS,EAC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";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index.cjs42.js"),R=require("lucide-react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index.cjs42.js"),R=require("lucide-react"),b=require("react"),w=require("./index.cjs7.js"),E=require("./index.cjs8.js"),N=require("./index.cjs43.js");function k(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const s in t)if(s!=="default"){const n=Object.getOwnPropertyDescriptor(t,s);Object.defineProperty(e,s,n.get?n:{enumerable:!0,get:()=>t[s]})}}return e.default=t,Object.freeze(e)}const x=k(b),m=x.forwardRef(({className:t,value:e,placeholder:s,onValueChange:n,...d},a)=>{const[i,o]=x.useState(""),p=x.useRef(null);function j(c){const l=c.target.value;if(l.includes(",")){const g=l.split(","),y=Array.from(new Set(g));n([...e||[],...y.filter(u=>!!u&&!e?.includes(u)).map(u=>u.trim())||[]]),o("");return}o(l)}function h(c){["Enter","Tab"].includes(c.key)&&i?.trim()&&(c.preventDefault(),e?.includes(i)||f(),o("")),c.key==="Backspace"&&!i&&n(e?.slice(0,-1)||[])}function f(){i.trim()&&(n([...e||[],i]),o(""))}return r.jsxRuntimeExports.jsxs("div",{ref:a,className:N.cn("flex flex-wrap items-center gap-8 min-h-[36px]","border rounded border-gray-900-24 bg-white px-12 py-[4px]","hover:cursor-text","hover:shadow-field-hover","active:shadow-field-active","focus-visible:outline-none focus:shadow-field-active",t),onClick:()=>p.current?.focus(),...d,children:[r.jsxRuntimeExports.jsx(q,{value:e,onValueChange:n}),r.jsxRuntimeExports.jsx("input",{ref:p,className:"h-[26px] outline-none text-sm",type:"text",value:i,onChange:j,onKeyDown:h,style:{width:`${i.length+1}ch`},onBlur:()=>f()}),e?.length===0&&!i&&r.jsxRuntimeExports.jsx("div",{className:"text-gray-700 ml-[-2ch]",children:s})]})});m.displayName="TagInput";function q({value:t,onValueChange:e}){return r.jsxRuntimeExports.jsx(r.jsxRuntimeExports.Fragment,{children:t?.map((s,n)=>r.jsxRuntimeExports.jsxs(w.Badge,{className:"pl-0 gap-x-4 overflow-hidden",children:[r.jsxRuntimeExports.jsx(E.Button,{type:"button",className:"w-[26px] h-[26px] flex-shrink-0",size:"icon",intent:"secondary",onClick:()=>{e(t?.filter((d,a)=>a!==n)||[])},children:r.jsxRuntimeExports.jsx(R.LucideX,{className:"w-16"})}),r.jsxRuntimeExports.jsx("div",{className:"truncate",children:s})]},n))})}exports.TagInput=m;
|
|
2
2
|
//# sourceMappingURL=index.cjs32.js.map
|
package/dist/index.cjs32.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs32.js","sources":["../src/TagInput/index.tsx"],"sourcesContent":["import { LucideX } from 'lucide-react'\nimport * as React from 'react'\nimport { Badge } from '../Badge'\nimport { Button } from '../Button'\nimport { cn } from '../lib/utils'\n\nexport type TagInputProps = React.HTMLAttributes<HTMLInputElement> & {\n value?: string[]\n onValueChange: (value: string[]) => void\n placeholder?: string\n}\n\nconst TagInput = React.forwardRef<HTMLInputElement, TagInputProps>(\n ({ className, value, placeholder, onValueChange, ...props }, ref) => {\n const [inputValue, setInputValue] = React.useState('')\n const inputRef = React.useRef<HTMLInputElement>(null)\n\n function handleChange(event: React.ChangeEvent<HTMLInputElement>) {\n const currentInputValue = event.target.value\n if (currentInputValue.includes(',')) {\n const currentValues = currentInputValue.split(',')\n //Remove duplicates\n const uniqueValues = Array.from(new Set(currentValues))\n\n onValueChange([\n ...(value || []),\n ...(uniqueValues\n .filter(inputValue => {\n //Remove empty values and already added values\n return Boolean(inputValue) && !value?.includes(inputValue)\n })\n .map(i => i.trim()) || [])\n ])\n setInputValue('')\n return\n }\n setInputValue(currentInputValue)\n }\n\n function handleKeyDown(event: React.KeyboardEvent<HTMLInputElement>) {\n if (['Enter', 'Tab'].includes(event.key)) {\n if (inputValue?.trim()) {\n event.preventDefault()\n if (!value?.includes(inputValue)) {\n addInputValue()\n }\n setInputValue('')\n }\n }\n\n if (event.key === 'Backspace' && !inputValue) {\n onValueChange(value?.slice(0, -1) || [])\n }\n }\n\n function addInputValue() {\n if (!inputValue.trim()) return\n onValueChange([...(value || []), inputValue])\n setInputValue('')\n }\n\n return (\n <div\n ref={ref}\n className={cn(\n 'flex flex-wrap items-center gap-8 min-h-[36px]',\n 'border rounded border-gray-900-24 bg-white px-12 py-[4px]',\n 'hover:cursor-text',\n 'hover:shadow-field-hover',\n 'active:shadow-field-active',\n 'focus-visible:outline-none focus:shadow-field-active',\n className\n )}\n onClick={() => inputRef.current?.focus()}\n {...props}\n >\n <TagList value={value} onValueChange={onValueChange} />\n <input\n ref={inputRef}\n className=\"h-[26px] outline-none text-sm\"\n type=\"text\"\n value={inputValue}\n onChange={handleChange}\n onKeyDown={handleKeyDown}\n style={{ width: `${inputValue.length + 1}ch` }}\n onBlur={() => addInputValue()}\n />\n {value?.length === 0 && !inputValue && (\n <div className=\"text-gray-700 ml-[-2ch]\">{placeholder}</div>\n )}\n </div>\n )\n }\n)\n\nTagInput.displayName = 'TagInput'\n\ntype TagListProps = React.HTMLAttributes<HTMLDivElement> & {\n value?: string[]\n onValueChange: (value: string[]) => void\n}\n\nfunction TagList({ value, onValueChange }: TagListProps) {\n return (\n <>\n {value?.map((tag, index) => (\n <Badge key={index} className=\"pl-0 gap-x-4 overflow-hidden\">\n <Button\n className=\"w-[26px] h-[26px] flex-shrink-0\"\n size=\"icon\"\n intent=\"secondary\"\n onClick={() => {\n onValueChange(value?.filter((_, i) => i !== index) || [])\n }}\n >\n <LucideX className=\"w-16\" />\n </Button>\n <div className=\"truncate\">{tag}</div>\n </Badge>\n ))}\n </>\n )\n}\n\nexport { TagInput }\n"],"names":["TagInput","React","className","value","placeholder","onValueChange","props","ref","inputValue","setInputValue","inputRef","handleChange","event","currentInputValue","currentValues","uniqueValues","i","handleKeyDown","addInputValue","jsxs","cn","jsx","TagList","Fragment","tag","index","Badge","Button","_","LucideX"],"mappings":"mhBAYMA,EAAW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AAAnB,EAAc,cAAAE,CAA8B,CAAA,EACrDgB,EAAA,kBAAA,IAAC,QAAA,CACC,IAAKX,EACL,UAAU,gCACV,KAAK,OACL,MAAOF,EACP,SAAUG,EACV,UAAWM,EACX,MAAO,CAAE,MAAO,GAAGT,EAAW,OAAS,CAAC,IAAK,EAC7C,OAAQ,IAAMU,EAAc,CAAA,CAC9B,EACCf,GAAO,SAAW,GAAK,CAACK,GACtBa,EAAA,kBAAA,IAAA,MAAA,CAAI,UAAU,0BAA2B,SAAYjB,CAAA,CAAA,CAAA,CAAA,CAAA,CAI9D,CACF,EAEAJ,EAAS,YAAc,WAOvB,SAASsB,EAAQ,CAAE,MAAAnB,EAAO,cAAAE,GAA+B,CAErD,OAAAgB,EAAA,kBAAA,IAAAE,EAAA,kBAAA,SAAA,CACG,YAAO,IAAI,CAACC,EAAKC,IAChBN,EAAA,kBAAA,KAACO,EAAkB,MAAA,CAAA,UAAU,+BAC3B,SAAA,CAAAL,EAAA,kBAAA,IAACM,EAAA,OAAA,CACC,UAAU,kCACV,KAAK,OACL,OAAO,YACP,QAAS,IAAM,CACCtB,EAAAF,GAAO,OAAO,CAACyB,EAAGZ,IAAMA,IAAMS,CAAK,GAAK,CAAA,CAAE,CAC1D,EAEA,SAAAJ,EAAAA,kBAAAA,IAACQ,EAAAA,QAAQ,CAAA,UAAU,MAAO,CAAA,CAAA,CAC5B,EACCR,EAAA,kBAAA,IAAA,MAAA,CAAI,UAAU,WAAY,SAAIG,EAAA,CAAA,
|
|
1
|
+
{"version":3,"file":"index.cjs32.js","sources":["../src/TagInput/index.tsx"],"sourcesContent":["import { LucideX } from 'lucide-react'\nimport * as React from 'react'\nimport { Badge } from '../Badge'\nimport { Button } from '../Button'\nimport { cn } from '../lib/utils'\n\nexport type TagInputProps = React.HTMLAttributes<HTMLInputElement> & {\n value?: string[]\n onValueChange: (value: string[]) => void\n placeholder?: string\n}\n\nconst TagInput = React.forwardRef<HTMLInputElement, TagInputProps>(\n ({ className, value, placeholder, onValueChange, ...props }, ref) => {\n const [inputValue, setInputValue] = React.useState('')\n const inputRef = React.useRef<HTMLInputElement>(null)\n\n function handleChange(event: React.ChangeEvent<HTMLInputElement>) {\n const currentInputValue = event.target.value\n if (currentInputValue.includes(',')) {\n const currentValues = currentInputValue.split(',')\n //Remove duplicates\n const uniqueValues = Array.from(new Set(currentValues))\n\n onValueChange([\n ...(value || []),\n ...(uniqueValues\n .filter(inputValue => {\n //Remove empty values and already added values\n return Boolean(inputValue) && !value?.includes(inputValue)\n })\n .map(i => i.trim()) || [])\n ])\n setInputValue('')\n return\n }\n setInputValue(currentInputValue)\n }\n\n function handleKeyDown(event: React.KeyboardEvent<HTMLInputElement>) {\n if (['Enter', 'Tab'].includes(event.key)) {\n if (inputValue?.trim()) {\n event.preventDefault()\n if (!value?.includes(inputValue)) {\n addInputValue()\n }\n setInputValue('')\n }\n }\n\n if (event.key === 'Backspace' && !inputValue) {\n onValueChange(value?.slice(0, -1) || [])\n }\n }\n\n function addInputValue() {\n if (!inputValue.trim()) return\n onValueChange([...(value || []), inputValue])\n setInputValue('')\n }\n\n return (\n <div\n ref={ref}\n className={cn(\n 'flex flex-wrap items-center gap-8 min-h-[36px]',\n 'border rounded border-gray-900-24 bg-white px-12 py-[4px]',\n 'hover:cursor-text',\n 'hover:shadow-field-hover',\n 'active:shadow-field-active',\n 'focus-visible:outline-none focus:shadow-field-active',\n className\n )}\n onClick={() => inputRef.current?.focus()}\n {...props}\n >\n <TagList value={value} onValueChange={onValueChange} />\n <input\n ref={inputRef}\n className=\"h-[26px] outline-none text-sm\"\n type=\"text\"\n value={inputValue}\n onChange={handleChange}\n onKeyDown={handleKeyDown}\n style={{ width: `${inputValue.length + 1}ch` }}\n onBlur={() => addInputValue()}\n />\n {value?.length === 0 && !inputValue && (\n <div className=\"text-gray-700 ml-[-2ch]\">{placeholder}</div>\n )}\n </div>\n )\n }\n)\n\nTagInput.displayName = 'TagInput'\n\ntype TagListProps = React.HTMLAttributes<HTMLDivElement> & {\n value?: string[]\n onValueChange: (value: string[]) => void\n}\n\nfunction TagList({ value, onValueChange }: TagListProps) {\n return (\n <>\n {value?.map((tag, index) => (\n <Badge key={index} className=\"pl-0 gap-x-4 overflow-hidden\">\n <Button\n type=\"button\"\n className=\"w-[26px] h-[26px] flex-shrink-0\"\n size=\"icon\"\n intent=\"secondary\"\n onClick={() => {\n onValueChange(value?.filter((_, i) => i !== index) || [])\n }}\n >\n <LucideX className=\"w-16\" />\n </Button>\n <div className=\"truncate\">{tag}</div>\n </Badge>\n ))}\n </>\n )\n}\n\nexport { TagInput }\n"],"names":["TagInput","React","className","value","placeholder","onValueChange","props","ref","inputValue","setInputValue","inputRef","handleChange","event","currentInputValue","currentValues","uniqueValues","i","handleKeyDown","addInputValue","jsxs","cn","jsx","TagList","Fragment","tag","index","Badge","Button","_","LucideX"],"mappings":"mhBAYMA,EAAWC,EAAM,WACrB,CAAC,CAAE,UAAAC,EAAW,MAAAC,EAAO,YAAAC,EAAa,cAAAC,EAAe,GAAGC,CAAM,EAAGC,IAAQ,CACnE,KAAM,CAACC,EAAYC,CAAa,EAAIR,EAAM,SAAS,EAAE,EAC/CS,EAAWT,EAAM,OAAyB,IAAI,EAEpD,SAASU,EAAaC,EAA4C,CAC1D,MAAAC,EAAoBD,EAAM,OAAO,MACnC,GAAAC,EAAkB,SAAS,GAAG,EAAG,CAC7B,MAAAC,EAAgBD,EAAkB,MAAM,GAAG,EAE3CE,EAAe,MAAM,KAAK,IAAI,IAAID,CAAa,CAAC,EAExCT,EAAA,CACZ,GAAIF,GAAS,CAAC,EACd,GAAIY,EACD,OAAOP,GAEC,EAAQA,GAAe,CAACL,GAAO,SAASK,CAAU,CAC1D,EACA,IAAIQ,GAAKA,EAAE,KAAM,CAAA,GAAK,CAAC,CAAA,CAC3B,EACDP,EAAc,EAAE,EAChB,MACF,CACAA,EAAcI,CAAiB,CACjC,CAEA,SAASI,EAAcL,EAA8C,CAC/D,CAAC,QAAS,KAAK,EAAE,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QAAS,IAAM,CACCtB,EAAAF,GAAO,OAAO,CAACyB,EAAGZ,IAAMA,IAAMS,CAAK,GAAK,CAAA,CAAE,CAC1D,EAEA,SAAAJ,EAAAA,kBAAAA,IAACQ,EAAAA,QAAQ,CAAA,UAAU,MAAO,CAAA,CAAA,CAC5B,EACCR,EAAA,kBAAA,IAAA,MAAA,CAAI,UAAU,WAAY,SAAIG,EAAA,CAAA,GAZrBC,CAaZ,CACD,CACH,CAAA,CAEJ"}
|
package/dist/index.es15.js
CHANGED
|
@@ -2,25 +2,28 @@ import { j as e } from "./index.es42.js";
|
|
|
2
2
|
import { LucideX as v } from "lucide-react";
|
|
3
3
|
import f from "react";
|
|
4
4
|
import { Button as o } from "./index.es8.js";
|
|
5
|
-
import { Popover as
|
|
6
|
-
|
|
5
|
+
import { Popover as w, PopoverTrigger as C, PopoverContent as N } from "./index.es22.js";
|
|
6
|
+
import { cn as b } from "./index.es43.js";
|
|
7
|
+
function V({
|
|
7
8
|
children: m,
|
|
8
|
-
label:
|
|
9
|
+
label: p,
|
|
9
10
|
selectedLabel: a,
|
|
10
|
-
trigger:
|
|
11
|
+
trigger: d,
|
|
11
12
|
i18n: n,
|
|
12
13
|
value: t,
|
|
13
14
|
onOpenChange: u,
|
|
14
15
|
onApply: s,
|
|
15
16
|
...h
|
|
16
17
|
}) {
|
|
17
|
-
const [x, c] = f.useState(!1), [i, l] = f.useState(t || null), j = t ? a ? a(t) : t.toString() :
|
|
18
|
+
const [x, c] = f.useState(!1), [i, l] = f.useState(t || null), j = t ? a ? a(t) : t.toString() : p, g = /* @__PURE__ */ e.jsxs(
|
|
18
19
|
o,
|
|
19
20
|
{
|
|
20
21
|
variant: t ? "filled" : "outline",
|
|
21
22
|
intent: t ? "filter" : "secondary",
|
|
22
23
|
size: "sm",
|
|
23
|
-
className: "font-normal flex items-center whitespace-nowrap gap-x-4
|
|
24
|
+
className: b("font-normal flex items-center whitespace-nowrap gap-x-4", {
|
|
25
|
+
"pr-12": !!t
|
|
26
|
+
}),
|
|
24
27
|
children: [
|
|
25
28
|
j,
|
|
26
29
|
t && /* @__PURE__ */ e.jsx(
|
|
@@ -36,7 +39,7 @@ function S({
|
|
|
36
39
|
}
|
|
37
40
|
);
|
|
38
41
|
return /* @__PURE__ */ e.jsxs(
|
|
39
|
-
|
|
42
|
+
w,
|
|
40
43
|
{
|
|
41
44
|
open: x,
|
|
42
45
|
onOpenChange: (r) => {
|
|
@@ -44,41 +47,51 @@ function S({
|
|
|
44
47
|
},
|
|
45
48
|
...h,
|
|
46
49
|
children: [
|
|
47
|
-
/* @__PURE__ */ e.jsx(
|
|
48
|
-
/* @__PURE__ */ e.
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
50
|
+
/* @__PURE__ */ e.jsx(C, { asChild: !0, children: d || g }),
|
|
51
|
+
/* @__PURE__ */ e.jsx(N, { align: "start", className: "w-full", children: /* @__PURE__ */ e.jsxs(
|
|
52
|
+
"form",
|
|
53
|
+
{
|
|
54
|
+
onSubmit: (r) => {
|
|
55
|
+
r.preventDefault(), s?.(i || void 0), c(!1);
|
|
56
|
+
},
|
|
57
|
+
children: [
|
|
58
|
+
/* @__PURE__ */ e.jsx("div", { className: "p-8", children: m({
|
|
59
|
+
onFilterChange: l,
|
|
60
|
+
filterValue: i
|
|
61
|
+
}) }),
|
|
62
|
+
/* @__PURE__ */ e.jsxs("div", { className: "w-full flex justify-between mt-16", children: [
|
|
63
|
+
i && n.clear && /* @__PURE__ */ e.jsx(
|
|
64
|
+
o,
|
|
65
|
+
{
|
|
66
|
+
variant: "link",
|
|
67
|
+
intent: "secondary",
|
|
68
|
+
size: "fit-content",
|
|
69
|
+
type: "button",
|
|
70
|
+
onClick: () => {
|
|
71
|
+
l(null);
|
|
72
|
+
},
|
|
73
|
+
children: n.clear
|
|
74
|
+
}
|
|
75
|
+
),
|
|
76
|
+
n.apply && /* @__PURE__ */ e.jsx(
|
|
77
|
+
o,
|
|
78
|
+
{
|
|
79
|
+
className: "ml-auto",
|
|
80
|
+
variant: "link",
|
|
81
|
+
size: "fit-content",
|
|
82
|
+
type: "submit",
|
|
83
|
+
children: n.apply
|
|
84
|
+
}
|
|
85
|
+
)
|
|
86
|
+
] })
|
|
87
|
+
]
|
|
88
|
+
}
|
|
89
|
+
) })
|
|
77
90
|
]
|
|
78
91
|
}
|
|
79
92
|
);
|
|
80
93
|
}
|
|
81
94
|
export {
|
|
82
|
-
|
|
95
|
+
V as Filter
|
|
83
96
|
};
|
|
84
97
|
//# sourceMappingURL=index.es15.js.map
|
package/dist/index.es15.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es15.js","sources":["../src/Filter/index.tsx"],"sourcesContent":["import { LucideX } from 'lucide-react'\nimport React from 'react'\nimport { Button } from '../Button'\nimport { Popover, PopoverContent, PopoverTrigger } from '../Popover'\n\ntype FilterPropsBase<T> = {\n i18n: {\n apply?: string\n clear?: string\n }\n value?: T\n onOpenChange?: (open: boolean) => void\n onApply: (value?: T) => void\n children: (props: {\n onFilterChange: (value: T | null) => void\n filterValue: T | null\n }) => React.ReactNode\n}\n\ntype FilterPropsWithLabel<T> = FilterPropsBase<T> & {\n label: string\n selectedLabel?: (value: T) => React.ReactNode\n trigger?: never\n}\n\ntype FilterPropsWithTrigger<T> = FilterPropsBase<T> & {\n trigger: React.ReactNode\n label?: never\n selectedLabel?: never\n}\n\ntype FilterProps<T> = FilterPropsWithLabel<T> | FilterPropsWithTrigger<T>\n\nfunction Filter<T>({\n children,\n label,\n selectedLabel,\n trigger,\n i18n,\n value,\n onOpenChange,\n onApply,\n ...props\n}: FilterProps<T>) {\n const [isOpen, setIsOpen] = React.useState(false)\n const [localValue, setLocalValue] = React.useState<T | null>(value || null)\n\n const filterLabel = value\n ? selectedLabel\n ? selectedLabel(value)\n : value.toString()\n : label\n\n const defaultTrigger = (\n <Button\n variant={value ? 'filled' : 'outline'}\n intent={value ? 'filter' : 'secondary'}\n size=\"sm\"\n className
|
|
1
|
+
{"version":3,"file":"index.es15.js","sources":["../src/Filter/index.tsx"],"sourcesContent":["import { LucideX } from 'lucide-react'\nimport React from 'react'\nimport { Button } from '../Button'\nimport { Popover, PopoverContent, PopoverTrigger } from '../Popover'\nimport { cn } from '../lib/utils'\n\ntype FilterPropsBase<T> = {\n i18n: {\n apply?: string\n clear?: string\n }\n value?: T\n onOpenChange?: (open: boolean) => void\n onApply: (value?: T) => void\n children: (props: {\n onFilterChange: (value: T | null) => void\n filterValue: T | null\n }) => React.ReactNode\n}\n\ntype FilterPropsWithLabel<T> = FilterPropsBase<T> & {\n label: string\n selectedLabel?: (value: T) => React.ReactNode\n trigger?: never\n}\n\ntype FilterPropsWithTrigger<T> = FilterPropsBase<T> & {\n trigger: React.ReactNode\n label?: never\n selectedLabel?: never\n}\n\ntype FilterProps<T> = FilterPropsWithLabel<T> | FilterPropsWithTrigger<T>\n\nfunction Filter<T>({\n children,\n label,\n selectedLabel,\n trigger,\n i18n,\n value,\n onOpenChange,\n onApply,\n ...props\n}: FilterProps<T>) {\n const [isOpen, setIsOpen] = React.useState(false)\n const [localValue, setLocalValue] = React.useState<T | null>(value || null)\n\n const filterLabel = value\n ? selectedLabel\n ? selectedLabel(value)\n : value.toString()\n : label\n\n const defaultTrigger = (\n <Button\n variant={value ? 'filled' : 'outline'}\n intent={value ? 'filter' : 'secondary'}\n size=\"sm\"\n className={cn('font-normal flex items-center whitespace-nowrap gap-x-4', {\n 'pr-12': !!value\n })}\n >\n {filterLabel}\n {value && (\n <LucideX\n className=\"w-16 h-16 rounded hover:bg-purple-100 shrink-0\"\n onClick={e => {\n e.preventDefault()\n setLocalValue(null)\n onApply?.(undefined)\n }}\n />\n )}\n </Button>\n )\n\n return (\n <Popover\n open={isOpen}\n onOpenChange={open => {\n onOpenChange?.(open)\n if (!open) onApply?.(localValue || undefined)\n setIsOpen(open)\n }}\n {...props}\n >\n <PopoverTrigger asChild>{trigger || defaultTrigger}</PopoverTrigger>\n <PopoverContent align=\"start\" className=\"w-full\">\n <form\n onSubmit={event => {\n event.preventDefault()\n onApply?.(localValue || undefined)\n setIsOpen(false)\n }}\n >\n <div className=\"p-8\">\n {children({\n onFilterChange: setLocalValue,\n filterValue: localValue\n })}\n </div>\n <div className=\"w-full flex justify-between mt-16\">\n {localValue && i18n.clear && (\n <Button\n variant=\"link\"\n intent=\"secondary\"\n size=\"fit-content\"\n type=\"button\"\n onClick={() => {\n setLocalValue(null)\n }}\n >\n {i18n.clear}\n </Button>\n )}\n {i18n.apply && (\n <Button\n className=\"ml-auto\"\n variant=\"link\"\n size=\"fit-content\"\n type=\"submit\"\n >\n {i18n.apply}\n </Button>\n )}\n </div>\n </form>\n </PopoverContent>\n </Popover>\n )\n}\n\nexport { Filter }\nexport type { FilterProps }\n"],"names":["Filter","children","label","selectedLabel","trigger","i18n","value","onOpenChange","onApply","props","isOpen","setIsOpen","React","localValue","setLocalValue","filterLabel","defaultTrigger","jsxs","Button","cn","jsx","LucideX","e","Popover","open","PopoverTrigger","PopoverContent","event"],"mappings":";;;;;;AAkCA,SAASA,EAAU;AAAA,EACjB,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,eAAAC;AAAA,EACA,SAAAC;AAAA,EACA,MAAAC;AAAA,EACA,OAAAC;AAAA,EACA,cAAAC;AAAA,EACA,SAAAC;AAAA,EACA,GAAGC;AACL,GAAmB;AACjB,QAAM,CAACC,GAAQC,CAAS,IAAIC,EAAM,SAAS,EAAK,GAC1C,CAACC,GAAYC,CAAa,IAAIF,EA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AAA,gBAChB,aAAaD;AAAA,cACd,CAAA,GACH;AAAA,cACAI,gBAAAA,EAAAA,KAAC,OAAI,EAAA,WAAU,qCACZ,UAAA;AAAA,gBAAAJ,KAAcR,EAAK,SAClBe,gBAAAA,EAAA;AAAA,kBAACF;AAAA,kBAAA;AAAA,oBACC,SAAQ;AAAA,oBACR,QAAO;AAAA,oBACP,MAAK;AAAA,oBACL,MAAK;AAAA,oBACL,SAAS,MAAM;AACb,sBAAAJ,EAAc,IAAI;AAAA,oBACpB;AAAA,oBAEC,UAAKT,EAAA;AAAA,kBAAA;AAAA,gBACR;AAAA,gBAEDA,EAAK,SACJe,gBAAAA,EAAA;AAAA,kBAACF;AAAA,kBAAA;AAAA,oBACC,WAAU;AAAA,oBACV,SAAQ;AAAA,oBACR,MAAK;AAAA,oBACL,MAAK;AAAA,oBAEJ,UAAKb,EAAA;AAAA,kBAAA;AAAA,gBACR;AAAA,cAAA,GAEJ;AAAA,YAAA;AAAA,UAAA;AAAA,QAAA,GAEJ;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
package/dist/index.es32.js
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
import { j as e } from "./index.es42.js";
|
|
2
|
-
import { LucideX as
|
|
2
|
+
import { LucideX as g } from "lucide-react";
|
|
3
3
|
import * as f from "react";
|
|
4
4
|
import { Badge as j } from "./index.es7.js";
|
|
5
5
|
import { Button as N } from "./index.es8.js";
|
|
6
|
-
import { cn as
|
|
7
|
-
const
|
|
8
|
-
({ className: s, value: t, placeholder: a, onValueChange:
|
|
9
|
-
const [
|
|
6
|
+
import { cn as b } from "./index.es43.js";
|
|
7
|
+
const k = f.forwardRef(
|
|
8
|
+
({ className: s, value: t, placeholder: a, onValueChange: r, ...d }, l) => {
|
|
9
|
+
const [n, o] = f.useState(""), p = f.useRef(null);
|
|
10
10
|
function x(i) {
|
|
11
11
|
const u = i.target.value;
|
|
12
12
|
if (u.includes(",")) {
|
|
13
|
-
const w = u.split(","),
|
|
14
|
-
|
|
13
|
+
const w = u.split(","), y = Array.from(new Set(w));
|
|
14
|
+
r([
|
|
15
15
|
...t || [],
|
|
16
|
-
...
|
|
16
|
+
...y.filter((c) => !!c && !t?.includes(c)).map((c) => c.trim()) || []
|
|
17
17
|
]), o("");
|
|
18
18
|
return;
|
|
19
19
|
}
|
|
20
20
|
o(u);
|
|
21
21
|
}
|
|
22
22
|
function h(i) {
|
|
23
|
-
["Enter", "Tab"].includes(i.key) &&
|
|
23
|
+
["Enter", "Tab"].includes(i.key) && n?.trim() && (i.preventDefault(), t?.includes(n) || m(), o("")), i.key === "Backspace" && !n && r(t?.slice(0, -1) || []);
|
|
24
24
|
}
|
|
25
25
|
function m() {
|
|
26
|
-
|
|
26
|
+
n.trim() && (r([...t || [], n]), o(""));
|
|
27
27
|
}
|
|
28
28
|
return /* @__PURE__ */ e.jsxs(
|
|
29
29
|
"div",
|
|
30
30
|
{
|
|
31
31
|
ref: l,
|
|
32
|
-
className:
|
|
32
|
+
className: b(
|
|
33
33
|
"flex flex-wrap items-center gap-8 min-h-[36px]",
|
|
34
34
|
"border rounded border-gray-900-24 bg-white px-12 py-[4px]",
|
|
35
35
|
"hover:cursor-text",
|
|
@@ -41,45 +41,46 @@ const b = f.forwardRef(
|
|
|
41
41
|
onClick: () => p.current?.focus(),
|
|
42
42
|
...d,
|
|
43
43
|
children: [
|
|
44
|
-
/* @__PURE__ */ e.jsx(v, { value: t, onValueChange:
|
|
44
|
+
/* @__PURE__ */ e.jsx(v, { value: t, onValueChange: r }),
|
|
45
45
|
/* @__PURE__ */ e.jsx(
|
|
46
46
|
"input",
|
|
47
47
|
{
|
|
48
48
|
ref: p,
|
|
49
49
|
className: "h-[26px] outline-none text-sm",
|
|
50
50
|
type: "text",
|
|
51
|
-
value:
|
|
51
|
+
value: n,
|
|
52
52
|
onChange: x,
|
|
53
53
|
onKeyDown: h,
|
|
54
|
-
style: { width: `${
|
|
54
|
+
style: { width: `${n.length + 1}ch` },
|
|
55
55
|
onBlur: () => m()
|
|
56
56
|
}
|
|
57
57
|
),
|
|
58
|
-
t?.length === 0 && !
|
|
58
|
+
t?.length === 0 && !n && /* @__PURE__ */ e.jsx("div", { className: "text-gray-700 ml-[-2ch]", children: a })
|
|
59
59
|
]
|
|
60
60
|
}
|
|
61
61
|
);
|
|
62
62
|
}
|
|
63
63
|
);
|
|
64
|
-
|
|
64
|
+
k.displayName = "TagInput";
|
|
65
65
|
function v({ value: s, onValueChange: t }) {
|
|
66
|
-
return /* @__PURE__ */ e.jsx(e.Fragment, { children: s?.map((a,
|
|
66
|
+
return /* @__PURE__ */ e.jsx(e.Fragment, { children: s?.map((a, r) => /* @__PURE__ */ e.jsxs(j, { className: "pl-0 gap-x-4 overflow-hidden", children: [
|
|
67
67
|
/* @__PURE__ */ e.jsx(
|
|
68
68
|
N,
|
|
69
69
|
{
|
|
70
|
+
type: "button",
|
|
70
71
|
className: "w-[26px] h-[26px] flex-shrink-0",
|
|
71
72
|
size: "icon",
|
|
72
73
|
intent: "secondary",
|
|
73
74
|
onClick: () => {
|
|
74
|
-
t(s?.filter((d, l) => l !==
|
|
75
|
+
t(s?.filter((d, l) => l !== r) || []);
|
|
75
76
|
},
|
|
76
|
-
children: /* @__PURE__ */ e.jsx(
|
|
77
|
+
children: /* @__PURE__ */ e.jsx(g, { className: "w-16" })
|
|
77
78
|
}
|
|
78
79
|
),
|
|
79
80
|
/* @__PURE__ */ e.jsx("div", { className: "truncate", children: a })
|
|
80
|
-
] },
|
|
81
|
+
] }, r)) });
|
|
81
82
|
}
|
|
82
83
|
export {
|
|
83
|
-
|
|
84
|
+
k as TagInput
|
|
84
85
|
};
|
|
85
86
|
//# sourceMappingURL=index.es32.js.map
|
package/dist/index.es32.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es32.js","sources":["../src/TagInput/index.tsx"],"sourcesContent":["import { LucideX } from 'lucide-react'\nimport * as React from 'react'\nimport { Badge } from '../Badge'\nimport { Button } from '../Button'\nimport { cn } from '../lib/utils'\n\nexport type TagInputProps = React.HTMLAttributes<HTMLInputElement> & {\n value?: string[]\n onValueChange: (value: string[]) => void\n placeholder?: string\n}\n\nconst TagInput = React.forwardRef<HTMLInputElement, TagInputProps>(\n ({ className, value, placeholder, onValueChange, ...props }, ref) => {\n const [inputValue, setInputValue] = React.useState('')\n const inputRef = React.useRef<HTMLInputElement>(null)\n\n function handleChange(event: React.ChangeEvent<HTMLInputElement>) {\n const currentInputValue = event.target.value\n if (currentInputValue.includes(',')) {\n const currentValues = currentInputValue.split(',')\n //Remove duplicates\n const uniqueValues = Array.from(new Set(currentValues))\n\n onValueChange([\n ...(value || []),\n ...(uniqueValues\n .filter(inputValue => {\n //Remove empty values and already added values\n return Boolean(inputValue) && !value?.includes(inputValue)\n })\n .map(i => i.trim()) || [])\n ])\n setInputValue('')\n return\n }\n setInputValue(currentInputValue)\n }\n\n function handleKeyDown(event: React.KeyboardEvent<HTMLInputElement>) {\n if (['Enter', 'Tab'].includes(event.key)) {\n if (inputValue?.trim()) {\n event.preventDefault()\n if (!value?.includes(inputValue)) {\n addInputValue()\n }\n setInputValue('')\n }\n }\n\n if (event.key === 'Backspace' && !inputValue) {\n onValueChange(value?.slice(0, -1) || [])\n }\n }\n\n function addInputValue() {\n if (!inputValue.trim()) return\n onValueChange([...(value || []), inputValue])\n setInputValue('')\n }\n\n return (\n <div\n ref={ref}\n className={cn(\n 'flex flex-wrap items-center gap-8 min-h-[36px]',\n 'border rounded border-gray-900-24 bg-white px-12 py-[4px]',\n 'hover:cursor-text',\n 'hover:shadow-field-hover',\n 'active:shadow-field-active',\n 'focus-visible:outline-none focus:shadow-field-active',\n className\n )}\n onClick={() => inputRef.current?.focus()}\n {...props}\n >\n <TagList value={value} onValueChange={onValueChange} />\n <input\n ref={inputRef}\n className=\"h-[26px] outline-none text-sm\"\n type=\"text\"\n value={inputValue}\n onChange={handleChange}\n onKeyDown={handleKeyDown}\n style={{ width: `${inputValue.length + 1}ch` }}\n onBlur={() => addInputValue()}\n />\n {value?.length === 0 && !inputValue && (\n <div className=\"text-gray-700 ml-[-2ch]\">{placeholder}</div>\n )}\n </div>\n )\n }\n)\n\nTagInput.displayName = 'TagInput'\n\ntype TagListProps = React.HTMLAttributes<HTMLDivElement> & {\n value?: string[]\n onValueChange: (value: string[]) => void\n}\n\nfunction TagList({ value, onValueChange }: TagListProps) {\n return (\n <>\n {value?.map((tag, index) => (\n <Badge key={index} className=\"pl-0 gap-x-4 overflow-hidden\">\n <Button\n className=\"w-[26px] h-[26px] flex-shrink-0\"\n size=\"icon\"\n intent=\"secondary\"\n onClick={() => {\n onValueChange(value?.filter((_, i) => i !== index) || [])\n }}\n >\n <LucideX className=\"w-16\" />\n </Button>\n <div className=\"truncate\">{tag}</div>\n </Badge>\n ))}\n </>\n )\n}\n\nexport { TagInput }\n"],"names":["TagInput","React","className","value","placeholder","onValueChange","props","ref","inputValue","setInputValue","inputRef","handleChange","event","currentInputValue","currentValues","uniqueValues","i","handleKeyDown","addInputValue","jsxs","cn","jsx","TagList","Fragment","tag","index","Badge","Button","_","LucideX"],"mappings":";;;;;;AAYA,MAAMA,IAAWC,EAAM;AAAA,EACrB,CAAC,EAAE,WAAAC,GAAW,OAAAC,GAAO,aAAAC,GAAa,eAAAC,GAAe,GAAGC,EAAM,GAAGC,MAAQ;AACnE,UAAM,CAACC,GAAYC,CAAa,IAAIR,EAAM,SAAS,EAAE,GAC/CS,IAAWT,EAAM,OAAyB,IAAI;AAEpD,aAASU,EAAaC,GAA4C;AAC1D,YAAAC,IAAoBD,EAAM,OAAO;AACnC,UAAAC,EAAkB,SAAS,GAAG,GAAG;AAC7B,cAAAC,IAAgBD,EAAkB,MAAM,GAAG,GAE3CE,IAAe,MAAM,KAAK,IAAI,IAAID,CAAa,CAAC;AAExC,QAAAT,EAAA;AAAA,UACZ,GAAIF,KAAS,CAAC;AAAA,UACd,GAAIY,EACD,OAAO,CAAAP,MAEC,EAAQA,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AW,KAAK,CAACK,KACtBa,gBAAAA,EAAA,IAAA,OAAA,EAAI,WAAU,2BAA2B,UAAYjB,EAAA,CAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAI9D;AACF;AAEAJ,EAAS,cAAc;AAOvB,SAASsB,EAAQ,EAAE,OAAAnB,GAAO,eAAAE,KAA+B;AAErD,SAAAgB,gBAAAA,EAAA,IAAAE,EAAA,UAAA,EACG,aAAO,IAAI,CAACC,GAAKC,MAChBN,gBAAAA,EAAA,KAACO,GAAkB,EAAA,WAAU,gCAC3B,UAAA;AAAA,IAAAL,gBAAAA,EAAA;AAAA,MAACM;AAAA,MAAA;AAAA,QACC,WAAU;AAAA,QACV,MAAK;AAAA,QACL,QAAO;AAAA,QACP,SAAS,MAAM;AACC,UAAAtB,EAAAF,GAAO,OAAO,CAACyB,GAAGZ,MAAMA,MAAMS,CAAK,KAAK,CAAA,CAAE;AAAA,QAC1D;AAAA,QAEA,UAAAJ,gBAAAA,EAAAA,IAACQ,GAAQ,EAAA,WAAU,OAAO,CAAA;AAAA,MAAA;AAAA,IAC5B;AAAA,IACCR,gBAAAA,EAAA,IAAA,OAAA,EAAI,WAAU,YAAY,UAAIG,GAAA;AAAA,EAAA,
|
|
1
|
+
{"version":3,"file":"index.es32.js","sources":["../src/TagInput/index.tsx"],"sourcesContent":["import { LucideX } from 'lucide-react'\nimport * as React from 'react'\nimport { Badge } from '../Badge'\nimport { Button } from '../Button'\nimport { cn } from '../lib/utils'\n\nexport type TagInputProps = React.HTMLAttributes<HTMLInputElement> & {\n value?: string[]\n onValueChange: (value: string[]) => void\n placeholder?: string\n}\n\nconst TagInput = React.forwardRef<HTMLInputElement, TagInputProps>(\n ({ className, value, placeholder, onValueChange, ...props }, ref) => {\n const [inputValue, setInputValue] = React.useState('')\n const inputRef = React.useRef<HTMLInputElement>(null)\n\n function handleChange(event: React.ChangeEvent<HTMLInputElement>) {\n const currentInputValue = event.target.value\n if (currentInputValue.includes(',')) {\n const currentValues = currentInputValue.split(',')\n //Remove duplicates\n const uniqueValues = Array.from(new Set(currentValues))\n\n onValueChange([\n ...(value || []),\n ...(uniqueValues\n .filter(inputValue => {\n //Remove empty values and already added values\n return Boolean(inputValue) && !value?.includes(inputValue)\n })\n .map(i => i.trim()) || [])\n ])\n setInputValue('')\n return\n }\n setInputValue(currentInputValue)\n }\n\n function handleKeyDown(event: React.KeyboardEvent<HTMLInputElement>) {\n if (['Enter', 'Tab'].includes(event.key)) {\n if (inputValue?.trim()) {\n event.preventDefault()\n if (!value?.includes(inputValue)) {\n addInputValue()\n }\n setInputValue('')\n }\n }\n\n if (event.key === 'Backspace' && !inputValue) {\n onValueChange(value?.slice(0, -1) || [])\n }\n }\n\n function addInputValue() {\n if (!inputValue.trim()) return\n onValueChange([...(value || []), inputValue])\n setInputValue('')\n }\n\n return (\n <div\n ref={ref}\n className={cn(\n 'flex flex-wrap items-center gap-8 min-h-[36px]',\n 'border rounded border-gray-900-24 bg-white px-12 py-[4px]',\n 'hover:cursor-text',\n 'hover:shadow-field-hover',\n 'active:shadow-field-active',\n 'focus-visible:outline-none focus:shadow-field-active',\n className\n )}\n onClick={() => inputRef.current?.focus()}\n {...props}\n >\n <TagList value={value} onValueChange={onValueChange} />\n <input\n ref={inputRef}\n className=\"h-[26px] outline-none text-sm\"\n type=\"text\"\n value={inputValue}\n onChange={handleChange}\n onKeyDown={handleKeyDown}\n style={{ width: `${inputValue.length + 1}ch` }}\n onBlur={() => addInputValue()}\n />\n {value?.length === 0 && !inputValue && (\n <div className=\"text-gray-700 ml-[-2ch]\">{placeholder}</div>\n )}\n </div>\n )\n }\n)\n\nTagInput.displayName = 'TagInput'\n\ntype TagListProps = React.HTMLAttributes<HTMLDivElement> & {\n value?: string[]\n onValueChange: (value: string[]) => void\n}\n\nfunction TagList({ value, onValueChange }: TagListProps) {\n return (\n <>\n {value?.map((tag, index) => (\n <Badge key={index} className=\"pl-0 gap-x-4 overflow-hidden\">\n <Button\n type=\"button\"\n className=\"w-[26px] h-[26px] flex-shrink-0\"\n size=\"icon\"\n intent=\"secondary\"\n onClick={() => {\n onValueChange(value?.filter((_, i) => i !== index) || [])\n }}\n >\n <LucideX className=\"w-16\" />\n </Button>\n <div className=\"truncate\">{tag}</div>\n </Badge>\n ))}\n </>\n )\n}\n\nexport { TagInput }\n"],"names":["TagInput","React","className","value","placeholder","onValueChange","props","ref","inputValue","setInputValue","inputRef","handleChange","event","currentInputValue","currentValues","uniqueValues","i","handleKeyDown","addInputValue","jsxs","cn","jsx","TagList","Fragment","tag","index","Badge","Button","_","LucideX"],"mappings":";;;;;;AAYA,MAAMA,IAAWC,EAAM;AAAA,EACrB,CAAC,EAAE,WAAAC,GAAW,OAAAC,GAAO,aAAAC,GAAa,eAAAC,GAAe,GAAGC,EAAM,GAAGC,MAAQ;AACnE,UAAM,CAACC,GAAYC,CAAa,IAAIR,EAAM,SAAS,EAAE,GAC/CS,IAAWT,EAAM,OAAyB,IAAI;AAEpD,aAASU,EAAaC,GAA4C;AAC1D,YAAAC,IAAoBD,EAAM,OAAO;AACnC,UAAAC,EAAkB,SAAS,GAAG,GAAG;AAC7B,cAAAC,IAAgBD,EAAkB,MAAM,GAAG,GAE3CE,IAAe,MAAM,KAAK,IAAI,IAAID,CAAa,CAAC;AAExC,QAAAT,EAAA;AAAA,UACZ,GAAIF,KAAS,CAAC;AAAA,UACd,GAAIY,EACD,OAAO,CAAAP,MAEC,EAAQA,KAAe,CAACL,GAAO,SAASK,CAAU,CAC1D,EACA,IAAI,CAAAQ,MAAKA,EAAE,KAAM,CAAA,KAAK,CAAC;AAAA,QAAA,CAC3B,GACDP,EAAc,EAAE;AAChB;AAAA,MACF;AACA,MAAAA,EAAcI,CAAiB;AAAA,IACjC;AAEA,aAASI,EAAcL,GAA8C;AACnE,MAAI,CAAC,SAAS,KAAK,EAAE,SAASA,EAAM,GAAG,KACjCJ,GAAY,WACdI,EAAM,eAAe,GAChBT,GAAO,SAASK,CAAU,KACfU,KAEhBT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