@sarunyu/system-one 1.1.2 → 1.3.0

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.js CHANGED
@@ -377,6 +377,160 @@ const Card = forwardRef(function Card2({
377
377
  );
378
378
  });
379
379
  Card.displayName = "Card";
380
+ const pageWidthClass = {
381
+ sm: "max-w-[640px]",
382
+ md: "max-w-[960px]",
383
+ lg: "max-w-[1200px]",
384
+ xl: "max-w-[1440px]",
385
+ full: "max-w-none"
386
+ };
387
+ const Page = forwardRef(function Page2({ width = "lg", className, children, ...rest }, ref) {
388
+ return /* @__PURE__ */ jsx(
389
+ "main",
390
+ {
391
+ ref,
392
+ className: cn(
393
+ "mx-auto w-full px-6 md:px-8 py-10 flex flex-col gap-12",
394
+ pageWidthClass[width],
395
+ className
396
+ ),
397
+ ...rest,
398
+ children
399
+ }
400
+ );
401
+ });
402
+ const PageHeader = forwardRef(
403
+ function PageHeader2({ title, description, actions, eyebrow, className, ...rest }, ref) {
404
+ return /* @__PURE__ */ jsxs(
405
+ "header",
406
+ {
407
+ ref,
408
+ className: cn(
409
+ "flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",
410
+ className
411
+ ),
412
+ ...rest,
413
+ children: [
414
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2 min-w-0", children: [
415
+ eyebrow && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap items-center gap-2", children: eyebrow }),
416
+ /* @__PURE__ */ jsx("h1", { children: title }),
417
+ description && /* @__PURE__ */ jsx("p", { className: "text-muted-foreground max-w-[720px]", children: description })
418
+ ] }),
419
+ actions && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap items-center gap-3 shrink-0", children: actions })
420
+ ]
421
+ }
422
+ );
423
+ }
424
+ );
425
+ const Section = forwardRef(function Section2({ title, description, actions, className, children, ...rest }, ref) {
426
+ const hasHeader = Boolean(title || description || actions);
427
+ return /* @__PURE__ */ jsxs(
428
+ "section",
429
+ {
430
+ ref,
431
+ className: cn("flex flex-col gap-6", className),
432
+ ...rest,
433
+ children: [
434
+ hasHeader && /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2 sm:flex-row sm:items-start sm:justify-between", children: [
435
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1 min-w-0", children: [
436
+ title && /* @__PURE__ */ jsx("h2", { children: title }),
437
+ description && /* @__PURE__ */ jsx("p", { className: "text-muted-foreground max-w-[720px]", children: description })
438
+ ] }),
439
+ actions && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap items-center gap-3 shrink-0", children: actions })
440
+ ] }),
441
+ children
442
+ ]
443
+ }
444
+ );
445
+ });
446
+ const Toolbar = forwardRef(
447
+ function Toolbar2({ end, className, children, ...rest }, ref) {
448
+ return /* @__PURE__ */ jsxs(
449
+ "div",
450
+ {
451
+ ref,
452
+ className: cn(
453
+ "flex flex-wrap items-center gap-3",
454
+ className
455
+ ),
456
+ ...rest,
457
+ children: [
458
+ children,
459
+ end && /* @__PURE__ */ jsx("div", { className: "ml-auto flex items-center gap-3", children: end })
460
+ ]
461
+ }
462
+ );
463
+ }
464
+ );
465
+ const cardGridColsClass = {
466
+ 2: "grid-cols-1 sm:grid-cols-2",
467
+ 3: "grid-cols-1 sm:grid-cols-2 lg:grid-cols-3",
468
+ 4: "grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4"
469
+ };
470
+ const CardGrid = forwardRef(
471
+ function CardGrid2({ cols = 3, className, children, ...rest }, ref) {
472
+ return /* @__PURE__ */ jsx(
473
+ "div",
474
+ {
475
+ ref,
476
+ className: cn("grid gap-6", cardGridColsClass[cols], className),
477
+ ...rest,
478
+ children
479
+ }
480
+ );
481
+ }
482
+ );
483
+ const stackGapClass = {
484
+ 1: "gap-1",
485
+ 2: "gap-2",
486
+ 3: "gap-3",
487
+ 4: "gap-4",
488
+ 6: "gap-6",
489
+ 8: "gap-8",
490
+ 10: "gap-10",
491
+ 12: "gap-12"
492
+ };
493
+ const stackAlignClass = {
494
+ start: "items-start",
495
+ center: "items-center",
496
+ end: "items-end",
497
+ stretch: "items-stretch"
498
+ };
499
+ const stackJustifyClass = {
500
+ start: "justify-start",
501
+ center: "justify-center",
502
+ end: "justify-end",
503
+ between: "justify-between",
504
+ around: "justify-around"
505
+ };
506
+ const Stack = forwardRef(function Stack2({
507
+ direction = "col",
508
+ gap = 4,
509
+ align,
510
+ justify,
511
+ wrap,
512
+ className,
513
+ children,
514
+ ...rest
515
+ }, ref) {
516
+ return /* @__PURE__ */ jsx(
517
+ "div",
518
+ {
519
+ ref,
520
+ className: cn(
521
+ "flex",
522
+ direction === "col" ? "flex-col" : "flex-row",
523
+ stackGapClass[gap],
524
+ align && stackAlignClass[align],
525
+ justify && stackJustifyClass[justify],
526
+ wrap && "flex-wrap",
527
+ className
528
+ ),
529
+ ...rest,
530
+ children
531
+ }
532
+ );
533
+ });
380
534
  const sizeStyles$1 = {
381
535
  large: {
382
536
  container: "h-9 px-3 gap-1",
@@ -3876,19 +4030,25 @@ TimeInput.displayName = "TimeInput";
3876
4030
  export {
3877
4031
  Button,
3878
4032
  Card,
4033
+ CardGrid,
3879
4034
  Chip,
3880
4035
  DateInput,
3881
4036
  Dropdown,
3882
4037
  DropdownMultiple,
3883
4038
  Input,
3884
4039
  OptionList,
4040
+ Page,
4041
+ PageHeader,
3885
4042
  SearchInput,
4043
+ Section,
4044
+ Stack,
3886
4045
  StatusTag,
3887
4046
  Tab,
3888
4047
  TabGroup,
3889
4048
  Tag,
3890
4049
  TextArea,
3891
4050
  TimeInput,
4051
+ Toolbar,
3892
4052
  cn
3893
4053
  };
3894
4054
  //# sourceMappingURL=index.js.map