@ngrok/mantle 0.1.8 → 0.1.9

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 (89) hide show
  1. package/package.json +9 -10
  2. package/dist/alert.cjs +0 -2
  3. package/dist/alert.cjs.map +0 -1
  4. package/dist/alert.d.cts +0 -26
  5. package/dist/anchor.cjs +0 -2
  6. package/dist/anchor.cjs.map +0 -1
  7. package/dist/anchor.d.cts +0 -87
  8. package/dist/as-child-BjnPZ1DU.d.cts +0 -22
  9. package/dist/button.cjs +0 -2
  10. package/dist/button.cjs.map +0 -1
  11. package/dist/button.d.cts +0 -92
  12. package/dist/card.cjs +0 -2
  13. package/dist/card.cjs.map +0 -1
  14. package/dist/card.d.cts +0 -29
  15. package/dist/checkbox.cjs +0 -2
  16. package/dist/checkbox.cjs.map +0 -1
  17. package/dist/checkbox.d.cts +0 -6
  18. package/dist/chunk-D3F6KERE.cjs +0 -2
  19. package/dist/chunk-D3F6KERE.cjs.map +0 -1
  20. package/dist/chunk-IN6SIXF2.cjs +0 -2
  21. package/dist/chunk-IN6SIXF2.cjs.map +0 -1
  22. package/dist/chunk-JGNAMNKZ.cjs +0 -2
  23. package/dist/chunk-JGNAMNKZ.cjs.map +0 -1
  24. package/dist/chunk-K4UKFOMI.cjs +0 -2
  25. package/dist/chunk-K4UKFOMI.cjs.map +0 -1
  26. package/dist/chunk-ROHPZJ5N.cjs +0 -2
  27. package/dist/chunk-ROHPZJ5N.cjs.map +0 -1
  28. package/dist/code-block.cjs +0 -4
  29. package/dist/code-block.cjs.map +0 -1
  30. package/dist/code-block.d.cts +0 -108
  31. package/dist/cx.cjs +0 -2
  32. package/dist/cx.cjs.map +0 -1
  33. package/dist/cx.d.cts +0 -10
  34. package/dist/deep-non-nullable-SmpSvoSd.d.cts +0 -8
  35. package/dist/dialog.cjs +0 -2
  36. package/dist/dialog.cjs.map +0 -1
  37. package/dist/dialog.d.cts +0 -26
  38. package/dist/dropdown-menu.cjs +0 -2
  39. package/dist/dropdown-menu.cjs.map +0 -1
  40. package/dist/dropdown-menu.d.cts +0 -37
  41. package/dist/hooks.cjs +0 -2
  42. package/dist/hooks.cjs.map +0 -1
  43. package/dist/hooks.d.cts +0 -15
  44. package/dist/icon.cjs +0 -2
  45. package/dist/icon.cjs.map +0 -1
  46. package/dist/icon.d.cts +0 -23
  47. package/dist/inline-code.cjs +0 -2
  48. package/dist/inline-code.cjs.map +0 -1
  49. package/dist/inline-code.d.cts +0 -9
  50. package/dist/input.cjs +0 -2
  51. package/dist/input.cjs.map +0 -1
  52. package/dist/input.d.cts +0 -75
  53. package/dist/media-object.cjs +0 -2
  54. package/dist/media-object.cjs.map +0 -1
  55. package/dist/media-object.d.cts +0 -26
  56. package/dist/popover.cjs +0 -2
  57. package/dist/popover.cjs.map +0 -1
  58. package/dist/popover.d.cts +0 -8
  59. package/dist/select.cjs +0 -2
  60. package/dist/select.cjs.map +0 -1
  61. package/dist/select.d.cts +0 -19
  62. package/dist/separator.cjs +0 -2
  63. package/dist/separator.cjs.map +0 -1
  64. package/dist/separator.d.cts +0 -9
  65. package/dist/sheet.cjs +0 -2
  66. package/dist/sheet.cjs.map +0 -1
  67. package/dist/sheet.d.cts +0 -22
  68. package/dist/skeleton.cjs +0 -2
  69. package/dist/skeleton.cjs.map +0 -1
  70. package/dist/skeleton.d.cts +0 -14
  71. package/dist/table.cjs +0 -2
  72. package/dist/table.cjs.map +0 -1
  73. package/dist/table.d.cts +0 -13
  74. package/dist/tailwind-preset.d.cts +0 -475
  75. package/dist/tailwind-preset.d.ts +0 -475
  76. package/dist/text-area.cjs +0 -2
  77. package/dist/text-area.cjs.map +0 -1
  78. package/dist/text-area.d.cts +0 -19
  79. package/dist/theme-provider.cjs +0 -29
  80. package/dist/theme-provider.cjs.map +0 -1
  81. package/dist/theme-provider.d.cts +0 -75
  82. package/dist/tooltip.cjs +0 -2
  83. package/dist/tooltip.cjs.map +0 -1
  84. package/dist/tooltip.d.cts +0 -15
  85. package/dist/types.cjs +0 -1
  86. package/dist/types.cjs.map +0 -1
  87. package/dist/types.d.cts +0 -6
  88. package/dist/variant-props-DnYnbC7s.d.cts +0 -11
  89. package/dist/with-style-props-VnLWm0Yd.d.cts +0 -27
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../packages/code-block/src/code-block.tsx","../packages/code-block/src/supported-languages.ts","../packages/code-block/src/fmt-code.ts","../packages/code-block/src/parse-metastring.ts"],"names":["Slot","Prism","createContext","forwardRef","useContext","useEffect","useId","useMemo","useState","CaretDown","Check","Copy","useCopyToClipboard","assert","supportedLanguages","parseLanguage","value","maybeLanguage","isSupportedLanguage","formatLanguageClassName","language","Fragment","jsx","jsxs","CodeBlockContext","CodeBlock","className","props","ref","copyText","setCopyText","hasCodeExpander","setHasCodeExpander","isCodeExpanded","setIsCodeExpanded","codeId","setCodeId","context","id","old","cx","CodeBlockBody","CodeBlockCode","style","registerCodeId","unregisterCodeId","trimmedCode","highlightedCodeInnerHtml","setHighlightedCodeInnerHtml","grammar","newHighlightedCodeInnerHtml","CodeBlockHeader","CodeBlockTitle","asChild","CodeBlockCopyButton","onCopy","onCopyError","copyToClipboard","copied","setCopied","timeoutId","error","CodeBlockExpanderButton","onClick","event","prev","fmtCode","strings","values","isTemplateStringsArray","text","minIndent","findMinIndent","line","match","acc","curr","z","modes","metaSchema","defaultMeta","parseMetastring","metastring","metaJson","tokenizeMetastring","token","key","_value","normalizeValue","parsed","input","result","currentString","inQuotes","char"],"mappings":"yCAAA,OAAS,QAAAA,MAAY,uBACrB,OAAOC,MAAW,UAClB,OACC,iBAAAC,EAEA,cAAAC,EAGA,cAAAC,EACA,aAAAC,EACA,SAAAC,EACA,WAAAC,EACA,YAAAC,MACM,QACP,MAAO,mCACP,MAAO,mCACP,MAAO,qCACP,MAAO,kCACP,MAAO,iCACP,MAAO,mCACP,MAAO,yCACP,MAAO,mCACP,MAAO,kCACP,MAAO,qCACP,MAAO,qCACP,MAAO,mCACP,MAAO,m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AAI,CAACkE,EACJ,OAAOF,EAGR,IAAMG,EAAWC,GAAmBF,CAAU,EAAE,OAAgC,CAACP,EAAKU,IAAU,CAC/F,GAAM,CAACC,EAAKC,CAAM,EAAIF,EAAM,MAAM,GAAG,EACrC,GAAI,CAACC,EACJ,OAAOX,EAER,IAAM3D,EAAQwE,GAAeD,CAAM,EACnC,OAAAZ,EAAIW,CAAG,EAAItE,GAAS,GACb2D,CACR,EAAG,CAAC,CAAC,EAEL,GAAI,CACH,IAAMc,EAASV,EAAW,MAAMI,CAAQ,EAGxC,MAAO,CACN,GAAGH,EACH,GAAGS,CACJ,CACD,MAAY,CACX,OAAOT,CACR,CACD,CASO,SAASQ,GAAexE,EAA2B,CACzD,OAAOA,GAAO,KAAK,EAAE,QAAQ,WAAY,IAAI,CAC9C,CAOO,SAASoE,GAAmBpE,EAAqC,CACvE,IAAM0E,EAAQ1E,GAAO,KAAK,GAAK,GACzB2E,EAAmB,CAAC,EAEtBC,EAAgB,GAChBC,EAAW,GAEf,QAAWC,KAAQJ,EACdI,IAAS,KAAO,CAACD,EAChBD,IACHD,EAAO,KAAKC,CAAa,EACzBA,EAAgB,KAEPE,IAAS,MACnBD,EAAW,CAACA,GACZD,GAAiBE,GAMnB,OAAIF,GACHD,EAAO,KAAKC,CAAa,EAGnBD,CACR","sourcesContent":["import { Slot } from \"@radix-ui/react-slot\";\nimport Prism from \"prismjs\";\nimport {\n\tcreateContext,\n\tDispatch,\n\tforwardRef,\n\tHTMLAttributes,\n\tSetStateAction,\n\tuseContext,\n\tuseEffect,\n\tuseId,\n\tuseMemo,\n\tuseState,\n} from \"react\";\nimport \"prismjs/components/prism-bash.js\";\nimport \"prismjs/components/prism-bash.js\";\nimport \"prismjs/components/prism-csharp.js\";\nimport \"prismjs/components/prism-css.js\";\nimport \"prismjs/components/prism-go.js\";\nimport \"prismjs/components/prism-java.js\";\nimport \"prismjs/components/prism-javascript.js\";\nimport \"prismjs/components/prism-json.js\";\nimport \"prismjs/components/prism-jsx.js\";\nimport \"prismjs/components/prism-markup.js\";\nimport \"prismjs/components/prism-python.js\";\nimport \"prismjs/components/prism-ruby.js\";\nimport \"prismjs/components/prism-rust.js\";\nimport \"prismjs/components/prism-tsx.js\";\nimport \"prismjs/components/prism-typescript.js\";\nimport \"prismjs/components/prism-yaml.js\";\nimport { CaretDown } from \"@phosphor-icons/react/CaretDown\";\nimport { Check } from \"@phosphor-icons/react/Check\";\nimport { Copy } from \"@phosphor-icons/react/Copy\";\nimport { useCopyToClipboard } from \"@uidotdev/usehooks\";\nimport assert from \"tiny-invariant\";\nimport { cx } from \"../../cx\";\nimport type { WithStyleProps } from \"../../types/src/with-style-props\";\nimport { LineRange } from \"./line-numbers\";\nimport { formatLanguageClassName, supportedLanguages } from \"./supported-languages\";\nimport type { SupportedLanguage } from \"./supported-languages\";\n\n/**\n * TODO(cody):\n * - fix line numbers, maybe try grid instead of :before and flex?\n * - fix line hightlighting\n * - fix line wrapping? horizontal scrolling has problems w/ line highlighting :(\n */\n\ntype CodeBlockContextType = {\n\tcodeId: string | undefined;\n\tcopyText: string;\n\thasCodeExpander: boolean;\n\tisCodeExpanded: boolean;\n\tregisterCodeId: (id: string) => void;\n\tsetCopyText: (newCopyText: string) => void;\n\tsetHasCodeExpander: (value: boolean) => void;\n\tsetIsCodeExpanded: Dispatch<SetStateAction<boolean>>;\n\tunregisterCodeId: (id: string) => void;\n};\n\nconst CodeBlockContext = createContext<CodeBlockContextType>({\n\tcodeId: undefined,\n\tcopyText: \"\",\n\thasCodeExpander: false,\n\tisCodeExpanded: false,\n\tregisterCodeId: () => {},\n\tsetCopyText: () => {},\n\tsetHasCodeExpander: () => {},\n\tsetIsCodeExpanded: () => {},\n\tunregisterCodeId: () => {},\n});\n\nconst CodeBlock = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(({ className, ...props }, ref) => {\n\tconst [copyText, setCopyText] = useState(\"\");\n\tconst [hasCodeExpander, setHasCodeExpander] = useState(false);\n\tconst [isCodeExpanded, setIsCodeExpanded] = useState(false);\n\tconst [codeId, setCodeId] = useState<string | undefined>(undefined);\n\n\tconst context: CodeBlockContextType = useMemo(\n\t\t() =>\n\t\t\t({\n\t\t\t\tcodeId,\n\t\t\t\tcopyText,\n\t\t\t\thasCodeExpander,\n\t\t\t\tisCodeExpanded,\n\t\t\t\tregisterCodeId: (id) => {\n\t\t\t\t\tsetCodeId((old) => {\n\t\t\t\t\t\tassert(old == null, \"You can only render a single CodeBlockCode within a CodeBlock.\");\n\t\t\t\t\t\treturn id;\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tsetCopyText,\n\t\t\t\tsetHasCodeExpander,\n\t\t\t\tsetIsCodeExpanded,\n\t\t\t\tunregisterCodeId: (id) => {\n\t\t\t\t\tsetCodeId((old) => {\n\t\t\t\t\t\tassert(old === id, \"You can only render a single CodeBlockCode within a CodeBlock.\");\n\t\t\t\t\t\treturn undefined;\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t}) as const,\n\t\t[codeId, copyText, hasCodeExpander, isCodeExpanded],\n\t);\n\n\treturn (\n\t\t<CodeBlockContext.Provider value={context}>\n\t\t\t<div\n\t\t\t\tclassName={cx(\n\t\t\t\t\t\"overflow-hidden rounded-md border border-gray-300 bg-gray-50 font-mono text-[0.8125rem]\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\tref={ref}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t</CodeBlockContext.Provider>\n\t);\n});\nCodeBlock.displayName = \"CodeBlock\";\n\nconst CodeBlockBody = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(({ className, ...props }, ref) => (\n\t<div className={cx(\"relative\", className)} ref={ref} {...props} />\n));\nCodeBlockBody.displayName = \"CodeBlockBody\";\n\ntype CodeBlockCodeProps = WithStyleProps & {\n\t/**\n\t * The code to display in the code block. Should be code formatted as a string. This code will be passed to our syntax highlighter.\n\t */\n\tvalue: string;\n\t/**\n\t * @todo not implemented yet\n\t */\n\thighlightLines?: (LineRange | number)[];\n\t/**\n\t * The language of the code block. This will be used to determine how to syntax highlight the code. @default `\"text\"`.\n\t */\n\tlanguage?: SupportedLanguage;\n\t/**\n\t * @todo not implemented yet\n\t */\n\tshowLineNumbers?: boolean;\n};\n\nconst CodeBlockCode = forwardRef<HTMLPreElement, CodeBlockCodeProps>((props, ref) => {\n\tconst { className, language = \"text\", style, value } = props;\n\tconst id = useId();\n\tconst { hasCodeExpander, isCodeExpanded, registerCodeId, setCopyText, unregisterCodeId } =\n\t\tuseContext(CodeBlockContext);\n\n\t// trim any leading and trailing whitespace/empty lines\n\tconst trimmedCode = value?.trim() ?? \"\";\n\tconst [highlightedCodeInnerHtml, setHighlightedCodeInnerHtml] = useState(trimmedCode);\n\n\tuseEffect(() => {\n\t\tconst grammar = Prism.languages[language];\n\t\tassert(\n\t\t\tgrammar,\n\t\t\t`CodeBlock does not support the language \"${language}\". The syntax highlighter does not have a grammar for this language. The supported languages are: ${supportedLanguages.join(\", \")}.`,\n\t\t);\n\t\tconst newHighlightedCodeInnerHtml = Prism.highlight(trimmedCode, grammar, language);\n\t\tsetHighlightedCodeInnerHtml(newHighlightedCodeInnerHtml);\n\t}, [trimmedCode, language]);\n\n\tuseEffect(() => {\n\t\tsetCopyText(trimmedCode);\n\t}, [trimmedCode, setCopyText]);\n\n\tuseEffect(() => {\n\t\tregisterCodeId(id);\n\n\t\treturn () => {\n\t\t\tunregisterCodeId(id);\n\t\t};\n\t}, [id, registerCodeId, unregisterCodeId]);\n\n\treturn (\n\t\t<pre\n\t\t\taria-expanded={hasCodeExpander ? isCodeExpanded : undefined}\n\t\t\tclassName={cx(\n\t\t\t\tformatLanguageClassName(language),\n\t\t\t\t\"scrollbar overflow-x-auto overflow-y-hidden p-4 pr-[3.375rem] firefox:after:mr-[3.375rem] firefox:after:inline-block firefox:after:content-['']\",\n\t\t\t\t\"aria-collapsed:max-h-[13.6rem]\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\tdata-lang={language}\n\t\t\tid={id}\n\t\t\tref={ref}\n\t\t\tstyle={{\n\t\t\t\t...style,\n\t\t\t\ttabSize: 2,\n\t\t\t\tMozTabSize: 2,\n\t\t\t}}\n\t\t>\n\t\t\t<code dangerouslySetInnerHTML={{ __html: highlightedCodeInnerHtml }} />\n\t\t</pre>\n\t);\n});\nCodeBlockCode.displayName = \"CodeBlockCode\";\n\nconst CodeBlockHeader = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(({ className, ...props }, ref) => (\n\t<div\n\t\tclassName={cx(\"flex items-center gap-1 border-b border-gray-300 bg-gray-100 px-4 py-2 text-gray-700\", className)}\n\t\tref={ref}\n\t\t{...props}\n\t/>\n));\nCodeBlockHeader.displayName = \"CodeBlockHeader\";\n\nconst CodeBlockTitle = forwardRef<HTMLHeadingElement, HTMLAttributes<HTMLHeadingElement> & { asChild?: boolean }>(\n\t({ asChild = false, className, ...props }, ref) => {\n\t\tconst Comp = asChild ? Slot : \"h3\";\n\t\treturn <Comp ref={ref} className={cx(\"font-mono text-[0.8125rem] font-normal\", className)} {...props} />;\n\t},\n);\nCodeBlockTitle.displayName = \"CodeBlockTitle\";\n\ntype CodeBlockCopyButtonProps = WithStyleProps & {\n\t/**\n\t * Callback fired when the copy button is clicked, passes the copied text as an argument.\n\t */\n\tonCopy?: (value: string) => void;\n\t/**\n\t * Callback fired when an error occurs during copying.\n\t */\n\tonCopyError?: (error: unknown) => void;\n};\n\nconst CodeBlockCopyButton = forwardRef<HTMLButtonElement, CodeBlockCopyButtonProps>(\n\t({ className, onCopy, onCopyError, style }, ref) => {\n\t\tconst { copyText } = useContext(CodeBlockContext);\n\t\tconst [, copyToClipboard] = useCopyToClipboard();\n\t\tconst [copied, setCopied] = useState(false);\n\n\t\tuseEffect(() => {\n\t\t\tif (copied) {\n\t\t\t\tconst timeoutId = window.setTimeout(() => {\n\t\t\t\t\tsetCopied(false);\n\t\t\t\t}, 2000);\n\n\t\t\t\treturn () => {\n\t\t\t\t\tclearTimeout(timeoutId);\n\t\t\t\t};\n\t\t\t}\n\t\t}, [copied]);\n\n\t\treturn (\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tclassName={cx(\n\t\t\t\t\t\"absolute right-3 top-3 z-10 flex h-7 w-7 items-center justify-center rounded border border-gray-300 bg-gray-50 shadow-[-1rem_0_0.75rem_-0.375rem_hsl(var(--gray-50)),1rem_0_0_-0.25rem_hsl(var(--gray-50))] hover:border-gray-400 hover:bg-gray-200 focus-visible:border-accent-600 focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-focus-accent\",\n\t\t\t\t\tcopied &&\n\t\t\t\t\t\t\"w-auto gap-1 border-transparent bg-filled-success pl-2 pr-1.5 text-on-filled hover:border-transparent hover:bg-filled-success focus:bg-filled-success focus-visible:border-success-600 focus-visible:ring-focus-success\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\tref={ref}\n\t\t\t\tstyle={style}\n\t\t\t\tonClick={async () => {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tawait copyToClipboard(copyText);\n\t\t\t\t\t\tonCopy?.(copyText);\n\t\t\t\t\t\tsetCopied(true);\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\tonCopyError?.(error);\n\t\t\t\t\t}\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t<span className=\"sr-only\">Copy code</span>\n\t\t\t\t{copied ? (\n\t\t\t\t\t<>\n\t\t\t\t\t\tCopied\n\t\t\t\t\t\t<Check className=\"h-4 w-4\" weight=\"bold\" />\n\t\t\t\t\t</>\n\t\t\t\t) : (\n\t\t\t\t\t<Copy className=\"-ml-px h-5 w-5\" />\n\t\t\t\t)}\n\t\t\t</button>\n\t\t);\n\t},\n);\nCodeBlockCopyButton.displayName = \"CodeBlockCopyButton\";\n\ntype CodeBlockExpanderButtonProps = Omit<\n\tHTMLAttributes<HTMLButtonElement>,\n\t\"children\" | \"aria-controls\" | \"aria-expanded\"\n>;\n\nconst CodeBlockExpanderButton = forwardRef<HTMLButtonElement, CodeBlockExpanderButtonProps>(\n\t({ className, onClick, ...props }, ref) => {\n\t\tconst { codeId, isCodeExpanded, setIsCodeExpanded, setHasCodeExpander } = useContext(CodeBlockContext);\n\n\t\tuseEffect(() => {\n\t\t\tsetHasCodeExpander(true);\n\n\t\t\treturn () => {\n\t\t\t\tsetHasCodeExpander(false);\n\t\t\t};\n\t\t}, [setHasCodeExpander]);\n\n\t\treturn (\n\t\t\t<button\n\t\t\t\t{...props}\n\t\t\t\taria-controls={codeId}\n\t\t\t\taria-expanded={isCodeExpanded}\n\t\t\t\tclassName={cx(\n\t\t\t\t\t\"flex w-full items-center justify-center gap-0.5 border-t border-gray-300 bg-gray-50 px-4 py-2 font-sans text-gray-700 hover:bg-gray-100\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\tref={ref}\n\t\t\t\ttype=\"button\"\n\t\t\t\tonClick={(event) => {\n\t\t\t\t\tsetIsCodeExpanded((prev) => !prev);\n\t\t\t\t\tonClick?.(event);\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t{isCodeExpanded ? \"Show less\" : \"Show more\"}{\" \"}\n\t\t\t\t<CaretDown\n\t\t\t\t\tclassName={cx(\"h-4 w-4\", isCodeExpanded && \"rotate-180\", \"transition-all duration-150\")}\n\t\t\t\t\tweight=\"bold\"\n\t\t\t\t/>\n\t\t\t</button>\n\t\t);\n\t},\n);\nCodeBlockExpanderButton.displayName = \"CodeBlockExpanderButton\";\n\nexport {\n\tCodeBlock,\n\tCodeBlockBody,\n\tCodeBlockCode,\n\tCodeBlockCopyButton,\n\tCodeBlockExpanderButton,\n\tCodeBlockHeader,\n\tCodeBlockTitle,\n};\n","/**\n * List of supported languages for syntax highlighting.\n * @private\n */\nexport const supportedLanguages = [\n\t\"bash\",\n\t\"cs\",\n\t\"csharp\",\n\t\"css\",\n\t\"dotnet\",\n\t\"go\",\n\t\"html\",\n\t\"java\",\n\t\"javascript\",\n\t\"js\",\n\t\"json\",\n\t\"jsx\",\n\t\"markup\",\n\t\"plain\",\n\t\"plaintext\",\n\t\"py\",\n\t\"python\",\n\t\"rb\",\n\t\"ruby\",\n\t\"rust\",\n\t\"sh\",\n\t\"shell\",\n\t\"text\",\n\t\"ts\",\n\t\"tsx\",\n\t\"txt\",\n\t\"typescript\",\n\t\"xml\",\n\t\"yaml\",\n\t\"yml\",\n] as const;\n\n/**\n * Supported languages for syntax highlighting.\n */\ntype SupportedLanguage = (typeof supportedLanguages)[number];\n\n/**\n * Parses a markdown code block (```) language class into a SupportedLanguage.\n * Defaults to \"sh\" if no supported language is found.\n */\nfunction parseLanguage(value: `language-${string}` | `lang-${string}` | (string & {}) | undefined): SupportedLanguage {\n\tif (!value) {\n\t\treturn \"sh\";\n\t}\n\n\t// remove leading \"language-\" and \"lang-\" prefixes\n\t// find first '-' and slice from there\n\tconst maybeLanguage = value.trim().slice(value.indexOf(\"-\") + 1);\n\n\treturn isSupportedLanguage(maybeLanguage) ? maybeLanguage : \"sh\";\n}\n\n/**\n * Type Predicate: checks if an arbitrary value is a supported syntax highlighting language.\n */\nconst isSupportedLanguage = (value: unknown): value is SupportedLanguage => {\n\treturn typeof value === \"string\" && supportedLanguages.includes(value as SupportedLanguage);\n};\n\n/**\n * A class name for a language that Prism.js can understand.\n */\ntype LanguageClass = `language-${SupportedLanguage}`;\n\n/**\n * Formats a language name into a class name that Prism.js can understand.\n * @default \"language-sh\"\n */\nfunction formatLanguageClassName(language: SupportedLanguage | undefined = \"sh\") {\n\tconst lang = language ?? \"sh\";\n\tconst className: LanguageClass = `language-${lang}`;\n\treturn className;\n}\n\nexport { isSupportedLanguage, parseLanguage, formatLanguageClassName };\nexport type { SupportedLanguage };\n","type Primitive = string | number | boolean | undefined | null;\n\n/**\n * Tagged template literal to format code blocks and normalize leading indentation\n */\nexport function fmtCode(strings: TemplateStringsArray, ...values: Primitive[]): string {\n\tif (!isTemplateStringsArray(strings) || !Array.isArray(values)) {\n\t\tthrow new Error(\n\t\t\t\"It looks like you tried to call `fmtCode` as a function. Make sure to use it as a tagged template.\\n\\tExample: fmtCode`SELECT * FROM users`, not fmtCode('SELECT * FROM users')\",\n\t\t);\n\t}\n\n\tconst text = String.raw({ raw: strings }, ...values);\n\n\t// fine the minimum indentation of the code block\n\tconst minIndent = findMinIndent(text);\n\tconst lines = text.trim().split(\"\\n\");\n\n\treturn lines\n\t\t.map((line) => {\n\t\t\t// remove nothing if the line doesn't start with indentation\n\t\t\tif (/^\\S+/.test(line)) {\n\t\t\t\treturn line;\n\t\t\t}\n\t\t\treturn line.slice(minIndent);\n\t\t})\n\t\t.join(\"\\n\");\n\t// replace all tabs with 2 spaces\n\t// .replace(/\\t/g, \" \")\n}\n\n/**\n * Find the shortest indentation of a multiline string\n */\nfunction findMinIndent(value: string): number {\n\tconst match = value.match(/^[ \\t]*(?=\\S)/gm);\n\n\tif (!match) {\n\t\treturn 0;\n\t}\n\n\treturn match.reduce((acc, curr) => Math.min(acc, curr.length), Infinity);\n}\n\n/**\n * Type guard to check if a value is a `TemplateStringsArray`\n */\nfunction isTemplateStringsArray(strings: unknown): strings is TemplateStringsArray {\n\treturn Array.isArray(strings) && \"raw\" in strings && Array.isArray(strings.raw);\n}\n","import { z } from \"zod\";\n\nconst modes = [\"file\", \"cli\"] as const;\ntype Mode = (typeof modes)[number];\n\nconst metaSchema = z.object({\n\tcollapsible: z.boolean().default(false),\n\tdisableCopy: z.boolean().default(false),\n\tmode: z.enum(modes).optional(),\n\ttitle: z.string().trim().optional(),\n});\n\ntype MetaInput = z.input<typeof metaSchema>;\n\ntype Meta = z.infer<typeof metaSchema>;\n\nconst defaultMeta = {\n\tcollapsible: false,\n\tdisableCopy: false,\n\tmode: undefined,\n\ttitle: undefined,\n} as const satisfies Meta;\n\ntype DefaultMeta = typeof defaultMeta;\n\n/**\n * Parses a markdown code block (```) metastring into a meta object.\n * Defaults to DefaultMeta if no metastring given or if metastring is invalid.\n * Useful for parsing the metastring from a markdown code block to pass into the\n * CodeBlock components as props.\n */\nfunction parseMetastring(value: string | undefined): Meta {\n\tconst metastring = value?.trim() ?? \"\";\n\tif (!metastring) {\n\t\treturn defaultMeta;\n\t}\n\n\tconst metaJson = tokenizeMetastring(metastring).reduce<Record<string, unknown>>((acc, token) => {\n\t\tconst [key, _value] = token.split(\"=\");\n\t\tif (!key) {\n\t\t\treturn acc;\n\t\t}\n\t\tconst value = normalizeValue(_value);\n\t\tacc[key] = value ?? true;\n\t\treturn acc;\n\t}, {});\n\n\ttry {\n\t\tconst parsed = metaSchema.parse(metaJson);\n\n\t\t// return the parsed meta object, with default values filled in\n\t\treturn {\n\t\t\t...defaultMeta,\n\t\t\t...parsed,\n\t\t};\n\t} catch (_) {\n\t\treturn defaultMeta;\n\t}\n}\n\nexport { defaultMeta, parseMetastring };\nexport type { Meta, MetaInput, Mode, DefaultMeta };\n\n/**\n * Remove leading and trailing `\"` quotes around value\n * @private\n */\nexport function normalizeValue(value: string | undefined) {\n\treturn value?.trim().replace(/^\"(.*)\"$/, \"$1\");\n}\n\n/**\n * Splits a metastring into an array of tokens that can be parsed into a meta object.\n * Should allow for quotes and spaces in tokens\n * @private\n */\nexport function tokenizeMetastring(value: string | undefined): string[] {\n\tconst input = value?.trim() ?? \"\";\n\tconst result: string[] = [];\n\n\tlet currentString = \"\";\n\tlet inQuotes = false;\n\n\tfor (const char of input) {\n\t\tif (char === \" \" && !inQuotes) {\n\t\t\tif (currentString) {\n\t\t\t\tresult.push(currentString);\n\t\t\t\tcurrentString = \"\";\n\t\t\t}\n\t\t} else if (char === '\"') {\n\t\t\tinQuotes = !inQuotes;\n\t\t\tcurrentString += char;\n\t\t} else {\n\t\t\tcurrentString += char;\n\t\t}\n\t}\n\n\tif (currentString) {\n\t\tresult.push(currentString);\n\t}\n\n\treturn result;\n}\n"]}
@@ -1,108 +0,0 @@
1
- import * as react from 'react';
2
- import { HTMLAttributes } from 'react';
3
- import { W as WithStyleProps } from './with-style-props-VnLWm0Yd.cjs';
4
- import { z } from 'zod';
5
-
6
- declare const CodeBlock: react.ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & react.RefAttributes<HTMLDivElement>>;
7
- declare const CodeBlockBody: react.ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & react.RefAttributes<HTMLDivElement>>;
8
- declare const CodeBlockCode: react.ForwardRefExoticComponent<WithStyleProps & {
9
- /**
10
- * The code to display in the code block. Should be code formatted as a string. This code will be passed to our syntax highlighter.
11
- */
12
- value: string;
13
- /**
14
- * @todo not implemented yet
15
- */
16
- highlightLines?: (number | `${number}-${number}`)[] | undefined;
17
- /**
18
- * The language of the code block. This will be used to determine how to syntax highlight the code. @default `"text"`.
19
- */
20
- language?: "bash" | "cs" | "csharp" | "css" | "dotnet" | "go" | "html" | "java" | "javascript" | "js" | "json" | "jsx" | "markup" | "plain" | "plaintext" | "py" | "python" | "rb" | "ruby" | "rust" | "sh" | "shell" | "text" | "ts" | "tsx" | "txt" | "typescript" | "xml" | "yaml" | "yml" | undefined;
21
- /**
22
- * @todo not implemented yet
23
- */
24
- showLineNumbers?: boolean | undefined;
25
- } & react.RefAttributes<HTMLPreElement>>;
26
- declare const CodeBlockHeader: react.ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & react.RefAttributes<HTMLDivElement>>;
27
- declare const CodeBlockTitle: react.ForwardRefExoticComponent<HTMLAttributes<HTMLHeadingElement> & {
28
- asChild?: boolean | undefined;
29
- } & react.RefAttributes<HTMLHeadingElement>>;
30
- declare const CodeBlockCopyButton: react.ForwardRefExoticComponent<WithStyleProps & {
31
- /**
32
- * Callback fired when the copy button is clicked, passes the copied text as an argument.
33
- */
34
- onCopy?: ((value: string) => void) | undefined;
35
- /**
36
- * Callback fired when an error occurs during copying.
37
- */
38
- onCopyError?: ((error: unknown) => void) | undefined;
39
- } & react.RefAttributes<HTMLButtonElement>>;
40
- type CodeBlockExpanderButtonProps = Omit<HTMLAttributes<HTMLButtonElement>, "children" | "aria-controls" | "aria-expanded">;
41
- declare const CodeBlockExpanderButton: react.ForwardRefExoticComponent<CodeBlockExpanderButtonProps & react.RefAttributes<HTMLButtonElement>>;
42
-
43
- type Primitive = string | number | boolean | undefined | null;
44
- /**
45
- * Tagged template literal to format code blocks and normalize leading indentation
46
- */
47
- declare function fmtCode(strings: TemplateStringsArray, ...values: Primitive[]): string;
48
-
49
- declare const modes: readonly ["file", "cli"];
50
- type Mode = (typeof modes)[number];
51
- declare const metaSchema: z.ZodObject<{
52
- collapsible: z.ZodDefault<z.ZodBoolean>;
53
- disableCopy: z.ZodDefault<z.ZodBoolean>;
54
- mode: z.ZodOptional<z.ZodEnum<["file", "cli"]>>;
55
- title: z.ZodOptional<z.ZodString>;
56
- }, "strip", z.ZodTypeAny, {
57
- collapsible: boolean;
58
- disableCopy: boolean;
59
- mode?: "file" | "cli" | undefined;
60
- title?: string | undefined;
61
- }, {
62
- collapsible?: boolean | undefined;
63
- disableCopy?: boolean | undefined;
64
- mode?: "file" | "cli" | undefined;
65
- title?: string | undefined;
66
- }>;
67
- type MetaInput = z.input<typeof metaSchema>;
68
- type Meta = z.infer<typeof metaSchema>;
69
- declare const defaultMeta: {
70
- readonly collapsible: false;
71
- readonly disableCopy: false;
72
- readonly mode: undefined;
73
- readonly title: undefined;
74
- };
75
- type DefaultMeta = typeof defaultMeta;
76
- /**
77
- * Parses a markdown code block (```) metastring into a meta object.
78
- * Defaults to DefaultMeta if no metastring given or if metastring is invalid.
79
- * Useful for parsing the metastring from a markdown code block to pass into the
80
- * CodeBlock components as props.
81
- */
82
- declare function parseMetastring(value: string | undefined): Meta;
83
-
84
- /**
85
- * List of supported languages for syntax highlighting.
86
- * @private
87
- */
88
- declare const supportedLanguages: readonly ["bash", "cs", "csharp", "css", "dotnet", "go", "html", "java", "javascript", "js", "json", "jsx", "markup", "plain", "plaintext", "py", "python", "rb", "ruby", "rust", "sh", "shell", "text", "ts", "tsx", "txt", "typescript", "xml", "yaml", "yml"];
89
- /**
90
- * Supported languages for syntax highlighting.
91
- */
92
- type SupportedLanguage = (typeof supportedLanguages)[number];
93
- /**
94
- * Parses a markdown code block (```) language class into a SupportedLanguage.
95
- * Defaults to "sh" if no supported language is found.
96
- */
97
- declare function parseLanguage(value: `language-${string}` | `lang-${string}` | (string & {}) | undefined): SupportedLanguage;
98
- /**
99
- * Type Predicate: checks if an arbitrary value is a supported syntax highlighting language.
100
- */
101
- declare const isSupportedLanguage: (value: unknown) => value is "bash" | "cs" | "csharp" | "css" | "dotnet" | "go" | "html" | "java" | "javascript" | "js" | "json" | "jsx" | "markup" | "plain" | "plaintext" | "py" | "python" | "rb" | "ruby" | "rust" | "sh" | "shell" | "text" | "ts" | "tsx" | "txt" | "typescript" | "xml" | "yaml" | "yml";
102
- /**
103
- * Formats a language name into a class name that Prism.js can understand.
104
- * @default "language-sh"
105
- */
106
- declare function formatLanguageClassName(language?: SupportedLanguage | undefined): "language-bash" | "language-cs" | "language-csharp" | "language-css" | "language-dotnet" | "language-go" | "language-html" | "language-java" | "language-javascript" | "language-js" | "language-json" | "language-jsx" | "language-markup" | "language-plain" | "language-plaintext" | "language-py" | "language-python" | "language-rb" | "language-ruby" | "language-rust" | "language-sh" | "language-shell" | "language-text" | "language-ts" | "language-tsx" | "language-txt" | "language-typescript" | "language-xml" | "language-yaml" | "language-yml";
107
-
108
- export { CodeBlock, CodeBlockBody, CodeBlockCode, CodeBlockCopyButton, CodeBlockExpanderButton, CodeBlockHeader, CodeBlockTitle, type DefaultMeta, type Meta, type MetaInput, type Mode, type SupportedLanguage, defaultMeta, fmtCode, formatLanguageClassName, isSupportedLanguage, parseLanguage, parseMetastring, supportedLanguages };
package/dist/cx.cjs DELETED
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkD3F6KEREcjs = require('./chunk-D3F6KERE.cjs');exports.cx = _chunkD3F6KEREcjs.a;
2
- //# sourceMappingURL=cx.cjs.map
package/dist/cx.cjs.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":""}
package/dist/cx.d.cts DELETED
@@ -1,10 +0,0 @@
1
- import { ClassValue } from 'clsx';
2
-
3
- /**
4
- * Conditionally add Tailwind (and other) CSS classes.
5
- *
6
- * Allows for tailwind overrides in LTR-specificity-like order of applied classes.
7
- */
8
- declare function cx(...inputs: ClassValue[]): string;
9
-
10
- export { cx };
@@ -1,8 +0,0 @@
1
- /**
2
- * Makes all properties in an object non-nullable, recursively.
3
- */
4
- type DeepNonNullable<Type> = {
5
- [Property in keyof Type]-?: Type[Property] & {};
6
- };
7
-
8
- export type { DeepNonNullable as D };
package/dist/dialog.cjs DELETED
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }var _chunkK4UKFOMIcjs = require('./chunk-K4UKFOMI.cjs');require('./chunk-JGNAMNKZ.cjs');var _chunkD3F6KEREcjs = require('./chunk-D3F6KERE.cjs');var _X = require('@phosphor-icons/react/X');var _reactdialog = require('@radix-ui/react-dialog'); var e = _interopRequireWildcard(_reactdialog);var _react = require('react');var _jsxruntime = require('react/jsx-runtime');var u=e.Root,N= exports.DialogTrigger =e.Trigger,d= exports.DialogPortal =e.Portal,C= exports.DialogClose =e.Close,n= exports.DialogOverlay =_react.forwardRef.call(void 0, ({className:t,...i},l)=>_jsxruntime.jsx.call(void 0, e.Overlay,{ref:l,className:_chunkD3F6KEREcjs.a.call(void 0, "fixed inset-0 z-50 bg-overlay backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...i}));n.displayName=e.Overlay.displayName;var g=_react.forwardRef.call(void 0, ({className:t,children:i,...l},y)=>_jsxruntime.jsxs.call(void 0, d,{children:[_jsxruntime.jsx.call(void 0, n,{}),_jsxruntime.jsxs.call(void 0, e.Content,{ref:y,className:_chunkD3F6KEREcjs.a.call(void 0, "scrollbar fixed left-[50%] top-[50%] z-50 max-h-dvh w-full max-w-lg translate-x-[-50%] translate-y-[-50%] overflow-y-auto rounded-xl border border-dialog bg-dialog p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]",t),...l,children:[_jsxruntime.jsx.call(void 0, e.Close,{asChild:!0,children:_jsxruntime.jsxs.call(void 0, _chunkK4UKFOMIcjs.a,{appearance:"outlined",priority:"neutral",className:"absolute right-3.5 top-3.5 size-11 p-0 sm:size-9",children:[_jsxruntime.jsx.call(void 0, _X.X,{className:"size-5 shrink-0"}),_jsxruntime.jsx.call(void 0, "span",{className:"sr-only",children:"Close"})]})}),i]})]}));g.displayName=e.Content.displayName;var p=({className:t,...i})=>_jsxruntime.jsx.call(void 0, "div",{className:_chunkD3F6KEREcjs.a.call(void 0, "flex shrink-0 flex-col gap-2 text-strong",t),...i});p.displayName="DialogHeader";var D=({className:t,...i})=>_jsxruntime.jsx.call(void 0, "div",{className:_chunkD3F6KEREcjs.a.call(void 0, "my-6 flex-1 text-body",t),...i});D.displayName="DialogBody";var f=({className:t,...i})=>_jsxruntime.jsx.call(void 0, "div",{className:_chunkD3F6KEREcjs.a.call(void 0, "flex shrink-0 flex-row-reverse gap-2",t),...i});f.displayName="DialogFooter";var c=_react.forwardRef.call(void 0, ({className:t,...i},l)=>_jsxruntime.jsx.call(void 0, e.Title,{ref:l,className:_chunkD3F6KEREcjs.a.call(void 0, "text-lg font-medium leading-none text-strong",t),...i}));c.displayName=e.Title.displayName;var v=_react.forwardRef.call(void 0, ({className:t,...i},l)=>_jsxruntime.jsx.call(void 0, e.Description,{ref:l,className:_chunkD3F6KEREcjs.a.call(void 0, "text-muted",t),...i}));v.displayName=e.Description.displayName;exports.Dialog = u; exports.DialogBody = D; exports.DialogClose = C; exports.DialogContent = g; exports.DialogDescription = v; exports.DialogFooter = f; exports.DialogHeader = p; exports.DialogOverlay = n; exports.DialogPortal = d; exports.DialogTitle = c; exports.DialogTrigger = N;
2
- //# sourceMappingURL=dialog.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../packages/dialog/src/dialog.tsx"],"names":["X","DialogPrimitive","forwardRef","jsx","jsxs","Dialog","DialogTrigger","DialogPortal","DialogClose","DialogOverlay","className","props","ref","cx","DialogContent","children","Button","DialogHeader","DialogBody","DialogFooter","DialogTitle","DialogDescription"],"mappings":"0GAAA,OAAS,KAAAA,MAAS,0BAClB,UAAYC,MAAqB,yBACjC,OAA+C,cAAAC,MAAkB,QAgBhE,cAAAC,EA0BG,QAAAC,MA1BH,oBAZD,IAAMC,EAAyB,OAEzBC,EAAgC,UAEhCC,EAA+B,SAE/BC,EAA8B,QAE9BC,EAAgBP,EAGpB,CAAC,CAAE,UAAAQ,EAAW,GAAGC,CAAM,EAAGC,IAC3BT,EAAiB,UAAhB,CACA,IAAKS,EACL,UAAWC,EACV,yKACAH,CACD,EACC,GAAGC,EACL,CACA,EACDF,EAAc,YAA8B,UAAQ,YAEpD,IAAMK,EAAgBZ,EAGpB,CAAC,CAAE,UAAAQ,EAAW,SAAAK,EAAU,GAAGJ,CAAM,EAAGC,IACrCR,EAACG,EAAA,CACA,UAAAJ,EAACM,EAAA,EAAc,EACfL,EAAiB,UAAhB,CACA,IAAKQ,EACL,UAAWC,EACV,8hBACAH,CACD,EACC,GAAGC,EAEJ,UAAAR,EAAiB,QAAhB,CAAsB,QAAO,GAC7B,SAAAC,EAACY,EAAA,CAAO,WAAW,WAAW,SAAS,UAAU,UAAU,mDAC1D,UAAAb,EAACH,EAAA,CAAE,UAAU,kBAAkB,EAC/BG,EAAC,QAAK,UAAU,UAAU,iBAAK,GAChC,EACD,EACCY,GACF,GACD,CACA,EACDD,EAAc,YAA8B,UAAQ,YAEpD,IAAMG,EAAe,CAAC,CAAE,UAAAP,EAAW,GAAGC,CAAM,IAC3CR,EAAC,OAAI,UAAWU,EAAG,2CAA4CH,CAAS,EAAI,GAAGC,EAAO,EAEvFM,EAAa,YAAc,eAE3B,IAAMC,EAAa,CAAC,CAAE,UAAAR,EAAW,GAAGC,CAAM,IACzCR,EAAC,OAAI,UAAWU,EAAG,wBAAyBH,CAAS,EAAI,GAAGC,EAAO,EAEpEO,EAAW,YAAc,aAEzB,IAAMC,EAAe,CAAC,CAAE,UAAAT,EAAW,GAAGC,CAAM,IAC3CR,EAAC,OAAI,UAAWU,EAAG,uCAAwCH,CAAS,EAAI,GAAGC,EAAO,EAEnFQ,EAAa,YAAc,eAE3B,IAAMC,EAAclB,EAGlB,CAAC,CAAE,UAAAQ,EAAW,GAAGC,CAAM,EAAGC,IAC3BT,EAAiB,QAAhB,CACA,IAAKS,EACL,UAAWC,EAAG,+CAAgDH,CAAS,EACtE,GAAGC,EACL,CACA,EACDS,EAAY,YAA8B,QAAM,YAEhD,IAAMC,EAAoBnB,EAGxB,CAAC,CAAE,UAAAQ,EAAW,GAAGC,CAAM,EAAGC,IAC3BT,EAAiB,cAAhB,CAA4B,IAAKS,EAAK,UAAWC,EAAG,aAAcH,CAAS,EAAI,GAAGC,EAAO,CAC1F,EACDU,EAAkB,YAA8B,cAAY","sourcesContent":["import { X } from \"@phosphor-icons/react/X\";\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport { ComponentPropsWithoutRef, ElementRef, forwardRef } from \"react\";\nimport { Button } from \"../../button\";\nimport { cx } from \"../../cx\";\n\nconst Dialog = DialogPrimitive.Root;\n\nconst DialogTrigger = DialogPrimitive.Trigger;\n\nconst DialogPortal = DialogPrimitive.Portal;\n\nconst DialogClose = DialogPrimitive.Close;\n\nconst DialogOverlay = forwardRef<\n\tElementRef<typeof DialogPrimitive.Overlay>,\n\tComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n\t<DialogPrimitive.Overlay\n\t\tref={ref}\n\t\tclassName={cx(\n\t\t\t\"fixed inset-0 z-50 bg-overlay backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t/>\n));\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName;\n\nconst DialogContent = forwardRef<\n\tElementRef<typeof DialogPrimitive.Content>,\n\tComponentPropsWithoutRef<typeof DialogPrimitive.Content>\n>(({ className, children, ...props }, ref) => (\n\t<DialogPortal>\n\t\t<DialogOverlay />\n\t\t<DialogPrimitive.Content\n\t\t\tref={ref}\n\t\t\tclassName={cx(\n\t\t\t\t\"scrollbar fixed left-[50%] top-[50%] z-50 max-h-dvh w-full max-w-lg translate-x-[-50%] translate-y-[-50%] overflow-y-auto rounded-xl border border-dialog bg-dialog p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t<DialogPrimitive.Close asChild>\n\t\t\t\t<Button appearance=\"outlined\" priority=\"neutral\" className=\"absolute right-3.5 top-3.5 size-11 p-0 sm:size-9\">\n\t\t\t\t\t<X className=\"size-5 shrink-0\" />\n\t\t\t\t\t<span className=\"sr-only\">Close</span>\n\t\t\t\t</Button>\n\t\t\t</DialogPrimitive.Close>\n\t\t\t{children}\n\t\t</DialogPrimitive.Content>\n\t</DialogPortal>\n));\nDialogContent.displayName = DialogPrimitive.Content.displayName;\n\nconst DialogHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n\t<div className={cx(\"flex shrink-0 flex-col gap-2 text-strong\", className)} {...props}></div>\n);\nDialogHeader.displayName = \"DialogHeader\";\n\nconst DialogBody = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n\t<div className={cx(\"my-6 flex-1 text-body\", className)} {...props} />\n);\nDialogBody.displayName = \"DialogBody\";\n\nconst DialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n\t<div className={cx(\"flex shrink-0 flex-row-reverse gap-2\", className)} {...props} />\n);\nDialogFooter.displayName = \"DialogFooter\";\n\nconst DialogTitle = forwardRef<\n\tElementRef<typeof DialogPrimitive.Title>,\n\tComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n\t<DialogPrimitive.Title\n\t\tref={ref}\n\t\tclassName={cx(\"text-lg font-medium leading-none text-strong\", className)}\n\t\t{...props}\n\t/>\n));\nDialogTitle.displayName = DialogPrimitive.Title.displayName;\n\nconst DialogDescription = forwardRef<\n\tElementRef<typeof DialogPrimitive.Description>,\n\tComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n\t<DialogPrimitive.Description ref={ref} className={cx(\"text-muted\", className)} {...props} />\n));\nDialogDescription.displayName = DialogPrimitive.Description.displayName;\n\nexport {\n\tDialog,\n\tDialogPortal,\n\tDialogOverlay,\n\tDialogTrigger,\n\tDialogClose,\n\tDialogContent,\n\tDialogHeader,\n\tDialogBody,\n\tDialogFooter,\n\tDialogTitle,\n\tDialogDescription,\n};\n"]}
package/dist/dialog.d.cts DELETED
@@ -1,26 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import * as react from 'react';
3
- import * as DialogPrimitive from '@radix-ui/react-dialog';
4
-
5
- declare const Dialog: react.FC<DialogPrimitive.DialogProps>;
6
- declare const DialogTrigger: react.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & react.RefAttributes<HTMLButtonElement>>;
7
- declare const DialogPortal: react.FC<DialogPrimitive.DialogPortalProps>;
8
- declare const DialogClose: react.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & react.RefAttributes<HTMLButtonElement>>;
9
- declare const DialogOverlay: react.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
10
- declare const DialogContent: react.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
11
- declare const DialogHeader: {
12
- ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
13
- displayName: string;
14
- };
15
- declare const DialogBody: {
16
- ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
17
- displayName: string;
18
- };
19
- declare const DialogFooter: {
20
- ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): react_jsx_runtime.JSX.Element;
21
- displayName: string;
22
- };
23
- declare const DialogTitle: react.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & react.RefAttributes<HTMLHeadingElement>, "ref"> & react.RefAttributes<HTMLHeadingElement>>;
24
- declare const DialogDescription: react.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & react.RefAttributes<HTMLParagraphElement>, "ref"> & react.RefAttributes<HTMLParagraphElement>>;
25
-
26
- export { Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger };
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }var _chunkROHPZJ5Ncjs = require('./chunk-ROHPZJ5N.cjs');var _chunkD3F6KEREcjs = require('./chunk-D3F6KERE.cjs');var _react = require('@ariakit/react'); var o = _interopRequireWildcard(_react);var _Check = require('@phosphor-icons/react/Check');var _react2 = require('react');var _jsxruntime = require('react/jsx-runtime');var y=o.MenuProvider,m= exports.DropdownMenuTrigger =_react2.forwardRef.call(void 0, ({asChild:t=!1,children:e,...n},a)=>t?_jsxruntime.jsx.call(void 0, o.MenuButton,{ref:a,render:typeof e=="object"&&e!=null?e:_jsxruntime.jsx.call(void 0, "button",{})}):_jsxruntime.jsx.call(void 0, o.MenuButton,{ref:a,...n,children:e}));m.displayName="DropdownMenuTrigger";var s=_react2.forwardRef.call(void 0, ({className:t,gutter:e=8,...n},a)=>_jsxruntime.jsx.call(void 0, o.Menu,{gutter:e,ref:a,className:_chunkD3F6KEREcjs.a.call(void 0, "z-50 min-w-[8rem] overflow-hidden rounded border border-popover bg-popover p-1.25 shadow-xl outline-none data-side-bottom:slide-in-from-top-2 data-side-left:slide-in-from-right-2 data-side-right:slide-in-from-left-2 data-side-top:slide-in-from-bottom-2 data-state-closed:animate-out data-state-closed:fade-out-0 data-state-closed:zoom-out-95 data-state-open:animate-in data-state-open:fade-in-0 data-state-open:zoom-in-95",t),...n}));s.displayName="DropdownMenuContent";var u=_react2.forwardRef.call(void 0, ({className:t,...e},n)=>_jsxruntime.jsx.call(void 0, o.MenuItem,{ref:n,className:_chunkD3F6KEREcjs.a.call(void 0, "relative flex cursor-pointer select-none items-center rounded px-2 py-1.5 text-sm font-normal text-strong outline-none data-active-item:bg-popover-hover data-disabled:pointer-events-none data-disabled:opacity-50 data-active-item:dark:bg-popover-hover",t),...e}));u.displayName="DropdownMenuItem";var l=_react2.forwardRef.call(void 0, ({className:t,children:e,...n},a)=>_jsxruntime.jsxs.call(void 0, o.MenuItemCheckbox,{ref:a,className:_chunkD3F6KEREcjs.a.call(void 0, "relative flex cursor-pointer select-none items-center gap-2 rounded py-1.5 pl-2 pr-9 text-sm font-normal text-strong outline-none data-disabled:pointer-events-none data-disabled:opacity-50","data-active-item:bg-popover-hover data-active-item:dark:bg-popover-hover","aria-checked:!bg-filled-accent aria-checked:font-medium aria-checked:text-on-filled",t),...n,children:[e,_jsxruntime.jsx.call(void 0, f,{className:"absolute right-2 flex items-center"})]}));l.displayName="DropdownMenuCheckboxItem";var c=_react2.forwardRef.call(void 0, ({className:t,children:e,...n},a)=>_jsxruntime.jsxs.call(void 0, o.MenuItemRadio,{ref:a,className:_chunkD3F6KEREcjs.a.call(void 0, "relative flex cursor-pointer select-none items-center gap-2 rounded py-1.5 pl-2 pr-9 text-sm font-normal text-strong outline-none data-disabled:pointer-events-none data-disabled:opacity-50","data-active-item:bg-popover-hover data-active-item:dark:bg-popover-hover","aria-checked:!bg-filled-accent aria-checked:font-medium aria-checked:text-on-filled",t),...n,children:[e,_jsxruntime.jsx.call(void 0, f,{className:"absolute right-2 flex items-center"})]}));c.displayName="DropdownMenuRadioItem";var f=t=>_jsxruntime.jsx.call(void 0, o.MenuItemCheck,{...t,children:_jsxruntime.jsx.call(void 0, _Check.Check,{className:"size-5",weight:"bold"})}),M= exports.DropdownMenuLabel =_react2.forwardRef.call(void 0, ({className:t,...e},n)=>_jsxruntime.jsx.call(void 0, "div",{ref:n,className:_chunkD3F6KEREcjs.a.call(void 0, "px-2 py-1.5 text-sm font-medium text-strong",t),...e}));M.displayName="DropdownMenuLabel";var h=_react2.forwardRef.call(void 0, ({className:t,...e},n)=>_jsxruntime.jsx.call(void 0, _chunkROHPZJ5Ncjs.a,{ref:n,className:_chunkD3F6KEREcjs.a.call(void 0, "-mx-2 my-1 w-auto",t),...e}));h.displayName="DropdownMenuSeparator";var k=({className:t,...e})=>_jsxruntime.jsx.call(void 0, "span",{className:_chunkD3F6KEREcjs.a.call(void 0, "ml-auto text-xs tracking-widest opacity-60",t),...e});k.displayName="DropdownMenuShortcut";exports.DropdownMenu = y; exports.DropdownMenuCheckboxItem = l; exports.DropdownMenuContent = s; exports.DropdownMenuItem = u; exports.DropdownMenuLabel = M; exports.DropdownMenuRadioItem = c; exports.DropdownMenuSeparator = h; exports.DropdownMenuShortcut = k; exports.DropdownMenuTrigger = m;
2
- //# sourceMappingURL=dropdown-menu.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../packages/dropdown-menu/src/dropdown-menu.tsx"],"names":["Ariakit","Check","forwardRef","jsx","jsxs","DropdownMenu","DropdownMenuTrigger","asChild","children","props","ref","DropdownMenuContent","className","gutter","cx","DropdownMenuItem","DropdownMenuCheckboxItem","DropdownMenuItemCheck","DropdownMenuRadioItem","DropdownMenuLabel","DropdownMenuSeparator","Separator","DropdownMenuShortcut"],"mappings":"kFAAA,UAAYA,MAAa,iBACzB,OAAS,SAAAC,MAAa,8BAEtB,OAAS,cAAAC,MAAkB,QAcuE,cAAAC,EA+ChG,QAAAC,MA/CgG,oBATlG,IAAMC,EAAuB,eAGvBC,EAAsBJ,EAC3B,CAAC,CAAE,QAAAK,EAAU,GAAO,SAAAC,EAAU,GAAGC,CAAM,EAAGC,IACrCH,EAEFJ,EAAS,aAAR,CACA,IAAKO,EACL,OAAQ,OAAOF,GAAa,UAAYA,GAAY,KAAQA,EAAiCL,EAAC,WAAO,EACtG,EAKDA,EAAS,aAAR,CAAmB,IAAKO,EAAM,GAAGD,EAChC,SAAAD,EACF,CAGH,EACAF,EAAoB,YAAc,sBAElC,IAAMK,EAAsBT,EAC3B,CAAC,CAAE,UAAAU,EAAW,OAAAC,EAAS,EAAG,GAAGJ,CAAM,EAAGC,IACrCP,EAAS,OAAR,CACA,OAAQU,EACR,IAAKH,EACL,UAAWI,EACV,waACAF,CACD,EACC,GAAGH,EACL,CAEF,EACAE,EAAoB,YAAc,sBAElC,IAAMI,EAAmBb,EAGvB,CAAC,CAAE,UAAAU,EAAW,GAAGH,CAAM,EAAGC,IAC3BP,EAAS,WAAR,CACA,IAAKO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","sourcesContent":["import * as Ariakit from \"@ariakit/react\";\nimport { Check } from \"@phosphor-icons/react/Check\";\nimport type { ComponentPropsWithoutRef, ElementRef, HTMLAttributes } from \"react\";\nimport { forwardRef } from \"react\";\nimport { cx } from \"../../cx\";\nimport { Separator } from \"../../separator\";\nimport { WithAsChild } from \"../../types\";\n\nconst DropdownMenu = Ariakit.MenuProvider;\n\ntype DropdownMenuTriggerProps = Omit<ComponentPropsWithoutRef<typeof Ariakit.MenuButton>, \"render\"> & WithAsChild;\nconst DropdownMenuTrigger = forwardRef<ElementRef<\"button\">, DropdownMenuTriggerProps>(\n\t({ asChild = false, children, ...props }, ref) => {\n\t\tif (asChild) {\n\t\t\treturn (\n\t\t\t\t<Ariakit.MenuButton\n\t\t\t\t\tref={ref}\n\t\t\t\t\trender={typeof children === \"object\" && children != null ? (children as React.JSX.Element) : <button />}\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<Ariakit.MenuButton ref={ref} {...props}>\n\t\t\t\t{children}\n\t\t\t</Ariakit.MenuButton>\n\t\t);\n\t},\n);\nDropdownMenuTrigger.displayName = \"DropdownMenuTrigger\";\n\nconst DropdownMenuContent = forwardRef<ElementRef<typeof Ariakit.Menu>, ComponentPropsWithoutRef<typeof Ariakit.Menu>>(\n\t({ className, gutter = 8, ...props }, ref) => (\n\t\t<Ariakit.Menu\n\t\t\tgutter={gutter}\n\t\t\tref={ref}\n\t\t\tclassName={cx(\n\t\t\t\t\"z-50 min-w-[8rem] overflow-hidden rounded border border-popover bg-popover p-1.25 shadow-xl outline-none data-side-bottom:slide-in-from-top-2 data-side-left:slide-in-from-right-2 data-side-right:slide-in-from-left-2 data-side-top:slide-in-from-bottom-2 data-state-closed:animate-out data-state-closed:fade-out-0 data-state-closed:zoom-out-95 data-state-open:animate-in data-state-open:fade-in-0 data-state-open:zoom-in-95\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t),\n);\nDropdownMenuContent.displayName = \"DropdownMenuContent\";\n\nconst DropdownMenuItem = forwardRef<\n\tElementRef<typeof Ariakit.MenuItem>,\n\tComponentPropsWithoutRef<typeof Ariakit.MenuItem>\n>(({ className, ...props }, ref) => (\n\t<Ariakit.MenuItem\n\t\tref={ref}\n\t\tclassName={cx(\n\t\t\t\"relative flex cursor-pointer select-none items-center rounded px-2 py-1.5 text-sm font-normal text-strong outline-none data-active-item:bg-popover-hover data-disabled:pointer-events-none data-disabled:opacity-50 data-active-item:dark:bg-popover-hover\",\n\t\t\tclassName,\n\t\t)}\n\t\t{...props}\n\t/>\n));\nDropdownMenuItem.displayName = \"DropdownMenuItem\";\n\ntype DropdownMenuCheckboxItemProps = Omit<ComponentPropsWithoutRef<typeof Ariakit.MenuItemCheckbox>, \"render\">;\nconst DropdownMenuCheckboxItem = forwardRef<ElementRef<typeof Ariakit.MenuItemRadio>, DropdownMenuCheckboxItemProps>(\n\t({ className, children, ...props }, ref) => (\n\t\t<Ariakit.MenuItemCheckbox\n\t\t\tref={ref}\n\t\t\tclassName={cx(\n\t\t\t\t\"relative flex cursor-pointer select-none items-center gap-2 rounded py-1.5 pl-2 pr-9 text-sm font-normal text-strong outline-none data-disabled:pointer-events-none data-disabled:opacity-50\",\n\t\t\t\t\"data-active-item:bg-popover-hover data-active-item:dark:bg-popover-hover\",\n\t\t\t\t\"aria-checked:!bg-filled-accent aria-checked:font-medium aria-checked:text-on-filled\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t\t<DropdownMenuItemCheck className=\"absolute right-2 flex items-center\" />\n\t\t</Ariakit.MenuItemCheckbox>\n\t),\n);\nDropdownMenuCheckboxItem.displayName = \"DropdownMenuCheckboxItem\";\n\ntype DropdownMenuRadioItemProps = Omit<ComponentPropsWithoutRef<typeof Ariakit.MenuItemRadio>, \"render\">;\nconst DropdownMenuRadioItem = forwardRef<ElementRef<typeof Ariakit.MenuItemRadio>, DropdownMenuRadioItemProps>(\n\t({ className, children, ...props }, ref) => (\n\t\t<Ariakit.MenuItemRadio\n\t\t\tref={ref}\n\t\t\tclassName={cx(\n\t\t\t\t\"relative flex cursor-pointer select-none items-center gap-2 rounded py-1.5 pl-2 pr-9 text-sm font-normal text-strong outline-none data-disabled:pointer-events-none data-disabled:opacity-50\",\n\t\t\t\t\"data-active-item:bg-popover-hover data-active-item:dark:bg-popover-hover\",\n\t\t\t\t\"aria-checked:!bg-filled-accent aria-checked:font-medium aria-checked:text-on-filled\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t\t<DropdownMenuItemCheck className=\"absolute right-2 flex items-center\" />\n\t\t</Ariakit.MenuItemRadio>\n\t),\n);\nDropdownMenuRadioItem.displayName = \"DropdownMenuRadioItem\";\n\nconst DropdownMenuItemCheck = (props: Omit<HTMLAttributes<HTMLSpanElement>, \"children\">) => (\n\t<Ariakit.MenuItemCheck {...props}>\n\t\t<Check className=\"size-5\" weight=\"bold\" />\n\t</Ariakit.MenuItemCheck>\n);\n\nconst DropdownMenuLabel = forwardRef<ElementRef<\"div\">, ComponentPropsWithoutRef<\"div\">>(\n\t({ className, ...props }, ref) => (\n\t\t<div ref={ref} className={cx(\"px-2 py-1.5 text-sm font-medium text-strong\", className)} {...props} />\n\t),\n);\nDropdownMenuLabel.displayName = \"DropdownMenuLabel\";\n\nconst DropdownMenuSeparator = forwardRef<ElementRef<typeof Separator>, ComponentPropsWithoutRef<typeof Separator>>(\n\t({ className, ...props }, ref) => <Separator ref={ref} className={cx(\"-mx-2 my-1 w-auto\", className)} {...props} />,\n);\nDropdownMenuSeparator.displayName = \"DropdownMenuSeparator\";\n\nconst DropdownMenuShortcut = ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => {\n\treturn <span className={cx(\"ml-auto text-xs tracking-widest opacity-60\", className)} {...props} />;\n};\nDropdownMenuShortcut.displayName = \"DropdownMenuShortcut\";\n\nexport {\n\tDropdownMenu,\n\tDropdownMenuTrigger,\n\tDropdownMenuContent,\n\tDropdownMenuItem,\n\tDropdownMenuCheckboxItem,\n\tDropdownMenuRadioItem,\n\tDropdownMenuLabel,\n\tDropdownMenuSeparator,\n\tDropdownMenuShortcut,\n\n\t// TODO(cody): audit / add in these exports in a follow up\n\t// DropdownMenuGroup,\n\t// DropdownMenuPortal,\n\t// DropdownMenuSub,\n\t// DropdownMenuSubContent,\n\t// DropdownMenuSubTrigger,\n\t// DropdownMenuRadioGroup,\n};\n"]}
@@ -1,37 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import * as _radix_ui_react_separator from '@radix-ui/react-separator';
3
- import * as react from 'react';
4
- import { HTMLAttributes, ComponentPropsWithoutRef } from 'react';
5
- import * as Ariakit from '@ariakit/react';
6
- import { W as WithAsChild } from './as-child-BjnPZ1DU.cjs';
7
-
8
- declare const DropdownMenu: typeof Ariakit.MenuProvider;
9
- declare const DropdownMenuTrigger: react.ForwardRefExoticComponent<Omit<Omit<Ariakit.MenuButtonOptions<"button" | "div"> & Omit<(Omit<react.DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
10
- ref?: ((instance: HTMLDivElement | null) => void) | react.RefObject<HTMLDivElement> | null | undefined;
11
- }) | (Omit<react.DetailedHTMLProps<react.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
12
- ref?: ((instance: HTMLButtonElement | null) => void) | react.RefObject<HTMLButtonElement> | null | undefined;
13
- }), keyof Ariakit.MenuButtonOptions<T>> & {
14
- [index: `data-${string}`]: unknown;
15
- }, "ref">, "render"> & WithAsChild & react.RefAttributes<HTMLButtonElement>>;
16
- declare const DropdownMenuContent: react.ForwardRefExoticComponent<Omit<Ariakit.MenuOptions<"div"> & Omit<Omit<react.DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
17
- ref?: ((instance: HTMLDivElement | null) => void) | react.RefObject<HTMLDivElement> | null | undefined;
18
- }, keyof Ariakit.MenuOptions<T>> & {
19
- [index: `data-${string}`]: unknown;
20
- }, "ref"> & react.RefAttributes<HTMLDivElement>>;
21
- declare const DropdownMenuItem: react.ForwardRefExoticComponent<Omit<Ariakit.MenuItemOptions<"div"> & Omit<Omit<react.DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
22
- ref?: ((instance: HTMLDivElement | null) => void) | react.RefObject<HTMLDivElement> | null | undefined;
23
- }, keyof Ariakit.MenuItemOptions<T>> & {
24
- [index: `data-${string}`]: unknown;
25
- }, "ref"> & react.RefAttributes<HTMLDivElement>>;
26
- type DropdownMenuCheckboxItemProps = Omit<ComponentPropsWithoutRef<typeof Ariakit.MenuItemCheckbox>, "render">;
27
- declare const DropdownMenuCheckboxItem: react.ForwardRefExoticComponent<DropdownMenuCheckboxItemProps & react.RefAttributes<HTMLDivElement>>;
28
- type DropdownMenuRadioItemProps = Omit<ComponentPropsWithoutRef<typeof Ariakit.MenuItemRadio>, "render">;
29
- declare const DropdownMenuRadioItem: react.ForwardRefExoticComponent<DropdownMenuRadioItemProps & react.RefAttributes<HTMLDivElement>>;
30
- declare const DropdownMenuLabel: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
31
- declare const DropdownMenuSeparator: react.ForwardRefExoticComponent<Omit<Omit<_radix_ui_react_separator.SeparatorProps & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>, "ref"> & react.RefAttributes<HTMLDivElement>>;
32
- declare const DropdownMenuShortcut: {
33
- ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): react_jsx_runtime.JSX.Element;
34
- displayName: string;
35
- };
36
-
37
- export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuTrigger };
package/dist/hooks.cjs DELETED
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkIN6SIXF2cjs = require('./chunk-IN6SIXF2.cjs');var _react = require('react');var f="(prefers-reduced-motion: no-preference)";function i(){let[r,t]=_react.useState.call(void 0, !0);return _react.useEffect.call(void 0, ()=>{let e=window.matchMedia(f);t(!e.matches);function o(n){t(!n.matches)}return e.addEventListener("change",o),()=>{e.removeEventListener("change",o)}},[]),r}var m=typeof window<"u"?_react.useLayoutEffect:_react.useEffect;exports.useIsomorphicLayoutEffect = m; exports.useMatchesMediaQuery = _chunkIN6SIXF2cjs.a; exports.usePrefersReducedMotion = i;
2
- //# sourceMappingURL=hooks.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../packages/hooks/src/use-prefers-reduced-motion.tsx","../packages/hooks/src/use-isomorphic-layout-effect.tsx"],"names":["useEffect","useState","query","usePrefersReducedMotion","prefersReducedMotion","setPrefersReducedMotion","mediaQueryList","listener","event","useLayoutEffect","useIsomorphicLayoutEffect"],"mappings":"yCAAA,OAAS,aAAAA,EAAW,YAAAC,MAAgB,QAOpC,IAAMC,EAAQ,0CAKP,SAASC,GAA0B,CAEzC,GAAM,CAACC,EAAsBC,CAAuB,EAAIJ,EAAS,EAAI,EAErE,OAAAD,EAAU,IAAM,CACf,IAAMM,EAAiB,OAAO,WAAWJ,CAAK,EAG9CG,EAAwB,CAACC,EAAe,OAAO,EAG/C,SAASC,EAASC,EAA4B,CAC7CH,EAAwB,CAACG,EAAM,OAAO,CACvC,CAEA,OAAAF,EAAe,iBAAiB,SAAUC,CAAQ,EAE3C,IAAM,CACZD,EAAe,oBAAoB,SAAUC,CAAQ,CACtD,CACD,EAAG,CAAC,CAAC,EAEEH,CACR,CCnCA,OAAS,aAAAJ,EAAW,mBAAAS,MAAuB,QAKpC,IAAMC,EAA4B,OAAO,OAAW,IAAcD,EAAkBT","sourcesContent":["import { useEffect, useState } from \"react\";\n\n/**\n * no-preference is the default value for the prefers-reduced-motion media query.\n * Users who have never fiddled with their a11y settings will still see animations\n * (no explicit opt-in required from a user's perspective)\n */\nconst query = \"(prefers-reduced-motion: no-preference)\";\n\n/**\n * usePrefersReducedMotion returns true if the user has opted out of animations\n */\nexport function usePrefersReducedMotion() {\n\t// default to no animations, since we don't know what the user's preference is on the server\n\tconst [prefersReducedMotion, setPrefersReducedMotion] = useState(true);\n\n\tuseEffect(() => {\n\t\tconst mediaQueryList = window.matchMedia(query);\n\n\t\t// set the _real_ initial value now that we're on the client\n\t\tsetPrefersReducedMotion(!mediaQueryList.matches);\n\n\t\t// register for updates\n\t\tfunction listener(event: MediaQueryListEvent) {\n\t\t\tsetPrefersReducedMotion(!event.matches);\n\t\t}\n\n\t\tmediaQueryList.addEventListener(\"change\", listener);\n\n\t\treturn () => {\n\t\t\tmediaQueryList.removeEventListener(\"change\", listener);\n\t\t};\n\t}, []);\n\n\treturn prefersReducedMotion;\n}\n","import { useEffect, useLayoutEffect } from \"react\";\n\n/**\n * useIsomorphicLayoutEffect is a hook that uses useLayoutEffect on the client and useEffect on the server.\n */\nexport const useIsomorphicLayoutEffect = typeof window !== \"undefined\" ? useLayoutEffect : useEffect;\n"]}
package/dist/hooks.d.cts DELETED
@@ -1,15 +0,0 @@
1
- import { useEffect } from 'react';
2
-
3
- /**
4
- * usePrefersReducedMotion returns true if the user has opted out of animations
5
- */
6
- declare function usePrefersReducedMotion(): boolean;
7
-
8
- declare function useMatchesMediaQuery(query: string): boolean;
9
-
10
- /**
11
- * useIsomorphicLayoutEffect is a hook that uses useLayoutEffect on the client and useEffect on the server.
12
- */
13
- declare const useIsomorphicLayoutEffect: typeof useEffect;
14
-
15
- export { useIsomorphicLayoutEffect, useMatchesMediaQuery, usePrefersReducedMotion };
package/dist/icon.cjs DELETED
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkJGNAMNKZcjs = require('./chunk-JGNAMNKZ.cjs');require('./chunk-D3F6KERE.cjs');exports.Icon = _chunkJGNAMNKZcjs.a;
2
- //# sourceMappingURL=icon.cjs.map
package/dist/icon.cjs.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":""}
package/dist/icon.d.cts DELETED
@@ -1,23 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { ReactNode, HTMLAttributes } from 'react';
3
- import { W as WithStyleProps } from './with-style-props-VnLWm0Yd.cjs';
4
-
5
- type IconProps = WithStyleProps & {
6
- /**
7
- * A single SVG icon element.
8
- */
9
- svg: ReactNode;
10
- };
11
- type SvgAttributes = HTMLAttributes<SVGElement> & {
12
- focusable?: "true" | "false";
13
- };
14
- /**
15
- * Decorates an svg icon with automatic sizing styles.
16
- * Merges `className` selectors with the following order of precedence (last one wins):
17
- * 1. Icon base classes
18
- * 2. svg className
19
- * 3. Icon className
20
- */
21
- declare const Icon: ({ className, style, svg }: IconProps) => react_jsx_runtime.JSX.Element;
22
-
23
- export { Icon, type IconProps, type SvgAttributes };
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkD3F6KEREcjs = require('./chunk-D3F6KERE.cjs');var _react = require('react');var _jsxruntime = require('react/jsx-runtime');var o=_react.forwardRef.call(void 0, ({className:r,...t},n)=>_jsxruntime.jsx.call(void 0, "code",{ref:n,className:_chunkD3F6KEREcjs.a.call(void 0, "rounded-md border border-card bg-gray-500/5 px-1 py-0.5 font-mono text-[0.8em]",r),...t}));o.displayName="InlineCode";exports.InlineCode = o;
2
- //# sourceMappingURL=inline-code.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../packages/inline-code/src/inline-code.tsx"],"names":["forwardRef","jsx","InlineCode","className","props","ref","cx"],"mappings":"yCAAA,OAAS,cAAAA,MAAkC,QAO1C,cAAAC,MAAA,oBADD,IAAMC,EAAaF,EAA6D,CAAC,CAAE,UAAAG,EAAW,GAAGC,CAAM,EAAGC,IACzGJ,EAAC,QACA,IAAKI,EACL,UAAWC,EAAG,iFAAkFH,CAAS,EACxG,GAAGC,EACL,CACA,EACDF,EAAW,YAAc","sourcesContent":["import { forwardRef, HTMLAttributes } from \"react\";\nimport { cx } from \"../../cx\";\n\n/**\n * A component to render inline code.\n */\nconst InlineCode = forwardRef<HTMLSpanElement, HTMLAttributes<HTMLSpanElement>>(({ className, ...props }, ref) => (\n\t<code\n\t\tref={ref}\n\t\tclassName={cx(\"rounded-md border border-card bg-gray-500/5 px-1 py-0.5 font-mono text-[0.8em]\", className)}\n\t\t{...props}\n\t/>\n));\nInlineCode.displayName = \"InlineCode\";\n\nexport { InlineCode };\n"]}
@@ -1,9 +0,0 @@
1
- import * as react from 'react';
2
- import { HTMLAttributes } from 'react';
3
-
4
- /**
5
- * A component to render inline code.
6
- */
7
- declare const InlineCode: react.ForwardRefExoticComponent<HTMLAttributes<HTMLSpanElement> & react.RefAttributes<HTMLSpanElement>>;
8
-
9
- export { InlineCode };
package/dist/input.cjs DELETED
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkD3F6KEREcjs = require('./chunk-D3F6KERE.cjs');var _Warning = require('@phosphor-icons/react/Warning');var _react = require('react');var _jsxruntime = require('react/jsx-runtime');var m=_react.forwardRef.call(void 0, ({children:n,className:p,...t},r)=>{let e=!!n,o=_react.useRef.call(void 0, null);return e?_jsxruntime.jsx.call(void 0, y,{className:p,forwardedRef:r,innerRef:o,...t,children:n}):_jsxruntime.jsx.call(void 0, y,{...t,className:p,forwardedRef:r,innerRef:o,children:_jsxruntime.jsx.call(void 0, d,{...t})})});m.displayName="Input";var d=_react.forwardRef.call(void 0, ({"aria-invalid":n,className:p,invalid:t=!1,...r},e)=>{let{"aria-invalid":o,invalid:a,forwardedRef:s,innerRef:f,...u}=_react.useContext.call(void 0, w),P=_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(o, () => (a)), () => (n)), () => (t)),v={...u,...r,type:_nullishCoalesce(_nullishCoalesce(r.type, () => (u.type)), () => ("text"))};return _jsxruntime.jsx.call(void 0, "input",{"aria-invalid":P,className:_chunkD3F6KEREcjs.a.call(void 0, "min-w-0 flex-1 bg-form placeholder:text-placeholder focus:outline-none",p),ref:l=>{typeof e=="function"?e(l):e&&(e.current=l),typeof s=="function"?s(l):s&&(s.current=l),f.current=l},...v})});d.displayName="InputCapture";var w=_react.createContext.call(void 0, {invalid:!1,innerRef:{current:null}}),y=({"aria-invalid":n,children:p,className:t,forwardedRef:r,innerRef:e,invalid:o,style:a,type:s,...f})=>{let u=_nullishCoalesce(n, () => (o));return _jsxruntime.jsx.call(void 0, w.Provider,{value:{"aria-invalid":n,invalid:o,type:s,...f,forwardedRef:r,innerRef:e},children:_jsxruntime.jsxs.call(void 0, "div",{"aria-invalid":u,className:_chunkD3F6KEREcjs.a.call(void 0, "flex h-11 w-full items-center gap-1.5 rounded-md border bg-form px-3 py-2 file:border-0 file:bg-transparent file:text-sm file:font-medium focus-within:outline-none focus-within:ring-4 focus-visible:outline-none focus-visible:ring-4 disabled:pointer-events-none disabled:opacity-50 sm:h-9 sm:text-sm","has-[input:not(:first-child)]:ps-2.5 has-[input:not(:last-child)]:pe-2.5 [&>:not(input)]:shrink-0 [&_svg]:size-6 sm:[&_svg]:size-5","border-form text-strong focus-within:border-accent-600 focus-within:ring-focus-accent",u&&"border-danger-600 pe-2.5 focus-within:border-danger-600 focus-within:ring-focus-danger",t),onClick:()=>{_optionalChain([e, 'optionalAccess', _ => _.current, 'optionalAccess', _2 => _2.focus, 'call', _3 => _3()])},style:a,children:[p,o&&_jsxruntime.jsxs.call(void 0, "div",{className:"pointer-events-none order-last select-none text-danger-600",children:[_jsxruntime.jsx.call(void 0, "span",{className:"sr-only",children:["The value entered for the",f.name,"input has failed validation."].filter(Boolean).join(" ")}),_jsxruntime.jsx.call(void 0, _Warning.Warning,{"aria-hidden":!0,weight:"fill"})]})]})})};var _Eye = require('@phosphor-icons/react/Eye');var _EyeClosed = require('@phosphor-icons/react/EyeClosed');var x=_react.forwardRef.call(void 0, (n,p)=>{let[t,r]=_react.useState.call(void 0, !1);return _jsxruntime.jsxs.call(void 0, m,{type:t?"text":"password",ref:p,...n,children:[_jsxruntime.jsx.call(void 0, d,{}),_jsxruntime.jsxs.call(void 0, "button",{type:"button",tabIndex:-1,className:"ml-1 cursor-pointer bg-inherit p-0 text-body hover:text-strong",onClick:()=>{r(a=>!a)},children:[_jsxruntime.jsxs.call(void 0, "span",{className:"sr-only",children:["Turn password visibility ",t?"off":"on"]}),_jsxruntime.jsx.call(void 0, t?_Eye.Eye:_EyeClosed.EyeClosed,{"aria-hidden":!0})]})]})});x.displayName="PasswordInput";exports.Input = m; exports.InputCapture = d; exports.PasswordInput = x;
2
- //# sourceMappingURL=input.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../packages/input/src/input.tsx","../packages/input/src/password-input.tsx"],"names":["Warning","createContext","forwardRef","useContext","useRef","jsx","jsxs","Input","children","className","props","forwardedRef","hasChildren","innerRef","InputContainer","InputCapture","_ariaInvalid","invalid","restProps","ref","ctxAriaInvalid","ctxInvalid","ctxForwardedRef","ctxInnerRef","ctx","InputContext","ariaInvalid","cx","node","style","type","Eye","EyeClosed","useState","PasswordInput","showPassword","setShowPassword","s"],"mappings":"yCAAA,OAAS,WAAAA,MAAe,gCAExB,OAAS,iBAAAC,EAA2B,cAAAC,EAAY,cAAAC,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ACrB,GACD,CAEF,CAAC,EACDE,EAAc,YAAc","sourcesContent":["import { Warning } from \"@phosphor-icons/react/Warning\";\nimport type { ForwardedRef, InputHTMLAttributes, MutableRefObject, PropsWithChildren } from \"react\";\nimport { createContext, ElementRef, forwardRef, useContext, useRef } from \"react\";\nimport { cx } from \"../../cx\";\nimport type { WithAutoComplete, WithInputType, WithInvalid } from \"./types\";\n\ntype BaseProps = WithAutoComplete & WithInputType & WithInvalid;\n\n/**\n * The props for the `Input` component.\n */\ntype InputProps = Omit<InputHTMLAttributes<HTMLInputElement>, \"autoComplete\" | \"type\"> & BaseProps & PropsWithChildren;\n\n/**\n * Used to create interactive controls for web-based forms in order to accept data from the user\n */\nconst Input = forwardRef<HTMLInputElement, InputProps>(({ children, className, ...props }, forwardedRef) => {\n\tconst hasChildren = Boolean(children);\n\tconst innerRef = useRef<ElementRef<\"input\">>(null);\n\n\tif (hasChildren) {\n\t\treturn (\n\t\t\t<InputContainer className={className} forwardedRef={forwardedRef} innerRef={innerRef} {...props}>\n\t\t\t\t{children}\n\t\t\t</InputContainer>\n\t\t);\n\t}\n\n\treturn (\n\t\t<InputContainer {...props} className={className} forwardedRef={forwardedRef} innerRef={innerRef}>\n\t\t\t<InputCapture {...props} />\n\t\t</InputContainer>\n\t);\n});\nInput.displayName = \"Input\";\n\ntype InputCaptureProps = Omit<InputHTMLAttributes<HTMLInputElement>, \"autoComplete\" | \"type\"> & BaseProps;\n\n/**\n * The actual <input /> element that captures user input.\n */\nconst InputCapture = forwardRef<HTMLInputElement, InputCaptureProps>(\n\t({ \"aria-invalid\": _ariaInvalid, className, invalid = false, ...restProps }, ref) => {\n\t\tconst {\n\t\t\t\"aria-invalid\": ctxAriaInvalid,\n\t\t\tinvalid: ctxInvalid,\n\t\t\tforwardedRef: ctxForwardedRef,\n\t\t\tinnerRef: ctxInnerRef,\n\t\t\t...ctx\n\t\t} = useContext(InputContext);\n\t\tconst ariaInvalid = ctxAriaInvalid ?? ctxInvalid ?? _ariaInvalid ?? invalid;\n\t\tconst props = { ...ctx, ...restProps, type: restProps.type ?? ctx.type ?? \"text\" };\n\n\t\treturn (\n\t\t\t<input\n\t\t\t\taria-invalid={ariaInvalid}\n\t\t\t\tclassName={cx(\"min-w-0 flex-1 bg-form placeholder:text-placeholder focus:outline-none\", className)}\n\t\t\t\tref={(node) => {\n\t\t\t\t\tif (typeof ref === \"function\") {\n\t\t\t\t\t\tref(node);\n\t\t\t\t\t} else if (ref) {\n\t\t\t\t\t\tref.current = node;\n\t\t\t\t\t}\n\t\t\t\t\tif (typeof ctxForwardedRef === \"function\") {\n\t\t\t\t\t\tctxForwardedRef(node);\n\t\t\t\t\t} else if (ctxForwardedRef) {\n\t\t\t\t\t\tctxForwardedRef.current = node;\n\t\t\t\t\t}\n\t\t\t\t\tctxInnerRef.current = node;\n\t\t\t\t}}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t);\n\t},\n);\nInputCapture.displayName = \"InputCapture\";\n\ntype InputContextType = Omit<InputHTMLAttributes<HTMLInputElement>, \"autoComplete\" | \"type\"> &\n\tBaseProps & {\n\t\t/**\n\t\t * inner ref for the input element, controlled by `Input`\n\t\t */\n\t\tinnerRef: MutableRefObject<HTMLInputElement | null>;\n\t\t/**\n\t\t * forwarded ref to the input element, forwarded from `Input` to `InputCapture`\n\t\t */\n\t\tforwardedRef?: ForwardedRef<HTMLInputElement>;\n\t};\n\nconst InputContext = createContext<InputContextType>({ invalid: false, innerRef: { current: null } });\n\ntype InputContainerProps = InputHTMLAttributes<HTMLInputElement> &\n\tBaseProps & {\n\t\t/**\n\t\t * @private inner ref for the input element, controlled by `Input`\n\t\t */\n\t\tinnerRef: MutableRefObject<HTMLInputElement | null>;\n\t\t/**\n\t\t * @private ref to the input element, forwarded from `Input` to `InputCapture`\n\t\t */\n\t\tforwardedRef: ForwardedRef<HTMLInputElement>;\n\t};\n\n/**\n * The container for the input element.\n */\nconst InputContainer = ({\n\t\"aria-invalid\": _ariaInvalid,\n\tchildren,\n\tclassName,\n\tforwardedRef,\n\tinnerRef,\n\tinvalid,\n\tstyle,\n\ttype,\n\t...props\n}: InputContainerProps) => {\n\tconst ariaInvalid = _ariaInvalid ?? invalid;\n\n\treturn (\n\t\t<InputContext.Provider\n\t\t\tvalue={{\n\t\t\t\t\"aria-invalid\": _ariaInvalid,\n\t\t\t\tinvalid,\n\t\t\t\ttype,\n\t\t\t\t...props,\n\t\t\t\tforwardedRef,\n\t\t\t\tinnerRef,\n\t\t\t}}\n\t\t>\n\t\t\t<div\n\t\t\t\taria-invalid={ariaInvalid}\n\t\t\t\tclassName={cx(\n\t\t\t\t\t\"flex h-11 w-full items-center gap-1.5 rounded-md border bg-form px-3 py-2 file:border-0 file:bg-transparent file:text-sm file:font-medium focus-within:outline-none focus-within:ring-4 focus-visible:outline-none focus-visible:ring-4 disabled:pointer-events-none disabled:opacity-50 sm:h-9 sm:text-sm\",\n\t\t\t\t\t\"has-[input:not(:first-child)]:ps-2.5 has-[input:not(:last-child)]:pe-2.5 [&>:not(input)]:shrink-0 [&_svg]:size-6 sm:[&_svg]:size-5\",\n\t\t\t\t\t\"border-form text-strong focus-within:border-accent-600 focus-within:ring-focus-accent\",\n\t\t\t\t\tariaInvalid && \"border-danger-600 pe-2.5 focus-within:border-danger-600 focus-within:ring-focus-danger\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\tonClick={() => {\n\t\t\t\t\tinnerRef?.current?.focus();\n\t\t\t\t}}\n\t\t\t\tstyle={style}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t\t{invalid && (\n\t\t\t\t\t<div className=\"pointer-events-none order-last select-none text-danger-600\">\n\t\t\t\t\t\t<span className=\"sr-only\">\n\t\t\t\t\t\t\t{[\"The value entered for the\", props.name, \"input has failed validation.\"].filter(Boolean).join(\" \")}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<Warning aria-hidden weight=\"fill\" />\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t</InputContext.Provider>\n\t);\n};\n\nexport { Input, InputCapture };\nexport type { InputProps, InputCaptureProps };\n","import { Eye } from \"@phosphor-icons/react/Eye\";\nimport { EyeClosed } from \"@phosphor-icons/react/EyeClosed\";\nimport { forwardRef, useState } from \"react\";\nimport type { InputHTMLAttributes } from \"react\";\nimport { Input, InputCapture } from \"./input\";\nimport type { InputType, WithAutoComplete, WithInvalid } from \"./types\";\n\ntype PasswordInputProps = Omit<InputHTMLAttributes<HTMLInputElement>, \"autoComplete\" | \"type\"> &\n\tWithInvalid &\n\tWithAutoComplete;\n\ntype PasswordInputType = Extract<InputType, \"text\" | \"password\">;\n\nconst PasswordInput = forwardRef<HTMLInputElement, PasswordInputProps>((props, ref) => {\n\tconst [showPassword, setShowPassword] = useState<boolean>(false);\n\tconst type: PasswordInputType = showPassword ? \"text\" : \"password\";\n\tconst EyeCon = showPassword ? Eye : EyeClosed;\n\n\treturn (\n\t\t<Input type={type} ref={ref} {...props}>\n\t\t\t<InputCapture />\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\ttabIndex={-1}\n\t\t\t\tclassName=\"ml-1 cursor-pointer bg-inherit p-0 text-body hover:text-strong\"\n\t\t\t\tonClick={() => {\n\t\t\t\t\tsetShowPassword((s) => !s);\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t<span className=\"sr-only\">Turn password visibility {showPassword ? \"off\" : \"on\"}</span>\n\t\t\t\t<EyeCon aria-hidden />\n\t\t\t</button>\n\t\t</Input>\n\t);\n});\nPasswordInput.displayName = \"PasswordInput\";\n\nexport { PasswordInput };\nexport type { PasswordInputProps };\n"]}
package/dist/input.d.cts DELETED
@@ -1,75 +0,0 @@
1
- import * as react from 'react';
2
- import { InputHTMLAttributes, PropsWithChildren } from 'react';
3
-
4
- /**
5
- * (Not a Boolean attribute!) The autocomplete attribute takes as its value a space-separated string that describes what,
6
- * if any, type of autocomplete functionality the input should provide. A typical implementation of autocomplete recalls
7
- * previous values entered in the same input field, but more complex forms of autocomplete can exist. For instance, a
8
- * browser could integrate with a device's contacts list to autocomplete email addresses in an email input field.
9
- *
10
- * The autocomplete attribute is valid on hidden, text, search, url, tel, email, date, month, week, time, datetime-local,
11
- * number, range, color, and password. This attribute has no effect on input types that do not return numeric or text
12
- * data, being valid for all input types except checkbox, radio, file, or any of the button types.
13
- *
14
- * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete#values
15
- */
16
- type AutoComplete = "off" | "on" | "name" | "honorific-prefix" | "given-name" | "additional-name" | "family-name" | "honorific-suffix" | "nickname" | "email" | "username" | "new-password" | "current-password" | "one-time-code" | "organization-title" | "organization" | "street-address" | "address-line1" | "address-line2" | "address-line3" | "address-level4" | "address-level3" | "address-level2" | "address-level1" | "country" | "country-name" | "postal-code" | "cc-name" | "cc-given-name" | "cc-additional-name" | "cc-family-name" | "cc-number" | "cc-exp" | "cc-exp-month" | "cc-exp-year" | "cc-csc" | "cc-type" | "transaction-currency" | "transaction-amount" | "language" | "bday" | "bday-day" | "bday-month" | "bday-year" | "sex" | "tel" | "tel-country-code" | "tel-national" | "tel-area-code" | "tel-local" | "tel-extension" | "impp" | "url" | "photo";
17
- type WithAutoComplete = {
18
- /**
19
- * (Not a Boolean attribute!) The autocomplete attribute takes as its value a space-separated string that describes what,
20
- * if any, type of autocomplete functionality the input should provide. A typical implementation of autocomplete recalls
21
- * previous values entered in the same input field, but more complex forms of autocomplete can exist. For instance, a
22
- * browser could integrate with a device's contacts list to autocomplete email addresses in an email input field.
23
- *
24
- * The autocomplete attribute is valid on hidden, text, search, url, tel, email, date, month, week, time, datetime-local,
25
- * number, range, color, and password. This attribute has no effect on input types that do not return numeric or text
26
- * data, being valid for all input types except checkbox, radio, file, or any of the button types.
27
- *
28
- * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete#values
29
- */
30
- autoComplete?: AutoComplete;
31
- };
32
- /**
33
- * A string specifying the type of control to render. For example, to create a checkbox, a value of `"checkbox"` is used.
34
- * If omitted (or an unknown value is specified), the input type `"text"` is used, creating a plaintext input field.
35
- *
36
- * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#input_types
37
- */
38
- type InputType = "button" | "checkbox" | "color" | "date" | "datetime-local" | "email" | "file" | "hidden" | "image" | "month" | "number" | "password" | "radio" | "range" | "reset" | "search" | "submit" | "tel" | "text" | "time" | "url" | "week";
39
- type WithInputType = {
40
- /**
41
- * A string specifying the type of control to render. For example, to create a checkbox, a value of `"checkbox"` is used.
42
- * If omitted (or an unknown value is specified), the input type `"text"` is used, creating a plaintext input field.
43
- *
44
- * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#input_types
45
- */
46
- type?: InputType;
47
- };
48
- type WithInvalid = {
49
- /**
50
- * Whether or not the input has a validation error.
51
- */
52
- invalid?: boolean;
53
- };
54
-
55
- type BaseProps = WithAutoComplete & WithInputType & WithInvalid;
56
- /**
57
- * The props for the `Input` component.
58
- */
59
- type InputProps = Omit<InputHTMLAttributes<HTMLInputElement>, "autoComplete" | "type"> & BaseProps & PropsWithChildren;
60
- /**
61
- * Used to create interactive controls for web-based forms in order to accept data from the user
62
- */
63
- declare const Input: react.ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "autoComplete" | "type"> & WithAutoComplete & WithInputType & WithInvalid & {
64
- children?: react.ReactNode;
65
- } & react.RefAttributes<HTMLInputElement>>;
66
- type InputCaptureProps = Omit<InputHTMLAttributes<HTMLInputElement>, "autoComplete" | "type"> & BaseProps;
67
- /**
68
- * The actual <input /> element that captures user input.
69
- */
70
- declare const InputCapture: react.ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "autoComplete" | "type"> & WithAutoComplete & WithInputType & WithInvalid & react.RefAttributes<HTMLInputElement>>;
71
-
72
- type PasswordInputProps = Omit<InputHTMLAttributes<HTMLInputElement>, "autoComplete" | "type"> & WithInvalid & WithAutoComplete;
73
- declare const PasswordInput: react.ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "autoComplete" | "type"> & WithInvalid & WithAutoComplete & react.RefAttributes<HTMLInputElement>>;
74
-
75
- export { type AutoComplete, Input, InputCapture, type InputCaptureProps, type InputProps, type InputType, PasswordInput, type PasswordInputProps, type WithAutoComplete, type WithInputType, type WithInvalid };
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkD3F6KEREcjs = require('./chunk-D3F6KERE.cjs');var _react = require('react');var _jsxruntime = require('react/jsx-runtime');var n=_react.forwardRef.call(void 0, ({className:e,children:t,style:i},a)=>_jsxruntime.jsx.call(void 0, "div",{ref:a,className:_chunkD3F6KEREcjs.a.call(void 0, "flex gap-4",e),style:i,children:t}));n.displayName="MediaObject";var s=_react.forwardRef.call(void 0, ({className:e,children:t,style:i},a)=>_jsxruntime.jsx.call(void 0, "div",{ref:a,className:_chunkD3F6KEREcjs.a.call(void 0, "shrink-0 leading-none",e),style:i,children:t}));s.displayName="MediaObjectMedia";var l=_react.forwardRef.call(void 0, ({className:e,children:t,style:i},a)=>_jsxruntime.jsx.call(void 0, "div",{ref:a,className:_chunkD3F6KEREcjs.a.call(void 0, "min-w-0 flex-1",e),style:i,children:t}));l.displayName="MediaObjectContent";exports.MediaObject = n; exports.MediaObjectContent = l; exports.MediaObjectMedia = s;
2
- //# sourceMappingURL=media-object.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../packages/media-object/src/media-object.tsx"],"names":["forwardRef","jsx","MediaObject","className","children","style","ref","cx","MediaObjectMedia","MediaObjectContent"],"mappings":"yCAAA,OAAS,cAAAA,MAAkB,QAkBzB,cAAAC,MAAA,oBAFF,IAAMC,EAAcF,EACnB,CAAC,CAAE,UAAAG,EAAW,SAAAC,EAAU,MAAAC,CAAM,EAAGC,IAChCL,EAAC,OAAI,IAAKK,EAAK,UAAWC,EAAG,aAAcJ,CAAS,EAAG,MAAOE,EAC5D,SAAAD,EACF,CAEF,EACAF,EAAY,YAAc,cAK1B,IAAMM,EAAmBR,EACxB,CAAC,CAAE,UAAAG,EAAW,SAAAC,EAAU,MAAAC,CAAM,EAAGC,IAChCL,EAAC,OAAI,IAAKK,EAAK,UAAWC,EAAG,wBAAyBJ,CAAS,EAAG,MAAOE,EACvE,SAAAD,EACF,CAEF,EACAI,EAAiB,YAAc,mBAK/B,IAAMC,EAAqBT,EAC1B,CAAC,CAAE,UAAAG,EAAW,SAAAC,EAAU,MAAAC,CAAM,EAAGC,IAChCL,EAAC,OAAI,IAAKK,EAAK,UAAWC,EAAG,iBAAkBJ,CAAS,EAAG,MAAOE,EAChE,SAAAD,EACF,CAEF,EACAK,EAAmB,YAAc","sourcesContent":["import { forwardRef } from \"react\";\nimport type { HTMLAttributes } from \"react\";\nimport { cx } from \"../../cx\";\n\n/**\n * The media object is an image/icon (media) to the left, with descriptive\n * content (title and subtitle/description) to the right.\n *\n * Change the spacing between the media and content by passing a `gap-*` class.\n * The default gap is `gap-4`.\n *\n * Use flexbox utilities to change the alignment of the media and content.\n *\n * Compose the media object with the `MediaObjectMedia` and `MediaObjectContent`\n * components as direct children.\n */\nconst MediaObject = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(\n\t({ className, children, style }, ref) => (\n\t\t<div ref={ref} className={cx(\"flex gap-4\", className)} style={style}>\n\t\t\t{children}\n\t\t</div>\n\t),\n);\nMediaObject.displayName = \"MediaObject\";\n\n/**\n * The container for an image or icon to display in the media slot of the media object.\n */\nconst MediaObjectMedia = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(\n\t({ className, children, style }, ref) => (\n\t\t<div ref={ref} className={cx(\"shrink-0 leading-none\", className)} style={style}>\n\t\t\t{children}\n\t\t</div>\n\t),\n);\nMediaObjectMedia.displayName = \"MediaObjectMedia\";\n\n/**\n * The container for the content slot of a media object.\n */\nconst MediaObjectContent = forwardRef<HTMLDivElement, HTMLAttributes<HTMLDivElement>>(\n\t({ className, children, style }, ref) => (\n\t\t<div ref={ref} className={cx(\"min-w-0 flex-1\", className)} style={style}>\n\t\t\t{children}\n\t\t</div>\n\t),\n);\nMediaObjectContent.displayName = \"MediaObjectContent\";\n\nexport { MediaObject, MediaObjectMedia, MediaObjectContent };\n"]}
@@ -1,26 +0,0 @@
1
- import * as react from 'react';
2
- import { HTMLAttributes } from 'react';
3
-
4
- /**
5
- * The media object is an image/icon (media) to the left, with descriptive
6
- * content (title and subtitle/description) to the right.
7
- *
8
- * Change the spacing between the media and content by passing a `gap-*` class.
9
- * The default gap is `gap-4`.
10
- *
11
- * Use flexbox utilities to change the alignment of the media and content.
12
- *
13
- * Compose the media object with the `MediaObjectMedia` and `MediaObjectContent`
14
- * components as direct children.
15
- */
16
- declare const MediaObject: react.ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & react.RefAttributes<HTMLDivElement>>;
17
- /**
18
- * The container for an image or icon to display in the media slot of the media object.
19
- */
20
- declare const MediaObjectMedia: react.ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & react.RefAttributes<HTMLDivElement>>;
21
- /**
22
- * The container for the content slot of a media object.
23
- */
24
- declare const MediaObjectContent: react.ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & react.RefAttributes<HTMLDivElement>>;
25
-
26
- export { MediaObject, MediaObjectContent, MediaObjectMedia };
package/dist/popover.cjs DELETED
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }var _chunkD3F6KEREcjs = require('./chunk-D3F6KERE.cjs');var _reactpopover = require('@radix-ui/react-popover'); var o = _interopRequireWildcard(_reactpopover);var _react = require('react');var _jsxruntime = require('react/jsx-runtime');var s=o.Root,P= exports.PopoverTrigger =o.Trigger,r= exports.PopoverContent =_react.forwardRef.call(void 0, ({className:i,align:a="center",sideOffset:p=4,...n},d)=>_jsxruntime.jsx.call(void 0, o.Portal,{children:_jsxruntime.jsx.call(void 0, o.Content,{ref:d,align:a,sideOffset:p,className:_chunkD3F6KEREcjs.a.call(void 0, "text-popover-foreground z-50 w-72 rounded-md border border-popover bg-popover p-4 shadow-md outline-none data-side-bottom:slide-in-from-top-2 data-side-left:slide-in-from-right-2 data-side-right:slide-in-from-left-2 data-side-top:slide-in-from-bottom-2 data-state-closed:animate-out data-state-closed:fade-out-0 data-state-closed:zoom-out-95 data-state-open:animate-in data-state-open:fade-in-0 data-state-open:zoom-in-95",i),...n})}));r.displayName=o.Content.displayName;exports.Popover = s; exports.PopoverContent = r; exports.PopoverTrigger = P;
2
- //# sourceMappingURL=popover.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../packages/popover/src/popover.tsx"],"names":["PopoverPrimitive","forwardRef","jsx","Popover","PopoverTrigger","PopoverContent","className","align","sideOffset","props","ref","cx"],"mappings":"yCAAA,UAAYA,MAAsB,0BAClC,OAA+C,cAAAC,MAAkB,QAY/D,cAAAC,MAAA,oBATF,IAAMC,EAA2B,OAE3BC,EAAkC,UAElCC,EAAiBJ,EAGrB,CAAC,CAAE,UAAAK,EAAW,MAAAC,EAAQ,SAAU,WAAAC,EAAa,EAAG,GAAGC,CAAM,EAAGC,IAC7DR,EAAkB,SAAjB,CACA,SAAAA,EAAkB,UAAjB,CACA,IAAKQ,EACL,MAAOH,EACP,WAAYC,EACZ,UAAWG,EACV,waACAL,CACD,EACC,GAAGG,EACL,EACD,CACA,EACDJ,EAAe,YAA+B,UAAQ","sourcesContent":["import * as PopoverPrimitive from \"@radix-ui/react-popover\";\nimport { ComponentPropsWithoutRef, ElementRef, forwardRef } from \"react\";\nimport { cx } from \"../../cx\";\n\nconst Popover = PopoverPrimitive.Root;\n\nconst PopoverTrigger = PopoverPrimitive.Trigger;\n\nconst PopoverContent = forwardRef<\n\tElementRef<typeof PopoverPrimitive.Content>,\n\tComponentPropsWithoutRef<typeof PopoverPrimitive.Content>\n>(({ className, align = \"center\", sideOffset = 4, ...props }, ref) => (\n\t<PopoverPrimitive.Portal>\n\t\t<PopoverPrimitive.Content\n\t\t\tref={ref}\n\t\t\talign={align}\n\t\t\tsideOffset={sideOffset}\n\t\t\tclassName={cx(\n\t\t\t\t\"text-popover-foreground z-50 w-72 rounded-md border border-popover bg-popover p-4 shadow-md outline-none data-side-bottom:slide-in-from-top-2 data-side-left:slide-in-from-right-2 data-side-right:slide-in-from-left-2 data-side-top:slide-in-from-bottom-2 data-state-closed:animate-out data-state-closed:fade-out-0 data-state-closed:zoom-out-95 data-state-open:animate-in data-state-open:fade-in-0 data-state-open:zoom-in-95\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t</PopoverPrimitive.Portal>\n));\nPopoverContent.displayName = PopoverPrimitive.Content.displayName;\n\nexport { Popover, PopoverTrigger, PopoverContent };\n"]}