@bbki.ng/components 2.5.10 → 2.6.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/index.cjs +169 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +121 -14
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +35 -1
- package/dist/index.js +166 -12
- package/dist/index.js.map +1 -1
- package/package.json +9 -3
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,15 @@ import * as React from 'react';
|
|
|
2
2
|
import React__default, { FunctionComponent, EventHandler, ReactElement, CSSProperties, Ref, ReactNode } from 'react';
|
|
3
3
|
import { LinkProps as LinkProps$1 } from 'react-router-dom';
|
|
4
4
|
import * as ContextMenuPrimitive from '@radix-ui/react-context-menu';
|
|
5
|
+
import * as _radix_ui_react_slot from '@radix-ui/react-slot';
|
|
6
|
+
import * as react_hook_form from 'react-hook-form';
|
|
7
|
+
import { FieldValues, ControllerProps } from 'react-hook-form';
|
|
8
|
+
export { useForm } from 'react-hook-form';
|
|
9
|
+
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
10
|
+
import * as class_variance_authority_dist_types from 'class-variance-authority/dist/types';
|
|
11
|
+
import { VariantProps } from 'class-variance-authority';
|
|
12
|
+
export { z } from 'zod';
|
|
13
|
+
export { zodResolver } from '@hookform/resolvers/zod';
|
|
5
14
|
|
|
6
15
|
declare type ArticleProps = {
|
|
7
16
|
title: any;
|
|
@@ -23,6 +32,7 @@ interface ButtonProps {
|
|
|
23
32
|
children: React__default.ReactNode;
|
|
24
33
|
type?: ButtonType;
|
|
25
34
|
onClick: EventHandler<React__default.MouseEvent<HTMLButtonElement>>;
|
|
35
|
+
btnType?: "submit" | "reset" | "button";
|
|
26
36
|
}
|
|
27
37
|
declare function Button(props: ButtonProps): JSX.Element;
|
|
28
38
|
declare namespace Button {
|
|
@@ -309,6 +319,30 @@ declare const ContextMenuShortcut: {
|
|
|
309
319
|
displayName: string;
|
|
310
320
|
};
|
|
311
321
|
|
|
322
|
+
declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues extends FieldValues | undefined = undefined>(props: react_hook_form.FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
|
|
323
|
+
declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends react_hook_form.Path<TFieldValues> = react_hook_form.Path<TFieldValues>>({ ...props }: ControllerProps<TFieldValues, TName>) => JSX.Element;
|
|
324
|
+
declare const useFormField: () => {
|
|
325
|
+
invalid: boolean;
|
|
326
|
+
isDirty: boolean;
|
|
327
|
+
isTouched: boolean;
|
|
328
|
+
isValidating: boolean;
|
|
329
|
+
error?: react_hook_form.FieldError | undefined;
|
|
330
|
+
id: string;
|
|
331
|
+
name: string;
|
|
332
|
+
formItemId: string;
|
|
333
|
+
formDescriptionId: string;
|
|
334
|
+
formMessageId: string;
|
|
335
|
+
};
|
|
336
|
+
declare const FormItem: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
337
|
+
declare const FormLabel: React.ForwardRefExoticComponent<Pick<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>, "title" | "children" | "className" | "form" | "slot" | "style" | "onClick" | "hidden" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "asChild" | "htmlFor"> & React.RefAttributes<HTMLLabelElement>>;
|
|
338
|
+
declare const FormControl: React.ForwardRefExoticComponent<Pick<_radix_ui_react_slot.SlotProps & React.RefAttributes<HTMLElement>, "key" | keyof _radix_ui_react_slot.SlotProps> & React.RefAttributes<HTMLElement>>;
|
|
339
|
+
declare const FormDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
340
|
+
declare const FormMessage: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
341
|
+
|
|
342
|
+
declare const Label: React.ForwardRefExoticComponent<Pick<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>, "title" | "children" | "className" | "form" | "slot" | "style" | "onClick" | "hidden" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "asChild" | "htmlFor"> & VariantProps<(props?: class_variance_authority_dist_types.ClassProp | undefined) => string> & React.RefAttributes<HTMLLabelElement>>;
|
|
343
|
+
|
|
344
|
+
declare const Input: React.ForwardRefExoticComponent<Pick<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "key" | keyof React.InputHTMLAttributes<HTMLInputElement>> & React.RefAttributes<HTMLInputElement>>;
|
|
345
|
+
|
|
312
346
|
declare type BlurCoverProps = {
|
|
313
347
|
status: "silent" | "show";
|
|
314
348
|
className?: string;
|
|
@@ -338,4 +372,4 @@ interface ICanvasProps extends React__default.HTMLAttributes<HTMLCanvasElement>
|
|
|
338
372
|
}
|
|
339
373
|
declare const Canvas: (props: ICanvasProps) => JSX.Element;
|
|
340
374
|
|
|
341
|
-
export { Article, ArticleProps, ArticleSkeleton, ArticleSkeletonProps, AttributeProps, BLinkDotProps, BlinkDot, BlurCover, BlurCoverProps, Breadcrumb, BreadcrumbProps, Button, ButtonProps, ButtonType, Canvas, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, DropImage, DropZone, DropZoneProps, Error, ErrorBoundary, Gallery, GalleryProps, ICanvasProps, ImageDropProps, ImagePreviewerProps, ImageRenderer, Img, ImgProps, Link, LinkColor, LinkList, LinkListProps, LinkListSkeleton, LinkListSkeletonProps, LinkProps, List, LoadingSpiral, LoadingSpiralProps, Logo, LogoProps, Nav, NavProps, NotFound, Page, Panel, PanelProps, PathObj, Photo, PopConfirm, PopConfirmProps, Skeleton, SkeletonColor, SkeletonProps, Table, TableProps, Tag, TagProps, Tags, ThreeColLayout, TitledList, TitledListProps, UniformProps, listProps, ossProcessType, threeColLayoutProps };
|
|
375
|
+
export { Article, ArticleProps, ArticleSkeleton, ArticleSkeletonProps, AttributeProps, BLinkDotProps, BlinkDot, BlurCover, BlurCoverProps, Breadcrumb, BreadcrumbProps, Button, ButtonProps, ButtonType, Canvas, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, DropImage, DropZone, DropZoneProps, Error, ErrorBoundary, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, Gallery, GalleryProps, ICanvasProps, ImageDropProps, ImagePreviewerProps, ImageRenderer, Img, ImgProps, Input, Label, Link, LinkColor, LinkList, LinkListProps, LinkListSkeleton, LinkListSkeletonProps, LinkProps, List, LoadingSpiral, LoadingSpiralProps, Logo, LogoProps, Nav, NavProps, NotFound, Page, Panel, PanelProps, PathObj, Photo, PopConfirm, PopConfirmProps, Skeleton, SkeletonColor, SkeletonProps, Table, TableProps, Tag, TagProps, Tags, ThreeColLayout, TitledList, TitledListProps, UniformProps, listProps, ossProcessType, threeColLayoutProps, useFormField };
|
package/dist/index.js
CHANGED
|
@@ -30,11 +30,12 @@ function Button(props) {
|
|
|
30
30
|
["disabled" /* DISABLED */]: "text-gray-400 cursor-not-allowed",
|
|
31
31
|
["normal" /* NORMAL */]: "text-black"
|
|
32
32
|
};
|
|
33
|
-
const { type = "normal" /* NORMAL */, className = "", onClick } = props;
|
|
33
|
+
const { type = "normal" /* NORMAL */, className = "", onClick, btnType } = props;
|
|
34
34
|
const shadowTransCls = type === "disabled" /* DISABLED */ ? "" : "transition-all duration-200 ease-in-out shadow-button hover:shadow-button-hover active:shadow-empty";
|
|
35
35
|
return /* @__PURE__ */ React2.createElement("button", {
|
|
36
36
|
className: `${typeClsMap[type]} ${className} ${shadowTransCls} py-8 px-16 transition-all duration-200 ease-in-out`,
|
|
37
|
-
onClick
|
|
37
|
+
onClick,
|
|
38
|
+
type: btnType
|
|
38
39
|
}, props.children);
|
|
39
40
|
}
|
|
40
41
|
Button.displayName = "Button";
|
|
@@ -275,11 +276,11 @@ var Page = (props) => {
|
|
|
275
276
|
}, main));
|
|
276
277
|
};
|
|
277
278
|
var NotFound = (props) => {
|
|
278
|
-
return /* @__PURE__ */ React10.createElement(
|
|
279
|
+
return /* @__PURE__ */ React10.createElement(Error2, {
|
|
279
280
|
error: { name: "404", message: "Not Found" }
|
|
280
281
|
});
|
|
281
282
|
};
|
|
282
|
-
var
|
|
283
|
+
var Error2 = (props) => {
|
|
283
284
|
const { error } = props;
|
|
284
285
|
return /* @__PURE__ */ React10.createElement("div", {
|
|
285
286
|
className: "prose"
|
|
@@ -301,7 +302,7 @@ var ErrorBoundary = class extends React10.Component {
|
|
|
301
302
|
title: "\u51FA\u9519"
|
|
302
303
|
}, /* @__PURE__ */ React10.createElement("div", {
|
|
303
304
|
className: "relative h-256"
|
|
304
|
-
}, /* @__PURE__ */ React10.createElement(
|
|
305
|
+
}, /* @__PURE__ */ React10.createElement(Error2, {
|
|
305
306
|
error: this.state.error
|
|
306
307
|
})));
|
|
307
308
|
}
|
|
@@ -1272,7 +1273,7 @@ var ContextMenuSubTrigger = React22.forwardRef(({ className, inset, children, ..
|
|
|
1272
1273
|
),
|
|
1273
1274
|
...props
|
|
1274
1275
|
}, children, /* @__PURE__ */ React22.createElement(ChevronRightIcon, {
|
|
1275
|
-
className: "ml-auto
|
|
1276
|
+
className: "ml-auto"
|
|
1276
1277
|
})));
|
|
1277
1278
|
ContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;
|
|
1278
1279
|
var ContextMenuSubContent = React22.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React22.createElement(ContextMenuPrimitive.SubContent, {
|
|
@@ -1360,8 +1361,148 @@ var ContextMenuShortcut = ({
|
|
|
1360
1361
|
};
|
|
1361
1362
|
ContextMenuShortcut.displayName = "ContextMenuShortcut";
|
|
1362
1363
|
|
|
1364
|
+
// lib/form/index.tsx
|
|
1365
|
+
import * as React24 from "react";
|
|
1366
|
+
import { z } from "zod";
|
|
1367
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
1368
|
+
import { zodResolver } from "@hookform/resolvers/zod";
|
|
1369
|
+
import {
|
|
1370
|
+
Controller,
|
|
1371
|
+
useForm,
|
|
1372
|
+
FormProvider,
|
|
1373
|
+
useFormContext
|
|
1374
|
+
} from "react-hook-form";
|
|
1375
|
+
import cn3 from "classnames";
|
|
1376
|
+
|
|
1377
|
+
// lib/label/index.tsx
|
|
1378
|
+
import * as React23 from "react";
|
|
1379
|
+
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
1380
|
+
import { cva } from "class-variance-authority";
|
|
1381
|
+
import cn2 from "classnames";
|
|
1382
|
+
"use client";
|
|
1383
|
+
var labelVariants = cva(
|
|
1384
|
+
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
|
|
1385
|
+
);
|
|
1386
|
+
var Label2 = React23.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ React23.createElement(LabelPrimitive.Root, {
|
|
1387
|
+
ref,
|
|
1388
|
+
className: cn2(labelVariants(), className),
|
|
1389
|
+
...props
|
|
1390
|
+
}));
|
|
1391
|
+
Label2.displayName = LabelPrimitive.Root.displayName;
|
|
1392
|
+
|
|
1393
|
+
// lib/form/index.tsx
|
|
1394
|
+
"use client";
|
|
1395
|
+
var Form = FormProvider;
|
|
1396
|
+
var FormFieldContext = React24.createContext(
|
|
1397
|
+
{}
|
|
1398
|
+
);
|
|
1399
|
+
var FormField = ({
|
|
1400
|
+
...props
|
|
1401
|
+
}) => {
|
|
1402
|
+
return /* @__PURE__ */ React24.createElement(FormFieldContext.Provider, {
|
|
1403
|
+
value: { name: props.name }
|
|
1404
|
+
}, /* @__PURE__ */ React24.createElement(Controller, {
|
|
1405
|
+
...props
|
|
1406
|
+
}));
|
|
1407
|
+
};
|
|
1408
|
+
var useFormField = () => {
|
|
1409
|
+
const fieldContext = React24.useContext(FormFieldContext);
|
|
1410
|
+
const itemContext = React24.useContext(FormItemContext);
|
|
1411
|
+
const { getFieldState, formState } = useFormContext();
|
|
1412
|
+
const fieldState = getFieldState(fieldContext.name, formState);
|
|
1413
|
+
if (!fieldContext) {
|
|
1414
|
+
throw new Error("useFormField should be used within <FormField>");
|
|
1415
|
+
}
|
|
1416
|
+
const { id } = itemContext;
|
|
1417
|
+
return {
|
|
1418
|
+
id,
|
|
1419
|
+
name: fieldContext.name,
|
|
1420
|
+
formItemId: `${id}-form-item`,
|
|
1421
|
+
formDescriptionId: `${id}-form-item-description`,
|
|
1422
|
+
formMessageId: `${id}-form-item-message`,
|
|
1423
|
+
...fieldState
|
|
1424
|
+
};
|
|
1425
|
+
};
|
|
1426
|
+
var FormItemContext = React24.createContext(
|
|
1427
|
+
{}
|
|
1428
|
+
);
|
|
1429
|
+
var FormItem = React24.forwardRef(({ className, ...props }, ref) => {
|
|
1430
|
+
const id = React24.useId();
|
|
1431
|
+
return /* @__PURE__ */ React24.createElement(FormItemContext.Provider, {
|
|
1432
|
+
value: { id }
|
|
1433
|
+
}, /* @__PURE__ */ React24.createElement("div", {
|
|
1434
|
+
ref,
|
|
1435
|
+
className: cn3("space-y-2", className),
|
|
1436
|
+
...props
|
|
1437
|
+
}));
|
|
1438
|
+
});
|
|
1439
|
+
FormItem.displayName = "FormItem";
|
|
1440
|
+
var FormLabel = React24.forwardRef(({ className, ...props }, ref) => {
|
|
1441
|
+
const { error, formItemId } = useFormField();
|
|
1442
|
+
return /* @__PURE__ */ React24.createElement(Label2, {
|
|
1443
|
+
ref,
|
|
1444
|
+
className: cn3(error && "text-destructive", className),
|
|
1445
|
+
htmlFor: formItemId,
|
|
1446
|
+
...props
|
|
1447
|
+
});
|
|
1448
|
+
});
|
|
1449
|
+
FormLabel.displayName = "FormLabel";
|
|
1450
|
+
var FormControl = React24.forwardRef(({ ...props }, ref) => {
|
|
1451
|
+
const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
|
|
1452
|
+
return /* @__PURE__ */ React24.createElement(Slot, {
|
|
1453
|
+
ref,
|
|
1454
|
+
id: formItemId,
|
|
1455
|
+
"aria-describedby": !error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`,
|
|
1456
|
+
"aria-invalid": !!error,
|
|
1457
|
+
...props
|
|
1458
|
+
});
|
|
1459
|
+
});
|
|
1460
|
+
FormControl.displayName = "FormControl";
|
|
1461
|
+
var FormDescription = React24.forwardRef(({ className, ...props }, ref) => {
|
|
1462
|
+
const { formDescriptionId } = useFormField();
|
|
1463
|
+
return /* @__PURE__ */ React24.createElement("p", {
|
|
1464
|
+
ref,
|
|
1465
|
+
id: formDescriptionId,
|
|
1466
|
+
className: cn3("text-sm text-muted-foreground", className),
|
|
1467
|
+
...props
|
|
1468
|
+
});
|
|
1469
|
+
});
|
|
1470
|
+
FormDescription.displayName = "FormDescription";
|
|
1471
|
+
var FormMessage = React24.forwardRef(({ className, children, ...props }, ref) => {
|
|
1472
|
+
const { error, formMessageId } = useFormField();
|
|
1473
|
+
const body = error ? String(error == null ? void 0 : error.message) : children;
|
|
1474
|
+
if (!body) {
|
|
1475
|
+
return null;
|
|
1476
|
+
}
|
|
1477
|
+
return /* @__PURE__ */ React24.createElement("p", {
|
|
1478
|
+
ref,
|
|
1479
|
+
id: formMessageId,
|
|
1480
|
+
className: cn3("text-sm font-medium text-destructive", className),
|
|
1481
|
+
...props
|
|
1482
|
+
}, body);
|
|
1483
|
+
});
|
|
1484
|
+
FormMessage.displayName = "FormMessage";
|
|
1485
|
+
|
|
1486
|
+
// lib/input/index.tsx
|
|
1487
|
+
import * as React25 from "react";
|
|
1488
|
+
import cn4 from "classnames";
|
|
1489
|
+
var Input = React25.forwardRef(
|
|
1490
|
+
({ className, type, ...props }, ref) => {
|
|
1491
|
+
return /* @__PURE__ */ React25.createElement("input", {
|
|
1492
|
+
type,
|
|
1493
|
+
className: cn4(
|
|
1494
|
+
"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
1495
|
+
className
|
|
1496
|
+
),
|
|
1497
|
+
ref,
|
|
1498
|
+
...props
|
|
1499
|
+
});
|
|
1500
|
+
}
|
|
1501
|
+
);
|
|
1502
|
+
Input.displayName = "Input";
|
|
1503
|
+
|
|
1363
1504
|
// lib/blur-cover/BlurCover.tsx
|
|
1364
|
-
import
|
|
1505
|
+
import React26 from "react";
|
|
1365
1506
|
import cls5 from "classnames";
|
|
1366
1507
|
var BlurCover = (props) => {
|
|
1367
1508
|
const { status } = props;
|
|
@@ -1382,13 +1523,13 @@ var BlurCover = (props) => {
|
|
|
1382
1523
|
},
|
|
1383
1524
|
props.className
|
|
1384
1525
|
);
|
|
1385
|
-
return /* @__PURE__ */
|
|
1526
|
+
return /* @__PURE__ */ React26.createElement("div", {
|
|
1386
1527
|
className: coverCls
|
|
1387
1528
|
});
|
|
1388
1529
|
};
|
|
1389
1530
|
|
|
1390
1531
|
// lib/canvas/Canvas.tsx
|
|
1391
|
-
import
|
|
1532
|
+
import React27, { useEffect as useEffect6 } from "react";
|
|
1392
1533
|
|
|
1393
1534
|
// lib/canvas/useRenderer.ts
|
|
1394
1535
|
import { useEffect as useEffect5, useRef as useRef3, useState as useState7 } from "react";
|
|
@@ -1487,7 +1628,7 @@ var Canvas = (props) => {
|
|
|
1487
1628
|
renderer.remove(instName);
|
|
1488
1629
|
};
|
|
1489
1630
|
}, [renderer]);
|
|
1490
|
-
return /* @__PURE__ */
|
|
1631
|
+
return /* @__PURE__ */ React27.createElement("canvas", {
|
|
1491
1632
|
style: {
|
|
1492
1633
|
...props.style,
|
|
1493
1634
|
imageRendering: "pixelated"
|
|
@@ -1522,10 +1663,19 @@ export {
|
|
|
1522
1663
|
ContextMenuTrigger,
|
|
1523
1664
|
DropImage,
|
|
1524
1665
|
DropZone,
|
|
1525
|
-
Error,
|
|
1666
|
+
Error2 as Error,
|
|
1526
1667
|
ErrorBoundary,
|
|
1668
|
+
Form,
|
|
1669
|
+
FormControl,
|
|
1670
|
+
FormDescription,
|
|
1671
|
+
FormField,
|
|
1672
|
+
FormItem,
|
|
1673
|
+
FormLabel,
|
|
1674
|
+
FormMessage,
|
|
1527
1675
|
Gallery,
|
|
1528
1676
|
Img,
|
|
1677
|
+
Input,
|
|
1678
|
+
Label2 as Label,
|
|
1529
1679
|
Link,
|
|
1530
1680
|
LinkColor,
|
|
1531
1681
|
LinkList,
|
|
@@ -1545,6 +1695,10 @@ export {
|
|
|
1545
1695
|
Tags,
|
|
1546
1696
|
ThreeColLayout,
|
|
1547
1697
|
TitledList,
|
|
1548
|
-
ossProcessType
|
|
1698
|
+
ossProcessType,
|
|
1699
|
+
useForm,
|
|
1700
|
+
useFormField,
|
|
1701
|
+
z,
|
|
1702
|
+
zodResolver
|
|
1549
1703
|
};
|
|
1550
1704
|
//# sourceMappingURL=index.js.map
|