@intlayer/design-system 8.3.2 → 8.3.4

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.
Files changed (40) hide show
  1. package/dist/esm/components/ContentEditor/ContentEditorTextArea.mjs +1 -1
  2. package/dist/esm/components/DictionaryFieldEditor/ContentEditorView/TextEditor.mjs +1 -1
  3. package/dist/esm/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs +1 -1
  4. package/dist/esm/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs +1 -1
  5. package/dist/esm/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs +1 -1
  6. package/dist/esm/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs.map +1 -1
  7. package/dist/esm/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs +1 -1
  8. package/dist/esm/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs +1 -1
  9. package/dist/esm/components/DictionaryFieldEditor/StructureView/StructureView.mjs +1 -1
  10. package/dist/esm/components/Form/elements/OTPElement.mjs +1 -1
  11. package/dist/esm/components/IDE/IDE.mjs +1 -1
  12. package/dist/esm/components/IDE/IDE.mjs.map +1 -1
  13. package/dist/esm/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs +1 -1
  14. package/dist/esm/components/MarkDownRender/MarkDownRender.mjs +1 -1
  15. package/dist/esm/components/MarkDownRender/MarkDownRender.mjs.map +1 -1
  16. package/dist/esm/components/MaxHeightSmoother/index.mjs +1 -1
  17. package/dist/esm/components/MaxHeightSmoother/index.mjs.map +1 -1
  18. package/dist/esm/components/Modal/Modal.mjs +1 -1
  19. package/dist/esm/components/Navbar/MobileNavbar.mjs +1 -1
  20. package/dist/esm/components/Pagination/Pagination.mjs +1 -1
  21. package/dist/esm/components/RightDrawer/RightDrawer.mjs +1 -1
  22. package/dist/esm/components/SwitchSelector/index.mjs +1 -1
  23. package/dist/esm/components/SwitchSelector/index.mjs.map +1 -1
  24. package/dist/esm/hooks/index.mjs +1 -1
  25. package/dist/types/components/Badge/index.d.ts +1 -1
  26. package/dist/types/components/Button/Button.d.ts +3 -3
  27. package/dist/types/components/CollapsibleTable/CollapsibleTable.d.ts +1 -1
  28. package/dist/types/components/Command/index.d.ts +1 -1
  29. package/dist/types/components/Container/index.d.ts +3 -3
  30. package/dist/types/components/Input/Checkbox.d.ts +1 -1
  31. package/dist/types/components/Link/Link.d.ts +2 -2
  32. package/dist/types/components/MarkDownRender/MarkDownRender.d.ts.map +1 -1
  33. package/dist/types/components/MaxHeightSmoother/index.d.ts +80 -100
  34. package/dist/types/components/MaxHeightSmoother/index.d.ts.map +1 -1
  35. package/dist/types/components/Pagination/Pagination.d.ts +1 -1
  36. package/dist/types/components/SwitchSelector/index.d.ts +3 -1
  37. package/dist/types/components/SwitchSelector/index.d.ts.map +1 -1
  38. package/dist/types/components/TabSelector/TabSelector.d.ts +1 -1
  39. package/dist/types/components/Tag/index.d.ts +1 -1
  40. package/package.json +16 -16
