@deckai/deck-ui 0.0.12 → 0.0.13
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/README.md +127 -1
- package/dist/components/AboutCard.cjs +2 -2
- package/dist/components/AboutCard.cjs.map +1 -1
- package/dist/components/AboutCard.js +2 -2
- package/dist/components/AboutCard.js.map +1 -1
- package/dist/components/Breadcrumbs.cjs +1 -1
- package/dist/components/Breadcrumbs.cjs.map +1 -1
- package/dist/components/Breadcrumbs.js +1 -1
- package/dist/components/Breadcrumbs.js.map +1 -1
- package/dist/components/Combobox.cjs +1 -1
- package/dist/components/Combobox.cjs.map +1 -1
- package/dist/components/Combobox.d.cts +7 -1
- package/dist/components/Combobox.d.ts +7 -1
- package/dist/components/Combobox.js +1 -1
- package/dist/components/Combobox.js.map +1 -1
- package/dist/components/ContactItem.cjs +1 -1
- package/dist/components/ContactItem.cjs.map +1 -1
- package/dist/components/ContactItem.js +1 -1
- package/dist/components/ContactItem.js.map +1 -1
- package/dist/components/Icon.d.cts +1 -1
- package/dist/components/Icon.d.ts +1 -1
- package/dist/components/Input.cjs +1 -1
- package/dist/components/Input.cjs.map +1 -1
- package/dist/components/Input.d.cts +6 -2
- package/dist/components/Input.d.ts +6 -2
- package/dist/components/Input.js +1 -1
- package/dist/components/Input.js.map +1 -1
- package/dist/components/Link.cjs +1 -1
- package/dist/components/Link.cjs.map +1 -1
- package/dist/components/Link.d.cts +1 -1
- package/dist/components/Link.d.ts +1 -1
- package/dist/components/Link.js +1 -1
- package/dist/components/Link.js.map +1 -1
- package/dist/components/MultiSelectCombobox.cjs +2 -0
- package/dist/components/MultiSelectCombobox.cjs.map +1 -0
- package/dist/components/MultiSelectCombobox.d.cts +21 -0
- package/dist/components/MultiSelectCombobox.d.ts +21 -0
- package/dist/components/MultiSelectCombobox.js +2 -0
- package/dist/components/MultiSelectCombobox.js.map +1 -0
- package/dist/components/Navbar.cjs +2 -2
- package/dist/components/Navbar.cjs.map +1 -1
- package/dist/components/Navbar.d.cts +1 -1
- package/dist/components/Navbar.d.ts +1 -1
- package/dist/components/Navbar.js +2 -2
- package/dist/components/Navbar.js.map +1 -1
- package/dist/components/NavbarItem.d.cts +1 -1
- package/dist/components/NavbarItem.d.ts +1 -1
- package/dist/components/ProfileCard.cjs +2 -2
- package/dist/components/ProfileCard.cjs.map +1 -1
- package/dist/components/ProfileCard.js +2 -2
- package/dist/components/ProfileCard.js.map +1 -1
- package/dist/components/Sidebar.cjs +2 -0
- package/dist/components/Sidebar.cjs.map +1 -0
- package/dist/components/Sidebar.d.cts +37 -0
- package/dist/components/Sidebar.d.ts +37 -0
- package/dist/components/Sidebar.js +2 -0
- package/dist/components/Sidebar.js.map +1 -0
- package/dist/components/Tag.cjs +1 -1
- package/dist/components/Tag.cjs.map +1 -1
- package/dist/components/Tag.d.cts +2 -1
- package/dist/components/Tag.d.ts +2 -1
- package/dist/components/Tag.js +1 -1
- package/dist/components/Tag.js.map +1 -1
- package/dist/components/Text.d.cts +2 -2
- package/dist/components/Text.d.ts +2 -2
- package/dist/components/TextArea.cjs +2 -0
- package/dist/components/TextArea.cjs.map +1 -0
- package/dist/components/TextArea.d.cts +19 -0
- package/dist/components/TextArea.d.ts +19 -0
- package/dist/components/TextArea.js +2 -0
- package/dist/components/TextArea.js.map +1 -0
- package/dist/components/WorkCard.cjs +1 -1
- package/dist/components/WorkCard.cjs.map +1 -1
- package/dist/components/WorkCard.js +1 -1
- package/dist/components/WorkCard.js.map +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +78 -23
- package/dist/index.d.ts +78 -23
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/styles/styles.css +1 -1
- package/dist/{tailwind-BKauZ5Yx.d.cts → tailwind-CIZ10fKA.d.cts} +1 -0
- package/dist/{tailwind-BKauZ5Yx.d.ts → tailwind-CIZ10fKA.d.ts} +1 -0
- package/package.json +3 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var p=require('react'),g=require('@radix-ui/react-popover'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),icons=require('@deckai/icons');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var p__namespace=/*#__PURE__*/_interopNamespace(p);var g__namespace=/*#__PURE__*/_interopNamespace(g);var P="focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",R="ring-2 ring-ring ring-offset-2";function u(...t){return tailwindMerge.twMerge(clsx.clsx(t))}var w={primary:"#080808",secondary:"#666666",white:"#ffffff",primaryBlue:"#089CCB"},X={sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},Y=t=>{if(!t)return {width:"24px",height:"24px"};let r=Array.isArray(t)?t:[t],e={},o;return r.forEach(n=>{if(typeof n=="number")o=`${n}px`;else {let[s,i]=n.split(":"),d=parseInt(i,10);e[`@media (min-width: ${X[s]})`]=`${d}px`;}}),{width:o||"24px",height:o||"24px",...Object.entries(e).reduce((n,[s,i])=>({...n,[s]:{width:i,height:i}}),{})}},b=p__namespace.default.forwardRef(({name:t,size:r=24,color:e="primary",title:o,className:n,style:s={},...i},d)=>{let l=icons.IconMap[t],a=Y(r);return p__namespace.default.createElement("div",{className:u("flex justify-center items-center",n),style:{...a,"--icon-stroke":w[e],...s}},p__namespace.default.createElement(l,{ref:d,"aria-hidden":!o,"aria-label":o,stroke:t.includes("filled")?void 0:w[e],...i}))});b.displayName="Icon";var I=({className:t,end:r,iconName:e,color:o,size:n,title:s,label:i,labelClassName:d,id:l,...a})=>p__namespace.createElement("div",{className:"space-y-2"},i&&p__namespace.createElement("label",{htmlFor:l,className:u("block text-sm font-medium text-text-primary",d)},i),p__namespace.createElement("div",{className:"relative"},p__namespace.createElement("input",{id:l,className:u(`font-sans lg:text-body-default text-xs flex w-full rounded-lg border border-secondary-50 bg-background-0 px-3 md:py-3 py-2 text-secondary ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-secondary text-text-primary ${P} disabled:cursor-not-allowed disabled:opacity-50 md:text-md`,r&&"pr-10",t),...a}),r&&p__namespace.createElement("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3"},e?p__namespace.createElement(b,{name:e,color:o,size:n,title:s}):r)));var O=({value:t,label:r,onChange:e,selected:o})=>p__namespace.default.createElement("button",{type:"button",className:u("relative w-full h-full text-left px-2 py-1.5 text-sm cursor-pointer hover:bg-gray-100 rounded",o&&"bg-gray-100"),onClick:()=>{e?.(t);}},r);var ee={xl:"h1",lg:"h1",md:"h2",sm:"h3",xs:"h4"},te=t=>{let[r,e]=t.split("-");return r==="heading"?ee[e]||"p":r==="label"?"label":"p"},re={light:"font-light",regular:"font-regular",semibold:"font-semibold",bold:"font-bold"},oe=t=>t?(Array.isArray(t)?t:[t]).map(e=>{if(e.includes(":")){let[o,n]=e.split(":");return `${o}:text-${n}`}return `text-${e}`}).join(" "):"text-body-default",v=p__namespace.default.forwardRef(({variant:t="body-default",color:r="text-primary",as:e,className:o,children:n,weight:s,...i},d)=>{let l=oe(t),a=r&&r==="inherit"?"inherit":r?`text-${r}`:"",y=p__namespace.default.useMemo(()=>{let c=typeof t=="string"?t.split(":").pop():Array.isArray(t)?t[0].split(":").pop():"body-default";return te(c)},[t]);return p__namespace.default.createElement(e||y,{ref:d,className:`font-sans antialiased ${l} ${a} ${s?`!${re[s]}`:""} ${o??""}`,...i},n)});v.displayName="Text";var k=({children:t,type:r="button",className:e,disabled:o,...n})=>p__namespace.default.createElement("button",{type:r,disabled:o,className:`appearance-none hover:opacity-80 transition-all active:scale-95 ${P} ${e} ${o?"opacity-50 cursor-not-allowed":""}`,...n},t);var j=({children:t,color:r="primary",className:e,onClose:o,...n})=>{let[s,i]=p.useState(!1),d=p.useCallback(()=>{i(!0);},[]),l=p.useCallback(()=>{i(!1);},[]),a=p__namespace.default.createElement("div",{className:u("flex gap-2",o?"justify-between items-center":"items-center justify-center","hover:bg-primary-100 rounded bg-secondary-400 px-2 py-1 sm:px-3 sm:py-1.5 h-min hover:text-white",r==="primary"?"text-primary-100":"text-primary",e),onMouseEnter:d,onMouseLeave:l},typeof t=="string"?p__namespace.default.createElement(v,{color:"inherit",variant:["md:body-default-medium","body-xxs-medium"],className:"truncate pt-0.5"},t):t,o&&p__namespace.default.createElement(k,{...n,onClick:o,className:"flex items-center justify-center"},p__namespace.default.createElement(b,{name:"close",size:10,color:s?"white":"primaryBlue"})));return o?a:p__namespace.default.createElement(k,{...n},a)};var B=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,z=clsx.clsx,K=(t,r)=>e=>{var o;if(r?.variants==null)return z(t,e?.class,e?.className);let{variants:n,defaultVariants:s}=r,i=Object.keys(n).map(a=>{let y=e?.[a],f=s?.[a];if(y===null)return null;let c=B(y)||B(f);return n[a][c]}),d=e&&Object.entries(e).reduce((a,y)=>{let[f,c]=y;return c===void 0||(a[f]=c),a},{}),l=r==null||(o=r.compoundVariants)===null||o===void 0?void 0:o.reduce((a,y)=>{let{class:f,className:c,...L}=y;return Object.entries(L).every(C=>{let[x,T]=C;return Array.isArray(T)?T.includes({...s,...d}[x]):{...s,...d}[x]===T})?[...a,f,c]:a},[]);return z(t,i,l,e?.class,e?.className)};var ie=K("animate-spin rounded-full border-current border-t-transparent",{variants:{size:{sm:"h-4 w-4 border-4",md:"h-6 w-6 border-4",lg:"h-8 w-8 border-8"}},defaultVariants:{size:"md"}}),A=p__namespace.forwardRef(({size:t,className:r,customSize:e,...o},n)=>{let s=e?{width:e,height:e,borderWidth:Math.max(2,Math.floor(e/16))}:{};return p__namespace.createElement("div",{role:"status","aria-label":"Loading",ref:n,className:u(ie({size:t}),"text-primary-100",r),style:s,...o},p__namespace.createElement("span",{className:"sr-only"},"Loading..."))});A.displayName="Spinner";var et=({options:t,selectedValues:r,onSelectionChange:e,placeholder:o="Select items...",className:n,label:s,labelClassName:i,id:d,maxSelections:l,disabled:a,noOptionsMessage:y,loading:f,errorMessage:c})=>{let[L,C]=p.useState(!1),[x,T]=p.useState(""),F=p.useMemo(()=>t.filter(m=>r.includes(m.value)),[t,r]),S=p.useMemo(()=>t.filter(m=>!r.includes(m.value)&&m.label.toLowerCase().includes(x.toLowerCase())),[t,r,x]),q=p.useCallback(m=>{e([...r,m]),T(""),C(!1);},[l,e,r]),D=p.useCallback(m=>{e(r.filter(E=>E!==m));},[e,r]);return p__namespace.default.createElement("div",{className:"py-2"},p__namespace.default.createElement(g__namespace.Root,{open:L,onOpenChange:C},p__namespace.default.createElement("div",{className:`relative w-full font-sans text-text-secondary ${n}`},p__namespace.default.createElement(g__namespace.Trigger,{asChild:!0},p__namespace.default.createElement("div",{className:"relative flex-1"},p__namespace.default.createElement(I,{id:d,label:s,labelClassName:i,placeholder:l&&r.length>=l?`Maximum ${l} items selected`:o,value:x,onChange:m=>T(m.target.value),className:`flex-1 ${L&&R}`,disabled:a||!!l&&r.length>=l,end:f?p__namespace.default.createElement(A,{size:"sm"}):p__namespace.default.createElement(b,{name:"search-normal",size:["lg:24",18]})}))),p__namespace.default.createElement(g__namespace.Portal,null,p__namespace.default.createElement(g__namespace.Content,{className:"w-[--radix-popover-trigger-width] p-1 bg-white rounded-md shadow-lg border z-20",sideOffset:5},p__namespace.default.createElement("div",{className:"max-h-60 overflow-auto flex flex-col items-start"},S.length>0?S.map(({label:m,value:E})=>p__namespace.default.createElement(O,{key:E,label:m,value:E,onChange:q})):p__namespace.default.createElement(v,{variant:"label-default",className:"text-text-secondary"},y||"No results found")))))),p__namespace.default.createElement("div",{className:"flex flex-col gap-1 pt-2"},c&&p__namespace.default.createElement(v,{variant:"label-default",color:"tertiary-20"},c),p__namespace.default.createElement("div",{className:"flex flex-wrap gap-2"},F.map(m=>p__namespace.default.createElement(j,{key:m.value,onClose:()=>D(m.value)},m.label)))))};if (exports.default) module.exports = exports.default;exports.MultiSelectCombobox=et;//# sourceMappingURL=MultiSelectCombobox.cjs.map
|
|
2
|
+
//# sourceMappingURL=MultiSelectCombobox.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utils/tailwind.ts","../../src/utils/index.ts","../../src/components/Icon.tsx","../../src/components/Input.tsx","../../src/components/Option.tsx","../../src/components/Tag.tsx","../../src/components/Text.tsx","../../src/components/Pressable.tsx","../../../../node_modules/class-variance-authority/dist/index.mjs","../../src/components/Spinner.tsx","../../src/components/MultiSelectCombobox.tsx"],"names":["focusRingStyles","focusRingStylesCoerced","cn","inputs","twMerge","clsx","COLOR_MAP","BREAKPOINT_MAP","processSizes","sizes","sizeArray","mediaQueries","baseSize","size","breakpoint","valueStr","value","acc","query","Icon","React","name","color","title","className","style","props","ref","IconComponent","IconMap","sizeStyles","Input","end","iconName","label","labelClassName","id","h","Option","onChange","selected","HEADING_ELEMENT_MAP","getElementFromVariant","variant","category","fontWeight","processVariants","variants","typographyClass","Text","as","children","weight","typographyClasses","colorClasses","suggestedElement","baseVariant","Pressable","type","disabled","Tag","onClose","pressableProps","isHovered","setIsHovered","useState","handleMouseEnter","useCallback","handleMouseLeave","content","falsyToString","cx","cva","base","config","_config_compoundVariants","defaultVariants","getVariantClassNames","variantProp","defaultVariantProp","variantKey","propsWithoutUndefined","param","key","getCompoundVariantClassNames","cvClass","cvClassName","compoundVariantOptions","spinnerVariants","Spinner","H","customSize","styles","MultiSelectCombobox","options","selectedValues","onSelectionChange","placeholder","maxSelections","noOptionsMessage","loading","errorMessage","open","setOpen","inputValue","setInputValue","selectedOptions","useMemo","option","filteredOptions","handleOptionSelect","handleRemoveTag","valueToRemove","g","e"],"mappings":"8jBAmEO,IAAMA,CAAAA,CACX,sGAEWC,CAAyB,CAAA,gCAAA,CCnE/B,SAASC,CAAMC,CAAAA,GAAAA,CAAAA,CAAsB,CAC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,CACD,CACH,CACF,CACF,CAEJ","file":"MultiSelectCombobox.cjs","sourcesContent":["import { Colors, Typography } from \"../types/tailwind\";\n\n// Generate safelist patterns for all color utilities so you can use any theme color variable in your code\nexport const generateSafelist = (colors: Colors, typography: Typography) => {\n const colorNames = Object.keys(colors) as (keyof Colors)[];\n const utilities = [\"bg\", \"text\", \"border\", \"ring\", \"divide\", \"outline\"];\n const variants = [\"hover:\", \"focus:\", \"active:\", \"disabled:\"];\n\n const safelist: string[] = [];\n\n colorNames.forEach((colorName) => {\n if (typeof colors[colorName] === \"object\") {\n // Handle nested color objects (with number keys)\n Object.keys(colors[colorName]).forEach((shade) => {\n utilities.forEach((utility) => {\n // Base utility\n safelist.push(`${utility}-${colorName}-${shade}`);\n\n // Variant utilities\n variants.forEach((variant) => {\n safelist.push(`${variant}${utility}-${colorName}-${shade}`);\n });\n });\n });\n } else {\n // Handle direct color values\n utilities.forEach((utility) => {\n safelist.push(`${utility}-${colorName}`);\n\n variants.forEach((variant) => {\n safelist.push(`${variant}${utility}-${colorName}`);\n });\n });\n }\n });\n\n // Generate typography classes\n Object.entries(typography).forEach(([family, sizes]) => {\n Object.keys(sizes).forEach((size) => {\n // Base typography classes\n safelist.push(`text-${family}-${size}`);\n\n // Add variants\n variants.forEach((variant) => {\n safelist.push(`${variant}text-${family}-${size}`);\n });\n });\n });\n\n const breakpoints = [\"sm\", \"md\", \"lg\", \"xl\", \"2xl\"];\n const typographyClasses = Object.entries(typography).flatMap(\n ([category, sizes]) =>\n Object.keys(sizes).map((size) => `text-${category}-${size}`)\n );\n\n // Generate responsive variants\n const responsiveTypographyClasses = typographyClasses.flatMap((className) =>\n breakpoints.map((breakpoint) => `${breakpoint}:${className}`)\n );\n\n return [\n ...typographyClasses,\n ...responsiveTypographyClasses\n // ... rest of your safelist\n ];\n};\n\nexport const focusRingStyles =\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\";\n\nexport const focusRingStylesCoerced = \"ring-2 ring-ring ring-offset-2\";\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\nexport const noopFn = () => {};\n","import React, { SVGProps } from \"react\";\nimport { IconName, IconMap } from \"@deckai/icons\";\nimport { IconColors } from \"../types/tailwind\";\nimport { cn } from \"../utils\";\n\ntype Breakpoint = \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\";\ntype ResponsiveSize = number | `${Breakpoint}:${number}`;\n\nexport type IconProps = {\n name: IconName;\n /** @default 24 */\n size?: ResponsiveSize | ResponsiveSize[];\n /** @default primary */\n color?: IconColors;\n title?: string;\n className?: string;\n style?: React.CSSProperties;\n} & Omit<SVGProps<SVGSVGElement>, \"aria-hidden\" | \"aria-label\">;\n\nconst COLOR_MAP: Record<IconColors, string> = {\n primary: \"#080808\",\n secondary: \"#666666\",\n white: \"#ffffff\",\n primaryBlue: \"#089CCB\"\n};\n\nconst BREAKPOINT_MAP: Record<Breakpoint, string> = {\n sm: \"640px\",\n md: \"768px\",\n lg: \"1024px\",\n xl: \"1280px\",\n \"2xl\": \"1536px\"\n};\n\nconst processSizes = (\n sizes: ResponsiveSize | ResponsiveSize[] | undefined\n): React.CSSProperties => {\n if (!sizes) return { width: \"24px\", height: \"24px\" };\n\n const sizeArray = Array.isArray(sizes) ? sizes : [sizes];\n const mediaQueries: Record<string, string> = {};\n let baseSize: string | undefined;\n\n // Process each size\n sizeArray.forEach((size) => {\n if (typeof size === \"number\") {\n baseSize = `${size}px`;\n } else {\n const [breakpoint, valueStr] = size.split(\":\") as [Breakpoint, string];\n const value = parseInt(valueStr, 10);\n mediaQueries[`@media (min-width: ${BREAKPOINT_MAP[breakpoint]})`] =\n `${value}px`;\n }\n });\n\n // Create the style object with the correct structure\n return {\n width: baseSize || \"24px\",\n height: baseSize || \"24px\",\n ...Object.entries(mediaQueries).reduce(\n (acc, [query, size]) => ({\n ...acc,\n [query]: {\n width: size,\n height: size\n }\n }),\n {}\n )\n };\n};\n\nexport const Icon = React.forwardRef<SVGSVGElement, IconProps>(\n (\n {\n name,\n size = 24,\n color = \"primary\",\n title,\n className,\n style = {},\n ...props\n },\n ref\n ) => {\n const IconComponent = IconMap[name];\n const sizeStyles = processSizes(size);\n\n return (\n <div\n className={cn(\"flex justify-center items-center\", className)}\n style={{\n ...sizeStyles,\n [\"--icon-stroke\" as string]: COLOR_MAP[color],\n ...style\n }}\n >\n <IconComponent\n ref={ref}\n aria-hidden={!title}\n aria-label={title}\n stroke={name.includes(\"filled\") ? undefined : COLOR_MAP[color]}\n {...props}\n />\n </div>\n );\n }\n);\n\nIcon.displayName = \"Icon\";\n","import * as React from \"react\";\nimport { cn } from \"../utils\";\nimport { focusRingStyles } from \"../utils/tailwind\";\nimport { IconName } from \"@deckai/icons\";\nimport { Icon, IconProps } from \"./Icon\";\n\nexport type InputProps = {\n className?: string;\n end?: React.ReactNode;\n /** renders an icon in the end slot */\n iconName?: IconName;\n /** Label text for the input */\n label?: string;\n /** Additional classes for the label */\n labelClassName?: string;\n} & React.InputHTMLAttributes<HTMLInputElement> &\n Pick<IconProps, \"color\" | \"size\" | \"title\">;\n\nexport const Input = ({\n className,\n end,\n iconName,\n color,\n size,\n title,\n label,\n labelClassName,\n id,\n ...props\n}: InputProps) => (\n <div className=\"space-y-2\">\n {label && (\n <label\n htmlFor={id}\n className={cn(\n \"block text-sm font-medium text-text-primary\",\n labelClassName\n )}\n >\n {label}\n </label>\n )}\n <div className=\"relative\">\n <input\n id={id}\n className={cn(\n `font-sans lg:text-body-default text-xs flex w-full rounded-lg border border-secondary-50 bg-background-0 px-3 md:py-3 py-2 text-secondary ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-secondary text-text-primary ${focusRingStyles} disabled:cursor-not-allowed disabled:opacity-50 md:text-md`,\n end && \"pr-10\",\n className\n )}\n {...props}\n />\n {end && (\n <div className=\"absolute inset-y-0 right-0 flex items-center pr-3\">\n {iconName ? (\n <Icon name={iconName} color={color} size={size} title={title} />\n ) : (\n end\n )}\n </div>\n )}\n </div>\n </div>\n);\n","import React from \"react\";\nimport { cn } from \"../utils\";\nimport { Icon } from \"./Icon\";\n\nexport type OptionProps = {\n label: string;\n value: string;\n onChange?: (value: string) => void;\n selected?: boolean;\n};\n\nexport const Option = ({ value, label, onChange, selected }: OptionProps) => (\n <button\n type=\"button\"\n className={cn(\n \"relative w-full h-full text-left px-2 py-1.5 text-sm cursor-pointer hover:bg-gray-100 rounded\",\n selected && \"bg-gray-100\"\n )}\n onClick={() => {\n onChange?.(value);\n }}\n >\n {label}\n </button>\n);\n","import React, { useState, useCallback, HTMLAttributes } from \"react\";\nimport { Text } from \"./Text\";\nimport { Pressable, PressableProps } from \"./Pressable\";\nimport { cn } from \"../utils\";\nimport { Icon } from \"./Icon\";\n\nexport type TagProps = {\n children: React.ReactNode;\n padded?: boolean;\n color?: \"primary\" | \"text\";\n onClose?: () => void;\n} & HTMLAttributes<HTMLDivElement> &\n PressableProps;\n\nexport const Tag = ({\n children,\n color = \"primary\",\n className,\n onClose,\n ...pressableProps\n}: TagProps) => {\n const [isHovered, setIsHovered] = useState(false);\n\n const handleMouseEnter = useCallback(() => {\n setIsHovered(true);\n }, []);\n\n const handleMouseLeave = useCallback(() => {\n setIsHovered(false);\n }, []);\n\n const content = (\n <div\n className={cn(\n \"flex gap-2\",\n onClose\n ? \"justify-between items-center\"\n : \"items-center justify-center\",\n \"hover:bg-primary-100 rounded bg-secondary-400 px-2 py-1 sm:px-3 sm:py-1.5 h-min hover:text-white\",\n color === \"primary\" ? \"text-primary-100\" : \"text-primary\",\n className\n )}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n >\n {typeof children === \"string\" ? (\n <Text\n color=\"inherit\"\n variant={[\"md:body-default-medium\", \"body-xxs-medium\"]}\n className=\"truncate pt-0.5\"\n >\n {children}\n </Text>\n ) : (\n children\n )}\n {onClose && (\n <Pressable\n {...pressableProps}\n onClick={onClose}\n className=\"flex items-center justify-center\"\n >\n <Icon\n name=\"close\"\n size={10}\n color={isHovered ? \"white\" : \"primaryBlue\"}\n />\n </Pressable>\n )}\n </div>\n );\n\n return onClose ? (\n content\n ) : (\n <Pressable {...pressableProps}>{content}</Pressable>\n );\n};\n","import React from \"react\";\nimport {\n Colors,\n TextColorVariant,\n PrimaryShades,\n SecondaryShades,\n TertiaryShades,\n Typography\n} from \"../types/tailwind\";\n\ntype TextElement =\n | \"p\"\n | \"span\"\n | \"h1\"\n | \"h2\"\n | \"h3\"\n | \"h4\"\n | \"h5\"\n | \"h6\"\n | \"strong\"\n | \"em\"\n | \"blockquote\"\n | \"pre\"\n | \"code\"\n | \"small\"\n | \"label\"\n | \"a\";\n\n// HTML element mapping type\ntype HTMLElementByTag = {\n p: HTMLParagraphElement;\n span: HTMLSpanElement;\n h1: HTMLHeadingElement;\n h2: HTMLHeadingElement;\n h3: HTMLHeadingElement;\n h4: HTMLHeadingElement;\n h5: HTMLHeadingElement;\n h6: HTMLHeadingElement;\n strong: HTMLElement;\n em: HTMLElement;\n blockquote: HTMLQuoteElement;\n pre: HTMLPreElement;\n code: HTMLElement;\n small: HTMLElement;\n label: HTMLLabelElement;\n a: HTMLAnchorElement;\n};\n\n// HTML props mapping type\ntype HTMLPropsMap = {\n p: React.HTMLAttributes<HTMLParagraphElement>;\n span: React.HTMLAttributes<HTMLSpanElement>;\n h1: React.HTMLAttributes<HTMLHeadingElement>;\n h2: React.HTMLAttributes<HTMLHeadingElement>;\n h3: React.HTMLAttributes<HTMLHeadingElement>;\n h4: React.HTMLAttributes<HTMLHeadingElement>;\n h5: React.HTMLAttributes<HTMLHeadingElement>;\n h6: React.HTMLAttributes<HTMLHeadingElement>;\n strong: React.HTMLAttributes<HTMLElement>;\n em: React.HTMLAttributes<HTMLElement>;\n blockquote: React.HTMLAttributes<HTMLQuoteElement>;\n pre: React.HTMLAttributes<HTMLPreElement>;\n code: React.HTMLAttributes<HTMLElement>;\n small: React.HTMLAttributes<HTMLElement>;\n label: React.LabelHTMLAttributes<HTMLLabelElement>;\n a: Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, \"color\">;\n};\n\ntype ColorCategory = keyof Omit<Colors, \"stroke\" | \"background\">;\ntype ColorValue<T extends ColorCategory> = T extends \"text\"\n ? TextColorVariant\n : T extends \"primary\"\n ? keyof PrimaryShades\n : T extends \"secondary\"\n ? keyof SecondaryShades\n : T extends \"tertiary\"\n ? keyof TertiaryShades\n : never;\n\ntype ColorKey = {\n [T in ColorCategory]: `${T}-${ColorValue<T>}`;\n}[ColorCategory];\n\ntype TypographyCategory = keyof Typography;\ntype TypographyValue<T extends TypographyCategory> = Extract<\n keyof Typography[T],\n string | number | bigint | boolean | null | undefined\n>;\ntype TypographyKey = {\n [T in TypographyCategory]: `${T}-${TypographyValue<T>}`;\n}[TypographyCategory];\n\nconst HEADING_ELEMENT_MAP: Record<string, TextElement> = {\n xl: \"h1\",\n lg: \"h1\",\n md: \"h2\",\n sm: \"h3\",\n xs: \"h4\"\n};\n\nconst getElementFromVariant = (variant: TypographyKey): TextElement => {\n const [category, size] = variant.split(\"-\");\n\n if (category === \"heading\") {\n return HEADING_ELEMENT_MAP[size] || \"p\";\n }\n\n if (category === \"label\") {\n return \"label\";\n }\n\n return \"p\";\n};\n\ntype Weight = \"light\" | \"regular\" | \"semibold\" | \"bold\";\n\nconst fontWeight: Record<Weight, string> = {\n light: \"font-light\",\n regular: \"font-regular\",\n semibold: \"font-semibold\",\n bold: \"font-bold\"\n};\n\n// Add breakpoint types\ntype Breakpoint = \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\";\ntype ResponsiveVariant = TypographyKey | `${Breakpoint}:${TypographyKey}`;\n\n// Update TextProps to use ResponsiveVariant\nexport type TextProps<T extends TextElement = \"p\"> = {\n variant?: ResponsiveVariant | ResponsiveVariant[];\n color?: ColorKey | \"inherit\";\n as?: T;\n className?: string;\n children: React.ReactNode;\n weight?: Weight;\n} & HTMLPropsMap[T];\n\n// Add helper function to process variants\nconst processVariants = (\n variants: ResponsiveVariant | ResponsiveVariant[] | undefined\n): string => {\n if (!variants) return \"text-body-default\";\n\n const variantArray = Array.isArray(variants) ? variants : [variants];\n\n return variantArray\n .map((variant) => {\n if (variant.includes(\":\")) {\n const [breakpoint, typographyClass] = variant.split(\":\");\n return `${breakpoint}:text-${typographyClass}`;\n }\n return `text-${variant}`;\n })\n .join(\" \");\n};\n\nexport const Text = React.forwardRef(\n <T extends TextElement = \"p\">(\n {\n variant = \"body-default\",\n color = \"text-primary\",\n as,\n className,\n children,\n weight,\n ...props\n }: TextProps<T>,\n ref: React.ForwardedRef<HTMLElementByTag[T]>\n ) => {\n // Process typography classes with breakpoints\n const typographyClasses = processVariants(variant);\n\n // Get color styles\n const colorClasses =\n color && color === \"inherit\" ? \"inherit\" : color ? `text-${color}` : \"\";\n\n const suggestedElement = React.useMemo(() => {\n const baseVariant =\n typeof variant === \"string\"\n ? variant.split(\":\").pop()!\n : Array.isArray(variant)\n ? variant[0].split(\":\").pop()!\n : \"body-default\";\n return getElementFromVariant(baseVariant as TypographyKey);\n }, [variant]);\n\n const Component = (as || suggestedElement) as T;\n\n return (\n // @ts-expect-error TODO: figure this out\n <Component\n ref={ref}\n className={`font-sans antialiased ${typographyClasses} ${colorClasses} ${\n weight ? `!${fontWeight[weight]}` : \"\"\n } ${className ?? \"\"}`}\n {...props}\n >\n {children}\n </Component>\n );\n }\n);\n\nText.displayName = \"Text\";\n","import React, { ButtonHTMLAttributes } from \"react\";\nimport { focusRingStyles } from \"../utils/tailwind\";\n\nexport type PressableProps = ButtonHTMLAttributes<HTMLButtonElement>;\n\nexport const Pressable: React.FC<PressableProps> = ({\n children,\n type = \"button\",\n className,\n disabled,\n ...props\n}) => (\n <button\n // eslint-disable-next-line react/butt on-has-type\n type={type}\n disabled={disabled}\n className={`appearance-none hover:opacity-80 transition-all active:scale-95 ${focusRingStyles} ${className} ${disabled ? \"opacity-50 cursor-not-allowed\" : \"\"}`}\n {...props}\n >\n {children}\n </button>\n);\n","/**\n * Copyright 2022 Joe Bell. All rights reserved.\n *\n * This file is licensed to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with the\n * License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR REPRESENTATIONS OF ANY KIND, either express or implied. See the\n * License for the specific language governing permissions and limitations under\n * the License.\n */ import { clsx } from \"clsx\";\nconst falsyToString = (value)=>typeof value === \"boolean\" ? `${value}` : value === 0 ? \"0\" : value;\nexport const cx = clsx;\nexport const cva = (base, config)=>(props)=>{\n var _config_compoundVariants;\n if ((config === null || config === void 0 ? void 0 : config.variants) == null) return cx(base, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);\n const { variants, defaultVariants } = config;\n const getVariantClassNames = Object.keys(variants).map((variant)=>{\n const variantProp = props === null || props === void 0 ? void 0 : props[variant];\n const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];\n if (variantProp === null) return null;\n const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);\n return variants[variant][variantKey];\n });\n const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param)=>{\n let [key, value] = param;\n if (value === undefined) {\n return acc;\n }\n acc[key] = value;\n return acc;\n }, {});\n const getCompoundVariantClassNames = config === null || config === void 0 ? void 0 : (_config_compoundVariants = config.compoundVariants) === null || _config_compoundVariants === void 0 ? void 0 : _config_compoundVariants.reduce((acc, param)=>{\n let { class: cvClass, className: cvClassName, ...compoundVariantOptions } = param;\n return Object.entries(compoundVariantOptions).every((param)=>{\n let [key, value] = param;\n return Array.isArray(value) ? value.includes({\n ...defaultVariants,\n ...propsWithoutUndefined\n }[key]) : ({\n ...defaultVariants,\n ...propsWithoutUndefined\n })[key] === value;\n }) ? [\n ...acc,\n cvClass,\n cvClassName\n ] : acc;\n }, []);\n return cx(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);\n };\n\n","import * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../utils\";\n\nconst spinnerVariants = cva(\n \"animate-spin rounded-full border-current border-t-transparent\",\n {\n variants: {\n size: {\n sm: \"h-4 w-4 border-4\",\n md: \"h-6 w-6 border-4\",\n lg: \"h-8 w-8 border-8\"\n }\n },\n defaultVariants: {\n size: \"md\"\n }\n }\n);\n\nexport type SpinnerProps = {\n className?: string;\n customSize?: number;\n} & VariantProps<typeof spinnerVariants>;\n\nexport const Spinner = React.forwardRef<HTMLDivElement, SpinnerProps>(\n ({ size, className, customSize, ...props }, ref) => {\n const styles = customSize\n ? {\n width: customSize,\n height: customSize,\n borderWidth: Math.max(2, Math.floor(customSize / 16))\n }\n : {};\n\n return (\n <div\n role=\"status\"\n aria-label=\"Loading\"\n ref={ref}\n className={cn(spinnerVariants({ size }), \"text-primary-100\", className)}\n style={styles}\n {...props}\n >\n <span className=\"sr-only\">Loading...</span>\n </div>\n );\n }\n);\n\nSpinner.displayName = \"Spinner\";\n","import React, { useCallback, useMemo, useState } from \"react\";\nimport * as Popover from \"@radix-ui/react-popover\";\nimport { focusRingStylesCoerced } from \"../utils/tailwind\";\nimport { Input } from \"./Input\";\nimport { OptionProps, Option } from \"./Option\";\nimport { Tag } from \"./Tag\";\nimport { Text } from \"./Text\";\nimport { Icon } from \"./Icon\";\nimport { Spinner } from \"./Spinner\";\n\nexport type MultiSelectComboboxProps = {\n options: OptionProps[];\n selectedValues: string[];\n onSelectionChange: (values: string[]) => void;\n placeholder?: string;\n className?: string;\n label?: string;\n disabled?: boolean;\n labelClassName?: string;\n id?: string;\n maxSelections?: number;\n noOptionsMessage?: string;\n loading?: boolean;\n errorMessage?: string;\n};\n\nexport const MultiSelectCombobox = ({\n options,\n selectedValues,\n onSelectionChange,\n placeholder = \"Select items...\",\n className,\n label,\n labelClassName,\n id,\n maxSelections,\n disabled,\n noOptionsMessage,\n loading,\n errorMessage\n}: MultiSelectComboboxProps) => {\n const [open, setOpen] = useState(false);\n const [inputValue, setInputValue] = useState(\"\");\n\n const selectedOptions = useMemo(\n () => options.filter((option) => selectedValues.includes(option.value)),\n [options, selectedValues]\n );\n\n const filteredOptions = useMemo(\n () =>\n options.filter(\n (option) =>\n !selectedValues.includes(option.value) &&\n option.label.toLowerCase().includes(inputValue.toLowerCase())\n ),\n [options, selectedValues, inputValue]\n );\n\n const handleOptionSelect = useCallback(\n (value: string) => {\n onSelectionChange([...selectedValues, value]);\n setInputValue(\"\");\n setOpen(false);\n },\n [maxSelections, onSelectionChange, selectedValues]\n );\n\n const handleRemoveTag = useCallback(\n (valueToRemove: string) => {\n onSelectionChange(\n selectedValues.filter((value) => value !== valueToRemove)\n );\n },\n [onSelectionChange, selectedValues]\n );\n\n return (\n <div className=\"py-2\">\n <Popover.Root open={open} onOpenChange={setOpen}>\n <div\n className={`relative w-full font-sans text-text-secondary ${className}`}\n >\n <Popover.Trigger asChild>\n <div className=\"relative flex-1\">\n <Input\n id={id}\n label={label}\n labelClassName={labelClassName}\n placeholder={\n maxSelections && selectedValues.length >= maxSelections\n ? `Maximum ${maxSelections} items selected`\n : placeholder\n }\n value={inputValue}\n onChange={(e) => setInputValue(e.target.value)}\n className={`flex-1 ${open && focusRingStylesCoerced}`}\n disabled={\n disabled ||\n (!!maxSelections && selectedValues.length >= maxSelections)\n }\n end={\n loading ? (\n <Spinner size=\"sm\" />\n ) : (\n <Icon name=\"search-normal\" size={[\"lg:24\", 18]} />\n )\n }\n />\n </div>\n </Popover.Trigger>\n\n <Popover.Portal>\n <Popover.Content\n className=\"w-[--radix-popover-trigger-width] p-1 bg-white rounded-md shadow-lg border z-20\"\n sideOffset={5}\n >\n <div className=\"max-h-60 overflow-auto flex flex-col items-start\">\n {filteredOptions.length > 0 ? (\n filteredOptions.map(({ label, value }) => (\n <Option\n key={value}\n label={label}\n value={value}\n onChange={handleOptionSelect}\n />\n ))\n ) : (\n <Text variant=\"label-default\" className=\"text-text-secondary\">\n {noOptionsMessage || \"No results found\"}\n </Text>\n )}\n </div>\n </Popover.Content>\n </Popover.Portal>\n </div>\n </Popover.Root>\n <div className=\"flex flex-col gap-1 pt-2\">\n {errorMessage && (\n <Text variant=\"label-default\" color=\"tertiary-20\">\n {errorMessage}\n </Text>\n )}\n <div className=\"flex flex-wrap gap-2\">\n {selectedOptions.map((option) => (\n <Tag\n key={option.value}\n onClose={() => handleRemoveTag(option.value)}\n >\n {option.label}\n </Tag>\n ))}\n </div>\n </div>\n </div>\n );\n};\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { OptionProps } from './Option.cjs';
|
|
3
|
+
|
|
4
|
+
type MultiSelectComboboxProps = {
|
|
5
|
+
options: OptionProps[];
|
|
6
|
+
selectedValues: string[];
|
|
7
|
+
onSelectionChange: (values: string[]) => void;
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
className?: string;
|
|
10
|
+
label?: string;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
labelClassName?: string;
|
|
13
|
+
id?: string;
|
|
14
|
+
maxSelections?: number;
|
|
15
|
+
noOptionsMessage?: string;
|
|
16
|
+
loading?: boolean;
|
|
17
|
+
errorMessage?: string;
|
|
18
|
+
};
|
|
19
|
+
declare const MultiSelectCombobox: ({ options, selectedValues, onSelectionChange, placeholder, className, label, labelClassName, id, maxSelections, disabled, noOptionsMessage, loading, errorMessage }: MultiSelectComboboxProps) => React__default.JSX.Element;
|
|
20
|
+
|
|
21
|
+
export { MultiSelectCombobox, type MultiSelectComboboxProps };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { OptionProps } from './Option.js';
|
|
3
|
+
|
|
4
|
+
type MultiSelectComboboxProps = {
|
|
5
|
+
options: OptionProps[];
|
|
6
|
+
selectedValues: string[];
|
|
7
|
+
onSelectionChange: (values: string[]) => void;
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
className?: string;
|
|
10
|
+
label?: string;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
labelClassName?: string;
|
|
13
|
+
id?: string;
|
|
14
|
+
maxSelections?: number;
|
|
15
|
+
noOptionsMessage?: string;
|
|
16
|
+
loading?: boolean;
|
|
17
|
+
errorMessage?: string;
|
|
18
|
+
};
|
|
19
|
+
declare const MultiSelectCombobox: ({ options, selectedValues, onSelectionChange, placeholder, className, label, labelClassName, id, maxSelections, disabled, noOptionsMessage, loading, errorMessage }: MultiSelectComboboxProps) => React__default.JSX.Element;
|
|
20
|
+
|
|
21
|
+
export { MultiSelectCombobox, type MultiSelectComboboxProps };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import*as p from'react';import p__default,{useState,useMemo,useCallback}from'react';import*as g from'@radix-ui/react-popover';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {IconMap}from'@deckai/icons';var P="focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",R="ring-2 ring-ring ring-offset-2";function u(...t){return twMerge(clsx(t))}var w={primary:"#080808",secondary:"#666666",white:"#ffffff",primaryBlue:"#089CCB"},X={sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},Y=t=>{if(!t)return {width:"24px",height:"24px"};let r=Array.isArray(t)?t:[t],e={},o;return r.forEach(n=>{if(typeof n=="number")o=`${n}px`;else {let[s,i]=n.split(":"),d=parseInt(i,10);e[`@media (min-width: ${X[s]})`]=`${d}px`;}}),{width:o||"24px",height:o||"24px",...Object.entries(e).reduce((n,[s,i])=>({...n,[s]:{width:i,height:i}}),{})}},b=p__default.forwardRef(({name:t,size:r=24,color:e="primary",title:o,className:n,style:s={},...i},d)=>{let l=IconMap[t],a=Y(r);return p__default.createElement("div",{className:u("flex justify-center items-center",n),style:{...a,"--icon-stroke":w[e],...s}},p__default.createElement(l,{ref:d,"aria-hidden":!o,"aria-label":o,stroke:t.includes("filled")?void 0:w[e],...i}))});b.displayName="Icon";var I=({className:t,end:r,iconName:e,color:o,size:n,title:s,label:i,labelClassName:d,id:l,...a})=>p.createElement("div",{className:"space-y-2"},i&&p.createElement("label",{htmlFor:l,className:u("block text-sm font-medium text-text-primary",d)},i),p.createElement("div",{className:"relative"},p.createElement("input",{id:l,className:u(`font-sans lg:text-body-default text-xs flex w-full rounded-lg border border-secondary-50 bg-background-0 px-3 md:py-3 py-2 text-secondary ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-secondary text-text-primary ${P} disabled:cursor-not-allowed disabled:opacity-50 md:text-md`,r&&"pr-10",t),...a}),r&&p.createElement("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3"},e?p.createElement(b,{name:e,color:o,size:n,title:s}):r)));var O=({value:t,label:r,onChange:e,selected:o})=>p__default.createElement("button",{type:"button",className:u("relative w-full h-full text-left px-2 py-1.5 text-sm cursor-pointer hover:bg-gray-100 rounded",o&&"bg-gray-100"),onClick:()=>{e?.(t);}},r);var ee={xl:"h1",lg:"h1",md:"h2",sm:"h3",xs:"h4"},te=t=>{let[r,e]=t.split("-");return r==="heading"?ee[e]||"p":r==="label"?"label":"p"},re={light:"font-light",regular:"font-regular",semibold:"font-semibold",bold:"font-bold"},oe=t=>t?(Array.isArray(t)?t:[t]).map(e=>{if(e.includes(":")){let[o,n]=e.split(":");return `${o}:text-${n}`}return `text-${e}`}).join(" "):"text-body-default",v=p__default.forwardRef(({variant:t="body-default",color:r="text-primary",as:e,className:o,children:n,weight:s,...i},d)=>{let l=oe(t),a=r&&r==="inherit"?"inherit":r?`text-${r}`:"",y=p__default.useMemo(()=>{let c=typeof t=="string"?t.split(":").pop():Array.isArray(t)?t[0].split(":").pop():"body-default";return te(c)},[t]);return p__default.createElement(e||y,{ref:d,className:`font-sans antialiased ${l} ${a} ${s?`!${re[s]}`:""} ${o??""}`,...i},n)});v.displayName="Text";var k=({children:t,type:r="button",className:e,disabled:o,...n})=>p__default.createElement("button",{type:r,disabled:o,className:`appearance-none hover:opacity-80 transition-all active:scale-95 ${P} ${e} ${o?"opacity-50 cursor-not-allowed":""}`,...n},t);var j=({children:t,color:r="primary",className:e,onClose:o,...n})=>{let[s,i]=useState(!1),d=useCallback(()=>{i(!0);},[]),l=useCallback(()=>{i(!1);},[]),a=p__default.createElement("div",{className:u("flex gap-2",o?"justify-between items-center":"items-center justify-center","hover:bg-primary-100 rounded bg-secondary-400 px-2 py-1 sm:px-3 sm:py-1.5 h-min hover:text-white",r==="primary"?"text-primary-100":"text-primary",e),onMouseEnter:d,onMouseLeave:l},typeof t=="string"?p__default.createElement(v,{color:"inherit",variant:["md:body-default-medium","body-xxs-medium"],className:"truncate pt-0.5"},t):t,o&&p__default.createElement(k,{...n,onClick:o,className:"flex items-center justify-center"},p__default.createElement(b,{name:"close",size:10,color:s?"white":"primaryBlue"})));return o?a:p__default.createElement(k,{...n},a)};var B=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,z=clsx,K=(t,r)=>e=>{var o;if(r?.variants==null)return z(t,e?.class,e?.className);let{variants:n,defaultVariants:s}=r,i=Object.keys(n).map(a=>{let y=e?.[a],f=s?.[a];if(y===null)return null;let c=B(y)||B(f);return n[a][c]}),d=e&&Object.entries(e).reduce((a,y)=>{let[f,c]=y;return c===void 0||(a[f]=c),a},{}),l=r==null||(o=r.compoundVariants)===null||o===void 0?void 0:o.reduce((a,y)=>{let{class:f,className:c,...L}=y;return Object.entries(L).every(C=>{let[x,T]=C;return Array.isArray(T)?T.includes({...s,...d}[x]):{...s,...d}[x]===T})?[...a,f,c]:a},[]);return z(t,i,l,e?.class,e?.className)};var ie=K("animate-spin rounded-full border-current border-t-transparent",{variants:{size:{sm:"h-4 w-4 border-4",md:"h-6 w-6 border-4",lg:"h-8 w-8 border-8"}},defaultVariants:{size:"md"}}),A=p.forwardRef(({size:t,className:r,customSize:e,...o},n)=>{let s=e?{width:e,height:e,borderWidth:Math.max(2,Math.floor(e/16))}:{};return p.createElement("div",{role:"status","aria-label":"Loading",ref:n,className:u(ie({size:t}),"text-primary-100",r),style:s,...o},p.createElement("span",{className:"sr-only"},"Loading..."))});A.displayName="Spinner";var et=({options:t,selectedValues:r,onSelectionChange:e,placeholder:o="Select items...",className:n,label:s,labelClassName:i,id:d,maxSelections:l,disabled:a,noOptionsMessage:y,loading:f,errorMessage:c})=>{let[L,C]=useState(!1),[x,T]=useState(""),F=useMemo(()=>t.filter(m=>r.includes(m.value)),[t,r]),S=useMemo(()=>t.filter(m=>!r.includes(m.value)&&m.label.toLowerCase().includes(x.toLowerCase())),[t,r,x]),q=useCallback(m=>{e([...r,m]),T(""),C(!1);},[l,e,r]),D=useCallback(m=>{e(r.filter(E=>E!==m));},[e,r]);return p__default.createElement("div",{className:"py-2"},p__default.createElement(g.Root,{open:L,onOpenChange:C},p__default.createElement("div",{className:`relative w-full font-sans text-text-secondary ${n}`},p__default.createElement(g.Trigger,{asChild:!0},p__default.createElement("div",{className:"relative flex-1"},p__default.createElement(I,{id:d,label:s,labelClassName:i,placeholder:l&&r.length>=l?`Maximum ${l} items selected`:o,value:x,onChange:m=>T(m.target.value),className:`flex-1 ${L&&R}`,disabled:a||!!l&&r.length>=l,end:f?p__default.createElement(A,{size:"sm"}):p__default.createElement(b,{name:"search-normal",size:["lg:24",18]})}))),p__default.createElement(g.Portal,null,p__default.createElement(g.Content,{className:"w-[--radix-popover-trigger-width] p-1 bg-white rounded-md shadow-lg border z-20",sideOffset:5},p__default.createElement("div",{className:"max-h-60 overflow-auto flex flex-col items-start"},S.length>0?S.map(({label:m,value:E})=>p__default.createElement(O,{key:E,label:m,value:E,onChange:q})):p__default.createElement(v,{variant:"label-default",className:"text-text-secondary"},y||"No results found")))))),p__default.createElement("div",{className:"flex flex-col gap-1 pt-2"},c&&p__default.createElement(v,{variant:"label-default",color:"tertiary-20"},c),p__default.createElement("div",{className:"flex flex-wrap gap-2"},F.map(m=>p__default.createElement(j,{key:m.value,onClose:()=>D(m.value)},m.label)))))};if (exports.default) module.exports = exports.default;export{et as MultiSelectCombobox};//# sourceMappingURL=MultiSelectCombobox.js.map
|
|
2
|
+
//# sourceMappingURL=MultiSelectCombobox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utils/tailwind.ts","../../src/utils/index.ts","../../src/components/Icon.tsx","../../src/components/Input.tsx","../../src/components/Option.tsx","../../src/components/Tag.tsx","../../src/components/Text.tsx","../../src/components/Pressable.tsx","../../../../node_modules/class-variance-authority/dist/index.mjs","../../src/components/Spinner.tsx","../../src/components/MultiSelectCombobox.tsx"],"names":["focusRingStyles","focusRingStylesCoerced","cn","inputs","twMerge","clsx","COLOR_MAP","BREAKPOINT_MAP","processSizes","sizes","sizeArray","mediaQueries","baseSize","size","breakpoint","valueStr","value","acc","query","Icon","React","name","color","title","className","style","props","ref","IconComponent","IconMap","sizeStyles","Input","end","iconName","label","labelClassName","id","h","Option","onChange","selected","HEADING_ELEMENT_MAP","getElementFromVariant","variant","category","fontWeight","processVariants","variants","typographyClass","Text","as","children","weight","typographyClasses","colorClasses","suggestedElement","baseVariant","Pressable","type","disabled","Tag","onClose","pressableProps","isHovered","setIsHovered","useState","handleMouseEnter","useCallback","handleMouseLeave","content","falsyToString","cx","cva","base","config","_config_compoundVariants","defaultVariants","getVariantClassNames","variantProp","defaultVariantProp","variantKey","propsWithoutUndefined","param","key","getCompoundVariantClassNames","cvClass","cvClassName","compoundVariantOptions","spinnerVariants","Spinner","H","customSize","styles","MultiSelectCombobox","options","selectedValues","onSelectionChange","placeholder","maxSelections","noOptionsMessage","loading","errorMessage","open","setOpen","inputValue","setInputValue","selectedOptions","useMemo","option","filteredOptions","handleOptionSelect","handleRemoveTag","valueToRemove","e"],"mappings":"+NAmEO,IAAMA,CAAAA,CACX,sGAEWC,CAAyB,C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AO,CAAA,KACV,CACD,CACH,CACF,CACF,CAEJ","file":"MultiSelectCombobox.js","sourcesContent":["import { Colors, Typography } from \"../types/tailwind\";\n\n// Generate safelist patterns for all color utilities so you can use any theme color variable in your code\nexport const generateSafelist = (colors: Colors, typography: Typography) => {\n const colorNames = Object.keys(colors) as (keyof Colors)[];\n const utilities = [\"bg\", \"text\", \"border\", \"ring\", \"divide\", \"outline\"];\n const variants = [\"hover:\", \"focus:\", \"active:\", \"disabled:\"];\n\n const safelist: string[] = [];\n\n colorNames.forEach((colorName) => {\n if (typeof colors[colorName] === \"object\") {\n // Handle nested color objects (with number keys)\n Object.keys(colors[colorName]).forEach((shade) => {\n utilities.forEach((utility) => {\n // Base utility\n safelist.push(`${utility}-${colorName}-${shade}`);\n\n // Variant utilities\n variants.forEach((variant) => {\n safelist.push(`${variant}${utility}-${colorName}-${shade}`);\n });\n });\n });\n } else {\n // Handle direct color values\n utilities.forEach((utility) => {\n safelist.push(`${utility}-${colorName}`);\n\n variants.forEach((variant) => {\n safelist.push(`${variant}${utility}-${colorName}`);\n });\n });\n }\n });\n\n // Generate typography classes\n Object.entries(typography).forEach(([family, sizes]) => {\n Object.keys(sizes).forEach((size) => {\n // Base typography classes\n safelist.push(`text-${family}-${size}`);\n\n // Add variants\n variants.forEach((variant) => {\n safelist.push(`${variant}text-${family}-${size}`);\n });\n });\n });\n\n const breakpoints = [\"sm\", \"md\", \"lg\", \"xl\", \"2xl\"];\n const typographyClasses = Object.entries(typography).flatMap(\n ([category, sizes]) =>\n Object.keys(sizes).map((size) => `text-${category}-${size}`)\n );\n\n // Generate responsive variants\n const responsiveTypographyClasses = typographyClasses.flatMap((className) =>\n breakpoints.map((breakpoint) => `${breakpoint}:${className}`)\n );\n\n return [\n ...typographyClasses,\n ...responsiveTypographyClasses\n // ... rest of your safelist\n ];\n};\n\nexport const focusRingStyles =\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\";\n\nexport const focusRingStylesCoerced = \"ring-2 ring-ring ring-offset-2\";\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\nexport const noopFn = () => {};\n","import React, { SVGProps } from \"react\";\nimport { IconName, IconMap } from \"@deckai/icons\";\nimport { IconColors } from \"../types/tailwind\";\nimport { cn } from \"../utils\";\n\ntype Breakpoint = \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\";\ntype ResponsiveSize = number | `${Breakpoint}:${number}`;\n\nexport type IconProps = {\n name: IconName;\n /** @default 24 */\n size?: ResponsiveSize | ResponsiveSize[];\n /** @default primary */\n color?: IconColors;\n title?: string;\n className?: string;\n style?: React.CSSProperties;\n} & Omit<SVGProps<SVGSVGElement>, \"aria-hidden\" | \"aria-label\">;\n\nconst COLOR_MAP: Record<IconColors, string> = {\n primary: \"#080808\",\n secondary: \"#666666\",\n white: \"#ffffff\",\n primaryBlue: \"#089CCB\"\n};\n\nconst BREAKPOINT_MAP: Record<Breakpoint, string> = {\n sm: \"640px\",\n md: \"768px\",\n lg: \"1024px\",\n xl: \"1280px\",\n \"2xl\": \"1536px\"\n};\n\nconst processSizes = (\n sizes: ResponsiveSize | ResponsiveSize[] | undefined\n): React.CSSProperties => {\n if (!sizes) return { width: \"24px\", height: \"24px\" };\n\n const sizeArray = Array.isArray(sizes) ? sizes : [sizes];\n const mediaQueries: Record<string, string> = {};\n let baseSize: string | undefined;\n\n // Process each size\n sizeArray.forEach((size) => {\n if (typeof size === \"number\") {\n baseSize = `${size}px`;\n } else {\n const [breakpoint, valueStr] = size.split(\":\") as [Breakpoint, string];\n const value = parseInt(valueStr, 10);\n mediaQueries[`@media (min-width: ${BREAKPOINT_MAP[breakpoint]})`] =\n `${value}px`;\n }\n });\n\n // Create the style object with the correct structure\n return {\n width: baseSize || \"24px\",\n height: baseSize || \"24px\",\n ...Object.entries(mediaQueries).reduce(\n (acc, [query, size]) => ({\n ...acc,\n [query]: {\n width: size,\n height: size\n }\n }),\n {}\n )\n };\n};\n\nexport const Icon = React.forwardRef<SVGSVGElement, IconProps>(\n (\n {\n name,\n size = 24,\n color = \"primary\",\n title,\n className,\n style = {},\n ...props\n },\n ref\n ) => {\n const IconComponent = IconMap[name];\n const sizeStyles = processSizes(size);\n\n return (\n <div\n className={cn(\"flex justify-center items-center\", className)}\n style={{\n ...sizeStyles,\n [\"--icon-stroke\" as string]: COLOR_MAP[color],\n ...style\n }}\n >\n <IconComponent\n ref={ref}\n aria-hidden={!title}\n aria-label={title}\n stroke={name.includes(\"filled\") ? undefined : COLOR_MAP[color]}\n {...props}\n />\n </div>\n );\n }\n);\n\nIcon.displayName = \"Icon\";\n","import * as React from \"react\";\nimport { cn } from \"../utils\";\nimport { focusRingStyles } from \"../utils/tailwind\";\nimport { IconName } from \"@deckai/icons\";\nimport { Icon, IconProps } from \"./Icon\";\n\nexport type InputProps = {\n className?: string;\n end?: React.ReactNode;\n /** renders an icon in the end slot */\n iconName?: IconName;\n /** Label text for the input */\n label?: string;\n /** Additional classes for the label */\n labelClassName?: string;\n} & React.InputHTMLAttributes<HTMLInputElement> &\n Pick<IconProps, \"color\" | \"size\" | \"title\">;\n\nexport const Input = ({\n className,\n end,\n iconName,\n color,\n size,\n title,\n label,\n labelClassName,\n id,\n ...props\n}: InputProps) => (\n <div className=\"space-y-2\">\n {label && (\n <label\n htmlFor={id}\n className={cn(\n \"block text-sm font-medium text-text-primary\",\n labelClassName\n )}\n >\n {label}\n </label>\n )}\n <div className=\"relative\">\n <input\n id={id}\n className={cn(\n `font-sans lg:text-body-default text-xs flex w-full rounded-lg border border-secondary-50 bg-background-0 px-3 md:py-3 py-2 text-secondary ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-secondary text-text-primary ${focusRingStyles} disabled:cursor-not-allowed disabled:opacity-50 md:text-md`,\n end && \"pr-10\",\n className\n )}\n {...props}\n />\n {end && (\n <div className=\"absolute inset-y-0 right-0 flex items-center pr-3\">\n {iconName ? (\n <Icon name={iconName} color={color} size={size} title={title} />\n ) : (\n end\n )}\n </div>\n )}\n </div>\n </div>\n);\n","import React from \"react\";\nimport { cn } from \"../utils\";\nimport { Icon } from \"./Icon\";\n\nexport type OptionProps = {\n label: string;\n value: string;\n onChange?: (value: string) => void;\n selected?: boolean;\n};\n\nexport const Option = ({ value, label, onChange, selected }: OptionProps) => (\n <button\n type=\"button\"\n className={cn(\n \"relative w-full h-full text-left px-2 py-1.5 text-sm cursor-pointer hover:bg-gray-100 rounded\",\n selected && \"bg-gray-100\"\n )}\n onClick={() => {\n onChange?.(value);\n }}\n >\n {label}\n </button>\n);\n","import React, { useState, useCallback, HTMLAttributes } from \"react\";\nimport { Text } from \"./Text\";\nimport { Pressable, PressableProps } from \"./Pressable\";\nimport { cn } from \"../utils\";\nimport { Icon } from \"./Icon\";\n\nexport type TagProps = {\n children: React.ReactNode;\n padded?: boolean;\n color?: \"primary\" | \"text\";\n onClose?: () => void;\n} & HTMLAttributes<HTMLDivElement> &\n PressableProps;\n\nexport const Tag = ({\n children,\n color = \"primary\",\n className,\n onClose,\n ...pressableProps\n}: TagProps) => {\n const [isHovered, setIsHovered] = useState(false);\n\n const handleMouseEnter = useCallback(() => {\n setIsHovered(true);\n }, []);\n\n const handleMouseLeave = useCallback(() => {\n setIsHovered(false);\n }, []);\n\n const content = (\n <div\n className={cn(\n \"flex gap-2\",\n onClose\n ? \"justify-between items-center\"\n : \"items-center justify-center\",\n \"hover:bg-primary-100 rounded bg-secondary-400 px-2 py-1 sm:px-3 sm:py-1.5 h-min hover:text-white\",\n color === \"primary\" ? \"text-primary-100\" : \"text-primary\",\n className\n )}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n >\n {typeof children === \"string\" ? (\n <Text\n color=\"inherit\"\n variant={[\"md:body-default-medium\", \"body-xxs-medium\"]}\n className=\"truncate pt-0.5\"\n >\n {children}\n </Text>\n ) : (\n children\n )}\n {onClose && (\n <Pressable\n {...pressableProps}\n onClick={onClose}\n className=\"flex items-center justify-center\"\n >\n <Icon\n name=\"close\"\n size={10}\n color={isHovered ? \"white\" : \"primaryBlue\"}\n />\n </Pressable>\n )}\n </div>\n );\n\n return onClose ? (\n content\n ) : (\n <Pressable {...pressableProps}>{content}</Pressable>\n );\n};\n","import React from \"react\";\nimport {\n Colors,\n TextColorVariant,\n PrimaryShades,\n SecondaryShades,\n TertiaryShades,\n Typography\n} from \"../types/tailwind\";\n\ntype TextElement =\n | \"p\"\n | \"span\"\n | \"h1\"\n | \"h2\"\n | \"h3\"\n | \"h4\"\n | \"h5\"\n | \"h6\"\n | \"strong\"\n | \"em\"\n | \"blockquote\"\n | \"pre\"\n | \"code\"\n | \"small\"\n | \"label\"\n | \"a\";\n\n// HTML element mapping type\ntype HTMLElementByTag = {\n p: HTMLParagraphElement;\n span: HTMLSpanElement;\n h1: HTMLHeadingElement;\n h2: HTMLHeadingElement;\n h3: HTMLHeadingElement;\n h4: HTMLHeadingElement;\n h5: HTMLHeadingElement;\n h6: HTMLHeadingElement;\n strong: HTMLElement;\n em: HTMLElement;\n blockquote: HTMLQuoteElement;\n pre: HTMLPreElement;\n code: HTMLElement;\n small: HTMLElement;\n label: HTMLLabelElement;\n a: HTMLAnchorElement;\n};\n\n// HTML props mapping type\ntype HTMLPropsMap = {\n p: React.HTMLAttributes<HTMLParagraphElement>;\n span: React.HTMLAttributes<HTMLSpanElement>;\n h1: React.HTMLAttributes<HTMLHeadingElement>;\n h2: React.HTMLAttributes<HTMLHeadingElement>;\n h3: React.HTMLAttributes<HTMLHeadingElement>;\n h4: React.HTMLAttributes<HTMLHeadingElement>;\n h5: React.HTMLAttributes<HTMLHeadingElement>;\n h6: React.HTMLAttributes<HTMLHeadingElement>;\n strong: React.HTMLAttributes<HTMLElement>;\n em: React.HTMLAttributes<HTMLElement>;\n blockquote: React.HTMLAttributes<HTMLQuoteElement>;\n pre: React.HTMLAttributes<HTMLPreElement>;\n code: React.HTMLAttributes<HTMLElement>;\n small: React.HTMLAttributes<HTMLElement>;\n label: React.LabelHTMLAttributes<HTMLLabelElement>;\n a: Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, \"color\">;\n};\n\ntype ColorCategory = keyof Omit<Colors, \"stroke\" | \"background\">;\ntype ColorValue<T extends ColorCategory> = T extends \"text\"\n ? TextColorVariant\n : T extends \"primary\"\n ? keyof PrimaryShades\n : T extends \"secondary\"\n ? keyof SecondaryShades\n : T extends \"tertiary\"\n ? keyof TertiaryShades\n : never;\n\ntype ColorKey = {\n [T in ColorCategory]: `${T}-${ColorValue<T>}`;\n}[ColorCategory];\n\ntype TypographyCategory = keyof Typography;\ntype TypographyValue<T extends TypographyCategory> = Extract<\n keyof Typography[T],\n string | number | bigint | boolean | null | undefined\n>;\ntype TypographyKey = {\n [T in TypographyCategory]: `${T}-${TypographyValue<T>}`;\n}[TypographyCategory];\n\nconst HEADING_ELEMENT_MAP: Record<string, TextElement> = {\n xl: \"h1\",\n lg: \"h1\",\n md: \"h2\",\n sm: \"h3\",\n xs: \"h4\"\n};\n\nconst getElementFromVariant = (variant: TypographyKey): TextElement => {\n const [category, size] = variant.split(\"-\");\n\n if (category === \"heading\") {\n return HEADING_ELEMENT_MAP[size] || \"p\";\n }\n\n if (category === \"label\") {\n return \"label\";\n }\n\n return \"p\";\n};\n\ntype Weight = \"light\" | \"regular\" | \"semibold\" | \"bold\";\n\nconst fontWeight: Record<Weight, string> = {\n light: \"font-light\",\n regular: \"font-regular\",\n semibold: \"font-semibold\",\n bold: \"font-bold\"\n};\n\n// Add breakpoint types\ntype Breakpoint = \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\";\ntype ResponsiveVariant = TypographyKey | `${Breakpoint}:${TypographyKey}`;\n\n// Update TextProps to use ResponsiveVariant\nexport type TextProps<T extends TextElement = \"p\"> = {\n variant?: ResponsiveVariant | ResponsiveVariant[];\n color?: ColorKey | \"inherit\";\n as?: T;\n className?: string;\n children: React.ReactNode;\n weight?: Weight;\n} & HTMLPropsMap[T];\n\n// Add helper function to process variants\nconst processVariants = (\n variants: ResponsiveVariant | ResponsiveVariant[] | undefined\n): string => {\n if (!variants) return \"text-body-default\";\n\n const variantArray = Array.isArray(variants) ? variants : [variants];\n\n return variantArray\n .map((variant) => {\n if (variant.includes(\":\")) {\n const [breakpoint, typographyClass] = variant.split(\":\");\n return `${breakpoint}:text-${typographyClass}`;\n }\n return `text-${variant}`;\n })\n .join(\" \");\n};\n\nexport const Text = React.forwardRef(\n <T extends TextElement = \"p\">(\n {\n variant = \"body-default\",\n color = \"text-primary\",\n as,\n className,\n children,\n weight,\n ...props\n }: TextProps<T>,\n ref: React.ForwardedRef<HTMLElementByTag[T]>\n ) => {\n // Process typography classes with breakpoints\n const typographyClasses = processVariants(variant);\n\n // Get color styles\n const colorClasses =\n color && color === \"inherit\" ? \"inherit\" : color ? `text-${color}` : \"\";\n\n const suggestedElement = React.useMemo(() => {\n const baseVariant =\n typeof variant === \"string\"\n ? variant.split(\":\").pop()!\n : Array.isArray(variant)\n ? variant[0].split(\":\").pop()!\n : \"body-default\";\n return getElementFromVariant(baseVariant as TypographyKey);\n }, [variant]);\n\n const Component = (as || suggestedElement) as T;\n\n return (\n // @ts-expect-error TODO: figure this out\n <Component\n ref={ref}\n className={`font-sans antialiased ${typographyClasses} ${colorClasses} ${\n weight ? `!${fontWeight[weight]}` : \"\"\n } ${className ?? \"\"}`}\n {...props}\n >\n {children}\n </Component>\n );\n }\n);\n\nText.displayName = \"Text\";\n","import React, { ButtonHTMLAttributes } from \"react\";\nimport { focusRingStyles } from \"../utils/tailwind\";\n\nexport type PressableProps = ButtonHTMLAttributes<HTMLButtonElement>;\n\nexport const Pressable: React.FC<PressableProps> = ({\n children,\n type = \"button\",\n className,\n disabled,\n ...props\n}) => (\n <button\n // eslint-disable-next-line react/butt on-has-type\n type={type}\n disabled={disabled}\n className={`appearance-none hover:opacity-80 transition-all active:scale-95 ${focusRingStyles} ${className} ${disabled ? \"opacity-50 cursor-not-allowed\" : \"\"}`}\n {...props}\n >\n {children}\n </button>\n);\n","/**\n * Copyright 2022 Joe Bell. All rights reserved.\n *\n * This file is licensed to you under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with the\n * License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR REPRESENTATIONS OF ANY KIND, either express or implied. See the\n * License for the specific language governing permissions and limitations under\n * the License.\n */ import { clsx } from \"clsx\";\nconst falsyToString = (value)=>typeof value === \"boolean\" ? `${value}` : value === 0 ? \"0\" : value;\nexport const cx = clsx;\nexport const cva = (base, config)=>(props)=>{\n var _config_compoundVariants;\n if ((config === null || config === void 0 ? void 0 : config.variants) == null) return cx(base, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);\n const { variants, defaultVariants } = config;\n const getVariantClassNames = Object.keys(variants).map((variant)=>{\n const variantProp = props === null || props === void 0 ? void 0 : props[variant];\n const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];\n if (variantProp === null) return null;\n const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);\n return variants[variant][variantKey];\n });\n const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param)=>{\n let [key, value] = param;\n if (value === undefined) {\n return acc;\n }\n acc[key] = value;\n return acc;\n }, {});\n const getCompoundVariantClassNames = config === null || config === void 0 ? void 0 : (_config_compoundVariants = config.compoundVariants) === null || _config_compoundVariants === void 0 ? void 0 : _config_compoundVariants.reduce((acc, param)=>{\n let { class: cvClass, className: cvClassName, ...compoundVariantOptions } = param;\n return Object.entries(compoundVariantOptions).every((param)=>{\n let [key, value] = param;\n return Array.isArray(value) ? value.includes({\n ...defaultVariants,\n ...propsWithoutUndefined\n }[key]) : ({\n ...defaultVariants,\n ...propsWithoutUndefined\n })[key] === value;\n }) ? [\n ...acc,\n cvClass,\n cvClassName\n ] : acc;\n }, []);\n return cx(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);\n };\n\n","import * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../utils\";\n\nconst spinnerVariants = cva(\n \"animate-spin rounded-full border-current border-t-transparent\",\n {\n variants: {\n size: {\n sm: \"h-4 w-4 border-4\",\n md: \"h-6 w-6 border-4\",\n lg: \"h-8 w-8 border-8\"\n }\n },\n defaultVariants: {\n size: \"md\"\n }\n }\n);\n\nexport type SpinnerProps = {\n className?: string;\n customSize?: number;\n} & VariantProps<typeof spinnerVariants>;\n\nexport const Spinner = React.forwardRef<HTMLDivElement, SpinnerProps>(\n ({ size, className, customSize, ...props }, ref) => {\n const styles = customSize\n ? {\n width: customSize,\n height: customSize,\n borderWidth: Math.max(2, Math.floor(customSize / 16))\n }\n : {};\n\n return (\n <div\n role=\"status\"\n aria-label=\"Loading\"\n ref={ref}\n className={cn(spinnerVariants({ size }), \"text-primary-100\", className)}\n style={styles}\n {...props}\n >\n <span className=\"sr-only\">Loading...</span>\n </div>\n );\n }\n);\n\nSpinner.displayName = \"Spinner\";\n","import React, { useCallback, useMemo, useState } from \"react\";\nimport * as Popover from \"@radix-ui/react-popover\";\nimport { focusRingStylesCoerced } from \"../utils/tailwind\";\nimport { Input } from \"./Input\";\nimport { OptionProps, Option } from \"./Option\";\nimport { Tag } from \"./Tag\";\nimport { Text } from \"./Text\";\nimport { Icon } from \"./Icon\";\nimport { Spinner } from \"./Spinner\";\n\nexport type MultiSelectComboboxProps = {\n options: OptionProps[];\n selectedValues: string[];\n onSelectionChange: (values: string[]) => void;\n placeholder?: string;\n className?: string;\n label?: string;\n disabled?: boolean;\n labelClassName?: string;\n id?: string;\n maxSelections?: number;\n noOptionsMessage?: string;\n loading?: boolean;\n errorMessage?: string;\n};\n\nexport const MultiSelectCombobox = ({\n options,\n selectedValues,\n onSelectionChange,\n placeholder = \"Select items...\",\n className,\n label,\n labelClassName,\n id,\n maxSelections,\n disabled,\n noOptionsMessage,\n loading,\n errorMessage\n}: MultiSelectComboboxProps) => {\n const [open, setOpen] = useState(false);\n const [inputValue, setInputValue] = useState(\"\");\n\n const selectedOptions = useMemo(\n () => options.filter((option) => selectedValues.includes(option.value)),\n [options, selectedValues]\n );\n\n const filteredOptions = useMemo(\n () =>\n options.filter(\n (option) =>\n !selectedValues.includes(option.value) &&\n option.label.toLowerCase().includes(inputValue.toLowerCase())\n ),\n [options, selectedValues, inputValue]\n );\n\n const handleOptionSelect = useCallback(\n (value: string) => {\n onSelectionChange([...selectedValues, value]);\n setInputValue(\"\");\n setOpen(false);\n },\n [maxSelections, onSelectionChange, selectedValues]\n );\n\n const handleRemoveTag = useCallback(\n (valueToRemove: string) => {\n onSelectionChange(\n selectedValues.filter((value) => value !== valueToRemove)\n );\n },\n [onSelectionChange, selectedValues]\n );\n\n return (\n <div className=\"py-2\">\n <Popover.Root open={open} onOpenChange={setOpen}>\n <div\n className={`relative w-full font-sans text-text-secondary ${className}`}\n >\n <Popover.Trigger asChild>\n <div className=\"relative flex-1\">\n <Input\n id={id}\n label={label}\n labelClassName={labelClassName}\n placeholder={\n maxSelections && selectedValues.length >= maxSelections\n ? `Maximum ${maxSelections} items selected`\n : placeholder\n }\n value={inputValue}\n onChange={(e) => setInputValue(e.target.value)}\n className={`flex-1 ${open && focusRingStylesCoerced}`}\n disabled={\n disabled ||\n (!!maxSelections && selectedValues.length >= maxSelections)\n }\n end={\n loading ? (\n <Spinner size=\"sm\" />\n ) : (\n <Icon name=\"search-normal\" size={[\"lg:24\", 18]} />\n )\n }\n />\n </div>\n </Popover.Trigger>\n\n <Popover.Portal>\n <Popover.Content\n className=\"w-[--radix-popover-trigger-width] p-1 bg-white rounded-md shadow-lg border z-20\"\n sideOffset={5}\n >\n <div className=\"max-h-60 overflow-auto flex flex-col items-start\">\n {filteredOptions.length > 0 ? (\n filteredOptions.map(({ label, value }) => (\n <Option\n key={value}\n label={label}\n value={value}\n onChange={handleOptionSelect}\n />\n ))\n ) : (\n <Text variant=\"label-default\" className=\"text-text-secondary\">\n {noOptionsMessage || \"No results found\"}\n </Text>\n )}\n </div>\n </Popover.Content>\n </Popover.Portal>\n </div>\n </Popover.Root>\n <div className=\"flex flex-col gap-1 pt-2\">\n {errorMessage && (\n <Text variant=\"label-default\" color=\"tertiary-20\">\n {errorMessage}\n </Text>\n )}\n <div className=\"flex flex-wrap gap-2\">\n {selectedOptions.map((option) => (\n <Tag\n key={option.value}\n onClose={() => handleRemoveTag(option.value)}\n >\n {option.label}\n </Tag>\n ))}\n </div>\n </div>\n </div>\n );\n};\n"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
'use strict';var p=require('react'),f=require('@radix-ui/react-popover'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),icons=require('@deckai/icons');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var p__namespace=/*#__PURE__*/_interopNamespace(p);var f__namespace=/*#__PURE__*/_interopNamespace(f);var v="focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",S="ring-2 ring-ring ring-offset-2";var g=({children:e,type:s="button",className:r,disabled:o,...t})=>p__namespace.default.createElement("button",{type:s,disabled:o,className:`appearance-none hover:opacity-80 transition-all active:scale-95 ${v} ${r} ${o?"opacity-50 cursor-not-allowed":""}`,...t},e);var T={sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},j=e=>{if(!e)return {width:"48px",height:"48px"};let s=Array.isArray(e)?e:[e],r={},o;return s.forEach(t=>{if(typeof t=="number")o=`${t}px`;else {let[n,i]=t.split(":"),a=parseInt(i,10);r[`@media (minWidth: ${T[n]})`]=`${a}px`;}}),{width:o||"48px",height:o||"48px",...Object.entries(r).reduce((t,[n,i])=>({...t,[n]:{width:i,height:i}}),{})}},$=({src:e,size:s=48,onClick:r,...o})=>{let t=j(s),n=e?p__namespace.default.createElement("img",{src:e,alt:"avatar",className:"rounded-full",style:t,...o}):p__namespace.default.createElement("div",{style:t,className:"rounded-full bg-gray-200"});return r?p__namespace.default.createElement(g,{onClick:r},n):n};function d(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var k={primary:"#080808",secondary:"#666666",white:"#ffffff",primaryBlue:"#089CCB"},_={sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},F=e=>{if(!e)return {width:"24px",height:"24px"};let s=Array.isArray(e)?e:[e],r={},o;return s.forEach(t=>{if(typeof t=="number")o=`${t}px`;else {let[n,i]=t.split(":"),a=parseInt(i,10);r[`@media (min-width: ${_[n]})`]=`${a}px`;}}),{width:o||"24px",height:o||"24px",...Object.entries(r).reduce((t,[n,i])=>({...t,[n]:{width:i,height:i}}),{})}},C=p__namespace.default.forwardRef(({name:e,size:s=24,color:r="primary",title:o,className:t,style:n={},...i},a)=>{let m=icons.IconMap[e],x=F(s);return p__namespace.default.createElement("div",{className:d("flex justify-center items-center",t),style:{...x,"--icon-stroke":k[r],...n}},p__namespace.default.createElement(m,{ref:a,"aria-hidden":!o,"aria-label":o,stroke:e.includes("filled")?void 0:k[r],...i}))});C.displayName="Icon";var w=({className:e,end:s,iconName:r,color:o,size:t,title:n,...i})=>p__namespace.createElement("div",{className:"relative"},p__namespace.createElement("input",{className:d(`font-sans lg:text-body-default text-xs flex w-full rounded-lg border border-secondary-50 bg-background-0 px-3 md:py-3 py-2 text-secondary ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-secondary text-text-primary ${v} disabled:cursor-not-allowed disabled:opacity-50 md:text-md`,s&&"pr-10",e),...i}),s&&p__namespace.createElement("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3"},r?p__namespace.createElement(C,{name:r,color:o,size:t,title:n}):s));var O=({value:e,label:s,onChange:r,selected:o})=>p__namespace.default.createElement("button",{type:"button",className:d("relative w-full h-full text-left px-2 py-1.5 text-sm cursor-pointer hover:bg-gray-100 rounded",o&&"bg-gray-100"),onClick:()=>{r?.(e);}},s);var A=({options:e,placeholder:s="Select an item...",value:r,onChange:o,end:t,className:n})=>{let[i,a]=p.useState(!1),[m,x]=p.useState(r),N=p.useMemo(()=>e.find(c=>c.value===m),[m,e]),I=e.filter(c=>m?c.label.toLowerCase().includes(m.toLowerCase()):e),V=p.useCallback(c=>{o(c),a(!1),x(N?.label);},[o,N?.label]);return p__namespace.default.createElement(f__namespace.Root,{open:i,onOpenChange:a},p__namespace.default.createElement("div",{className:`relative w-full font-sans text-text-secondary ${n}`},p__namespace.default.createElement(f__namespace.Trigger,{asChild:!0},p__namespace.default.createElement("div",{className:"flex"},p__namespace.default.createElement("div",{className:"relative flex-1"},p__namespace.default.createElement(w,{placeholder:s,value:m,onChange:c=>x(c.target.value),end:t,className:`flex-1 ${i&&S}`})))),p__namespace.default.createElement(f__namespace.Portal,null,p__namespace.default.createElement(f__namespace.Content,{className:"w-[--radix-popover-trigger-width] p-1 bg-white rounded-md shadow-lg border mt-1 z-20",sideOffset:5},p__namespace.default.createElement("div",{className:"max-h-60 overflow-auto flex flex-col items-start"},I.length>0?I.map(({label:c,value:B},z)=>p__namespace.default.createElement(O,{onChange:V,value:B,key:z,label:c})):p__namespace.default.createElement("div",{className:"px-2 py-1.5 text-sm text-gray-500"},"No results found"))))))};var M=({className:e})=>p__namespace.default.createElement("div",{className:d("lg:w-[76px] lg:h-[25px] w-[58px] h-[19px]",e)},p__namespace.default.createElement("svg",{width:"100%",height:"100%",viewBox:"0 0 76 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},p__namespace.default.createElement("path",{d:"M0.8 15.584C0.8 13.9413 1.12 12.4693 1.76 11.168C2.4 9.84533 3.27467 8.8 4.384 8.032C5.49333 7.264 6.77333 6.88 8.224 6.88C9.39733 6.88 10.464 7.168 11.424 7.744C12.384 8.29867 13.1093 9.03467 13.6 9.952V0.639999H18.72V18.304C18.72 18.816 18.8053 19.1787 18.976 19.392C19.1467 19.584 19.424 19.7013 19.808 19.744V24C18.912 24.1707 18.1867 24.256 17.632 24.256C16.7573 24.256 16.0427 24.064 15.488 23.68C14.9547 23.296 14.624 22.7627 14.496 22.08L14.4 21.216C13.8027 22.2613 12.992 23.04 11.968 23.552C10.944 24.064 9.86667 24.32 8.736 24.32C7.584 24.32 6.51733 24.1067 5.536 23.68C4.576 23.232 3.73333 22.6133 3.008 21.824C2.304 21.0347 1.76 20.1067 1.376 19.04C0.992 17.9733 0.8 16.8213 0.8 15.584ZM13.632 17.664V14.144C13.4187 13.568 13.1093 13.0667 12.704 12.64C12.32 12.2133 11.872 11.872 11.36 11.616C10.8693 11.36 10.368 11.232 9.856 11.232C9.30133 11.232 8.78933 11.3493 8.32 11.584C7.872 11.8187 7.47733 12.1493 7.136 12.576C6.79467 12.9813 6.528 13.4507 6.336 13.984C6.16533 14.5173 6.08 15.0827 6.08 15.68C6.08 16.2987 6.176 16.8747 6.368 17.408C6.58133 17.92 6.86933 18.3787 7.232 18.784C7.59467 19.168 8.02133 19.4667 8.512 19.68C9.00267 19.8933 9.536 20 10.112 20C10.4747 20 10.8267 19.9467 11.168 19.84C11.5093 19.712 11.8293 19.552 12.128 19.36C12.448 19.168 12.736 18.9227 12.992 18.624C13.248 18.3253 13.4613 18.0053 13.632 17.664ZM30.0895 24.32C28.6602 24.32 27.3908 24.096 26.2815 23.648C25.1722 23.1787 24.2228 22.5493 23.4335 21.76C22.6655 20.9707 22.0788 20.064 21.6735 19.04C21.2682 17.9947 21.0655 16.9067 21.0655 15.776C21.0655 14.1547 21.4175 12.6827 22.1215 11.36C22.8468 10.016 23.8815 8.93867 25.2255 8.128C26.5695 7.296 28.1908 6.88 30.0895 6.88C31.9882 6.88 33.5988 7.28533 34.9215 8.096C36.2655 8.90667 37.2895 9.97333 37.9935 11.296C38.6975 12.5973 39.0495 14.016 39.0495 15.552C39.0495 15.8507 39.0282 16.1493 38.9855 16.448C38.9642 16.7253 38.9428 16.9707 38.9215 17.184H26.5055C26.5695 17.9307 26.7722 18.56 27.1135 19.072C27.4762 19.584 27.9348 19.9787 28.4895 20.256C29.0442 20.512 29.6308 20.64 30.2495 20.64C31.0175 20.64 31.7322 20.4587 32.3935 20.096C33.0762 19.7333 33.5455 19.2427 33.8015 18.624L38.1535 19.84C37.7268 20.7147 37.1188 21.4933 36.3295 22.176C35.5615 22.8373 34.6442 23.36 33.5775 23.744C32.5322 24.128 31.3695 24.32 30.0895 24.32ZM26.3775 14.048H33.6735C33.5882 13.344 33.3855 12.736 33.0655 12.224C32.7455 11.6907 32.3188 11.2853 31.7855 11.008C31.2522 10.7093 30.6655 10.56 30.0255 10.56C29.3642 10.56 28.7668 10.7093 28.2335 11.008C27.7215 11.2853 27.3055 11.6907 26.9855 12.224C26.6655 12.736 26.4628 13.344 26.3775 14.048ZM48.762 24.32C47.3327 24.32 46.0633 24.0853 44.954 23.616C43.8447 23.1467 42.8953 22.5067 42.106 21.696C41.338 20.8853 40.7513 19.9573 40.346 18.912C39.9407 17.8667 39.738 16.7573 39.738 15.584C39.738 14.048 40.09 12.6187 40.794 11.296C41.5193 9.97333 42.554 8.90667 43.898 8.096C45.242 7.28533 46.8633 6.88 48.762 6.88C50.682 6.88 52.3033 7.296 53.626 8.128C54.97 8.93867 55.9727 10.0053 56.634 11.328L51.642 12.832C51.322 12.32 50.906 11.9253 50.394 11.648C49.9033 11.3707 49.3487 11.232 48.73 11.232C48.026 11.232 47.386 11.4133 46.81 11.776C46.2553 12.1387 45.8073 12.64 45.466 13.28C45.146 13.92 44.986 14.688 44.986 15.584C44.986 16.4587 45.1567 17.2267 45.498 17.888C45.8393 18.5493 46.2873 19.072 46.842 19.456C47.3967 19.8187 48.026 20 48.73 20C49.1567 20 49.5513 19.936 49.914 19.808C50.298 19.6587 50.6393 19.456 50.938 19.2C51.258 18.944 51.5033 18.656 51.674 18.336L56.666 19.872C56.2607 20.7253 55.674 21.4933 54.906 22.176C54.1593 22.8373 53.274 23.36 52.25 23.744C51.226 24.128 50.0633 24.32 48.762 24.32ZM69.636 24L65.252 17.28L63.46 19.104V24H58.34V0.639999H63.46V14.144L69.156 7.2H74.564L68.516 14.432L75.076 24H69.636Z",fill:"#080808"})));var E=({iconName:e,hasNotification:s,color:r,title:o,...t})=>(console.log({hasNotification:s}),p__namespace.default.createElement(g,{className:"relative lg:px-7 md:px-5 py-3",...t},p__namespace.default.createElement(C,{name:e,color:r,title:o}),s&&p__namespace.default.createElement("div",{className:"w-3 h-3 bg-red-500 rounded-full absolute top-3 right-5"})));var Ze=({searchOptions:e,onSearchChange:s,navbarItems:r,onLogoClick:o,onProfileClick:t,avatarImage:n})=>p__namespace.default.createElement("div",{className:"flex py-6 lg:px-10 md:px-5 px-6 justify-between md:gap-6 gap-3 sm:relative sticky top-0"},p__namespace.default.createElement("div",{className:"flex flex-1 md:gap-6 gap-3 items-center"},p__namespace.default.createElement(g,{onClick:o,title:"Deck AI"},p__namespace.default.createElement(M,null)),p__namespace.default.createElement(A,{options:e,placeholder:"Search for a creator, type of content, or platform...",end:p__namespace.default.createElement(C,{name:"search-normal",size:["lg:24",18]}),onChange:s,className:"flex-1 max-w-lg"})),p__namespace.default.createElement("div",{className:"flex gap-4"},p__namespace.default.createElement("div",{className:"md:flex hidden gap-2 border-b-2 border-stroke items-center"},r.map(({iconName:i,title:a,onClick:m})=>p__namespace.default.createElement(E,{key:a,iconName:i,title:a,onClick:m}))),p__namespace.default.createElement("div",{className:"flex"},p__namespace.default.createElement($,{onClick:t,src:n,size:["sm:48",40]}))));if (exports.default) module.exports = exports.default;
|
|
2
|
-
exports.Navbar=
|
|
1
|
+
'use strict';var p=require('react'),f=require('@radix-ui/react-popover'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),icons=require('@deckai/icons');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var p__namespace=/*#__PURE__*/_interopNamespace(p);var f__namespace=/*#__PURE__*/_interopNamespace(f);var b="focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",w="ring-2 ring-ring ring-offset-2";var x=({children:e,type:s="button",className:r,disabled:o,...t})=>p__namespace.default.createElement("button",{type:s,disabled:o,className:`appearance-none hover:opacity-80 transition-all active:scale-95 ${b} ${r} ${o?"opacity-50 cursor-not-allowed":""}`,...t},e);var G={sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},Z=e=>{if(!e)return {width:"48px",height:"48px"};let s=Array.isArray(e)?e:[e],r={},o;return s.forEach(t=>{if(typeof t=="number")o=`${t}px`;else {let[i,n]=t.split(":"),a=parseInt(n,10);r[`@media (minWidth: ${G[i]})`]=`${a}px`;}}),{width:o||"48px",height:o||"48px",...Object.entries(r).reduce((t,[i,n])=>({...t,[i]:{width:n,height:n}}),{})}},O=({src:e,size:s=48,onClick:r,...o})=>{let t=Z(s),i=e?p__namespace.default.createElement("img",{src:e,alt:"avatar",className:"rounded-full",style:t,...o}):p__namespace.default.createElement("div",{style:t,className:"rounded-full bg-gray-200"});return r?p__namespace.default.createElement(x,{onClick:r},i):i};function c(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var L={primary:"#080808",secondary:"#666666",white:"#ffffff",primaryBlue:"#089CCB"},Q={sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},D=e=>{if(!e)return {width:"24px",height:"24px"};let s=Array.isArray(e)?e:[e],r={},o;return s.forEach(t=>{if(typeof t=="number")o=`${t}px`;else {let[i,n]=t.split(":"),a=parseInt(n,10);r[`@media (min-width: ${Q[i]})`]=`${a}px`;}}),{width:o||"24px",height:o||"24px",...Object.entries(r).reduce((t,[i,n])=>({...t,[i]:{width:n,height:n}}),{})}},C=p__namespace.default.forwardRef(({name:e,size:s=24,color:r="primary",title:o,className:t,style:i={},...n},a)=>{let d=icons.IconMap[e],u=D(s);return p__namespace.default.createElement("div",{className:c("flex justify-center items-center",t),style:{...u,"--icon-stroke":L[r],...i}},p__namespace.default.createElement(d,{ref:a,"aria-hidden":!o,"aria-label":o,stroke:e.includes("filled")?void 0:L[r],...n}))});C.displayName="Icon";var A=({className:e,end:s,iconName:r,color:o,size:t,title:i,label:n,labelClassName:a,id:d,...u})=>p__namespace.createElement("div",{className:"space-y-2"},n&&p__namespace.createElement("label",{htmlFor:d,className:c("block text-sm font-medium text-text-primary",a)},n),p__namespace.createElement("div",{className:"relative"},p__namespace.createElement("input",{id:d,className:c(`font-sans lg:text-body-default text-xs flex w-full rounded-lg border border-secondary-50 bg-background-0 px-3 md:py-3 py-2 text-secondary ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-secondary text-text-primary ${b} disabled:cursor-not-allowed disabled:opacity-50 md:text-md`,s&&"pr-10",e),...u}),s&&p__namespace.createElement("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3"},r?p__namespace.createElement(C,{name:r,color:o,size:t,title:i}):s)));var M=({value:e,label:s,onChange:r,selected:o})=>p__namespace.default.createElement("button",{type:"button",className:c("relative w-full h-full text-left px-2 py-1.5 text-sm cursor-pointer hover:bg-gray-100 rounded",o&&"bg-gray-100"),onClick:()=>{r?.(e);}},s);var V=({options:e,placeholder:s="Select an item...",value:r,onChange:o,end:t,className:i,label:n,labelClassName:a,id:d})=>{let[u,I]=p.useState(!1),[v,S]=p.useState(r),k=p.useMemo(()=>e.find(m=>m.value===v),[v,e]),$=e.filter(m=>v?m.label.toLowerCase().includes(v.toLowerCase()):e),H=p.useCallback(m=>{o(m),I(!1),S(k?.label);},[o,k?.label]);return p__namespace.default.createElement(f__namespace.Root,{open:u,onOpenChange:I},p__namespace.default.createElement("div",{className:`relative w-full font-sans text-text-secondary ${i}`},p__namespace.default.createElement(f__namespace.Trigger,{asChild:!0},p__namespace.default.createElement("div",{className:"flex"},p__namespace.default.createElement("div",{className:"relative flex-1"},p__namespace.default.createElement(A,{id:d,label:n,labelClassName:a,placeholder:s,value:v,onChange:m=>S(m.target.value),end:t,className:`flex-1 ${u&&w}`})))),p__namespace.default.createElement(f__namespace.Portal,null,p__namespace.default.createElement(f__namespace.Content,{className:"w-[--radix-popover-trigger-width] p-1 bg-white rounded-md shadow-lg border mt-1 z-20",sideOffset:5},p__namespace.default.createElement("div",{className:"max-h-60 overflow-auto flex flex-col items-start"},$.length>0?$.map(({label:m,value:T},j)=>p__namespace.default.createElement(M,{onChange:H,value:T,key:j,label:m})):p__namespace.default.createElement("div",{className:"px-2 py-1.5 text-sm text-gray-500"},"No results found"))))))};var B=({className:e})=>p__namespace.default.createElement("div",{className:c("lg:w-[76px] lg:h-[25px] w-[58px] h-[19px]",e)},p__namespace.default.createElement("svg",{width:"100%",height:"100%",viewBox:"0 0 76 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},p__namespace.default.createElement("path",{d:"M0.8 15.584C0.8 13.9413 1.12 12.4693 1.76 11.168C2.4 9.84533 3.27467 8.8 4.384 8.032C5.49333 7.264 6.77333 6.88 8.224 6.88C9.39733 6.88 10.464 7.168 11.424 7.744C12.384 8.29867 13.1093 9.03467 13.6 9.952V0.639999H18.72V18.304C18.72 18.816 18.8053 19.1787 18.976 19.392C19.1467 19.584 19.424 19.7013 19.808 19.744V24C18.912 24.1707 18.1867 24.256 17.632 24.256C16.7573 24.256 16.0427 24.064 15.488 23.68C14.9547 23.296 14.624 22.7627 14.496 22.08L14.4 21.216C13.8027 22.2613 12.992 23.04 11.968 23.552C10.944 24.064 9.86667 24.32 8.736 24.32C7.584 24.32 6.51733 24.1067 5.536 23.68C4.576 23.232 3.73333 22.6133 3.008 21.824C2.304 21.0347 1.76 20.1067 1.376 19.04C0.992 17.9733 0.8 16.8213 0.8 15.584ZM13.632 17.664V14.144C13.4187 13.568 13.1093 13.0667 12.704 12.64C12.32 12.2133 11.872 11.872 11.36 11.616C10.8693 11.36 10.368 11.232 9.856 11.232C9.30133 11.232 8.78933 11.3493 8.32 11.584C7.872 11.8187 7.47733 12.1493 7.136 12.576C6.79467 12.9813 6.528 13.4507 6.336 13.984C6.16533 14.5173 6.08 15.0827 6.08 15.68C6.08 16.2987 6.176 16.8747 6.368 17.408C6.58133 17.92 6.86933 18.3787 7.232 18.784C7.59467 19.168 8.02133 19.4667 8.512 19.68C9.00267 19.8933 9.536 20 10.112 20C10.4747 20 10.8267 19.9467 11.168 19.84C11.5093 19.712 11.8293 19.552 12.128 19.36C12.448 19.168 12.736 18.9227 12.992 18.624C13.248 18.3253 13.4613 18.0053 13.632 17.664ZM30.0895 24.32C28.6602 24.32 27.3908 24.096 26.2815 23.648C25.1722 23.1787 24.2228 22.5493 23.4335 21.76C22.6655 20.9707 22.0788 20.064 21.6735 19.04C21.2682 17.9947 21.0655 16.9067 21.0655 15.776C21.0655 14.1547 21.4175 12.6827 22.1215 11.36C22.8468 10.016 23.8815 8.93867 25.2255 8.128C26.5695 7.296 28.1908 6.88 30.0895 6.88C31.9882 6.88 33.5988 7.28533 34.9215 8.096C36.2655 8.90667 37.2895 9.97333 37.9935 11.296C38.6975 12.5973 39.0495 14.016 39.0495 15.552C39.0495 15.8507 39.0282 16.1493 38.9855 16.448C38.9642 16.7253 38.9428 16.9707 38.9215 17.184H26.5055C26.5695 17.9307 26.7722 18.56 27.1135 19.072C27.4762 19.584 27.9348 19.9787 28.4895 20.256C29.0442 20.512 29.6308 20.64 30.2495 20.64C31.0175 20.64 31.7322 20.4587 32.3935 20.096C33.0762 19.7333 33.5455 19.2427 33.8015 18.624L38.1535 19.84C37.7268 20.7147 37.1188 21.4933 36.3295 22.176C35.5615 22.8373 34.6442 23.36 33.5775 23.744C32.5322 24.128 31.3695 24.32 30.0895 24.32ZM26.3775 14.048H33.6735C33.5882 13.344 33.3855 12.736 33.0655 12.224C32.7455 11.6907 32.3188 11.2853 31.7855 11.008C31.2522 10.7093 30.6655 10.56 30.0255 10.56C29.3642 10.56 28.7668 10.7093 28.2335 11.008C27.7215 11.2853 27.3055 11.6907 26.9855 12.224C26.6655 12.736 26.4628 13.344 26.3775 14.048ZM48.762 24.32C47.3327 24.32 46.0633 24.0853 44.954 23.616C43.8447 23.1467 42.8953 22.5067 42.106 21.696C41.338 20.8853 40.7513 19.9573 40.346 18.912C39.9407 17.8667 39.738 16.7573 39.738 15.584C39.738 14.048 40.09 12.6187 40.794 11.296C41.5193 9.97333 42.554 8.90667 43.898 8.096C45.242 7.28533 46.8633 6.88 48.762 6.88C50.682 6.88 52.3033 7.296 53.626 8.128C54.97 8.93867 55.9727 10.0053 56.634 11.328L51.642 12.832C51.322 12.32 50.906 11.9253 50.394 11.648C49.9033 11.3707 49.3487 11.232 48.73 11.232C48.026 11.232 47.386 11.4133 46.81 11.776C46.2553 12.1387 45.8073 12.64 45.466 13.28C45.146 13.92 44.986 14.688 44.986 15.584C44.986 16.4587 45.1567 17.2267 45.498 17.888C45.8393 18.5493 46.2873 19.072 46.842 19.456C47.3967 19.8187 48.026 20 48.73 20C49.1567 20 49.5513 19.936 49.914 19.808C50.298 19.6587 50.6393 19.456 50.938 19.2C51.258 18.944 51.5033 18.656 51.674 18.336L56.666 19.872C56.2607 20.7253 55.674 21.4933 54.906 22.176C54.1593 22.8373 53.274 23.36 52.25 23.744C51.226 24.128 50.0633 24.32 48.762 24.32ZM69.636 24L65.252 17.28L63.46 19.104V24H58.34V0.639999H63.46V14.144L69.156 7.2H74.564L68.516 14.432L75.076 24H69.636Z",fill:"#080808"})));var z=({iconName:e,hasNotification:s,color:r,title:o,...t})=>(console.log({hasNotification:s}),p__namespace.default.createElement(x,{className:"relative lg:px-7 md:px-5 py-3",...t},p__namespace.default.createElement(C,{name:e,color:r,title:o}),s&&p__namespace.default.createElement("div",{className:"w-3 h-3 bg-red-500 rounded-full absolute top-3 right-5"})));var Ke=({searchOptions:e,onSearchChange:s,navbarItems:r,onLogoClick:o,onProfileClick:t,avatarImage:i})=>p__namespace.default.createElement("div",{className:"flex py-6 lg:px-10 md:px-5 px-6 justify-between md:gap-6 gap-3 sm:relative sticky top-0"},p__namespace.default.createElement("div",{className:"flex flex-1 md:gap-6 gap-3 items-center"},p__namespace.default.createElement(x,{onClick:o,title:"Deck AI"},p__namespace.default.createElement(B,null)),p__namespace.default.createElement(V,{options:e,placeholder:"Search for a creator, type of content, or platform...",end:p__namespace.default.createElement(C,{name:"search-normal",size:["lg:24",18]}),onChange:s,className:"flex-1 max-w-lg"})),p__namespace.default.createElement("div",{className:"flex gap-4"},p__namespace.default.createElement("div",{className:"md:flex hidden gap-2 border-b-2 border-stroke items-center"},r.map(({iconName:n,title:a,onClick:d})=>p__namespace.default.createElement(z,{key:a,iconName:n,title:a,onClick:d}))),p__namespace.default.createElement("div",{className:"flex"},p__namespace.default.createElement(O,{onClick:t,src:i,size:["sm:48",40]}))));if (exports.default) module.exports = exports.default;
|
|
2
|
+
exports.Navbar=Ke;//# sourceMappingURL=Navbar.cjs.map
|
|
3
3
|
//# sourceMappingURL=Navbar.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/tailwind.ts","../../src/components/Pressable.tsx","../../src/components/Avatar.tsx","../../src/utils/index.ts","../../src/components/Icon.tsx","../../src/components/Input.tsx","../../src/components/Option.tsx","../../src/components/Combobox.tsx","../../src/components/Logo.tsx","../../src/components/NavbarItem.tsx","../../src/components/Navbar.tsx"],"names":["focusRingStyles","focusRingStylesCoerced","Pressable","children","type","className","disabled","props","React","BREAKPOINT_MAP","processSizes","sizes","sizeArray","mediaQueries","baseSize","size","breakpoint","valueStr","value","acc","query","Avatar","src","onClick","sizeStyles","content","cn","inputs","twMerge","clsx","COLOR_MAP","Icon","name","color","title","style","ref","IconComponent","IconMap","Input","end","iconName","u","Option","label","onChange","selected","Combobox","options","placeholder","open","setOpen","useState","inputValue","setInputValue","selectedOption","useMemo","option","filteredItems","handleOptionChange","useCallback","f","e","optionValue","index","Logo","NavbarItem","hasNotification","Navbar","searchOptions","onSearchChange","navbarItems","onLogoClick","onProfileClick","avatarImage"],"mappings":"8jBAmEO,IAAMA,CACX,CAAA,qGAAA,CAEWC,CAAyB,CAAA,gCAAA,CCjE/B,IAAMC,CAAAA,CAAsC,CAAC,CAClD,QAAAC,CAAAA,CAAAA,CACA,IAAAC,CAAAA,CAAAA,CAAO,QACP,CAAA,SAAA,CAAAC,CACA,CAAA,QAAA,CAAAC,CACA,CAAA,GAAGC,CACL,CAAA,GACEC,qBAAA,aAAC,CAAA,QAAA,CAAA,CAEC,IAAMJ,CAAAA,CAAAA,CACN,QAAUE,CAAAA,CAAAA,CACV,SAAW,CAAA,CAAA,gEAAA,EAAmEN,CAAe,CAAA,CAAA,EAAIK,CAAS,CAAA,CAAA,EAAIC,CAAW,CAAA,+BAAA,CAAkC,EAAE,CAAA,CAAA,CAC5J,GAAGC,CAAAA,CAAAA,CAEHJ,CACH,CAAA,CCdF,IAAMM,CAAAA,CAA6C,CACjD,EAAA,CAAI,OACJ,CAAA,EAAA,CAAI,OACJ,CAAA,EAAA,CAAI,QACJ,CAAA,EAAA,CAAI,SACJ,KAAO,CAAA,QACT,CAOMC,CAAAA,CAAAA,CACJC,CACwB,EAAA,CACxB,GAAI,CAACA,CAAO,CAAA,OAAO,CAAE,KAAA,CAAO,MAAQ,CAAA,MAAA,CAAQ,MAAO,CAAA,CAEnD,IAAMC,CAAAA,CAAY,KAAM,CAAA,OAAA,CAAQD,CAAK,CAAA,CAAIA,CAAQ,CAAA,CAACA,CAAK,CAAA,CACjDE,CAAuC,CAAA,EACzCC,CAAAA,CAAAA,CAGJ,OAAAF,CAAU,CAAA,OAAA,CAASG,CAAS,EAAA,CAC1B,GAAI,OAAOA,CAA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CACT,CAAA,GAAA,CAAKC,CACL,CAAA,IAAA,CAAM,CAAC,OAAA,CAAS,EAAE,CAAA,CACpB,CACF,CACF,CACF","file":"Navbar.cjs","sourcesContent":["import { Colors, Typography } from \"../types/tailwind\";\n\n// Generate safelist patterns for all color utilities so you can use any theme color variable in your code\nexport const generateSafelist = (colors: Colors, typography: Typography) => {\n const colorNames = Object.keys(colors) as (keyof Colors)[];\n const utilities = [\"bg\", \"text\", \"border\", \"ring\", \"divide\", \"outline\"];\n const variants = [\"hover:\", \"focus:\", \"active:\", \"disabled:\"];\n\n const safelist: string[] = [];\n\n colorNames.forEach((colorName) => {\n if (typeof colors[colorName] === \"object\") {\n // Handle nested color objects (with number keys)\n Object.keys(colors[colorName]).forEach((shade) => {\n utilities.forEach((utility) => {\n // Base utility\n safelist.push(`${utility}-${colorName}-${shade}`);\n\n // Variant utilities\n variants.forEach((variant) => {\n safelist.push(`${variant}${utility}-${colorName}-${shade}`);\n });\n });\n });\n } else {\n // Handle direct color values\n utilities.forEach((utility) => {\n safelist.push(`${utility}-${colorName}`);\n\n variants.forEach((variant) => {\n safelist.push(`${variant}${utility}-${colorName}`);\n });\n });\n }\n });\n\n // Generate typography classes\n Object.entries(typography).forEach(([family, sizes]) => {\n Object.keys(sizes).forEach((size) => {\n // Base typography classes\n safelist.push(`text-${family}-${size}`);\n\n // Add variants\n variants.forEach((variant) => {\n safelist.push(`${variant}text-${family}-${size}`);\n });\n });\n });\n\n const breakpoints = [\"sm\", \"md\", \"lg\", \"xl\", \"2xl\"];\n const typographyClasses = Object.entries(typography).flatMap(\n ([category, sizes]) =>\n Object.keys(sizes).map((size) => `text-${category}-${size}`)\n );\n\n // Generate responsive variants\n const responsiveTypographyClasses = typographyClasses.flatMap((className) =>\n breakpoints.map((breakpoint) => `${breakpoint}:${className}`)\n );\n\n return [\n ...typographyClasses,\n ...responsiveTypographyClasses\n // ... rest of your safelist\n ];\n};\n\nexport const focusRingStyles =\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\";\n\nexport const focusRingStylesCoerced = \"ring-2 ring-ring ring-offset-2\";\n","import React, { ButtonHTMLAttributes } from \"react\";\nimport { focusRingStyles } from \"../utils/tailwind\";\n\nexport type PressableProps = ButtonHTMLAttributes<HTMLButtonElement>;\n\nexport const Pressable: React.FC<PressableProps> = ({\n children,\n type = \"button\",\n className,\n disabled,\n ...props\n}) => (\n <button\n // eslint-disable-next-line react/butt on-has-type\n type={type}\n disabled={disabled}\n className={`appearance-none hover:opacity-80 transition-all active:scale-95 ${focusRingStyles} ${className} ${disabled ? \"opacity-50 cursor-not-allowed\" : \"\"}`}\n {...props}\n >\n {children}\n </button>\n);\n","import React from \"react\";\nimport { Pressable } from \"./Pressable\";\n\ntype Breakpoint = \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\";\ntype ResponsiveSize = number | `${Breakpoint}:${number}`;\n\nconst BREAKPOINT_MAP: Record<Breakpoint, string> = {\n sm: \"640px\",\n md: \"768px\",\n lg: \"1024px\",\n xl: \"1280px\",\n \"2xl\": \"1536px\"\n};\n\nexport type AvatarProps = {\n src?: string;\n size?: ResponsiveSize | ResponsiveSize[];\n} & Pick<React.ComponentProps<typeof Pressable>, \"onClick\">;\n\nconst processSizes = (\n sizes: ResponsiveSize | ResponsiveSize[] | undefined\n): React.CSSProperties => {\n if (!sizes) return { width: \"48px\", height: \"48px\" };\n\n const sizeArray = Array.isArray(sizes) ? sizes : [sizes];\n const mediaQueries: Record<string, string> = {};\n let baseSize: string | undefined;\n\n // Process each size\n sizeArray.forEach((size) => {\n if (typeof size === \"number\") {\n baseSize = `${size}px`;\n } else {\n const [breakpoint, valueStr] = size.split(\":\") as [Breakpoint, string];\n const value = parseInt(valueStr, 10);\n mediaQueries[`@media (minWidth: ${BREAKPOINT_MAP[breakpoint]})`] =\n `${value}px`;\n }\n });\n\n // Create the style object with the correct structure\n return {\n width: baseSize || \"48px\",\n height: baseSize || \"48px\",\n ...Object.entries(mediaQueries).reduce(\n (acc, [query, size]) => ({\n ...acc,\n [query]: {\n width: size,\n height: size\n }\n }),\n {}\n )\n };\n};\n\nexport const Avatar = ({ src, size = 48, onClick, ...props }: AvatarProps) => {\n const sizeStyles = processSizes(size);\n\n const content = src ? (\n <img\n src={src}\n alt=\"avatar\"\n className=\"rounded-full\"\n style={sizeStyles}\n {...props}\n />\n ) : (\n <div style={sizeStyles} className=\"rounded-full bg-gray-200\" />\n );\n\n return onClick ? <Pressable onClick={onClick}>{content}</Pressable> : content;\n};\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\nexport const noopFn = () => {};\n","import React, { SVGProps } from \"react\";\nimport { IconName, IconMap } from \"@deckai/icons\";\nimport { IconColors } from \"../types/tailwind\";\nimport { cn } from \"../utils\";\n\ntype Breakpoint = \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\";\ntype ResponsiveSize = number | `${Breakpoint}:${number}`;\n\nexport type IconProps = {\n name: IconName;\n /** @default 24 */\n size?: ResponsiveSize | ResponsiveSize[];\n /** @default primary */\n color?: IconColors;\n title?: string;\n className?: string;\n style?: React.CSSProperties;\n} & Omit<SVGProps<SVGSVGElement>, \"aria-hidden\" | \"aria-label\">;\n\nconst COLOR_MAP: Record<IconColors, string> = {\n primary: \"#080808\",\n secondary: \"#666666\",\n white: \"#ffffff\",\n primaryBlue: \"#089CCB\"\n};\n\nconst BREAKPOINT_MAP: Record<Breakpoint, string> = {\n sm: \"640px\",\n md: \"768px\",\n lg: \"1024px\",\n xl: \"1280px\",\n \"2xl\": \"1536px\"\n};\n\nconst processSizes = (\n sizes: ResponsiveSize | ResponsiveSize[] | undefined\n): React.CSSProperties => {\n if (!sizes) return { width: \"24px\", height: \"24px\" };\n\n const sizeArray = Array.isArray(sizes) ? sizes : [sizes];\n const mediaQueries: Record<string, string> = {};\n let baseSize: string | undefined;\n\n // Process each size\n sizeArray.forEach((size) => {\n if (typeof size === \"number\") {\n baseSize = `${size}px`;\n } else {\n const [breakpoint, valueStr] = size.split(\":\") as [Breakpoint, string];\n const value = parseInt(valueStr, 10);\n mediaQueries[`@media (min-width: ${BREAKPOINT_MAP[breakpoint]})`] =\n `${value}px`;\n }\n });\n\n // Create the style object with the correct structure\n return {\n width: baseSize || \"24px\",\n height: baseSize || \"24px\",\n ...Object.entries(mediaQueries).reduce(\n (acc, [query, size]) => ({\n ...acc,\n [query]: {\n width: size,\n height: size\n }\n }),\n {}\n )\n };\n};\n\nexport const Icon = React.forwardRef<SVGSVGElement, IconProps>(\n (\n {\n name,\n size = 24,\n color = \"primary\",\n title,\n className,\n style = {},\n ...props\n },\n ref\n ) => {\n const IconComponent = IconMap[name];\n const sizeStyles = processSizes(size);\n\n return (\n <div\n className={cn(\"flex justify-center items-center\", className)}\n style={{\n ...sizeStyles,\n [\"--icon-stroke\" as string]: COLOR_MAP[color],\n ...style\n }}\n >\n <IconComponent\n ref={ref}\n aria-hidden={!title}\n aria-label={title}\n stroke={name.includes(\"filled\") ? undefined : COLOR_MAP[color]}\n {...props}\n />\n </div>\n );\n }\n);\n\nIcon.displayName = \"Icon\";\n","import * as React from \"react\";\nimport { cn } from \"../utils\";\nimport { focusRingStyles } from \"../utils/tailwind\";\nimport { IconName } from \"@deckai/icons\";\nimport { Icon, IconProps } from \"./Icon\";\n\nexport type InputProps = {\n className?: string;\n end?: React.ReactNode;\n /** renders an icon in the end slot */\n iconName?: IconName;\n} & React.InputHTMLAttributes<HTMLInputElement> &\n Pick<IconProps, \"color\" | \"size\" | \"title\">;\n\nexport const Input = ({\n className,\n end,\n iconName,\n color,\n size,\n title,\n ...props\n}: InputProps) => (\n <div className=\"relative\">\n <input\n className={cn(\n `font-sans lg:text-body-default text-xs flex w-full rounded-lg border border-secondary-50 bg-background-0 px-3 md:py-3 py-2 text-secondary ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-secondary text-text-primary ${focusRingStyles} disabled:cursor-not-allowed disabled:opacity-50 md:text-md`,\n end && \"pr-10\",\n className\n )}\n {...props}\n />\n {end && (\n <div className=\"absolute inset-y-0 right-0 flex items-center pr-3\">\n {iconName ? (\n <Icon name={iconName} color={color} size={size} title={title} />\n ) : (\n end\n )}\n </div>\n )}\n </div>\n);\n","import React from \"react\";\nimport { cn } from \"../utils\";\nimport { Icon } from \"./Icon\";\n\nexport type OptionProps = {\n label: string;\n value: string;\n onChange?: (value: string) => void;\n selected?: boolean;\n};\n\nexport const Option = ({ value, label, onChange, selected }: OptionProps) => (\n <button\n type=\"button\"\n className={cn(\n \"relative w-full h-full text-left px-2 py-1.5 text-sm cursor-pointer hover:bg-gray-100 rounded\",\n selected && \"bg-gray-100\"\n )}\n onClick={() => {\n onChange?.(value);\n }}\n >\n {label}\n </button>\n);\n","import React, { useCallback, useMemo, useState } from \"react\";\nimport * as Popover from \"@radix-ui/react-popover\";\nimport { Input } from \"./Input\";\nimport { OptionProps, Option } from \"./Option\";\nimport { focusRingStylesCoerced } from \"../utils/tailwind\";\n\nexport type ComboboxProps = {\n options: OptionProps[];\n placeholder?: string;\n value?: string;\n onChange: (value: string) => void;\n end?: React.ReactNode;\n className?: string;\n};\n\nexport const Combobox = ({\n options,\n placeholder = \"Select an item...\",\n value,\n onChange,\n end,\n className\n}: ComboboxProps) => {\n const [open, setOpen] = useState(false);\n const [inputValue, setInputValue] = useState<string | undefined>(value);\n\n const selectedOption: OptionProps | undefined = useMemo(\n () => options.find((option) => option.value === inputValue),\n [inputValue, options]\n );\n\n const filteredItems = options.filter((option) =>\n inputValue\n ? option.label.toLowerCase().includes(inputValue.toLowerCase())\n : options\n );\n\n const handleOptionChange = useCallback(\n (option: string) => {\n onChange(option);\n setOpen(false);\n setInputValue(selectedOption?.label);\n },\n [onChange, selectedOption?.label]\n );\n\n return (\n <Popover.Root open={open} onOpenChange={setOpen}>\n <div\n className={`relative w-full font-sans text-text-secondary ${className}`}\n >\n <Popover.Trigger asChild>\n <div className=\"flex\">\n <div className=\"relative flex-1\">\n <Input\n placeholder={placeholder}\n value={inputValue}\n onChange={(e) => setInputValue(e.target.value)}\n end={end}\n className={`flex-1 ${open && focusRingStylesCoerced}`}\n />\n </div>\n </div>\n </Popover.Trigger>\n\n <Popover.Portal>\n <Popover.Content\n className=\"w-[--radix-popover-trigger-width] p-1 bg-white rounded-md shadow-lg border mt-1 z-20\"\n sideOffset={5}\n >\n <div className=\"max-h-60 overflow-auto flex flex-col items-start\">\n {filteredItems.length > 0 ? (\n filteredItems.map(({ label, value: optionValue }, index) => (\n <Option\n onChange={handleOptionChange}\n value={optionValue}\n key={index}\n label={label}\n />\n ))\n ) : (\n <div className=\"px-2 py-1.5 text-sm text-gray-500\">\n No results found\n </div>\n )}\n </div>\n </Popover.Content>\n </Popover.Portal>\n </div>\n </Popover.Root>\n );\n};\n","import React from \"react\";\nimport { cn } from \"../utils\";\n\nexport type LogoProps = {\n className?: string;\n};\n\nexport const Logo = ({ className }: LogoProps) => (\n <div className={cn(\"lg:w-[76px] lg:h-[25px] w-[58px] h-[19px]\", className)}>\n <svg\n width=\"100%\"\n height=\"100%\"\n viewBox=\"0 0 76 25\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M0.8 15.584C0.8 13.9413 1.12 12.4693 1.76 11.168C2.4 9.84533 3.27467 8.8 4.384 8.032C5.49333 7.264 6.77333 6.88 8.224 6.88C9.39733 6.88 10.464 7.168 11.424 7.744C12.384 8.29867 13.1093 9.03467 13.6 9.952V0.639999H18.72V18.304C18.72 18.816 18.8053 19.1787 18.976 19.392C19.1467 19.584 19.424 19.7013 19.808 19.744V24C18.912 24.1707 18.1867 24.256 17.632 24.256C16.7573 24.256 16.0427 24.064 15.488 23.68C14.9547 23.296 14.624 22.7627 14.496 22.08L14.4 21.216C13.8027 22.2613 12.992 23.04 11.968 23.552C10.944 24.064 9.86667 24.32 8.736 24.32C7.584 24.32 6.51733 24.1067 5.536 23.68C4.576 23.232 3.73333 22.6133 3.008 21.824C2.304 21.0347 1.76 20.1067 1.376 19.04C0.992 17.9733 0.8 16.8213 0.8 15.584ZM13.632 17.664V14.144C13.4187 13.568 13.1093 13.0667 12.704 12.64C12.32 12.2133 11.872 11.872 11.36 11.616C10.8693 11.36 10.368 11.232 9.856 11.232C9.30133 11.232 8.78933 11.3493 8.32 11.584C7.872 11.8187 7.47733 12.1493 7.136 12.576C6.79467 12.9813 6.528 13.4507 6.336 13.984C6.16533 14.5173 6.08 15.0827 6.08 15.68C6.08 16.2987 6.176 16.8747 6.368 17.408C6.58133 17.92 6.86933 18.3787 7.232 18.784C7.59467 19.168 8.02133 19.4667 8.512 19.68C9.00267 19.8933 9.536 20 10.112 20C10.4747 20 10.8267 19.9467 11.168 19.84C11.5093 19.712 11.8293 19.552 12.128 19.36C12.448 19.168 12.736 18.9227 12.992 18.624C13.248 18.3253 13.4613 18.0053 13.632 17.664ZM30.0895 24.32C28.6602 24.32 27.3908 24.096 26.2815 23.648C25.1722 23.1787 24.2228 22.5493 23.4335 21.76C22.6655 20.9707 22.0788 20.064 21.6735 19.04C21.2682 17.9947 21.0655 16.9067 21.0655 15.776C21.0655 14.1547 21.4175 12.6827 22.1215 11.36C22.8468 10.016 23.8815 8.93867 25.2255 8.128C26.5695 7.296 28.1908 6.88 30.0895 6.88C31.9882 6.88 33.5988 7.28533 34.9215 8.096C36.2655 8.90667 37.2895 9.97333 37.9935 11.296C38.6975 12.5973 39.0495 14.016 39.0495 15.552C39.0495 15.8507 39.0282 16.1493 38.9855 16.448C38.9642 16.7253 38.9428 16.9707 38.9215 17.184H26.5055C26.5695 17.9307 26.7722 18.56 27.1135 19.072C27.4762 19.584 27.9348 19.9787 28.4895 20.256C29.0442 20.512 29.6308 20.64 30.2495 20.64C31.0175 20.64 31.7322 20.4587 32.3935 20.096C33.0762 19.7333 33.5455 19.2427 33.8015 18.624L38.1535 19.84C37.7268 20.7147 37.1188 21.4933 36.3295 22.176C35.5615 22.8373 34.6442 23.36 33.5775 23.744C32.5322 24.128 31.3695 24.32 30.0895 24.32ZM26.3775 14.048H33.6735C33.5882 13.344 33.3855 12.736 33.0655 12.224C32.7455 11.6907 32.3188 11.2853 31.7855 11.008C31.2522 10.7093 30.6655 10.56 30.0255 10.56C29.3642 10.56 28.7668 10.7093 28.2335 11.008C27.7215 11.2853 27.3055 11.6907 26.9855 12.224C26.6655 12.736 26.4628 13.344 26.3775 14.048ZM48.762 24.32C47.3327 24.32 46.0633 24.0853 44.954 23.616C43.8447 23.1467 42.8953 22.5067 42.106 21.696C41.338 20.8853 40.7513 19.9573 40.346 18.912C39.9407 17.8667 39.738 16.7573 39.738 15.584C39.738 14.048 40.09 12.6187 40.794 11.296C41.5193 9.97333 42.554 8.90667 43.898 8.096C45.242 7.28533 46.8633 6.88 48.762 6.88C50.682 6.88 52.3033 7.296 53.626 8.128C54.97 8.93867 55.9727 10.0053 56.634 11.328L51.642 12.832C51.322 12.32 50.906 11.9253 50.394 11.648C49.9033 11.3707 49.3487 11.232 48.73 11.232C48.026 11.232 47.386 11.4133 46.81 11.776C46.2553 12.1387 45.8073 12.64 45.466 13.28C45.146 13.92 44.986 14.688 44.986 15.584C44.986 16.4587 45.1567 17.2267 45.498 17.888C45.8393 18.5493 46.2873 19.072 46.842 19.456C47.3967 19.8187 48.026 20 48.73 20C49.1567 20 49.5513 19.936 49.914 19.808C50.298 19.6587 50.6393 19.456 50.938 19.2C51.258 18.944 51.5033 18.656 51.674 18.336L56.666 19.872C56.2607 20.7253 55.674 21.4933 54.906 22.176C54.1593 22.8373 53.274 23.36 52.25 23.744C51.226 24.128 50.0633 24.32 48.762 24.32ZM69.636 24L65.252 17.28L63.46 19.104V24H58.34V0.639999H63.46V14.144L69.156 7.2H74.564L68.516 14.432L75.076 24H69.636Z\"\n fill=\"#080808\"\n />\n </svg>\n </div>\n);\n","import React from \"react\";\nimport { IconName } from \"@deckai/icons\";\nimport { Icon, IconProps } from \"./Icon\";\nimport { Pressable, PressableProps } from \"./Pressable\";\n\nexport type NavbarItemProps = {\n iconName: IconName;\n hasNotification?: boolean;\n} & Pick<IconProps, \"color\" | \"title\"> &\n PressableProps;\n\nexport const NavbarItem = ({\n iconName,\n hasNotification,\n color,\n title,\n ...props\n}: NavbarItemProps) => {\n console.log({ hasNotification });\n return (\n <Pressable className=\"relative lg:px-7 md:px-5 py-3\" {...props}>\n <Icon name={iconName} color={color} title={title} />\n {hasNotification && (\n <div className=\"w-3 h-3 bg-red-500 rounded-full absolute top-3 right-5\" />\n )}\n </Pressable>\n );\n};\n","import React from \"react\";\nimport { Avatar } from \"./Avatar\";\nimport { Combobox } from \"./Combobox\";\nimport { Icon } from \"./Icon\";\nimport { Logo } from \"./Logo\";\nimport { Pressable } from \"./Pressable\";\nimport { OptionProps } from \"./Option\";\nimport { NavbarItem, NavbarItemProps } from \"./NavbarItem\";\n\nexport type NavbarProps = {\n searchOptions: OptionProps[];\n onSearchChange: (value: string) => void;\n navbarItems: NavbarItemProps[];\n onLogoClick?: () => void;\n onProfileClick?: () => void;\n avatarImage: string;\n};\n\nexport const Navbar = ({\n searchOptions,\n onSearchChange,\n navbarItems,\n onLogoClick,\n onProfileClick,\n avatarImage\n}: NavbarProps) => (\n <div className=\"flex py-6 lg:px-10 md:px-5 px-6 justify-between md:gap-6 gap-3 sm:relative sticky top-0\">\n <div className=\"flex flex-1 md:gap-6 gap-3 items-center\">\n <Pressable onClick={onLogoClick} title=\"Deck AI\">\n <Logo />\n </Pressable>\n <Combobox\n options={searchOptions}\n placeholder=\"Search for a creator, type of content, or platform...\"\n end={<Icon name=\"search-normal\" size={[\"lg:24\", 18]} />}\n onChange={onSearchChange}\n className=\"flex-1 max-w-lg\"\n />\n </div>\n <div className=\"flex gap-4\">\n <div className=\"md:flex hidden gap-2 border-b-2 border-stroke items-center\">\n {navbarItems.map(({ iconName, title, onClick }) => (\n <NavbarItem\n key={title}\n iconName={iconName}\n title={title}\n onClick={onClick}\n />\n ))}\n </div>\n <div className=\"flex\">\n <Avatar\n onClick={onProfileClick}\n src={avatarImage}\n size={[\"sm:48\", 40]}\n />\n </div>\n </div>\n </div>\n);\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/utils/tailwind.ts","../../src/components/Pressable.tsx","../../src/components/Avatar.tsx","../../src/components/Combobox.tsx","../../src/utils/index.ts","../../src/components/Icon.tsx","../../src/components/Input.tsx","../../src/components/Option.tsx","../../src/components/Logo.tsx","../../src/components/NavbarItem.tsx","../../src/components/Navbar.tsx"],"names":["focusRingStyles","focusRingStylesCoerced","Pressable","children","type","className","disabled","props","React","BREAKPOINT_MAP","processSizes","sizes","sizeArray","mediaQueries","baseSize","size","breakpoint","valueStr","value","acc","query","Avatar","src","onClick","sizeStyles","content","cn","inputs","twMerge","clsx","COLOR_MAP","Icon","name","color","title","style","ref","IconComponent","IconMap","Input","end","iconName","label","labelClassName","id","g","Option","onChange","selected","Combobox","options","placeholder","open","setOpen","useState","inputValue","setInputValue","selectedOption","useMemo","option","filteredItems","handleOptionChange","useCallback","f","e","optionLabel","optionValue","index","Logo","NavbarItem","hasNotification","Navbar","searchOptions","onSearchChange","navbarItems","onLogoClick","onProfileClick","avatarImage"],"mappings":"8jBAmEO,IAAMA,CAAAA,CACX,qGAEWC,CAAAA,CAAAA,CAAyB,gCCjE/B,CAAA,IAAMC,CAAsC,CAAA,CAAC,CAClD,QAAA,CAAAC,CACA,CAAA,IAAA,CAAAC,CAAO,CAAA,QAAA,CACP,SAAAC,CAAAA,CAAAA,CACA,QAAAC,CAAAA,CAAAA,CACA,GAAGC,CACL,CACEC,GAAAA,oBAAAA,CAAA,aAAC,CAAA,QAAA,CAAA,CAEC,IAAMJ,CAAAA,CAAAA,CACN,QAAUE,CAAAA,CAAAA,CACV,SAAW,CAAA,CAAA,gEAAA,EAAmEN,CAAe,CAAA,CAAA,EAAIK,CAAS,CAAA,CAAA,EAAIC,CAAW,CAAA,+BAAA,CAAkC,EAAE,CAAA,CAA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tailwind\";\n\n// Generate safelist patterns for all color utilities so you can use any theme color variable in your code\nexport const generateSafelist = (colors: Colors, typography: Typography) => {\n const colorNames = Object.keys(colors) as (keyof Colors)[];\n const utilities = [\"bg\", \"text\", \"border\", \"ring\", \"divide\", \"outline\"];\n const variants = [\"hover:\", \"focus:\", \"active:\", \"disabled:\"];\n\n const safelist: string[] = [];\n\n colorNames.forEach((colorName) => {\n if (typeof colors[colorName] === \"object\") {\n // Handle nested color objects (with number keys)\n Object.keys(colors[colorName]).forEach((shade) => {\n utilities.forEach((utility) => {\n // Base utility\n safelist.push(`${utility}-${colorName}-${shade}`);\n\n // Variant utilities\n variants.forEach((variant) => {\n safelist.push(`${variant}${utility}-${colorName}-${shade}`);\n });\n });\n });\n } else {\n // Handle direct color values\n utilities.forEach((utility) => {\n safelist.push(`${utility}-${colorName}`);\n\n variants.forEach((variant) => {\n safelist.push(`${variant}${utility}-${colorName}`);\n });\n });\n }\n });\n\n // Generate typography classes\n Object.entries(typography).forEach(([family, sizes]) => {\n Object.keys(sizes).forEach((size) => {\n // Base typography classes\n safelist.push(`text-${family}-${size}`);\n\n // Add variants\n variants.forEach((variant) => {\n safelist.push(`${variant}text-${family}-${size}`);\n });\n });\n });\n\n const breakpoints = [\"sm\", \"md\", \"lg\", \"xl\", \"2xl\"];\n const typographyClasses = Object.entries(typography).flatMap(\n ([category, sizes]) =>\n Object.keys(sizes).map((size) => `text-${category}-${size}`)\n );\n\n // Generate responsive variants\n const responsiveTypographyClasses = typographyClasses.flatMap((className) =>\n breakpoints.map((breakpoint) => `${breakpoint}:${className}`)\n );\n\n return [\n ...typographyClasses,\n ...responsiveTypographyClasses\n // ... rest of your safelist\n ];\n};\n\nexport const focusRingStyles =\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\";\n\nexport const focusRingStylesCoerced = \"ring-2 ring-ring ring-offset-2\";\n","import React, { ButtonHTMLAttributes } from \"react\";\nimport { focusRingStyles } from \"../utils/tailwind\";\n\nexport type PressableProps = ButtonHTMLAttributes<HTMLButtonElement>;\n\nexport const Pressable: React.FC<PressableProps> = ({\n children,\n type = \"button\",\n className,\n disabled,\n ...props\n}) => (\n <button\n // eslint-disable-next-line react/butt on-has-type\n type={type}\n disabled={disabled}\n className={`appearance-none hover:opacity-80 transition-all active:scale-95 ${focusRingStyles} ${className} ${disabled ? \"opacity-50 cursor-not-allowed\" : \"\"}`}\n {...props}\n >\n {children}\n </button>\n);\n","import React from \"react\";\nimport { Pressable } from \"./Pressable\";\n\ntype Breakpoint = \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\";\ntype ResponsiveSize = number | `${Breakpoint}:${number}`;\n\nconst BREAKPOINT_MAP: Record<Breakpoint, string> = {\n sm: \"640px\",\n md: \"768px\",\n lg: \"1024px\",\n xl: \"1280px\",\n \"2xl\": \"1536px\"\n};\n\nexport type AvatarProps = {\n src?: string;\n size?: ResponsiveSize | ResponsiveSize[];\n} & Pick<React.ComponentProps<typeof Pressable>, \"onClick\">;\n\nconst processSizes = (\n sizes: ResponsiveSize | ResponsiveSize[] | undefined\n): React.CSSProperties => {\n if (!sizes) return { width: \"48px\", height: \"48px\" };\n\n const sizeArray = Array.isArray(sizes) ? sizes : [sizes];\n const mediaQueries: Record<string, string> = {};\n let baseSize: string | undefined;\n\n // Process each size\n sizeArray.forEach((size) => {\n if (typeof size === \"number\") {\n baseSize = `${size}px`;\n } else {\n const [breakpoint, valueStr] = size.split(\":\") as [Breakpoint, string];\n const value = parseInt(valueStr, 10);\n mediaQueries[`@media (minWidth: ${BREAKPOINT_MAP[breakpoint]})`] =\n `${value}px`;\n }\n });\n\n // Create the style object with the correct structure\n return {\n width: baseSize || \"48px\",\n height: baseSize || \"48px\",\n ...Object.entries(mediaQueries).reduce(\n (acc, [query, size]) => ({\n ...acc,\n [query]: {\n width: size,\n height: size\n }\n }),\n {}\n )\n };\n};\n\nexport const Avatar = ({ src, size = 48, onClick, ...props }: AvatarProps) => {\n const sizeStyles = processSizes(size);\n\n const content = src ? (\n <img\n src={src}\n alt=\"avatar\"\n className=\"rounded-full\"\n style={sizeStyles}\n {...props}\n />\n ) : (\n <div style={sizeStyles} className=\"rounded-full bg-gray-200\" />\n );\n\n return onClick ? <Pressable onClick={onClick}>{content}</Pressable> : content;\n};\n","import React, { useCallback, useMemo, useState } from \"react\";\nimport * as Popover from \"@radix-ui/react-popover\";\nimport { Input } from \"./Input\";\nimport { OptionProps, Option } from \"./Option\";\nimport { focusRingStylesCoerced } from \"../utils/tailwind\";\n\nexport type ComboboxProps = {\n options: OptionProps[];\n placeholder?: string;\n value?: string;\n onChange: (value: string) => void;\n end?: React.ReactNode;\n className?: string;\n /** Label text for the combobox */\n label?: string;\n /** Additional classes for the label */\n labelClassName?: string;\n /** ID for accessibility */\n id?: string;\n};\n\nexport const Combobox = ({\n options,\n placeholder = \"Select an item...\",\n value,\n onChange,\n end,\n className,\n label,\n labelClassName,\n id\n}: ComboboxProps) => {\n const [open, setOpen] = useState(false);\n const [inputValue, setInputValue] = useState<string | undefined>(value);\n\n const selectedOption: OptionProps | undefined = useMemo(\n () => options.find((option) => option.value === inputValue),\n [inputValue, options]\n );\n\n const filteredItems = options.filter((option) =>\n inputValue\n ? option.label.toLowerCase().includes(inputValue.toLowerCase())\n : options\n );\n\n const handleOptionChange = useCallback(\n (option: string) => {\n onChange(option);\n setOpen(false);\n setInputValue(selectedOption?.label);\n },\n [onChange, selectedOption?.label]\n );\n\n return (\n <Popover.Root open={open} onOpenChange={setOpen}>\n <div\n className={`relative w-full font-sans text-text-secondary ${className}`}\n >\n <Popover.Trigger asChild>\n <div className=\"flex\">\n <div className=\"relative flex-1\">\n <Input\n id={id}\n label={label}\n labelClassName={labelClassName}\n placeholder={placeholder}\n value={inputValue}\n onChange={(e) => setInputValue(e.target.value)}\n end={end}\n className={`flex-1 ${open && focusRingStylesCoerced}`}\n />\n </div>\n </div>\n </Popover.Trigger>\n\n <Popover.Portal>\n <Popover.Content\n className=\"w-[--radix-popover-trigger-width] p-1 bg-white rounded-md shadow-lg border mt-1 z-20\"\n sideOffset={5}\n >\n <div className=\"max-h-60 overflow-auto flex flex-col items-start\">\n {filteredItems.length > 0 ? (\n filteredItems.map(\n ({ label: optionLabel, value: optionValue }, index) => (\n <Option\n onChange={handleOptionChange}\n value={optionValue}\n key={index}\n label={optionLabel}\n />\n )\n )\n ) : (\n <div className=\"px-2 py-1.5 text-sm text-gray-500\">\n No results found\n </div>\n )}\n </div>\n </Popover.Content>\n </Popover.Portal>\n </div>\n </Popover.Root>\n );\n};\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\nexport const noopFn = () => {};\n","import React, { SVGProps } from \"react\";\nimport { IconName, IconMap } from \"@deckai/icons\";\nimport { IconColors } from \"../types/tailwind\";\nimport { cn } from \"../utils\";\n\ntype Breakpoint = \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\";\ntype ResponsiveSize = number | `${Breakpoint}:${number}`;\n\nexport type IconProps = {\n name: IconName;\n /** @default 24 */\n size?: ResponsiveSize | ResponsiveSize[];\n /** @default primary */\n color?: IconColors;\n title?: string;\n className?: string;\n style?: React.CSSProperties;\n} & Omit<SVGProps<SVGSVGElement>, \"aria-hidden\" | \"aria-label\">;\n\nconst COLOR_MAP: Record<IconColors, string> = {\n primary: \"#080808\",\n secondary: \"#666666\",\n white: \"#ffffff\",\n primaryBlue: \"#089CCB\"\n};\n\nconst BREAKPOINT_MAP: Record<Breakpoint, string> = {\n sm: \"640px\",\n md: \"768px\",\n lg: \"1024px\",\n xl: \"1280px\",\n \"2xl\": \"1536px\"\n};\n\nconst processSizes = (\n sizes: ResponsiveSize | ResponsiveSize[] | undefined\n): React.CSSProperties => {\n if (!sizes) return { width: \"24px\", height: \"24px\" };\n\n const sizeArray = Array.isArray(sizes) ? sizes : [sizes];\n const mediaQueries: Record<string, string> = {};\n let baseSize: string | undefined;\n\n // Process each size\n sizeArray.forEach((size) => {\n if (typeof size === \"number\") {\n baseSize = `${size}px`;\n } else {\n const [breakpoint, valueStr] = size.split(\":\") as [Breakpoint, string];\n const value = parseInt(valueStr, 10);\n mediaQueries[`@media (min-width: ${BREAKPOINT_MAP[breakpoint]})`] =\n `${value}px`;\n }\n });\n\n // Create the style object with the correct structure\n return {\n width: baseSize || \"24px\",\n height: baseSize || \"24px\",\n ...Object.entries(mediaQueries).reduce(\n (acc, [query, size]) => ({\n ...acc,\n [query]: {\n width: size,\n height: size\n }\n }),\n {}\n )\n };\n};\n\nexport const Icon = React.forwardRef<SVGSVGElement, IconProps>(\n (\n {\n name,\n size = 24,\n color = \"primary\",\n title,\n className,\n style = {},\n ...props\n },\n ref\n ) => {\n const IconComponent = IconMap[name];\n const sizeStyles = processSizes(size);\n\n return (\n <div\n className={cn(\"flex justify-center items-center\", className)}\n style={{\n ...sizeStyles,\n [\"--icon-stroke\" as string]: COLOR_MAP[color],\n ...style\n }}\n >\n <IconComponent\n ref={ref}\n aria-hidden={!title}\n aria-label={title}\n stroke={name.includes(\"filled\") ? undefined : COLOR_MAP[color]}\n {...props}\n />\n </div>\n );\n }\n);\n\nIcon.displayName = \"Icon\";\n","import * as React from \"react\";\nimport { cn } from \"../utils\";\nimport { focusRingStyles } from \"../utils/tailwind\";\nimport { IconName } from \"@deckai/icons\";\nimport { Icon, IconProps } from \"./Icon\";\n\nexport type InputProps = {\n className?: string;\n end?: React.ReactNode;\n /** renders an icon in the end slot */\n iconName?: IconName;\n /** Label text for the input */\n label?: string;\n /** Additional classes for the label */\n labelClassName?: string;\n} & React.InputHTMLAttributes<HTMLInputElement> &\n Pick<IconProps, \"color\" | \"size\" | \"title\">;\n\nexport const Input = ({\n className,\n end,\n iconName,\n color,\n size,\n title,\n label,\n labelClassName,\n id,\n ...props\n}: InputProps) => (\n <div className=\"space-y-2\">\n {label && (\n <label\n htmlFor={id}\n className={cn(\n \"block text-sm font-medium text-text-primary\",\n labelClassName\n )}\n >\n {label}\n </label>\n )}\n <div className=\"relative\">\n <input\n id={id}\n className={cn(\n `font-sans lg:text-body-default text-xs flex w-full rounded-lg border border-secondary-50 bg-background-0 px-3 md:py-3 py-2 text-secondary ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-secondary text-text-primary ${focusRingStyles} disabled:cursor-not-allowed disabled:opacity-50 md:text-md`,\n end && \"pr-10\",\n className\n )}\n {...props}\n />\n {end && (\n <div className=\"absolute inset-y-0 right-0 flex items-center pr-3\">\n {iconName ? (\n <Icon name={iconName} color={color} size={size} title={title} />\n ) : (\n end\n )}\n </div>\n )}\n </div>\n </div>\n);\n","import React from \"react\";\nimport { cn } from \"../utils\";\nimport { Icon } from \"./Icon\";\n\nexport type OptionProps = {\n label: string;\n value: string;\n onChange?: (value: string) => void;\n selected?: boolean;\n};\n\nexport const Option = ({ value, label, onChange, selected }: OptionProps) => (\n <button\n type=\"button\"\n className={cn(\n \"relative w-full h-full text-left px-2 py-1.5 text-sm cursor-pointer hover:bg-gray-100 rounded\",\n selected && \"bg-gray-100\"\n )}\n onClick={() => {\n onChange?.(value);\n }}\n >\n {label}\n </button>\n);\n","import React from \"react\";\nimport { cn } from \"../utils\";\n\nexport type LogoProps = {\n className?: string;\n};\n\nexport const Logo = ({ className }: LogoProps) => (\n <div className={cn(\"lg:w-[76px] lg:h-[25px] w-[58px] h-[19px]\", className)}>\n <svg\n width=\"100%\"\n height=\"100%\"\n viewBox=\"0 0 76 25\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M0.8 15.584C0.8 13.9413 1.12 12.4693 1.76 11.168C2.4 9.84533 3.27467 8.8 4.384 8.032C5.49333 7.264 6.77333 6.88 8.224 6.88C9.39733 6.88 10.464 7.168 11.424 7.744C12.384 8.29867 13.1093 9.03467 13.6 9.952V0.639999H18.72V18.304C18.72 18.816 18.8053 19.1787 18.976 19.392C19.1467 19.584 19.424 19.7013 19.808 19.744V24C18.912 24.1707 18.1867 24.256 17.632 24.256C16.7573 24.256 16.0427 24.064 15.488 23.68C14.9547 23.296 14.624 22.7627 14.496 22.08L14.4 21.216C13.8027 22.2613 12.992 23.04 11.968 23.552C10.944 24.064 9.86667 24.32 8.736 24.32C7.584 24.32 6.51733 24.1067 5.536 23.68C4.576 23.232 3.73333 22.6133 3.008 21.824C2.304 21.0347 1.76 20.1067 1.376 19.04C0.992 17.9733 0.8 16.8213 0.8 15.584ZM13.632 17.664V14.144C13.4187 13.568 13.1093 13.0667 12.704 12.64C12.32 12.2133 11.872 11.872 11.36 11.616C10.8693 11.36 10.368 11.232 9.856 11.232C9.30133 11.232 8.78933 11.3493 8.32 11.584C7.872 11.8187 7.47733 12.1493 7.136 12.576C6.79467 12.9813 6.528 13.4507 6.336 13.984C6.16533 14.5173 6.08 15.0827 6.08 15.68C6.08 16.2987 6.176 16.8747 6.368 17.408C6.58133 17.92 6.86933 18.3787 7.232 18.784C7.59467 19.168 8.02133 19.4667 8.512 19.68C9.00267 19.8933 9.536 20 10.112 20C10.4747 20 10.8267 19.9467 11.168 19.84C11.5093 19.712 11.8293 19.552 12.128 19.36C12.448 19.168 12.736 18.9227 12.992 18.624C13.248 18.3253 13.4613 18.0053 13.632 17.664ZM30.0895 24.32C28.6602 24.32 27.3908 24.096 26.2815 23.648C25.1722 23.1787 24.2228 22.5493 23.4335 21.76C22.6655 20.9707 22.0788 20.064 21.6735 19.04C21.2682 17.9947 21.0655 16.9067 21.0655 15.776C21.0655 14.1547 21.4175 12.6827 22.1215 11.36C22.8468 10.016 23.8815 8.93867 25.2255 8.128C26.5695 7.296 28.1908 6.88 30.0895 6.88C31.9882 6.88 33.5988 7.28533 34.9215 8.096C36.2655 8.90667 37.2895 9.97333 37.9935 11.296C38.6975 12.5973 39.0495 14.016 39.0495 15.552C39.0495 15.8507 39.0282 16.1493 38.9855 16.448C38.9642 16.7253 38.9428 16.9707 38.9215 17.184H26.5055C26.5695 17.9307 26.7722 18.56 27.1135 19.072C27.4762 19.584 27.9348 19.9787 28.4895 20.256C29.0442 20.512 29.6308 20.64 30.2495 20.64C31.0175 20.64 31.7322 20.4587 32.3935 20.096C33.0762 19.7333 33.5455 19.2427 33.8015 18.624L38.1535 19.84C37.7268 20.7147 37.1188 21.4933 36.3295 22.176C35.5615 22.8373 34.6442 23.36 33.5775 23.744C32.5322 24.128 31.3695 24.32 30.0895 24.32ZM26.3775 14.048H33.6735C33.5882 13.344 33.3855 12.736 33.0655 12.224C32.7455 11.6907 32.3188 11.2853 31.7855 11.008C31.2522 10.7093 30.6655 10.56 30.0255 10.56C29.3642 10.56 28.7668 10.7093 28.2335 11.008C27.7215 11.2853 27.3055 11.6907 26.9855 12.224C26.6655 12.736 26.4628 13.344 26.3775 14.048ZM48.762 24.32C47.3327 24.32 46.0633 24.0853 44.954 23.616C43.8447 23.1467 42.8953 22.5067 42.106 21.696C41.338 20.8853 40.7513 19.9573 40.346 18.912C39.9407 17.8667 39.738 16.7573 39.738 15.584C39.738 14.048 40.09 12.6187 40.794 11.296C41.5193 9.97333 42.554 8.90667 43.898 8.096C45.242 7.28533 46.8633 6.88 48.762 6.88C50.682 6.88 52.3033 7.296 53.626 8.128C54.97 8.93867 55.9727 10.0053 56.634 11.328L51.642 12.832C51.322 12.32 50.906 11.9253 50.394 11.648C49.9033 11.3707 49.3487 11.232 48.73 11.232C48.026 11.232 47.386 11.4133 46.81 11.776C46.2553 12.1387 45.8073 12.64 45.466 13.28C45.146 13.92 44.986 14.688 44.986 15.584C44.986 16.4587 45.1567 17.2267 45.498 17.888C45.8393 18.5493 46.2873 19.072 46.842 19.456C47.3967 19.8187 48.026 20 48.73 20C49.1567 20 49.5513 19.936 49.914 19.808C50.298 19.6587 50.6393 19.456 50.938 19.2C51.258 18.944 51.5033 18.656 51.674 18.336L56.666 19.872C56.2607 20.7253 55.674 21.4933 54.906 22.176C54.1593 22.8373 53.274 23.36 52.25 23.744C51.226 24.128 50.0633 24.32 48.762 24.32ZM69.636 24L65.252 17.28L63.46 19.104V24H58.34V0.639999H63.46V14.144L69.156 7.2H74.564L68.516 14.432L75.076 24H69.636Z\"\n fill=\"#080808\"\n />\n </svg>\n </div>\n);\n","import React from \"react\";\nimport { IconName } from \"@deckai/icons\";\nimport { Icon, IconProps } from \"./Icon\";\nimport { Pressable, PressableProps } from \"./Pressable\";\n\nexport type NavbarItemProps = {\n iconName: IconName;\n hasNotification?: boolean;\n} & Pick<IconProps, \"color\" | \"title\"> &\n PressableProps;\n\nexport const NavbarItem = ({\n iconName,\n hasNotification,\n color,\n title,\n ...props\n}: NavbarItemProps) => {\n console.log({ hasNotification });\n return (\n <Pressable className=\"relative lg:px-7 md:px-5 py-3\" {...props}>\n <Icon name={iconName} color={color} title={title} />\n {hasNotification && (\n <div className=\"w-3 h-3 bg-red-500 rounded-full absolute top-3 right-5\" />\n )}\n </Pressable>\n );\n};\n","import React from \"react\";\nimport { Avatar } from \"./Avatar\";\nimport { Combobox } from \"./Combobox\";\nimport { Icon } from \"./Icon\";\nimport { Logo } from \"./Logo\";\nimport { Pressable } from \"./Pressable\";\nimport { OptionProps } from \"./Option\";\nimport { NavbarItem, NavbarItemProps } from \"./NavbarItem\";\n\nexport type NavbarProps = {\n searchOptions: OptionProps[];\n onSearchChange: (value: string) => void;\n navbarItems: NavbarItemProps[];\n onLogoClick?: () => void;\n onProfileClick?: () => void;\n avatarImage: string;\n};\n\nexport const Navbar = ({\n searchOptions,\n onSearchChange,\n navbarItems,\n onLogoClick,\n onProfileClick,\n avatarImage\n}: NavbarProps) => (\n <div className=\"flex py-6 lg:px-10 md:px-5 px-6 justify-between md:gap-6 gap-3 sm:relative sticky top-0\">\n <div className=\"flex flex-1 md:gap-6 gap-3 items-center\">\n <Pressable onClick={onLogoClick} title=\"Deck AI\">\n <Logo />\n </Pressable>\n <Combobox\n options={searchOptions}\n placeholder=\"Search for a creator, type of content, or platform...\"\n end={<Icon name=\"search-normal\" size={[\"lg:24\", 18]} />}\n onChange={onSearchChange}\n className=\"flex-1 max-w-lg\"\n />\n </div>\n <div className=\"flex gap-4\">\n <div className=\"md:flex hidden gap-2 border-b-2 border-stroke items-center\">\n {navbarItems.map(({ iconName, title, onClick }) => (\n <NavbarItem\n key={title}\n iconName={iconName}\n title={title}\n onClick={onClick}\n />\n ))}\n </div>\n <div className=\"flex\">\n <Avatar\n onClick={onProfileClick}\n src={avatarImage}\n size={[\"sm:48\", 40]}\n />\n </div>\n </div>\n </div>\n);\n"]}
|
|
@@ -3,7 +3,7 @@ import { OptionProps } from './Option.cjs';
|
|
|
3
3
|
import { NavbarItemProps } from './NavbarItem.cjs';
|
|
4
4
|
import '@deckai/icons';
|
|
5
5
|
import './Icon.cjs';
|
|
6
|
-
import '../tailwind-
|
|
6
|
+
import '../tailwind-CIZ10fKA.cjs';
|
|
7
7
|
import './Pressable.cjs';
|
|
8
8
|
|
|
9
9
|
type NavbarProps = {
|