@sarunyu/system-one 4.9.7 → 4.9.8

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/llms.txt CHANGED
@@ -845,13 +845,23 @@ Centered overlay surface for confirmations, richer content, or status alerts.
845
845
  Caller owns open/close state and supplies the backdrop — `<Modal>` only renders
846
846
  the dialog panel.
847
847
 
848
+ **CRITICAL — choose the correct variant before writing any code:**
849
+
850
+ | Variant | Use when | Has children? |
851
+ |---|---|---|
852
+ | `"dialog"` | Simple confirmation: title + description text + up to 2 buttons. NO custom UI. | No |
853
+ | `"content"` | Any modal with custom content: filters, forms, inputs, lists, date pickers, etc. | Yes — required |
854
+ | `"alert"` | Status moments only: success / warning / danger with icon. | No |
855
+
856
+ **Rule: if the modal contains ANYTHING other than a title + plain description text → use `variant="content"` and pass the body as `children`. Never use `variant="dialog"` with custom UI inside.**
857
+
848
858
  ```tsx
849
859
  type ModalVariant = "dialog" | "content" | "alert";
850
860
  type ModalActionLayout = "none" | "single" | "double";
851
861
  type ModalResponsive = "mobile" | "desktop";
852
862
  type ModalAlertStatus = "warning" | "success" | "danger";
853
863
 
854
- // Dialog — short confirmation (title + text + up to 2 buttons)
864
+ // Dialog — ONLY for title + plain text + buttons. No custom children.
855
865
  <Modal
856
866
  variant="dialog"
857
867
  actionLayout="double"
@@ -864,7 +874,24 @@ type ModalAlertStatus = "warning" | "success" | "danger";
864
874
  onClose={close}
865
875
  />
866
876
 
867
- // Content — custom body (pass children)
877
+ // Content — filters, forms, inputs, any custom UI. Always pass children.
878
+ <Modal
879
+ variant="content"
880
+ actionLayout="double"
881
+ title="Filters"
882
+ primaryLabel="Apply"
883
+ secondaryLabel="Reset"
884
+ onPrimaryClick={apply}
885
+ onSecondaryClick={reset}
886
+ onClose={close}
887
+ >
888
+ <div className="flex flex-col gap-4">
889
+ <Dropdown placeholder="Category" ... />
890
+ <DateInput mode="range" ... />
891
+ </div>
892
+ </Modal>
893
+
894
+ // Content desktop — right-aligns action buttons
868
895
  <Modal variant="content" actionLayout="single" responsive="desktop" title="Edit profile" onClose={close}>
869
896
  <Input placeholder="Name" value={name} onChange={setName} />
870
897
  </Modal>
@@ -886,7 +913,9 @@ type ModalAlertStatus = "warning" | "success" | "danger";
886
913
  ```tsx
887
914
  {open ? (
888
915
  <div className="fixed inset-0 z-50 flex items-center justify-center bg-black/30 p-4">
889
- <Modal variant="dialog" actionLayout="double" onClose={close} {...rest} />
916
+ <Modal variant="content" title="Filters" actionLayout="double" onClose={close}>
917
+ {/* your content */}
918
+ </Modal>
890
919
  </div>
891
920
  ) : null}
892
921
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sarunyu/system-one",
3
- "version": "4.9.7",
3
+ "version": "4.9.8",
4
4
  "type": "module",
5
5
  "description": "A production-ready React design system built for AI-powered web generation tools (Figma Make, Lovable, V0). Tailwind CSS v4 + CSS custom properties for full theming support.",
6
6
  "keywords": [