graphen 2.0.0 → 2.0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graphen",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "Graphen is a small library, that keeps reusable blocks of UI and helps making application design consistent across multiple projects.",
5
5
  "main": "src/index.ts",
6
6
  "files": [
@@ -81,7 +81,7 @@ body.docs-body {
81
81
  top: 0;
82
82
  z-index: 30;
83
83
  display: grid;
84
- grid-template-columns: 280px 1fr auto;
84
+ grid-template-columns: 1fr auto;
85
85
  align-items: center;
86
86
  height: 56px;
87
87
  padding: 0 24px;
@@ -112,41 +112,6 @@ body.docs-body {
112
112
  }
113
113
  }
114
114
 
115
- .docs-search {
116
- display: flex;
117
- align-items: center;
118
- gap: 10px;
119
- width: 100%;
120
- max-width: 440px;
121
- height: 34px;
122
- padding: 0 12px;
123
- background: var(--surface);
124
- border: 1px solid var(--border);
125
- border-radius: 8px;
126
- color: var(--text-muted);
127
- font-size: 13px;
128
- cursor: text;
129
- transition: border-color 0.15s, background 0.15s;
130
-
131
- &:hover { border-color: var(--border-strong); }
132
-
133
- .kbd {
134
- margin-left: auto;
135
- display: inline-flex;
136
- gap: 2px;
137
- }
138
-
139
- .kbd > span {
140
- padding: 1px 5px;
141
- background: var(--bg-elev);
142
- border: 1px solid var(--border);
143
- border-radius: 4px;
144
- font-family: var(--font-mono);
145
- font-size: 11px;
146
- color: var(--text-subtle);
147
- }
148
- }
149
-
150
115
  .docs-tools {
151
116
  display: flex;
152
117
  align-items: center;
@@ -691,6 +656,22 @@ body.docs-body {
691
656
  .docs-col { display: flex; flex-direction: column; gap: 12px; }
692
657
  .docs-spacer-y { height: 16px; }
693
658
 
659
+ .docs-dialog-content {
660
+ max-width: 320px;
661
+
662
+ h4 {
663
+ margin: 0 0 8px;
664
+ font-size: 17px;
665
+ font-weight: 500;
666
+ }
667
+
668
+ p {
669
+ margin: 0 0 18px;
670
+ color: var(--text-muted);
671
+ font-size: 13.5px;
672
+ }
673
+ }
674
+
694
675
  .docs-card-eyebrow {
695
676
  font-family: var(--font-mono);
696
677
  font-size: 11px;
@@ -716,15 +697,12 @@ body.docs-body {
716
697
  @media (max-width: 1180px) {
717
698
  .docs-app { grid-template-columns: 240px minmax(0, 1fr); }
718
699
  .docs-toc { display: none; }
719
- .docs-topbar { grid-template-columns: 240px 1fr auto; }
720
700
  .docs-content { padding: 40px 40px 80px; }
721
701
  }
722
702
 
723
703
  @media (max-width: 760px) {
724
704
  .docs-app { grid-template-columns: 1fr; }
725
705
  .docs-sidebar { display: none; }
726
- .docs-topbar { grid-template-columns: 1fr auto; }
727
- .docs-search { display: none; }
728
706
  .docs-content { padding: 28px 20px 60px; }
729
707
  .docs-comp-index { grid-template-columns: repeat(2, 1fr); }
730
708
  .docs-title { font-size: 34px; }
package/src/example.tsx CHANGED
@@ -5,6 +5,7 @@ import {
5
5
  Badge,
6
6
  Button,
7
7
  Card,
8
+ Dialog,
8
9
  Dropdown,
9
10
  Input,
10
11
  Link,
@@ -150,6 +151,7 @@ const NAV = [
150
151
  { id: "separator", label: "Separator" },
151
152
  { id: "input", label: "Input" },
152
153
  { id: "dropdown", label: "Dropdown" },
154
+ { id: "dialog", label: "Dialog" },
153
155
  { id: "card", label: "Card" },
154
156
  { id: "badge", label: "Badge" },
155
157
  ],
@@ -169,6 +171,7 @@ const TOC = [
169
171
  ["separator", "Separator"],
170
172
  ["input", "Input"],
171
173
  ["dropdown", "Dropdown"],
174
+ ["dialog", "Dialog"],
172
175
  ["card", "Card"],
173
176
  ["badge", "Badge"],
174
177
  ] as const;
@@ -362,6 +365,7 @@ function App() {
362
365
  const [activeId, setActiveId] = useState<string>("introduction");
363
366
  const [installCopied, setInstallCopied] = useState(false);
364
367
  const [dropdownValue, setDropdownValue] = useState("red");
368
+ const [isDialogOpen, setIsDialogOpen] = useState(false);
365
369
 
366
370
  useEffect(() => {
367
371
  document.documentElement.setAttribute("data-theme", theme);
@@ -419,21 +423,6 @@ function App() {
419
423
  <span>graphen</span>
420
424
  <span className="ver">{VERSION}</span>
421
425
  </a>
422
- <div
423
- className="docs-search"
424
- role="search"
425
- aria-label="Search documentation"
426
- >
427
- <StrokeIcon size={14} stroke={2}>
428
- <circle cx="11" cy="11" r="7" />
429
- <path d="m20 20-3.5-3.5" />
430
- </StrokeIcon>
431
- <span>Search components, tokens…</span>
432
- <span className="kbd">
433
- <span>⌘</span>
434
- <span>K</span>
435
- </span>
436
- </div>
437
426
  <div className="docs-tools">
438
427
  <button
439
428
  type="button"
@@ -865,8 +854,50 @@ function App() {
865
854
  </Demo>
866
855
  </section>
867
856
 
868
- <section className="docs-section" id="card">
857
+ <section className="docs-section" id="dialog">
869
858
  <div className="docs-section-eyebrow">Components / 08</div>
859
+ <h2 className="docs-section-title">Dialog</h2>
860
+ <p className="docs-section-desc">
861
+ A fixed overlay surface for focused messages and short actions.
862
+ Render it conditionally and keep a clear dismissal path.
863
+ </p>
864
+ <Demo
865
+ code={`const [isDialogOpen, setIsDialogOpen] = useState(false);
866
+
867
+ <Button className="gc-btn--primary" onClick={() => setIsDialogOpen(true)}>
868
+ Open dialog
869
+ </Button>
870
+
871
+ {isDialogOpen && (
872
+ <Dialog isOverlay>
873
+ <h4>Publish changes?</h4>
874
+ <p>This action will update the public example bundle.</p>
875
+ <Button onClick={() => setIsDialogOpen(false)}>Close</Button>
876
+ </Dialog>
877
+ )}`}
878
+ >
879
+ <Button
880
+ className="gc-btn--primary"
881
+ onClick={() => setIsDialogOpen(true)}
882
+ >
883
+ Open dialog
884
+ </Button>
885
+ {isDialogOpen && (
886
+ <Dialog isOverlay>
887
+ <div className="docs-dialog-content">
888
+ <h4>Publish changes?</h4>
889
+ <p>This action will update the public example bundle.</p>
890
+ <Button onClick={() => setIsDialogOpen(false)}>
891
+ Close
892
+ </Button>
893
+ </div>
894
+ </Dialog>
895
+ )}
896
+ </Demo>
897
+ </section>
898
+
899
+ <section className="docs-section" id="card">
900
+ <div className="docs-section-eyebrow">Components / 09</div>
870
901
  <h2 className="docs-section-title">Card</h2>
871
902
  <p className="docs-section-desc">
872
903
  A single-content surface. Don&apos;t nest cards. If a card has
@@ -905,7 +936,7 @@ function App() {
905
936
  </section>
906
937
 
907
938
  <section className="docs-section" id="badge">
908
- <div className="docs-section-eyebrow">Components / 09</div>
939
+ <div className="docs-section-eyebrow">Components / 10</div>
909
940
  <h2 className="docs-section-title">Badge</h2>
910
941
  <p className="docs-section-desc">
911
942
  Small status pills. Use sparingly — one badge per row, never