@sarunyu/system-one 4.3.0 → 4.4.1

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 CHANGED
@@ -60,12 +60,14 @@ ships no `Page`/`Section`/`Stack` primitives — use whatever layout looks right
60
60
  | `Button` | Action button — 5 variants, 10 sizes |
61
61
  | `Input` / `TextArea` / `SearchInput` | Text input, multiline, search field |
62
62
  | `Dropdown` / `DropdownMultiple` / `OptionList` | Select controls |
63
- | `Checkbox` / `Radio` | Boolean / single-choice |
63
+ | `Checkbox` / `Toggle` / `Radio` | Checkbox, boolean switch (on/off), single-choice |
64
64
  | `DateInput` / `TimeInput` | Date and time pickers |
65
65
  | `Tag` / `StatusTag` / `Chip` | Labels, workflow states, filter chips |
66
66
  | `Tab` / `TabGroup` | Tabbed navigation |
67
67
  | `Card` | Event/content card (desktop / tablet / mobile variants) |
68
68
  | `Table` | Data tables (`TableRow` / `TableHeaderCell` / `TableCell`) |
69
+ | `Modal` | Centered overlay — dialog / content / alert variants |
70
+ | `BottomSheet` | Mobile-first bottom sheet (Vaul-based, with backdrop) |
69
71
 
70
72
  Full prop reference: [`llms.txt`](./llms.txt).
71
73
 
@@ -120,6 +122,8 @@ import type {
120
122
  ButtonVariant, ButtonSize,
121
123
  TagVariant, ChipSize,
122
124
  InputProps, DropdownOption,
125
+ ToggleSize, ToggleProps,
126
+ ModalVariant, ModalActionLayout,
123
127
  } from "@sarunyu/system-one";
124
128
  ```
125
129
 
package/dist/index.cjs CHANGED
@@ -247,6 +247,19 @@ const Button = React.forwardRef(function Button2({
247
247
  );
248
248
  });
249
249
  Button.displayName = "Button";
250
+ function BannerMedia({ src, alt }) {
251
+ if (!src) {
252
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { "aria-hidden": "true", className: "absolute inset-0 bg-muted" });
253
+ }
254
+ return /* @__PURE__ */ jsxRuntime.jsx(
255
+ "img",
256
+ {
257
+ alt,
258
+ className: "pointer-events-none absolute inset-0 size-full object-cover",
259
+ src
260
+ }
261
+ );
262
+ }
250
263
  function DurationBadge({
251
264
  duration,
252
265
  size
@@ -340,7 +353,7 @@ const tagConfig = {
340
353
  }
341
354
  };
342
355
  const Card = React.forwardRef(function Card2({
343
- variant = "event",
356
+ variant = "default",
344
357
  size = "desktop",
345
358
  children,
346
359
  title,
@@ -454,14 +467,7 @@ const Card = React.forwardRef(function Card2({
454
467
  }
455
468
  )
456
469
  ] }),
457
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative h-[84px] w-[149px] shrink-0 overflow-clip rounded-[6px]", children: /* @__PURE__ */ jsxRuntime.jsx(
458
- "img",
459
- {
460
- alt: "social thumbnail",
461
- className: "pointer-events-none absolute inset-0 size-full object-cover",
462
- src: bannerSrc
463
- }
464
- ) })
470
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative h-[84px] w-[149px] shrink-0 overflow-clip rounded-[6px]", children: /* @__PURE__ */ jsxRuntime.jsx(BannerMedia, { src: bannerSrc, alt: "social thumbnail" }) })
465
471
  ] }),
466
472
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
467
473
  isDesktop ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 items-center gap-[12px]", children: [
@@ -544,14 +550,7 @@ const Card = React.forwardRef(function Card2({
544
550
  imgHeight
545
551
  ),
546
552
  children: [
547
- /* @__PURE__ */ jsxRuntime.jsx(
548
- "img",
549
- {
550
- alt: "live thumbnail",
551
- className: "pointer-events-none absolute inset-0 size-full object-cover",
552
- src: bannerSrc
553
- }
554
- ),
553
+ /* @__PURE__ */ jsxRuntime.jsx(BannerMedia, { src: bannerSrc, alt: "live thumbnail" }),
555
554
  /* @__PURE__ */ jsxRuntime.jsxs(
556
555
  "div",
557
556
  {
@@ -588,14 +587,7 @@ const Card = React.forwardRef(function Card2({
588
587
  ),
589
588
  children: [
590
589
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative h-[184px] w-full shrink-0 overflow-clip", children: [
591
- /* @__PURE__ */ jsxRuntime.jsx(
592
- "img",
593
- {
594
- alt: "news banner",
595
- className: "pointer-events-none absolute inset-0 size-full object-cover",
596
- src: bannerSrc
597
- }
598
- ),
590
+ /* @__PURE__ */ jsxRuntime.jsx(BannerMedia, { src: bannerSrc, alt: "news banner" }),
599
591
  locked && /* @__PURE__ */ jsxRuntime.jsx(LockBadge, {})
600
592
  ] }),
601
593
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -625,14 +617,7 @@ const Card = React.forwardRef(function Card2({
625
617
  ),
626
618
  children: [
627
619
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative h-[114px] w-[171px] shrink-0 overflow-clip", children: [
628
- /* @__PURE__ */ jsxRuntime.jsx(
629
- "img",
630
- {
631
- alt: "news banner",
632
- className: "pointer-events-none absolute inset-0 size-full object-cover",
633
- src: bannerSrc
634
- }
635
- ),
620
+ /* @__PURE__ */ jsxRuntime.jsx(BannerMedia, { src: bannerSrc, alt: "news banner" }),
636
621
  locked && /* @__PURE__ */ jsxRuntime.jsx(LockBadge, {})
637
622
  ] }),
638
623
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -670,11 +655,10 @@ const Card = React.forwardRef(function Card2({
670
655
  className: cn("relative w-full shrink-0 overflow-clip", bannerClass),
671
656
  children: [
672
657
  /* @__PURE__ */ jsxRuntime.jsx(
673
- "img",
658
+ BannerMedia,
674
659
  {
675
- alt: variant === "news" ? "news banner" : "event banner",
676
- className: "pointer-events-none absolute inset-0 size-full object-cover",
677
- src: bannerSrc
660
+ src: bannerSrc,
661
+ alt: variant === "news" ? "news banner" : "event banner"
678
662
  }
679
663
  ),
680
664
  locked && /* @__PURE__ */ jsxRuntime.jsx(LockBadge, { size })