@sarunyu/system-one 1.1.1 → 1.2.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",
@@ -2785,7 +2939,7 @@ const sizeClasses = {
2785
2939
  font: "font-bold",
2786
2940
  gap: "gap-1.5",
2787
2941
  iconSize: "h-5 w-5",
2788
- badgeClass: "min-w-[18px] px-[5.5px] text-[length:var(--text-xs)] leading-[var(--leading-4)]"
2942
+ badgeClass: "min-w-[16px] h-[16px] px-[3px] text-[length:var(--text-xs)] leading-[var(--leading-4)]"
2789
2943
  },
2790
2944
  md: {
2791
2945
  pad: "px-2.5 py-2",
@@ -2794,7 +2948,7 @@ const sizeClasses = {
2794
2948
  font: "font-bold",
2795
2949
  gap: "gap-1.5",
2796
2950
  iconSize: "h-[18px] w-[18px]",
2797
- badgeClass: "min-w-[18px] px-[5.5px] text-[length:var(--text-xs)] leading-[var(--leading-4)]"
2951
+ badgeClass: "min-w-[16px] h-[16px] px-[3px] text-[length:var(--text-xs)] leading-[var(--leading-4)]"
2798
2952
  },
2799
2953
  sm: {
2800
2954
  pad: "px-2 py-1.5",
@@ -2803,7 +2957,7 @@ const sizeClasses = {
2803
2957
  font: "font-semibold",
2804
2958
  gap: "gap-1",
2805
2959
  iconSize: "h-4 w-4",
2806
- badgeClass: "min-h-[14px] px-1 text-[length:var(--text-xxs)] leading-[var(--leading-3)]"
2960
+ badgeClass: "min-w-[14px] h-[14px] px-1 text-[length:var(--text-xxs)] leading-[var(--leading-3)]"
2807
2961
  }
2808
2962
  };
2809
2963
  function DefaultTabIcon({ className }) {
@@ -2824,7 +2978,7 @@ const Tab = forwardRef(function Tab2({
2824
2978
  const hasNotification = notification !== void 0 && notification !== null;
2825
2979
  const renderedIcon = icon === true ? /* @__PURE__ */ jsx(DefaultTabIcon, { className: s.iconSize }) : icon;
2826
2980
  const textColor = disabled ? "text-disabled" : active ? "text-primary-action" : "text-muted-foreground";
2827
- const borderColor = active && !disabled ? "border-primary-action" : "border-border";
2981
+ const borderColor = disabled ? "border-border-disabled" : active ? "border-primary-action" : "border-border";
2828
2982
  const cursor = disabled ? "cursor-not-allowed" : "cursor-pointer";
2829
2983
  const hoverBg = !disabled && !active ? "hover:bg-hover-bg" : "";
2830
2984
  return /* @__PURE__ */ jsxs(
@@ -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