@@ -1,2 +1,2 @@
1
- "use client";import{cn as e}from"../../utils/cn.mjs";import{useItemSelector as t}from"../../hooks/useItemSelector.mjs";import{createElement as n,useEffect as r,useRef as i,useState as a}from"react";import{cva as o}from"class-variance-authority";import{jsx as s,jsxs as c}from"react/jsx-runtime";const l=[{content:`Off`,value:!1},{content:`On`,value:!0}];let u=function(e){return e.PRIMARY=`primary`,e.SECONDARY=`secondary`,e.DESTRUCTIVE=`destructive`,e.NEUTRAL=`neutral`,e.LIGHT=`light`,e.DARK=`dark`,e.TEXT=`text`,e}({});const d=o(`flex w-fit cursor-pointer flex-row gap-2 rounded-full border-[1.3px] p-[1.5px]`,{variants:{color:{[`${u.PRIMARY}`]:`border-primary text-primary`,[`${u.SECONDARY}`]:`border-secondary text-secondary`,[`${u.DESTRUCTIVE}`]:`border-destructive bg-destructive text-destructive`,[`${u.NEUTRAL}`]:`border-neutral text-neutral`,[`${u.LIGHT}`]:`border-white text-white`,[`${u.DARK}`]:`border-neutral-800 text-neutral-800`,[`${u.TEXT}`]:`border-text text-text`},disabled:{true:`cursor-not-allowed opacity-50`,false:``}},defaultVariants:{color:`${u.PRIMARY}`,disabled:!1}});let f=function(e){return e.SM=`sm`,e.MD=`md`,e.LG=`lg`,e}({});const p=o(`z-1 w-full flex-1 cursor-pointer font-medium text-sm transition-all duration-300 ease-in-out aria-selected:cursor-default data-[indicator=true]:text-text-opposite motion-reduce:transition-none`,{variants:{size:{[`${f.SM}`]:`px-2 py-1 text-xs`,[`${f.MD}`]:`p-2 text-sm`,[`${f.LG}`]:`p-4 text-base`}},defaultVariants:{size:`${f.MD}`}}),m=o(`absolute top-0 z-0 h-full w-auto rounded-full transition-[left,width] duration-300 ease-in-out motion-reduce:transition-none`,{variants:{color:{[`${u.PRIMARY}`]:`bg-primary data-[indicator=true]:text-text`,[`${u.SECONDARY}`]:`bg-secondary data-[indicator=true]:text-text`,[`${u.DESTRUCTIVE}`]:`bg-destructive data-[indicator=true]:text-text`,[`${u.NEUTRAL}`]:`bg-neutral data-[indicator=true]:text-white`,[`${u.LIGHT}`]:`bg-white data-[indicator=true]:text-black`,[`${u.DARK}`]:`bg-neutral-800 data-[indicator=true]:text-white`,[`${u.TEXT}`]:`bg-text data-[indicator=true]:text-text-opposite`}}}),h=({choices:o=l,value:h,defaultValue:g,onChange:_,color:v=u.PRIMARY,size:y=f.MD,className:b,hoverable:x=!0,disabled:S=!1})=>{let[C,w]=a(h??g??o[0].value),[T,E]=a(null),D=i([]),O=i(null),{choiceIndicatorPosition:k}=t(D,{isHoverable:x}),A=o.findIndex(e=>e.value===C),j=x&&T!==null?T:A,M=e=>{w(e),_?.(e)};return r(()=>{h!==void 0&&w(h)},[h]),s(`div`,{className:d({color:v,disabled:S,className:b}),role:`tablist`,"aria-disabled":S?`true`:void 0,children:c(`div`,{className:`relative flex size-full flex-row items-center justify-center`,children:[o.map((t,r)=>{let{content:i,value:a,...o}=t,s=typeof a==`string`||typeof a==`number`,c=r===A,l=r===j;return n(`button`,{...o,className:e(p({size:y}),S&&`cursor-not-allowed`),key:s?a:r,role:`tab`,onClick:()=>M(a),"aria-selected":c?`true`:void 0,"data-indicator":l?`true`:void 0,disabled:S||c,tabIndex:c?0:-1,ref:e=>{D.current[r]=e},onMouseEnter:()=>!S&&E(r),onMouseLeave:()=>!S&&E(null)},i)}),k&&s(`div`,{className:e(m({color:v})),style:k,ref:O})]})})};export{h as SwitchSelector,u as SwitchSelectorColor,f as SwitchSelectorSize};
1
+ "use client";import{cn as e}from"../../utils/cn.mjs";import{useItemSelector as t}from"../../hooks/useItemSelector.mjs";import{createElement as n,useEffect as r,useRef as i,useState as a}from"react";import{cva as o}from"class-variance-authority";import{jsx as s,jsxs as c}from"react/jsx-runtime";const l=[{content:`Off`,value:!1},{content:`On`,value:!0}];let u=function(e){return e.PRIMARY=`primary`,e.SECONDARY=`secondary`,e.DESTRUCTIVE=`destructive`,e.NEUTRAL=`neutral`,e.LIGHT=`light`,e.DARK=`dark`,e.TEXT=`text`,e}({});const d=o(`flex w-fit cursor-pointer flex-row gap-2 rounded-full border-[1.3px] p-[1.5px]`,{variants:{color:{[`${u.PRIMARY}`]:`border-primary text-primary`,[`${u.SECONDARY}`]:`border-secondary text-secondary`,[`${u.DESTRUCTIVE}`]:`border-destructive bg-destructive text-destructive`,[`${u.NEUTRAL}`]:`border-neutral text-neutral`,[`${u.LIGHT}`]:`border-white text-white`,[`${u.DARK}`]:`border-neutral-800 text-neutral-800`,[`${u.TEXT}`]:`border-text text-text`},disabled:{true:`cursor-not-allowed opacity-50`,false:``}},defaultVariants:{color:`${u.PRIMARY}`,disabled:!1}});let f=function(e){return e.SM=`sm`,e.MD=`md`,e.LG=`lg`,e}({});const p=o(`z-1 w-full flex-1 cursor-pointer font-medium text-sm transition-all duration-300 ease-in-out aria-selected:cursor-default data-[indicator=true]:text-text-opposite motion-reduce:transition-none`,{variants:{size:{[`${f.SM}`]:`px-2 py-1 text-xs`,[`${f.MD}`]:`p-2 text-sm`,[`${f.LG}`]:`p-4 text-base`}},defaultVariants:{size:`${f.MD}`}}),m=o(`absolute top-0 z-0 h-full w-auto rounded-full transition-[left,width] duration-300 ease-in-out motion-reduce:transition-none`,{variants:{color:{[`${u.PRIMARY}`]:`bg-primary data-[indicator=true]:text-text`,[`${u.SECONDARY}`]:`bg-secondary data-[indicator=true]:text-text`,[`${u.DESTRUCTIVE}`]:`bg-destructive data-[indicator=true]:text-text`,[`${u.NEUTRAL}`]:`bg-neutral data-[indicator=true]:text-white`,[`${u.LIGHT}`]:`bg-white data-[indicator=true]:text-black`,[`${u.DARK}`]:`bg-neutral-800 data-[indicator=true]:text-white`,[`${u.TEXT}`]:`bg-text data-[indicator=true]:text-text-opposite`}}}),h=({choices:o=l,value:h,defaultValue:g,onChange:_,color:v=u.PRIMARY,size:y=f.MD,className:b,itemClassName:x,hoverable:S=!0,disabled:C=!1})=>{let[w,T]=a(h??g??o[0].value),[E,D]=a(null),O=i([]),k=i(null),{choiceIndicatorPosition:A}=t(O,{isHoverable:S}),j=o.findIndex(e=>e.value===w),M=S&&E!==null?E:j,N=e=>{T(e),_?.(e)};return r(()=>{h!==void 0&&T(h)},[h]),s(`div`,{className:d({color:v,disabled:C,className:b}),role:`tablist`,"aria-disabled":C?`true`:void 0,children:c(`div`,{className:`relative flex size-full flex-row items-center justify-center`,children:[o.map((t,r)=>{let{content:i,value:a,...o}=t,s=typeof a==`string`||typeof a==`number`,c=r===j,l=r===M;return n(`button`,{...o,className:e(p({size:y}),C&&`cursor-not-allowed`,x),key:s?a:r,role:`tab`,onClick:()=>N(a),"aria-selected":c?`true`:void 0,"data-indicator":l?`true`:void 0,disabled:C||c,tabIndex:c?0:-1,ref:e=>{O.current[r]=e},onMouseEnter:()=>!C&&D(r),onMouseLeave:()=>!C&&D(null)},i)}),A&&s(`div`,{className:e(m({color:v})),style:A,ref:k})]})})};export{h as SwitchSelector,u as SwitchSelectorColor,f as SwitchSelectorSize};
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../../../src/components/SwitchSelector/index.tsx"],"sourcesContent":["'use client';\n\nimport { useItemSelector } from '@hooks/useItemSelector';\nimport { cn } from '@utils/cn';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport {\n type HTMLAttributes,\n type ReactNode,\n useEffect,\n useRef,\n useState,\n} from 'react';\n\nexport type SwitchSelectorChoice<T = boolean> = {\n content: ReactNode;\n value: T;\n} & HTMLAttributes<HTMLButtonElement>;\nexport type SwitchSelectorChoices<T> = SwitchSelectorChoice<T>[];\n\nconst defaultChoices: SwitchSelectorChoices<boolean> = [\n { content: 'Off', value: false },\n { content: 'On', value: true },\n];\n\nexport type SwitchSelectorProps<T = boolean> = {\n choices?: SwitchSelectorChoices<T>;\n value?: T;\n defaultValue?: T;\n onChange?: (choice: T) => void;\n className?: string;\n hoverable?: boolean;\n disabled?: boolean;\n} & VariantProps<typeof switchSelectorVariant> &\n VariantProps<typeof choiceVariant>;\n\nexport enum SwitchSelectorColor {\n PRIMARY = 'primary',\n SECONDARY = 'secondary',\n DESTRUCTIVE = 'destructive',\n NEUTRAL = 'neutral',\n LIGHT = 'light',\n DARK = 'dark',\n TEXT = 'text',\n}\n\nconst switchSelectorVariant = cva(\n 'flex w-fit cursor-pointer flex-row gap-2 rounded-full border-[1.3px] p-[1.5px]',\n {\n variants: {\n color: {\n [`${SwitchSelectorColor.PRIMARY}`]: 'border-primary text-primary',\n [`${SwitchSelectorColor.SECONDARY}`]: 'border-secondary text-secondary',\n [`${SwitchSelectorColor.DESTRUCTIVE}`]:\n 'border-destructive bg-destructive text-destructive',\n [`${SwitchSelectorColor.NEUTRAL}`]: 'border-neutral text-neutral',\n [`${SwitchSelectorColor.LIGHT}`]: 'border-white text-white',\n [`${SwitchSelectorColor.DARK}`]: 'border-neutral-800 text-neutral-800',\n [`${SwitchSelectorColor.TEXT}`]: 'border-text text-text',\n },\n disabled: {\n true: 'cursor-not-allowed opacity-50',\n false: '',\n },\n },\n defaultVariants: {\n color: `${SwitchSelectorColor.PRIMARY}`,\n disabled: false,\n },\n }\n);\n\nexport enum SwitchSelectorSize {\n SM = 'sm',\n MD = 'md',\n LG = 'lg',\n}\n\nconst choiceVariant = cva(\n 'z-1 w-full flex-1 cursor-pointer font-medium text-sm transition-all duration-300 ease-in-out aria-selected:cursor-default data-[indicator=true]:text-text-opposite motion-reduce:transition-none',\n {\n variants: {\n size: {\n [`${SwitchSelectorSize.SM}`]: 'px-2 py-1 text-xs',\n [`${SwitchSelectorSize.MD}`]: 'p-2 text-sm',\n [`${SwitchSelectorSize.LG}`]: 'p-4 text-base',\n },\n },\n defaultVariants: {\n size: `${SwitchSelectorSize.MD}`,\n },\n }\n);\n\nconst indicatorVariant = cva(\n 'absolute top-0 z-0 h-full w-auto rounded-full transition-[left,width] duration-300 ease-in-out motion-reduce:transition-none',\n {\n variants: {\n color: {\n [`${SwitchSelectorColor.PRIMARY}`]:\n 'bg-primary data-[indicator=true]:text-text',\n [`${SwitchSelectorColor.SECONDARY}`]:\n 'bg-secondary data-[indicator=true]:text-text',\n [`${SwitchSelectorColor.DESTRUCTIVE}`]:\n 'bg-destructive data-[indicator=true]:text-text',\n [`${SwitchSelectorColor.NEUTRAL}`]:\n 'bg-neutral data-[indicator=true]:text-white',\n [`${SwitchSelectorColor.LIGHT}`]:\n 'bg-white data-[indicator=true]:text-black',\n [`${SwitchSelectorColor.DARK}`]:\n 'bg-neutral-800 data-[indicator=true]:text-white',\n [`${SwitchSelectorColor.TEXT}`]:\n 'bg-text data-[indicator=true]:text-text-opposite',\n },\n },\n }\n);\n\n/**\n *\n * Component that allows the user to select one of the provided choices.\n *\n * Example:\n * ```jsx\n * <SwitchSelector\n * choices={[\n * { content: 'Option 1', value: 'option1' },\n * { content: 'Option 2', value: 'option2' },\n * { content: 'Option 3', value: 'option3' },\n * ]}\n * value=\"option1\"\n * onChange={(choice) => console.log(choice)}\n * />\n * ```\n */\nexport const SwitchSelector = <T,>({\n choices = defaultChoices as SwitchSelectorChoices<T>,\n value,\n defaultValue,\n onChange,\n color = SwitchSelectorColor.PRIMARY,\n size = SwitchSelectorSize.MD,\n className,\n hoverable = true,\n disabled = false,\n}: SwitchSelectorProps<T>) => {\n const [valueState, setValue] = useState<T>(\n value ?? defaultValue ?? choices[0].value\n );\n const [hoveredIndex, setHoveredIndex] = useState<number | null>(null);\n\n const optionsRefs = useRef<HTMLButtonElement[]>([]);\n const indicatorRef = useRef<HTMLDivElement | null>(null);\n const { choiceIndicatorPosition } = useItemSelector(optionsRefs, {\n isHoverable: hoverable,\n });\n\n const selectedIndex = choices.findIndex(\n (choice) => choice.value === valueState\n );\n\n // The indicator follows hover if hoverable, otherwise the selected option\n const indicatorIndex =\n hoverable && hoveredIndex !== null ? hoveredIndex : selectedIndex;\n\n const handleChange = (newValue: T) => {\n setValue(newValue);\n onChange?.(newValue);\n };\n\n useEffect(() => {\n if (value === undefined) return;\n setValue(value);\n }, [value]);\n\n return (\n <div\n className={switchSelectorVariant({\n color,\n disabled,\n className,\n })}\n role=\"tablist\"\n aria-disabled={disabled ? 'true' : undefined}\n >\n <div className=\"relative flex size-full flex-row items-center justify-center\">\n {choices.map((choice, index) => {\n const { content, value, ...buttonProps } = choice;\n\n const isKeyOfKey =\n typeof value === 'string' || typeof value === 'number';\n\n const isSelected = index === selectedIndex;\n const isIndicatorOwner = index === indicatorIndex;\n\n return (\n <button\n {...buttonProps}\n className={cn(\n choiceVariant({\n size,\n }),\n disabled && 'cursor-not-allowed'\n )}\n key={isKeyOfKey ? value : index}\n role=\"tab\"\n onClick={() => handleChange(value)}\n aria-selected={isSelected ? 'true' : undefined}\n data-indicator={isIndicatorOwner ? 'true' : undefined}\n disabled={disabled || isSelected}\n tabIndex={isSelected ? 0 : -1}\n ref={(el) => {\n optionsRefs.current[index] = el!;\n }}\n onMouseEnter={() => !disabled && setHoveredIndex(index)}\n onMouseLeave={() => !disabled && setHoveredIndex(null)}\n >\n {content}\n </button>\n );\n })}\n\n {choiceIndicatorPosition && (\n <div\n className={cn(\n indicatorVariant({\n color,\n })\n )}\n style={choiceIndicatorPosition}\n ref={indicatorRef}\n />\n )}\n </div>\n </div>\n );\n};\n"],"mappings":"uSAmBA,MAAM,EAAiD,CACrD,CAAE,QAAS,MAAO,MAAO,GAAO,CAChC,CAAE,QAAS,KAAM,MAAO,GAAM,CAC/B,CAaD,IAAY,EAAL,SAAA,EAAA,OACL,GAAA,QAAA,UACA,EAAA,UAAA,YACA,EAAA,YAAA,cACA,EAAA,QAAA,UACA,EAAA,MAAA,QACA,EAAA,KAAA,OACA,EAAA,KAAA,aACD,CAED,MAAM,EAAwB,EAC5B,iFACA,CACE,SAAU,CACR,MAAO,EACJ,GAAG,EAAoB,WAAY,+BACnC,GAAG,EAAoB,aAAc,mCACrC,GAAG,EAAoB,eACtB,sDACD,GAAG,EAAoB,WAAY,+BACnC,GAAG,EAAoB,SAAU,2BACjC,GAAG,EAAoB,QAAS,uCAChC,GAAG,EAAoB,QAAS,wBAClC,CACD,SAAU,CACR,KAAM,gCACN,MAAO,GACR,CACF,CACD,gBAAiB,CACf,MAAO,GAAG,EAAoB,UAC9B,SAAU,GACX,CACF,CACF,CAED,IAAY,EAAL,SAAA,EAAA,OACL,GAAA,GAAA,KACA,EAAA,GAAA,KACA,EAAA,GAAA,WACD,CAED,MAAM,EAAgB,EACpB,mMACA,CACE,SAAU,CACR,KAAM,EACH,GAAG,EAAmB,MAAO,qBAC7B,GAAG,EAAmB,MAAO,eAC7B,GAAG,EAAmB,MAAO,gBAC/B,CACF,CACD,gBAAiB,CACf,KAAM,GAAG,EAAmB,KAC7B,CACF,CACF,CAEK,EAAmB,EACvB,+HACA,CACE,SAAU,CACR,MAAO,EACJ,GAAG,EAAoB,WACtB,8CACD,GAAG,EAAoB,aACtB,gDACD,GAAG,EAAoB,eACtB,kDACD,GAAG,EAAoB,WACtB,+CACD,GAAG,EAAoB,SACtB,6CACD,GAAG,EAAoB,QAC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,CAAC,GAAY,EAAgB,EAAM,CACvD,iBAAoB,CAAC,GAAY,EAAgB,KAAK,CAG/C,CADN,EACM,EAEX,CAED,GACC,EAAC,MAAD,CACE,UAAW,EACT,EAAiB,CACf,QACD,CAAC,CACH,CACD,MAAO,EACP,IAAK,EACL,CAAA,CAEA,GACF,CAAA"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../../../src/components/SwitchSelector/index.tsx"],"sourcesContent":["'use client';\n\nimport { useItemSelector } from '@hooks/useItemSelector';\nimport { cn } from '@utils/cn';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport {\n type HTMLAttributes,\n type ReactNode,\n useEffect,\n useRef,\n useState,\n} from 'react';\n\nexport type SwitchSelectorChoice<T = boolean> = {\n content: ReactNode;\n value: T;\n} & HTMLAttributes<HTMLButtonElement>;\nexport type SwitchSelectorChoices<T> = SwitchSelectorChoice<T>[];\n\nconst defaultChoices: SwitchSelectorChoices<boolean> = [\n { content: 'Off', value: false },\n { content: 'On', value: true },\n];\n\nexport type SwitchSelectorProps<T = boolean> = {\n choices?: SwitchSelectorChoices<T>;\n value?: T;\n defaultValue?: T;\n onChange?: (choice: T) => void;\n className?: string;\n itemClassName?: string;\n hoverable?: boolean;\n disabled?: boolean;\n} & VariantProps<typeof switchSelectorVariant> &\n VariantProps<typeof choiceVariant>;\n\nexport enum SwitchSelectorColor {\n PRIMARY = 'primary',\n SECONDARY = 'secondary',\n DESTRUCTIVE = 'destructive',\n NEUTRAL = 'neutral',\n LIGHT = 'light',\n DARK = 'dark',\n TEXT = 'text',\n}\n\nconst switchSelectorVariant = cva(\n 'flex w-fit cursor-pointer flex-row gap-2 rounded-full border-[1.3px] p-[1.5px]',\n {\n variants: {\n color: {\n [`${SwitchSelectorColor.PRIMARY}`]: 'border-primary text-primary',\n [`${SwitchSelectorColor.SECONDARY}`]: 'border-secondary text-secondary',\n [`${SwitchSelectorColor.DESTRUCTIVE}`]:\n 'border-destructive bg-destructive text-destructive',\n [`${SwitchSelectorColor.NEUTRAL}`]: 'border-neutral text-neutral',\n [`${SwitchSelectorColor.LIGHT}`]: 'border-white text-white',\n [`${SwitchSelectorColor.DARK}`]: 'border-neutral-800 text-neutral-800',\n [`${SwitchSelectorColor.TEXT}`]: 'border-text text-text',\n },\n disabled: {\n true: 'cursor-not-allowed opacity-50',\n false: '',\n },\n },\n defaultVariants: {\n color: `${SwitchSelectorColor.PRIMARY}`,\n disabled: false,\n },\n }\n);\n\nexport enum SwitchSelectorSize {\n SM = 'sm',\n MD = 'md',\n LG = 'lg',\n}\n\nconst choiceVariant = cva(\n 'z-1 w-full flex-1 cursor-pointer font-medium text-sm transition-all duration-300 ease-in-out aria-selected:cursor-default data-[indicator=true]:text-text-opposite motion-reduce:transition-none',\n {\n variants: {\n size: {\n [`${SwitchSelectorSize.SM}`]: 'px-2 py-1 text-xs',\n [`${SwitchSelectorSize.MD}`]: 'p-2 text-sm',\n [`${SwitchSelectorSize.LG}`]: 'p-4 text-base',\n },\n },\n defaultVariants: {\n size: `${SwitchSelectorSize.MD}`,\n },\n }\n);\n\nconst indicatorVariant = cva(\n 'absolute top-0 z-0 h-full w-auto rounded-full transition-[left,width] duration-300 ease-in-out motion-reduce:transition-none',\n {\n variants: {\n color: {\n [`${SwitchSelectorColor.PRIMARY}`]:\n 'bg-primary data-[indicator=true]:text-text',\n [`${SwitchSelectorColor.SECONDARY}`]:\n 'bg-secondary data-[indicator=true]:text-text',\n [`${SwitchSelectorColor.DESTRUCTIVE}`]:\n 'bg-destructive data-[indicator=true]:text-text',\n [`${SwitchSelectorColor.NEUTRAL}`]:\n 'bg-neutral data-[indicator=true]:text-white',\n [`${SwitchSelectorColor.LIGHT}`]:\n 'bg-white data-[indicator=true]:text-black',\n [`${SwitchSelectorColor.DARK}`]:\n 'bg-neutral-800 data-[indicator=true]:text-white',\n [`${SwitchSelectorColor.TEXT}`]:\n 'bg-text data-[indicator=true]:text-text-opposite',\n },\n },\n }\n);\n\n/**\n *\n * Component that allows the user to select one of the provided choices.\n *\n * Example:\n * ```jsx\n * <SwitchSelector\n * choices={[\n * { content: 'Option 1', value: 'option1' },\n * { content: 'Option 2', value: 'option2' },\n * { content: 'Option 3', value: 'option3' },\n * ]}\n * value=\"option1\"\n * onChange={(choice) => console.log(choice)}\n * />\n * ```\n */\nexport const SwitchSelector = <T,>({\n choices = defaultChoices as SwitchSelectorChoices<T>,\n value,\n defaultValue,\n onChange,\n color = SwitchSelectorColor.PRIMARY,\n size = SwitchSelectorSize.MD,\n className,\n itemClassName,\n hoverable = true,\n disabled = false,\n}: SwitchSelectorProps<T>) => {\n const [valueState, setValue] = useState<T>(\n value ?? defaultValue ?? choices[0].value\n );\n const [hoveredIndex, setHoveredIndex] = useState<number | null>(null);\n\n const optionsRefs = useRef<HTMLButtonElement[]>([]);\n const indicatorRef = useRef<HTMLDivElement | null>(null);\n const { choiceIndicatorPosition } = useItemSelector(optionsRefs, {\n isHoverable: hoverable,\n });\n\n const selectedIndex = choices.findIndex(\n (choice) => choice.value === valueState\n );\n\n // The indicator follows hover if hoverable, otherwise the selected option\n const indicatorIndex =\n hoverable && hoveredIndex !== null ? hoveredIndex : selectedIndex;\n\n const handleChange = (newValue: T) => {\n setValue(newValue);\n onChange?.(newValue);\n };\n\n useEffect(() => {\n if (value === undefined) return;\n setValue(value);\n }, [value]);\n\n return (\n <div\n className={switchSelectorVariant({\n color,\n disabled,\n className,\n })}\n role=\"tablist\"\n aria-disabled={disabled ? 'true' : undefined}\n >\n <div className=\"relative flex size-full flex-row items-center justify-center\">\n {choices.map((choice, index) => {\n const { content, value, ...buttonProps } = choice;\n\n const isKeyOfKey =\n typeof value === 'string' || typeof value === 'number';\n\n const isSelected = index === selectedIndex;\n const isIndicatorOwner = index === indicatorIndex;\n\n return (\n <button\n {...buttonProps}\n className={cn(\n choiceVariant({\n size,\n }),\n disabled && 'cursor-not-allowed',\n itemClassName\n )}\n key={isKeyOfKey ? value : index}\n role=\"tab\"\n onClick={() => handleChange(value)}\n aria-selected={isSelected ? 'true' : undefined}\n data-indicator={isIndicatorOwner ? 'true' : undefined}\n disabled={disabled || isSelected}\n tabIndex={isSelected ? 0 : -1}\n ref={(el) => {\n optionsRefs.current[index] = el!;\n }}\n onMouseEnter={() => !disabled && setHoveredIndex(index)}\n onMouseLeave={() => !disabled && setHoveredIndex(null)}\n >\n {content}\n </button>\n );\n })}\n\n {choiceIndicatorPosition && (\n <div\n className={cn(\n indicatorVariant({\n color,\n })\n )}\n style={choiceIndicatorPosition}\n ref={indicatorRef}\n />\n )}\n </div>\n </div>\n );\n};\n"],"mappings":"uSAmBA,MAAM,EAAiD,CACrD,CAAE,QAAS,MAAO,MAAO,GAAO,CAChC,CAAE,QAAS,KAAM,MAAO,GAAM,CAC/B,CAcD,IAAY,EAAL,SAAA,EAAA,OACL,GAAA,QAAA,UACA,EAAA,UAAA,YACA,EAAA,YAAA,cACA,EAAA,QAAA,UACA,EAAA,MAAA,QACA,EAAA,KAAA,OACA,EAAA,KAAA,aACD,CAED,MAAM,EAAwB,EAC5B,iFACA,CACE,SAAU,CACR,MAAO,EACJ,GAAG,EAAoB,WAAY,+BACnC,GAAG,EAAoB,aAAc,mCACrC,GAAG,EAAoB,eACtB,sDACD,GAAG,EAAoB,WAAY,+BACnC,GAAG,EAAoB,SAAU,2BACjC,GAAG,EAAoB,QAAS,uCAChC,GAAG,EAAoB,QAAS,wBAClC,CACD,SAAU,CACR,KAAM,gCACN,MAAO,GACR,CACF,CACD,gBAAiB,CACf,MAAO,GAAG,EAAoB,UAC9B,SAAU,GACX,CACF,CACF,CAED,IAAY,EAAL,SAAA,EAAA,OACL,GAAA,GAAA,KACA,EAAA,GAAA,KACA,EAAA,GAAA,WACD,CAED,MAAM,EAAgB,EACpB,mMACA,CACE,SAAU,CACR,KAAM,EACH,GAAG,EAAmB,MAAO,qBAC7B,GAAG,EAAmB,MAAO,eAC7B,GAAG,EAAmB,MAAO,gBAC/B,CACF,CACD,gBAAiB,CACf,KAAM,GAAG,EAAmB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ACD,IAAK,EAAa,EAAQ,EAC1B,KAAK,MACL,YAAe,EAAa,EAAM,CAClC,gBAAe,EAAa,OAAS,IAAA,GACrC,iBAAgB,EAAmB,OAAS,IAAA,GAC5C,SAAU,GAAY,EACtB,SAAU,EAAa,EAAI,GAC3B,IAAM,GAAO,CACX,EAAY,QAAQ,GAAS,GAE/B,iBAAoB,CAAC,GAAY,EAAgB,EAAM,CACvD,iBAAoB,CAAC,GAAY,EAAgB,KAAK,CAG/C,CADN,EACM,EAEX,CAED,GACC,EAAC,MAAD,CACE,UAAW,EACT,EAAiB,CACf,QACD,CAAC,CACH,CACD,MAAO,EACP,IAAK,EACL,CAAA,CAEA,GACF,CAAA"}
@@ -1 +1 @@
1
- import{useKeyboardDetector as e}from"./useKeyboardDetector.mjs";import{useGetElementOrWindow as t}from"./useGetElementOrWindow.mjs";import{useScrollY as n}from"./useScrollY.mjs";import{usePersistedStore as r}from"./usePersistedStore.mjs";import{useHorizontalSwipe as i}from"./useHorizontalSwipe.mjs";import{useItemSelector as a}from"./useItemSelector.mjs";import{calculateIsMobile as o,checkIsIOS as s,checkIsIphoneOrSafariDevice as c,checkIsMac as l,checkIsMobileScreen as u,checkIsMobileUserAgent as d,getBreakpointFromSize as f,useDevice as p}from"./useDevice.mjs";import{useOAuth2 as m}from"./useAuth/useOAuth2.mjs";import{useSession as h}from"./useAuth/useSession.mjs";import{useAuth as g}from"./useAuth/useAuth.mjs";import{useIntlayerAuth as _,useIntlayerOAuth as v}from"./useIntlayerAPI.mjs";import{useAddDictionary as y,useAddNewAccessKey as b,useAddOrganization as x,useAddOrganizationMember as S,useAddPasskey as C,useAddProject as w,useAddTag as T,useAppQuery as E,useAskDocQuestion as D,useAskResetPassword as O,useAuditContentDeclaration as k,useAuditContentDeclarationField as A,useAuditContentDeclarationMetadata as j,useAuditScan as M,useAuditTag as N,useAutocomplete as P,useBitbucketAuth as F,useBitbucketCheckConfig as I,useBitbucketGetConfigFile as L,useBitbucketRepos as R,useCancelSubscription as z,useChangePassword as B,useCreateUser as V,useDeleteAccessKey as H,useDeleteDictionary as U,useDeleteOrganization as W,useDeletePasskey as G,useDeleteProject as K,useDeleteSSOProvider as q,useDeleteShowcaseProject as J,useDeleteTag as Y,useDeleteUser as X,useDisableTwoFactor as Z,useEnableTwoFactor as Q,useGetCIConfig as $,useGetDictionaries as ee,useGetDictionariesKeys as te,useGetDictionary as ne,useGetDiscussions as re,useGetDiscussionsData as ie,useGetEditorDictionaries as ae,useGetNewsletterStatus as oe,useGetOrganizations as se,useGetOtherShowcaseProjects as ce,useGetPricing as le,useGetProjects as ue,useGetRecursiveAuditStatus as de,useGetShowcaseProjectById as fe,useGetShowcaseProjects as pe,useGetSubscription as me,useGetTags as he,useGetUserByAccount as ge,useGetUserById as _e,useGetUsers as ve,useGetVerifyEmailStatus as ye,useGithubAuth as be,useGithubCheckConfig as xe,useGithubGetAuthUrl as Se,useGithubGetConfigFile as Ce,useGithubRepos as we,useGitlabAuth as Te,useGitlabCheckConfig as Ee,useGitlabGetConfigFile as De,useGitlabProjects as Oe,useInfiniteGetDictionaries as ke,useListPasskeys as Ae,useListSSOProviders as je,useLogin as Me,useLogout as Ne,usePushCIConfig as Pe,usePushDictionaries as Fe,useQueryClient as Ie,useRefreshAccessKey as Le,useRegister as Re,useRegisterSSO as ze,useResetPassword as Be,useSearchDoc as Ve,useSelectOrganization as He,useSelectProject as Ue,useSignInMagicLink as We,useSignInPasskey as Ge,useSignInSSO as Ke,useStartRecursiveAudit as qe,useSubmitShowcaseProject as Je,useSubscribeToNewsletter as Ye,useToggleShowcaseDownvote as Xe,useToggleShowcaseUpvote as Ze,useTranslateJSONDeclaration as Qe,useTriggerBuild as $e,useTriggerWebhook as et,useUnselectOrganization as tt,useUnselectProject as nt,useUnsubscribeFromNewsletter as rt,useUpdateDictionary as it,useUpdateOrganization as at,useUpdateOrganizationMembers as ot,useUpdateOrganizationMembersById as st,useUpdateProject as ct,useUpdateProjectMembers as lt,useUpdateShowcaseProject as ut,useUpdateTag as dt,useUpdateUser as ft,useVerifyBackupCode as pt,useVerifyEmail as mt,useVerifyTotp as ht,useWriteDictionary as gt}from"./reactQuery.mjs";import{useSearch as _t}from"./useSearch.mjs";import{useIsMounted as vt}from"./useIsMounted.mjs";import{useGetElementById as yt}from"./useGetElementById.mjs";import{useIsDarkMode as bt}from"./useIsDarkMode.mjs";import{useScreenWidth as xt}from"./useScreenWidth.mjs";import{useScrollBlockage as St}from"./useScrollBlockage/index.mjs";import{useScrollDetection as Ct}from"./useScrollDetection.mjs";import{useUser as wt}from"./useUser/index.mjs";export{o as calculateIsMobile,s as checkIsIOS,c as checkIsIphoneOrSafariDevice,l as checkIsMac,u as checkIsMobileScreen,d as checkIsMobileUserAgent,f as getBreakpointFromSize,y as useAddDictionary,b as useAddNewAccessKey,x as useAddOrganization,S as useAddOrganizationMember,C as useAddPasskey,w as useAddProject,T as useAddTag,E as useAppQuery,D as useAskDocQuestion,O as useAskResetPassword,k as useAuditContentDeclaration,A as useAuditContentDeclarationField,j as useAuditContentDeclarationMetadata,M as useAuditScan,N as useAuditTag,g as useAuth,P as useAutocomplete,F as useBitbucketAuth,I as useBitbucketCheckConfig,L as useBitbucketGetConfigFile,R as useBitbucketRepos,z as useCancelSubscription,B as useChangePassword,V as useCreateUser,H as useDeleteAccessKey,U as useDeleteDictionary,W as useDeleteOrganization,G as useDeletePasskey,K as useDeleteProject,q as useDeleteSSOProvider,J as useDeleteShowcaseProject,Y as useDeleteTag,X as useDeleteUser,p as useDevice,Z as useDisableTwoFactor,Q as useEnableTwoFactor,$ as useGetCIConfig,ee as useGetDictionaries,te as useGetDictionariesKeys,ne as useGetDictionary,re as useGetDiscussions,ie as useGetDiscussionsData,ae as useGetEditorDictionaries,yt as useGetElementById,t as useGetElementOrWindow,oe as useGetNewsletterStatus,se as useGetOrganizations,ce as useGetOtherShowcaseProjects,le as useGetPricing,ue as useGetProjects,de as useGetRecursiveAuditStatus,fe as useGetShowcaseProjectById,pe as useGetShowcaseProjects,me as useGetSubscription,he as useGetTags,ge as useGetUserByAccount,_e as useGetUserById,ve as useGetUsers,ye as useGetVerifyEmailStatus,be as useGithubAuth,xe as useGithubCheckConfig,Se as useGithubGetAuthUrl,Ce as useGithubGetConfigFile,we as useGithubRepos,Te as useGitlabAuth,Ee as useGitlabCheckConfig,De as useGitlabGetConfigFile,Oe as useGitlabProjects,i as useHorizontalSwipe,ke as useInfiniteGetDictionaries,_ as useIntlayerAuth,v as useIntlayerOAuth,bt as useIsDarkMode,vt as useIsMounted,a as useItemSelector,e as useKeyboardDetector,Ae as useListPasskeys,je as useListSSOProviders,Me as useLogin,Ne as useLogout,m as useOAuth2,r as usePersistedStore,Pe as usePushCIConfig,Fe as usePushDictionaries,Ie as useQueryClient,Le as useRefreshAccessKey,Re as useRegister,ze as useRegisterSSO,Be as useResetPassword,xt as useScreenWidth,St as useScrollBlockage,Ct as useScrollDetection,n as useScrollY,_t as useSearch,Ve as useSearchDoc,He as useSelectOrganization,Ue as useSelectProject,h as useSession,We as useSignInMagicLink,Ge as useSignInPasskey,Ke as useSignInSSO,qe as useStartRecursiveAudit,Je as useSubmitShowcaseProject,Ye as useSubscribeToNewsletter,Xe as useToggleShowcaseDownvote,Ze as useToggleShowcaseUpvote,Qe as useTranslateJSONDeclaration,$e as useTriggerBuild,et as useTriggerWebhook,tt as useUnselectOrganization,nt as useUnselectProject,rt as useUnsubscribeFromNewsletter,it as useUpdateDictionary,at as useUpdateOrganization,ot as useUpdateOrganizationMembers,st as useUpdateOrganizationMembersById,ct as useUpdateProject,lt as useUpdateProjectMembers,ut as useUpdateShowcaseProject,dt as useUpdateTag,ft as useUpdateUser,wt as useUser,pt as useVerifyBackupCode,mt as useVerifyEmail,ht as useVerifyTotp,gt as useWriteDictionary};
1
+ import{calculateIsMobile as e,checkIsIOS as t,checkIsIphoneOrSafariDevice as n,checkIsMac as r,checkIsMobileScreen as i,checkIsMobileUserAgent as a,getBreakpointFromSize as o,useDevice as s}from"./useDevice.mjs";import{useOAuth2 as c}from"./useAuth/useOAuth2.mjs";import{useSession as l}from"./useAuth/useSession.mjs";import{useAuth as u}from"./useAuth/useAuth.mjs";import{useIntlayerAuth as d,useIntlayerOAuth as f}from"./useIntlayerAPI.mjs";import{useAddDictionary as p,useAddNewAccessKey as m,useAddOrganization as h,useAddOrganizationMember as g,useAddPasskey as _,useAddProject as v,useAddTag as y,useAppQuery as b,useAskDocQuestion as x,useAskResetPassword as S,useAuditContentDeclaration as C,useAuditContentDeclarationField as w,useAuditContentDeclarationMetadata as T,useAuditScan as E,useAuditTag as D,useAutocomplete as O,useBitbucketAuth as k,useBitbucketCheckConfig as A,useBitbucketGetConfigFile as j,useBitbucketRepos as M,useCancelSubscription as N,useChangePassword as P,useCreateUser as F,useDeleteAccessKey as I,useDeleteDictionary as L,useDeleteOrganization as R,useDeletePasskey as z,useDeleteProject as B,useDeleteSSOProvider as V,useDeleteShowcaseProject as H,useDeleteTag as U,useDeleteUser as W,useDisableTwoFactor as G,useEnableTwoFactor as K,useGetCIConfig as q,useGetDictionaries as J,useGetDictionariesKeys as Y,useGetDictionary as X,useGetDiscussions as Z,useGetDiscussionsData as Q,useGetEditorDictionaries as $,useGetNewsletterStatus as ee,useGetOrganizations as te,useGetOtherShowcaseProjects as ne,useGetPricing as re,useGetProjects as ie,useGetRecursiveAuditStatus as ae,useGetShowcaseProjectById as oe,useGetShowcaseProjects as se,useGetSubscription as ce,useGetTags as le,useGetUserByAccount as ue,useGetUserById as de,useGetUsers as fe,useGetVerifyEmailStatus as pe,useGithubAuth as me,useGithubCheckConfig as he,useGithubGetAuthUrl as ge,useGithubGetConfigFile as _e,useGithubRepos as ve,useGitlabAuth as ye,useGitlabCheckConfig as be,useGitlabGetConfigFile as xe,useGitlabProjects as Se,useInfiniteGetDictionaries as Ce,useListPasskeys as we,useListSSOProviders as Te,useLogin as Ee,useLogout as De,usePushCIConfig as Oe,usePushDictionaries as ke,useQueryClient as Ae,useRefreshAccessKey as je,useRegister as Me,useRegisterSSO as Ne,useResetPassword as Pe,useSearchDoc as Fe,useSelectOrganization as Ie,useSelectProject as Le,useSignInMagicLink as Re,useSignInPasskey as ze,useSignInSSO as Be,useStartRecursiveAudit as Ve,useSubmitShowcaseProject as He,useSubscribeToNewsletter as Ue,useToggleShowcaseDownvote as We,useToggleShowcaseUpvote as Ge,useTranslateJSONDeclaration as Ke,useTriggerBuild as qe,useTriggerWebhook as Je,useUnselectOrganization as Ye,useUnselectProject as Xe,useUnsubscribeFromNewsletter as Ze,useUpdateDictionary as Qe,useUpdateOrganization as $e,useUpdateOrganizationMembers as et,useUpdateOrganizationMembersById as tt,useUpdateProject as nt,useUpdateProjectMembers as rt,useUpdateShowcaseProject as it,useUpdateTag as at,useUpdateUser as ot,useVerifyBackupCode as st,useVerifyEmail as ct,useVerifyTotp as lt,useWriteDictionary as ut}from"./reactQuery.mjs";import{usePersistedStore as dt}from"./usePersistedStore.mjs";import{useItemSelector as ft}from"./useItemSelector.mjs";import{useUser as pt}from"./useUser/index.mjs";import{useHorizontalSwipe as mt}from"./useHorizontalSwipe.mjs";import{useGetElementById as ht}from"./useGetElementById.mjs";import{useGetElementOrWindow as gt}from"./useGetElementOrWindow.mjs";import{useIsDarkMode as _t}from"./useIsDarkMode.mjs";import{useIsMounted as vt}from"./useIsMounted.mjs";import{useKeyboardDetector as yt}from"./useKeyboardDetector.mjs";import{useScreenWidth as bt}from"./useScreenWidth.mjs";import{useScrollBlockage as xt}from"./useScrollBlockage/index.mjs";import{useScrollDetection as St}from"./useScrollDetection.mjs";import{useScrollY as Ct}from"./useScrollY.mjs";import{useSearch as wt}from"./useSearch.mjs";export{e as calculateIsMobile,t as checkIsIOS,n as checkIsIphoneOrSafariDevice,r as checkIsMac,i as checkIsMobileScreen,a as checkIsMobileUserAgent,o as getBreakpointFromSize,p as useAddDictionary,m as useAddNewAccessKey,h as useAddOrganization,g as useAddOrganizationMember,_ as useAddPasskey,v as useAddProject,y as useAddTag,b as useAppQuery,x as useAskDocQuestion,S as useAskResetPassword,C as useAuditContentDeclaration,w as useAuditContentDeclarationField,T as useAuditContentDeclarationMetadata,E as useAuditScan,D as useAuditTag,u as useAuth,O as useAutocomplete,k as useBitbucketAuth,A as useBitbucketCheckConfig,j as useBitbucketGetConfigFile,M as useBitbucketRepos,N as useCancelSubscription,P as useChangePassword,F as useCreateUser,I as useDeleteAccessKey,L as useDeleteDictionary,R as useDeleteOrganization,z as useDeletePasskey,B as useDeleteProject,V as useDeleteSSOProvider,H as useDeleteShowcaseProject,U as useDeleteTag,W as useDeleteUser,s as useDevice,G as useDisableTwoFactor,K as useEnableTwoFactor,q as useGetCIConfig,J as useGetDictionaries,Y as useGetDictionariesKeys,X as useGetDictionary,Z as useGetDiscussions,Q as useGetDiscussionsData,$ as useGetEditorDictionaries,ht as useGetElementById,gt as useGetElementOrWindow,ee as useGetNewsletterStatus,te as useGetOrganizations,ne as useGetOtherShowcaseProjects,re as useGetPricing,ie as useGetProjects,ae as useGetRecursiveAuditStatus,oe as useGetShowcaseProjectById,se as useGetShowcaseProjects,ce as useGetSubscription,le as useGetTags,ue as useGetUserByAccount,de as useGetUserById,fe as useGetUsers,pe as useGetVerifyEmailStatus,me as useGithubAuth,he as useGithubCheckConfig,ge as useGithubGetAuthUrl,_e as useGithubGetConfigFile,ve as useGithubRepos,ye as useGitlabAuth,be as useGitlabCheckConfig,xe as useGitlabGetConfigFile,Se as useGitlabProjects,mt as useHorizontalSwipe,Ce as useInfiniteGetDictionaries,d as useIntlayerAuth,f as useIntlayerOAuth,_t as useIsDarkMode,vt as useIsMounted,ft as useItemSelector,yt as useKeyboardDetector,we as useListPasskeys,Te as useListSSOProviders,Ee as useLogin,De as useLogout,c as useOAuth2,dt as usePersistedStore,Oe as usePushCIConfig,ke as usePushDictionaries,Ae as useQueryClient,je as useRefreshAccessKey,Me as useRegister,Ne as useRegisterSSO,Pe as useResetPassword,bt as useScreenWidth,xt as useScrollBlockage,St as useScrollDetection,Ct as useScrollY,wt as useSearch,Fe as useSearchDoc,Ie as useSelectOrganization,Le as useSelectProject,l as useSession,Re as useSignInMagicLink,ze as useSignInPasskey,Be as useSignInSSO,Ve as useStartRecursiveAudit,He as useSubmitShowcaseProject,Ue as useSubscribeToNewsletter,We as useToggleShowcaseDownvote,Ge as useToggleShowcaseUpvote,Ke as useTranslateJSONDeclaration,qe as useTriggerBuild,Je as useTriggerWebhook,Ye as useUnselectOrganization,Xe as useUnselectProject,Ze as useUnsubscribeFromNewsletter,Qe as useUpdateDictionary,$e as useUpdateOrganization,et as useUpdateOrganizationMembers,tt as useUpdateOrganizationMembersById,nt as useUpdateProject,rt as useUpdateProjectMembers,it as useUpdateShowcaseProject,at as useUpdateTag,ot as useUpdateUser,pt as useUser,st as useVerifyBackupCode,ct as useVerifyEmail,lt as useVerifyTotp,ut as useWriteDictionary};
@@ -43,7 +43,7 @@ declare enum BadgeSize {
43
43
  * @description Defines the styling variants for different badge combinations
44
44
  */
45
45
  declare const badgeVariants: (props?: {
46
- color?: "error" | "custom" | "text" | "primary" | "secondary" | "destructive" | "neutral" | "light" | "dark" | "success";
46
+ color?: "primary" | "text" | "secondary" | "destructive" | "success" | "error" | "neutral" | "light" | "dark" | "custom";
47
47
  variant?: "none" | "default" | "outline" | "hoverable";
48
48
  size?: "sm" | "md" | "lg";
49
49
  } & class_variance_authority_types0.ClassProp) => string;
@@ -61,10 +61,10 @@ declare enum ButtonTextAlign {
61
61
  */
62
62
  declare const buttonVariants: (props?: {
63
63
  size?: "sm" | "md" | "lg" | "xl" | "icon-sm" | "icon-md" | "icon-lg" | "icon-xl";
64
- color?: "error" | "custom" | "text" | "primary" | "secondary" | "destructive" | "neutral" | "card" | "light" | "dark" | "current" | "text-inverse" | "success";
64
+ color?: "primary" | "text" | "secondary" | "destructive" | "success" | "error" | "neutral" | "light" | "dark" | "custom" | "card" | "current" | "text-inverse";
65
65
  roundedSize?: "sm" | "md" | "lg" | "xl" | "2xl" | "none" | "3xl" | "4xl" | "5xl" | "full";
66
- variant?: "input" | "none" | "default" | "outline" | "link" | "invisible-link" | "hoverable" | "fade";
67
- textAlign?: "left" | "center" | "right";
66
+ variant?: "input" | "none" | "default" | "outline" | "hoverable" | "link" | "invisible-link" | "fade";
67
+ textAlign?: "left" | "right" | "center";
68
68
  isFullWidth?: boolean;
69
69
  } & class_variance_authority_types0.ClassProp) => string;
70
70
  /**
@@ -5,7 +5,7 @@ import { VariantProps } from "class-variance-authority";
5
5
  //#region src/components/CollapsibleTable/CollapsibleTable.d.ts
6
6
  declare const collapsibleTableVariants: (props?: {
7
7
  size?: "sm" | "md" | "lg" | "xl" | "full";
8
- variant?: "default" | "ghost" | "dark" | "outlined";
8
+ variant?: "default" | "dark" | "ghost" | "outlined";
9
9
  spacing?: "sm" | "md" | "lg" | "none" | "auto";
10
10
  } & class_variance_authority_types0.ClassProp) => string;
11
11
  interface CollapsibleTableProps extends Omit<HTMLAttributes<HTMLElement>, 'title'>, VariantProps<typeof collapsibleTableVariants> {
@@ -29,7 +29,7 @@ declare const Command: {
29
29
  ref?: React.Ref<HTMLInputElement>;
30
30
  } & {
31
31
  asChild?: boolean;
32
- }, "key" | keyof react.InputHTMLAttributes<HTMLInputElement> | "asChild">, "type" | "onChange" | "value"> & {
32
+ }, "key" | "asChild" | keyof react.InputHTMLAttributes<HTMLInputElement>>, "onChange" | "type" | "value"> & {
33
33
  value?: string;
34
34
  onValueChange?: (search: string) => void;
35
35
  } & react.RefAttributes<HTMLInputElement>>;
@@ -12,9 +12,9 @@ declare const containerVariants: (props?: {
12
12
  transparency?: "xs" | "sm" | "md" | "lg" | "xl" | "none" | "full";
13
13
  padding?: "sm" | "md" | "lg" | "xl" | "2xl" | "none";
14
14
  separator?: "both" | "without" | "x" | "y";
15
- border?: "with" | "none";
16
- borderColor?: "error" | "success" | "text" | "primary" | "secondary" | "neutral" | "card" | "warning";
17
- background?: "with" | "none" | "hoverable";
15
+ border?: "none" | "with";
16
+ borderColor?: "error" | "success" | "primary" | "secondary" | "neutral" | "text" | "card" | "warning";
17
+ background?: "none" | "with" | "hoverable";
18
18
  gap?: "sm" | "md" | "lg" | "xl" | "2xl" | "none";
19
19
  } & class_variance_authority_types0.ClassProp) => string;
20
20
  /** Available rounded corner sizes for the container */
@@ -6,7 +6,7 @@ import { VariantProps } from "class-variance-authority";
6
6
  declare const checkboxVariants: (props?: {
7
7
  variant?: "default";
8
8
  size?: "xs" | "sm" | "md" | "lg";
9
- color?: "error" | "success" | "text" | "primary" | "secondary" | "neutral" | "destructive" | "custom" | "light" | "dark";
9
+ color?: "error" | "success" | "primary" | "secondary" | "destructive" | "neutral" | "light" | "dark" | "text" | "custom";
10
10
  validationStyleEnabled?: "enabled" | "disabled";
11
11
  } & class_variance_authority_types0.ClassProp) => string;
12
12
  declare enum CheckboxSize {
@@ -53,9 +53,9 @@ declare enum LinkUnderlined {
53
53
  FALSE = "false"
54
54
  }
55
55
  declare const linkVariants: (props?: {
56
- variant?: "default" | "invisible-link" | "hoverable" | "button" | "button-outlined";
56
+ variant?: "default" | "hoverable" | "button" | "invisible-link" | "button-outlined";
57
57
  roundedSize?: "sm" | "md" | "lg" | "xl" | "2xl" | "none" | "3xl" | "full";
58
- color?: "error" | "custom" | "text" | "primary" | "secondary" | "destructive" | "neutral" | "light" | "dark" | "text-inverse" | "success";
58
+ color?: "primary" | "text" | "secondary" | "destructive" | "success" | "error" | "neutral" | "light" | "dark" | "custom" | "text-inverse";
59
59
  size?: "sm" | "md" | "lg" | "xl" | "custom";
60
60
  underlined?: boolean | LinkUnderlined.DEFAULT;
61
61
  } & class_variance_authority_types0.ClassProp) => string;
@@ -1 +1 @@
1
- {"version":3,"file":"MarkDownRender.d.ts","names":[],"sources":["../../../../src/components/MarkDownRender/MarkDownRender.tsx"],"mappings":";;;;;;;;cA2Ma,sBAAA;cA1Lc,cAAA,WAAoB,kBAAA,CAAA,GAAA,CAAA,OAAA;cAGpB,cAAA,WAAoB,kBAAA,CAAA,GAAA,CAAA,OAAA;cAGpB,cAAA,WAAoB,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,CAAA,GAAA,CAAA,OAAA;EAAA;AAAA;AAAA,cAyDrB,gBAAA,EAAkB,EAAA,CAAG,qBAAA"}
@@ -20,9 +20,9 @@ interface MaxHeightSmootherProps extends HTMLAttributes<HTMLDivElement> {
20
20
  * MaxHeightSmoother Component
21
21
  *
22
22
  * A sophisticated container component that provides smooth height transitions
23
- * for collapsible content. Uses CSS Grid's fractional rows to create fluid
24
- * animations without JavaScript height calculations, making it performant
25
- * and smooth across all devices and screen sizes.
23
+ * for collapsible content. Implemented entirely in CSS no client-side
24
+ * JavaScript, hooks, or event listeners making it compatible with React
25
+ * Server Components and Next.js App Router without `'use client'`.
26
26
  *
27
27
  * @component
28
28
  * @example
@@ -38,125 +38,105 @@ interface MaxHeightSmootherProps extends HTMLAttributes<HTMLDivElement> {
38
38
  * @example
39
39
  * Hover-triggered expansion:
40
40
  * ```tsx
41
- * <MaxHeightSmoother isOverable={true}>
42
- * <div>
43
- * <p>This content expands when you hover over the container.</p>
44
- * <p>Perfect for preview cards or tooltips.</p>
45
- * </div>
41
+ * <MaxHeightSmoother isOverable>
42
+ * <p>This content expands when you hover over the container.</p>
46
43
  * </MaxHeightSmoother>
47
44
  * ```
48
45
  *
49
46
  * @example
50
- * Accessible focus-triggered expansion:
47
+ * Focus-triggered expansion (keyboard accessible):
51
48
  * ```tsx
52
- * <MaxHeightSmoother isFocusable={true}>
53
- * <div>
54
- * <h3>Expandable Section</h3>
55
- * <p>Tab to focus this container to expand the content.</p>
56
- * <p>Great for accessible progressive disclosure.</p>
57
- * </div>
49
+ * <MaxHeightSmoother isFocusable>
50
+ * <p>Tab to focus this container to expand the content.</p>
58
51
  * </MaxHeightSmoother>
59
52
  * ```
60
53
  *
61
54
  * @example
62
55
  * With minimum height for preview:
63
56
  * ```tsx
64
- * <MaxHeightSmoother
65
- * isOverable={true}
66
- * minHeight={100}
67
- * className="border rounded-lg p-4"
68
- * >
69
- * <div>
70
- * <h3>Article Preview</h3>
71
- * <p>This article preview shows the first few lines...</p>
72
- * <p>Hover to see the full content with smooth expansion.</p>
73
- * <p>The minHeight ensures some content is always visible.</p>
74
- * </div>
57
+ * <MaxHeightSmoother isOverable minHeight={100} className="border rounded-lg p-4">
58
+ * <h3>Article Preview</h3>
59
+ * <p>This shows a preview of the content. Hover to see all.</p>
75
60
  * </MaxHeightSmoother>
76
61
  * ```
77
62
  *
78
63
  * @example
79
- * Combined hover and focus behavior:
64
+ * Combined hover and focus:
80
65
  * ```tsx
81
- * <MaxHeightSmoother
82
- * isOverable={true}
83
- * isFocusable={true}
84
- * minHeight={80}
85
- * >
86
- * <div>
87
- * <h4>Interactive Card</h4>
88
- * <p>Expands on both hover and keyboard focus.</p>
89
- * <p>Accessible to both mouse and keyboard users.</p>
90
- * </div>
66
+ * <MaxHeightSmoother isOverable isFocusable minHeight={80}>
67
+ * <h4>Interactive Card</h4>
68
+ * <p>Expands on both hover and keyboard focus.</p>
91
69
  * </MaxHeightSmoother>
92
70
  * ```
93
71
  *
94
- * Features:
95
- * - Smooth CSS Grid-based height transitions (700ms duration)
96
- * - Three interaction modes: controlled, hover, and focus
97
- * - Configurable minimum height for collapsed state
98
- * - Accessible keyboard navigation support
99
- * - Overflow handling with smooth scrolling
100
- * - ARIA attributes for screen reader compatibility
101
- * - Performance-optimized with CSS-only animations
102
- * - Responsive design that works on all screen sizes
103
- *
104
- * Animation Technique:
105
- * Uses CSS Grid `grid-rows-[0fr]` to `grid-rows-[1fr]` transitions
106
- * instead of height animations, which provides:
107
- * - Smooth animations without knowing content height
108
- * - Better performance (no layout recalculations)
109
- * - More reliable across different content types
110
- * - Automatic adaptation to dynamic content changes
111
- *
112
- * Interaction Modes:
113
- * 1. **Controlled**: Use `isHidden` prop for external state control
114
- * 2. **Hover**: Set `isOverable={true}` for mouse hover expansion
115
- * 3. **Focus**: Set `isFocusable={true}` for keyboard focus expansion
116
- * 4. **Combined**: Use both `isOverable` and `isFocusable` together
117
- *
118
- * Accessibility Features:
119
- * - `role="button"` when focusable for proper screen reader context
120
- * - `tabIndex={0}` for keyboard navigation when focusable
121
- * - `aria-hidden` attribute for screen reader control
122
- * - Semantic focus management with focus-within pseudo-class
123
- * - High contrast focus indicators
124
- * - Respects prefers-reduced-motion settings
125
- *
126
- * Use Cases:
127
- * - FAQ accordions and expandable sections
128
- * - Article previews and read-more functionality
129
- * - Card hover effects and content previews
130
- * - Progressive disclosure for complex forms
131
- * - Tooltip and popover content containers
132
- * - Mobile-friendly collapsible navigation
133
- * - Dashboard widget expansion
134
- * - Email preview in mail clients
135
- *
136
- * Performance Considerations:
137
- * - Pure CSS animations (no JavaScript timer overhead)
138
- * - GPU acceleration through transform-based animations
139
- * - Minimal repaints and layout shifts
140
- * - Efficient event handling with CSS pseudo-classes
141
- * - No DOM measurements or calculations required
72
+ * ## Animation Strategies
73
+ *
74
+ * ### Strategy A `grid-template-rows` (`minHeight === 0`)
75
+ * Transitions between `grid-rows-[0fr]` and `grid-rows-[1fr]`.
76
+ * Clean and performant; no fixed height ceiling required.
77
+ * Requires `min-h-0` on the inner wrapper so the grid track can fully collapse.
78
+ *
79
+ * ### Strategy B — `max-height` via CSS custom properties (`minHeight > 0`)
80
+ * When a visible preview floor is required, `grid-template-rows` produces a
81
+ * "dead time" artifact: the track silently grows from 0 → minHeight before
82
+ * anything visible happens, resulting in a perceived snap.
83
+ *
84
+ * `max-height` sidesteps this entirely the transition starts from the
85
+ * already-visible floor value, producing a single continuous expansion.
86
+ *
87
+ * The collapsed floor (`--mhs-collapsed`) and expanded ceiling
88
+ * (`--mhs-expanded`) are injected as CSS variables via inline style,
89
+ * NOT as `max-height` directly. This lets Tailwind own `max-height`
90
+ * entirely, so `:hover` and `:focus-within` can override it freely
91
+ * without fighting inline-style specificity.
92
+ *
93
+ * Both variables are consumer-overridable via CSS:
94
+ * ```css
95
+ * .my-container {
96
+ * --mhs-collapsed: 80px;
97
+ * --mhs-expanded: 1200px;
98
+ * }
99
+ * ```
100
+ *
101
+ * Trade-off: easing is applied over [minHeight → 3000px], not the real
102
+ * content height. For typical content this is imperceptible. If pixel-perfect
103
+ * easing is critical, use a JS-measured height with a controlled `isHidden`
104
+ * prop and a `style={{ maxHeight }}` override instead.
105
+ *
106
+ * ## Interaction Modes
107
+ *
108
+ * 1. **Controlled** Pass `isHidden` for external state control (e.g. accordion)
109
+ * 2. **Hover** Set `isOverable` for mouse hover expansion
110
+ * 3. **Focus** Set `isFocusable` for keyboard focus expansion
111
+ * 4. **Combined** Use `isOverable` and `isFocusable` together
112
+ *
113
+ * ## Accessibility
114
+ *
115
+ * - `role="button"` and `tabIndex={0}` when `isFocusable` is true
116
+ * - `aria-expanded` reflects the current disclosure state
117
+ * - Focus expansion via `:focus-within` CSS pseudo-class
118
+ * - `motion-reduce:transition-none` respects `prefers-reduced-motion`
119
+ *
120
+ * Note: because this component relies on CSS pseudo-classes for interaction,
121
+ * keyboard toggle (Enter / Space) is not supported in uncontrolled mode.
122
+ * For full keyboard toggle behaviour, manage `isHidden` externally and
123
+ * wire an `onClick` / `onKeyDown` handler on the parent.
124
+ *
125
+ * ## Performance
126
+ *
127
+ * - Pure CSS animations — no JavaScript timers or DOM measurements
128
+ * - No `'use client'` directive required
129
+ * - Compatible with React Server Components and Next.js App Router
130
+ * - GPU-accelerated transitions
142
131
  *
143
132
  * @param props - Component props extending HTML div attributes
144
133
  * @param props.children - Content to render within the container
145
- * @param props.isHidden - Controlled collapse state (true=collapsed, false=expanded)
146
- * @param props.isOverable - Enable hover-to-expand behavior
147
- * @param props.isFocusable - Enable focus-to-expand behavior with keyboard navigation
148
- * @param props.minHeight - Minimum height in pixels for collapsed state (default: 0)
149
- * @param props.className - Additional CSS classes for styling
150
- * @param props.style - Inline styles (note: minHeight style will be applied)
151
- * @param props.role - ARIA role (automatically set to "button" when focusable)
152
- * @param props.tabIndex - Tab index (automatically set to 0 when focusable)
153
- * @param props.aria-hidden - ARIA hidden state (controlled by isHidden when focusable)
154
- * @param props.onClick - Click event handler
155
- * @param props.onMouseEnter - Mouse enter event handler
156
- * @param props.onMouseLeave - Mouse leave event handler
157
- * @param props.onFocus - Focus event handler
158
- * @param props.onBlur - Blur event handler
159
- * @param props...rest - All other standard HTML div attributes
134
+ * @param props.isHidden - Controlled collapse state (`true` = collapsed, `false` = expanded)
135
+ * @param props.isOverable - Enable hover-to-expand behaviour
136
+ * @param props.isFocusable - Enable focus-to-expand behaviour with keyboard navigation
137
+ * @param props.minHeight - Minimum height in pixels for the collapsed state (default: 0)
138
+ * @param props.className - Additional CSS classes
139
+ * @param props.style - Inline styles (CSS variable overrides will be merged)
160
140
  *
161
141
  * @returns A smooth height-transitioning container with configurable interaction modes
162
142
  */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../../../src/components/MaxHeightSmoother/index.tsx"],"mappings":";;;;;AAC2D;UAKjD,sBAAA,SAA+B,cAAA,CAAe,cAAA;;EAEtD,QAAA,EAAU,SAAA;EAAA;EAEV,QAAA;EAJqD;EAMrD,UAAA;EANuC;EAQvC,WAAA;EANA;EAQA,SAAA;AAAA;;;;;;AAmJF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAAa,iBAAA,EAAmB,EAAA,CAAG,sBAAA"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../../../src/components/MaxHeightSmoother/index.tsx"],"mappings":";;;;;AAC0E;UAKhE,sBAAA,SAA+B,cAAA,CAAe,cAAA;;EAEtD,QAAA,EAAU,SAAA;EAAA;EAEV,QAAA;EAJqD;EAMrD,UAAA;EANuC;EAQvC,WAAA;EANA;EAQA,SAAA;AAAA;;;;;;AA+HF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAAa,iBAAA,EAAmB,EAAA,CAAG,sBAAA"}
@@ -5,7 +5,7 @@ import { VariantProps } from "class-variance-authority";
5
5
  //#region src/components/Pagination/Pagination.d.ts
6
6
  declare const paginationVariants: (props?: {
7
7
  size?: "sm" | "md" | "lg";
8
- color?: "text" | "primary" | "secondary" | "neutral" | "destructive";
8
+ color?: "primary" | "secondary" | "destructive" | "neutral" | "text";
9
9
  variant?: "default" | "bordered" | "ghost";
10
10
  } & class_variance_authority_types0.ClassProp) => string;
11
11
  declare enum PaginationSize {
@@ -15,6 +15,7 @@ type SwitchSelectorProps<T = boolean> = {
15
15
  defaultValue?: T;
16
16
  onChange?: (choice: T) => void;
17
17
  className?: string;
18
+ itemClassName?: string;
18
19
  hoverable?: boolean;
19
20
  disabled?: boolean;
20
21
  } & VariantProps<typeof switchSelectorVariant> & VariantProps<typeof choiceVariant>;
@@ -28,7 +29,7 @@ declare enum SwitchSelectorColor {
28
29
  TEXT = "text"
29
30
  }
30
31
  declare const switchSelectorVariant: (props?: {
31
- color?: "text" | "primary" | "secondary" | "destructive" | "neutral" | "light" | "dark";
32
+ color?: "primary" | "text" | "secondary" | "destructive" | "neutral" | "light" | "dark";
32
33
  disabled?: boolean;
33
34
  } & class_variance_authority_types0.ClassProp) => string;
34
35
  declare enum SwitchSelectorSize {
@@ -64,6 +65,7 @@ declare const SwitchSelector: <T>({
64
65
  color,
65
66
  size,
66
67
  className,
68
+ itemClassName,
67
69
  hoverable,
68
70
  disabled
69
71
  }: SwitchSelectorProps<T>) => react_jsx_runtime0.JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../../../src/components/SwitchSelector/index.tsx"],"mappings":";;;;;;KAaY,oBAAA;EACV,OAAA,EAAS,SAAA;EACT,KAAA,EAAO,CAAA;AAAA,IACL,cAAA,CAAe,iBAAA;AAAA,KACP,qBAAA,MAA2B,oBAAA,CAAqB,CAAA;AAAA,KAOhD,mBAAA;EACV,OAAA,GAAU,qBAAA,CAAsB,CAAA;EAChC,KAAA,GAAQ,CAAA;EACR,YAAA,GAAe,CAAA;EACf,QAAA,IAAY,MAAA,EAAQ,CAAA;EACpB,SAAA;EACA,SAAA;EACA,QAAA;AAAA,IACE,YAAA,QAAoB,qBAAA,IACtB,YAAA,QAAoB,aAAA;AAAA,aAEV,mBAAA;EACV,OAAA;EACA,SAAA;EACA,WAAA;EACA,OAAA;EACA,KAAA;EACA,IAAA;EACA,IAAA;AAAA;AAAA,cAGI,qBAAA,GAAqB,KAAA;;;IAwB1B,+BAAA,CAAA,SAAA;AAAA,aAEW,kBAAA;EACV,EAAA;EACA,EAAA;EACA,EAAA;AAAA;AAAA,cAGI,aAAA,GAAa,KAAA;;IAclB,+BAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;cA2CY,cAAA;EAAsB,OAAA;EAAA,KAAA;EAAA,YAAA;EAAA,QAAA;EAAA,KAAA;EAAA,IAAA;EAAA,SAAA;EAAA,SAAA;EAAA;AAAA,GAUhC,mBAAA,CAAoB,CAAA,MAAE,kBAAA,CAAA,GAAA,CAAA,OAAA"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../../../src/components/SwitchSelector/index.tsx"],"mappings":";;;;;;KAaY,oBAAA;EACV,OAAA,EAAS,SAAA;EACT,KAAA,EAAO,CAAA;AAAA,IACL,cAAA,CAAe,iBAAA;AAAA,KACP,qBAAA,MAA2B,oBAAA,CAAqB,CAAA;AAAA,KAOhD,mBAAA;EACV,OAAA,GAAU,qBAAA,CAAsB,CAAA;EAChC,KAAA,GAAQ,CAAA;EACR,YAAA,GAAe,CAAA;EACf,QAAA,IAAY,MAAA,EAAQ,CAAA;EACpB,SAAA;EACA,aAAA;EACA,SAAA;EACA,QAAA;AAAA,IACE,YAAA,QAAoB,qBAAA,IACtB,YAAA,QAAoB,aAAA;AAAA,aAEV,mBAAA;EACV,OAAA;EACA,SAAA;EACA,WAAA;EACA,OAAA;EACA,KAAA;EACA,IAAA;EACA,IAAA;AAAA;AAAA,cAGI,qBAAA,GAAqB,KAAA;;;IAwB1B,+BAAA,CAAA,SAAA;AAAA,aAEW,kBAAA;EACV,EAAA;EACA,EAAA;EACA,EAAA;AAAA;AAAA,cAGI,aAAA,GAAa,KAAA;;IAclB,+BAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;cA2CY,cAAA;EAAsB,OAAA;EAAA,KAAA;EAAA,YAAA;EAAA,QAAA;EAAA,KAAA;EAAA,IAAA;EAAA,SAAA;EAAA,aAAA;EAAA,SAAA;EAAA;AAAA,GAWhC,mBAAA,CAAoB,CAAA,MAAE,kBAAA,CAAA,GAAA,CAAA,OAAA"}
@@ -15,7 +15,7 @@ declare enum TabSelectorColor {
15
15
  TEXT = "text"
16
16
  }
17
17
  declare const tabSelectorVariant: (props?: {
18
- color?: "text" | "primary" | "secondary" | "neutral" | "destructive" | "light" | "dark";
18
+ color?: "primary" | "secondary" | "destructive" | "neutral" | "light" | "dark" | "text";
19
19
  } & class_variance_authority_types0.ClassProp) => string;
20
20
  type TabSelectorItemProps = HTMLAttributes<HTMLElement> & {
21
21
  key: string | number;
@@ -186,7 +186,7 @@ declare enum TagBackground {
186
186
  }
187
187
  declare const containerVariants: (props?: {
188
188
  roundedSize?: "sm" | "md" | "lg" | "xl" | "2xl" | "none" | "3xl" | "full";
189
- color?: "error" | "text" | "primary" | "neutral" | "success" | "warning" | "blue" | "yellow" | "green" | "red" | "orange" | "purple" | "pink" | "brown" | "gray" | "black" | "white";
189
+ color?: "primary" | "text" | "success" | "error" | "neutral" | "warning" | "blue" | "yellow" | "green" | "red" | "orange" | "purple" | "pink" | "brown" | "gray" | "black" | "white";
190
190
  size?: "xs" | "sm" | "md" | "lg" | "xl";
191
191
  border?: "none" | "with";
192
192
  background?: "none" | "with";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intlayer/design-system",
3
- "version": "8.3.2",
3
+ "version": "8.3.4",
4
4
  "private": false,
5
5
  "description": "Intlayer design system, including UI components used in the Intlayer editor, website, and visual editor/CMS.",
6
6
  "keywords": [
@@ -106,12 +106,12 @@
106
106
  "dependencies": {
107
107
  "@better-auth/passkey": "1.5.5",
108
108
  "@better-auth/sso": "1.5.5",
109
- "@intlayer/api": "8.3.2",
110
- "@intlayer/config": "8.3.2",
111
- "@intlayer/core": "8.3.2",
112
- "@intlayer/dictionaries-entry": "8.3.2",
113
- "@intlayer/editor-react": "8.3.2",
114
- "@intlayer/types": "8.3.2",
109
+ "@intlayer/api": "8.3.4",
110
+ "@intlayer/config": "8.3.4",
111
+ "@intlayer/core": "8.3.4",
112
+ "@intlayer/dictionaries-entry": "8.3.4",
113
+ "@intlayer/editor-react": "8.3.4",
114
+ "@intlayer/types": "8.3.4",
115
115
  "@radix-ui/react-dialog": "1.1.15",
116
116
  "@radix-ui/react-select": "2.2.6",
117
117
  "@radix-ui/react-slot": "1.2.4",
@@ -120,12 +120,12 @@
120
120
  "better-auth": "1.5.5",
121
121
  "class-variance-authority": "0.7.1",
122
122
  "cmdk": "1.1.1",
123
- "react-intlayer": "8.3.2",
123
+ "react-intlayer": "8.3.4",
124
124
  "rollup-preserve-directives": "1.1.3",
125
125
  "zod": "4.3.6"
126
126
  },
127
127
  "devDependencies": {
128
- "@intlayer/backend": "8.3.2",
128
+ "@intlayer/backend": "8.3.4",
129
129
  "@shikijs/transformers": "4.0.2",
130
130
  "@storybook/addon-a11y": "8.6.14",
131
131
  "@storybook/addon-essentials": "8.6.14",
@@ -154,14 +154,14 @@
154
154
  "@utils/ts-config": "1.0.4",
155
155
  "@utils/ts-config-types": "1.0.4",
156
156
  "fast-glob": "3.3.3",
157
- "intlayer": "8.3.2",
157
+ "intlayer": "8.3.4",
158
158
  "rimraf": "6.1.3",
159
159
  "shiki": "4.0.2",
160
160
  "storybook": "8.6.17",
161
- "tsdown": "0.21.2",
161
+ "tsdown": "0.21.4",
162
162
  "typescript": "5.9.3",
163
163
  "vite": "8.0.0",
164
- "vite-intlayer": "8.3.2",
164
+ "vite-intlayer": "8.3.4",
165
165
  "vite-plugin-dts": "4.5.4",
166
166
  "vite-tsconfig-paths": "6.1.1",
167
167
  "vitest": "4.1.0"
@@ -169,20 +169,20 @@
169
169
  "peerDependencies": {
170
170
  "@better-fetch/fetch": "1.1.21",
171
171
  "@hookform/resolvers": "5.2.2",
172
- "@intlayer/backend": "8.3.2",
172
+ "@intlayer/backend": "8.3.4",
173
173
  "@monaco-editor/react": "4.7.0",
174
174
  "@shikijs/transformers": "4.0.2",
175
175
  "@tanstack/react-query": "5.90.21",
176
176
  "@tanstack/react-query-devtools": "5.91.3",
177
177
  "clsx": "2.1.1",
178
- "framer-motion": "12.36.0",
178
+ "framer-motion": "12.37.0",
179
179
  "fuse.js": "7.1.0",
180
- "intlayer": "8.3.2",
180
+ "intlayer": "8.3.4",
181
181
  "lucide-react": "0.577.0",
182
182
  "react": ">=16.0.0",
183
183
  "react-dom": ">=16.0.0",
184
184
  "react-hook-form": "7.71.2",
185
- "react-intlayer": "8.3.2",
185
+ "react-intlayer": "8.3.4",
186
186
  "shiki": "4.0.2",
187
187
  "tailwind-merge": "3.5.0",
188
188
  "tailwindcss": "4.2.1"