@rudra-studio/rudra-layout 1.0.4

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/README.md ADDED
@@ -0,0 +1,7 @@
1
+ # rudra-layout
2
+
3
+ This library was generated with [Nx](https://nx.dev).
4
+
5
+ ## Running unit tests
6
+
7
+ Run `nx test rudra-layout` to execute the unit tests via [Vitest](https://vitest.dev/).
@@ -0,0 +1,7 @@
1
+ import { default as React } from 'react';
2
+ export interface GridProps extends React.HTMLAttributes<HTMLDivElement> {
3
+ columns?: '1' | '2' | '3' | '4' | 'auto-fit';
4
+ gap?: 'sm' | 'md' | 'lg' | 'xl';
5
+ children?: React.ReactNode;
6
+ }
7
+ export default function Grid({ columns, gap, className, children, ...props }: GridProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,23 @@
1
+ import "react";
2
+ import { jsx as e } from "react/jsx-runtime";
3
+ //#region src/components/Grid/index.tsx
4
+ function t({ columns: t = "3", gap: n = "md", className: r = "", children: i, ...a }) {
5
+ return /* @__PURE__ */ e("div", {
6
+ className: `grid w-full ${{
7
+ 1: "grid-cols-1",
8
+ 2: "grid-cols-1 md:grid-cols-2",
9
+ 3: "grid-cols-1 md:grid-cols-3",
10
+ 4: "grid-cols-1 md:grid-cols-2 lg:grid-cols-4",
11
+ "auto-fit": "grid-cols-[repeat(auto-fit,minmax(250px,1fr))]"
12
+ }[t]} ${{
13
+ sm: "gap-4",
14
+ md: "gap-6",
15
+ lg: "gap-8",
16
+ xl: "gap-12"
17
+ }[n]} ${r}`,
18
+ ...a,
19
+ children: i
20
+ });
21
+ }
22
+ //#endregion
23
+ export { t as default };
@@ -0,0 +1,10 @@
1
+ import { default as React } from 'react';
2
+ export declare const RepeaterContext: React.Context<any>;
3
+ export interface RepeaterProps extends React.HTMLAttributes<HTMLDivElement> {
4
+ items?: any[];
5
+ layout?: 'grid' | 'stack';
6
+ columns?: '1' | '2' | '3' | '4';
7
+ gap?: 'sm' | 'md' | 'lg';
8
+ children?: React.ReactNode;
9
+ }
10
+ export default function Repeater({ items, layout, columns, gap, className, children, ...props }: RepeaterProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,35 @@
1
+ import e, { createContext as t } from "react";
2
+ import { jsx as n } from "react/jsx-runtime";
3
+ //#region src/components/Repeater/index.tsx
4
+ var r = t(null);
5
+ function i({ items: t = [], layout: i = "grid", columns: a = "3", gap: o = "md", className: s = "", children: c, ...l }) {
6
+ let u = Array.isArray(t) ? t : [], d = {
7
+ sm: "gap-4",
8
+ md: "gap-6",
9
+ lg: "gap-8"
10
+ }, f = i === "grid" ? `grid ${{
11
+ 1: "grid-cols-1",
12
+ 2: "grid-cols-1 sm:grid-cols-2",
13
+ 3: "grid-cols-1 md:grid-cols-3",
14
+ 4: "grid-cols-1 md:grid-cols-2 xl:grid-cols-4"
15
+ }[a]} ${d[o]}` : `flex flex-col w-full ${d[o]}`;
16
+ return u.length === 0 ? /* @__PURE__ */ n("div", {
17
+ className: `w-full p-8 border-2 border-dashed border-purple-200 bg-purple-50 rounded-lg flex flex-col items-center justify-center text-purple-600 ${s}`,
18
+ children: /* @__PURE__ */ n("div", {
19
+ className: "mt-4 w-full p-4 border border-dashed border-purple-300 rounded bg-white",
20
+ children: c
21
+ })
22
+ }) : /* @__PURE__ */ n("div", {
23
+ className: `${f} ${s}`,
24
+ ...l,
25
+ children: u.map((t, i) => /* @__PURE__ */ n(r.Provider, {
26
+ value: {
27
+ item: t,
28
+ index: i
29
+ },
30
+ children: /* @__PURE__ */ n(e.Fragment, { children: c }, t.id || i)
31
+ }, t.id || i))
32
+ });
33
+ }
34
+ //#endregion
35
+ export { r as RepeaterContext, i as default };
@@ -0,0 +1,10 @@
1
+ import { default as React } from 'react';
2
+ export interface StackProps extends React.HTMLAttributes<HTMLDivElement> {
3
+ direction?: 'row' | 'col';
4
+ align?: 'start' | 'center' | 'end' | 'stretch';
5
+ justify?: 'start' | 'center' | 'end' | 'between' | 'around';
6
+ gap?: 'none' | 'sm' | 'md' | 'lg' | 'xl';
7
+ wrap?: boolean;
8
+ children?: React.ReactNode;
9
+ }
10
+ export default function Stack({ direction, align, justify, gap, wrap, className, children, ...props }: StackProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,29 @@
1
+ import "react";
2
+ import { jsx as e } from "react/jsx-runtime";
3
+ //#region src/components/Stack/index.tsx
4
+ function t({ direction: t = "col", align: n = "stretch", justify: r = "start", gap: i = "md", wrap: a = !1, className: o = "", children: s, ...c }) {
5
+ return /* @__PURE__ */ e("div", {
6
+ className: `flex w-full ${t === "row" ? "flex-row" : "flex-col"} ${a ? "flex-wrap" : "flex-nowrap"} ${{
7
+ start: "items-start",
8
+ center: "items-center",
9
+ end: "items-end",
10
+ stretch: "items-stretch"
11
+ }[n]} ${{
12
+ start: "justify-start",
13
+ center: "justify-center",
14
+ end: "justify-end",
15
+ between: "justify-between",
16
+ around: "justify-around"
17
+ }[r]} ${{
18
+ none: "gap-0",
19
+ sm: "gap-2",
20
+ md: "gap-4",
21
+ lg: "gap-8",
22
+ xl: "gap-12"
23
+ }[i]} ${o}`,
24
+ ...c,
25
+ children: s
26
+ });
27
+ }
28
+ //#endregion
29
+ export { t as default };
package/index.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ export type { GridProps } from './components/Grid';
2
+ export { default as Grid } from './components/Grid';
3
+ export { RepeaterContext } from './components/Repeater';
4
+ export type { RepeaterProps } from './components/Repeater';
5
+ export { default as Repeater } from './components/Repeater';
6
+ export type { StackProps } from './components/Stack';
7
+ export { default as Stack } from './components/Stack';
package/index.js ADDED
@@ -0,0 +1,7 @@
1
+ /* empty css */
2
+ import e from "./components/Grid/index.js";
3
+ import t, { RepeaterContext as n } from "./components/Repeater/index.js";
4
+ import r from "./components/Stack/index.js";
5
+ export { e as Grid, t as Repeater, n as RepeaterContext, r as Stack };
6
+
7
+ try{if(typeof document!=="undefined"){const e=document.createElement("style");e.textContent="*,:before,:after{box-sizing:border-box;border:0 solid #e5e7eb}:before,:after{--tw-content:\"\"}html,:host{-webkit-text-size-adjust:100%;tab-size:4;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5}body{line-height:inherit;margin:0}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-feature-settings:normal;font-variation-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-feature-settings:inherit;font-variation-settings:inherit;font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:#0000;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{margin:0;padding:0;list-style:none}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder{opacity:1;color:#9ca3af}textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after,::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:#3b82f680;--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.mt-4{margin-top:1rem}.flex{display:flex}.grid{display:grid}.w-full{width:100%}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-\\[repeat\\(auto-fit\\,minmax\\(250px\\,1fr\\)\\)\\]{grid-template-columns:repeat(auto-fit,minmax(250px,1fr))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.flex-nowrap{flex-wrap:nowrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-stretch{align-items:stretch}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.justify-around{justify-content:space-around}.gap-0{gap:0}.gap-12{gap:3rem}.gap-2{gap:.5rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.gap-8{gap:2rem}.rounded{border-radius:.25rem}.rounded-lg{border-radius:.5rem}.border{border-width:1px}.border-2{border-width:2px}.border-dashed{border-style:dashed}.border-purple-200{--tw-border-opacity:1;border-color:rgb(233 213 255/var(--tw-border-opacity))}.border-purple-300{--tw-border-opacity:1;border-color:rgb(216 180 254/var(--tw-border-opacity))}.bg-purple-50{--tw-bg-opacity:1;background-color:rgb(250 245 255/var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.p-4{padding:1rem}.p-8{padding:2rem}.text-purple-600{--tw-text-opacity:1;color:rgb(147 51 234/var(--tw-text-opacity))}@media (width>=640px){.sm\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (width>=768px){.md\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}@media (width>=1024px){.lg\\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}@media (width>=1280px){.xl\\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}";const target = window.__RUDRA_SHADOW_ROOT__ || document.head; target.appendChild(e);}}catch(err){}
package/package.json ADDED
@@ -0,0 +1,45 @@
1
+ {
2
+ "dependencies": {
3
+ "@react-three/fiber": "9.6.1",
4
+ "gsap": "3.12.2",
5
+ "lucide-react": "^1.8.0",
6
+ "motion": "12.0.0",
7
+ "tailwindcss": "3.4.4",
8
+ "three": "0.184.0"
9
+ },
10
+ "devDependencies": {
11
+ "autoprefixer": "^10.4.0",
12
+ "postcss": "^8.4.0",
13
+ "sass": "^1.72.0",
14
+ "tailwindcss": "^3.4.0"
15
+ },
16
+ "exports": {
17
+ ".": {
18
+ "import": "./index.js",
19
+ "require": "./index.js",
20
+ "types": "./index.d.ts"
21
+ },
22
+ "./*": {
23
+ "import": "./*.js",
24
+ "require": "./*.js",
25
+ "types": "./*.d.ts"
26
+ }
27
+ },
28
+ "jsdelivr": "./index.umd.js",
29
+ "main": "./index.js",
30
+ "name": "@rudra-studio/rudra-layout",
31
+ "peerDependencies": {
32
+ "react": "^19.0.0",
33
+ "react-dom": "^19.0.0",
34
+ "tailwindcss": ">=3.0.0"
35
+ },
36
+ "publishConfig": {
37
+ "access": "public"
38
+ },
39
+ "scripts": {
40
+ "test": "echo 'Skipping unit tests for now...' && exit 0"
41
+ },
42
+ "types": "./index.d.ts",
43
+ "unpkg": "./index.umd.js",
44
+ "version": "1.0.4"
45
+ }