Skip to content

Commit f696479

Browse files
committed
Updated panel helper styling
1 parent 1d4fb6d commit f696479

File tree

6 files changed

+207
-175
lines changed

6 files changed

+207
-175
lines changed

pages/columns/@column/column-inspector/index.module.sass

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,24 @@
3333
& > *
3434
border-radius: 4px
3535

36+
h3
37+
color: var(--secondary-color)
38+
39+
.column-settings-panel
3640
:global
37-
.bp5-label
38-
flex-grow: 1
41+
.bp5-form-group, .bp5-control-group
42+
.bp5-label
43+
color: var(--text-color)
44+
flex-grow: 1
45+
46+
.facet-control
47+
:global(.bp5-html-select).unset select
48+
color: var(--secondary-color)
49+
font-style: italic
3950

51+
:global(.bp5-label) .facet-label :global(.bp5-popover-target)
52+
margin-left: 0.2em
53+
display: inline
4054

4155
.range-control
4256
:global
@@ -76,8 +90,7 @@
7690
top: 2.2em
7791

7892
h3
79-
color: #444
80-
margin-bottom: 0.3em
93+
color: var(--secondary-color)
8194

8295
.default-buttons
8396
width: 100%

pages/columns/@column/column-inspector/index.ts

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,15 @@ import { navigate } from "vike/client/router";
2121
import { SGPMeasurementsColumn, StableIsotopesColumn } from "./facets";
2222
import { ModalUnitPanel } from "./modal-panel";
2323

24-
import { PageBreadcrumbs } from "~/components";
24+
import { AlphaTag, BetaTag, PageBreadcrumbs } from "~/components";
2525
import { onDemand } from "~/_utils";
26-
import { ErrorBoundary } from "@macrostrat/ui-components";
26+
import { CollapsePanel, ErrorBoundary } from "@macrostrat/ui-components";
2727
import { DataField, Parenthetical } from "@macrostrat/data-components";
2828
import { ColumnAxisType } from "@macrostrat/column-components";
2929
import { atom, useAtom, useAtomValue, useSetAtom, WritableAtom } from "jotai";
3030
import {
3131
Button,
32+
Collapse,
3233
ControlGroup,
3334
FormGroup,
3435
HTMLSelect,
@@ -78,15 +79,15 @@ function validateAxis(value: string | null): ColumnAxisType | undefined {
7879
}
7980

8081
const facets = [
81-
{ label: "None", value: null },
82+
{ label: "None", value: "none" },
8283
{ label: "Carbon/oxygen isotopes", value: "stable-isotopes" },
8384
{ label: "SGP", value: "sgp-samples" },
8485
{ label: "Fossils (taxa)", value: "fossil-taxa" },
8586
{ label: "Fossils (collections)", value: "fossil-collections" },
8687
{ label: "Detrital zircons", value: "detrital-zircons" },
8788
];
8889

89-
const validFacets = facets.map((d) => d.value).filter((d) => d != null);
90+
const validFacets = facets.map((d) => d.value).filter((d) => d != "none");
9091

9192
function getStateFromHash(): ColumnHashState {
9293
const hash = document.location.hash.substring(1);
@@ -483,6 +484,7 @@ function ColumnSettingsPanel() {
483484
}
484485

485486
return h("div.column-settings-panel", [
487+
h("h3", "Settings"),
486488
h(AxisTypeControl),
487489
h(FacetControl),
488490
h(RangeControl, {
@@ -613,6 +615,7 @@ function AxisTypeControl() {
613615
return { label: k, value: v };
614616
});
615617
const axisType = useAtomValue(inferredAxisTypeAtom);
618+
const defaultAxisType = useAtomValue(defaultAxisTypeAtom);
616619
const setAxisType = useSetAtom(axisTypeAtom);
617620
return h(
618621
FormGroup,
@@ -627,7 +630,11 @@ function AxisTypeControl() {
627630
setAxisType(value);
628631
},
629632
}),
630-
h(ClearButton, { value: axisType, setValue: setAxisType }),
633+
h(ClearButton, {
634+
value: axisType,
635+
setValue: setAxisType,
636+
disabled: axisType === defaultAxisType,
637+
}),
631638
])
632639
);
633640
}
@@ -637,15 +644,15 @@ function FacetControl() {
637644
return h("div.facet-control", [
638645
h(
639646
FormGroup,
640-
{ label: "Facet", inline: true },
647+
{ label: h("span.facet-label", ["Facet ", h(AlphaTag, {content: "This feature is in early development"})]), inline: true },
641648
h(ControlGroup, { fill: true }, [
642649
h(HTMLSelect, {
643650
options: facets,
644-
value: facet,
645-
intent: facet == null ? "none" : "primary",
651+
value: facet ?? "none",
652+
className: facet == null ? "unset" : null,
646653
onChange: (evt) => {
647654
const value = evt.target.value;
648-
setFacet(value);
655+
setFacet(value === "none" ? null : value);
649656
},
650657
}),
651658
h(ClearButton, { value: facet, setValue: setFacet }),

pages/maps/main.module.sass

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,6 @@
3535
display: inline-block
3636
font-size: 0.8em
3737

38-
h1,
39-
h3
40-
margin: 0
41-
4238
.maps-list
4339
padding: 0
4440
display: flex
@@ -189,4 +185,4 @@ h3
189185

190186
.top-row
191187
display: flex
192-
gap: .5em
188+
gap: .5em

src/components/general/index.ts

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -172,25 +172,43 @@ export function IDTag({ id }) {
172172
return h("div.id-tag", "ID: #" + id);
173173
}
174174

175-
export function BetaTag({ content = "This page is in beta and may be incomplete."} ) {
175+
export function BetaTag({
176+
content = "This page is in beta and may be incomplete.",
177+
}) {
178+
let _content = content;
179+
if (typeof content === "string") {
180+
_content = h("div.tag-content", content);
181+
}
182+
176183
return h(
177184
Popover,
178185
{
179-
content: h("div.tag-content", content),
180-
interactionKind: "hover"
186+
content: _content,
187+
interactionKind: "hover",
188+
inline: true,
181189
},
182-
[h(Tag, { intent: "warning" }, "Beta")]
190+
h(Tag, { intent: "warning" }, "Beta")
183191
);
184192
}
185193

186-
export function AlphaTag({ content = "This page is in alpha and highly experimental." }) {
194+
export function AlphaTag({
195+
content = "This page is in alpha and highly experimental.",
196+
}: {
197+
content?: React.ReactNode;
198+
}) {
199+
let _content = content;
200+
if (typeof content === "string") {
201+
_content = h("div.tag-content", content);
202+
}
203+
187204
return h(
188205
Popover,
189206
{
190-
content: h("div.tag-content", content),
191-
interactionKind: "hover"
207+
content: _content,
208+
interactionKind: "hover",
209+
minimal: true,
192210
},
193-
[h(Tag, { intent: "danger" }, "Alpha")]
211+
h(Tag, { intent: "danger" }, "Alpha")
194212
);
195213
}
196214

src/components/general/layout.module.sass

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ a.macrostrat-logo-link
189189
font-weight: 400
190190
font-family: "Maven Pro", sans-serif
191191
margin: 0
192+
192193
*
193194
font-family: "Publico Text", serif
194195

@@ -205,4 +206,8 @@ a.macrostrat-logo-link
205206
height: 16px
206207

207208
.tag-content
208-
padding: .5em
209+
padding: .25em
210+
font-size: 0.9em
211+
font-style: italic
212+
color: var(--secondary-color)
213+
background-color: var(--secondary-background)

0 commit comments

Comments
 (0)