@grupor5/raya 0.2.6 → 0.2.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/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +208 -0
- package/dist/index.mjs +207 -1
- package/dist/molecules/grid/index.d.mts +194 -0
- package/dist/molecules/grid/index.d.ts +194 -0
- package/dist/molecules/grid/index.js +254 -0
- package/dist/molecules/grid/index.mjs +247 -0
- package/dist/tailwind.css +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -27,6 +27,7 @@ export { Step, StepContent, StepDescription, StepLabel, Stepper, StepperAPI, use
|
|
|
27
27
|
export { Dropdown, DropdownProps } from './molecules/dropdown/index.mjs';
|
|
28
28
|
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from './molecules/accordion/index.mjs';
|
|
29
29
|
export { ChartConfig, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent } from './molecules/chart/index.mjs';
|
|
30
|
+
export { Grid, GridItem, GridItemProps, GridProps, ResponsiveValue } from './molecules/grid/index.mjs';
|
|
30
31
|
export { useModal } from './hooks/useModal.mjs';
|
|
31
32
|
import 'clsx';
|
|
32
33
|
import 'class-variance-authority/dist/types';
|
package/dist/index.d.ts
CHANGED
|
@@ -27,6 +27,7 @@ export { Step, StepContent, StepDescription, StepLabel, Stepper, StepperAPI, use
|
|
|
27
27
|
export { Dropdown, DropdownProps } from './molecules/dropdown/index.js';
|
|
28
28
|
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from './molecules/accordion/index.js';
|
|
29
29
|
export { ChartConfig, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent } from './molecules/chart/index.js';
|
|
30
|
+
export { Grid, GridItem, GridItemProps, GridProps, ResponsiveValue } from './molecules/grid/index.js';
|
|
30
31
|
export { useModal } from './hooks/useModal.js';
|
|
31
32
|
import 'clsx';
|
|
32
33
|
import 'class-variance-authority/dist/types';
|
package/dist/index.js
CHANGED
|
@@ -2613,6 +2613,212 @@ function getPayloadConfigFromPayload(config, payload, key) {
|
|
|
2613
2613
|
}
|
|
2614
2614
|
return configLabelKey in config ? config[configLabelKey] : config[key];
|
|
2615
2615
|
}
|
|
2616
|
+
var getColsClasses = (cols) => {
|
|
2617
|
+
if (typeof cols === "number") {
|
|
2618
|
+
return `grid-cols-${cols}`;
|
|
2619
|
+
}
|
|
2620
|
+
if (typeof cols === "object" && cols !== null) {
|
|
2621
|
+
const classes = [];
|
|
2622
|
+
if (cols.mobile) {
|
|
2623
|
+
classes.push(`grid-cols-${cols.mobile}`);
|
|
2624
|
+
}
|
|
2625
|
+
if (cols.tablet) {
|
|
2626
|
+
classes.push(`md:grid-cols-${cols.tablet}`);
|
|
2627
|
+
}
|
|
2628
|
+
if (cols.desktop) {
|
|
2629
|
+
classes.push(`lg:grid-cols-${cols.desktop}`);
|
|
2630
|
+
}
|
|
2631
|
+
return classes.join(" ");
|
|
2632
|
+
}
|
|
2633
|
+
return "grid-cols-4 md:grid-cols-8 lg:grid-cols-12";
|
|
2634
|
+
};
|
|
2635
|
+
var getGapClasses = (gap) => {
|
|
2636
|
+
if (typeof gap === "string") {
|
|
2637
|
+
const gapMap = {
|
|
2638
|
+
xs: "gap-1",
|
|
2639
|
+
// 4px
|
|
2640
|
+
s: "gap-2",
|
|
2641
|
+
// 8px
|
|
2642
|
+
m: "gap-4",
|
|
2643
|
+
// 16px
|
|
2644
|
+
l: "gap-6",
|
|
2645
|
+
// 24px
|
|
2646
|
+
xl: "gap-8"
|
|
2647
|
+
// 32px
|
|
2648
|
+
};
|
|
2649
|
+
return gapMap[gap] || "gap-4";
|
|
2650
|
+
}
|
|
2651
|
+
if (typeof gap === "object" && gap !== null) {
|
|
2652
|
+
const gapMap = {
|
|
2653
|
+
xs: "1",
|
|
2654
|
+
s: "2",
|
|
2655
|
+
m: "4",
|
|
2656
|
+
l: "6",
|
|
2657
|
+
xl: "8"
|
|
2658
|
+
};
|
|
2659
|
+
const classes = [];
|
|
2660
|
+
if (gap.mobile) {
|
|
2661
|
+
classes.push(`gap-${gapMap[gap.mobile] || "4"}`);
|
|
2662
|
+
}
|
|
2663
|
+
if (gap.tablet) {
|
|
2664
|
+
classes.push(`md:gap-${gapMap[gap.tablet] || "5"}`);
|
|
2665
|
+
}
|
|
2666
|
+
if (gap.desktop) {
|
|
2667
|
+
classes.push(`lg:gap-${gapMap[gap.desktop] || "6"}`);
|
|
2668
|
+
}
|
|
2669
|
+
return classes.join(" ");
|
|
2670
|
+
}
|
|
2671
|
+
return "gap-4 md:gap-5 lg:gap-6";
|
|
2672
|
+
};
|
|
2673
|
+
var getSpanClasses = (span) => {
|
|
2674
|
+
if (typeof span === "number") {
|
|
2675
|
+
return `col-span-${span}`;
|
|
2676
|
+
}
|
|
2677
|
+
if (typeof span === "object" && span !== null) {
|
|
2678
|
+
const classes = [];
|
|
2679
|
+
if (span.mobile) {
|
|
2680
|
+
classes.push(`col-span-${span.mobile}`);
|
|
2681
|
+
}
|
|
2682
|
+
if (span.tablet) {
|
|
2683
|
+
classes.push(`md:col-span-${span.tablet}`);
|
|
2684
|
+
}
|
|
2685
|
+
if (span.desktop) {
|
|
2686
|
+
classes.push(`lg:col-span-${span.desktop}`);
|
|
2687
|
+
}
|
|
2688
|
+
return classes.join(" ");
|
|
2689
|
+
}
|
|
2690
|
+
return "";
|
|
2691
|
+
};
|
|
2692
|
+
var getRowSpanClasses = (rowSpan) => {
|
|
2693
|
+
if (typeof rowSpan === "number") {
|
|
2694
|
+
return `row-span-${rowSpan}`;
|
|
2695
|
+
}
|
|
2696
|
+
if (typeof rowSpan === "object" && rowSpan !== null) {
|
|
2697
|
+
const classes = [];
|
|
2698
|
+
if (rowSpan.mobile) {
|
|
2699
|
+
classes.push(`row-span-${rowSpan.mobile}`);
|
|
2700
|
+
}
|
|
2701
|
+
if (rowSpan.tablet) {
|
|
2702
|
+
classes.push(`md:row-span-${rowSpan.tablet}`);
|
|
2703
|
+
}
|
|
2704
|
+
if (rowSpan.desktop) {
|
|
2705
|
+
classes.push(`lg:row-span-${rowSpan.desktop}`);
|
|
2706
|
+
}
|
|
2707
|
+
return classes.join(" ");
|
|
2708
|
+
}
|
|
2709
|
+
return "";
|
|
2710
|
+
};
|
|
2711
|
+
var getColPositionClasses = (colStart, colEnd) => {
|
|
2712
|
+
const classes = [];
|
|
2713
|
+
if (colStart) {
|
|
2714
|
+
if (typeof colStart === "number") {
|
|
2715
|
+
classes.push(`col-start-${colStart}`);
|
|
2716
|
+
} else if (typeof colStart === "object") {
|
|
2717
|
+
if (colStart.mobile) classes.push(`col-start-${colStart.mobile}`);
|
|
2718
|
+
if (colStart.tablet) classes.push(`md:col-start-${colStart.tablet}`);
|
|
2719
|
+
if (colStart.desktop) classes.push(`lg:col-start-${colStart.desktop}`);
|
|
2720
|
+
}
|
|
2721
|
+
}
|
|
2722
|
+
if (colEnd) {
|
|
2723
|
+
if (typeof colEnd === "number") {
|
|
2724
|
+
classes.push(`col-end-${colEnd}`);
|
|
2725
|
+
} else if (typeof colEnd === "object") {
|
|
2726
|
+
if (colEnd.mobile) classes.push(`col-end-${colEnd.mobile}`);
|
|
2727
|
+
if (colEnd.tablet) classes.push(`md:col-end-${colEnd.tablet}`);
|
|
2728
|
+
if (colEnd.desktop) classes.push(`lg:col-end-${colEnd.desktop}`);
|
|
2729
|
+
}
|
|
2730
|
+
}
|
|
2731
|
+
return classes.join(" ");
|
|
2732
|
+
};
|
|
2733
|
+
var Grid = React17__namespace.default.forwardRef(
|
|
2734
|
+
(_a, ref) => {
|
|
2735
|
+
var _b = _a, {
|
|
2736
|
+
container = true,
|
|
2737
|
+
cols,
|
|
2738
|
+
gap,
|
|
2739
|
+
margin = false,
|
|
2740
|
+
className,
|
|
2741
|
+
children,
|
|
2742
|
+
"aria-label": ariaLabel,
|
|
2743
|
+
"data-testid": dataTestId
|
|
2744
|
+
} = _b, props = __objRest(_b, [
|
|
2745
|
+
"container",
|
|
2746
|
+
"cols",
|
|
2747
|
+
"gap",
|
|
2748
|
+
"margin",
|
|
2749
|
+
"className",
|
|
2750
|
+
"children",
|
|
2751
|
+
"aria-label",
|
|
2752
|
+
"data-testid"
|
|
2753
|
+
]);
|
|
2754
|
+
const gridClasses = cn(
|
|
2755
|
+
// Base grid styles
|
|
2756
|
+
container && "grid",
|
|
2757
|
+
// Column configuration
|
|
2758
|
+
getColsClasses(cols),
|
|
2759
|
+
// Gap configuration
|
|
2760
|
+
getGapClasses(gap),
|
|
2761
|
+
// Margin configuration (follows design system)
|
|
2762
|
+
margin && "mx-4 md:mx-5 lg:mx-6",
|
|
2763
|
+
// Custom classes
|
|
2764
|
+
className
|
|
2765
|
+
);
|
|
2766
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2767
|
+
"div",
|
|
2768
|
+
__spreadProps(__spreadValues({
|
|
2769
|
+
ref,
|
|
2770
|
+
className: gridClasses,
|
|
2771
|
+
"aria-label": ariaLabel,
|
|
2772
|
+
"data-testid": dataTestId
|
|
2773
|
+
}, props), {
|
|
2774
|
+
children
|
|
2775
|
+
})
|
|
2776
|
+
);
|
|
2777
|
+
}
|
|
2778
|
+
);
|
|
2779
|
+
Grid.displayName = "Grid";
|
|
2780
|
+
var GridItem = React17__namespace.default.forwardRef(
|
|
2781
|
+
(_a, ref) => {
|
|
2782
|
+
var _b = _a, {
|
|
2783
|
+
span,
|
|
2784
|
+
rowSpan,
|
|
2785
|
+
colStart,
|
|
2786
|
+
colEnd,
|
|
2787
|
+
className,
|
|
2788
|
+
children,
|
|
2789
|
+
"data-testid": dataTestId
|
|
2790
|
+
} = _b, props = __objRest(_b, [
|
|
2791
|
+
"span",
|
|
2792
|
+
"rowSpan",
|
|
2793
|
+
"colStart",
|
|
2794
|
+
"colEnd",
|
|
2795
|
+
"className",
|
|
2796
|
+
"children",
|
|
2797
|
+
"data-testid"
|
|
2798
|
+
]);
|
|
2799
|
+
const itemClasses = cn(
|
|
2800
|
+
// Span configuration
|
|
2801
|
+
getSpanClasses(span),
|
|
2802
|
+
// Row span configuration
|
|
2803
|
+
getRowSpanClasses(rowSpan),
|
|
2804
|
+
// Position configuration
|
|
2805
|
+
getColPositionClasses(colStart, colEnd),
|
|
2806
|
+
// Custom classes
|
|
2807
|
+
className
|
|
2808
|
+
);
|
|
2809
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2810
|
+
"div",
|
|
2811
|
+
__spreadProps(__spreadValues({
|
|
2812
|
+
ref,
|
|
2813
|
+
className: itemClasses,
|
|
2814
|
+
"data-testid": dataTestId
|
|
2815
|
+
}, props), {
|
|
2816
|
+
children
|
|
2817
|
+
})
|
|
2818
|
+
);
|
|
2819
|
+
}
|
|
2820
|
+
);
|
|
2821
|
+
GridItem.displayName = "GridItem";
|
|
2616
2822
|
function Modal({ open, onClose, children }) {
|
|
2617
2823
|
if (!open) return null;
|
|
2618
2824
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { style: { position: "fixed", top: 0, left: 0, right: 0, bottom: 0, background: "rgba(0,0,0,0.5)" }, onClick: onClose, children: /* @__PURE__ */ jsxRuntime.jsx("div", { style: { margin: "100px auto", background: "#fff", padding: 24, borderRadius: 8, minWidth: 320 }, onClick: (e) => e.stopPropagation(), children }) });
|
|
@@ -2659,6 +2865,8 @@ exports.Form = Form;
|
|
|
2659
2865
|
exports.FormField = FormField;
|
|
2660
2866
|
exports.FormLabel = FormLabel;
|
|
2661
2867
|
exports.FormMessage = FormMessage;
|
|
2868
|
+
exports.Grid = Grid;
|
|
2869
|
+
exports.GridItem = GridItem;
|
|
2662
2870
|
exports.Input = Input;
|
|
2663
2871
|
exports.Label = Label;
|
|
2664
2872
|
exports.Modal = Modal;
|
package/dist/index.mjs
CHANGED
|
@@ -2585,6 +2585,212 @@ function getPayloadConfigFromPayload(config, payload, key) {
|
|
|
2585
2585
|
}
|
|
2586
2586
|
return configLabelKey in config ? config[configLabelKey] : config[key];
|
|
2587
2587
|
}
|
|
2588
|
+
var getColsClasses = (cols) => {
|
|
2589
|
+
if (typeof cols === "number") {
|
|
2590
|
+
return `grid-cols-${cols}`;
|
|
2591
|
+
}
|
|
2592
|
+
if (typeof cols === "object" && cols !== null) {
|
|
2593
|
+
const classes = [];
|
|
2594
|
+
if (cols.mobile) {
|
|
2595
|
+
classes.push(`grid-cols-${cols.mobile}`);
|
|
2596
|
+
}
|
|
2597
|
+
if (cols.tablet) {
|
|
2598
|
+
classes.push(`md:grid-cols-${cols.tablet}`);
|
|
2599
|
+
}
|
|
2600
|
+
if (cols.desktop) {
|
|
2601
|
+
classes.push(`lg:grid-cols-${cols.desktop}`);
|
|
2602
|
+
}
|
|
2603
|
+
return classes.join(" ");
|
|
2604
|
+
}
|
|
2605
|
+
return "grid-cols-4 md:grid-cols-8 lg:grid-cols-12";
|
|
2606
|
+
};
|
|
2607
|
+
var getGapClasses = (gap) => {
|
|
2608
|
+
if (typeof gap === "string") {
|
|
2609
|
+
const gapMap = {
|
|
2610
|
+
xs: "gap-1",
|
|
2611
|
+
// 4px
|
|
2612
|
+
s: "gap-2",
|
|
2613
|
+
// 8px
|
|
2614
|
+
m: "gap-4",
|
|
2615
|
+
// 16px
|
|
2616
|
+
l: "gap-6",
|
|
2617
|
+
// 24px
|
|
2618
|
+
xl: "gap-8"
|
|
2619
|
+
// 32px
|
|
2620
|
+
};
|
|
2621
|
+
return gapMap[gap] || "gap-4";
|
|
2622
|
+
}
|
|
2623
|
+
if (typeof gap === "object" && gap !== null) {
|
|
2624
|
+
const gapMap = {
|
|
2625
|
+
xs: "1",
|
|
2626
|
+
s: "2",
|
|
2627
|
+
m: "4",
|
|
2628
|
+
l: "6",
|
|
2629
|
+
xl: "8"
|
|
2630
|
+
};
|
|
2631
|
+
const classes = [];
|
|
2632
|
+
if (gap.mobile) {
|
|
2633
|
+
classes.push(`gap-${gapMap[gap.mobile] || "4"}`);
|
|
2634
|
+
}
|
|
2635
|
+
if (gap.tablet) {
|
|
2636
|
+
classes.push(`md:gap-${gapMap[gap.tablet] || "5"}`);
|
|
2637
|
+
}
|
|
2638
|
+
if (gap.desktop) {
|
|
2639
|
+
classes.push(`lg:gap-${gapMap[gap.desktop] || "6"}`);
|
|
2640
|
+
}
|
|
2641
|
+
return classes.join(" ");
|
|
2642
|
+
}
|
|
2643
|
+
return "gap-4 md:gap-5 lg:gap-6";
|
|
2644
|
+
};
|
|
2645
|
+
var getSpanClasses = (span) => {
|
|
2646
|
+
if (typeof span === "number") {
|
|
2647
|
+
return `col-span-${span}`;
|
|
2648
|
+
}
|
|
2649
|
+
if (typeof span === "object" && span !== null) {
|
|
2650
|
+
const classes = [];
|
|
2651
|
+
if (span.mobile) {
|
|
2652
|
+
classes.push(`col-span-${span.mobile}`);
|
|
2653
|
+
}
|
|
2654
|
+
if (span.tablet) {
|
|
2655
|
+
classes.push(`md:col-span-${span.tablet}`);
|
|
2656
|
+
}
|
|
2657
|
+
if (span.desktop) {
|
|
2658
|
+
classes.push(`lg:col-span-${span.desktop}`);
|
|
2659
|
+
}
|
|
2660
|
+
return classes.join(" ");
|
|
2661
|
+
}
|
|
2662
|
+
return "";
|
|
2663
|
+
};
|
|
2664
|
+
var getRowSpanClasses = (rowSpan) => {
|
|
2665
|
+
if (typeof rowSpan === "number") {
|
|
2666
|
+
return `row-span-${rowSpan}`;
|
|
2667
|
+
}
|
|
2668
|
+
if (typeof rowSpan === "object" && rowSpan !== null) {
|
|
2669
|
+
const classes = [];
|
|
2670
|
+
if (rowSpan.mobile) {
|
|
2671
|
+
classes.push(`row-span-${rowSpan.mobile}`);
|
|
2672
|
+
}
|
|
2673
|
+
if (rowSpan.tablet) {
|
|
2674
|
+
classes.push(`md:row-span-${rowSpan.tablet}`);
|
|
2675
|
+
}
|
|
2676
|
+
if (rowSpan.desktop) {
|
|
2677
|
+
classes.push(`lg:row-span-${rowSpan.desktop}`);
|
|
2678
|
+
}
|
|
2679
|
+
return classes.join(" ");
|
|
2680
|
+
}
|
|
2681
|
+
return "";
|
|
2682
|
+
};
|
|
2683
|
+
var getColPositionClasses = (colStart, colEnd) => {
|
|
2684
|
+
const classes = [];
|
|
2685
|
+
if (colStart) {
|
|
2686
|
+
if (typeof colStart === "number") {
|
|
2687
|
+
classes.push(`col-start-${colStart}`);
|
|
2688
|
+
} else if (typeof colStart === "object") {
|
|
2689
|
+
if (colStart.mobile) classes.push(`col-start-${colStart.mobile}`);
|
|
2690
|
+
if (colStart.tablet) classes.push(`md:col-start-${colStart.tablet}`);
|
|
2691
|
+
if (colStart.desktop) classes.push(`lg:col-start-${colStart.desktop}`);
|
|
2692
|
+
}
|
|
2693
|
+
}
|
|
2694
|
+
if (colEnd) {
|
|
2695
|
+
if (typeof colEnd === "number") {
|
|
2696
|
+
classes.push(`col-end-${colEnd}`);
|
|
2697
|
+
} else if (typeof colEnd === "object") {
|
|
2698
|
+
if (colEnd.mobile) classes.push(`col-end-${colEnd.mobile}`);
|
|
2699
|
+
if (colEnd.tablet) classes.push(`md:col-end-${colEnd.tablet}`);
|
|
2700
|
+
if (colEnd.desktop) classes.push(`lg:col-end-${colEnd.desktop}`);
|
|
2701
|
+
}
|
|
2702
|
+
}
|
|
2703
|
+
return classes.join(" ");
|
|
2704
|
+
};
|
|
2705
|
+
var Grid = React17__default.forwardRef(
|
|
2706
|
+
(_a, ref) => {
|
|
2707
|
+
var _b = _a, {
|
|
2708
|
+
container = true,
|
|
2709
|
+
cols,
|
|
2710
|
+
gap,
|
|
2711
|
+
margin = false,
|
|
2712
|
+
className,
|
|
2713
|
+
children,
|
|
2714
|
+
"aria-label": ariaLabel,
|
|
2715
|
+
"data-testid": dataTestId
|
|
2716
|
+
} = _b, props = __objRest(_b, [
|
|
2717
|
+
"container",
|
|
2718
|
+
"cols",
|
|
2719
|
+
"gap",
|
|
2720
|
+
"margin",
|
|
2721
|
+
"className",
|
|
2722
|
+
"children",
|
|
2723
|
+
"aria-label",
|
|
2724
|
+
"data-testid"
|
|
2725
|
+
]);
|
|
2726
|
+
const gridClasses = cn(
|
|
2727
|
+
// Base grid styles
|
|
2728
|
+
container && "grid",
|
|
2729
|
+
// Column configuration
|
|
2730
|
+
getColsClasses(cols),
|
|
2731
|
+
// Gap configuration
|
|
2732
|
+
getGapClasses(gap),
|
|
2733
|
+
// Margin configuration (follows design system)
|
|
2734
|
+
margin && "mx-4 md:mx-5 lg:mx-6",
|
|
2735
|
+
// Custom classes
|
|
2736
|
+
className
|
|
2737
|
+
);
|
|
2738
|
+
return /* @__PURE__ */ jsx(
|
|
2739
|
+
"div",
|
|
2740
|
+
__spreadProps(__spreadValues({
|
|
2741
|
+
ref,
|
|
2742
|
+
className: gridClasses,
|
|
2743
|
+
"aria-label": ariaLabel,
|
|
2744
|
+
"data-testid": dataTestId
|
|
2745
|
+
}, props), {
|
|
2746
|
+
children
|
|
2747
|
+
})
|
|
2748
|
+
);
|
|
2749
|
+
}
|
|
2750
|
+
);
|
|
2751
|
+
Grid.displayName = "Grid";
|
|
2752
|
+
var GridItem = React17__default.forwardRef(
|
|
2753
|
+
(_a, ref) => {
|
|
2754
|
+
var _b = _a, {
|
|
2755
|
+
span,
|
|
2756
|
+
rowSpan,
|
|
2757
|
+
colStart,
|
|
2758
|
+
colEnd,
|
|
2759
|
+
className,
|
|
2760
|
+
children,
|
|
2761
|
+
"data-testid": dataTestId
|
|
2762
|
+
} = _b, props = __objRest(_b, [
|
|
2763
|
+
"span",
|
|
2764
|
+
"rowSpan",
|
|
2765
|
+
"colStart",
|
|
2766
|
+
"colEnd",
|
|
2767
|
+
"className",
|
|
2768
|
+
"children",
|
|
2769
|
+
"data-testid"
|
|
2770
|
+
]);
|
|
2771
|
+
const itemClasses = cn(
|
|
2772
|
+
// Span configuration
|
|
2773
|
+
getSpanClasses(span),
|
|
2774
|
+
// Row span configuration
|
|
2775
|
+
getRowSpanClasses(rowSpan),
|
|
2776
|
+
// Position configuration
|
|
2777
|
+
getColPositionClasses(colStart, colEnd),
|
|
2778
|
+
// Custom classes
|
|
2779
|
+
className
|
|
2780
|
+
);
|
|
2781
|
+
return /* @__PURE__ */ jsx(
|
|
2782
|
+
"div",
|
|
2783
|
+
__spreadProps(__spreadValues({
|
|
2784
|
+
ref,
|
|
2785
|
+
className: itemClasses,
|
|
2786
|
+
"data-testid": dataTestId
|
|
2787
|
+
}, props), {
|
|
2788
|
+
children
|
|
2789
|
+
})
|
|
2790
|
+
);
|
|
2791
|
+
}
|
|
2792
|
+
);
|
|
2793
|
+
GridItem.displayName = "GridItem";
|
|
2588
2794
|
function Modal({ open, onClose, children }) {
|
|
2589
2795
|
if (!open) return null;
|
|
2590
2796
|
return /* @__PURE__ */ jsx("div", { style: { position: "fixed", top: 0, left: 0, right: 0, bottom: 0, background: "rgba(0,0,0,0.5)" }, onClick: onClose, children: /* @__PURE__ */ jsx("div", { style: { margin: "100px auto", background: "#fff", padding: 24, borderRadius: 8, minWidth: 320 }, onClick: (e) => e.stopPropagation(), children }) });
|
|
@@ -2603,4 +2809,4 @@ function useModal(initialOpen = false) {
|
|
|
2603
2809
|
return { open, openModal, closeModal };
|
|
2604
2810
|
}
|
|
2605
2811
|
|
|
2606
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertTitle, AuthLayout, Badge, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Checkbox, Dropdown, Form, FormField, FormLabel, FormMessage, Input, Label, Modal, Paragraph, ProgressBar, RadioGroup, RadioGroupItem, Step, StepContent, StepDescription, StepLabel, Stepper, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Tag, Textarea, ThemeProvider, Title, Typography, badgeTokens, badgeVariants, classNames, cn, colors, componentStrokes, createStroke, fontFamily, fontSize, fontWeight, generateSpacingCSS, generateStrokesCSS, generateTypographyCSS, getSpacing, getSpacingPx, getStroke, getStrokeColor, letterSpacing, lineHeight, presets, responsiveStrokes, spacing, spacingPx, spacingStyles, stroke, strokeColors, strokeDirections, strokeStyles, strokeTransitions, tagTokens, tailwindSpacing, tailwindStrokes, typography, typographyVariants, typographyVars, useModal, useStepper, useTheme };
|
|
2812
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertTitle, AuthLayout, Badge, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Checkbox, Dropdown, Form, FormField, FormLabel, FormMessage, Grid, GridItem, Input, Label, Modal, Paragraph, ProgressBar, RadioGroup, RadioGroupItem, Step, StepContent, StepDescription, StepLabel, Stepper, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Tag, Textarea, ThemeProvider, Title, Typography, badgeTokens, badgeVariants, classNames, cn, colors, componentStrokes, createStroke, fontFamily, fontSize, fontWeight, generateSpacingCSS, generateStrokesCSS, generateTypographyCSS, getSpacing, getSpacingPx, getStroke, getStrokeColor, letterSpacing, lineHeight, presets, responsiveStrokes, spacing, spacingPx, spacingStyles, stroke, strokeColors, strokeDirections, strokeStyles, strokeTransitions, tagTokens, tailwindSpacing, tailwindStrokes, typography, typographyVariants, typographyVars, useModal, useStepper, useTheme };
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Responsive value type for breakpoint-specific configuration
|
|
5
|
+
*
|
|
6
|
+
* Allows different values for each breakpoint following the Raya Design System:
|
|
7
|
+
* - **mobile**: 0px and up (4-column grid)
|
|
8
|
+
* - **tablet**: 768px and up (8-column grid)
|
|
9
|
+
* - **desktop**: 1024px and up (12-column grid)
|
|
10
|
+
*
|
|
11
|
+
* @template T The type of value for each breakpoint
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* // Responsive columns
|
|
15
|
+
* const columns: ResponsiveValue<number> = {
|
|
16
|
+
* mobile: 1, // 1 column on mobile
|
|
17
|
+
* tablet: 2, // 2 columns on tablet
|
|
18
|
+
* desktop: 4 // 4 columns on desktop
|
|
19
|
+
* }
|
|
20
|
+
*
|
|
21
|
+
* // Responsive gaps
|
|
22
|
+
* const gaps: ResponsiveValue<string> = {
|
|
23
|
+
* mobile: 's', // Small gap on mobile
|
|
24
|
+
* tablet: 'm', // Medium gap on tablet
|
|
25
|
+
* desktop: 'l' // Large gap on desktop
|
|
26
|
+
* }
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
interface ResponsiveValue<T> {
|
|
30
|
+
/** Value for mobile breakpoint (0px and up) */
|
|
31
|
+
mobile?: T;
|
|
32
|
+
/** Value for tablet breakpoint (768px and up) */
|
|
33
|
+
tablet?: T;
|
|
34
|
+
/** Value for desktop breakpoint (1024px and up) */
|
|
35
|
+
desktop?: T;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Grid container props
|
|
39
|
+
*/
|
|
40
|
+
interface GridProps {
|
|
41
|
+
/**
|
|
42
|
+
* Whether this is a grid container (default: true)
|
|
43
|
+
* @default true
|
|
44
|
+
*/
|
|
45
|
+
container?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Number of columns per breakpoint. Supports single number or responsive values.
|
|
48
|
+
* Default: { mobile: 4, tablet: 8, desktop: 12 }
|
|
49
|
+
* @example { mobile: 1, tablet: 2, desktop: 3 }
|
|
50
|
+
*/
|
|
51
|
+
cols?: ResponsiveValue<1 | 2 | 3 | 4 | 6 | 8 | 12> | 1 | 2 | 3 | 4 | 6 | 8 | 12;
|
|
52
|
+
/**
|
|
53
|
+
* Gap size between grid items using design system tokens.
|
|
54
|
+
* xs=4px, s=8px, m=16px, l=24px, xl=32px
|
|
55
|
+
* @example { mobile: 'm', tablet: 'l', desktop: 'xl' }
|
|
56
|
+
*/
|
|
57
|
+
gap?: ResponsiveValue<'xs' | 's' | 'm' | 'l' | 'xl'> | 'xs' | 's' | 'm' | 'l' | 'xl';
|
|
58
|
+
/**
|
|
59
|
+
* Whether to apply responsive margins following design system
|
|
60
|
+
* Mobile: 16px, Tablet: 20px, Desktop: 24px
|
|
61
|
+
* @default false
|
|
62
|
+
*/
|
|
63
|
+
margin?: boolean;
|
|
64
|
+
/** Custom CSS classes to apply to the grid container */
|
|
65
|
+
className?: string;
|
|
66
|
+
/** Grid items or content to be rendered inside the grid */
|
|
67
|
+
children: React__default.ReactNode;
|
|
68
|
+
/** ARIA label for accessibility and screen readers */
|
|
69
|
+
'aria-label'?: string;
|
|
70
|
+
/** Data test id for testing purposes */
|
|
71
|
+
'data-testid'?: string;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Grid item props for responsive layout control
|
|
75
|
+
*/
|
|
76
|
+
interface GridItemProps {
|
|
77
|
+
/**
|
|
78
|
+
* Number of columns this item should span across breakpoints
|
|
79
|
+
* @example { mobile: 12, tablet: 6, desktop: 4 }
|
|
80
|
+
* @example 6 // Static span across all breakpoints
|
|
81
|
+
*/
|
|
82
|
+
span?: ResponsiveValue<number> | number;
|
|
83
|
+
/**
|
|
84
|
+
* Number of rows this item should span across breakpoints
|
|
85
|
+
* @example { mobile: 1, desktop: 2 }
|
|
86
|
+
* @example 2 // Static row span across all breakpoints
|
|
87
|
+
*/
|
|
88
|
+
rowSpan?: ResponsiveValue<number> | number;
|
|
89
|
+
/**
|
|
90
|
+
* Grid column start position (1-based indexing)
|
|
91
|
+
* @example { mobile: 1, desktop: 2 }
|
|
92
|
+
* @example 3 // Start at column 3
|
|
93
|
+
*/
|
|
94
|
+
colStart?: ResponsiveValue<number> | number;
|
|
95
|
+
/**
|
|
96
|
+
* Grid column end position (1-based indexing)
|
|
97
|
+
* @example { mobile: -1, desktop: 5 }
|
|
98
|
+
* @example 6 // End at column 6
|
|
99
|
+
*/
|
|
100
|
+
colEnd?: ResponsiveValue<number> | number;
|
|
101
|
+
/** Custom CSS classes to apply to the grid item */
|
|
102
|
+
className?: string;
|
|
103
|
+
/** Content to be rendered inside the grid item */
|
|
104
|
+
children: React__default.ReactNode;
|
|
105
|
+
/** Data test id for testing purposes */
|
|
106
|
+
'data-testid'?: string;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* # Grid - MANDATORY Responsive Grid System
|
|
110
|
+
*
|
|
111
|
+
* ## 🚨 CRITICAL: ALL LAYOUTS MUST USE THIS COMPONENT
|
|
112
|
+
*
|
|
113
|
+
* This is the **MANDATORY** grid component for all screens and layouts in the Raya Design System.
|
|
114
|
+
* Manual CSS Grid classes are **FORBIDDEN**. Use this component to ensure consistent spacing,
|
|
115
|
+
* responsive behavior, and design system compliance.
|
|
116
|
+
*
|
|
117
|
+
* ### Features
|
|
118
|
+
* - **Responsive by Default**: Automatically adapts to mobile (4 cols), tablet (8 cols), desktop (12 cols)
|
|
119
|
+
* - **Design System Integration**: Consistent margins, gaps, and breakpoints
|
|
120
|
+
* - **Type Safety**: Full TypeScript support with responsive value types
|
|
121
|
+
* - **Accessibility**: ARIA labels and semantic HTML structure
|
|
122
|
+
*
|
|
123
|
+
* ### Breakpoints
|
|
124
|
+
* - **Mobile**: 0px (4 columns, 16px margins/gaps)
|
|
125
|
+
* - **Tablet**: 768px (8 columns, 20px margins/gaps)
|
|
126
|
+
* - **Desktop**: 1024px (12 columns, 24px margins/gaps)
|
|
127
|
+
*
|
|
128
|
+
* @example
|
|
129
|
+
* ```tsx
|
|
130
|
+
* // ✅ CORRECT - Always use Grid component
|
|
131
|
+
* <Grid cols={{ mobile: 1, tablet: 2, desktop: 3 }} gap="l" margin>
|
|
132
|
+
* <Card>Content 1</Card>
|
|
133
|
+
* <Card>Content 2</Card>
|
|
134
|
+
* <Card>Content 3</Card>
|
|
135
|
+
* </Grid>
|
|
136
|
+
*
|
|
137
|
+
* // ✅ CORRECT - Advanced responsive configuration
|
|
138
|
+
* <Grid cols={12} gap="m" margin>
|
|
139
|
+
* <GridItem span={{ mobile: 12, desktop: 8 }}>
|
|
140
|
+
* <MainContent />
|
|
141
|
+
* </GridItem>
|
|
142
|
+
* <GridItem span={{ mobile: 12, desktop: 4 }}>
|
|
143
|
+
* <Sidebar />
|
|
144
|
+
* </GridItem>
|
|
145
|
+
* </Grid>
|
|
146
|
+
* ```
|
|
147
|
+
*
|
|
148
|
+
* @example
|
|
149
|
+
* ```tsx
|
|
150
|
+
* // ❌ FORBIDDEN - Never use manual CSS Grid
|
|
151
|
+
* <div className="grid grid-cols-3 gap-6">
|
|
152
|
+
* <Card>Content</Card>
|
|
153
|
+
* </div>
|
|
154
|
+
* ```
|
|
155
|
+
*/
|
|
156
|
+
declare const Grid: React__default.ForwardRefExoticComponent<GridProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
157
|
+
/**
|
|
158
|
+
* # GridItem - Responsive Grid Item with Advanced Control
|
|
159
|
+
*
|
|
160
|
+
* Provides fine-grained control over individual grid items including
|
|
161
|
+
* column spans, row spans, and positioning. Use within a Grid component
|
|
162
|
+
* for precise layout control across breakpoints.
|
|
163
|
+
*
|
|
164
|
+
* ### Features
|
|
165
|
+
* - **Responsive Spans**: Different column/row spans per breakpoint
|
|
166
|
+
* - **Positioning**: Control exact grid placement with colStart/colEnd
|
|
167
|
+
* - **Flexible Layout**: Combine with Grid for complex layouts
|
|
168
|
+
*
|
|
169
|
+
* @example
|
|
170
|
+
* ```tsx
|
|
171
|
+
* <Grid cols={12} gap="m">
|
|
172
|
+
* <GridItem span={6}>Half width</GridItem>
|
|
173
|
+
* <GridItem span={{ mobile: 12, desktop: 4 }}>Responsive width</GridItem>
|
|
174
|
+
* <GridItem span={3} rowSpan={2}>Tall item spanning 2 rows</GridItem>
|
|
175
|
+
* <GridItem colStart={2} colEnd={5}>Positioned item (cols 2-5)</GridItem>
|
|
176
|
+
* </Grid>
|
|
177
|
+
* ```
|
|
178
|
+
*
|
|
179
|
+
* @example
|
|
180
|
+
* ```tsx
|
|
181
|
+
* // Content + Sidebar layout
|
|
182
|
+
* <Grid cols={12} margin>
|
|
183
|
+
* <GridItem span={{ mobile: 12, desktop: 8 }}>
|
|
184
|
+
* <MainContent />
|
|
185
|
+
* </GridItem>
|
|
186
|
+
* <GridItem span={{ mobile: 12, desktop: 4 }}>
|
|
187
|
+
* <Sidebar />
|
|
188
|
+
* </GridItem>
|
|
189
|
+
* </Grid>
|
|
190
|
+
* ```
|
|
191
|
+
*/
|
|
192
|
+
declare const GridItem: React__default.ForwardRefExoticComponent<GridItemProps & React__default.RefAttributes<HTMLDivElement>>;
|
|
193
|
+
|
|
194
|
+
export { Grid, GridItem, type GridItemProps, type GridProps, type ResponsiveValue };
|