@dimaan/ui 0.0.13 → 0.0.14
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 +125 -69
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +204 -103
- package/dist/index.d.ts +204 -103
- package/dist/index.js +121 -70
- package/dist/index.js.map +1 -1
- package/package.json +1 -2
package/dist/index.cjs
CHANGED
|
@@ -16662,6 +16662,126 @@ function mergeRefs2(...refs) {
|
|
|
16662
16662
|
};
|
|
16663
16663
|
}
|
|
16664
16664
|
|
|
16665
|
+
// src/components/page-header/PageHeader.tsx
|
|
16666
|
+
var import_react_router_dom2 = __toESM(require_dist2());
|
|
16667
|
+
|
|
16668
|
+
// src/components/page-header/pageHeaderVariants.ts
|
|
16669
|
+
var pageHeaderBaseClass = "flex w-full flex-col gap-3";
|
|
16670
|
+
var pageHeaderBorderedClass = "border-b border-border pb-4";
|
|
16671
|
+
var pageHeaderTitleRowClass = "flex flex-wrap items-start justify-between gap-3 sm:gap-4";
|
|
16672
|
+
var pageHeaderTitleBlockClass = "min-w-0 flex-1 space-y-1";
|
|
16673
|
+
var pageHeaderTitleClass = "text-2xl font-semibold tracking-tight text-foreground";
|
|
16674
|
+
var pageHeaderDescriptionClass = "text-sm text-muted-foreground";
|
|
16675
|
+
var pageHeaderActionsClass = "flex shrink-0 flex-wrap items-center gap-2";
|
|
16676
|
+
var pageHeaderBackClass = "inline-flex items-center gap-1.5 self-start text-sm text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40 focus-visible:ring-offset-2 focus-visible:ring-offset-background rounded-md";
|
|
16677
|
+
var pageHeaderBackIconClass = "size-4 shrink-0 rtl:rotate-180";
|
|
16678
|
+
var pageHeaderBreadcrumbsClass = "text-xs text-muted-foreground";
|
|
16679
|
+
var PageHeader = React10.forwardRef(function PageHeader2({
|
|
16680
|
+
title,
|
|
16681
|
+
description,
|
|
16682
|
+
breadcrumbs,
|
|
16683
|
+
back,
|
|
16684
|
+
actions,
|
|
16685
|
+
as = "h1",
|
|
16686
|
+
bordered = false,
|
|
16687
|
+
className,
|
|
16688
|
+
...props
|
|
16689
|
+
}, ref) {
|
|
16690
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
16691
|
+
"header",
|
|
16692
|
+
{
|
|
16693
|
+
ref,
|
|
16694
|
+
"data-slot": "page-header",
|
|
16695
|
+
className: cn(pageHeaderBaseClass, bordered && pageHeaderBorderedClass, className),
|
|
16696
|
+
...props,
|
|
16697
|
+
children: [
|
|
16698
|
+
breadcrumbs ? /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "page-header-breadcrumbs", className: pageHeaderBreadcrumbsClass, children: breadcrumbs }) : null,
|
|
16699
|
+
back ? /* @__PURE__ */ jsxRuntime.jsx(PageHeaderBack, { ...back }) : null,
|
|
16700
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { "data-slot": "page-header-row", className: pageHeaderTitleRowClass, children: [
|
|
16701
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: pageHeaderTitleBlockClass, children: [
|
|
16702
|
+
React10.createElement(
|
|
16703
|
+
as,
|
|
16704
|
+
{ "data-slot": "page-header-title", className: pageHeaderTitleClass },
|
|
16705
|
+
title
|
|
16706
|
+
),
|
|
16707
|
+
description ? /* @__PURE__ */ jsxRuntime.jsx("p", { "data-slot": "page-header-description", className: pageHeaderDescriptionClass, children: description }) : null
|
|
16708
|
+
] }),
|
|
16709
|
+
actions ? /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "page-header-actions", className: pageHeaderActionsClass, children: actions }) : null
|
|
16710
|
+
] })
|
|
16711
|
+
]
|
|
16712
|
+
}
|
|
16713
|
+
);
|
|
16714
|
+
});
|
|
16715
|
+
function PageHeaderBack({ label = "Back", to, onClick, render }) {
|
|
16716
|
+
const inner = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
16717
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowLeft, { className: pageHeaderBackIconClass, "aria-hidden": "true" }),
|
|
16718
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: label })
|
|
16719
|
+
] });
|
|
16720
|
+
if (render) {
|
|
16721
|
+
return render({
|
|
16722
|
+
to,
|
|
16723
|
+
onClick,
|
|
16724
|
+
className: pageHeaderBackClass,
|
|
16725
|
+
children: inner
|
|
16726
|
+
});
|
|
16727
|
+
}
|
|
16728
|
+
if (to) {
|
|
16729
|
+
return /* @__PURE__ */ jsxRuntime.jsx(import_react_router_dom2.Link, { to, onClick, className: pageHeaderBackClass, children: inner });
|
|
16730
|
+
}
|
|
16731
|
+
return /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick, className: pageHeaderBackClass, children: inner });
|
|
16732
|
+
}
|
|
16733
|
+
|
|
16734
|
+
// src/components/form-page/formPageVariants.ts
|
|
16735
|
+
var formPageBaseClass = "flex w-full flex-col gap-6";
|
|
16736
|
+
var formPageBodyClass = "flex-1";
|
|
16737
|
+
var formPageActionsBarClass = "sticky bottom-0 -mx-6 -mb-6 mt-6 flex items-center justify-end gap-2 border-t border-border bg-background/95 px-6 py-3 backdrop-blur supports-[backdrop-filter]:bg-background/80";
|
|
16738
|
+
var formPageSkeletonRowClass = "h-10 w-full animate-pulse rounded-md bg-muted";
|
|
16739
|
+
var DEFAULT_SKELETON_ROW_COUNT = 6;
|
|
16740
|
+
function FormPage({
|
|
16741
|
+
title,
|
|
16742
|
+
description,
|
|
16743
|
+
back,
|
|
16744
|
+
bordered = true,
|
|
16745
|
+
onSubmit,
|
|
16746
|
+
isLoading = false,
|
|
16747
|
+
loadingRowCount = DEFAULT_SKELETON_ROW_COUNT,
|
|
16748
|
+
actions,
|
|
16749
|
+
children,
|
|
16750
|
+
className,
|
|
16751
|
+
formClassName,
|
|
16752
|
+
bodyClassName,
|
|
16753
|
+
actionsClassName
|
|
16754
|
+
}) {
|
|
16755
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-slot": "form-page", className: cn(formPageBaseClass, className), children: [
|
|
16756
|
+
/* @__PURE__ */ jsxRuntime.jsx(PageHeader, { title, description, back, bordered }),
|
|
16757
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
16758
|
+
"form",
|
|
16759
|
+
{
|
|
16760
|
+
onSubmit,
|
|
16761
|
+
"aria-busy": isLoading || void 0,
|
|
16762
|
+
noValidate: true,
|
|
16763
|
+
"data-slot": "form-page-form",
|
|
16764
|
+
className: cn("flex flex-1 flex-col gap-6", formClassName),
|
|
16765
|
+
children: [
|
|
16766
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "form-page-body", className: cn(formPageBodyClass, bodyClassName), children: isLoading ? /* @__PURE__ */ jsxRuntime.jsx(FormPageSkeleton, { rowCount: loadingRowCount }) : children }),
|
|
16767
|
+
actions !== null && actions !== void 0 ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
16768
|
+
"div",
|
|
16769
|
+
{
|
|
16770
|
+
"data-slot": "form-page-actions",
|
|
16771
|
+
className: cn(formPageActionsBarClass, actionsClassName),
|
|
16772
|
+
children: actions
|
|
16773
|
+
}
|
|
16774
|
+
) : null
|
|
16775
|
+
]
|
|
16776
|
+
}
|
|
16777
|
+
)
|
|
16778
|
+
] });
|
|
16779
|
+
}
|
|
16780
|
+
function FormPageSkeleton({ rowCount }) {
|
|
16781
|
+
const rows = Array.from({ length: Math.max(1, rowCount) }, (_, i) => `form-page-skeleton-${i}`);
|
|
16782
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-4", "aria-hidden": "true", children: rows.map((key) => /* @__PURE__ */ jsxRuntime.jsx("div", { "data-testid": "form-page-skeleton-row", className: formPageSkeletonRowClass }, key)) });
|
|
16783
|
+
}
|
|
16784
|
+
|
|
16665
16785
|
// src/components/input/inputVariants.ts
|
|
16666
16786
|
var inputVariantClass = {
|
|
16667
16787
|
default: "border border-input bg-background hover:border-ring",
|
|
@@ -16777,75 +16897,6 @@ function LanguageSwitcher({
|
|
|
16777
16897
|
);
|
|
16778
16898
|
}
|
|
16779
16899
|
|
|
16780
|
-
// src/components/page-header/PageHeader.tsx
|
|
16781
|
-
var import_react_router_dom2 = __toESM(require_dist2());
|
|
16782
|
-
|
|
16783
|
-
// src/components/page-header/pageHeaderVariants.ts
|
|
16784
|
-
var pageHeaderBaseClass = "flex w-full flex-col gap-3";
|
|
16785
|
-
var pageHeaderBorderedClass = "border-b border-border pb-4";
|
|
16786
|
-
var pageHeaderTitleRowClass = "flex flex-wrap items-start justify-between gap-3 sm:gap-4";
|
|
16787
|
-
var pageHeaderTitleBlockClass = "min-w-0 flex-1 space-y-1";
|
|
16788
|
-
var pageHeaderTitleClass = "text-2xl font-semibold tracking-tight text-foreground";
|
|
16789
|
-
var pageHeaderDescriptionClass = "text-sm text-muted-foreground";
|
|
16790
|
-
var pageHeaderActionsClass = "flex shrink-0 flex-wrap items-center gap-2";
|
|
16791
|
-
var pageHeaderBackClass = "inline-flex items-center gap-1.5 self-start text-sm text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40 focus-visible:ring-offset-2 focus-visible:ring-offset-background rounded-md";
|
|
16792
|
-
var pageHeaderBackIconClass = "size-4 shrink-0 rtl:rotate-180";
|
|
16793
|
-
var pageHeaderBreadcrumbsClass = "text-xs text-muted-foreground";
|
|
16794
|
-
var PageHeader = React10.forwardRef(function PageHeader2({
|
|
16795
|
-
title,
|
|
16796
|
-
description,
|
|
16797
|
-
breadcrumbs,
|
|
16798
|
-
back,
|
|
16799
|
-
actions,
|
|
16800
|
-
as = "h1",
|
|
16801
|
-
bordered = false,
|
|
16802
|
-
className,
|
|
16803
|
-
...props
|
|
16804
|
-
}, ref) {
|
|
16805
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
16806
|
-
"header",
|
|
16807
|
-
{
|
|
16808
|
-
ref,
|
|
16809
|
-
"data-slot": "page-header",
|
|
16810
|
-
className: cn(pageHeaderBaseClass, bordered && pageHeaderBorderedClass, className),
|
|
16811
|
-
...props,
|
|
16812
|
-
children: [
|
|
16813
|
-
breadcrumbs ? /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "page-header-breadcrumbs", className: pageHeaderBreadcrumbsClass, children: breadcrumbs }) : null,
|
|
16814
|
-
back ? /* @__PURE__ */ jsxRuntime.jsx(PageHeaderBack, { ...back }) : null,
|
|
16815
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { "data-slot": "page-header-row", className: pageHeaderTitleRowClass, children: [
|
|
16816
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: pageHeaderTitleBlockClass, children: [
|
|
16817
|
-
React10.createElement(
|
|
16818
|
-
as,
|
|
16819
|
-
{ "data-slot": "page-header-title", className: pageHeaderTitleClass },
|
|
16820
|
-
title
|
|
16821
|
-
),
|
|
16822
|
-
description ? /* @__PURE__ */ jsxRuntime.jsx("p", { "data-slot": "page-header-description", className: pageHeaderDescriptionClass, children: description }) : null
|
|
16823
|
-
] }),
|
|
16824
|
-
actions ? /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "page-header-actions", className: pageHeaderActionsClass, children: actions }) : null
|
|
16825
|
-
] })
|
|
16826
|
-
]
|
|
16827
|
-
}
|
|
16828
|
-
);
|
|
16829
|
-
});
|
|
16830
|
-
function PageHeaderBack({ label = "Back", to, onClick, render }) {
|
|
16831
|
-
const inner = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
16832
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowLeft, { className: pageHeaderBackIconClass, "aria-hidden": "true" }),
|
|
16833
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children: label })
|
|
16834
|
-
] });
|
|
16835
|
-
if (render) {
|
|
16836
|
-
return render({
|
|
16837
|
-
to,
|
|
16838
|
-
onClick,
|
|
16839
|
-
className: pageHeaderBackClass,
|
|
16840
|
-
children: inner
|
|
16841
|
-
});
|
|
16842
|
-
}
|
|
16843
|
-
if (to) {
|
|
16844
|
-
return /* @__PURE__ */ jsxRuntime.jsx(import_react_router_dom2.Link, { to, onClick, className: pageHeaderBackClass, children: inner });
|
|
16845
|
-
}
|
|
16846
|
-
return /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick, className: pageHeaderBackClass, children: inner });
|
|
16847
|
-
}
|
|
16848
|
-
|
|
16849
16900
|
// src/components/select/selectVariants.ts
|
|
16850
16901
|
var selectVariantClass = {
|
|
16851
16902
|
default: "border border-input bg-background hover:border-ring",
|
|
@@ -17941,6 +17992,7 @@ exports.DropdownMenuShortcut = DropdownMenuShortcut;
|
|
|
17941
17992
|
exports.DropdownMenuTrigger = DropdownMenuTrigger;
|
|
17942
17993
|
exports.EmptyState = EmptyState;
|
|
17943
17994
|
exports.Field = Field;
|
|
17995
|
+
exports.FormPage = FormPage;
|
|
17944
17996
|
exports.HeaderActions = HeaderActions;
|
|
17945
17997
|
exports.HeaderCollapseTrigger = HeaderCollapseTrigger;
|
|
17946
17998
|
exports.HeaderMobileTrigger = HeaderMobileTrigger;
|
|
@@ -18007,6 +18059,10 @@ exports.emptyStateDescriptionSizeClass = emptyStateDescriptionSizeClass;
|
|
|
18007
18059
|
exports.emptyStateIconWrapperBaseClass = emptyStateIconWrapperBaseClass;
|
|
18008
18060
|
exports.emptyStateIconWrapperSizeClass = emptyStateIconWrapperSizeClass;
|
|
18009
18061
|
exports.emptyStateTitleSizeClass = emptyStateTitleSizeClass;
|
|
18062
|
+
exports.formPageActionsBarClass = formPageActionsBarClass;
|
|
18063
|
+
exports.formPageBaseClass = formPageBaseClass;
|
|
18064
|
+
exports.formPageBodyClass = formPageBodyClass;
|
|
18065
|
+
exports.formPageSkeletonRowClass = formPageSkeletonRowClass;
|
|
18010
18066
|
exports.inputBaseClass = inputBaseClass;
|
|
18011
18067
|
exports.inputSizeClass = inputSizeClass;
|
|
18012
18068
|
exports.inputVariantClass = inputVariantClass;
|