-
-
-
+
+
+
{items}
-
+
;
diff --git a/src/app/pages/public/cart/index.tsx b/src/app/pages/public/cart/index.tsx
index 6d8ab3e..2a6234a 100644
--- a/src/app/pages/public/cart/index.tsx
+++ b/src/app/pages/public/cart/index.tsx
@@ -1,4 +1,4 @@
-import { cn } from '@/lib/utils/tailwindcss';
+import { cn } from '@/lib/utils';
import { useGalleryTranslations } from '@/app/hooks/locales/translations/pages/public';
import { useCartCalculator } from '@/app/hooks/features/carts/useCartCalculator';
import * as page from '@/app/utils/page';
diff --git a/src/app/pages/public/cart/item/buttons.tsx b/src/app/pages/public/cart/item/buttons.tsx
index 1840043..a7e6ec6 100644
--- a/src/app/pages/public/cart/item/buttons.tsx
+++ b/src/app/pages/public/cart/item/buttons.tsx
@@ -1,7 +1,6 @@
import { Trash } from 'lucide-react';
import { useGalleryTranslations } from '@/app/hooks/locales/translations/pages/public';
-import { Checkbox } from '@/app/components/ui/checkbox';
-import { Button } from '@/app/components/ui/button';
+import { Button, Checkbox } from '@/app/components/ui';
import { Children } from '@/types/react';
type Props = {
diff --git a/src/app/pages/public/cart/item/quantity.tsx b/src/app/pages/public/cart/item/quantity.tsx
index 6a8d831..477edd7 100644
--- a/src/app/pages/public/cart/item/quantity.tsx
+++ b/src/app/pages/public/cart/item/quantity.tsx
@@ -1,5 +1,5 @@
import { Minus, Plus } from 'lucide-react';
-import { Button } from '@/app/components/ui/button';
+import { Button } from '@/app/components/ui';
type Props = {
value: number;
diff --git a/src/app/pages/public/cart/list.tsx b/src/app/pages/public/cart/list.tsx
index a5c1e32..8106c30 100644
--- a/src/app/pages/public/cart/list.tsx
+++ b/src/app/pages/public/cart/list.tsx
@@ -1,7 +1,7 @@
import { Link } from '@tanstack/react-router';
import { useGalleryTranslations } from '@/app/hooks/locales/translations/pages/public';
import { useCartStore } from '@/app/hooks/stores/useCartStore';
-import { ScrollArea } from '@/app/components/ui/scroll-area';
+import { scroll } from '@/app/components/ui';
import Item from './item';
type Set = (productId: string, cost: number, acc?: boolean) => void;
@@ -12,7 +12,7 @@ const List = ({ set }: Props) => {
return (
-
+
{items?.length ? (
items.map((x) => (
@@ -39,7 +39,7 @@ const List = ({ set }: Props) => {
)}
-
+
);
};
diff --git a/src/app/pages/public/cart/money.tsx b/src/app/pages/public/cart/money.tsx
index 3f393d8..90fc9d1 100644
--- a/src/app/pages/public/cart/money.tsx
+++ b/src/app/pages/public/cart/money.tsx
@@ -1,8 +1,8 @@
+import { ClassName } from '@/types/react';
import { useGalleryTranslations } from '@/app/hooks/locales/translations/pages/public';
-type Props = {
+type Props = ClassName & {
money: { product: string; print: string; total: string };
- className?: string;
separator?: string;
withSigns?: boolean;
};
diff --git a/src/app/pages/public/editor/buttons/next.tsx b/src/app/pages/public/editor/buttons/next.tsx
index 83fa00d..c638e1d 100644
--- a/src/app/pages/public/editor/buttons/next.tsx
+++ b/src/app/pages/public/editor/buttons/next.tsx
@@ -23,10 +23,14 @@ const NextButton = ({ id, cad, save }: Props) => {
infill: useEditorStore(cad.id, (state) => state.infill),
};
- if (!id) return
;
- const next = () => save({ ...request, id });
-
- return
{tEditor('next')};
+ return (
+
save({ ...request, id: id! })}
+ >
+ {id ? tEditor('next') : }
+
+ );
};
export default NextButton;
diff --git a/src/app/pages/public/editor/general/button.tsx b/src/app/pages/public/editor/general/button.tsx
index 49d989a..68c7e8b 100644
--- a/src/app/pages/public/editor/general/button.tsx
+++ b/src/app/pages/public/editor/general/button.tsx
@@ -1,12 +1,13 @@
import { Children } from '@/types/react';
-import { Button } from '@/app/components/ui/button';
+import { Button } from '@/app/components/ui';
-type Props = { onClick?: VoidFunction } & Children;
-const GeneralButton = ({ children, onClick }: Props) => (
+type Props = { onClick?: VoidFunction; disabled?: boolean } & Children;
+const GeneralButton = ({ children, disabled, onClick }: Props) => (
diff --git a/src/app/pages/public/editor/general/section.tsx b/src/app/pages/public/editor/general/section.tsx
index 1a16933..95c53c1 100644
--- a/src/app/pages/public/editor/general/section.tsx
+++ b/src/app/pages/public/editor/general/section.tsx
@@ -1,7 +1,7 @@
-import { Children } from '@/types/react';
-import { cn } from '@/lib/utils/tailwindcss';
+import { Children, ClassName } from '@/types/react';
+import { cn } from '@/lib/utils';
-type Props = { className?: string } & Children;
+type Props = Children & ClassName;
const GeneralSection = ({ children, className }: Props) => (
{children}
diff --git a/src/app/pages/public/editor/hooks/useRadioGroups.tsx b/src/app/pages/public/editor/hooks/useRadioGroups.tsx
index 6196cd2..5f66c7c 100644
--- a/src/app/pages/public/editor/hooks/useRadioGroups.tsx
+++ b/src/app/pages/public/editor/hooks/useRadioGroups.tsx
@@ -1,7 +1,7 @@
import React, { useState } from 'react';
import type { Distance, Mass } from '@/types/units';
import RadioField from '@/app/components/fields/radio';
-import { RadioGroup } from '@/app/components/ui/radio-group';
+import { Root } from '@/app/components/ui/radio-group';
export const useRadioGroups = () => {
const [distance, setDistance] = useState('mm');
@@ -12,8 +12,8 @@ export const useRadioGroups = () => {
mass,
ui: {
distance: (metrics: Distance[]) => ({
- Wrapper: (props: React.ComponentProps) => (
- ) => (
+ setDistance(x as Distance)}
@@ -25,8 +25,8 @@ export const useRadioGroups = () => {
)),
}),
mass: (metrics: Mass[]) => ({
- Wrapper: (props: React.ComponentProps) => (
- ) => (
+ setMass(x as Mass)}
diff --git a/src/app/pages/public/editor/index.tsx b/src/app/pages/public/editor/index.tsx
index 25b7849..2ce445d 100644
--- a/src/app/pages/public/editor/index.tsx
+++ b/src/app/pages/public/editor/index.tsx
@@ -1,6 +1,6 @@
import { getRouteApi } from '@tanstack/react-router';
import { useQuery } from '@customcads/react-sdk';
-import { cn } from '@/lib/utils/tailwindcss';
+import { cn } from '@/lib/utils';
import * as editor from '@/app/stores/editor';
import { useEditorStore } from '@/app/hooks/stores/useEditorStore';
import { useCartItemEditor } from '@/app/hooks/features/carts/useCartItemEditor';
diff --git a/src/app/pages/public/editor/info/dimensions.tsx b/src/app/pages/public/editor/info/dimensions.tsx
index b7e3849..b34277a 100644
--- a/src/app/pages/public/editor/info/dimensions.tsx
+++ b/src/app/pages/public/editor/info/dimensions.tsx
@@ -1,5 +1,5 @@
import type { Distance } from '@/types/units';
-import * as units from '@/lib/utils/units';
+import { units } from '@/lib/utils';
import { useEditorStore } from '@/app/hooks/stores/useEditorStore';
import { useCommonTranslations } from '@/app/hooks/locales/translations/common';
import * as calculate3D from '@/app/utils/calculate-3D';
diff --git a/src/app/pages/public/editor/info/print.tsx b/src/app/pages/public/editor/info/print.tsx
index 3901ee2..830c99e 100644
--- a/src/app/pages/public/editor/info/print.tsx
+++ b/src/app/pages/public/editor/info/print.tsx
@@ -1,5 +1,5 @@
-import type { Mass } from '@/types/units';
-import * as units from '@/lib/utils/units';
+import { type Mass } from '@/types/units';
+import { units } from '@/lib/utils';
import { useEditorStore } from '@/app/hooks/stores/useEditorStore';
import { useMoneyFormatter } from '@/app/hooks/locales/useMoneyFormatter';
import { useGalleryTranslations } from '@/app/hooks/locales/translations/pages/public';
diff --git a/src/app/pages/public/editor/looks/color.tsx b/src/app/pages/public/editor/looks/color.tsx
index 5a503cd..cdcfe0c 100644
--- a/src/app/pages/public/editor/looks/color.tsx
+++ b/src/app/pages/public/editor/looks/color.tsx
@@ -2,9 +2,7 @@ import { X } from 'lucide-react';
import * as editor from '@/app/stores/editor';
import { useGalleryTranslations } from '@/app/hooks/locales/translations/pages/public';
import { useEditorStore } from '@/app/hooks/stores/useEditorStore';
-import { Button } from '@/app/components/ui/button';
-import { Input } from '@/app/components/ui/input';
-import { Label } from '@/app/components/ui/label';
+import { Button, Input, Label } from '@/app/components/ui';
const Color = ({ id }: { id: string }) => {
const tEditor = useGalleryTranslations('editor');
diff --git a/src/app/pages/public/editor/looks/dropdown.tsx b/src/app/pages/public/editor/looks/dropdown.tsx
index 5ec53ee..e68fd45 100644
--- a/src/app/pages/public/editor/looks/dropdown.tsx
+++ b/src/app/pages/public/editor/looks/dropdown.tsx
@@ -1,12 +1,8 @@
import { type MaterialResponse } from '@customcads/react-sdk';
import { Children } from '@/types/react';
-import { cn } from '@/lib/utils/tailwindcss';
+import { cn } from '@/lib/utils';
import { useMoneyFormatter } from '@/app/hooks/locales/useMoneyFormatter';
-import {
- DropdownMenu,
- DropdownMenuContent,
- DropdownMenuTrigger,
-} from '@/app/components/ui/dropdown-menu';
+import * as dropdownMenu from '@/app/components/ui/dropdown-menu';
import * as materials_utils from '@/app/utils/materials';
type Props = {
@@ -23,9 +19,9 @@ const MaterialsDropdown = ({
const formatMoney = useMoneyFormatter();
return (
-
- {children}
-
+
+ {children}
+
{materials.map((x) => (
-
))}
-
-
+
+
);
};
diff --git a/src/app/pages/public/editor/range/infill.tsx b/src/app/pages/public/editor/range/infill.tsx
index 2142f4d..fae10e1 100644
--- a/src/app/pages/public/editor/range/infill.tsx
+++ b/src/app/pages/public/editor/range/infill.tsx
@@ -1,16 +1,10 @@
import { CircleQuestionMark } from 'lucide-react';
-import * as units from '@/lib/utils/units';
-import { cn } from '@/lib/utils/tailwindcss';
+import { cn, units } from '@/lib/utils';
import { INFILL } from '@/app/constants/threejs';
import * as editor from '@/app/stores/editor';
import { useEditorStore } from '@/app/hooks/stores/useEditorStore';
import { useGalleryTranslations } from '@/app/hooks/locales/translations/pages/public';
-import {
- Tooltip,
- TooltipContent,
- TooltipTrigger,
-} from '@/app/components/ui/tooltip';
-import RangeUi from './ui';
+import { tooltip, Slider } from '@/app/components/ui';
const InfillRange = ({ id }: { id: string }) => {
const tEditor = useGalleryTranslations('editor');
@@ -19,37 +13,36 @@ const InfillRange = ({ id }: { id: string }) => {
const infill = useEditorStore(id, (state) => state.infill);
return (
- actions.set.infill(e.sortedValues[0])}
- stepSize={0.0001}
- >
-
-
-
-
-
-
-
- {tEditor('infill-description')}
-
-
- {tEditor('infill')}:
- {units.percentage(100 * infill)}
-
-
0.3 && 'opacity-100',
- )}
- >
- ({tEditor('unrecommended')})
-
-
-
+
+
+
+
+
+
+
+ {tEditor('infill-description')}
+
+
+ {tEditor('infill')}:
+ {units.percentage(100 * infill)}
+
+
actions.set.infill(values[0])}
+ />
+ 0.3 && 'opacity-100',
+ )}
+ >
+ ({tEditor('unrecommended')})
+
+
);
};
diff --git a/src/app/pages/public/editor/range/scale.tsx b/src/app/pages/public/editor/range/scale.tsx
index 9f707f3..02e0652 100644
--- a/src/app/pages/public/editor/range/scale.tsx
+++ b/src/app/pages/public/editor/range/scale.tsx
@@ -1,9 +1,9 @@
-import * as units from '@/lib/utils/units';
+import { units } from '@/lib/utils';
import * as editor from '@/app/stores/editor';
import { useEditorStore } from '@/app/hooks/stores/useEditorStore';
import { useGalleryTranslations } from '@/app/hooks/locales/translations/pages/public';
+import { Slider } from '@/app/components/ui';
import * as calculate3D from '@/app/utils/calculate-3D';
-import RangeUi from './ui';
const ScaleRange = ({ id }: { id: string }) => {
const state = {
@@ -16,17 +16,18 @@ const ScaleRange = ({ id }: { id: string }) => {
const ratio = calculate3D.baseRatio(state.size);
return (
- actions.set.scale(e.sortedValues[0])}
- stepSize={0.0001}
- >
+
{tEditor('scale')}: {units.percentage(100 * state.scale)}
-
+ actions.set.scale(values[0])}
+ size={0.0001}
+ />
+
);
};
diff --git a/src/app/pages/public/editor/range/ui.tsx b/src/app/pages/public/editor/range/ui.tsx
deleted file mode 100644
index c5b599c..0000000
--- a/src/app/pages/public/editor/range/ui.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-import type { Children } from '@/types/react';
-import RangeField from '@/app/components/fields/range';
-
-type Props = React.ComponentProps & Children;
-const RangeUi = ({ children, ...props }: Props) => (
-
- {children}
-
-
-);
-
-export default RangeUi;
diff --git a/src/app/pages/public/editor/side.tsx b/src/app/pages/public/editor/side.tsx
index 0c3b92f..d6891cc 100644
--- a/src/app/pages/public/editor/side.tsx
+++ b/src/app/pages/public/editor/side.tsx
@@ -1,12 +1,12 @@
import { Children } from '@/types/react';
-import { cn } from '@/lib/utils/tailwindcss';
+import { cn } from '@/lib/utils';
type Props = { orientation: 'left' | 'right' } & Children;
const Side = ({ children, orientation }: Props) => (
{
diff --git a/src/app/pages/public/gallery/index.tsx b/src/app/pages/public/gallery/index.tsx
index e6dea08..d9fbf67 100644
--- a/src/app/pages/public/gallery/index.tsx
+++ b/src/app/pages/public/gallery/index.tsx
@@ -1,6 +1,6 @@
import { getRouteApi } from '@tanstack/react-router';
import { useQuery } from '@customcads/react-sdk';
-import { cn } from '@/lib/utils/tailwindcss';
+import { cn } from '@/lib/utils';
import * as page from '@/app/utils/page';
import Bars from './bars';
import List from './list';
diff --git a/src/app/pages/public/gallery/item.tsx b/src/app/pages/public/gallery/item.tsx
index 739d3b5..3b621af 100644
--- a/src/app/pages/public/gallery/item.tsx
+++ b/src/app/pages/public/gallery/item.tsx
@@ -4,7 +4,7 @@ import {
type GalleryAllProductsResponse,
} from '@customcads/react-sdk';
import { Banknote, Eye } from 'lucide-react';
-import { cn } from '@/lib/utils/tailwindcss';
+import { cn } from '@/lib/utils';
const Item = ({ product }: { product: GalleryAllProductsResponse }) => {
const { data: image } = useQuery(
diff --git a/src/app/pages/public/gallery/list.tsx b/src/app/pages/public/gallery/list.tsx
index ff1ba75..3563f35 100644
--- a/src/app/pages/public/gallery/list.tsx
+++ b/src/app/pages/public/gallery/list.tsx
@@ -1,5 +1,5 @@
import { ApiResult, GalleryAllProductsResponse } from '@customcads/react-sdk';
-import { cn } from '@/lib/utils/tailwindcss';
+import { cn } from '@/lib/utils';
import { useCommonTranslations } from '@/app/hooks/locales/translations/common';
import Item from './item';
diff --git a/src/app/pages/public/home/index.tsx b/src/app/pages/public/home/index.tsx
index 4a529c1..0b5d2e6 100644
--- a/src/app/pages/public/home/index.tsx
+++ b/src/app/pages/public/home/index.tsx
@@ -1,5 +1,5 @@
-import { cn } from '@/lib/utils/tailwindcss';
-import { buildPrefixedGetter } from '@/lib/utils/typescript';
+import { cn } from '@/lib/utils';
+import { typescript } from '@/lib/utils';
import { useInfoTranslations } from '@/app/hooks/locales/translations/pages/public';
import * as page from '@/app/utils/page';
import Section1 from './section-1';
@@ -9,7 +9,9 @@ const Home = () => {
return (
-
+
);
};
diff --git a/src/app/pages/public/home/section-1/button.tsx b/src/app/pages/public/home/section-1/button.tsx
index 1a02fca..9445aab 100644
--- a/src/app/pages/public/home/section-1/button.tsx
+++ b/src/app/pages/public/home/section-1/button.tsx
@@ -1,5 +1,5 @@
import { Link, LinkProps } from '@tanstack/react-router';
-import { cn } from '@/lib/utils/tailwindcss';
+import { cn } from '@/lib/utils';
type Props = { text: string; to: LinkProps['to'] };
const Button = ({ text, to }: Props) => (
@@ -7,7 +7,7 @@ const Button = ({ text, to }: Props) => (
to={to}
className={cn(
'font-bold text-foreground text-center bg-secondary px-4 md:px-12 py-3 rounded-lg', // common
- 'border-primary border-1 shadow-primary shadow-lg', // light
+ 'border-primary border shadow-primary shadow-lg', // light
'dark:shadow-background dark:shadow-lg', // dark
'hover:opacity-60 transition duraton-200', // animation
)}
diff --git a/src/app/pages/public/home/section-1/index.tsx b/src/app/pages/public/home/section-1/index.tsx
index a041c28..1ac2706 100644
--- a/src/app/pages/public/home/section-1/index.tsx
+++ b/src/app/pages/public/home/section-1/index.tsx
@@ -1,9 +1,10 @@
-import { cn } from '@/lib/utils/tailwindcss';
-import { SuffixOf } from '@/lib/utils/typescript';
+import { cn, typescript } from '@/lib/utils';
import { Home } from '@/app/locales/types/pages/public/info';
import Button from './button';
-type Props = { tSection1: (key: SuffixOf
) => string };
+type Props = {
+ tSection1: (key: typescript.SuffixOf) => string;
+};
const Section1 = ({ tSection1 }: Props) => (
-
-
-
+
+
);
};
diff --git a/src/app/pages/public/product/info/hooks/useButtons.tsx b/src/app/pages/public/product/info/hooks/useButtons.tsx
index d1f1a07..c4461a0 100644
--- a/src/app/pages/public/product/info/hooks/useButtons.tsx
+++ b/src/app/pages/public/product/info/hooks/useButtons.tsx
@@ -1,9 +1,9 @@
import { useState } from 'react';
import { HeartMinus, HeartPlus, ListCheck, ListPlus } from 'lucide-react';
-import { cn } from '@/lib/utils/tailwindcss';
+import { cn } from '@/lib/utils';
import { useGalleryTranslations } from '@/app/hooks/locales/translations/pages/public';
import { useCartStore } from '@/app/hooks/stores/useCartStore';
-import { Button } from '@/app/components/ui/button';
+import { Button } from '@/app/components/ui';
import * as productTags from '@/app/utils/product-tags';
import AddToCartButton from '../add';
diff --git a/src/app/stores/auth.ts b/src/app/stores/auth.ts
index 4be84e9..00a1bb0 100644
--- a/src/app/stores/auth.ts
+++ b/src/app/stores/auth.ts
@@ -1,21 +1,21 @@
import { Store } from '@tanstack/store';
-import { getRoleCookie } from '@/lib/isomorphic/api';
+import { getRoleCookie } from '@/lib/isomorphic';
import { getStore } from '@/lib/isomorphic/store';
-type AuthState = {
+type State = {
authn: boolean;
authz: string | null;
};
-const getDefaultState = (role?: string): AuthState => ({
- authn: Boolean(role),
- authz: role ?? null,
-});
-export const store = getStore(() => {
- const store = new Store