@oneplatformdev/ui 0.1.99-beta.5 → 0.1.99-beta.50
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/Accordion/Accordion.d.ts +1 -1
- package/Accordion/Accordion.d.ts.map +1 -1
- package/Accordion/Accordion.js +48 -26
- package/Accordion/Accordion.js.map +1 -1
- package/AlertDialog/AlertDialogRoot.d.ts.map +1 -1
- package/AlertDialog/AlertDialogRoot.js +15 -14
- package/AlertDialog/AlertDialogRoot.js.map +1 -1
- package/Badge/badgeVariants.d.ts +1 -1
- package/Button/Button.d.ts +7 -1
- package/Button/Button.d.ts.map +1 -1
- package/Button/Button.js +44 -42
- package/Button/Button.js.map +1 -1
- package/Button/Button.types.d.ts +22 -0
- package/Button/Button.types.d.ts.map +1 -1
- package/Button/ButtonCounterBadge.d.ts +7 -0
- package/Button/ButtonCounterBadge.d.ts.map +1 -0
- package/Button/ButtonCounterBadge.js +20 -0
- package/Button/ButtonCounterBadge.js.map +1 -0
- package/Button/buttonVariants.d.ts +11 -20
- package/Button/buttonVariants.d.ts.map +1 -1
- package/Button/buttonVariants.js +76 -12
- package/Button/buttonVariants.js.map +1 -1
- package/Button/index.js +6 -5
- package/ButtonIcon/ButtonIcon.d.ts +6 -1
- package/ButtonIcon/ButtonIcon.d.ts.map +1 -1
- package/ButtonIcon/ButtonIcon.js +70 -50
- package/ButtonIcon/ButtonIcon.js.map +1 -1
- package/ButtonIcon/ButtonIcon.stories.js +82 -55
- package/ButtonIcon/ButtonIcon.stories.js.map +1 -1
- package/ButtonIcon/buttonIconVariants.d.ts +1 -1
- package/ButtonIcon/buttonIconVariants.d.ts.map +1 -1
- package/ButtonIcon/buttonIconVariants.js +7 -6
- package/ButtonIcon/buttonIconVariants.js.map +1 -1
- package/CHANGELOG.md +548 -0
- package/Combobox/Combobox.d.ts +2 -1
- package/Combobox/Combobox.d.ts.map +1 -1
- package/Combobox/Combobox.js +124 -122
- package/Combobox/Combobox.js.map +1 -1
- package/Combobox/Combobox.stories.js +208 -0
- package/Combobox/Combobox.stories.js.map +1 -0
- package/Combobox/Combobox.types.d.ts +2 -0
- package/Combobox/Combobox.types.d.ts.map +1 -1
- package/Combobox/ComboboxOptions.d.ts.map +1 -1
- package/Combobox/ComboboxOptions.js +42 -42
- package/Combobox/ComboboxOptions.js.map +1 -1
- package/Dialog/Dialog.d.ts.map +1 -1
- package/Dialog/Dialog.js +22 -16
- package/Dialog/Dialog.js.map +1 -1
- package/Dialog/Dialog.types.d.ts +4 -0
- package/Dialog/Dialog.types.d.ts.map +1 -0
- package/Dialog/Dialog.types.js +2 -0
- package/Dialog/Dialog.types.js.map +1 -0
- package/Dialog/index.d.ts +1 -0
- package/Dialog/index.d.ts.map +1 -1
- package/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/DropdownMenu/DropdownMenu.js +33 -20
- package/DropdownMenu/DropdownMenu.js.map +1 -1
- package/Form/Form.d.ts.map +1 -1
- package/Form/Form.js.map +1 -1
- package/Form/FormRenderControl.d.ts.map +1 -1
- package/Form/FormRenderControl.js +26 -13
- package/Form/FormRenderControl.js.map +1 -1
- package/Form/FormRenderControl.types.d.ts +2 -1
- package/Form/FormRenderControl.types.d.ts.map +1 -1
- package/Form/FormTooltipButton.d.ts +6 -0
- package/Form/FormTooltipButton.d.ts.map +1 -0
- package/Form/FormTooltipButton.js +34 -0
- package/Form/FormTooltipButton.js.map +1 -0
- package/FormInput/FormInput.d.ts.map +1 -1
- package/FormInput/FormInput.js +22 -21
- package/FormInput/FormInput.js.map +1 -1
- package/InfoBlock/InfoBlock.d.ts +7 -0
- package/InfoBlock/InfoBlock.d.ts.map +1 -0
- package/InfoBlock/InfoBlock.js +27 -0
- package/InfoBlock/InfoBlock.js.map +1 -0
- package/InfoBlock/InfoBlock.stories.js +14 -0
- package/InfoBlock/InfoBlock.stories.js.map +1 -0
- package/InfoBlock/InfoBlock.types.d.ts +8 -0
- package/InfoBlock/InfoBlock.types.d.ts.map +1 -0
- package/InfoBlock/InfoBlock.types.js +2 -0
- package/InfoBlock/InfoBlock.types.js.map +1 -0
- package/InfoBlock/index.d.ts +3 -0
- package/InfoBlock/index.d.ts.map +1 -0
- package/InfoBlock/index.js +5 -0
- package/InfoBlock/index.js.map +1 -0
- package/InfoBlock/infoBlockVariants.d.ts +6 -0
- package/InfoBlock/infoBlockVariants.d.ts.map +1 -0
- package/InfoBlock/infoBlockVariants.js +26 -0
- package/InfoBlock/infoBlockVariants.js.map +1 -0
- package/Input/Input.js +1 -1
- package/Input/Input.js.map +1 -1
- package/Input/inputVariants.d.ts.map +1 -1
- package/Input/inputVariants.js +5 -4
- package/Input/inputVariants.js.map +1 -1
- package/LoadedIcon/LoadedIcon.d.ts.map +1 -1
- package/LoadedIcon/LoadedIcon.js +3 -1
- package/LoadedIcon/LoadedIcon.js.map +1 -1
- package/Resizable/Resizable.d.ts +5 -20
- package/Resizable/Resizable.d.ts.map +1 -1
- package/Resizable/Resizable.js +48 -31
- package/Resizable/Resizable.js.map +1 -1
- package/Resizable/Resizable.stories.js +140 -0
- package/Resizable/Resizable.stories.js.map +1 -0
- package/Search/Search.js +12 -12
- package/Search/Search.js.map +1 -1
- package/Search/Search.stories.js +17 -0
- package/Search/Search.stories.js.map +1 -0
- package/Textarea/Textarea.d.ts.map +1 -1
- package/Textarea/Textarea.js +50 -45
- package/Textarea/Textarea.js.map +1 -1
- package/Textarea/Textarea.stories.js +12 -0
- package/Textarea/Textarea.stories.js.map +1 -0
- package/Textarea/Textarea.types.d.ts +3 -1
- package/Textarea/Textarea.types.d.ts.map +1 -1
- package/Textarea/useAutosizeTextArea.d.ts +1 -1
- package/Textarea/useAutosizeTextArea.d.ts.map +1 -1
- package/Textarea/useAutosizeTextArea.js.map +1 -1
- package/Tooltip/Tooltip.d.ts.map +1 -1
- package/Tooltip/Tooltip.js.map +1 -1
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -1
- package/index.js +328 -325
- package/index.js.map +1 -1
- package/package.json +4 -4
package/Form/Form.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Form.d.ts","sourceRoot":"","sources":["../../src/Form/Form.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,cAAc,MAAM,uBAAuB,CAAA;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAC3C,OAAO,EAKL,KAAK,eAAe,EACpB,KAAK,SAAS,EACd,KAAK,WAAW,EACjB,MAAM,iBAAiB,CAAA;AAKxB,QAAA,MAAM,IAAI,4MAAe,CAAA;AAazB,QAAA,MAAM,SAAS,GACb,YAAY,SAAS,WAAW,GAAG,WAAW,EAC9C,KAAK,SAAS,SAAS,CAAC,YAAY,CAAC,GAAG,SAAS,CAAC,YAAY,CAAC,EAC/D,cAEG,eAAe,CAAC,YAAY,EAAE,KAAK,CAAC,4CAMxC,CAAA;AAED,QAAA,MAAM,YAAY;;;;;;;;;;;CAqBjB,CAAA;AAUD,iBAAS,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"Form.d.ts","sourceRoot":"","sources":["../../src/Form/Form.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,cAAc,MAAM,uBAAuB,CAAA;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAC3C,OAAO,EAKL,KAAK,eAAe,EACpB,KAAK,SAAS,EACd,KAAK,WAAW,EACjB,MAAM,iBAAiB,CAAA;AAKxB,QAAA,MAAM,IAAI,4MAAe,CAAA;AAazB,QAAA,MAAM,SAAS,GACb,YAAY,SAAS,WAAW,GAAG,WAAW,EAC9C,KAAK,SAAS,SAAS,CAAC,YAAY,CAAC,GAAG,SAAS,CAAC,YAAY,CAAC,EAC/D,cAEG,eAAe,CAAC,YAAY,EAAE,KAAK,CAAC,4CAMxC,CAAA;AAED,QAAA,MAAM,YAAY;;;;;;;;;;;CAqBjB,CAAA;AAUD,iBAAS,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAYrE;AAED,iBAAS,SAAS,CAAC,EACE,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,cAAc,CAAC,IAAI,CAAC,2CAYrE;AAED,iBAAS,WAAW,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,IAAI,CAAC,2CAgBnE;AAED,iBAAS,eAAe,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,2CAW1E;AAED,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,kDAkBtE;AAED,OAAO,EACL,YAAY,EACZ,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,WAAW,EACX,eAAe,EACf,WAAW,EACX,SAAS,GACV,CAAA"}
|
package/Form/Form.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Form.js","sources":["../../src/Form/Form.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport * as LabelPrimitive from \"@radix-ui/react-label\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport {\n Controller,\n FormProvider,\n useFormContext,\n useFormState,\n type ControllerProps,\n type FieldPath,\n type FieldValues,\n} from \"react-hook-form\"\n\nimport { cn } from \"@oneplatformdev/utils\"\nimport { Label } from \"../Label\"\n\nconst Form = FormProvider\n\ntype FormFieldContextValue<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n> = {\n name: TName\n}\n\nconst FormFieldContext = React.createContext<FormFieldContextValue>(\n {} as FormFieldContextValue\n)\n\nconst FormField = <\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n>({\n ...props\n }: ControllerProps<TFieldValues, TName>) => {\n return (\n <FormFieldContext.Provider value={{ name: props.name }}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n )\n}\n\nconst useFormField = () => {\n const fieldContext = React.useContext(FormFieldContext)\n const itemContext = React.useContext(FormItemContext)\n const { getFieldState } = useFormContext()\n const formState = useFormState({ name: fieldContext.name })\n const fieldState = getFieldState(fieldContext.name, formState)\n\n if (!fieldContext) {\n throw new Error(\"useFormField should be used within <FormField>\")\n }\n\n const { id } = itemContext\n\n return {\n id,\n name: fieldContext.name,\n formItemId: `${id}-form-item`,\n formDescriptionId: `${id}-form-item-description`,\n formMessageId: `${id}-form-item-message`,\n ...fieldState,\n }\n}\n\ntype FormItemContextValue = {\n id: string\n}\n\nconst FormItemContext = React.createContext<FormItemContextValue>(\n {} as FormItemContextValue\n)\n\nfunction FormItem({ className, ...props }: React.ComponentProps<\"div\">) {\n const id = React.useId()\n\n return (\n <FormItemContext.Provider value={{ id }}>\n <div\n data-slot=\"form-item\"\n
|
|
1
|
+
{"version":3,"file":"Form.js","sources":["../../src/Form/Form.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport * as LabelPrimitive from \"@radix-ui/react-label\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport {\n Controller,\n FormProvider,\n useFormContext,\n useFormState,\n type ControllerProps,\n type FieldPath,\n type FieldValues,\n} from \"react-hook-form\"\n\nimport { cn } from \"@oneplatformdev/utils\"\nimport { Label } from \"../Label\"\n\nconst Form = FormProvider\n\ntype FormFieldContextValue<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n> = {\n name: TName\n}\n\nconst FormFieldContext = React.createContext<FormFieldContextValue>(\n {} as FormFieldContextValue\n)\n\nconst FormField = <\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n>({\n ...props\n }: ControllerProps<TFieldValues, TName>) => {\n return (\n <FormFieldContext.Provider value={{ name: props.name }}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n )\n}\n\nconst useFormField = () => {\n const fieldContext = React.useContext(FormFieldContext)\n const itemContext = React.useContext(FormItemContext)\n const { getFieldState } = useFormContext()\n const formState = useFormState({ name: fieldContext.name })\n const fieldState = getFieldState(fieldContext.name, formState)\n\n if (!fieldContext) {\n throw new Error(\"useFormField should be used within <FormField>\")\n }\n\n const { id } = itemContext\n\n return {\n id,\n name: fieldContext.name,\n formItemId: `${id}-form-item`,\n formDescriptionId: `${id}-form-item-description`,\n formMessageId: `${id}-form-item-message`,\n ...fieldState,\n }\n}\n\ntype FormItemContextValue = {\n id: string\n}\n\nconst FormItemContext = React.createContext<FormItemContextValue>(\n {} as FormItemContextValue\n)\n\nfunction FormItem({ className, ...props }: React.ComponentProps<\"div\">) {\n const id = React.useId()\n\n return (\n <FormItemContext.Provider value={{ id }}>\n <div\n data-slot=\"form-item\"\n className={cn(\"flex flex-col gap-2\", className)}\n {...props}\n />\n </FormItemContext.Provider>\n )\n}\n\nfunction FormLabel({\n className,\n ...props\n }: React.ComponentProps<typeof LabelPrimitive.Root>) {\n const { error, formItemId } = useFormField()\n\n return (\n <Label\n data-slot=\"form-label\"\n data-error={!!error}\n className={cn(\"data-[error=true]:text-destructive\", className)}\n htmlFor={formItemId}\n {...props}\n />\n )\n}\n\nfunction FormControl({ ...props }: React.ComponentProps<typeof Slot>) {\n const { error, formItemId, formDescriptionId, formMessageId } = useFormField()\n\n return (\n <Slot\n data-slot=\"form-control\"\n id={formItemId}\n aria-describedby={\n !error\n ? `${formDescriptionId}`\n : `${formDescriptionId} ${formMessageId}`\n }\n aria-invalid={!!error}\n {...props}\n />\n )\n}\n\nfunction FormDescription({ className, ...props }: React.ComponentProps<\"p\">) {\n const { formDescriptionId } = useFormField()\n\n return (\n <p\n data-slot=\"form-description\"\n id={formDescriptionId}\n className={cn(\"text-muted-foreground text-sm\", className)}\n {...props}\n />\n )\n}\n\nfunction FormMessage({ className, ...props }: React.ComponentProps<\"p\">) {\n const { error, formMessageId } = useFormField()\n const body = error ? String(error?.message ?? \"\") : props.children\n\n if (!body) {\n return null\n }\n\n return (\n <p\n data-slot=\"form-message\"\n id={formMessageId}\n className={cn(\"text-destructive text-sm\", className)}\n {...props}\n >\n {body}\n </p>\n )\n}\n\nexport {\n useFormField,\n Form,\n FormItem,\n FormLabel,\n FormControl,\n FormDescription,\n FormMessage,\n FormField,\n}\n"],"names":["Form","FormProvider","FormFieldContext","React","FormField","props","jsx","Controller","useFormField","fieldContext","itemContext","FormItemContext","getFieldState","useFormContext","formState","useFormState","fieldState","id","FormItem","className","cn","FormLabel","error","formItemId","Label","FormControl","formDescriptionId","formMessageId","Slot","FormDescription","FormMessage","body"],"mappings":";;;;;;;AAkBA,MAAMA,IAAOC,GASPC,IAAmBC,EAAM;AAAA,EAC7B,CAAA;AACF,GAEMC,IAAY,CAGhB;AAAA,EACE,GAAGC;AACL,MAEE,gBAAAC,EAACJ,EAAiB,UAAjB,EAA0B,OAAO,EAAE,MAAMG,EAAM,KAAA,GAC9C,UAAA,gBAAAC,EAACC,GAAA,EAAY,GAAGF,GAAO,GACzB,GAIEG,IAAe,MAAM;AACzB,QAAMC,IAAeN,EAAM,WAAWD,CAAgB,GAChDQ,IAAcP,EAAM,WAAWQ,CAAe,GAC9C,EAAE,eAAAC,EAAA,IAAkBC,EAAA,GACpBC,IAAYC,EAAa,EAAE,MAAMN,EAAa,MAAM,GACpDO,IAAaJ,EAAcH,EAAa,MAAMK,CAAS;AAE7D,MAAI,CAACL;AACH,UAAM,IAAI,MAAM,gDAAgD;AAGlE,QAAM,EAAE,IAAAQ,MAAOP;AAEf,SAAO;AAAA,IACL,IAAAO;AAAA,IACA,MAAMR,EAAa;AAAA,IACnB,YAAY,GAAGQ,CAAE;AAAA,IACjB,mBAAmB,GAAGA,CAAE;AAAA,IACxB,eAAe,GAAGA,CAAE;AAAA,IACpB,GAAGD;AAAA,EAAA;AAEP,GAMML,IAAkBR,EAAM;AAAA,EAC5B,CAAA;AACF;AAEA,SAASe,EAAS,EAAE,WAAAC,GAAW,GAAGd,KAAsC;AACtE,QAAMY,IAAKd,EAAM,MAAA;AAEjB,2BACGQ,EAAgB,UAAhB,EAAyB,OAAO,EAAE,IAAAM,KACjC,UAAA,gBAAAX;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAWc,EAAG,uBAAuBD,CAAS;AAAA,MAC7C,GAAGd;AAAA,IAAA;AAAA,EAAA,GAER;AAEJ;AAEA,SAASgB,EAAU;AAAA,EACE,WAAAF;AAAA,EACA,GAAGd;AACL,GAAqD;AACtE,QAAM,EAAE,OAAAiB,GAAO,YAAAC,EAAA,IAAef,EAAA;AAE9B,SACE,gBAAAF;AAAA,IAACkB;AAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV,cAAY,CAAC,CAACF;AAAA,MACd,WAAWF,EAAG,sCAAsCD,CAAS;AAAA,MAC7D,SAASI;AAAA,MACR,GAAGlB;AAAA,IAAA;AAAA,EAAA;AAGV;AAEA,SAASoB,EAAY,EAAE,GAAGpB,KAA4C;AACpE,QAAM,EAAE,OAAAiB,GAAO,YAAAC,GAAY,mBAAAG,GAAmB,eAAAC,EAAA,IAAkBnB,EAAA;AAEhE,SACE,gBAAAF;AAAA,IAACsB;AAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV,IAAIL;AAAA,MACJ,oBACGD,IAEG,GAAGI,CAAiB,IAAIC,CAAa,KADrC,GAAGD,CAAiB;AAAA,MAG1B,gBAAc,CAAC,CAACJ;AAAA,MACf,GAAGjB;AAAA,IAAA;AAAA,EAAA;AAGV;AAEA,SAASwB,EAAgB,EAAE,WAAAV,GAAW,GAAGd,KAAoC;AAC3E,QAAM,EAAE,mBAAAqB,EAAA,IAAsBlB,EAAA;AAE9B,SACE,gBAAAF;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV,IAAIoB;AAAA,MACJ,WAAWN,EAAG,iCAAiCD,CAAS;AAAA,MACvD,GAAGd;AAAA,IAAA;AAAA,EAAA;AAGV;AAEA,SAASyB,EAAY,EAAE,WAAAX,GAAW,GAAGd,KAAoC;AACvE,QAAM,EAAE,OAAAiB,GAAO,eAAAK,EAAA,IAAkBnB,EAAA,GAC3BuB,IAAOT,IAAQ,OAAOA,GAAO,WAAW,EAAE,IAAIjB,EAAM;AAE1D,SAAK0B,IAKH,gBAAAzB;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV,IAAIqB;AAAA,MACJ,WAAWP,EAAG,4BAA4BD,CAAS;AAAA,MAClD,GAAGd;AAAA,MAEH,UAAA0B;AAAA,IAAA;AAAA,EAAA,IAVI;AAaX;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormRenderControl.d.ts","sourceRoot":"","sources":["../../src/Form/FormRenderControl.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"FormRenderControl.d.ts","sourceRoot":"","sources":["../../src/Form/FormRenderControl.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAI9C,eAAO,MAAM,iBAAiB,GAC5B,IAAI,SAAS,WAAW,GAAG,WAAW,EAEtC,OAAO,sBAAsB,CAAC,IAAI,CAAC,4CA4BpC,CAAC"}
|
|
@@ -1,22 +1,35 @@
|
|
|
1
|
-
import { jsx as r, jsxs as
|
|
2
|
-
import { FormField as
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { jsx as r, jsxs as t } from "react/jsx-runtime";
|
|
2
|
+
import { FormField as a, FormItem as d, FormLabel as F, FormMessage as f } from "./Form.js";
|
|
3
|
+
import { cn as x } from "@oneplatformdev/utils";
|
|
4
|
+
import { FormTooltipButton as h } from "./FormTooltipButton.js";
|
|
5
|
+
const B = (n) => {
|
|
6
|
+
const { form: m, name: l, label: o, tooltip: e, render: s, containerProps: c = {}, ...i } = n;
|
|
5
7
|
return /* @__PURE__ */ r(
|
|
6
|
-
|
|
8
|
+
a,
|
|
7
9
|
{
|
|
8
|
-
control:
|
|
9
|
-
name:
|
|
10
|
-
render: (
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
control: m.control,
|
|
11
|
+
name: l,
|
|
12
|
+
render: (p) => /* @__PURE__ */ t(d, { ...c, children: [
|
|
13
|
+
(o || e) && /* @__PURE__ */ t(
|
|
14
|
+
F,
|
|
15
|
+
{
|
|
16
|
+
className: x(
|
|
17
|
+
"flex items-center gap-1"
|
|
18
|
+
),
|
|
19
|
+
children: [
|
|
20
|
+
o && /* @__PURE__ */ r("span", { children: o }),
|
|
21
|
+
e && /* @__PURE__ */ r(h, { content: e })
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
),
|
|
25
|
+
s(p),
|
|
26
|
+
/* @__PURE__ */ r(f, {})
|
|
14
27
|
] }),
|
|
15
|
-
...
|
|
28
|
+
...i
|
|
16
29
|
}
|
|
17
30
|
);
|
|
18
31
|
};
|
|
19
32
|
export {
|
|
20
|
-
|
|
33
|
+
B as FormRenderControl
|
|
21
34
|
};
|
|
22
35
|
//# sourceMappingURL=FormRenderControl.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormRenderControl.js","sources":["../../src/Form/FormRenderControl.tsx"],"sourcesContent":["import { FormField, FormItem, FormLabel, FormMessage } from
|
|
1
|
+
{"version":3,"file":"FormRenderControl.js","sources":["../../src/Form/FormRenderControl.tsx"],"sourcesContent":["import { FormField, FormItem, FormLabel, FormMessage } from \"./Form\";\nimport { FormRenderControlProps } from \"./FormRenderControl.types\";\nimport { FieldValues } from \"react-hook-form\";\nimport { cn } from \"@oneplatformdev/utils\";\nimport { FormTooltipButton } from \"./FormTooltipButton\";\n\nexport const FormRenderControl = <\n Data extends FieldValues = FieldValues,\n>(\n props: FormRenderControlProps<Data>\n) => {\n const { form, name, label, tooltip, render, containerProps = {}, ...rest } = props;\n return (\n <FormField\n control={form.control}\n name={name}\n render={(params) => (\n <FormItem {...containerProps}>\n {(label || tooltip) && (\n <FormLabel\n className={cn(\n \"flex items-center gap-1\"\n )}\n >\n {label && <span>{label}</span>}\n {tooltip && (\n <FormTooltipButton content={tooltip} />\n )}\n </FormLabel>\n )}\n {render(params)}\n <FormMessage />\n </FormItem>\n )}\n {...rest}\n />\n );\n};\n"],"names":["FormRenderControl","props","form","name","label","tooltip","render","containerProps","rest","jsx","FormField","params","jsxs","FormItem","FormLabel","cn","FormTooltipButton","FormMessage"],"mappings":";;;;AAMO,MAAMA,IAAoB,CAG/BC,MACG;AACH,QAAM,EAAE,MAAAC,GAAM,MAAAC,GAAM,OAAAC,GAAO,SAAAC,GAAS,QAAAC,GAAQ,gBAAAC,IAAiB,CAAA,GAAI,GAAGC,EAAA,IAASP;AAC7E,SACE,gBAAAQ;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,SAASR,EAAK;AAAA,MACd,MAAAC;AAAA,MACA,QAAQ,CAACQ,MACP,gBAAAC,EAACC,GAAA,EAAU,GAAGN,GACV,UAAA;AAAA,SAAAH,KAASC,MACT,gBAAAO;AAAA,UAACE;AAAA,UAAA;AAAA,YACC,WAAWC;AAAA,cACT;AAAA,YAAA;AAAA,YAGD,UAAA;AAAA,cAAAX,KAAS,gBAAAK,EAAC,UAAM,UAAAL,EAAA,CAAM;AAAA,cACtBC,KACC,gBAAAI,EAACO,GAAA,EAAkB,SAASX,EAAA,CAAS;AAAA,YAAA;AAAA,UAAA;AAAA,QAAA;AAAA,QAI1CC,EAAOK,CAAM;AAAA,0BACbM,GAAA,CAAA,CAAY;AAAA,MAAA,GACf;AAAA,MAED,GAAGT;AAAA,IAAA;AAAA,EAAA;AAGV;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HTMLAttributes, ReactElement } from 'react';
|
|
1
|
+
import { HTMLAttributes, ReactElement, ReactNode } from 'react';
|
|
2
2
|
import { ControllerFieldState, ControllerRenderProps, FieldPath, FieldValues, UseFormReturn, UseFormStateReturn } from 'react-hook-form';
|
|
3
3
|
export type FormRenderProps<Data extends FieldValues> = ({ field, fieldState, formState, }: {
|
|
4
4
|
field: ControllerRenderProps<Data, FieldPath<Data>>;
|
|
@@ -9,6 +9,7 @@ export interface FormRenderControlProps<Data extends FieldValues = FieldValues>
|
|
|
9
9
|
form: UseFormReturn<Data>;
|
|
10
10
|
name: FieldPath<Data>;
|
|
11
11
|
label?: string;
|
|
12
|
+
tooltip?: ReactNode;
|
|
12
13
|
render: FormRenderProps<Data>;
|
|
13
14
|
containerProps?: HTMLAttributes<HTMLDivElement>;
|
|
14
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormRenderControl.types.d.ts","sourceRoot":"","sources":["../../src/Form/FormRenderControl.types.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"FormRenderControl.types.d.ts","sourceRoot":"","sources":["../../src/Form/FormRenderControl.types.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAChE,OAAO,KAAK,EACV,oBAAoB,EACpB,qBAAqB,EACrB,SAAS,EACT,WAAW,EACX,aAAa,EACb,kBAAkB,EACnB,MAAM,iBAAiB,CAAC;AAEzB,MAAM,MAAM,eAAe,CAAC,IAAI,SAAS,WAAW,IAAI,CAAC,EACvD,KAAK,EACL,UAAU,EACV,SAAS,GACV,EAAE;IACD,KAAK,EAAE,qBAAqB,CAAC,IAAI,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IACpD,UAAU,EAAE,oBAAoB,CAAC;IACjC,SAAS,EAAE,kBAAkB,CAAC,IAAI,CAAC,CAAC;CACrC,KAAK,YAAY,CAAC;AAEnB,MAAM,WAAW,sBAAsB,CACrC,IAAI,SAAS,WAAW,GAAG,WAAW;IAEtC,IAAI,EAAE,aAAa,CAAC,IAAI,CAAC,CAAC;IAC1B,IAAI,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,MAAM,EAAE,eAAe,CAAC,IAAI,CAAC,CAAC;IAC9B,cAAc,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC,CAAC;CACjD;AAED,MAAM,MAAM,4BAA4B,CACtC,IAAI,SAAS,WAAW,GAAG,WAAW,IACpC,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormTooltipButton.d.ts","sourceRoot":"","sources":["../../src/Form/FormTooltipButton.tsx"],"names":[],"mappings":"AAKA,UAAU,sBAAsB;IAC9B,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC;CAC1B;AAED,eAAO,MAAM,iBAAiB,GAAI,aAAa,sBAAsB,4CA0BpE,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsxs as e, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { cn as t } from "@oneplatformdev/utils";
|
|
3
|
+
import { CircleQuestionMarkIcon as n } from "lucide-react";
|
|
4
|
+
import { Popover as i, PopoverTrigger as m, PopoverContent as l } from "../Popover/Popover.js";
|
|
5
|
+
import { ButtonIcon as a } from "../ButtonIcon/ButtonIcon.js";
|
|
6
|
+
import "../ButtonIcon/buttonIconVariants.js";
|
|
7
|
+
const h = ({ content: o }) => /* @__PURE__ */ e(i, { children: [
|
|
8
|
+
/* @__PURE__ */ r(m, { asChild: !0, children: /* @__PURE__ */ r(
|
|
9
|
+
a,
|
|
10
|
+
{
|
|
11
|
+
color: "primary",
|
|
12
|
+
className: "w-2 h-2 rounded-full border-none",
|
|
13
|
+
size: "xs",
|
|
14
|
+
children: /* @__PURE__ */ r(n, { size: 4 })
|
|
15
|
+
}
|
|
16
|
+
) }),
|
|
17
|
+
/* @__PURE__ */ r(
|
|
18
|
+
l,
|
|
19
|
+
{
|
|
20
|
+
side: "right",
|
|
21
|
+
align: "center",
|
|
22
|
+
className: t(
|
|
23
|
+
"w-auto max-w-80 rounded-xl bg-white px-4 py-3 shadow-lg",
|
|
24
|
+
"text-sm text-primary font-manrope font-normal",
|
|
25
|
+
"text-md leading-normal tracking-normal align-middle"
|
|
26
|
+
),
|
|
27
|
+
children: o
|
|
28
|
+
}
|
|
29
|
+
)
|
|
30
|
+
] });
|
|
31
|
+
export {
|
|
32
|
+
h as FormTooltipButton
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=FormTooltipButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormTooltipButton.js","sources":["../../src/Form/FormTooltipButton.tsx"],"sourcesContent":["import { cn } from \"@oneplatformdev/utils\";\nimport { CircleQuestionMarkIcon } from \"lucide-react\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"../Popover\";\nimport ButtonIcon from \"../ButtonIcon\";\n\ninterface FormTooltipButtonProps {\n content: React.ReactNode;\n}\n\nexport const FormTooltipButton = ({ content }: FormTooltipButtonProps) => {\n return (\n <Popover>\n <PopoverTrigger asChild>\n <ButtonIcon\n color=\"primary\"\n className=\"w-2 h-2 rounded-full border-none\"\n size=\"xs\"\n >\n <CircleQuestionMarkIcon size={4} />\n </ButtonIcon>\n </PopoverTrigger>\n\n <PopoverContent\n side=\"right\"\n align=\"center\"\n className={cn(\n \"w-auto max-w-80 rounded-xl bg-white px-4 py-3 shadow-lg\",\n \"text-sm text-primary font-manrope font-normal\",\n \"text-md leading-normal tracking-normal align-middle\"\n )}\n >\n {content}\n </PopoverContent>\n </Popover>\n );\n};\n"],"names":["FormTooltipButton","content","Popover","jsx","PopoverTrigger","ButtonIcon","CircleQuestionMarkIcon","PopoverContent","cn"],"mappings":";;;;;;AASO,MAAMA,IAAoB,CAAC,EAAE,SAAAC,0BAE/BC,GAAA,EACC,UAAA;AAAA,EAAA,gBAAAC,EAACC,GAAA,EAAe,SAAO,IACrB,UAAA,gBAAAD;AAAA,IAACE;AAAA,IAAA;AAAA,MACC,OAAM;AAAA,MACN,WAAU;AAAA,MACV,MAAK;AAAA,MAEL,UAAA,gBAAAF,EAACG,GAAA,EAAuB,MAAM,EAAA,CAAG;AAAA,IAAA;AAAA,EAAA,GAErC;AAAA,EAEA,gBAAAH;AAAA,IAACI;AAAA,IAAA;AAAA,MACC,MAAK;AAAA,MACL,OAAM;AAAA,MACN,WAAWC;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,MAAA;AAAA,MAGD,UAAAP;AAAA,IAAA;AAAA,EAAA;AACH,GACF;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormInput.d.ts","sourceRoot":"","sources":["../../src/FormInput/FormInput.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAmB,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAc,YAAY,EAAE,GAAG,EAAa,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"FormInput.d.ts","sourceRoot":"","sources":["../../src/FormInput/FormInput.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAmB,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAc,YAAY,EAAE,GAAG,EAAa,MAAM,OAAO,CAAC;AAwGjE,eAAO,MAAM,SAAS,EAAiC,CAAC,IAAI,SAAS,WAAW,EAC9E,KAAK,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAA;CAAE,KAC1D,YAAY,CAAC"}
|
package/FormInput/FormInput.js
CHANGED
|
@@ -1,49 +1,50 @@
|
|
|
1
1
|
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import { FormControl as
|
|
3
|
-
import { FormRenderControl as
|
|
4
|
-
import { Input as
|
|
5
|
-
import { forwardRef as
|
|
6
|
-
function
|
|
7
|
-
const { form: u,
|
|
2
|
+
import { FormControl as F } from "../Form/Form.js";
|
|
3
|
+
import { FormRenderControl as I } from "../Form/FormRenderControl.js";
|
|
4
|
+
import { Input as P } from "../Input/Input.js";
|
|
5
|
+
import { forwardRef as y } from "react";
|
|
6
|
+
function B(c, e) {
|
|
7
|
+
const { form: u, tooltip: m, label: p, name: l, onChange: i, onBlur: f, onPaste: h, style: v, onPastePrepare: s, ...g } = c;
|
|
8
8
|
return /* @__PURE__ */ a(
|
|
9
|
-
|
|
9
|
+
I,
|
|
10
10
|
{
|
|
11
11
|
form: u,
|
|
12
12
|
name: l,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
tooltip: m,
|
|
14
|
+
label: p,
|
|
15
|
+
render: ({ field: n }) => /* @__PURE__ */ a(F, { children: /* @__PURE__ */ a(
|
|
16
|
+
P,
|
|
16
17
|
{
|
|
17
18
|
...n,
|
|
18
|
-
...
|
|
19
|
+
...g,
|
|
19
20
|
ref: (t) => {
|
|
20
21
|
n.ref(t), typeof e == "function" ? e(t) : e && (e.current = t);
|
|
21
22
|
},
|
|
22
|
-
style:
|
|
23
|
+
style: v,
|
|
23
24
|
value: n.value || "",
|
|
24
25
|
onChange: (...t) => {
|
|
25
|
-
n.onChange?.(...t),
|
|
26
|
+
n.onChange?.(...t), i?.(...t);
|
|
26
27
|
},
|
|
27
28
|
onPaste: (t) => {
|
|
28
|
-
const
|
|
29
|
-
let r = o.value.slice(0,
|
|
29
|
+
const d = t.clipboardData.getData("text"), o = t.currentTarget, C = o.selectionStart ?? o.value.length, x = o.selectionEnd ?? o.value.length;
|
|
30
|
+
let r = o.value.slice(0, C) + d + o.value.slice(x);
|
|
30
31
|
s && (r = s(r, t));
|
|
31
|
-
const
|
|
32
|
-
t.preventDefault(), u.setValue(l,
|
|
32
|
+
const D = r;
|
|
33
|
+
t.preventDefault(), u.setValue(l, D, {
|
|
33
34
|
shouldDirty: !0,
|
|
34
35
|
shouldTouch: !0
|
|
35
|
-
}),
|
|
36
|
+
}), h?.(t);
|
|
36
37
|
},
|
|
37
38
|
onBlur: (...t) => {
|
|
38
|
-
n.onBlur?.(),
|
|
39
|
+
n.onBlur?.(), f?.(...t);
|
|
39
40
|
}
|
|
40
41
|
}
|
|
41
42
|
) })
|
|
42
43
|
}
|
|
43
44
|
);
|
|
44
45
|
}
|
|
45
|
-
const
|
|
46
|
+
const E = y(B);
|
|
46
47
|
export {
|
|
47
|
-
|
|
48
|
+
E as FormInput
|
|
48
49
|
};
|
|
49
50
|
//# sourceMappingURL=FormInput.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormInput.js","sources":["../../src/FormInput/FormInput.tsx"],"sourcesContent":["import { FormControl, FormRenderControl } from '../Form';\nimport { Input } from '../Input';\nimport { FormInputProps } from './FormInput.types';\nimport { FieldValues, Path, PathValue } from 'react-hook-form';\nimport { forwardRef, ReactElement, Ref, RefObject } from 'react';\n\n// TODO: add description\n// export const FormInput = <Data extends FieldValues>(\n// props: FormInputProps<Data> & { inputRef?: Ref<HTMLInputElement> }\n// ) => {\n// const { inputRef, form, label, name, onChange, onBlur, style, ...rest } =\n// props;\n// return (\n// <FormRenderControl\n// form={form}\n// name={name}\n// label={label}\n// render={({ field }) => (\n// <FormControl>\n// <Input\n// {...field}\n// {...rest}\n// ref={(el) => {\n// field.ref(el);\n// if (typeof inputRef === 'function') {\n// inputRef(el);\n// } else if (inputRef) {\n// (inputRef as RefObject<HTMLInputElement | null>).current = el;\n// }\n// }}\n// style={style}\n// value={field.value || ''}\n// onChange={(...rest) => {\n// field.onChange?.(...rest);\n// onChange?.(...rest);\n// }}\n// onBlur={(...rest) => {\n// field.onBlur?.();\n// onBlur?.(...rest);\n// }}\n// />\n// </FormControl>\n// )}\n// />\n// );\n// };\n\nfunction FormInputInner<Data extends FieldValues>(\n props: FormInputProps<Data>,\n ref: Ref<HTMLInputElement>\n) {\n const { form, label, name, onChange, onBlur, onPaste, style, onPastePrepare, ...rest } = props;\n return (\n <FormRenderControl\n form={form}\n name={name}\n label={label}\n render={({ field }) => (\n <FormControl>\n <Input\n {...field}\n {...rest}\n ref={(el) => {\n field.ref(el);\n if (typeof ref === 'function') {\n ref(el);\n } else if (ref) {\n (ref as RefObject<HTMLInputElement | null>).current = el;\n }\n }}\n style={style}\n value={field.value || ''}\n onChange={(...rest) => {\n field.onChange?.(...rest);\n onChange?.(...rest);\n }}\n onPaste={(e) => {\n const pasted = e.clipboardData.getData('text');\n const t = e.currentTarget;\n\n const start = t.selectionStart ?? t.value.length;\n const end = t.selectionEnd ?? t.value.length;\n\n let next = t.value.slice(0, start) + pasted + t.value.slice(end);\n if(onPastePrepare) next = onPastePrepare(next, e);\n const value = next as unknown as PathValue<Data, Path<Data>>;\n\n e.preventDefault();\n\n form.setValue(name, value, {\n shouldDirty: true,\n shouldTouch: true,\n });\n\n onPaste?.(e);\n }}\n onBlur={(...rest) => {\n field.onBlur?.();\n onBlur?.(...rest);\n }}\n />\n </FormControl>\n )}\n />\n );\n}\n\nexport const FormInput = forwardRef(FormInputInner) as <Data extends FieldValues>(\n props: FormInputProps<Data> & { ref?: Ref<HTMLInputElement> }\n) => ReactElement;\n"],"names":["FormInputInner","props","ref","form","label","name","onChange","onBlur","onPaste","style","onPastePrepare","rest","jsx","FormRenderControl","field","FormControl","Input","el","e","pasted","t","start","end","next","value","FormInput","forwardRef"],"mappings":";;;;;AA+CA,SAASA,EACPC,GACAC,GACA;AACA,QAAM,EAAE,MAAAC,GAAM,OAAAC,GAAO,MAAAC,GAAM,UAAAC,GAAU,QAAAC,GAAQ,SAAAC,GAAS,OAAAC,GAAO,gBAAAC,GAAgB,GAAGC,EAAA,
|
|
1
|
+
{"version":3,"file":"FormInput.js","sources":["../../src/FormInput/FormInput.tsx"],"sourcesContent":["import { FormControl, FormRenderControl } from '../Form';\nimport { Input } from '../Input';\nimport { FormInputProps } from './FormInput.types';\nimport { FieldValues, Path, PathValue } from 'react-hook-form';\nimport { forwardRef, ReactElement, Ref, RefObject } from 'react';\n\n// TODO: add description\n// export const FormInput = <Data extends FieldValues>(\n// props: FormInputProps<Data> & { inputRef?: Ref<HTMLInputElement> }\n// ) => {\n// const { inputRef, form, label, name, onChange, onBlur, style, ...rest } =\n// props;\n// return (\n// <FormRenderControl\n// form={form}\n// name={name}\n// label={label}\n// render={({ field }) => (\n// <FormControl>\n// <Input\n// {...field}\n// {...rest}\n// ref={(el) => {\n// field.ref(el);\n// if (typeof inputRef === 'function') {\n// inputRef(el);\n// } else if (inputRef) {\n// (inputRef as RefObject<HTMLInputElement | null>).current = el;\n// }\n// }}\n// style={style}\n// value={field.value || ''}\n// onChange={(...rest) => {\n// field.onChange?.(...rest);\n// onChange?.(...rest);\n// }}\n// onBlur={(...rest) => {\n// field.onBlur?.();\n// onBlur?.(...rest);\n// }}\n// />\n// </FormControl>\n// )}\n// />\n// );\n// };\n\nfunction FormInputInner<Data extends FieldValues>(\n props: FormInputProps<Data>,\n ref: Ref<HTMLInputElement>\n) {\n const { form, tooltip, label, name, onChange, onBlur, onPaste, style, onPastePrepare, ...rest } = props;\n return (\n <FormRenderControl\n form={form}\n name={name}\n tooltip={tooltip}\n label={label}\n render={({ field }) => (\n <FormControl>\n <Input\n {...field}\n {...rest}\n ref={(el) => {\n field.ref(el);\n if (typeof ref === 'function') {\n ref(el);\n } else if (ref) {\n (ref as RefObject<HTMLInputElement | null>).current = el;\n }\n }}\n style={style}\n value={field.value || ''}\n onChange={(...rest) => {\n field.onChange?.(...rest);\n onChange?.(...rest);\n }}\n onPaste={(e) => {\n const pasted = e.clipboardData.getData('text');\n const t = e.currentTarget;\n\n const start = t.selectionStart ?? t.value.length;\n const end = t.selectionEnd ?? t.value.length;\n\n let next = t.value.slice(0, start) + pasted + t.value.slice(end);\n if(onPastePrepare) next = onPastePrepare(next, e);\n const value = next as unknown as PathValue<Data, Path<Data>>;\n\n e.preventDefault();\n\n form.setValue(name, value, {\n shouldDirty: true,\n shouldTouch: true,\n });\n\n onPaste?.(e);\n }}\n onBlur={(...rest) => {\n field.onBlur?.();\n onBlur?.(...rest);\n }}\n />\n </FormControl>\n )}\n />\n );\n}\n\nexport const FormInput = forwardRef(FormInputInner) as <Data extends FieldValues>(\n props: FormInputProps<Data> & { ref?: Ref<HTMLInputElement> }\n) => ReactElement;\n"],"names":["FormInputInner","props","ref","form","tooltip","label","name","onChange","onBlur","onPaste","style","onPastePrepare","rest","jsx","FormRenderControl","field","FormControl","Input","el","e","pasted","t","start","end","next","value","FormInput","forwardRef"],"mappings":";;;;;AA+CA,SAASA,EACPC,GACAC,GACA;AACA,QAAM,EAAE,MAAAC,GAAM,SAAAC,GAAS,OAAAC,GAAO,MAAAC,GAAM,UAAAC,GAAU,QAAAC,GAAQ,SAAAC,GAAS,OAAAC,GAAO,gBAAAC,GAAgB,GAAGC,EAAA,IAASX;AAClG,SACE,gBAAAY;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,MAAAX;AAAA,MACA,MAAAG;AAAA,MACA,SAAAF;AAAA,MACA,OAAAC;AAAA,MACA,QAAQ,CAAC,EAAE,OAAAU,EAAA,wBACRC,GAAA,EACC,UAAA,gBAAAH;AAAA,QAACI;AAAA,QAAA;AAAA,UACE,GAAGF;AAAA,UACH,GAAGH;AAAA,UACJ,KAAK,CAACM,MAAO;AACX,YAAAH,EAAM,IAAIG,CAAE,GACR,OAAOhB,KAAQ,aACjBA,EAAIgB,CAAE,IACGhB,MACRA,EAA2C,UAAUgB;AAAA,UAE1D;AAAA,UACA,OAAAR;AAAA,UACA,OAAOK,EAAM,SAAS;AAAA,UACtB,UAAU,IAAIH,MAAS;AACrB,YAAAG,EAAM,WAAW,GAAGH,CAAI,GACxBL,IAAW,GAAGK,CAAI;AAAA,UACpB;AAAA,UACA,SAAS,CAACO,MAAM;AACd,kBAAMC,IAASD,EAAE,cAAc,QAAQ,MAAM,GACvCE,IAAIF,EAAE,eAENG,IAAQD,EAAE,kBAAkBA,EAAE,MAAM,QACpCE,IAAMF,EAAE,gBAAgBA,EAAE,MAAM;AAEtC,gBAAIG,IAAOH,EAAE,MAAM,MAAM,GAAGC,CAAK,IAAIF,IAASC,EAAE,MAAM,MAAME,CAAG;AAC/D,YAAGZ,MAAgBa,IAAOb,EAAea,GAAML,CAAC;AAChD,kBAAMM,IAAQD;AAEd,YAAAL,EAAE,eAAA,GAEFhB,EAAK,SAASG,GAAMmB,GAAO;AAAA,cACzB,aAAa;AAAA,cACb,aAAa;AAAA,YAAA,CACd,GAEDhB,IAAUU,CAAC;AAAA,UACb;AAAA,UACA,QAAQ,IAAIP,MAAS;AACnB,YAAAG,EAAM,SAAA,GACNP,IAAS,GAAGI,CAAI;AAAA,UAClB;AAAA,QAAA;AAAA,MAAA,EACF,CACF;AAAA,IAAA;AAAA,EAAA;AAIR;AAEO,MAAMc,IAAYC,EAAW3B,CAAc;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InfoBlock.d.ts","sourceRoot":"","sources":["../../src/InfoBlock/InfoBlock.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqB,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAgBtE,eAAO,MAAM,SAAS;YAAW,cAAc;;CAe9C,CAAA;AAED,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as e, jsxs as s, Fragment as c } from "react/jsx-runtime";
|
|
2
|
+
import { cn as m } from "@oneplatformdev/utils";
|
|
3
|
+
import { infoBlockVariants as f } from "./infoBlockVariants.js";
|
|
4
|
+
import { isValidElement as d, createElement as p } from "react";
|
|
5
|
+
import { TriangleAlertIcon as u } from "lucide-react";
|
|
6
|
+
const h = (r) => r ? d(r) ? r : p(r) : null, x = {
|
|
7
|
+
error: /* @__PURE__ */ e(u, { className: "fill-[#DC2626] text-white!" })
|
|
8
|
+
}, B = (r) => {
|
|
9
|
+
const { className: t, variant: n = "error", content: o, icon: i, children: a, ...l } = r;
|
|
10
|
+
return /* @__PURE__ */ e(
|
|
11
|
+
"div",
|
|
12
|
+
{
|
|
13
|
+
...l,
|
|
14
|
+
className: m(f({ className: t, variant: n })),
|
|
15
|
+
children: a ?? /* @__PURE__ */ s(c, { children: [
|
|
16
|
+
h(i ?? x[n]),
|
|
17
|
+
/* @__PURE__ */ e("span", { children: o })
|
|
18
|
+
] })
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
};
|
|
22
|
+
B.displayName = "InfoBlock";
|
|
23
|
+
export {
|
|
24
|
+
B as InfoBlock,
|
|
25
|
+
B as default
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=InfoBlock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InfoBlock.js","sources":["../../src/InfoBlock/InfoBlock.tsx"],"sourcesContent":["import { InfoBlockIconType, InfoBlockProps } from \"./InfoBlock.types\";\nimport { cn } from \"@oneplatformdev/utils\";\nimport { infoBlockVariants } from \"./infoBlockVariants\";\nimport { createElement, isValidElement } from \"react\";\nimport { TriangleAlertIcon } from \"lucide-react\";\n\nconst renderInnerIcon = (Icon?: InfoBlockIconType) => {\n if (!Icon) return null;\n if (isValidElement(Icon)) return Icon;\n return createElement(Icon);\n};\n\nconst iconByVariant: Record<NonNullable<InfoBlockProps['variant']>, InfoBlockIconType> = {\n error: <TriangleAlertIcon className='fill-[#DC2626] text-white!'/>\n}\n\nexport const InfoBlock = (props: InfoBlockProps) => {\n const { className, variant = 'error', content, icon, children, ...rest } = props;\n return (\n <div\n {...rest}\n className={cn(infoBlockVariants({ className, variant }))}\n >\n {children ?? (\n <>\n {renderInnerIcon(icon ?? iconByVariant[variant!])}\n <span>{content}</span>\n </>\n )}\n </div>\n )\n}\nInfoBlock.displayName = 'InfoBlock';\nexport default InfoBlock;\n\n"],"names":["renderInnerIcon","Icon","isValidElement","createElement","iconByVariant","jsx","TriangleAlertIcon","InfoBlock","props","className","variant","content","icon","children","rest","cn","infoBlockVariants","jsxs","Fragment"],"mappings":";;;;;AAMA,MAAMA,IAAkB,CAACC,MAClBA,IACDC,EAAeD,CAAI,IAAUA,IAC1BE,EAAcF,CAAI,IAFP,MAKdG,IAAmF;AAAA,EACvF,OAAO,gBAAAC,EAACC,GAAA,EAAkB,WAAU,6BAAA,CAA4B;AAClE,GAEaC,IAAY,CAACC,MAA0B;AAClD,QAAM,EAAE,WAAAC,GAAW,SAAAC,IAAU,SAAS,SAAAC,GAAS,MAAAC,GAAM,UAAAC,GAAU,GAAGC,EAAA,IAASN;AAC3E,SACE,gBAAAH;AAAA,IAAC;AAAA,IAAA;AAAA,MACE,GAAGS;AAAA,MACJ,WAAWC,EAAGC,EAAkB,EAAE,WAAAP,GAAW,SAAAC,EAAA,CAAS,CAAC;AAAA,MAEtD,eACC,gBAAAO,EAAAC,GAAA,EACG,UAAA;AAAA,QAAAlB,EAAgBY,KAAQR,EAAcM,CAAQ,CAAC;AAAA,QAChD,gBAAAL,EAAC,UAAM,UAAAM,EAAA,CAAQ;AAAA,MAAA,EAAA,CACjB;AAAA,IAAA;AAAA,EAAA;AAIR;AACAJ,EAAU,cAAc;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { InfoBlock as o } from "./InfoBlock.js";
|
|
2
|
+
const n = {
|
|
3
|
+
title: "UI/InfoBlock",
|
|
4
|
+
component: o
|
|
5
|
+
}, e = {
|
|
6
|
+
args: {
|
|
7
|
+
content: "Увага! Перш ніж архівувати підрозділ “Підрозділ дизану”, переведіть співробітників до іншого - інакше вони будуть автоматично звільнені. Підрозділ буде преміщено до розділу “Архів”."
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
export {
|
|
11
|
+
e as Default,
|
|
12
|
+
n as default
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=InfoBlock.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InfoBlock.stories.js","sources":["../../src/InfoBlock/InfoBlock.stories.tsx"],"sourcesContent":["import type { Meta, StoryObj } from '@storybook/react-vite';\n\nimport { InfoBlock } from './InfoBlock';\n\nconst meta = {\n title: 'UI/InfoBlock',\n component: InfoBlock,\n} satisfies Meta<typeof InfoBlock>;\n\nexport default meta;\n\ntype Story = StoryObj<typeof meta>;\n\nexport const Default: Story = {\n args: {\n content: 'Увага! Перш ніж архівувати підрозділ “Підрозділ дизану”, переведіть співробітників до іншого - інакше вони будуть автоматично звільнені. Підрозділ буде преміщено до розділу “Архів”.'\n }\n};\n"],"names":["meta","InfoBlock","Default"],"mappings":";AAIA,MAAMA,IAAO;AAAA,EACX,OAAO;AAAA,EACP,WAAWC;AACb,GAMaC,IAAiB;AAAA,EAC5B,MAAM;AAAA,IACJ,SAAS;AAAA,EAAA;AAEb;"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { InfoBlockVariantsProps } from './infoBlockVariants';
|
|
2
|
+
import { ComponentType, HTMLAttributes, PropsWithChildren, ReactElement, ReactNode, SVGProps } from 'react';
|
|
3
|
+
export type InfoBlockIconType = ComponentType<SVGProps<SVGSVGElement>> | ReactElement<SVGProps<SVGSVGElement>>;
|
|
4
|
+
export interface InfoBlockProps extends PropsWithChildren, InfoBlockVariantsProps, Omit<HTMLAttributes<HTMLDivElement>, 'color' | 'content'> {
|
|
5
|
+
content?: ReactNode;
|
|
6
|
+
icon?: InfoBlockIconType;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=InfoBlock.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InfoBlock.types.d.ts","sourceRoot":"","sources":["../../src/InfoBlock/InfoBlock.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EACL,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,SAAS,EACT,QAAQ,EACT,MAAM,OAAO,CAAC;AAEf,MAAM,MAAM,iBAAiB,GACzB,aAAa,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,GACtC,YAAY,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC;AAE1C,MAAM,WAAW,cACf,SAAQ,iBAAiB,EACvB,sBAAsB,EACtB,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC3D,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,IAAI,CAAC,EAAE,iBAAiB,CAAC;CAC1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InfoBlock.types.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/InfoBlock/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,mBAAmB,mBAAmB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
export declare const infoBlockVariants: (props?: ({
|
|
3
|
+
variant?: "error" | null | undefined;
|
|
4
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
5
|
+
export type InfoBlockVariantsProps = VariantProps<typeof infoBlockVariants>;
|
|
6
|
+
//# sourceMappingURL=infoBlockVariants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"infoBlockVariants.d.ts","sourceRoot":"","sources":["../../src/InfoBlock/infoBlockVariants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAElE,eAAO,MAAM,iBAAiB;;8EAoB7B,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG,YAAY,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { cva as r } from "class-variance-authority";
|
|
2
|
+
const a = r(
|
|
3
|
+
[
|
|
4
|
+
"flex items-start gap-2",
|
|
5
|
+
"p-2.5 rounded-lg",
|
|
6
|
+
"font-medium text-base leading-normal text-[#06080D]",
|
|
7
|
+
"whitespace-pre-wrap break-words",
|
|
8
|
+
"[&>p]:m-0 [&>p]:p-0",
|
|
9
|
+
"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:size-5",
|
|
10
|
+
"transition-transform duration-200 [&_svg]:transition-transform [&_svg]:duration-200"
|
|
11
|
+
],
|
|
12
|
+
{
|
|
13
|
+
variants: {
|
|
14
|
+
variant: {
|
|
15
|
+
error: "bg-[#DC26260F] [&>svg]:text-[#DC2626]"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
defaultVariants: {
|
|
19
|
+
variant: "error"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
export {
|
|
24
|
+
a as infoBlockVariants
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=infoBlockVariants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"infoBlockVariants.js","sources":["../../src/InfoBlock/infoBlockVariants.ts"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\n\nexport const infoBlockVariants = cva(\n [\n 'flex items-start gap-2',\n 'p-2.5 rounded-lg',\n 'font-medium text-base leading-normal text-[#06080D]',\n 'whitespace-pre-wrap break-words',\n '[&>p]:m-0 [&>p]:p-0',\n \"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:size-5\",\n 'transition-transform duration-200 [&_svg]:transition-transform [&_svg]:duration-200',\n ],\n {\n variants: {\n variant: {\n error: 'bg-[#DC26260F] [&>svg]:text-[#DC2626]',\n },\n },\n defaultVariants: {\n variant: 'error',\n },\n }\n)\n\nexport type InfoBlockVariantsProps = VariantProps<typeof infoBlockVariants>;\n"],"names":["infoBlockVariants","cva"],"mappings":";AAEO,MAAMA,IAAoBC;AAAA,EAC/B;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAAA,EAEF;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,OAAO;AAAA,MAAA;AAAA,IACT;AAAA,IAEF,iBAAiB;AAAA,MACf,SAAS;AAAA,IAAA;AAAA,EACX;AAEJ;"}
|
package/Input/Input.js
CHANGED
package/Input/Input.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.js","sources":["../../src/Input/Input.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport { Eye, EyeOff } from 'lucide-react';\nimport { inputVariants } from './inputVariants';\n\nimport { cn } from '@oneplatformdev/utils';\nimport { InputProps } from './Input.types';\n\nexport const BaseInput = React.forwardRef<HTMLInputElement, InputProps>(\n (props, ref) => {\n const {\n className,\n variant,\n type,\n slotProps: { input, wrapper } = {},\n onChange,\n onTransform,\n fullSize = false,\n ...rest\n } = props;\n const {\n startAdornment,\n className: classNameInputSlotProps,\n ...restInputSlotProps\n } = input || {};\n return (\n <div\n {...(wrapper || {})}\n className={cn(\n 'relative',\n fullSize && 'w-full',\n wrapper?.className\n )}>\n {Boolean(startAdornment) && (\n <span className=\"absolute left-[10px] top-1/2 -translate-y-1/2\">\n {startAdornment}\n </span>\n )}\n <input\n type={type}\n className={cn(\n inputVariants({ variant, className }),\n Boolean(startAdornment) && 'pl-
|
|
1
|
+
{"version":3,"file":"Input.js","sources":["../../src/Input/Input.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport { Eye, EyeOff } from 'lucide-react';\nimport { inputVariants } from './inputVariants';\n\nimport { cn } from '@oneplatformdev/utils';\nimport { InputProps } from './Input.types';\n\nexport const BaseInput = React.forwardRef<HTMLInputElement, InputProps>(\n (props, ref) => {\n const {\n className,\n variant,\n type,\n slotProps: { input, wrapper } = {},\n onChange,\n onTransform,\n fullSize = false,\n ...rest\n } = props;\n const {\n startAdornment,\n className: classNameInputSlotProps,\n ...restInputSlotProps\n } = input || {};\n return (\n <div\n {...(wrapper || {})}\n className={cn(\n 'relative',\n fullSize && 'w-full',\n wrapper?.className\n )}>\n {Boolean(startAdornment) && (\n <span className=\"absolute left-[10px] top-1/2 -translate-y-1/2\">\n {startAdornment}\n </span>\n )}\n <input\n type={type}\n className={cn(\n inputVariants({ variant, className }),\n Boolean(startAdornment) && 'pl-10',\n classNameInputSlotProps,\n fullSize && 'min-w-auto',\n )}\n ref={ref}\n {...restInputSlotProps}\n {...rest}\n onChange={(e) => {\n if (typeof onTransform?.(e.target.value, e) === 'string') {\n e.target.value = onTransform(e.target.value, e);\n }\n if (onChange) onChange(e);\n }}\n />\n </div>\n );\n }\n);\nBaseInput.displayName = 'Input';\n\nexport const PasswordInput = React.forwardRef<HTMLInputElement, InputProps>(\n (props, ref) => {\n const [isVisible, setIsVisible] = useState<boolean>(false);\n\n const inputType = isVisible ? 'text' : 'password';\n\n const toggleVisibility = () => {\n setIsVisible(!isVisible);\n };\n\n return (\n <div {...(props?.slotProps?.wrapper || {})} className={cn('relative', props?.slotProps?.wrapper?.className)}>\n <BaseInput {...props} type={inputType} className=\"pr-8\" ref={ref} />\n <VisibilityButton isVisible={isVisible} onClick={toggleVisibility} />\n </div>\n );\n }\n);\nPasswordInput.displayName = 'PasswordInput';\n\ntype VisibilityButtonProps = {\n isVisible: boolean\n onClick: () => void\n}\n\nconst VisibilityButton = ({ isVisible, onClick }:VisibilityButtonProps) => (\n <button\n type=\"button\"\n onClick={onClick}\n className=\"absolute top-1/2 right-3 transform -translate-y-1/2\"\n >\n {isVisible ? <Eye size={16} /> : <EyeOff size={16} />}\n </button>\n);\n\nexport const Input = React.forwardRef<HTMLInputElement, InputProps>(\n ({ type, ...props }, ref) => {\n if (type === 'password') return <PasswordInput type={type} {...props} ref={ref} />;\n return <BaseInput type={type} {...props} ref={ref} />;\n }\n);\nInput.displayName = 'Input';\n"],"names":["BaseInput","React","props","ref","className","variant","type","input","wrapper","onChange","onTransform","fullSize","rest","startAdornment","classNameInputSlotProps","restInputSlotProps","jsxs","cn","jsx","inputVariants","e","PasswordInput","isVisible","setIsVisible","useState","inputType","toggleVisibility","VisibilityButton","onClick","Eye","EyeOff","Input"],"mappings":";;;;;AAOO,MAAMA,IAAYC,EAAM;AAAA,EAC7B,CAACC,GAAOC,MAAQ;AACd,UAAM;AAAA,MACJ,WAAAC;AAAA,MACA,SAAAC;AAAA,MACA,MAAAC;AAAA,MACA,WAAW,EAAE,OAAAC,GAAO,SAAAC,EAAA,IAAY,CAAA;AAAA,MAChC,UAAAC;AAAA,MACA,aAAAC;AAAA,MACA,UAAAC,IAAW;AAAA,MACX,GAAGC;AAAA,IAAA,IACDV,GACE;AAAA,MACJ,gBAAAW;AAAA,MACA,WAAWC;AAAA,MACX,GAAGC;AAAA,IAAA,IACDR,KAAS,CAAA;AACb,WACE,gBAAAS;AAAA,MAAC;AAAA,MAAA;AAAA,QACE,GAAIR,KAAW,CAAA;AAAA,QAChB,WAAWS;AAAA,UACT;AAAA,UACAN,KAAY;AAAA,UACZH,GAAS;AAAA,QAAA;AAAA,QAEV,UAAA;AAAA,UAAA,EAAQK,KACP,gBAAAK,EAAC,QAAA,EAAK,WAAU,iDACb,UAAAL,GACH;AAAA,UAEF,gBAAAK;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,MAAAZ;AAAA,cACA,WAAWW;AAAA,gBACTE,EAAc,EAAE,SAAAd,GAAS,WAAAD,GAAW;AAAA,gBACpC,EAAQS,KAAmB;AAAA,gBAC3BC;AAAA,gBACAH,KAAY;AAAA,cAAA;AAAA,cAEd,KAAAR;AAAA,cACC,GAAGY;AAAA,cACH,GAAGH;AAAA,cACJ,UAAU,CAACQ,MAAM;AACf,gBAAI,OAAOV,IAAcU,EAAE,OAAO,OAAOA,CAAC,KAAM,aAC9CA,EAAE,OAAO,QAAQV,EAAYU,EAAE,OAAO,OAAOA,CAAC,IAE5CX,OAAmBW,CAAC;AAAA,cAC1B;AAAA,YAAA;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AACApB,EAAU,cAAc;AAEjB,MAAMqB,IAAgBpB,EAAM;AAAA,EACjC,CAACC,GAAOC,MAAQ;AACd,UAAM,CAACmB,GAAWC,CAAY,IAAIC,EAAkB,EAAK,GAEnDC,IAAYH,IAAY,SAAS,YAEjCI,IAAmB,MAAM;AAC7B,MAAAH,EAAa,CAACD,CAAS;AAAA,IACzB;AAEA,WACE,gBAAAN,EAAC,OAAA,EAAK,GAAId,GAAO,WAAW,WAAW,CAAA,GAAK,WAAWe,EAAG,YAAYf,GAAO,WAAW,SAAS,SAAS,GACxG,UAAA;AAAA,MAAA,gBAAAgB,EAAClB,KAAW,GAAGE,GAAO,MAAMuB,GAAW,WAAU,QAAO,KAAAtB,GAAU;AAAA,MAClE,gBAAAe,EAACS,GAAA,EAAiB,WAAAL,GAAsB,SAASI,EAAA,CAAkB;AAAA,IAAA,GACrE;AAAA,EAEJ;AACF;AACAL,EAAc,cAAc;AAO5B,MAAMM,IAAmB,CAAC,EAAE,WAAAL,GAAW,SAAAM,QACrC,gBAAAV;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,MAAK;AAAA,IACL,SAAAU;AAAA,IACA,WAAU;AAAA,IAET,UAAAN,sBAAaO,GAAA,EAAI,MAAM,IAAI,IAAK,gBAAAX,EAACY,GAAA,EAAO,MAAM,GAAA,CAAI;AAAA,EAAA;AACrD,GAGWC,IAAQ9B,EAAM;AAAA,EACzB,CAAC,EAAE,MAAAK,GAAM,GAAGJ,EAAA,GAASC,MACfG,MAAS,aAAmB,gBAAAY,EAACG,KAAc,MAAAf,GAAa,GAAGJ,GAAO,KAAAC,GAAU,IACzE,gBAAAe,EAAClB,GAAA,EAAU,MAAAM,GAAa,GAAGJ,GAAO,KAAAC,GAAU;AAEvD;AACA4B,EAAM,cAAc;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inputVariants.d.ts","sourceRoot":"","sources":["../../src/Input/inputVariants.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa;;
|
|
1
|
+
{"version":3,"file":"inputVariants.d.ts","sourceRoot":"","sources":["../../src/Input/inputVariants.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa;;8EAoBzB,CAAC"}
|
package/Input/inputVariants.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { cva as
|
|
2
|
-
const t =
|
|
1
|
+
import { cva as r } from "class-variance-authority";
|
|
2
|
+
const t = r(
|
|
3
3
|
[
|
|
4
|
-
"flex h-10 w-full rounded-
|
|
4
|
+
"flex h-10 w-full rounded-lg border border-input px-3 py-2",
|
|
5
5
|
"text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground",
|
|
6
6
|
"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
|
|
7
7
|
"group-data-[state=invalid]/form-control:border-destructive",
|
|
8
|
-
"group-data-[state=valid]/form-control:border-input"
|
|
8
|
+
"group-data-[state=valid]/form-control:border-input",
|
|
9
|
+
"box-border"
|
|
9
10
|
],
|
|
10
11
|
{
|
|
11
12
|
variants: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inputVariants.js","sources":["../../src/Input/inputVariants.tsx"],"sourcesContent":["import { cva } from 'class-variance-authority';\n\nexport const inputVariants = cva(\n [\n 'flex h-10 w-full rounded-
|
|
1
|
+
{"version":3,"file":"inputVariants.js","sources":["../../src/Input/inputVariants.tsx"],"sourcesContent":["import { cva } from 'class-variance-authority';\n\nexport const inputVariants = cva(\n [\n 'flex h-10 w-full rounded-lg border border-input px-3 py-2',\n 'text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground',\n 'focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50',\n 'group-data-[state=invalid]/form-control:border-destructive',\n 'group-data-[state=valid]/form-control:border-input',\n 'box-border',\n ],\n {\n variants: {\n variant: {\n default: 'bg-background',\n grey: 'bg-slate-200',\n },\n },\n defaultVariants: {\n variant: 'default',\n },\n }\n);\n"],"names":["inputVariants","cva"],"mappings":";AAEO,MAAMA,IAAgBC;AAAA,EAC3B;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAAA,EAEF;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SAAS;AAAA,QACT,MAAM;AAAA,MAAA;AAAA,IACR;AAAA,IAEF,iBAAiB;AAAA,MACf,SAAS;AAAA,IAAA;AAAA,EACX;AAEJ;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoadedIcon.d.ts","sourceRoot":"","sources":["../../src/LoadedIcon/LoadedIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAE7D,OAAO,EAAE,EAAE,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAI9D,QAAA,MAAM,kBAAkB;;
|
|
1
|
+
{"version":3,"file":"LoadedIcon.d.ts","sourceRoot":"","sources":["../../src/LoadedIcon/LoadedIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAE7D,OAAO,EAAE,EAAE,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAI9D,QAAA,MAAM,kBAAkB;;8EAatB,CAAC;AAEH,UAAU,gBACR,SAAQ,cAAc,CAAC,cAAc,CAAC,EACpC,YAAY,CAAC,OAAO,kBAAkB,CAAC;IACzC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,CAY9D,CAAC"}
|
package/LoadedIcon/LoadedIcon.js
CHANGED
|
@@ -2,7 +2,9 @@ import { jsx as s } from "react/jsx-runtime";
|
|
|
2
2
|
import { cva as t } from "class-variance-authority";
|
|
3
3
|
import { LoaderCircleIcon as m } from "lucide-react";
|
|
4
4
|
import { cn as c } from "@oneplatformdev/utils";
|
|
5
|
-
const d = t([
|
|
5
|
+
const d = t([
|
|
6
|
+
"relative"
|
|
7
|
+
], {
|
|
6
8
|
variants: {
|
|
7
9
|
size: {
|
|
8
10
|
inherit: "[&_svg]:size-inherit",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoadedIcon.js","sources":["../../src/LoadedIcon/LoadedIcon.tsx"],"sourcesContent":["import { cva, VariantProps } from 'class-variance-authority';\nimport { LoaderCircleIcon } from 'lucide-react';\nimport { FC, HTMLAttributes, PropsWithChildren } from 'react';\n\nimport { cn } from '@oneplatformdev/utils';\n\nconst loadedIconVariants = cva([], {\n variants: {\n size: {\n inherit: '[&_svg]:size-inherit',\n xs: '[&_svg]:size-3',\n sm: '[&_svg]:size-4',\n md: '[&_svg]:size-5',\n lg: '[&_svg]:size-6',\n },\n },\n defaultVariants: { size: 'inherit' },\n});\n\ninterface ILoadedIconProps\n
|
|
1
|
+
{"version":3,"file":"LoadedIcon.js","sources":["../../src/LoadedIcon/LoadedIcon.tsx"],"sourcesContent":["import { cva, VariantProps } from 'class-variance-authority';\nimport { LoaderCircleIcon } from 'lucide-react';\nimport { FC, HTMLAttributes, PropsWithChildren } from 'react';\n\nimport { cn } from '@oneplatformdev/utils';\n\nconst loadedIconVariants = cva([\n 'relative',\n], {\n variants: {\n size: {\n inherit: '[&_svg]:size-inherit',\n xs: '[&_svg]:size-3',\n sm: '[&_svg]:size-4',\n md: '[&_svg]:size-5',\n lg: '[&_svg]:size-6',\n },\n },\n defaultVariants: { size: 'inherit' },\n});\n\ninterface ILoadedIconProps\n extends HTMLAttributes<HTMLDivElement>,\n VariantProps<typeof loadedIconVariants> {\n loading?: boolean;\n}\n\nexport const LoadedIcon: FC<PropsWithChildren<ILoadedIconProps>> = (props) => {\n const { loading, children, size = 'md', className, ...rest } = props;\n return (\n <div\n {...rest}\n className={cn(loadedIconVariants({ size, className }))}\n >\n {loading\n ? <LoaderCircleIcon className=\"animate-spin\"/>\n : children}\n </div>\n );\n};\n"],"names":["loadedIconVariants","cva","LoadedIcon","props","loading","children","size","className","rest","jsx","cn","LoaderCircleIcon"],"mappings":";;;;AAMA,MAAMA,IAAqBC,EAAI;AAAA,EAC7B;AACF,GAAG;AAAA,EACD,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,SAAS;AAAA,MACT,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IAAA;AAAA,EACN;AAAA,EAEF,iBAAiB,EAAE,MAAM,UAAA;AAC3B,CAAC,GAQYC,IAAsD,CAACC,MAAU;AAC5E,QAAM,EAAE,SAAAC,GAAS,UAAAC,GAAU,MAAAC,IAAO,MAAM,WAAAC,GAAW,GAAGC,MAASL;AAC/D,SACE,gBAAAM;AAAA,IAAC;AAAA,IAAA;AAAA,MACE,GAAGD;AAAA,MACJ,WAAWE,EAAGV,EAAmB,EAAE,MAAAM,GAAM,WAAAC,EAAA,CAAW,CAAC;AAAA,MAEpD,UAAAH,IACG,gBAAAK,EAACE,GAAA,EAAiB,WAAU,gBAAc,IAC1CN;AAAA,IAAA;AAAA,EAAA;AAGV;"}
|
package/Resizable/Resizable.d.ts
CHANGED
|
@@ -1,24 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
1
2
|
import * as ResizablePrimitive from "react-resizable-panels";
|
|
2
|
-
declare
|
|
3
|
-
declare
|
|
4
|
-
|
|
5
|
-
collapsedSize?: number | undefined;
|
|
6
|
-
collapsible?: boolean | undefined;
|
|
7
|
-
defaultSize?: number | undefined;
|
|
8
|
-
id?: string;
|
|
9
|
-
maxSize?: number | undefined;
|
|
10
|
-
minSize?: number | undefined;
|
|
11
|
-
onCollapse?: ResizablePrimitive.PanelOnCollapse;
|
|
12
|
-
onExpand?: ResizablePrimitive.PanelOnExpand;
|
|
13
|
-
onResize?: ResizablePrimitive.PanelOnResize;
|
|
14
|
-
order?: number;
|
|
15
|
-
style?: object;
|
|
16
|
-
tagName?: keyof HTMLElementTagNameMap | undefined;
|
|
17
|
-
} & {
|
|
18
|
-
children?: import('react').ReactNode | undefined;
|
|
19
|
-
} & import('react').RefAttributes<ResizablePrimitive.ImperativePanelHandle>>;
|
|
20
|
-
declare const ResizableHandle: ({ withHandle, className, ...props }: React.ComponentProps<typeof ResizablePrimitive.PanelResizeHandle> & {
|
|
3
|
+
declare function ResizablePanelGroup({ className, ...props }: React.ComponentProps<typeof ResizablePrimitive.PanelGroup>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function ResizablePanel({ ...props }: React.ComponentProps<typeof ResizablePrimitive.Panel>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function ResizableHandle(props: React.ComponentProps<typeof ResizablePrimitive.PanelResizeHandle> & {
|
|
21
6
|
withHandle?: boolean;
|
|
22
|
-
})
|
|
7
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
23
8
|
export { ResizablePanelGroup, ResizablePanel, ResizableHandle };
|
|
24
9
|
//# sourceMappingURL=Resizable.d.ts.map
|