graphen 2.0.4 → 2.0.5
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 +1 -1
- package/src/example/styles/_docs.scss +66 -0
- package/src/example.tsx +66 -0
package/package.json
CHANGED
|
@@ -645,6 +645,72 @@ body.docs-body {
|
|
|
645
645
|
.swatch-radius { width: 36px; height: 24px; background: var(--surface-2); border: 1px solid var(--border-strong); }
|
|
646
646
|
}
|
|
647
647
|
|
|
648
|
+
.docs-bp-grid {
|
|
649
|
+
background: var(--bg-elev);
|
|
650
|
+
border: 1px solid var(--border);
|
|
651
|
+
border-radius: var(--radius-lg);
|
|
652
|
+
overflow: hidden;
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
.docs-bp-row {
|
|
656
|
+
display: grid;
|
|
657
|
+
grid-template-columns: 180px 120px 1fr;
|
|
658
|
+
gap: 16px;
|
|
659
|
+
align-items: center;
|
|
660
|
+
padding: 10px 18px;
|
|
661
|
+
border-top: 1px solid var(--border);
|
|
662
|
+
|
|
663
|
+
&:first-child { border-top: none; }
|
|
664
|
+
|
|
665
|
+
.mixin,
|
|
666
|
+
.range { font-family: var(--font-mono); font-size: 12.5px; }
|
|
667
|
+
.range { color: var(--text-muted); }
|
|
668
|
+
.vars { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
.docs-bp-demo {
|
|
672
|
+
display: flex;
|
|
673
|
+
flex-wrap: wrap;
|
|
674
|
+
justify-content: center;
|
|
675
|
+
gap: 12px;
|
|
676
|
+
|
|
677
|
+
.pill {
|
|
678
|
+
display: flex;
|
|
679
|
+
flex-direction: column;
|
|
680
|
+
align-items: center;
|
|
681
|
+
gap: 2px;
|
|
682
|
+
min-width: 128px;
|
|
683
|
+
padding: 10px 18px;
|
|
684
|
+
border: 1px dashed var(--border-strong);
|
|
685
|
+
border-radius: var(--radius);
|
|
686
|
+
opacity: 0.35;
|
|
687
|
+
transition: opacity 0.15s, border-color 0.15s, background 0.15s;
|
|
688
|
+
|
|
689
|
+
.nm { font-family: var(--font-mono); font-size: 12.5px; color: var(--text); }
|
|
690
|
+
.rg { font-family: var(--font-mono); font-size: 11px; color: var(--text-subtle); }
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
/* The live part of the Responsiveness demo — powered by the
|
|
695
|
+
library's own gx-* mixins, not by docs-local media queries. */
|
|
696
|
+
@mixin docs-bp-pill-active {
|
|
697
|
+
background: var(--accent-soft);
|
|
698
|
+
border: 1px solid var(--accent);
|
|
699
|
+
opacity: 1;
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
@include gx-phone {
|
|
703
|
+
.docs-bp-demo .pill--phone { @include docs-bp-pill-active; }
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
@include gx-tablet {
|
|
707
|
+
.docs-bp-demo .pill--tablet { @include docs-bp-pill-active; }
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
@include gx-desktop {
|
|
711
|
+
.docs-bp-demo .pill--desktop { @include docs-bp-pill-active; }
|
|
712
|
+
}
|
|
713
|
+
|
|
648
714
|
.docs-comp-index {
|
|
649
715
|
display: grid;
|
|
650
716
|
grid-template-columns: repeat(4, 1fr);
|
package/src/example.tsx
CHANGED
|
@@ -104,6 +104,16 @@ const SPACING = [
|
|
|
104
104
|
["$gb-sp-16", "64 px", "4rem", 64],
|
|
105
105
|
] as const;
|
|
106
106
|
|
|
107
|
+
const BREAKPOINTS = [
|
|
108
|
+
["@include gx-phone", "< 768 px", "up to $g-tablet-width − 1px"],
|
|
109
|
+
[
|
|
110
|
+
"@include gx-tablet",
|
|
111
|
+
"768 – 1023 px",
|
|
112
|
+
"$g-tablet-width … $g-desktop-width − 1px",
|
|
113
|
+
],
|
|
114
|
+
["@include gx-desktop", "≥ 1024 px", "$g-desktop-width and up"],
|
|
115
|
+
] as const;
|
|
116
|
+
|
|
107
117
|
const RADIUS = [
|
|
108
118
|
["$gb-r-sm", "4 px", 4],
|
|
109
119
|
["$gb-r", "6 px", 6],
|
|
@@ -166,6 +176,7 @@ const NAV = [
|
|
|
166
176
|
{ id: "typography", label: "Typography" },
|
|
167
177
|
{ id: "spacing", label: "Spacing & radius" },
|
|
168
178
|
{ id: "iconography", label: "Iconography", count: "14" },
|
|
179
|
+
{ id: "responsiveness", label: "Responsiveness" },
|
|
169
180
|
],
|
|
170
181
|
},
|
|
171
182
|
{
|
|
@@ -195,6 +206,7 @@ const TOC = [
|
|
|
195
206
|
["typography", "Typography"],
|
|
196
207
|
["spacing", "Spacing & radius"],
|
|
197
208
|
["iconography", "Iconography"],
|
|
209
|
+
["responsiveness", "Responsiveness"],
|
|
198
210
|
["logo", "Logo"],
|
|
199
211
|
["button", "Button"],
|
|
200
212
|
["link", "Link"],
|
|
@@ -713,6 +725,60 @@ function App() {
|
|
|
713
725
|
</div>
|
|
714
726
|
</section>
|
|
715
727
|
|
|
728
|
+
<section className="docs-section" id="responsiveness">
|
|
729
|
+
<div className="docs-section-eyebrow">Foundations / 05</div>
|
|
730
|
+
<h2 className="docs-section-title">Responsiveness</h2>
|
|
731
|
+
<p className="docs-section-desc">
|
|
732
|
+
Breakpoints are exposed as Sass variables and wrapped by three
|
|
733
|
+
mixins — <code>gx-phone</code>, <code>gx-tablet</code> and{" "}
|
|
734
|
+
<code>gx-desktop</code>. Each mixin scopes its block to exactly
|
|
735
|
+
one range, so the three never overlap. The demo below is styled
|
|
736
|
+
with the real mixins — resize the window to see the active range
|
|
737
|
+
light up.
|
|
738
|
+
</p>
|
|
739
|
+
<div className="docs-bp-grid" role="table" aria-label="Breakpoints">
|
|
740
|
+
{BREAKPOINTS.map(([mixin, range, vars]) => (
|
|
741
|
+
<div className="docs-bp-row" key={mixin}>
|
|
742
|
+
<span className="mixin">{mixin}</span>
|
|
743
|
+
<span className="range">{range}</span>
|
|
744
|
+
<span className="vars">{vars}</span>
|
|
745
|
+
</div>
|
|
746
|
+
))}
|
|
747
|
+
</div>
|
|
748
|
+
<div className="docs-spacer-y" />
|
|
749
|
+
<Demo
|
|
750
|
+
stageClass="center"
|
|
751
|
+
code={`.docs-bp-demo .pill { opacity: 0.35; }
|
|
752
|
+
|
|
753
|
+
@include gx-phone {
|
|
754
|
+
.docs-bp-demo .pill--phone { opacity: 1; }
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
@include gx-tablet {
|
|
758
|
+
.docs-bp-demo .pill--tablet { opacity: 1; }
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
@include gx-desktop {
|
|
762
|
+
.docs-bp-demo .pill--desktop { opacity: 1; }
|
|
763
|
+
}`}
|
|
764
|
+
>
|
|
765
|
+
<div className="docs-bp-demo">
|
|
766
|
+
<div className="pill pill--phone">
|
|
767
|
+
<span className="nm">gx-phone</span>
|
|
768
|
+
<span className="rg">< 768 px</span>
|
|
769
|
+
</div>
|
|
770
|
+
<div className="pill pill--tablet">
|
|
771
|
+
<span className="nm">gx-tablet</span>
|
|
772
|
+
<span className="rg">768 – 1023 px</span>
|
|
773
|
+
</div>
|
|
774
|
+
<div className="pill pill--desktop">
|
|
775
|
+
<span className="nm">gx-desktop</span>
|
|
776
|
+
<span className="rg">≥ 1024 px</span>
|
|
777
|
+
</div>
|
|
778
|
+
</div>
|
|
779
|
+
</Demo>
|
|
780
|
+
</section>
|
|
781
|
+
|
|
716
782
|
<section className="docs-section" id="logo">
|
|
717
783
|
<div className="docs-section-eyebrow">Components / 01</div>
|
|
718
784
|
<h2 className="docs-section-title">Logo</h2>
|