@arcote.tech/arc-ds 0.5.6 → 0.5.7
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/package.json +2 -2
- package/src/ds/container/container.tsx +33 -0
- package/src/ds/types.ts +10 -0
- package/src/index.ts +2 -0
- package/src/layout/layout.tsx +3 -2
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcote.tech/arc-ds",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.5.
|
|
4
|
+
"version": "0.5.7",
|
|
5
5
|
"private": false,
|
|
6
6
|
"author": "Przemysław Krasiński [arcote.tech]",
|
|
7
7
|
"description": "Design System for Arc framework — CVA-based components with display modes and variant overrides",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"tailwind-merge": "^3.5.0"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@arcote.tech/arc": "^0.5.
|
|
33
|
+
"@arcote.tech/arc": "^0.5.7",
|
|
34
34
|
"framer-motion": "^12.0.0",
|
|
35
35
|
"lucide-react": ">=0.400.0",
|
|
36
36
|
"radix-ui": "^1.0.0",
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { cva } from "class-variance-authority";
|
|
2
|
+
import { forwardRef, type HTMLAttributes } from "react";
|
|
3
|
+
import { cn } from "../../lib/utils";
|
|
4
|
+
import { useDsVariantOverrides } from "../ds-provider";
|
|
5
|
+
|
|
6
|
+
export const containerVariants = cva("mx-auto w-full max-w-screen-2xl");
|
|
7
|
+
|
|
8
|
+
export interface ContainerProps extends HTMLAttributes<HTMLDivElement> {}
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Container — szerokościowy wrapper dla głównego contentu Layoutu.
|
|
12
|
+
*
|
|
13
|
+
* Domyślnie `max-w-screen-2xl` (1536px). Aplikacje, które chcą węziej,
|
|
14
|
+
* nadpisują przez `arc.variants({ Container: { className: { default: "max-w-5xl" } } })`.
|
|
15
|
+
*/
|
|
16
|
+
export const Container = forwardRef<HTMLDivElement, ContainerProps>(
|
|
17
|
+
({ className, children, ...rest }, ref) => {
|
|
18
|
+
const overrides = useDsVariantOverrides("Container");
|
|
19
|
+
const extraClass = overrides?.className?.default;
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<div
|
|
23
|
+
ref={ref}
|
|
24
|
+
className={cn(containerVariants(), extraClass, className)}
|
|
25
|
+
{...rest}
|
|
26
|
+
>
|
|
27
|
+
{children}
|
|
28
|
+
</div>
|
|
29
|
+
);
|
|
30
|
+
},
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
Container.displayName = "Container";
|
package/src/ds/types.ts
CHANGED
|
@@ -19,6 +19,7 @@ export interface DSComponentMap {
|
|
|
19
19
|
Separator: ComponentType<SeparatorProps>;
|
|
20
20
|
Avatar: ComponentType<AvatarProps>;
|
|
21
21
|
Input: ComponentType<InputProps>;
|
|
22
|
+
Container: ComponentType<ContainerProps>;
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
/** Partial override — moduł nadpisuje tylko wybrane komponenty. */
|
|
@@ -130,3 +131,12 @@ export interface BoxProps {
|
|
|
130
131
|
className?: string;
|
|
131
132
|
children?: ReactNode;
|
|
132
133
|
}
|
|
134
|
+
|
|
135
|
+
// ---------------------------------------------------------------------------
|
|
136
|
+
// Container
|
|
137
|
+
// ---------------------------------------------------------------------------
|
|
138
|
+
|
|
139
|
+
export interface ContainerProps {
|
|
140
|
+
className?: string;
|
|
141
|
+
children?: ReactNode;
|
|
142
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -69,6 +69,8 @@ export type { EditableTextProps } from "./ds/editable-text/editable-text";
|
|
|
69
69
|
export { Badge, badgeVariants } from "./ds/badge/badge";
|
|
70
70
|
export { Box, boxVariants } from "./ds/box/box";
|
|
71
71
|
export type { BoxProps } from "./ds/box/box";
|
|
72
|
+
export { Container, containerVariants } from "./ds/container/container";
|
|
73
|
+
export type { ContainerProps } from "./ds/container/container";
|
|
72
74
|
export { Sidebar, sidebarVariants } from "./ds/sidebar/sidebar";
|
|
73
75
|
export type { SidebarProps } from "./ds/sidebar/sidebar";
|
|
74
76
|
export {
|
package/src/layout/layout.tsx
CHANGED
|
@@ -2,6 +2,7 @@ import { createContext, useContext, useEffect, useRef, useState } from "react";
|
|
|
2
2
|
import type { ReactNode } from "react";
|
|
3
3
|
import { Box } from "../ds/box/box";
|
|
4
4
|
import { Button } from "../ds/button/button";
|
|
5
|
+
import { Container } from "../ds/container/container";
|
|
5
6
|
import { DragHandle } from "./drag-handle";
|
|
6
7
|
import { useDynamicSlotContent } from "./dynamic-slot";
|
|
7
8
|
import { ExpandablePanel } from "./expandable-panel";
|
|
@@ -124,14 +125,14 @@ function DesktopLayout({ children }: { children?: ReactNode }) {
|
|
|
124
125
|
<SubNavSlot />
|
|
125
126
|
<div className="flex w-full flex-1">
|
|
126
127
|
<div className="flex min-w-0 flex-1 justify-center">
|
|
127
|
-
<
|
|
128
|
+
<Container className="flex gap-4 p-4">
|
|
128
129
|
{renderSlot("sidebar-left", { className: "flex w-64 shrink-0 flex-col gap-4" })}
|
|
129
130
|
<div className="min-w-0 flex-1">
|
|
130
131
|
{children}
|
|
131
132
|
{renderSlot("main-content", { className: "flex flex-col gap-4" })}
|
|
132
133
|
</div>
|
|
133
134
|
{renderSlot("sidebar-right", { className: "flex w-64 shrink-0 flex-col gap-4" })}
|
|
134
|
-
</
|
|
135
|
+
</Container>
|
|
135
136
|
</div>
|
|
136
137
|
{renderSlot("preview-pane", {
|
|
137
138
|
className:
|