@facter/ds-core 1.3.2 → 1.4.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.d.mts +2 -7
- package/dist/index.d.ts +2 -7
- package/dist/index.js +47 -70
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +36 -64
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -15,7 +15,8 @@ import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
|
15
15
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
16
16
|
import { toast as toast$1, Toaster as Toaster$1 } from 'sonner';
|
|
17
17
|
import * as SwitchPrimitives from '@radix-ui/react-switch';
|
|
18
|
-
import {
|
|
18
|
+
import { FormProvider, useFormContext, Controller } from 'react-hook-form';
|
|
19
|
+
export { FormProvider, useFormContext } from 'react-hook-form';
|
|
19
20
|
import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
|
|
20
21
|
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
21
22
|
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
@@ -2975,21 +2976,6 @@ var Textarea = React48.memo(
|
|
|
2975
2976
|
)
|
|
2976
2977
|
);
|
|
2977
2978
|
Textarea.displayName = "Textarea";
|
|
2978
|
-
var FormContext = React48.createContext(null);
|
|
2979
|
-
function useFormContext() {
|
|
2980
|
-
const context = React48.useContext(FormContext);
|
|
2981
|
-
if (!context) {
|
|
2982
|
-
throw new Error("useFormContext must be used within a Form provider");
|
|
2983
|
-
}
|
|
2984
|
-
return context.form;
|
|
2985
|
-
}
|
|
2986
|
-
function FormProvider({
|
|
2987
|
-
form,
|
|
2988
|
-
children
|
|
2989
|
-
}) {
|
|
2990
|
-
const value = React48.useMemo(() => ({ form }), [form]);
|
|
2991
|
-
return /* @__PURE__ */ jsx(FormContext.Provider, { value, children });
|
|
2992
|
-
}
|
|
2993
2979
|
var FormFieldContext = React48.createContext(null);
|
|
2994
2980
|
function useFormFieldContext() {
|
|
2995
2981
|
const context = React48.useContext(FormFieldContext);
|
|
@@ -3006,15 +2992,14 @@ function FormFieldProvider({ name, children }) {
|
|
|
3006
2992
|
const id = React48.useId();
|
|
3007
2993
|
const fieldState = form.getFieldState(name, form.formState);
|
|
3008
2994
|
const error = fieldState.error?.message;
|
|
3009
|
-
const isRequired = false;
|
|
3010
2995
|
const value = React48.useMemo(
|
|
3011
2996
|
() => ({
|
|
3012
2997
|
name,
|
|
3013
2998
|
id,
|
|
3014
2999
|
error,
|
|
3015
|
-
isRequired
|
|
3000
|
+
isRequired: false
|
|
3016
3001
|
}),
|
|
3017
|
-
[name, id, error
|
|
3002
|
+
[name, id, error]
|
|
3018
3003
|
);
|
|
3019
3004
|
return /* @__PURE__ */ jsx(FormFieldContext.Provider, { value, children });
|
|
3020
3005
|
}
|
|
@@ -3578,7 +3563,7 @@ function FormRoot({
|
|
|
3578
3563
|
className,
|
|
3579
3564
|
...props
|
|
3580
3565
|
}) {
|
|
3581
|
-
return /* @__PURE__ */ jsx(FormProvider, { form, children: /* @__PURE__ */ jsx(
|
|
3566
|
+
return /* @__PURE__ */ jsx(FormProvider, { ...form, children: /* @__PURE__ */ jsx(
|
|
3582
3567
|
"form",
|
|
3583
3568
|
{
|
|
3584
3569
|
onSubmit: form.handleSubmit(onSubmit, onError),
|
|
@@ -6820,18 +6805,18 @@ function WizardNavigation({
|
|
|
6820
6805
|
"div",
|
|
6821
6806
|
{
|
|
6822
6807
|
className: cn(
|
|
6823
|
-
"
|
|
6808
|
+
"grid grid-cols-2 gap-3 pt-4 border-t border-border",
|
|
6824
6809
|
className
|
|
6825
6810
|
),
|
|
6826
6811
|
children: [
|
|
6827
|
-
|
|
6812
|
+
shouldShowCancel && onCancel ? /* @__PURE__ */ jsx(
|
|
6828
6813
|
Button,
|
|
6829
6814
|
{
|
|
6830
6815
|
type: "button",
|
|
6831
6816
|
variant: "outline",
|
|
6832
6817
|
onClick: handleCancel,
|
|
6833
6818
|
disabled: isSubmitting,
|
|
6834
|
-
className: "w-full
|
|
6819
|
+
className: "w-full",
|
|
6835
6820
|
children: cancelLabel
|
|
6836
6821
|
},
|
|
6837
6822
|
"cancel"
|
|
@@ -6842,47 +6827,34 @@ function WizardNavigation({
|
|
|
6842
6827
|
variant: "outline",
|
|
6843
6828
|
onClick: handlePrev,
|
|
6844
6829
|
disabled: isSubmitting,
|
|
6845
|
-
className: "w-full
|
|
6830
|
+
className: "w-full",
|
|
6846
6831
|
children: prevLabel
|
|
6847
6832
|
},
|
|
6848
|
-
"prev
|
|
6849
|
-
) : /* @__PURE__ */ jsx("div", {})
|
|
6850
|
-
/* @__PURE__ */
|
|
6851
|
-
|
|
6852
|
-
|
|
6853
|
-
|
|
6854
|
-
|
|
6855
|
-
|
|
6856
|
-
|
|
6857
|
-
|
|
6858
|
-
|
|
6859
|
-
}
|
|
6860
|
-
|
|
6861
|
-
|
|
6862
|
-
|
|
6863
|
-
|
|
6864
|
-
|
|
6865
|
-
|
|
6866
|
-
|
|
6867
|
-
|
|
6868
|
-
|
|
6869
|
-
|
|
6870
|
-
|
|
6871
|
-
|
|
6872
|
-
|
|
6873
|
-
`submit-step-${currentStep}`
|
|
6874
|
-
) : /* @__PURE__ */ jsx(
|
|
6875
|
-
Button,
|
|
6876
|
-
{
|
|
6877
|
-
type: "button",
|
|
6878
|
-
onClick: handleNext,
|
|
6879
|
-
disabled: isSubmitting,
|
|
6880
|
-
className: "min-w-[120px]",
|
|
6881
|
-
children: nextLabel
|
|
6882
|
-
},
|
|
6883
|
-
`next-step-${currentStep}`
|
|
6884
|
-
)
|
|
6885
|
-
] })
|
|
6833
|
+
"prev"
|
|
6834
|
+
) : /* @__PURE__ */ jsx("div", {}),
|
|
6835
|
+
isLastStep ? /* @__PURE__ */ jsx(
|
|
6836
|
+
Button,
|
|
6837
|
+
{
|
|
6838
|
+
type: "submit",
|
|
6839
|
+
disabled: submitDisabled || isSubmitting,
|
|
6840
|
+
className: "w-full",
|
|
6841
|
+
children: isSubmitting ? /* @__PURE__ */ jsxs("span", { className: "flex items-center justify-center gap-2", children: [
|
|
6842
|
+
/* @__PURE__ */ jsx(Loader, { variant: "spinner" }),
|
|
6843
|
+
loadingLabel
|
|
6844
|
+
] }) : submitLabel
|
|
6845
|
+
},
|
|
6846
|
+
`submit-step-${currentStep}`
|
|
6847
|
+
) : /* @__PURE__ */ jsx(
|
|
6848
|
+
Button,
|
|
6849
|
+
{
|
|
6850
|
+
type: "button",
|
|
6851
|
+
onClick: handleNext,
|
|
6852
|
+
disabled: isSubmitting,
|
|
6853
|
+
className: "w-full",
|
|
6854
|
+
children: nextLabel
|
|
6855
|
+
},
|
|
6856
|
+
`next-step-${currentStep}`
|
|
6857
|
+
)
|
|
6886
6858
|
]
|
|
6887
6859
|
}
|
|
6888
6860
|
);
|
|
@@ -6952,7 +6924,7 @@ function WizardRoot({
|
|
|
6952
6924
|
onComplete,
|
|
6953
6925
|
validateOnNext,
|
|
6954
6926
|
allowJumpToStep,
|
|
6955
|
-
children: /* @__PURE__ */ jsx(FormProvider
|
|
6927
|
+
children: /* @__PURE__ */ jsx(FormProvider, { ...form, children: /* @__PURE__ */ jsx(
|
|
6956
6928
|
"form",
|
|
6957
6929
|
{
|
|
6958
6930
|
onSubmit: form.handleSubmit(handleSubmit),
|
|
@@ -7118,6 +7090,6 @@ var THEME_INFO = {
|
|
|
7118
7090
|
}
|
|
7119
7091
|
};
|
|
7120
7092
|
|
|
7121
|
-
export { AuthLayout, Avatar, AvatarFallback, AvatarImage, Badge, BigNumberCard, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, DENSITY_CONFIG, DashboardLayout, DataTable, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DialogWrapper, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, FACTER_THEMES, Form, FormCheckbox, FormDescription, FormError, FormFieldProvider, FormFieldWrapper, FormInput, FormLabel,
|
|
7093
|
+
export { AuthLayout, Avatar, AvatarFallback, AvatarImage, Badge, BigNumberCard, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, DENSITY_CONFIG, DashboardLayout, DataTable, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DialogWrapper, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, EmptyState, FACTER_THEMES, Form, FormCheckbox, FormDescription, FormError, FormFieldProvider, FormFieldWrapper, FormInput, FormLabel, FormRadioGroup, FormSelect, FormSwitch, FormTextarea, GlobalLoaderController, Input, Kanban, Loader, LoaderProvider, Logo, MobileNav, MobileNavItem, Navbar, NavbarCompanyProfile, NavbarNotification, NavbarUserMenu, Popover, PopoverContent, PopoverTrigger, RippleBackground, RippleEffect, RippleWrapper, ScrollArea, ScrollBar, SectionHeader, SectionHeaderActions, SectionHeaderBadge, SectionHeaderContent, SectionHeaderIcon, SectionHeaderRoot, SectionHeaderSubtitle, SectionHeaderTitle, Select, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectionLayout, Separator3 as Separator, Sidebar, Skeleton, Sparkline, Switch, THEME_INFO, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, ThemeProvider, ThemeToggle, Toaster, Wizard, WizardContent, WizardNavigation, WizardPanel, WizardProgress, WizardProvider, WizardStepConnector, WizardStepIndicator, WizardSteps, cn, loader, toast, useDashboardLayout, useDataTable, useDataTableColumnVisibility, useDataTableDensity, useDataTableEmpty, useDataTableInstance, useDataTableLoading, useDataTableMeta, useDataTablePagination, useDataTableSelection, useDataTableSorting, useDataTableState, useDebounce, useDebouncedCallback, useFormFieldContext, useKanban, useKanbanOptional, useLoader, useMediaQuery2 as useMediaQuery, useSidebar, useSidebarOptional, useTheme, useWizardContext, useWizardContextOptional };
|
|
7122
7094
|
//# sourceMappingURL=index.mjs.map
|
|
7123
7095
|
//# sourceMappingURL=index.mjs.map
|