@akira-io/ui 1.1.1 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/blocks.d.ts +6 -6
- package/dist/blocks.js +17 -18
- package/dist/blocks.js.map +1 -1
- package/dist/{chunk-CFDDAFPJ.js → chunk-7LBWPBVE.js} +29 -15
- package/dist/chunk-7LBWPBVE.js.map +1 -0
- package/dist/{chunk-ODYCBCKS.js → chunk-I5UZAJB4.js} +7 -6
- package/dist/chunk-I5UZAJB4.js.map +1 -0
- package/dist/{chunk-RPCL7VFQ.js → chunk-IE6VWUSB.js} +9 -5
- package/dist/chunk-IE6VWUSB.js.map +1 -0
- package/dist/{chunk-2WIIRDHT.js → chunk-MCMBS2SB.js} +4 -4
- package/dist/{chunk-2WIIRDHT.js.map → chunk-MCMBS2SB.js.map} +1 -1
- package/dist/{chunk-4SOQAVUP.js → chunk-NA33PNQO.js} +46 -28
- package/dist/chunk-NA33PNQO.js.map +1 -0
- package/dist/{chunk-YOVY3KT6.js → chunk-NGMG2UWX.js} +3 -3
- package/dist/{chunk-YOVY3KT6.js.map → chunk-NGMG2UWX.js.map} +1 -1
- package/dist/{chunk-T2INZOCM.js → chunk-O5DZTX7D.js} +3 -3
- package/dist/{chunk-T2INZOCM.js.map → chunk-O5DZTX7D.js.map} +1 -1
- package/dist/{chunk-QHZWW55M.js → chunk-PSJGAZIS.js} +24 -16
- package/dist/chunk-PSJGAZIS.js.map +1 -0
- package/dist/{chunk-5AJFQ6C4.js → chunk-QNF4LJVT.js} +2 -2
- package/dist/chunk-QNF4LJVT.js.map +1 -0
- package/dist/{chunk-FWQFB37J.js → chunk-SBLZ6T3D.js} +3 -3
- package/dist/{chunk-FWQFB37J.js.map → chunk-SBLZ6T3D.js.map} +1 -1
- package/dist/chunk-UTSTTTH5.js +48 -0
- package/dist/chunk-UTSTTTH5.js.map +1 -0
- package/dist/code.js +3 -3
- package/dist/{context-YWbxMH0C.d.ts → context-OwSoVEri.d.ts} +32 -3
- package/dist/editor.js +4 -5
- package/dist/editor.js.map +1 -1
- package/dist/{password-input-DcXX7SG9.d.ts → field-DWm5NXeV.d.ts} +1 -13
- package/dist/index.d.ts +15 -23
- package/dist/index.js +38 -30
- package/dist/index.js.map +1 -1
- package/dist/inertia.js +6 -7
- package/dist/inertia.js.map +1 -1
- package/dist/{button-Bj6My68b.d.ts → input-Dxnsxi-f.d.ts} +4 -1
- package/dist/{language-Dgjr9bm3.d.ts → language-Cv_N_53L.d.ts} +5 -2
- package/dist/locales/pt.d.ts +5 -5
- package/dist/locales/pt.js +7 -1
- package/dist/locales/pt.js.map +1 -1
- package/dist/shells.d.ts +2 -3
- package/dist/shells.js +6 -7
- package/dist/shells.js.map +1 -1
- package/dist/{sidebar-DqkFRUxQ.d.ts → sidebar-Bp6Q46j-.d.ts} +1 -2
- package/package.json +1 -1
- package/theme.css +6 -3
- package/dist/chunk-4SOQAVUP.js.map +0 -1
- package/dist/chunk-5AJFQ6C4.js.map +0 -1
- package/dist/chunk-CFDDAFPJ.js.map +0 -1
- package/dist/chunk-ODYCBCKS.js.map +0 -1
- package/dist/chunk-QHZWW55M.js.map +0 -1
- package/dist/chunk-RPCL7VFQ.js.map +0 -1
- package/dist/chunk-TGF54WAO.js +0 -29
- package/dist/chunk-TGF54WAO.js.map +0 -1
- package/dist/chunk-XZCC6MTE.js +0 -26
- package/dist/chunk-XZCC6MTE.js.map +0 -1
- package/dist/input-Dpi7pXeR.d.ts +0 -6
package/dist/editor.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/ui/editor/context.tsx","../src/components/ui/editor/content.tsx","../src/components/ui/editor/toolbar.tsx","../src/components/ui/editor/controls.tsx","../src/components/ui/editor/extensions.ts","../src/components/ui/editor/labels.ts","../src/components/ui/editor/editor.tsx","../src/components/ui/editor/link.tsx","../src/components/ui/editor/rich-text-editor.tsx"],"names":["TiptapContent","jsx","revision","useState","jsxs"],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BA,GAAAA,CAAC,SAAA,EAAA,EAAU,WAAA,EAAY,UAAA,EAAW,WAAU,UAAA,EAAW,CAAA;AAAA,sBACvDA,GAAAA,CAAC,UAAA,EAAA,EAAW,OAAA,EAAQ,QAAA,EAAS,CAAA;AAAA,sBAC7BA,GAAAA,CAAC,UAAA,EAAA,EAAW,OAAA,EAAQ,SAAA,EAAU,CAAA;AAAA,sBAC9BA,IAAC,gBAAA,EAAA,EAAiB,CAAA;AAAA,sBAClBA,GAAAA,CAAC,UAAA,EAAA,EAAW,IAAA,EAAK,MAAA,EAAO,CAAA;AAAA,sBACxBA,IAAC,UAAA,EAAA,EAAW,CAAA;AAAA,sBACZA,GAAAA,CAAC,SAAA,EAAA,EAAU,WAAA,EAAY,UAAA,EAAW,WAAU,UAAA,EAAW,CAAA;AAAA,sBACvDA,GAAAA,CAAC,aAAA,EAAA,EAAc,MAAA,EAAO,MAAA,EAAO,CAAA;AAAA,sBAC7BA,GAAAA,CAAC,aAAA,EAAA,EAAc,MAAA,EAAO,MAAA,EAAO;AAAA,KAAA,EACjC,CAAA;AAAA,oBACAA,IAAC,aAAA,EAAA,EAAc;AAAA,GAAA,EACnB,CAAA;AAER","file":"editor.js","sourcesContent":["import type { Editor as TiptapEditor } from '@tiptap/core';\nimport { createContext, useContext } from 'react';\n\nimport type { EditorLabels } from '@/components/ui/editor/labels';\n\nexport interface EditorContextValue {\n editor: TiptapEditor;\n labels: EditorLabels;\n editable: boolean;\n placeholder?: string;\n}\n\nconst EditorContext = createContext<EditorContextValue | null>(null);\n\nexport const EditorContextProvider = EditorContext.Provider;\n\nexport function useEditorContext(): EditorContextValue {\n const context = useContext(EditorContext);\n\n if (context === null) {\n throw new Error('Editor parts must be used inside <Editor>.');\n }\n\n return context;\n}\n","import { EditorContent as TiptapContent } from '@tiptap/react';\n\nimport { useEditorContext } from '@/components/ui/editor/context';\nimport { cn } from '@/lib/utils';\nimport type { SlotNameProps } from '@/types';\n\nexport interface EditorContentProps {\n className?: string;\n}\n\nexport function EditorContent({\n className,\n slotName = 'editor-content',\n}: EditorContentProps & SlotNameProps) {\n const { editor, placeholder } = useEditorContext();\n\n return (\n <div\n data-placeholder={placeholder}\n data-empty={editor.isEmpty ? '' : undefined}\n className={cn(\n 'data-empty:before:top-3 data-empty:before:left-4 data-empty:before:text-sm data-empty:before:font-medium relative w-full data-empty:before:pointer-events-none data-empty:before:absolute data-empty:before:text-muted-foreground data-empty:before:content-[attr(data-placeholder)]',\n className,\n )}\n data-slot={slotName}\n >\n <TiptapContent editor={editor} />\n </div>\n );\n}\n","import type { LucideIcon } from 'lucide-react';\nimport type { ReactNode } from 'react';\n\nimport { useEditorContext } from '@/components/ui/editor/context';\nimport { Toggle } from '@/components/ui/toggle';\nimport { cn } from '@/lib/utils';\nimport type { SlotNameProps } from '@/types';\n\nexport interface EditorToolbarProps {\n children: ReactNode;\n className?: string;\n}\n\nexport function EditorToolbar({\n children,\n className,\n slotName = 'editor-toolbar',\n}: EditorToolbarProps & SlotNameProps) {\n const { labels } = useEditorContext();\n\n return (\n <div\n role=\"toolbar\"\n aria-label={labels.toolbarLabel}\n aria-orientation=\"horizontal\"\n className={cn('gap-1 flex flex-wrap items-center', className)}\n data-slot={slotName}\n >\n {children}\n </div>\n );\n}\n\nexport interface EditorControlProps {\n label: string;\n icon: LucideIcon;\n pressed?: boolean;\n disabled?: boolean;\n onActivate: () => void;\n className?: string;\n}\n\nexport function EditorControl({\n label,\n icon: Icon,\n pressed = false,\n disabled = false,\n onActivate,\n className,\n slotName = 'editor-control',\n}: EditorControlProps & SlotNameProps) {\n const { editable } = useEditorContext();\n\n return (\n <Toggle\n size=\"sm\"\n aria-label={label}\n title={label}\n pressed={pressed}\n disabled={disabled || !editable}\n onPressedChange={onActivate}\n className={className}\n slotName={slotName}\n >\n <Icon aria-hidden=\"true\" />\n </Toggle>\n );\n}\n","import {\n Bold,\n Code,\n Heading1,\n Heading2,\n Heading3,\n Heading4,\n Heading5,\n Heading6,\n Italic,\n List,\n ListOrdered,\n Quote,\n Redo2,\n Strikethrough,\n Undo2,\n type LucideIcon,\n} from 'lucide-react';\n\nimport { Button } from '@/components/ui/button';\nimport { useEditorContext } from '@/components/ui/editor/context';\nimport { EditorControl } from '@/components/ui/editor/toolbar';\nimport type { SlotNameProps } from '@/types';\n\nexport type EditorMarkName = 'bold' | 'italic' | 'strike' | 'code';\n\nconst MARK_ICONS: Record<EditorMarkName, LucideIcon> = {\n bold: Bold,\n italic: Italic,\n strike: Strikethrough,\n code: Code,\n};\n\nexport interface EditorMarkProps {\n mark: EditorMarkName;\n label?: string;\n className?: string;\n}\n\nexport function EditorMark({ mark, label, className }: EditorMarkProps) {\n const { editor, labels } = useEditorContext();\n\n const names: Record<EditorMarkName, string> = {\n bold: labels.boldLabel,\n italic: labels.italicLabel,\n strike: labels.strikeLabel,\n code: labels.codeLabel,\n };\n\n return (\n <EditorControl\n label={label ?? names[mark]}\n icon={MARK_ICONS[mark]}\n pressed={editor.isActive(mark)}\n disabled={!editor.can().toggleMark(mark)}\n onActivate={() => editor.chain().focus().toggleMark(mark).run()}\n className={className}\n />\n );\n}\n\nconst HEADING_ICONS: Record<number, LucideIcon> = {\n 1: Heading1,\n 2: Heading2,\n 3: Heading3,\n 4: Heading4,\n 5: Heading5,\n 6: Heading6,\n};\n\nexport interface EditorHeadingProps {\n level: 1 | 2 | 3 | 4 | 5 | 6;\n label?: string;\n className?: string;\n}\n\nexport function EditorHeading({ level, label, className }: EditorHeadingProps) {\n const { editor, labels } = useEditorContext();\n\n return (\n <EditorControl\n label={label ?? labels.headingLabel(level)}\n icon={HEADING_ICONS[level]}\n pressed={editor.isActive('heading', { level })}\n disabled={\n !editor.can().toggleNode('heading', 'paragraph', { level })\n }\n onActivate={() =>\n editor.chain().focus().toggleHeading({ level }).run()\n }\n className={className}\n />\n );\n}\n\nexport type EditorListVariant = 'bullet' | 'ordered';\n\nexport interface EditorListProps {\n variant: EditorListVariant;\n label?: string;\n className?: string;\n}\n\nexport function EditorList({ variant, label, className }: EditorListProps) {\n const { editor, labels } = useEditorContext();\n const name = variant === 'bullet' ? 'bulletList' : 'orderedList';\n\n return (\n <EditorControl\n label={\n label ??\n (variant === 'bullet'\n ? labels.bulletListLabel\n : labels.orderedListLabel)\n }\n icon={variant === 'bullet' ? List : ListOrdered}\n pressed={editor.isActive(name)}\n disabled={!editor.can().toggleList(name, 'listItem')}\n onActivate={() =>\n variant === 'bullet'\n ? editor.chain().focus().toggleBulletList().run()\n : editor.chain().focus().toggleOrderedList().run()\n }\n className={className}\n />\n );\n}\n\nexport interface EditorBlockquoteProps {\n label?: string;\n className?: string;\n}\n\nexport function EditorBlockquote({ label, className }: EditorBlockquoteProps) {\n const { editor, labels } = useEditorContext();\n\n return (\n <EditorControl\n label={label ?? labels.blockquoteLabel}\n icon={Quote}\n pressed={editor.isActive('blockquote')}\n disabled={!editor.can().toggleWrap('blockquote')}\n onActivate={() => editor.chain().focus().toggleBlockquote().run()}\n className={className}\n />\n );\n}\n\nexport type EditorHistoryAction = 'undo' | 'redo';\n\nexport interface EditorHistoryProps {\n action: EditorHistoryAction;\n label?: string;\n className?: string;\n}\n\nexport function EditorHistory({\n action,\n label,\n className,\n slotName = 'editor-history',\n}: EditorHistoryProps & SlotNameProps) {\n const { editor, labels, editable } = useEditorContext();\n const undoing = action === 'undo';\n const available = undoing ? editor.can().undo() : editor.can().redo();\n const Icon = undoing ? Undo2 : Redo2;\n\n return (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-sm\"\n aria-label={\n label ?? (undoing ? labels.undoLabel : labels.redoLabel)\n }\n title={label ?? (undoing ? labels.undoLabel : labels.redoLabel)}\n disabled={!available || !editable}\n onClick={() =>\n undoing\n ? editor.chain().focus().undo().run()\n : editor.chain().focus().redo().run()\n }\n className={className}\n slotName={slotName}\n >\n <Icon aria-hidden=\"true\" />\n </Button>\n );\n}\n","import type { Extensions } from '@tiptap/core';\nimport StarterKit from '@tiptap/starter-kit';\n\nconst SAFE_PROTOCOLS = ['http', 'https', 'mailto', 'tel'];\n\nexport function isSafeEditorUrl(url: string): boolean {\n const protocol = /^([a-z][a-z0-9+.-]*):/i.exec(url.trim())?.[1];\n\n return (\n protocol === undefined ||\n SAFE_PROTOCOLS.includes(protocol.toLowerCase())\n );\n}\n\nexport function defaultEditorExtensions(): Extensions {\n return [\n StarterKit.configure({\n link: {\n openOnClick: false,\n autolink: true,\n protocols: SAFE_PROTOCOLS,\n isAllowedUri: (url) => isSafeEditorUrl(url),\n HTMLAttributes: {\n rel: 'noopener noreferrer nofollow',\n target: '_blank',\n },\n },\n }),\n ];\n}\n","export interface EditorLabels {\n toolbarLabel: string;\n boldLabel: string;\n italicLabel: string;\n strikeLabel: string;\n codeLabel: string;\n headingLabel: (level: number) => string;\n bulletListLabel: string;\n orderedListLabel: string;\n blockquoteLabel: string;\n undoLabel: string;\n redoLabel: string;\n linkLabel: string;\n linkDialogTitle: string;\n linkDialogDescription: string;\n linkUrlLabel: string;\n linkUrlPlaceholder: string;\n linkApplyLabel: string;\n linkRemoveLabel: string;\n linkCancelLabel: string;\n}\n\nexport const editorLabels: EditorLabels = {\n toolbarLabel: 'Formatting',\n boldLabel: 'Bold',\n italicLabel: 'Italic',\n strikeLabel: 'Strikethrough',\n codeLabel: 'Code',\n headingLabel: (level) => `Heading ${level}`,\n bulletListLabel: 'Bullet list',\n orderedListLabel: 'Numbered list',\n blockquoteLabel: 'Quote',\n undoLabel: 'Undo',\n redoLabel: 'Redo',\n linkLabel: 'Link',\n linkDialogTitle: 'Link',\n linkDialogDescription: 'Point the selected text at an address.',\n linkUrlLabel: 'Address',\n linkUrlPlaceholder: 'https://example.com',\n linkApplyLabel: 'Apply',\n linkRemoveLabel: 'Remove',\n linkCancelLabel: 'Cancel',\n};\n","import type { Extensions, JSONContent } from '@tiptap/core';\nimport { useEditor } from '@tiptap/react';\nimport { useEffect, useMemo, useRef, useState, type ReactNode } from 'react';\n\nimport {\n EditorContextProvider,\n type EditorContextValue,\n} from '@/components/ui/editor/context';\nimport { defaultEditorExtensions } from '@/components/ui/editor/extensions';\nimport { editorLabels, type EditorLabels } from '@/components/ui/editor/labels';\nimport { fieldSurface, focusRing } from '@/lib/language';\nimport { cn } from '@/lib/utils';\nimport type { SlotNameProps } from '@/types';\n\nexport type EditorOutput = 'html' | 'json';\n\nexport type EditorDocument = string | JSONContent;\n\ninterface EditorSharedProps {\n extensions?: Extensions;\n labels?: EditorLabels;\n placeholder?: string;\n label?: string;\n disabled?: boolean;\n readOnly?: boolean;\n className?: string;\n children: ReactNode;\n}\n\nexport type EditorProps = EditorSharedProps &\n (\n | {\n output?: 'html';\n value: string;\n onChange: (value: string) => void;\n }\n | {\n output: 'json';\n value: JSONContent;\n onChange: (value: JSONContent) => void;\n }\n );\n\nconst editorProse =\n 'text-sm font-medium leading-relaxed [&_p]:my-2 [&_h1]:mt-4 [&_h1]:mb-2 [&_h1]:text-2xl [&_h1]:font-bold [&_h2]:mt-4 [&_h2]:mb-2 [&_h2]:text-xl [&_h2]:font-bold [&_h3]:mt-3 [&_h3]:mb-2 [&_h3]:text-lg [&_h3]:font-semibold [&_ul]:my-2 [&_ul]:list-disc [&_ul]:pl-6 [&_ol]:my-2 [&_ol]:list-decimal [&_ol]:pl-6 [&_li]:my-1 [&_blockquote]:my-3 [&_blockquote]:border-l-2 [&_blockquote]:border-border [&_blockquote]:pl-4 [&_blockquote]:text-muted-foreground [&_a]:text-primary [&_a]:underline [&_a]:underline-offset-4 [&_code]:rounded-md [&_code]:bg-muted [&_code]:px-1.5 [&_code]:py-0.5 [&_code]:font-normal [&_pre]:my-3 [&_pre]:rounded-xl [&_pre]:bg-muted [&_pre]:p-4 [&_pre_code]:bg-transparent [&_pre_code]:p-0 [&_hr]:my-4 [&_hr]:border-border';\n\nconst editingSurface = `${fieldSurface} ${focusRing} ${editorProse} min-h-32 w-full px-4 py-3 selection:bg-primary selection:text-primary-foreground`;\n\nfunction read(\n editor: { getHTML: () => string; getJSON: () => JSONContent },\n output: EditorOutput,\n): EditorDocument {\n return output === 'json' ? editor.getJSON() : editor.getHTML();\n}\n\nfunction isSameDocument(left: EditorDocument, right: EditorDocument): boolean {\n if (typeof left === 'string' && typeof right === 'string') {\n return left === right;\n }\n\n return JSON.stringify(left) === JSON.stringify(right);\n}\n\nexport function Editor({\n value,\n onChange,\n output = 'html',\n extensions,\n labels = editorLabels,\n placeholder,\n label,\n disabled = false,\n readOnly = false,\n className,\n children,\n slotName = 'editor',\n}: EditorProps & SlotNameProps) {\n const [revision, setRevision] = useState(0);\n const editable = !disabled && !readOnly;\n const emit = useRef(onChange as (next: EditorDocument) => void);\n emit.current = onChange as (next: EditorDocument) => void;\n const emitted = useRef<EditorDocument | null>(null);\n\n const extensionSet = useMemo(\n () => extensions ?? defaultEditorExtensions(),\n [extensions],\n );\n\n const editor = useEditor(\n {\n extensions: extensionSet,\n content: value,\n editable,\n immediatelyRender: false,\n editorProps: {\n attributes: {\n 'data-slot': 'editor-surface',\n role: 'textbox',\n 'aria-multiline': 'true',\n ...(label === undefined ? {} : { 'aria-label': label }),\n class: editingSurface,\n },\n },\n onUpdate: ({ editor: instance }) => {\n const next = read(instance, output);\n\n emitted.current = next;\n emit.current(next);\n },\n },\n [extensionSet],\n );\n\n useEffect(() => {\n if (editor === null) {\n return;\n }\n\n const rerender = () => setRevision((revision) => revision + 1);\n\n editor.on('transaction', rerender);\n\n return () => {\n editor.off('transaction', rerender);\n };\n }, [editor]);\n\n useEffect(() => {\n editor?.setEditable(editable, false);\n }, [editor, editable]);\n\n useEffect(() => {\n if (editor === null) {\n return;\n }\n\n const echoed =\n emitted.current !== null && isSameDocument(emitted.current, value);\n\n if (echoed || isSameDocument(read(editor, output), value)) {\n return;\n }\n\n emitted.current = null;\n editor.commands.setContent(value, { emitUpdate: false });\n }, [editor, value, output]);\n\n const context = useMemo<EditorContextValue | null>(\n () =>\n editor === null ? null : { editor, labels, editable, placeholder },\n [editor, labels, editable, placeholder, revision],\n );\n\n if (context === null) {\n return null;\n }\n\n return (\n <EditorContextProvider value={context}>\n <div\n data-disabled={disabled ? '' : undefined}\n data-readonly={readOnly ? '' : undefined}\n className={cn(\n 'gap-2 flex w-full flex-col data-disabled:opacity-50',\n className,\n )}\n data-slot={slotName}\n >\n {children}\n </div>\n </EditorContextProvider>\n );\n}\n","import { Link2 } from 'lucide-react';\nimport { useId, useState } from 'react';\n\nimport { Button } from '@/components/ui/button';\nimport {\n Dialog,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n} from '@/components/ui/dialog';\nimport { useEditorContext } from '@/components/ui/editor/context';\nimport { isSafeEditorUrl } from '@/components/ui/editor/extensions';\nimport { EditorControl } from '@/components/ui/editor/toolbar';\nimport { Input } from '@/components/ui/input';\nimport { Label } from '@/components/ui/label';\nimport type { SlotNameProps } from '@/types';\n\nexport interface EditorLinkProps {\n label?: string;\n className?: string;\n}\n\nexport function EditorLink({\n label,\n className,\n slotName = 'editor-link-dialog',\n}: EditorLinkProps & SlotNameProps) {\n const { editor, labels, editable } = useEditorContext();\n const [open, setOpen] = useState(false);\n const [href, setHref] = useState('');\n const attached = editor.isActive('link');\n const fieldId = useId();\n\n function openDialog() {\n setHref(editor.getAttributes('link').href ?? '');\n setOpen(true);\n }\n\n function apply() {\n if (!isSafeEditorUrl(href)) {\n return;\n }\n\n editor\n .chain()\n .focus()\n .extendMarkRange('link')\n .setLink({ href: href.trim() })\n .run();\n\n setOpen(false);\n }\n\n function remove() {\n editor.chain().focus().extendMarkRange('link').unsetLink().run();\n setOpen(false);\n }\n\n return (\n <>\n <EditorControl\n label={label ?? labels.linkLabel}\n icon={Link2}\n pressed={attached}\n disabled={!editable}\n onActivate={openDialog}\n className={className}\n />\n <Dialog open={open} onOpenChange={setOpen}>\n <DialogContent slotName={slotName}>\n <DialogHeader>\n <DialogTitle>{labels.linkDialogTitle}</DialogTitle>\n <DialogDescription>\n {labels.linkDialogDescription}\n </DialogDescription>\n </DialogHeader>\n <div className=\"gap-2 flex flex-col\">\n <Label htmlFor={fieldId}>{labels.linkUrlLabel}</Label>\n <Input\n id={fieldId}\n slotName=\"editor-link-url\"\n value={href}\n placeholder={labels.linkUrlPlaceholder}\n onChange={(event) => setHref(event.target.value)}\n onKeyDown={(event) => {\n if (event.key === 'Enter') {\n event.preventDefault();\n apply();\n }\n }}\n />\n </div>\n <DialogFooter>\n {attached && (\n <Button\n type=\"button\"\n variant=\"ghost\"\n onClick={remove}\n >\n {labels.linkRemoveLabel}\n </Button>\n )}\n <Button\n type=\"button\"\n variant=\"outline\"\n onClick={() => setOpen(false)}\n >\n {labels.linkCancelLabel}\n </Button>\n <Button\n type=\"button\"\n onClick={apply}\n disabled={href.trim() === ''}\n >\n {labels.linkApplyLabel}\n </Button>\n </DialogFooter>\n </DialogContent>\n </Dialog>\n </>\n );\n}\n","import { EditorContent } from '@/components/ui/editor/content';\nimport {\n EditorBlockquote,\n EditorHeading,\n EditorHistory,\n EditorList,\n EditorMark,\n} from '@/components/ui/editor/controls';\nimport { Editor, type EditorProps } from '@/components/ui/editor/editor';\nimport { EditorLink } from '@/components/ui/editor/link';\nimport { EditorToolbar } from '@/components/ui/editor/toolbar';\nimport { Separator } from '@/components/ui/separator';\n\ntype WithoutChildren<T> = T extends unknown ? Omit<T, 'children'> : never;\n\nexport type RichTextEditorProps = WithoutChildren<EditorProps>;\n\nexport function RichTextEditor(props: RichTextEditorProps) {\n return (\n <Editor {...props}>\n <EditorToolbar>\n <EditorMark mark=\"bold\" />\n <EditorMark mark=\"italic\" />\n <EditorMark mark=\"strike\" />\n <Separator orientation=\"vertical\" className=\"mx-1 h-6\" />\n <EditorHeading level={2} />\n <EditorHeading level={3} />\n <Separator orientation=\"vertical\" className=\"mx-1 h-6\" />\n <EditorList variant=\"bullet\" />\n <EditorList variant=\"ordered\" />\n <EditorBlockquote />\n <EditorMark mark=\"code\" />\n <EditorLink />\n <Separator orientation=\"vertical\" className=\"mx-1 h-6\" />\n <EditorHistory action=\"undo\" />\n <EditorHistory action=\"redo\" />\n </EditorToolbar>\n <EditorContent />\n </Editor>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/components/ui/editor/context.tsx","../src/components/ui/editor/content.tsx","../src/components/ui/editor/toolbar.tsx","../src/components/ui/editor/controls.tsx","../src/components/ui/editor/extensions.ts","../src/components/ui/editor/labels.ts","../src/components/ui/editor/editor.tsx","../src/components/ui/editor/link.tsx","../src/components/ui/editor/rich-text-editor.tsx"],"names":["TiptapContent","jsx","revision","useState","jsxs"],"mappings":";;;;;;;;;;AAYA,IAAM,aAAA,GAAgB,cAAyC,IAAI,CAAA;AAE5D,IAAM,wBAAwB,aAAA,CAAc,QAAA;AAE5C,SAAS,gBAAA,GAAuC;AACnD,EAAA,MAAM,OAAA,GAAU,WAAW,aAAa,CAAA;AAExC,EAAA,IAAI,YAAY,IAAA,EAAM;AAClB,IAAA,MAAM,IAAI,MAAM,4CAA4C,CAAA;AAAA,EAChE;AAEA,EAAA,OAAO,OAAA;AACX;ACdO,SAAS,aAAA,CAAc;AAAA,EAC1B,SAAA;AAAA,EACA,QAAA,GAAW;AACf,CAAA,EAAuC;AACnC,EAAA,MAAM,EAAE,MAAA,EAAQ,WAAA,EAAY,GAAI,gBAAA,EAAiB;AAEjD,EAAA,uBACI,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACG,kBAAA,EAAkB,WAAA;AAAA,MAClB,YAAA,EAAY,MAAA,CAAO,OAAA,GAAU,EAAA,GAAK,MAAA;AAAA,MAClC,SAAA,EAAW,EAAA;AAAA,QACP,sRAAA;AAAA,QACA;AAAA,OACJ;AAAA,MACA,WAAA,EAAW,QAAA;AAAA,MAEX,QAAA,kBAAA,GAAA,CAACA,mBAAc,MAAA,EAAgB;AAAA;AAAA,GACnC;AAER;AChBO,SAAS,aAAA,CAAc;AAAA,EAC1B,QAAA;AAAA,EACA,SAAA;AAAA,EACA,QAAA,GAAW;AACf,CAAA,EAAuC;AACnC,EAAA,MAAM,EAAE,MAA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AA,CAAC,UAAA,EAAA,EAAW,IAAA,EAAK,QAAA,EAAS,CAAA;AAAA,sBAC1BA,GAAAA,CAAC,SAAA,EAAA,EAAU,WAAA,EAAY,UAAA,EAAW,WAAU,UAAA,EAAW,CAAA;AAAA,sBACvDA,GAAAA,CAAC,aAAA,EAAA,EAAc,KAAA,EAAO,CAAA,EAAG,CAAA;AAAA,sBACzBA,GAAAA,CAAC,aAAA,EAAA,EAAc,KAAA,EAAO,CAAA,EAAG,CAAA;AAAA,sBACzBA,GAAAA,CAAC,SAAA,EAAA,EAAU,WAAA,EAAY,UAAA,EAAW,WAAU,UAAA,EAAW,CAAA;AAAA,sBACvDA,GAAAA,CAAC,UAAA,EAAA,EAAW,OAAA,EAAQ,QAAA,EAAS,CAAA;AAAA,sBAC7BA,GAAAA,CAAC,UAAA,EAAA,EAAW,OAAA,EAAQ,SAAA,EAAU,CAAA;AAAA,sBAC9BA,IAAC,gBAAA,EAAA,EAAiB,CAAA;AAAA,sBAClBA,GAAAA,CAAC,UAAA,EAAA,EAAW,IAAA,EAAK,MAAA,EAAO,CAAA;AAAA,sBACxBA,IAAC,UAAA,EAAA,EAAW,CAAA;AAAA,sBACZA,GAAAA,CAAC,SAAA,EAAA,EAAU,WAAA,EAAY,UAAA,EAAW,WAAU,UAAA,EAAW,CAAA;AAAA,sBACvDA,GAAAA,CAAC,aAAA,EAAA,EAAc,MAAA,EAAO,MAAA,EAAO,CAAA;AAAA,sBAC7BA,GAAAA,CAAC,aAAA,EAAA,EAAc,MAAA,EAAO,MAAA,EAAO;AAAA,KAAA,EACjC,CAAA;AAAA,oBACAA,IAAC,aAAA,EAAA,EAAc;AAAA,GAAA,EACnB,CAAA;AAER","file":"editor.js","sourcesContent":["import type { Editor as TiptapEditor } from '@tiptap/core';\nimport { createContext, useContext } from 'react';\n\nimport type { EditorLabels } from '@/components/ui/editor/labels';\n\nexport interface EditorContextValue {\n editor: TiptapEditor;\n labels: EditorLabels;\n editable: boolean;\n placeholder?: string;\n}\n\nconst EditorContext = createContext<EditorContextValue | null>(null);\n\nexport const EditorContextProvider = EditorContext.Provider;\n\nexport function useEditorContext(): EditorContextValue {\n const context = useContext(EditorContext);\n\n if (context === null) {\n throw new Error('Editor parts must be used inside <Editor>.');\n }\n\n return context;\n}\n","import { EditorContent as TiptapContent } from '@tiptap/react';\n\nimport { useEditorContext } from '@/components/ui/editor/context';\nimport { cn } from '@/lib/utils';\nimport type { SlotNameProps } from '@/types';\n\nexport interface EditorContentProps {\n className?: string;\n}\n\nexport function EditorContent({\n className,\n slotName = 'editor-content',\n}: EditorContentProps & SlotNameProps) {\n const { editor, placeholder } = useEditorContext();\n\n return (\n <div\n data-placeholder={placeholder}\n data-empty={editor.isEmpty ? '' : undefined}\n className={cn(\n 'data-empty:before:top-3 data-empty:before:left-4 data-empty:before:text-sm data-empty:before:font-medium relative w-full data-empty:before:pointer-events-none data-empty:before:absolute data-empty:before:text-muted-foreground data-empty:before:content-[attr(data-placeholder)]',\n className,\n )}\n data-slot={slotName}\n >\n <TiptapContent editor={editor} />\n </div>\n );\n}\n","import type { LucideIcon } from 'lucide-react';\nimport type { ReactNode } from 'react';\n\nimport { useEditorContext } from '@/components/ui/editor/context';\nimport { Toggle } from '@/components/ui/toggle';\nimport { cn } from '@/lib/utils';\nimport type { SlotNameProps } from '@/types';\n\nexport interface EditorToolbarProps {\n children: ReactNode;\n className?: string;\n}\n\nexport function EditorToolbar({\n children,\n className,\n slotName = 'editor-toolbar',\n}: EditorToolbarProps & SlotNameProps) {\n const { labels } = useEditorContext();\n\n return (\n <div\n role=\"toolbar\"\n aria-label={labels.toolbarLabel}\n aria-orientation=\"horizontal\"\n className={cn('gap-1 flex flex-wrap items-center', className)}\n data-slot={slotName}\n >\n {children}\n </div>\n );\n}\n\nexport interface EditorControlProps {\n label: string;\n icon: LucideIcon;\n pressed?: boolean;\n disabled?: boolean;\n onActivate: () => void;\n className?: string;\n}\n\nexport function EditorControl({\n label,\n icon: Icon,\n pressed = false,\n disabled = false,\n onActivate,\n className,\n slotName = 'editor-control',\n}: EditorControlProps & SlotNameProps) {\n const { editable } = useEditorContext();\n\n return (\n <Toggle\n size=\"sm\"\n aria-label={label}\n title={label}\n pressed={pressed}\n disabled={disabled || !editable}\n onPressedChange={onActivate}\n className={className}\n slotName={slotName}\n >\n <Icon aria-hidden=\"true\" />\n </Toggle>\n );\n}\n","import {\n Bold,\n Code,\n Heading1,\n Heading2,\n Heading3,\n Heading4,\n Heading5,\n Heading6,\n Italic,\n List,\n ListOrdered,\n Quote,\n Redo2,\n Strikethrough,\n Undo2,\n type LucideIcon,\n} from 'lucide-react';\n\nimport { Button } from '@/components/ui/button';\nimport { useEditorContext } from '@/components/ui/editor/context';\nimport { EditorControl } from '@/components/ui/editor/toolbar';\nimport type { SlotNameProps } from '@/types';\n\nexport type EditorMarkName = 'bold' | 'italic' | 'strike' | 'code';\n\nconst MARK_ICONS: Record<EditorMarkName, LucideIcon> = {\n bold: Bold,\n italic: Italic,\n strike: Strikethrough,\n code: Code,\n};\n\nexport interface EditorMarkProps {\n mark: EditorMarkName;\n label?: string;\n className?: string;\n}\n\nexport function EditorMark({ mark, label, className }: EditorMarkProps) {\n const { editor, labels } = useEditorContext();\n\n const names: Record<EditorMarkName, string> = {\n bold: labels.boldLabel,\n italic: labels.italicLabel,\n strike: labels.strikeLabel,\n code: labels.codeLabel,\n };\n\n return (\n <EditorControl\n label={label ?? names[mark]}\n icon={MARK_ICONS[mark]}\n pressed={editor.isActive(mark)}\n disabled={!editor.can().toggleMark(mark)}\n onActivate={() => editor.chain().focus().toggleMark(mark).run()}\n className={className}\n />\n );\n}\n\nconst HEADING_ICONS: Record<number, LucideIcon> = {\n 1: Heading1,\n 2: Heading2,\n 3: Heading3,\n 4: Heading4,\n 5: Heading5,\n 6: Heading6,\n};\n\nexport interface EditorHeadingProps {\n level: 1 | 2 | 3 | 4 | 5 | 6;\n label?: string;\n className?: string;\n}\n\nexport function EditorHeading({ level, label, className }: EditorHeadingProps) {\n const { editor, labels } = useEditorContext();\n\n return (\n <EditorControl\n label={label ?? labels.headingLabel(level)}\n icon={HEADING_ICONS[level]}\n pressed={editor.isActive('heading', { level })}\n disabled={\n !editor.can().toggleNode('heading', 'paragraph', { level })\n }\n onActivate={() =>\n editor.chain().focus().toggleHeading({ level }).run()\n }\n className={className}\n />\n );\n}\n\nexport type EditorListVariant = 'bullet' | 'ordered';\n\nexport interface EditorListProps {\n variant: EditorListVariant;\n label?: string;\n className?: string;\n}\n\nexport function EditorList({ variant, label, className }: EditorListProps) {\n const { editor, labels } = useEditorContext();\n const name = variant === 'bullet' ? 'bulletList' : 'orderedList';\n\n return (\n <EditorControl\n label={\n label ??\n (variant === 'bullet'\n ? labels.bulletListLabel\n : labels.orderedListLabel)\n }\n icon={variant === 'bullet' ? List : ListOrdered}\n pressed={editor.isActive(name)}\n disabled={!editor.can().toggleList(name, 'listItem')}\n onActivate={() =>\n variant === 'bullet'\n ? editor.chain().focus().toggleBulletList().run()\n : editor.chain().focus().toggleOrderedList().run()\n }\n className={className}\n />\n );\n}\n\nexport interface EditorBlockquoteProps {\n label?: string;\n className?: string;\n}\n\nexport function EditorBlockquote({ label, className }: EditorBlockquoteProps) {\n const { editor, labels } = useEditorContext();\n\n return (\n <EditorControl\n label={label ?? labels.blockquoteLabel}\n icon={Quote}\n pressed={editor.isActive('blockquote')}\n disabled={!editor.can().toggleWrap('blockquote')}\n onActivate={() => editor.chain().focus().toggleBlockquote().run()}\n className={className}\n />\n );\n}\n\nexport type EditorHistoryAction = 'undo' | 'redo';\n\nexport interface EditorHistoryProps {\n action: EditorHistoryAction;\n label?: string;\n className?: string;\n}\n\nexport function EditorHistory({\n action,\n label,\n className,\n slotName = 'editor-history',\n}: EditorHistoryProps & SlotNameProps) {\n const { editor, labels, editable } = useEditorContext();\n const undoing = action === 'undo';\n const available = undoing ? editor.can().undo() : editor.can().redo();\n const Icon = undoing ? Undo2 : Redo2;\n\n return (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-sm\"\n aria-label={\n label ?? (undoing ? labels.undoLabel : labels.redoLabel)\n }\n title={label ?? (undoing ? labels.undoLabel : labels.redoLabel)}\n disabled={!available || !editable}\n onClick={() =>\n undoing\n ? editor.chain().focus().undo().run()\n : editor.chain().focus().redo().run()\n }\n className={className}\n slotName={slotName}\n >\n <Icon aria-hidden=\"true\" />\n </Button>\n );\n}\n","import type { Extensions } from '@tiptap/core';\nimport StarterKit from '@tiptap/starter-kit';\n\nconst SAFE_PROTOCOLS = ['http', 'https', 'mailto', 'tel'];\n\nexport function isSafeEditorUrl(url: string): boolean {\n const protocol = /^([a-z][a-z0-9+.-]*):/i.exec(url.trim())?.[1];\n\n return (\n protocol === undefined ||\n SAFE_PROTOCOLS.includes(protocol.toLowerCase())\n );\n}\n\nexport function defaultEditorExtensions(): Extensions {\n return [\n StarterKit.configure({\n link: {\n openOnClick: false,\n autolink: true,\n protocols: SAFE_PROTOCOLS,\n isAllowedUri: (url) => isSafeEditorUrl(url),\n HTMLAttributes: {\n rel: 'noopener noreferrer nofollow',\n target: '_blank',\n },\n },\n }),\n ];\n}\n","export interface EditorLabels {\n toolbarLabel: string;\n boldLabel: string;\n italicLabel: string;\n strikeLabel: string;\n codeLabel: string;\n headingLabel: (level: number) => string;\n bulletListLabel: string;\n orderedListLabel: string;\n blockquoteLabel: string;\n undoLabel: string;\n redoLabel: string;\n linkLabel: string;\n linkDialogTitle: string;\n linkDialogDescription: string;\n linkUrlLabel: string;\n linkUrlPlaceholder: string;\n linkApplyLabel: string;\n linkRemoveLabel: string;\n linkCancelLabel: string;\n}\n\nexport const editorLabels: EditorLabels = {\n toolbarLabel: 'Formatting',\n boldLabel: 'Bold',\n italicLabel: 'Italic',\n strikeLabel: 'Strikethrough',\n codeLabel: 'Code',\n headingLabel: (level) => `Heading ${level}`,\n bulletListLabel: 'Bullet list',\n orderedListLabel: 'Numbered list',\n blockquoteLabel: 'Quote',\n undoLabel: 'Undo',\n redoLabel: 'Redo',\n linkLabel: 'Link',\n linkDialogTitle: 'Link',\n linkDialogDescription: 'Point the selected text at an address.',\n linkUrlLabel: 'Address',\n linkUrlPlaceholder: 'https://example.com',\n linkApplyLabel: 'Apply',\n linkRemoveLabel: 'Remove',\n linkCancelLabel: 'Cancel',\n};\n","import type { Extensions, JSONContent } from '@tiptap/core';\nimport { useEditor } from '@tiptap/react';\nimport { useEffect, useMemo, useRef, useState, type ReactNode } from 'react';\n\nimport {\n EditorContextProvider,\n type EditorContextValue,\n} from '@/components/ui/editor/context';\nimport { defaultEditorExtensions } from '@/components/ui/editor/extensions';\nimport { editorLabels, type EditorLabels } from '@/components/ui/editor/labels';\nimport { fieldSurface, focusRing } from '@/lib/language';\nimport { cn } from '@/lib/utils';\nimport type { SlotNameProps } from '@/types';\n\nexport type EditorOutput = 'html' | 'json';\n\nexport type EditorDocument = string | JSONContent;\n\ninterface EditorSharedProps {\n extensions?: Extensions;\n labels?: EditorLabels;\n placeholder?: string;\n label?: string;\n disabled?: boolean;\n readOnly?: boolean;\n className?: string;\n children: ReactNode;\n}\n\nexport type EditorProps = EditorSharedProps &\n (\n | {\n output?: 'html';\n value: string;\n onChange: (value: string) => void;\n }\n | {\n output: 'json';\n value: JSONContent;\n onChange: (value: JSONContent) => void;\n }\n );\n\nconst editorProse =\n 'text-sm font-medium leading-relaxed [&_p]:my-2 [&_h1]:mt-4 [&_h1]:mb-2 [&_h1]:text-2xl [&_h1]:font-bold [&_h2]:mt-4 [&_h2]:mb-2 [&_h2]:text-xl [&_h2]:font-bold [&_h3]:mt-3 [&_h3]:mb-2 [&_h3]:text-lg [&_h3]:font-semibold [&_ul]:my-2 [&_ul]:list-disc [&_ul]:pl-6 [&_ol]:my-2 [&_ol]:list-decimal [&_ol]:pl-6 [&_li]:my-1 [&_blockquote]:my-3 [&_blockquote]:border-l-2 [&_blockquote]:border-border [&_blockquote]:pl-4 [&_blockquote]:text-muted-foreground [&_a]:text-primary [&_a]:underline [&_a]:underline-offset-4 [&_code]:rounded-md [&_code]:bg-muted [&_code]:px-1.5 [&_code]:py-0.5 [&_code]:font-normal [&_pre]:my-3 [&_pre]:rounded-xl [&_pre]:bg-muted [&_pre]:p-4 [&_pre_code]:bg-transparent [&_pre_code]:p-0 [&_hr]:my-4 [&_hr]:border-border';\n\nconst editingSurface = `${fieldSurface} ${focusRing} ${editorProse} min-h-32 w-full px-4 py-3 selection:bg-primary selection:text-primary-foreground`;\n\nfunction read(\n editor: { getHTML: () => string; getJSON: () => JSONContent },\n output: EditorOutput,\n): EditorDocument {\n return output === 'json' ? editor.getJSON() : editor.getHTML();\n}\n\nfunction isSameDocument(left: EditorDocument, right: EditorDocument): boolean {\n if (typeof left === 'string' && typeof right === 'string') {\n return left === right;\n }\n\n return JSON.stringify(left) === JSON.stringify(right);\n}\n\nexport function Editor({\n value,\n onChange,\n output = 'html',\n extensions,\n labels = editorLabels,\n placeholder,\n label,\n disabled = false,\n readOnly = false,\n className,\n children,\n slotName = 'editor',\n}: EditorProps & SlotNameProps) {\n const [revision, setRevision] = useState(0);\n const editable = !disabled && !readOnly;\n const emit = useRef(onChange as (next: EditorDocument) => void);\n emit.current = onChange as (next: EditorDocument) => void;\n const emitted = useRef<EditorDocument | null>(null);\n\n const extensionSet = useMemo(\n () => extensions ?? defaultEditorExtensions(),\n [extensions],\n );\n\n const editor = useEditor(\n {\n extensions: extensionSet,\n content: value,\n editable,\n immediatelyRender: false,\n editorProps: {\n attributes: {\n 'data-slot': 'editor-surface',\n role: 'textbox',\n 'aria-multiline': 'true',\n ...(label === undefined ? {} : { 'aria-label': label }),\n class: editingSurface,\n },\n },\n onUpdate: ({ editor: instance }) => {\n const next = read(instance, output);\n\n emitted.current = next;\n emit.current(next);\n },\n },\n [extensionSet],\n );\n\n useEffect(() => {\n if (editor === null) {\n return;\n }\n\n const rerender = () => setRevision((revision) => revision + 1);\n\n editor.on('transaction', rerender);\n\n return () => {\n editor.off('transaction', rerender);\n };\n }, [editor]);\n\n useEffect(() => {\n editor?.setEditable(editable, false);\n }, [editor, editable]);\n\n useEffect(() => {\n if (editor === null) {\n return;\n }\n\n const echoed =\n emitted.current !== null && isSameDocument(emitted.current, value);\n\n if (echoed || isSameDocument(read(editor, output), value)) {\n return;\n }\n\n emitted.current = null;\n editor.commands.setContent(value, { emitUpdate: false });\n }, [editor, value, output]);\n\n const context = useMemo<EditorContextValue | null>(\n () =>\n editor === null ? null : { editor, labels, editable, placeholder },\n [editor, labels, editable, placeholder, revision],\n );\n\n if (context === null) {\n return null;\n }\n\n return (\n <EditorContextProvider value={context}>\n <div\n data-disabled={disabled ? '' : undefined}\n data-readonly={readOnly ? '' : undefined}\n className={cn(\n 'gap-2 flex w-full flex-col data-disabled:opacity-50',\n className,\n )}\n data-slot={slotName}\n >\n {children}\n </div>\n </EditorContextProvider>\n );\n}\n","import { Link2 } from 'lucide-react';\nimport { useId, useState } from 'react';\n\nimport { Button } from '@/components/ui/button';\nimport {\n Dialog,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n} from '@/components/ui/dialog';\nimport { useEditorContext } from '@/components/ui/editor/context';\nimport { isSafeEditorUrl } from '@/components/ui/editor/extensions';\nimport { EditorControl } from '@/components/ui/editor/toolbar';\nimport { Input } from '@/components/ui/input';\nimport { Label } from '@/components/ui/label';\nimport type { SlotNameProps } from '@/types';\n\nexport interface EditorLinkProps {\n label?: string;\n className?: string;\n}\n\nexport function EditorLink({\n label,\n className,\n slotName = 'editor-link-dialog',\n}: EditorLinkProps & SlotNameProps) {\n const { editor, labels, editable } = useEditorContext();\n const [open, setOpen] = useState(false);\n const [href, setHref] = useState('');\n const attached = editor.isActive('link');\n const fieldId = useId();\n\n function openDialog() {\n setHref(editor.getAttributes('link').href ?? '');\n setOpen(true);\n }\n\n function apply() {\n if (!isSafeEditorUrl(href)) {\n return;\n }\n\n editor\n .chain()\n .focus()\n .extendMarkRange('link')\n .setLink({ href: href.trim() })\n .run();\n\n setOpen(false);\n }\n\n function remove() {\n editor.chain().focus().extendMarkRange('link').unsetLink().run();\n setOpen(false);\n }\n\n return (\n <>\n <EditorControl\n label={label ?? labels.linkLabel}\n icon={Link2}\n pressed={attached}\n disabled={!editable}\n onActivate={openDialog}\n className={className}\n />\n <Dialog open={open} onOpenChange={setOpen}>\n <DialogContent slotName={slotName}>\n <DialogHeader>\n <DialogTitle>{labels.linkDialogTitle}</DialogTitle>\n <DialogDescription>\n {labels.linkDialogDescription}\n </DialogDescription>\n </DialogHeader>\n <div className=\"gap-2 flex flex-col\">\n <Label htmlFor={fieldId}>{labels.linkUrlLabel}</Label>\n <Input\n id={fieldId}\n slotName=\"editor-link-url\"\n value={href}\n placeholder={labels.linkUrlPlaceholder}\n onChange={(event) => setHref(event.target.value)}\n onKeyDown={(event) => {\n if (event.key === 'Enter') {\n event.preventDefault();\n apply();\n }\n }}\n />\n </div>\n <DialogFooter>\n {attached && (\n <Button\n type=\"button\"\n variant=\"ghost\"\n onClick={remove}\n >\n {labels.linkRemoveLabel}\n </Button>\n )}\n <Button\n type=\"button\"\n variant=\"outline\"\n onClick={() => setOpen(false)}\n >\n {labels.linkCancelLabel}\n </Button>\n <Button\n type=\"button\"\n onClick={apply}\n disabled={href.trim() === ''}\n >\n {labels.linkApplyLabel}\n </Button>\n </DialogFooter>\n </DialogContent>\n </Dialog>\n </>\n );\n}\n","import { EditorContent } from '@/components/ui/editor/content';\nimport {\n EditorBlockquote,\n EditorHeading,\n EditorHistory,\n EditorList,\n EditorMark,\n} from '@/components/ui/editor/controls';\nimport { Editor, type EditorProps } from '@/components/ui/editor/editor';\nimport { EditorLink } from '@/components/ui/editor/link';\nimport { EditorToolbar } from '@/components/ui/editor/toolbar';\nimport { Separator } from '@/components/ui/separator';\n\ntype WithoutChildren<T> = T extends unknown ? Omit<T, 'children'> : never;\n\nexport type RichTextEditorProps = WithoutChildren<EditorProps>;\n\nexport function RichTextEditor(props: RichTextEditorProps) {\n return (\n <Editor {...props}>\n <EditorToolbar>\n <EditorMark mark=\"bold\" />\n <EditorMark mark=\"italic\" />\n <EditorMark mark=\"strike\" />\n <Separator orientation=\"vertical\" className=\"mx-1 h-6\" />\n <EditorHeading level={2} />\n <EditorHeading level={3} />\n <Separator orientation=\"vertical\" className=\"mx-1 h-6\" />\n <EditorList variant=\"bullet\" />\n <EditorList variant=\"ordered\" />\n <EditorBlockquote />\n <EditorMark mark=\"code\" />\n <EditorLink />\n <Separator orientation=\"vertical\" className=\"mx-1 h-6\" />\n <EditorHistory action=\"undo\" />\n <EditorHistory action=\"redo\" />\n </EditorToolbar>\n <EditorContent />\n </Editor>\n );\n}\n"]}
|
|
@@ -2,7 +2,6 @@ import { Slot } from '@radix-ui/react-slot';
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
4
4
|
import { S as SlotNameProps } from './types-cmBL8zOc.js';
|
|
5
|
-
import { I as Input } from './input-Dpi7pXeR.js';
|
|
6
5
|
|
|
7
6
|
type FieldOrientation = 'vertical' | 'horizontal';
|
|
8
7
|
interface FieldContextValue {
|
|
@@ -37,15 +36,4 @@ declare function FieldLabel({ className, children, requiredLabel, slotName, ...p
|
|
|
37
36
|
declare function FieldDescription({ className, slotName, ...props }: React.ComponentProps<'p'> & SlotNameProps): React.JSX.Element;
|
|
38
37
|
declare function FieldControl({ className, ...props }: React.ComponentProps<typeof Slot>): React.JSX.Element;
|
|
39
38
|
|
|
40
|
-
|
|
41
|
-
showLabel: string;
|
|
42
|
-
hideLabel: string;
|
|
43
|
-
}
|
|
44
|
-
interface PasswordInputProps extends Omit<React.ComponentProps<typeof Input>, 'type'> {
|
|
45
|
-
revealable?: boolean;
|
|
46
|
-
showLabel?: PasswordInputLabels['showLabel'];
|
|
47
|
-
hideLabel?: PasswordInputLabels['hideLabel'];
|
|
48
|
-
}
|
|
49
|
-
declare function PasswordInput({ className, revealable, showLabel, hideLabel, slotName, ...props }: PasswordInputProps & SlotNameProps): React.JSX.Element;
|
|
50
|
-
|
|
51
|
-
export { Field as F, Label as L, PasswordInput as P, type FieldContextValue as a, FieldControl as b, FieldDescription as c, FieldGroup as d, FieldLabel as e, type FieldLabels as f, type FieldOrientation as g, type PasswordInputLabels as h, useField as u };
|
|
39
|
+
export { Field as F, Label as L, type FieldContextValue as a, FieldControl as b, FieldDescription as c, FieldGroup as d, FieldLabel as e, type FieldLabels as f, type FieldOrientation as g, useField as u };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { ClassValue } from 'clsx';
|
|
2
|
-
import {
|
|
3
|
-
export { c as controlFill, e as elevatedSurface, f as focusRing, m as menuHighlight, n as nestedEdgeToEdge, a as nestedRadius, b as nestedSurfaceReset, r as recessedSurface, s as surface } from './language-
|
|
2
|
+
import { F as FlatSurfaceProps } from './language-Cv_N_53L.js';
|
|
3
|
+
export { S as SurfaceProps, c as controlFill, e as elevatedSurface, f as focusRing, m as menuHighlight, n as nestedEdgeToEdge, a as nestedRadius, b as nestedSurfaceReset, r as recessedSurface, s as surface } from './language-Cv_N_53L.js';
|
|
4
4
|
import * as React$1 from 'react';
|
|
5
5
|
import { ReactNode } from 'react';
|
|
6
6
|
import * as AccordionPrimitive from '@radix-ui/react-accordion';
|
|
7
7
|
import { S as SlotNameProps, I as IconComponent } from './types-cmBL8zOc.js';
|
|
8
8
|
export { C as Column, a as ColumnDef, F as FilterFn, L as LucideIcon, R as Row, T as TableInstance, U as UrlLike } from './types-cmBL8zOc.js';
|
|
9
|
-
import
|
|
10
|
-
|
|
9
|
+
import { F as FloatingSheetLabels } from './context-OwSoVEri.js';
|
|
10
|
+
export { B as Alert, E as AlertDescription, G as AlertLabels, H as AlertTitle, I as AppearanceToggle, J as AppearanceToggleLabels, K as AppearanceToggleProps, L as Combobox, M as ComboboxLabels, N as ComboboxOption, O as ComboboxProps, P as ConfirmDialog, Q as ConfirmDialogLabels, R as CopyButton, C as CopyButtonLabels, T as CopyButtonProps, V as DataTable, W as DataTableFacetedFilterLabels, X as DataTableFilter, Y as DataTableLabels, Z as DataTableRowAction, _ as DataTableServerFilter, $ as DatePicker, a0 as DatePickerLabels, a1 as DatePickerProps, a2 as DateRangeFilter, a3 as DateRangeFilterLabels, a4 as DateRangeFilterProps, a5 as FacetedFilter, a6 as PasswordInput, a7 as PasswordInputLabels, a8 as RowActionsMenu, a9 as SAVED_DURATION, aa as SaveStatus, ab as SaveStatusLabels, ac as SaveStatusProps, ad as SaveStatusState, ae as ServerFacetedFilter, U as UiLabelSections, v as UiLabels, w as UiLocaleProvider, af as alertDefaultLabels, ag as appearanceToggleDefaultLabels, ah as comboboxDefaultLabels, ai as confirmDialogDefaultLabels, aj as copyButtonLabels, ak as dataTableDefaultLabels, al as dataTableFacetedFilterDefaultLabels, am as datePickerDefaultLabels, an as dateRangeFilterDefaultLabels, ao as floatingSheetDefaultLabels, ap as passwordInputDefaultLabels, aq as saveStatusLabels, z as useUiLabels, A as useUiLocale } from './context-OwSoVEri.js';
|
|
11
11
|
import { AlertDialog as AlertDialog$1, AspectRatio as AspectRatio$1, Dialog as Dialog$1, ContextMenu as ContextMenu$1, HoverCard as HoverCard$1, Menubar as Menubar$1, Popover as Popover$1, Progress as Progress$1, RadioGroup as RadioGroup$1, Slider as Slider$1 } from 'radix-ui';
|
|
12
|
-
import { B as Button } from './
|
|
13
|
-
export { a as ButtonProps, b as buttonVariants } from './
|
|
14
|
-
import { F as FloatingSheetLabels } from './context-YWbxMH0C.js';
|
|
15
|
-
export { B as AppearanceToggle, E as AppearanceToggleLabels, G as AppearanceToggleProps, H as Combobox, I as ComboboxLabels, J as ComboboxOption, K as ComboboxProps, L as ConfirmDialog, M as ConfirmDialogLabels, N as CopyButton, C as CopyButtonLabels, O as CopyButtonProps, P as DataTable, Q as DataTableFacetedFilterLabels, R as DataTableFilter, T as DataTableLabels, V as DataTableRowAction, W as DataTableServerFilter, X as DatePicker, Y as DatePickerLabels, Z as DatePickerProps, _ as DateRangeFilter, $ as DateRangeFilterLabels, a0 as DateRangeFilterProps, a1 as FacetedFilter, a2 as RowActionsMenu, a3 as SAVED_DURATION, a4 as SaveStatus, a5 as SaveStatusLabels, a6 as SaveStatusProps, a7 as SaveStatusState, a8 as ServerFacetedFilter, U as UiLabelSections, v as UiLabels, w as UiLocaleProvider, a9 as appearanceToggleDefaultLabels, aa as comboboxDefaultLabels, ab as confirmDialogDefaultLabels, ac as copyButtonLabels, ad as dataTableDefaultLabels, ae as dataTableFacetedFilterDefaultLabels, af as datePickerDefaultLabels, ag as dateRangeFilterDefaultLabels, ah as floatingSheetDefaultLabels, ai as saveStatusLabels, z as useUiLabels, A as useUiLocale } from './context-YWbxMH0C.js';
|
|
12
|
+
import { B as Button } from './input-Dxnsxi-f.js';
|
|
13
|
+
export { a as ButtonProps, I as Input, b as buttonVariants } from './input-Dxnsxi-f.js';
|
|
16
14
|
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
15
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
16
|
+
import { VariantProps } from 'class-variance-authority';
|
|
17
17
|
import { DayPicker, DayButton } from 'react-day-picker';
|
|
18
18
|
import useEmblaCarousel, { UseEmblaCarouselType } from 'embla-carousel-react';
|
|
19
19
|
import * as RechartsPrimitive from 'recharts';
|
|
@@ -24,17 +24,16 @@ import { Command as Command$1 } from 'cmdk';
|
|
|
24
24
|
import { Drawer as Drawer$1 } from 'vaul';
|
|
25
25
|
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
26
26
|
import { LucideIcon } from 'lucide-react';
|
|
27
|
-
export { F as Field, a as FieldContextValue, b as FieldControl, c as FieldDescription, d as FieldGroup, e as FieldLabel, f as FieldLabels, g as FieldOrientation, L as Label,
|
|
27
|
+
export { F as Field, a as FieldContextValue, b as FieldControl, c as FieldDescription, d as FieldGroup, e as FieldLabel, f as FieldLabels, g as FieldOrientation, L as Label, u as useField } from './field-DWm5NXeV.js';
|
|
28
28
|
import * as react_hook_form from 'react-hook-form';
|
|
29
29
|
import { FieldValues, FieldPath, ControllerProps } from 'react-hook-form';
|
|
30
30
|
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
31
|
-
export { I as Input } from './input-Dpi7pXeR.js';
|
|
32
31
|
import * as input_otp from 'input-otp';
|
|
33
32
|
import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu';
|
|
34
33
|
import * as ResizablePrimitive from 'react-resizable-panels';
|
|
35
34
|
import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
|
|
36
35
|
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
37
|
-
export { S as Separator, a as Sidebar, b as SidebarContent, c as SidebarFooter, d as SidebarGroup, e as SidebarGroupAction, f as SidebarGroupContent, g as SidebarGroupLabel, h as SidebarHeader, i as SidebarInput, j as SidebarInset, k as SidebarMenu, l as SidebarMenuAction, m as SidebarMenuBadge, n as SidebarMenuButton, o as SidebarMenuItem, p as SidebarMenuSkeleton, q as SidebarMenuSub, r as SidebarMenuSubButton, s as SidebarMenuSubItem, t as SidebarProvider, u as SidebarRail, v as SidebarSeparator, w as SidebarTrigger, T as Tooltip, x as TooltipContent, y as TooltipProvider, z as TooltipTrigger, A as useSidebar } from './sidebar-
|
|
36
|
+
export { S as Separator, a as Sidebar, b as SidebarContent, c as SidebarFooter, d as SidebarGroup, e as SidebarGroupAction, f as SidebarGroupContent, g as SidebarGroupLabel, h as SidebarHeader, i as SidebarInput, j as SidebarInset, k as SidebarMenu, l as SidebarMenuAction, m as SidebarMenuBadge, n as SidebarMenuButton, o as SidebarMenuItem, p as SidebarMenuSkeleton, q as SidebarMenuSub, r as SidebarMenuSubButton, s as SidebarMenuSubItem, t as SidebarProvider, u as SidebarRail, v as SidebarSeparator, w as SidebarTrigger, T as Tooltip, x as TooltipContent, y as TooltipProvider, z as TooltipTrigger, A as useSidebar } from './sidebar-Bp6Q46j-.js';
|
|
38
37
|
import * as SheetPrimitive from '@radix-ui/react-dialog';
|
|
39
38
|
import { ToasterProps } from 'sonner';
|
|
40
39
|
export { toast } from 'sonner';
|
|
@@ -83,13 +82,6 @@ declare const AccordionItem: React$1.ForwardRefExoticComponent<Omit<AccordionPri
|
|
|
83
82
|
declare const AccordionTrigger: React$1.ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionTriggerProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & SlotNameProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
84
83
|
declare const AccordionContent: React$1.ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & SlotNameProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
85
84
|
|
|
86
|
-
declare const alertVariants: (props?: ({
|
|
87
|
-
variant?: "default" | "destructive" | null | undefined;
|
|
88
|
-
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
89
|
-
declare function Alert({ className, variant, slotName, ...props }: React$1.ComponentProps<'div'> & VariantProps<typeof alertVariants> & SlotNameProps): React$1.JSX.Element;
|
|
90
|
-
declare function AlertTitle({ className, slotName, ...props }: React$1.ComponentProps<'div'> & SlotNameProps): React$1.JSX.Element;
|
|
91
|
-
declare function AlertDescription({ className, slotName, ...props }: React$1.ComponentProps<'div'> & SlotNameProps): React$1.JSX.Element;
|
|
92
|
-
|
|
93
85
|
declare function AlertDialog({ slotName, ...props }: React$1.ComponentProps<typeof AlertDialog$1.Root> & SlotNameProps): React$1.JSX.Element;
|
|
94
86
|
declare function AlertDialogTrigger({ slotName, ...props }: React$1.ComponentProps<typeof AlertDialog$1.Trigger> & SlotNameProps): React$1.JSX.Element;
|
|
95
87
|
declare function AlertDialogPortal({ slotName, ...props }: React$1.ComponentProps<typeof AlertDialog$1.Portal> & SlotNameProps): React$1.JSX.Element;
|
|
@@ -134,12 +126,12 @@ declare function Calendar({ className, classNames, showOutsideDays, captionLayou
|
|
|
134
126
|
declare function CalendarDayButton({ className, day, modifiers, ...props }: React$1.ComponentProps<typeof DayButton>): React$1.JSX.Element;
|
|
135
127
|
|
|
136
128
|
declare const cardVariants: (props?: ({
|
|
137
|
-
variant?: "default" | "subtle" | "solid" | null | undefined;
|
|
129
|
+
variant?: "default" | "subtle" | "solid" | "outlined" | null | undefined;
|
|
138
130
|
interactive?: boolean | null | undefined;
|
|
139
131
|
padding?: "sm" | "lg" | "none" | "md" | null | undefined;
|
|
140
132
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
141
|
-
type CardProps = React$1.ComponentProps<'div'> & VariantProps<typeof cardVariants> &
|
|
142
|
-
declare function Card({ className, variant, interactive, padding, inset, slotName, ...props }: CardProps & SlotNameProps): React$1.JSX.Element;
|
|
133
|
+
type CardProps = React$1.ComponentProps<'div'> & VariantProps<typeof cardVariants> & FlatSurfaceProps;
|
|
134
|
+
declare function Card({ className, variant, interactive, padding, inset, flat, slotName, ...props }: CardProps & SlotNameProps): React$1.JSX.Element;
|
|
143
135
|
declare function CardHeader({ className, slotName, ...props }: React$1.ComponentProps<'div'> & SlotNameProps): React$1.JSX.Element;
|
|
144
136
|
declare function CardTitle({ className, slotName, ...props }: React$1.ComponentProps<'div'> & SlotNameProps): React$1.JSX.Element;
|
|
145
137
|
declare function CardDescription({ className, slotName, ...props }: React$1.ComponentProps<'div'> & SlotNameProps): React$1.JSX.Element;
|
|
@@ -504,7 +496,7 @@ interface SpinnerProps extends React$1.ComponentProps<'span'>, VariantProps<type
|
|
|
504
496
|
declare function Spinner({ className, label, size, slotName, ...props }: SpinnerProps & SlotNameProps): React$1.JSX.Element;
|
|
505
497
|
|
|
506
498
|
declare const statusBadgeVariants: (props?: ({
|
|
507
|
-
status?: "
|
|
499
|
+
status?: "warning" | "info" | "neutral" | "success" | "danger" | null | undefined;
|
|
508
500
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
509
501
|
type StatusBadgeStatus = NonNullable<VariantProps<typeof statusBadgeVariants>['status']>;
|
|
510
502
|
interface StatusBadgeProps extends Omit<React$1.ComponentProps<typeof Badge>, 'variant'>, VariantProps<typeof statusBadgeVariants> {
|
|
@@ -547,4 +539,4 @@ declare function Toggle({ className, variant, size, slotName, ...props }: React$
|
|
|
547
539
|
declare function ToggleGroup({ className, variant, size, children, slotName, ...props }: React$1.ComponentProps<typeof ToggleGroupPrimitive.Root> & VariantProps<typeof toggleVariants> & SlotNameProps): React$1.JSX.Element;
|
|
548
540
|
declare function ToggleGroupItem({ className, children, variant, size, slotName, ...props }: React$1.ComponentProps<typeof ToggleGroupPrimitive.Item> & VariantProps<typeof toggleVariants> & SlotNameProps): React$1.JSX.Element;
|
|
549
541
|
|
|
550
|
-
export { AUTOSAVE_DELAY, Accordion, AccordionContent, AccordionItem, AccordionTrigger,
|
|
542
|
+
export { AUTOSAVE_DELAY, Accordion, AccordionContent, AccordionItem, AccordionTrigger, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AspectRatio, type AutosaveStatus, Avatar, AvatarFallback, AvatarImage, Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Calendar, CalendarDayButton, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, type CarouselApi, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, type ChartConfig, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, type EmptyStateLabels, type EmptyStateProps, FieldError, FloatingSheet, FloatingSheetBody, FloatingSheetFooter, FloatingSheetLabels, FloatingSheetStack, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, HoverCard, HoverCardContent, HoverCardTrigger, Icon, IconComponent, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, PlaceholderPattern, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Progress, RadioGroup, RadioGroupItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Skeleton, Slider, SlotNameProps, Spinner, type SpinnerProps, StatusBadge, type StatusBadgeProps, type StatusBadgeStatus, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, TextLink, type TextLinkProps, Textarea, Toaster, Toggle, ToggleGroup, ToggleGroupItem, type UseAutosaveOptions, type UseAutosaveResult, type UseConfirmDialogOptions, badgeVariants, cardVariants, cn, emptyStateLabels, navigationMenuTriggerStyle, spinnerVariants, statusBadgeVariants, textLinkVariants, toggleVariants, useAutosave, useConfirmDialog, useFormField };
|
package/dist/index.js
CHANGED
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
import { Popover, PopoverTrigger, PopoverContent, Command, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, Select, SelectTrigger, SelectContent, SelectItem, Calendar, FieldContext, FieldError, useField, ConfirmDialog } from './chunk-
|
|
2
|
-
export { Alert, AlertDescription, AlertTitle, Calendar, CalendarDayButton, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ConfirmDialog, FieldError, FloatingSheet, FloatingSheetBody, FloatingSheetFooter, FloatingSheetStack, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, confirmDialogDefaultLabels, floatingSheetDefaultLabels, useField } from './chunk-
|
|
3
|
-
export { CopyButton, copyButtonLabels } from './chunk-
|
|
4
|
-
import { toggleVariants } from './chunk-
|
|
5
|
-
export { Toggle, toggleVariants } from './chunk-
|
|
6
|
-
import { Label } from './chunk-
|
|
7
|
-
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Label } from './chunk-
|
|
1
|
+
import { Popover, PopoverTrigger, PopoverContent, Command, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, Select, SelectTrigger, SelectContent, SelectItem, Calendar, FieldContext, FieldError, useField, ConfirmDialog } from './chunk-7LBWPBVE.js';
|
|
2
|
+
export { Alert, AlertDescription, AlertTitle, Calendar, CalendarDayButton, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ConfirmDialog, FieldError, FloatingSheet, FloatingSheetBody, FloatingSheetFooter, FloatingSheetStack, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, alertDefaultLabels, confirmDialogDefaultLabels, floatingSheetDefaultLabels, useField } from './chunk-7LBWPBVE.js';
|
|
3
|
+
export { CopyButton, copyButtonLabels } from './chunk-MCMBS2SB.js';
|
|
4
|
+
import { toggleVariants } from './chunk-SBLZ6T3D.js';
|
|
5
|
+
export { Toggle, toggleVariants } from './chunk-SBLZ6T3D.js';
|
|
6
|
+
import { Label } from './chunk-O5DZTX7D.js';
|
|
7
|
+
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Label } from './chunk-O5DZTX7D.js';
|
|
8
8
|
import { useAppearance } from './chunk-IQMRJXEO.js';
|
|
9
|
-
export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, cardVariants } from './chunk-
|
|
10
|
-
import { useUiLabels } from './chunk-
|
|
11
|
-
export { UiLocaleProvider, useUiLabels, useUiLocale } from './chunk-
|
|
12
|
-
import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuItem } from './chunk-
|
|
13
|
-
export { Avatar, AvatarFallback, AvatarImage, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Collapsible, CollapsibleContent, CollapsibleTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Icon, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, useSidebar } from './chunk-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
export { Button, Spinner, buttonVariants, cn, controlFill, elevatedSurface, focusRing, menuHighlight, nestedEdgeToEdge, nestedRadius, nestedSurfaceReset, recessedSurface, spinnerVariants, surface } from './chunk-ODYCBCKS.js';
|
|
9
|
+
export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, cardVariants } from './chunk-IE6VWUSB.js';
|
|
10
|
+
import { useUiLabels } from './chunk-QNF4LJVT.js';
|
|
11
|
+
export { UiLocaleProvider, useUiLabels, useUiLocale } from './chunk-QNF4LJVT.js';
|
|
12
|
+
import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuItem } from './chunk-PSJGAZIS.js';
|
|
13
|
+
export { Avatar, AvatarFallback, AvatarImage, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Collapsible, CollapsibleContent, CollapsibleTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Icon, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, useSidebar } from './chunk-PSJGAZIS.js';
|
|
14
|
+
import { Input } from './chunk-UTSTTTH5.js';
|
|
15
|
+
export { Input, Separator } from './chunk-UTSTTTH5.js';
|
|
16
|
+
import { cn, focusRing, nestedRadius, nestedSurfaceReset, nestedEdgeToEdge, elevatedSurface, modalSurface, Button, menuSurface, fieldFocus, fieldSurface, floatingSurface, panelSurface, buttonVariants, Spinner } from './chunk-I5UZAJB4.js';
|
|
17
|
+
export { Button, Spinner, buttonVariants, cn, controlFill, elevatedSurface, focusRing, menuHighlight, nestedEdgeToEdge, nestedRadius, nestedSurfaceReset, recessedSurface, spinnerVariants, surface } from './chunk-I5UZAJB4.js';
|
|
19
18
|
import * as React3 from 'react';
|
|
20
19
|
import { useState, useRef, useCallback, useEffect, useMemo, useId } from 'react';
|
|
21
20
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
@@ -552,13 +551,13 @@ function AspectRatio({
|
|
|
552
551
|
return /* @__PURE__ */ jsx(AspectRatio$1.Root, { ...props, "data-slot": slotName });
|
|
553
552
|
}
|
|
554
553
|
var badgeVariants = cva(
|
|
555
|
-
"inline-flex items-center justify-center rounded-full border px-2.5 py-1 text-xs font-semibold w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:
|
|
554
|
+
"inline-flex items-center justify-center rounded-full border px-2.5 py-1 text-xs font-semibold w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:outline-solid focus-visible:outline-1 focus-visible:outline-offset-0 focus-visible:outline-ring aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",
|
|
556
555
|
{
|
|
557
556
|
variants: {
|
|
558
557
|
variant: {
|
|
559
558
|
default: "border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
|
|
560
559
|
secondary: "border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
|
|
561
|
-
destructive: "border-transparent bg-destructive text-destructive-foreground [a&]:hover:bg-destructive/90 focus-visible:
|
|
560
|
+
destructive: "border-transparent bg-destructive text-destructive-foreground [a&]:hover:bg-destructive/90 focus-visible:outline-destructive",
|
|
562
561
|
outline: "text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"
|
|
563
562
|
}
|
|
564
563
|
},
|
|
@@ -1110,6 +1109,7 @@ function Combobox({
|
|
|
1110
1109
|
disabled,
|
|
1111
1110
|
className: cn(
|
|
1112
1111
|
"h-11 rounded-2xl w-full justify-between border-border bg-muted/40 hover:bg-muted disabled:cursor-not-allowed disabled:opacity-50",
|
|
1112
|
+
fieldFocus,
|
|
1113
1113
|
!selected && "text-muted-foreground",
|
|
1114
1114
|
invalid && "border-destructive ring-destructive",
|
|
1115
1115
|
className
|
|
@@ -1394,7 +1394,7 @@ function FilterPopover({
|
|
|
1394
1394
|
Button,
|
|
1395
1395
|
{
|
|
1396
1396
|
variant: "outline",
|
|
1397
|
-
className: "h-11 rounded-2xl border-dashed border-border",
|
|
1397
|
+
className: "h-11 pr-5 rounded-2xl border-dashed border-border",
|
|
1398
1398
|
slotName,
|
|
1399
1399
|
children: [
|
|
1400
1400
|
/* @__PURE__ */ jsx(PlusCircle, { className: "mr-2 size-4" }),
|
|
@@ -1856,7 +1856,7 @@ function DataTable({
|
|
|
1856
1856
|
value: serverSearch ? searchValue ?? "" : globalFilter,
|
|
1857
1857
|
onChange: (e) => serverSearch ? onSearchChange?.(e.target.value) : setGlobalFilter(e.target.value),
|
|
1858
1858
|
placeholder: labels.searchPlaceholder,
|
|
1859
|
-
className: `h-11 rounded-2xl pl-11 font-medium border-none bg-muted/50 focus:bg-muted
|
|
1859
|
+
className: `h-11 rounded-2xl pl-11 font-medium border-none bg-muted/50 focus:bg-muted`
|
|
1860
1860
|
}
|
|
1861
1861
|
)
|
|
1862
1862
|
] }),
|
|
@@ -2084,7 +2084,7 @@ var datePickerDefaultLabels = {
|
|
|
2084
2084
|
dateFormat: "dd MMM yy",
|
|
2085
2085
|
clearLabel: "Clear date"
|
|
2086
2086
|
};
|
|
2087
|
-
var triggerClasses = `h-11 px-4 text-sm font-medium flex w-full cursor-pointer items-center gap-2 text-left transition-all disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 ${fieldSurface} ${
|
|
2087
|
+
var triggerClasses = `h-11 px-4 text-sm font-medium flex w-full cursor-pointer items-center gap-2 text-left transition-all disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 ${fieldSurface} ${fieldFocus}`;
|
|
2088
2088
|
function boundaries(minDate, maxDate, disabledDays) {
|
|
2089
2089
|
const matchers = [];
|
|
2090
2090
|
if (minDate) {
|
|
@@ -2708,7 +2708,7 @@ function Menubar({
|
|
|
2708
2708
|
Menubar$1.Root,
|
|
2709
2709
|
{
|
|
2710
2710
|
className: cn(
|
|
2711
|
-
"h-9 gap-1 p-1 shadow-sm backdrop-blur-xl rounded-2xl flex items-center border border-border bg-card
|
|
2711
|
+
"h-9 gap-1 p-1 shadow-sm backdrop-blur-xl rounded-2xl flex items-center border border-border bg-card",
|
|
2712
2712
|
className
|
|
2713
2713
|
),
|
|
2714
2714
|
...props,
|
|
@@ -3000,7 +3000,7 @@ function NavigationMenuItem({
|
|
|
3000
3000
|
);
|
|
3001
3001
|
}
|
|
3002
3002
|
var navigationMenuTriggerStyle = cva(
|
|
3003
|
-
"group inline-flex h-11 w-max items-center justify-center rounded-xl bg-background px-4 text-sm font-medium data-[state=open]:font-semibold hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 data-[active=true]:bg-accent/50 data-[state=open]:bg-accent/50 data-[active=true]:text-accent-foreground transition-[color,box-shadow] outline-none focus-visible:
|
|
3003
|
+
"group inline-flex h-11 w-max items-center justify-center rounded-xl bg-background px-4 text-sm font-medium data-[state=open]:font-semibold hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 data-[active=true]:bg-accent/50 data-[state=open]:bg-accent/50 data-[active=true]:text-accent-foreground transition-[color,box-shadow] outline-none focus-visible:outline-solid focus-visible:outline-1 focus-visible:outline-offset-0 focus-visible:outline-ring"
|
|
3004
3004
|
);
|
|
3005
3005
|
function NavigationMenuTrigger({
|
|
3006
3006
|
className,
|
|
@@ -3080,7 +3080,7 @@ function NavigationMenuLink({
|
|
|
3080
3080
|
NavigationMenuPrimitive.Link,
|
|
3081
3081
|
{
|
|
3082
3082
|
className: cn(
|
|
3083
|
-
"gap-1 p-2 text-sm [&_svg:not([class*='size-'])]:size-4 rounded-xl data-[active=true]:font-semibold flex flex-col transition-[color,box-shadow] outline-none hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus-visible:
|
|
3083
|
+
"gap-1 p-2 text-sm [&_svg:not([class*='size-'])]:size-4 rounded-xl data-[active=true]:font-semibold flex flex-col transition-[color,box-shadow] outline-none hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus-visible:outline-1 focus-visible:outline-offset-0 focus-visible:outline-ring focus-visible:outline-solid data-[active=true]:bg-accent/50 data-[active=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground",
|
|
3084
3084
|
className
|
|
3085
3085
|
),
|
|
3086
3086
|
...props,
|
|
@@ -3224,14 +3224,22 @@ function PaginationEllipsis({
|
|
|
3224
3224
|
}
|
|
3225
3225
|
);
|
|
3226
3226
|
}
|
|
3227
|
+
var passwordInputDefaultLabels = {
|
|
3228
|
+
showLabel: "Show password",
|
|
3229
|
+
hideLabel: "Hide password"
|
|
3230
|
+
};
|
|
3227
3231
|
function PasswordInput({
|
|
3228
3232
|
className,
|
|
3229
3233
|
revealable = true,
|
|
3230
|
-
showLabel
|
|
3231
|
-
hideLabel
|
|
3234
|
+
showLabel,
|
|
3235
|
+
hideLabel,
|
|
3232
3236
|
slotName = "password-input",
|
|
3233
3237
|
...props
|
|
3234
3238
|
}) {
|
|
3239
|
+
const labels = useUiLabels("passwordInput", passwordInputDefaultLabels, {
|
|
3240
|
+
showLabel,
|
|
3241
|
+
hideLabel
|
|
3242
|
+
});
|
|
3235
3243
|
const [visible, setVisible] = React3.useState(false);
|
|
3236
3244
|
return /* @__PURE__ */ jsxs("div", { className: "relative w-full", "data-slot": slotName, children: [
|
|
3237
3245
|
/* @__PURE__ */ jsx(
|
|
@@ -3249,7 +3257,7 @@ function PasswordInput({
|
|
|
3249
3257
|
variant: "ghost",
|
|
3250
3258
|
size: "icon-sm",
|
|
3251
3259
|
slotName: "password-input-toggle",
|
|
3252
|
-
"aria-label": visible ? hideLabel : showLabel,
|
|
3260
|
+
"aria-label": visible ? labels.hideLabel : labels.showLabel,
|
|
3253
3261
|
"aria-pressed": visible,
|
|
3254
3262
|
disabled: props.disabled,
|
|
3255
3263
|
onMouseDown: (event) => event.preventDefault(),
|
|
@@ -3395,7 +3403,7 @@ function ResizableHandle({
|
|
|
3395
3403
|
ResizablePrimitive.Separator,
|
|
3396
3404
|
{
|
|
3397
3405
|
className: cn(
|
|
3398
|
-
"after:inset-y-0 after:w-1 aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:translate-x-0 relative flex w-px items-center justify-center bg-border after:absolute after:left-1/2 after:-translate-x-1/2 focus-visible:
|
|
3406
|
+
"after:inset-y-0 after:w-1 aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:translate-x-0 relative flex w-px items-center justify-center bg-border after:absolute after:left-1/2 after:-translate-x-1/2 focus-visible:outline-1 focus-visible:outline-offset-0 focus-visible:outline-ring focus-visible:outline-solid aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:-translate-y-1/2 [&[aria-orientation=horizontal]>div]:rotate-90",
|
|
3399
3407
|
className
|
|
3400
3408
|
),
|
|
3401
3409
|
...props,
|
|
@@ -3719,6 +3727,6 @@ function TextLink({
|
|
|
3719
3727
|
);
|
|
3720
3728
|
}
|
|
3721
3729
|
|
|
3722
|
-
export { AUTOSAVE_DELAY, Accordion, AccordionContent, AccordionItem, AccordionTrigger, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AppearanceToggle, AspectRatio, Badge, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Checkbox, Combobox, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, DataTable, DatePicker, DateRangeFilter, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, EmptyState, FacetedFilter, Field, FieldControl, FieldDescription, FieldGroup, FieldLabel, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, HoverCard, HoverCardContent, HoverCardTrigger, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, PasswordInput, PlaceholderPattern, Progress, RadioGroup, RadioGroupItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, RowActionsMenu, SAVED_DURATION, SaveStatus, ScrollArea, ScrollBar, ServerFacetedFilter, Slider, StatusBadge, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, TextLink, Toaster, ToggleGroup, ToggleGroupItem, appearanceToggleDefaultLabels, badgeVariants, comboboxDefaultLabels, dataTableDefaultLabels, dataTableFacetedFilterDefaultLabels, datePickerDefaultLabels, dateRangeFilterDefaultLabels, emptyStateLabels, navigationMenuTriggerStyle, saveStatusLabels, statusBadgeVariants, textLinkVariants, useAutosave, useConfirmDialog, useFormField };
|
|
3730
|
+
export { AUTOSAVE_DELAY, Accordion, AccordionContent, AccordionItem, AccordionTrigger, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AppearanceToggle, AspectRatio, Badge, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Checkbox, Combobox, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, DataTable, DatePicker, DateRangeFilter, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, EmptyState, FacetedFilter, Field, FieldControl, FieldDescription, FieldGroup, FieldLabel, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, HoverCard, HoverCardContent, HoverCardTrigger, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, PasswordInput, PlaceholderPattern, Progress, RadioGroup, RadioGroupItem, ResizableHandle, ResizablePanel, ResizablePanelGroup, RowActionsMenu, SAVED_DURATION, SaveStatus, ScrollArea, ScrollBar, ServerFacetedFilter, Slider, StatusBadge, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, TextLink, Toaster, ToggleGroup, ToggleGroupItem, appearanceToggleDefaultLabels, badgeVariants, comboboxDefaultLabels, dataTableDefaultLabels, dataTableFacetedFilterDefaultLabels, datePickerDefaultLabels, dateRangeFilterDefaultLabels, emptyStateLabels, navigationMenuTriggerStyle, passwordInputDefaultLabels, saveStatusLabels, statusBadgeVariants, textLinkVariants, useAutosave, useConfirmDialog, useFormField };
|
|
3723
3731
|
//# sourceMappingURL=index.js.map
|
|
3724
3732
|
//# sourceMappingURL=index.js.map
|