@lanfermann/ui 0.0.0-stage → 0.1.0
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/LICENSE +24 -0
- package/README.md +17 -2
- package/TRADEMARK.md +10 -0
- package/brand/app-icon.svg +1 -0
- package/brand/avatar.svg +1 -0
- package/brand/favicon.svg +1 -0
- package/dist/components/accordion/accordion.d.ts +26 -0
- package/dist/components/accordion/accordion.js +78 -0
- package/dist/components/alert/alert.d.ts +19 -0
- package/dist/components/alert/alert.js +68 -0
- package/dist/components/alert-dialog/alert-dialog.d.ts +20 -0
- package/dist/components/alert-dialog/alert-dialog.js +75 -0
- package/dist/components/anchor-heading/anchor-heading.d.ts +19 -0
- package/dist/components/anchor-heading/anchor-heading.js +39 -0
- package/dist/components/avatar/avatar.d.ts +14 -0
- package/dist/components/avatar/avatar.js +42 -0
- package/dist/components/badge/badge.d.ts +12 -0
- package/dist/components/badge/badge.js +27 -0
- package/dist/components/breadcrumbs/breadcrumbs.d.ts +23 -0
- package/dist/components/breadcrumbs/breadcrumbs.js +63 -0
- package/dist/components/button/button-variants.d.ts +15 -0
- package/dist/components/button/button-variants.js +76 -0
- package/dist/components/button/button.d.ts +25 -0
- package/dist/components/button/button.js +50 -0
- package/dist/components/calendar/calendar-selection.js +216 -0
- package/dist/components/calendar/calendar.d.ts +44 -0
- package/dist/components/calendar/calendar.js +208 -0
- package/dist/components/callout/callout.d.ts +21 -0
- package/dist/components/callout/callout.js +75 -0
- package/dist/components/card/card.d.ts +16 -0
- package/dist/components/card/card.js +53 -0
- package/dist/components/checkbox/checkbox.d.ts +9 -0
- package/dist/components/checkbox/checkbox.js +33 -0
- package/dist/components/checkbox-group/checkbox-group.d.ts +18 -0
- package/dist/components/checkbox-group/checkbox-group.js +33 -0
- package/dist/components/code/code.d.ts +7 -0
- package/dist/components/code/code.js +16 -0
- package/dist/components/code-block/code-block-frame.js +146 -0
- package/dist/components/code-block/code-block-live.d.ts +45 -0
- package/dist/components/code-block/code-block-live.js +51 -0
- package/dist/components/code-block/code-block.d.ts +36 -0
- package/dist/components/code-block/code-block.js +51 -0
- package/dist/components/code-block/code-copy.d.ts +12 -0
- package/dist/components/code-block/code-copy.js +71 -0
- package/dist/components/code-block/code-lines-view.d.ts +16 -0
- package/dist/components/code-block/code-lines-view.js +48 -0
- package/dist/components/code-block/code-lines.js +17 -0
- package/dist/components/code-block/code-scroll.js +29 -0
- package/dist/components/code-block/code-surface.js +13 -0
- package/dist/components/code-block/code-tabs-frame.js +85 -0
- package/dist/components/code-block/code-tabs-store.js +25 -0
- package/dist/components/code-block/code-tabs.d.ts +28 -0
- package/dist/components/code-block/code-tabs.js +29 -0
- package/dist/components/code-block/highlight.d.ts +34 -0
- package/dist/components/code-block/highlight.js +258 -0
- package/dist/components/code-block/lines.d.ts +5 -0
- package/dist/components/code-block/lines.js +40 -0
- package/dist/components/collapsible/collapsible.d.ts +19 -0
- package/dist/components/collapsible/collapsible.js +54 -0
- package/dist/components/combobox/combobox.d.ts +84 -0
- package/dist/components/combobox/combobox.js +169 -0
- package/dist/components/container/container.d.ts +16 -0
- package/dist/components/container/container.js +30 -0
- package/dist/components/copy-pill/copy-pill.d.ts +52 -0
- package/dist/components/copy-pill/copy-pill.js +232 -0
- package/dist/components/cta/cta.d.ts +109 -0
- package/dist/components/cta/cta.js +375 -0
- package/dist/components/date-field/date-field.d.ts +40 -0
- package/dist/components/date-field/date-field.js +99 -0
- package/dist/components/date-range-field/date-range-field.d.ts +41 -0
- package/dist/components/date-range-field/date-range-field.js +155 -0
- package/dist/components/dialog/dialog.d.ts +29 -0
- package/dist/components/dialog/dialog.js +96 -0
- package/dist/components/docs-layout/docs-layout.d.ts +17 -0
- package/dist/components/docs-layout/docs-layout.js +46 -0
- package/dist/components/drawer/drawer.d.ts +39 -0
- package/dist/components/drawer/drawer.js +181 -0
- package/dist/components/field/field.d.ts +18 -0
- package/dist/components/field/field.js +77 -0
- package/dist/components/fieldset/fieldset.d.ts +8 -0
- package/dist/components/fieldset/fieldset.js +25 -0
- package/dist/components/figure/figure.d.ts +14 -0
- package/dist/components/figure/figure.js +35 -0
- package/dist/components/form/form.d.ts +31 -0
- package/dist/components/form/form.js +55 -0
- package/dist/components/ground/ground.d.ts +20 -0
- package/dist/components/ground/ground.js +31 -0
- package/dist/components/heading/heading.d.ts +16 -0
- package/dist/components/heading/heading.js +36 -0
- package/dist/components/icon/icon.d.ts +22 -0
- package/dist/components/icon/icon.js +24 -0
- package/dist/components/input/input.d.ts +19 -0
- package/dist/components/input/input.js +46 -0
- package/dist/components/input-group/input-group.d.ts +34 -0
- package/dist/components/input-group/input-group.js +61 -0
- package/dist/components/kbd/kbd.d.ts +6 -0
- package/dist/components/kbd/kbd.js +15 -0
- package/dist/components/link/link-variants.d.ts +13 -0
- package/dist/components/link/link-variants.js +27 -0
- package/dist/components/link/link.d.ts +9 -0
- package/dist/components/link/link.js +18 -0
- package/dist/components/logo/logo-paths.js +22 -0
- package/dist/components/logo/logomark.d.ts +19 -0
- package/dist/components/logo/logomark.js +49 -0
- package/dist/components/logo/wordmark.d.ts +35 -0
- package/dist/components/logo/wordmark.js +48 -0
- package/dist/components/menu/menu.d.ts +26 -0
- package/dist/components/menu/menu.js +132 -0
- package/dist/components/meter/meter.d.ts +29 -0
- package/dist/components/meter/meter.js +68 -0
- package/dist/components/navigation-menu/navigation-menu-variants.d.ts +12 -0
- package/dist/components/navigation-menu/navigation-menu-variants.js +18 -0
- package/dist/components/navigation-menu/navigation-menu.d.ts +42 -0
- package/dist/components/navigation-menu/navigation-menu.js +128 -0
- package/dist/components/number-field/number-field.d.ts +32 -0
- package/dist/components/number-field/number-field.js +85 -0
- package/dist/components/page-header/page-header.d.ts +27 -0
- package/dist/components/page-header/page-header.js +48 -0
- package/dist/components/pager/pager.d.ts +24 -0
- package/dist/components/pager/pager.js +51 -0
- package/dist/components/parameter-list/parameter-list.d.ts +34 -0
- package/dist/components/parameter-list/parameter-list.js +70 -0
- package/dist/components/popover/popover.d.ts +15 -0
- package/dist/components/popover/popover.js +64 -0
- package/dist/components/progress/progress.d.ts +19 -0
- package/dist/components/progress/progress.js +67 -0
- package/dist/components/prose/prose.d.ts +13 -0
- package/dist/components/prose/prose.js +22 -0
- package/dist/components/quote/quote.d.ts +21 -0
- package/dist/components/quote/quote.js +46 -0
- package/dist/components/radio/radio.d.ts +12 -0
- package/dist/components/radio/radio.js +37 -0
- package/dist/components/reference-entry/reference-entry.d.ts +25 -0
- package/dist/components/reference-entry/reference-entry.js +66 -0
- package/dist/components/section/section.d.ts +13 -0
- package/dist/components/section/section.js +30 -0
- package/dist/components/segmented-control/segmented-control.d.ts +42 -0
- package/dist/components/segmented-control/segmented-control.js +413 -0
- package/dist/components/select/select.d.ts +70 -0
- package/dist/components/select/select.js +189 -0
- package/dist/components/separator/separator.d.ts +12 -0
- package/dist/components/separator/separator.js +29 -0
- package/dist/components/side-nav/side-nav.d.ts +48 -0
- package/dist/components/side-nav/side-nav.js +89 -0
- package/dist/components/site-footer/site-footer-floor.js +48 -0
- package/dist/components/site-footer/site-footer.d.ts +38 -0
- package/dist/components/site-footer/site-footer.js +96 -0
- package/dist/components/site-header/site-header.d.ts +77 -0
- package/dist/components/site-header/site-header.js +214 -0
- package/dist/components/slider/slider.d.ts +42 -0
- package/dist/components/slider/slider.js +279 -0
- package/dist/components/spinner/spinner.d.ts +15 -0
- package/dist/components/spinner/spinner.js +34 -0
- package/dist/components/switch/switch.d.ts +8 -0
- package/dist/components/switch/switch.js +28 -0
- package/dist/components/table/table.d.ts +83 -0
- package/dist/components/table/table.js +123 -0
- package/dist/components/table-of-contents/table-of-contents.d.ts +32 -0
- package/dist/components/table-of-contents/table-of-contents.js +187 -0
- package/dist/components/tabs/tabs.d.ts +28 -0
- package/dist/components/tabs/tabs.js +124 -0
- package/dist/components/text/text.d.ts +16 -0
- package/dist/components/text/text.js +63 -0
- package/dist/components/textarea/textarea.d.ts +19 -0
- package/dist/components/textarea/textarea.js +30 -0
- package/dist/components/time-field/time-field.d.ts +40 -0
- package/dist/components/time-field/time-field.js +123 -0
- package/dist/components/toast/toast.d.ts +55 -0
- package/dist/components/toast/toast.js +129 -0
- package/dist/components/tooltip/tooltip.d.ts +16 -0
- package/dist/components/tooltip/tooltip.js +41 -0
- package/dist/index.d.ts +79 -0
- package/dist/index.js +77 -0
- package/dist/internal/arrow.js +41 -0
- package/dist/internal/disclosure.js +20 -0
- package/dist/internal/field-context.js +21 -0
- package/dist/internal/field.d.ts +23 -0
- package/dist/internal/field.js +49 -0
- package/dist/internal/glyphs.js +84 -0
- package/dist/internal/iso-date.d.ts +2 -0
- package/dist/internal/iso-date.js +268 -0
- package/dist/internal/overlay.js +40 -0
- package/dist/internal/picker-sheet.js +74 -0
- package/dist/internal/popup.js +37 -0
- package/dist/internal/range-shape.js +295 -0
- package/dist/internal/reduced-motion.js +19 -0
- package/dist/internal/scroll-edges.js +45 -0
- package/dist/internal/trough.js +39 -0
- package/dist/internal/typed-input.d.ts +16 -0
- package/dist/internal/typed-input.js +133 -0
- package/dist/lib/cn.d.ts +11 -0
- package/dist/lib/cn.js +98 -0
- package/dist/motion/inertia.js +111 -0
- package/dist/motion/spring-step.js +35 -0
- package/dist/motion/springs.d.ts +78 -0
- package/dist/motion/springs.js +81 -0
- package/package.json +107 -4
- package/src/styles/base.css +93 -0
- package/src/styles/calendar.css +117 -0
- package/src/styles/code.css +252 -0
- package/src/styles/density.css +53 -0
- package/src/styles/depth.css +501 -0
- package/src/styles/grounds.css +191 -0
- package/src/styles/marks.css +50 -0
- package/src/styles/motion.css +55 -0
- package/src/styles/motion.generated.css +101 -0
- package/src/styles/prose.css +252 -0
- package/src/styles/radius.css +20 -0
- package/src/styles/segmented.css +208 -0
- package/src/styles/slider.css +110 -0
- package/src/styles/status.css +108 -0
- package/src/styles/tabs.css +39 -0
- package/src/styles/toast.css +106 -0
- package/src/styles/touch.css +41 -0
- package/src/styles/type.css +54 -0
- package/src/styles.css +38 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
export type LogomarkProps = Omit<ComponentProps<"svg">, "children" | "viewBox"> & {
|
|
3
|
+
/** The height of the L in pixels. 16 is the smallest the symbol may be. */
|
|
4
|
+
size?: number;
|
|
5
|
+
/**
|
|
6
|
+
* `duo`: the stem in the text colour, the foot in the accent. `mono`: one colour, for Indigo
|
|
7
|
+
* (where text and accent are both white), a stamp or a one-colour print.
|
|
8
|
+
*/
|
|
9
|
+
tone?: "duo" | "mono";
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* The symbol: the mitre, an L in two pieces cut at 45 degrees and joined, the way a frame is
|
|
13
|
+
* built. It stands where the word does not fit: a collapsed sidebar, an avatar, a stamp. For a
|
|
14
|
+
* favicon or an app icon use the files in `@lanfermann/ui/brand`, which sit on their Ink tile.
|
|
15
|
+
*
|
|
16
|
+
* Keep one stem's width free on every side. Never beside the `Wordmark`; on Indigo use
|
|
17
|
+
* `tone="mono"`.
|
|
18
|
+
*/
|
|
19
|
+
export declare function Logomark({ size, tone, className, ...props }: LogomarkProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { cn } from "../../lib/cn.js";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
// src/components/logo/logomark.tsx
|
|
4
|
+
/** The two pieces of the mitre, `seam` units apart along the cut. The kit's measures. */
|
|
5
|
+
function logomarkPaths(seam) {
|
|
6
|
+
return {
|
|
7
|
+
stem: `M0 ${-seam}L0 -12L3 -12L3 ${-3 - seam}Z`,
|
|
8
|
+
foot: `M${seam} 0L10 0L10 -3L${3 + seam} -3Z`
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* How far the two pieces stand apart. In two tones the colours already tell them apart: the seam
|
|
13
|
+
* is a tenth of the stem from 48px up and closed below, where it would only blur. In one colour
|
|
14
|
+
* the seam is all that separates them, so it is wider, a sixth of the stem, at every size.
|
|
15
|
+
*/
|
|
16
|
+
function logomarkSeam(size, tone) {
|
|
17
|
+
if (tone === "mono") return .35;
|
|
18
|
+
return size >= 48 ? .21 : 0;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* The symbol: the mitre, an L in two pieces cut at 45 degrees and joined, the way a frame is
|
|
22
|
+
* built. It stands where the word does not fit: a collapsed sidebar, an avatar, a stamp. For a
|
|
23
|
+
* favicon or an app icon use the files in `@lanfermann/ui/brand`, which sit on their Ink tile.
|
|
24
|
+
*
|
|
25
|
+
* Keep one stem's width free on every side. Never beside the `Wordmark`; on Indigo use
|
|
26
|
+
* `tone="mono"`.
|
|
27
|
+
*/
|
|
28
|
+
function Logomark({ size = 24, tone = "duo", className, ...props }) {
|
|
29
|
+
const { stem, foot } = logomarkPaths(logomarkSeam(size, tone));
|
|
30
|
+
return /* @__PURE__ */ jsxs("svg", {
|
|
31
|
+
"data-slot": "logomark",
|
|
32
|
+
role: "img",
|
|
33
|
+
"aria-label": "Lanfermann",
|
|
34
|
+
viewBox: "0 -12 10 12",
|
|
35
|
+
width: size * 10 / 12,
|
|
36
|
+
height: size,
|
|
37
|
+
className: cn("shrink-0 text-fg", className),
|
|
38
|
+
...props,
|
|
39
|
+
children: [/* @__PURE__ */ jsx("path", {
|
|
40
|
+
d: stem,
|
|
41
|
+
fill: "currentColor"
|
|
42
|
+
}), /* @__PURE__ */ jsx("path", {
|
|
43
|
+
d: foot,
|
|
44
|
+
fill: tone === "mono" ? "currentColor" : void 0,
|
|
45
|
+
className: tone === "mono" ? void 0 : "fill-accent"
|
|
46
|
+
})]
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
export { Logomark, logomarkPaths, logomarkSeam };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
declare const forms: {
|
|
3
|
+
readonly full: {
|
|
4
|
+
readonly letters: "M0,-10v-650h118v548zM129.57,-102h224.43v102h-342.43zM718,0v-90.01c-24.76,60.49 -83.64,100.01 -149,100.01c-88.92,0 -161,-72.08 -161,-161c0,-75.49 61.19,-136.68 136.68,-136.68l173.32,0v-34.32c0,-46.39 -37.61,-84 -84,-84c-34.76,0 -65.92,21.4 -78.4,53.84h-117.77c22.17,-90.33 103.16,-153.84 196.17,-153.84c111.56,0 202,90.44 202,202v304zM577.69,-211.68c-29.85,0 -54.05,24.2 -54.05,54.05c0,41.22 36.76,74.63 82.1,74.63c54.55,0 101.53,-38.49 112.26,-91.97v-36.71zM952,0v-496h118v13.51c29.97,-15.26 63.48,-23.51 98,-23.51c119.29,0 216,96.71 216,216v290h-118v-308c0,-54.12 -43.88,-98 -98,-98c-36.12,0 -70.99,13.25 -98,37.24v368.76zM1523.16,0v-396.88h-73.16v-99.12l77.54,0c19.59,-93.66 102.64,-164 202.12,-164c18.75,0 37.4,2.55 55.46,7.59v97.94c-15.72,-12.64 -35.29,-19.53 -55.46,-19.53c-45.32,0 -82.69,34.07 -87.88,78h117.38v99.12h-118l0,396.88zM2257.61,-124c-34.5,81.24 -114.22,134 -202.49,134c-121.5,0 -220,-98.5 -220,-220v-76c0,-121.5 98.5,-220 220,-220c121.5,0 220,98.5 220,220v67.76h-322v26.24c0,56.33 45.67,102 102,102c29.03,0 56.68,-12.36 76.03,-34zM2157.12,-298.24v-5.76c0,-56.33 -45.67,-102 -102,-102c-56.33,0 -102,45.67 -102,102v5.76zM2377.12,0v-496h118v13.51c29.97,-15.26 63.48,-23.51 98,-23.51c16.84,0 33.62,1.97 50,5.87v107.84c-15.13,-8.98 -32.4,-13.71 -50,-13.71c-36.12,0 -70.99,13.25 -98,37.24v368.76zM2687.12,0v-496h118v10.85c28.02,-13.55 59.07,-20.85 91,-20.85c58.85,0 112.02,24.32 150,63.46c39.14,-40.35 93.18,-63.46 150,-63.46c115.43,0 209,93.57 209,209v297h-118v-315c0,-50.26 -40.74,-91 -91,-91c-33.54,0 -65.92,12.3 -91,34.58v371.42h-118v-315c0,-50.26 -40.74,-91 -91,-91c-33.54,0 -65.92,12.3 -91,34.58v371.42zM3817.12,0v-90.01c-24.76,60.49 -83.64,100.01 -149,100.01c-88.92,0 -161,-72.08 -161,-161c0,-75.49 61.19,-136.68 136.68,-136.68l173.32,0v-34.32c0,-46.39 -37.61,-84 -84,-84c-34.76,0 -65.92,21.4 -78.4,53.84h-117.77c22.17,-90.33 103.16,-153.84 196.17,-153.84c111.56,0 202,90.44 202,202v304zM3676.81,-211.68c-29.85,0 -54.05,24.2 -54.05,54.05c0,41.22 36.76,74.63 82.1,74.63c54.55,0 101.53,-38.49 112.26,-91.97v-36.71zM4051.12,0v-496h118l0,13.51c29.97,-15.26 63.48,-23.51 98,-23.51c119.29,0 216,96.71 216,216v290h-118v-308c0,-54.12 -43.88,-98 -98,-98c-36.12,0 -70.99,13.25 -98,37.24v368.76zM4599.12,0v-496h118l0,13.51c29.97,-15.26 63.48,-23.51 98,-23.51c119.29,0 216,96.71 216,216v290h-118v-308c0,-54.12 -43.88,-98 -98,-98c-36.12,0 -70.99,13.25 -98,37.24v368.76zM5704.12,0l0,-14.29c-30.52,15.76 -64.74,24.29 -100,24.29c-120.4,0 -218,-97.6 -218,-218v-80c0,-120.4 97.6,-218 218,-218c35.26,0 69.48,8.53 100,24.29v-178.29h118v660zM5604.12,-406c-55.23,0 -100,44.77 -100,100v116c0,55.23 44.77,100 100,100c36.86,0 72.44,-13.52 100,-38l0,-240c-27.56,-24.48 -63.14,-38 -100,-38zM6346.61,-124c-34.5,81.24 -114.22,134 -202.49,134c-121.5,0 -220,-98.5 -220,-220v-76c0,-121.5 98.5,-220 220,-220c121.5,0 220,98.5 220,220v67.76h-322v26.24c0,56.33 45.67,102 102,102c29.03,0 56.68,-12.36 76.03,-34zM6246.12,-298.24v-5.76c0,-56.33 -45.67,-102 -102,-102c-56.33,0 -102,45.67 -102,102v5.76zM6416.12,-496h129.8l99,288.19l99,-288.19h129.8l-170.39,496h-116.82z";
|
|
5
|
+
readonly dot: "M5125.12,-78.5c0,-48.88 39.62,-88.5 88.5,-88.5c48.88,0 88.5,39.62 88.5,88.5c0,48.88 -39.62,88.5 -88.5,88.5c-48.88,0 -88.5,-39.62 -88.5,-88.5z";
|
|
6
|
+
readonly width: 6873.72;
|
|
7
|
+
readonly name: "Lanfermann.dev";
|
|
8
|
+
};
|
|
9
|
+
readonly short: {
|
|
10
|
+
readonly letters: "M0,-10v-650h118v548zM129.57,-102h224.43v102h-342.43zM718,0v-90.01c-24.76,60.49 -83.64,100.01 -149,100.01c-88.92,0 -161,-72.08 -161,-161c0,-75.49 61.19,-136.68 136.68,-136.68l173.32,0v-34.32c0,-46.39 -37.61,-84 -84,-84c-34.76,0 -65.92,21.4 -78.4,53.84h-117.77c22.17,-90.33 103.16,-153.84 196.17,-153.84c111.56,0 202,90.44 202,202v304zM577.69,-211.68c-29.85,0 -54.05,24.2 -54.05,54.05c0,41.22 36.76,74.63 82.1,74.63c54.55,0 101.53,-38.49 112.26,-91.97v-36.71zM952,0v-496h118v13.51c29.97,-15.26 63.48,-23.51 98,-23.51c119.29,0 216,96.71 216,216v290h-118v-308c0,-54.12 -43.88,-98 -98,-98c-36.12,0 -70.99,13.25 -98,37.24v368.76zM1523.16,0v-396.88h-73.16v-99.12l77.54,0c19.59,-93.66 102.64,-164 202.12,-164c18.75,0 37.4,2.55 55.46,7.59v97.94c-15.72,-12.64 -35.29,-19.53 -55.46,-19.53c-45.32,0 -82.69,34.07 -87.88,78h117.38v99.12h-118l0,396.88zM2257.61,-124c-34.5,81.24 -114.22,134 -202.49,134c-121.5,0 -220,-98.5 -220,-220v-76c0,-121.5 98.5,-220 220,-220c121.5,0 220,98.5 220,220v67.76h-322v26.24c0,56.33 45.67,102 102,102c29.03,0 56.68,-12.36 76.03,-34zM2157.12,-298.24v-5.76c0,-56.33 -45.67,-102 -102,-102c-56.33,0 -102,45.67 -102,102v5.76zM2377.12,0v-496h118v13.51c29.97,-15.26 63.48,-23.51 98,-23.51c16.84,0 33.62,1.97 50,5.87v107.84c-15.13,-8.98 -32.4,-13.71 -50,-13.71c-36.12,0 -70.99,13.25 -98,37.24v368.76zM2687.12,0v-496h118v10.85c28.02,-13.55 59.07,-20.85 91,-20.85c58.85,0 112.02,24.32 150,63.46c39.14,-40.35 93.18,-63.46 150,-63.46c115.43,0 209,93.57 209,209v297h-118v-315c0,-50.26 -40.74,-91 -91,-91c-33.54,0 -65.92,12.3 -91,34.58v371.42h-118v-315c0,-50.26 -40.74,-91 -91,-91c-33.54,0 -65.92,12.3 -91,34.58v371.42zM3817.12,0v-90.01c-24.76,60.49 -83.64,100.01 -149,100.01c-88.92,0 -161,-72.08 -161,-161c0,-75.49 61.19,-136.68 136.68,-136.68l173.32,0v-34.32c0,-46.39 -37.61,-84 -84,-84c-34.76,0 -65.92,21.4 -78.4,53.84h-117.77c22.17,-90.33 103.16,-153.84 196.17,-153.84c111.56,0 202,90.44 202,202v304zM3676.81,-211.68c-29.85,0 -54.05,24.2 -54.05,54.05c0,41.22 36.76,74.63 82.1,74.63c54.55,0 101.53,-38.49 112.26,-91.97v-36.71zM4051.12,0v-496h118l0,13.51c29.97,-15.26 63.48,-23.51 98,-23.51c119.29,0 216,96.71 216,216v290h-118v-308c0,-54.12 -43.88,-98 -98,-98c-36.12,0 -70.99,13.25 -98,37.24v368.76zM4599.12,0v-496h118l0,13.51c29.97,-15.26 63.48,-23.51 98,-23.51c119.29,0 216,96.71 216,216v290h-118v-308c0,-54.12 -43.88,-98 -98,-98c-36.12,0 -70.99,13.25 -98,37.24v368.76z";
|
|
11
|
+
readonly dot: "M5125.12,-78.5c0,-48.88 39.62,-88.5 88.5,-88.5c48.88,0 88.5,39.62 88.5,88.5c0,48.88 -39.62,88.5 -88.5,88.5c-48.88,0 -88.5,-39.62 -88.5,-88.5z";
|
|
12
|
+
readonly width: 5302.12;
|
|
13
|
+
readonly name: "Lanfermann";
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export type WordmarkProps = Omit<ComponentProps<"svg">, "children" | "viewBox"> & {
|
|
17
|
+
/** `full` is "Lanfermann.dev"; `short` is "Lanfermann." for where the address does not fit. */
|
|
18
|
+
variant?: keyof typeof forms;
|
|
19
|
+
/**
|
|
20
|
+
* The text height in pixels, as if the word were set in type at that size: the capital L is
|
|
21
|
+
* two thirds of it. The kit's sizes; 16 is the smallest the logo may be.
|
|
22
|
+
*/
|
|
23
|
+
size?: 16 | 20 | 24 | 32;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* The wordmark: the drawn word "Lanfermann.dev", its dot in the accent. It takes its colours
|
|
27
|
+
* from the ground it stands on (letters in the text colour, the dot in the accent), which gives
|
|
28
|
+
* the kit's three versions without choosing one: dark with an Indigo dot on Paper and Tint, light
|
|
29
|
+
* with a lavender dot on Ink, all white on Indigo.
|
|
30
|
+
*
|
|
31
|
+
* Keep the height of its capital L free on every side. Never beside the `Logomark` (it would
|
|
32
|
+
* read "L Lanfermann"), never recoloured, outlined, rotated, boxed or set in a font instead.
|
|
33
|
+
*/
|
|
34
|
+
export declare function Wordmark({ variant, size, className, ...props }: WordmarkProps): import("react").JSX.Element;
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { cn } from "../../lib/cn.js";
|
|
2
|
+
import { WORDMARK_DOT, WORDMARK_LETTERS, WORDMARK_SHORT_DOT, WORDMARK_SHORT_LETTERS, WORDMARK_SHORT_WIDTH, WORDMARK_WIDTH } from "./logo-paths.js";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
// src/components/logo/wordmark.tsx
|
|
5
|
+
const forms = {
|
|
6
|
+
full: {
|
|
7
|
+
letters: WORDMARK_LETTERS,
|
|
8
|
+
dot: WORDMARK_DOT,
|
|
9
|
+
width: WORDMARK_WIDTH,
|
|
10
|
+
name: "Lanfermann.dev"
|
|
11
|
+
},
|
|
12
|
+
short: {
|
|
13
|
+
letters: WORDMARK_SHORT_LETTERS,
|
|
14
|
+
dot: WORDMARK_SHORT_DOT,
|
|
15
|
+
width: WORDMARK_SHORT_WIDTH,
|
|
16
|
+
name: "Lanfermann"
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* The wordmark: the drawn word "Lanfermann.dev", its dot in the accent. It takes its colours
|
|
21
|
+
* from the ground it stands on (letters in the text colour, the dot in the accent), which gives
|
|
22
|
+
* the kit's three versions without choosing one: dark with an Indigo dot on Paper and Tint, light
|
|
23
|
+
* with a lavender dot on Ink, all white on Indigo.
|
|
24
|
+
*
|
|
25
|
+
* Keep the height of its capital L free on every side. Never beside the `Logomark` (it would
|
|
26
|
+
* read "L Lanfermann"), never recoloured, outlined, rotated, boxed or set in a font instead.
|
|
27
|
+
*/
|
|
28
|
+
function Wordmark({ variant = "full", size = 24, className, ...props }) {
|
|
29
|
+
const form = forms[variant];
|
|
30
|
+
return /* @__PURE__ */ jsxs("svg", {
|
|
31
|
+
"data-slot": "wordmark",
|
|
32
|
+
role: "img",
|
|
33
|
+
"aria-label": form.name,
|
|
34
|
+
viewBox: `0 -800 ${form.width} 1000`,
|
|
35
|
+
width: size * form.width / 1e3,
|
|
36
|
+
height: size,
|
|
37
|
+
className: cn("shrink-0 text-fg", className),
|
|
38
|
+
...props,
|
|
39
|
+
children: [/* @__PURE__ */ jsx("path", {
|
|
40
|
+
d: form.letters,
|
|
41
|
+
fill: "currentColor"
|
|
42
|
+
}), /* @__PURE__ */ jsx("path", {
|
|
43
|
+
d: form.dot,
|
|
44
|
+
className: "fill-accent"
|
|
45
|
+
})]
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
export { Wordmark };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Menu as Menu$1 } from "@base-ui/react/menu";
|
|
2
|
+
/** A list of actions or places behind one trigger. */
|
|
3
|
+
export declare const Menu: typeof Menu$1.Root;
|
|
4
|
+
export declare function MenuTrigger(props: Menu$1.Trigger.Props): import("react").JSX.Element;
|
|
5
|
+
export type MenuContentProps = Menu$1.Popup.Props & Pick<Menu$1.Positioner.Props, "side" | "align" | "sideOffset" | "alignOffset">;
|
|
6
|
+
/**
|
|
7
|
+
* The sheet. It floats on the long shadow and grows out of its trigger; inside, panel rules apply
|
|
8
|
+
* (lines between groups, no boxes). Items take the concentric radius of the sheet.
|
|
9
|
+
*/
|
|
10
|
+
export declare function MenuContent({ className, side, align, sideOffset, alignOffset, ...props }: MenuContentProps): import("react").JSX.Element;
|
|
11
|
+
export declare function MenuItem({ className, ...props }: Menu$1.Item.Props): import("react").JSX.Element;
|
|
12
|
+
/** A place rather than an action: a real link, so it can be opened in a new tab. */
|
|
13
|
+
export declare function MenuLinkItem({ className, ...props }: Menu$1.LinkItem.Props): import("react").JSX.Element;
|
|
14
|
+
/** An option that is on or off. The menu stays open, so several can be set in one go. */
|
|
15
|
+
export declare function MenuCheckboxItem({ className, children, ...props }: Menu$1.CheckboxItem.Props): import("react").JSX.Element;
|
|
16
|
+
export declare const MenuRadioGroup: import("react").NamedExoticComponent<Omit<import("@base-ui/react").ContextMenuRadioGroupProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
17
|
+
/** One of several: the chosen one carries the disc. */
|
|
18
|
+
export declare function MenuRadioItem({ className, children, ...props }: Menu$1.RadioItem.Props): import("react").JSX.Element;
|
|
19
|
+
export declare function MenuSeparator({ className, ...props }: Menu$1.Separator.Props): import("react").JSX.Element;
|
|
20
|
+
export declare const MenuGroup: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").ContextMenuGroupProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
21
|
+
export declare function MenuGroupLabel({ className, ...props }: Menu$1.GroupLabel.Props): import("react").JSX.Element;
|
|
22
|
+
/** A menu inside a menu. One level is the limit: deeper and people lose their way. */
|
|
23
|
+
export declare const MenuSub: typeof Menu$1.SubmenuRoot;
|
|
24
|
+
export declare function MenuSubTrigger({ className, children, ...props }: Menu$1.SubmenuTrigger.Props): import("react").JSX.Element;
|
|
25
|
+
/** The submenu's sheet. It overlaps its parent by the sheet's padding, so the rows line up. */
|
|
26
|
+
export declare function MenuSubContent({ className, sideOffset, alignOffset, ...props }: MenuContentProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useGround } from "../ground/ground.js";
|
|
3
|
+
import { ChevronRightGlyph, TickGlyph } from "../../internal/glyphs.js";
|
|
4
|
+
import { listGroupLabel, listItem, listSeparator, listSheet, popupMotion } from "../../internal/popup.js";
|
|
5
|
+
import { mergeClassName } from "../../lib/cn.js";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { Menu as Menu$1 } from "@base-ui/react/menu";
|
|
8
|
+
// src/components/menu/menu.tsx
|
|
9
|
+
/** A list of actions or places behind one trigger. */
|
|
10
|
+
const Menu = Menu$1.Root;
|
|
11
|
+
function MenuTrigger(props) {
|
|
12
|
+
return /* @__PURE__ */ jsx(Menu$1.Trigger, {
|
|
13
|
+
"data-slot": "menu-trigger",
|
|
14
|
+
...props
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* The sheet. It floats on the long shadow and grows out of its trigger; inside, panel rules apply
|
|
19
|
+
* (lines between groups, no boxes). Items take the concentric radius of the sheet.
|
|
20
|
+
*/
|
|
21
|
+
function MenuContent({ className, side = "bottom", align = "start", sideOffset = 6, alignOffset, ...props }) {
|
|
22
|
+
const ground = useGround();
|
|
23
|
+
return /* @__PURE__ */ jsx(Menu$1.Portal, { children: /* @__PURE__ */ jsx(Menu$1.Positioner, {
|
|
24
|
+
"data-slot": "menu-positioner",
|
|
25
|
+
side,
|
|
26
|
+
align,
|
|
27
|
+
sideOffset,
|
|
28
|
+
alignOffset,
|
|
29
|
+
className: "z-50 outline-none",
|
|
30
|
+
children: /* @__PURE__ */ jsx(Menu$1.Popup, {
|
|
31
|
+
"data-slot": "menu-content",
|
|
32
|
+
"data-theme": ground,
|
|
33
|
+
className: mergeClassName([
|
|
34
|
+
listSheet,
|
|
35
|
+
popupMotion,
|
|
36
|
+
"min-w-48"
|
|
37
|
+
], className),
|
|
38
|
+
...props
|
|
39
|
+
})
|
|
40
|
+
}) });
|
|
41
|
+
}
|
|
42
|
+
function MenuItem({ className, ...props }) {
|
|
43
|
+
return /* @__PURE__ */ jsx(Menu$1.Item, {
|
|
44
|
+
"data-slot": "menu-item",
|
|
45
|
+
className: mergeClassName(listItem, className),
|
|
46
|
+
...props
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
/** A place rather than an action: a real link, so it can be opened in a new tab. */
|
|
50
|
+
function MenuLinkItem({ className, ...props }) {
|
|
51
|
+
return /* @__PURE__ */ jsx(Menu$1.LinkItem, {
|
|
52
|
+
"data-slot": "menu-item",
|
|
53
|
+
className: mergeClassName(listItem, className),
|
|
54
|
+
...props
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
/** An option that is on or off. The menu stays open, so several can be set in one go. */
|
|
58
|
+
function MenuCheckboxItem({ className, children, ...props }) {
|
|
59
|
+
return /* @__PURE__ */ jsxs(Menu$1.CheckboxItem, {
|
|
60
|
+
"data-slot": "menu-checkbox-item",
|
|
61
|
+
className: mergeClassName(listItem, className),
|
|
62
|
+
...props,
|
|
63
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
64
|
+
"aria-hidden": true,
|
|
65
|
+
className: "flex size-3 shrink-0 items-center justify-center text-accent",
|
|
66
|
+
children: /* @__PURE__ */ jsx(Menu$1.CheckboxItemIndicator, {
|
|
67
|
+
"data-slot": "menu-item-indicator",
|
|
68
|
+
children: /* @__PURE__ */ jsx(TickGlyph, {})
|
|
69
|
+
})
|
|
70
|
+
}), children]
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
const MenuRadioGroup = Menu$1.RadioGroup;
|
|
74
|
+
/** One of several: the chosen one carries the disc. */
|
|
75
|
+
function MenuRadioItem({ className, children, ...props }) {
|
|
76
|
+
return /* @__PURE__ */ jsxs(Menu$1.RadioItem, {
|
|
77
|
+
"data-slot": "menu-radio-item",
|
|
78
|
+
className: mergeClassName(["group", listItem], className),
|
|
79
|
+
...props,
|
|
80
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
81
|
+
"aria-hidden": true,
|
|
82
|
+
className: "flex size-3 shrink-0 items-center justify-center",
|
|
83
|
+
children: /* @__PURE__ */ jsx("span", { className: "mark mark-quiet group-data-checked:mark-on" })
|
|
84
|
+
}), children]
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
function MenuSeparator({ className, ...props }) {
|
|
88
|
+
return /* @__PURE__ */ jsx(Menu$1.Separator, {
|
|
89
|
+
"data-slot": "menu-separator",
|
|
90
|
+
className: mergeClassName(listSeparator, className),
|
|
91
|
+
...props
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
const MenuGroup = Menu$1.Group;
|
|
95
|
+
function MenuGroupLabel({ className, ...props }) {
|
|
96
|
+
return /* @__PURE__ */ jsx(Menu$1.GroupLabel, {
|
|
97
|
+
"data-slot": "menu-group-label",
|
|
98
|
+
className: mergeClassName(listGroupLabel, className),
|
|
99
|
+
...props
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
/** A menu inside a menu. One level is the limit: deeper and people lose their way. */
|
|
103
|
+
const MenuSub = Menu$1.SubmenuRoot;
|
|
104
|
+
function MenuSubTrigger({ className, children, ...props }) {
|
|
105
|
+
return /* @__PURE__ */ jsxs(Menu$1.SubmenuTrigger, {
|
|
106
|
+
"data-slot": "menu-sub-trigger",
|
|
107
|
+
className: mergeClassName([listItem, "data-popup-open:bg-hover"], className),
|
|
108
|
+
...props,
|
|
109
|
+
children: [children, /* @__PURE__ */ jsx(ChevronRightGlyph, { className: "ml-auto text-fg-muted" })]
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
/** The submenu's sheet. It overlaps its parent by the sheet's padding, so the rows line up. */
|
|
113
|
+
function MenuSubContent({ className, sideOffset = -4, alignOffset = -4, ...props }) {
|
|
114
|
+
const ground = useGround();
|
|
115
|
+
return /* @__PURE__ */ jsx(Menu$1.Portal, { children: /* @__PURE__ */ jsx(Menu$1.Positioner, {
|
|
116
|
+
"data-slot": "menu-positioner",
|
|
117
|
+
sideOffset,
|
|
118
|
+
alignOffset,
|
|
119
|
+
className: "z-50 outline-none",
|
|
120
|
+
children: /* @__PURE__ */ jsx(Menu$1.Popup, {
|
|
121
|
+
"data-slot": "menu-content",
|
|
122
|
+
"data-theme": ground,
|
|
123
|
+
className: mergeClassName([
|
|
124
|
+
listSheet,
|
|
125
|
+
popupMotion,
|
|
126
|
+
"min-w-40"
|
|
127
|
+
], className),
|
|
128
|
+
...props
|
|
129
|
+
})
|
|
130
|
+
}) });
|
|
131
|
+
}
|
|
132
|
+
export { Menu, MenuCheckboxItem, MenuContent, MenuGroup, MenuGroupLabel, MenuItem, MenuLinkItem, MenuRadioGroup, MenuRadioItem, MenuSeparator, MenuSub, MenuSubContent, MenuSubTrigger, MenuTrigger };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Meter as Meter$1 } from "@base-ui/react/meter";
|
|
2
|
+
export type MeterProps = Meter$1.Root.Props & {
|
|
3
|
+
/**
|
|
4
|
+
* The colour of the fill. `neutral` (the text colour) only measures. `accent` is Indigo, for
|
|
5
|
+
* the one meter a view is about. `success`, `warning` and `danger` say what the amount means;
|
|
6
|
+
* a colour is never the whole message, so say it in the label or the value as well ("fast
|
|
7
|
+
* voll").
|
|
8
|
+
*/
|
|
9
|
+
tone?: "neutral" | "accent" | "success" | "warning" | "danger";
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* An amount within a known range: storage used, three of five quotes this month. It measures; it
|
|
13
|
+
* does not advance. For a task that is being worked through, use a `Progress`.
|
|
14
|
+
*
|
|
15
|
+
* Name it with a `MeterLabel` or an `aria-label`. `MeterValue` shows a percentage; give it a
|
|
16
|
+
* function to say it in the unit people think in ("3 von 5"). Without children it is the bare
|
|
17
|
+
* track.
|
|
18
|
+
*/
|
|
19
|
+
export declare function Meter({ className, children, tone, ...props }: MeterProps): import("react").JSX.Element;
|
|
20
|
+
/** Says what is measured. */
|
|
21
|
+
export declare function MeterLabel({ className, ...props }: Meter$1.Label.Props): import("react").JSX.Element;
|
|
22
|
+
/** The amount as text: a percentage, or what the function you pass makes of it. */
|
|
23
|
+
export declare function MeterValue({ className, ...props }: Meter$1.Value.Props): import("react").JSX.Element;
|
|
24
|
+
/**
|
|
25
|
+
* The trough and its fill. By default the fill is the text colour, not Indigo: Indigo marks what
|
|
26
|
+
* was chosen or is being done, and a measurement is neither. `tone="accent"` on the `Meter`
|
|
27
|
+
* makes it Indigo where a view wants that one meter to stand out.
|
|
28
|
+
*/
|
|
29
|
+
export declare function MeterTrack({ className, ...props }: Meter$1.Track.Props): import("react").JSX.Element;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { fillFraction, fillStyle, gaugeLabel, gaugeRoot, gaugeValue, troughFill, troughTrack } from "../../internal/trough.js";
|
|
3
|
+
import { mergeClassName } from "../../lib/cn.js";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { createContext, useContext } from "react";
|
|
6
|
+
import { Meter as Meter$1 } from "@base-ui/react/meter";
|
|
7
|
+
// src/components/meter/meter.tsx
|
|
8
|
+
/** How far the fill stands, from 0 to 1. */
|
|
9
|
+
const MeterFill = createContext(0);
|
|
10
|
+
/**
|
|
11
|
+
* An amount within a known range: storage used, three of five quotes this month. It measures; it
|
|
12
|
+
* does not advance. For a task that is being worked through, use a `Progress`.
|
|
13
|
+
*
|
|
14
|
+
* Name it with a `MeterLabel` or an `aria-label`. `MeterValue` shows a percentage; give it a
|
|
15
|
+
* function to say it in the unit people think in ("3 von 5"). Without children it is the bare
|
|
16
|
+
* track.
|
|
17
|
+
*/
|
|
18
|
+
function Meter({ className, children, tone = "neutral", ...props }) {
|
|
19
|
+
return /* @__PURE__ */ jsx(Meter$1.Root, {
|
|
20
|
+
"data-slot": "meter",
|
|
21
|
+
"data-tone": tone,
|
|
22
|
+
className: mergeClassName(["group/meter", gaugeRoot], className),
|
|
23
|
+
...props,
|
|
24
|
+
children: /* @__PURE__ */ jsx(MeterFill, {
|
|
25
|
+
value: fillFraction(props.value, props.min, props.max),
|
|
26
|
+
children: children ?? /* @__PURE__ */ jsx(MeterTrack, {})
|
|
27
|
+
})
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
/** Says what is measured. */
|
|
31
|
+
function MeterLabel({ className, ...props }) {
|
|
32
|
+
return /* @__PURE__ */ jsx(Meter$1.Label, {
|
|
33
|
+
"data-slot": "meter-label",
|
|
34
|
+
className: mergeClassName(gaugeLabel, className),
|
|
35
|
+
...props
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
/** The amount as text: a percentage, or what the function you pass makes of it. */
|
|
39
|
+
function MeterValue({ className, ...props }) {
|
|
40
|
+
return /* @__PURE__ */ jsx(Meter$1.Value, {
|
|
41
|
+
"data-slot": "meter-value",
|
|
42
|
+
className: mergeClassName(gaugeValue, className),
|
|
43
|
+
...props
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* The trough and its fill. By default the fill is the text colour, not Indigo: Indigo marks what
|
|
48
|
+
* was chosen or is being done, and a measurement is neither. `tone="accent"` on the `Meter`
|
|
49
|
+
* makes it Indigo where a view wants that one meter to stand out.
|
|
50
|
+
*/
|
|
51
|
+
function MeterTrack({ className, ...props }) {
|
|
52
|
+
const fill = useContext(MeterFill);
|
|
53
|
+
return /* @__PURE__ */ jsx(Meter$1.Track, {
|
|
54
|
+
"data-slot": "meter-track",
|
|
55
|
+
className: mergeClassName(["relative col-span-2 h-2 not-first:mt-1.5", troughTrack], className),
|
|
56
|
+
...props,
|
|
57
|
+
children: /* @__PURE__ */ jsx(Meter$1.Indicator, {
|
|
58
|
+
"data-slot": "meter-indicator",
|
|
59
|
+
style: fillStyle(fill),
|
|
60
|
+
className: [
|
|
61
|
+
troughFill,
|
|
62
|
+
"bg-fg transition-[translate,background-color] spring-glide",
|
|
63
|
+
"group-data-[tone=accent]/meter:bg-accent group-data-[tone=danger]/meter:bg-danger-solid group-data-[tone=success]/meter:bg-success-solid group-data-[tone=warning]/meter:bg-warning-solid"
|
|
64
|
+
].join(" ")
|
|
65
|
+
})
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
export { Meter, MeterLabel, MeterTrack, MeterValue };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { VariantProps } from "class-variance-authority";
|
|
2
|
+
/**
|
|
3
|
+
* The look of an entry in the row of a navigation menu, as class names. It lives outside the
|
|
4
|
+
* client component so a plain link in the row can wear the look of a trigger:
|
|
5
|
+
*
|
|
6
|
+
* <NavigationMenuLink kind="entry" href="/preise">Preise</NavigationMenuLink>
|
|
7
|
+
*
|
|
8
|
+
* An entry is quiet: no face, no shadow. It takes the hover wash, and keeps it while its panel is
|
|
9
|
+
* open.
|
|
10
|
+
*/
|
|
11
|
+
export declare const navigationMenuEntryVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
12
|
+
export type NavigationMenuEntryVariants = VariantProps<typeof navigationMenuEntryVariants>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { cva } from "class-variance-authority";
|
|
2
|
+
// src/components/navigation-menu/navigation-menu-variants.ts
|
|
3
|
+
/**
|
|
4
|
+
* The look of an entry in the row of a navigation menu, as class names. It lives outside the
|
|
5
|
+
* client component so a plain link in the row can wear the look of a trigger:
|
|
6
|
+
*
|
|
7
|
+
* <NavigationMenuLink kind="entry" href="/preise">Preise</NavigationMenuLink>
|
|
8
|
+
*
|
|
9
|
+
* An entry is quiet: no face, no shadow. It takes the hover wash, and keeps it while its panel is
|
|
10
|
+
* open.
|
|
11
|
+
*/
|
|
12
|
+
const navigationMenuEntryVariants = cva([
|
|
13
|
+
"group/entry inline-flex h-(--control-md) items-center gap-1.5 rounded-md px-3 text-control font-medium whitespace-nowrap text-fg-body select-none",
|
|
14
|
+
"transition-colors duration-150 ease-out hover:bg-hover hover:text-fg data-popup-open:bg-hover data-popup-open:text-fg",
|
|
15
|
+
"focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent",
|
|
16
|
+
"data-active:text-fg data-disabled:pointer-events-none data-disabled:text-on-disabled"
|
|
17
|
+
]);
|
|
18
|
+
export { navigationMenuEntryVariants };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
import { NavigationMenu as NavigationMenu$1 } from "@base-ui/react/navigation-menu";
|
|
3
|
+
export type NavigationMenuProps = NavigationMenu$1.Root.Props & Pick<NavigationMenu$1.Positioner.Props, "align" | "sideOffset">;
|
|
4
|
+
/**
|
|
5
|
+
* The places of a website as one row: plain links, and entries that open a panel with the pages
|
|
6
|
+
* behind them. A panel opens when its entry is pointed at or pressed, and one sheet serves them
|
|
7
|
+
* all: moving along the row, it glides to the next entry and takes its size, and the content
|
|
8
|
+
* changes inside it.
|
|
9
|
+
*
|
|
10
|
+
* It is a `<nav>`: name it with `aria-label`. Put a `NavigationMenuList` inside, with one
|
|
11
|
+
* `NavigationMenuItem` per entry.
|
|
12
|
+
*/
|
|
13
|
+
export declare function NavigationMenu({ align, sideOffset, className, children, ...props }: NavigationMenuProps): import("react").JSX.Element;
|
|
14
|
+
export declare function NavigationMenuList({ className, ...props }: NavigationMenu$1.List.Props): import("react").JSX.Element;
|
|
15
|
+
export declare function NavigationMenuItem({ className, ...props }: NavigationMenu$1.Item.Props): import("react").JSX.Element;
|
|
16
|
+
/**
|
|
17
|
+
* An entry that opens a panel: a noun of one or two words ("Produkt", "Dokumentation"). The
|
|
18
|
+
* chevron says that more is behind it and turns while the panel is open.
|
|
19
|
+
*/
|
|
20
|
+
export declare function NavigationMenuTrigger({ className, children, ...props }: NavigationMenu$1.Trigger.Props): import("react").JSX.Element;
|
|
21
|
+
/**
|
|
22
|
+
* The panel of an entry. Lay its links out as a list, one column or two, and give the list a
|
|
23
|
+
* width: the sheet takes it. Coming from a neighbouring entry, the content arrives from that
|
|
24
|
+
* side; it leaves by fading.
|
|
25
|
+
*/
|
|
26
|
+
export declare function NavigationMenuContent({ className, ...props }: NavigationMenu$1.Content.Props): import("react").JSX.Element;
|
|
27
|
+
export type NavigationMenuLinkProps = NavigationMenu$1.Link.Props & {
|
|
28
|
+
/**
|
|
29
|
+
* `page` is a row in a panel: a title, and a line that says what is there. `entry` is a plain
|
|
30
|
+
* link in the row itself, which looks like the entries beside it and opens nothing.
|
|
31
|
+
*/
|
|
32
|
+
kind?: "page" | "entry";
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* A link in the navigation menu. Mark the page the reader is on with `active`. For a router's
|
|
36
|
+
* link, pass it as `render`: `<NavigationMenuLink render={<NextLink href="/preise" />}>`.
|
|
37
|
+
*/
|
|
38
|
+
export declare function NavigationMenuLink({ kind, className, ...props }: NavigationMenuLinkProps): import("react").JSX.Element;
|
|
39
|
+
/** The name of the page a row leads to. */
|
|
40
|
+
export declare function NavigationMenuLinkTitle({ className, ...props }: ComponentProps<"span">): import("react").JSX.Element;
|
|
41
|
+
/** One line that says what is on that page, without a full stop. */
|
|
42
|
+
export declare function NavigationMenuLinkDescription({ className, ...props }: ComponentProps<"span">): import("react").JSX.Element;
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useGround } from "../ground/ground.js";
|
|
3
|
+
import { ChevronDownGlyph } from "../../internal/glyphs.js";
|
|
4
|
+
import { cn, mergeClassName } from "../../lib/cn.js";
|
|
5
|
+
import { navigationMenuEntryVariants } from "./navigation-menu-variants.js";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { NavigationMenu as NavigationMenu$1 } from "@base-ui/react/navigation-menu";
|
|
8
|
+
// src/components/navigation-menu/navigation-menu.tsx
|
|
9
|
+
/**
|
|
10
|
+
* The places of a website as one row: plain links, and entries that open a panel with the pages
|
|
11
|
+
* behind them. A panel opens when its entry is pointed at or pressed, and one sheet serves them
|
|
12
|
+
* all: moving along the row, it glides to the next entry and takes its size, and the content
|
|
13
|
+
* changes inside it.
|
|
14
|
+
*
|
|
15
|
+
* It is a `<nav>`: name it with `aria-label`. Put a `NavigationMenuList` inside, with one
|
|
16
|
+
* `NavigationMenuItem` per entry.
|
|
17
|
+
*/
|
|
18
|
+
function NavigationMenu({ align = "start", sideOffset = 8, className, children, ...props }) {
|
|
19
|
+
const ground = useGround();
|
|
20
|
+
return /* @__PURE__ */ jsxs(NavigationMenu$1.Root, {
|
|
21
|
+
"data-slot": "navigation-menu",
|
|
22
|
+
className: mergeClassName("relative flex items-center", className),
|
|
23
|
+
...props,
|
|
24
|
+
children: [children, /* @__PURE__ */ jsx(NavigationMenu$1.Portal, { children: /* @__PURE__ */ jsx(NavigationMenu$1.Positioner, {
|
|
25
|
+
"data-slot": "navigation-menu-positioner",
|
|
26
|
+
side: "bottom",
|
|
27
|
+
align,
|
|
28
|
+
sideOffset,
|
|
29
|
+
collisionPadding: {
|
|
30
|
+
top: 8,
|
|
31
|
+
bottom: 8,
|
|
32
|
+
left: 16,
|
|
33
|
+
right: 16
|
|
34
|
+
},
|
|
35
|
+
collisionAvoidance: { side: "none" },
|
|
36
|
+
className: cn("z-50 h-(--positioner-height) w-(--positioner-width) max-w-(--available-width)", "transition-[top,left,right,bottom] spring-glide data-instant:transition-none", "before:absolute before:inset-x-0 before:-top-2 before:h-2 before:content-['']"),
|
|
37
|
+
children: /* @__PURE__ */ jsx(NavigationMenu$1.Popup, {
|
|
38
|
+
"data-slot": "navigation-menu-popup",
|
|
39
|
+
"data-theme": ground,
|
|
40
|
+
className: cn("relative h-(--popup-height) w-(--popup-width) origin-(--transform-origin) rounded-xl bg-sheet text-fg-body depth-floating outline-hidden", "transition-[opacity,scale,width,height] spring-glide", "data-starting-style:scale-(--motion-enter-scale) data-starting-style:opacity-0", "data-ending-style:opacity-0 data-ending-style:spring-leave", "data-instant:transition-none"),
|
|
41
|
+
children: /* @__PURE__ */ jsx(NavigationMenu$1.Viewport, {
|
|
42
|
+
"data-slot": "navigation-menu-viewport",
|
|
43
|
+
className: "relative size-full overflow-hidden rounded-[inherit]"
|
|
44
|
+
})
|
|
45
|
+
})
|
|
46
|
+
}) })]
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
function NavigationMenuList({ className, ...props }) {
|
|
50
|
+
return /* @__PURE__ */ jsx(NavigationMenu$1.List, {
|
|
51
|
+
"data-slot": "navigation-menu-list",
|
|
52
|
+
className: mergeClassName("flex list-none items-center gap-1", className),
|
|
53
|
+
...props
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
function NavigationMenuItem({ className, ...props }) {
|
|
57
|
+
return /* @__PURE__ */ jsx(NavigationMenu$1.Item, {
|
|
58
|
+
"data-slot": "navigation-menu-item",
|
|
59
|
+
className: mergeClassName("relative", className),
|
|
60
|
+
...props
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* An entry that opens a panel: a noun of one or two words ("Produkt", "Dokumentation"). The
|
|
65
|
+
* chevron says that more is behind it and turns while the panel is open.
|
|
66
|
+
*/
|
|
67
|
+
function NavigationMenuTrigger({ className, children, ...props }) {
|
|
68
|
+
return /* @__PURE__ */ jsxs(NavigationMenu$1.Trigger, {
|
|
69
|
+
"data-slot": "navigation-menu-trigger",
|
|
70
|
+
className: mergeClassName(navigationMenuEntryVariants(), className),
|
|
71
|
+
...props,
|
|
72
|
+
children: [children, /* @__PURE__ */ jsx(NavigationMenu$1.Icon, {
|
|
73
|
+
"data-slot": "navigation-menu-icon",
|
|
74
|
+
className: "flex text-fg-muted transition-[rotate] spring-settle group-data-popup-open/entry:rotate-180",
|
|
75
|
+
children: /* @__PURE__ */ jsx(ChevronDownGlyph, {})
|
|
76
|
+
})]
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* The panel of an entry. Lay its links out as a list, one column or two, and give the list a
|
|
81
|
+
* width: the sheet takes it. Coming from a neighbouring entry, the content arrives from that
|
|
82
|
+
* side; it leaves by fading.
|
|
83
|
+
*/
|
|
84
|
+
function NavigationMenuContent({ className, ...props }) {
|
|
85
|
+
return /* @__PURE__ */ jsx(NavigationMenu$1.Content, {
|
|
86
|
+
"data-slot": "navigation-menu-content",
|
|
87
|
+
className: mergeClassName([
|
|
88
|
+
"h-full w-max max-w-[calc(100vw-2rem)] p-2",
|
|
89
|
+
"transition-[opacity,translate] spring-settle",
|
|
90
|
+
"data-ending-style:opacity-0 data-ending-style:spring-leave data-starting-style:opacity-0",
|
|
91
|
+
"data-starting-style:data-[activation-direction=left]:-translate-x-[calc(var(--motion-enter-offset)*6)]",
|
|
92
|
+
"data-starting-style:data-[activation-direction=right]:translate-x-[calc(var(--motion-enter-offset)*6)]"
|
|
93
|
+
], className),
|
|
94
|
+
...props
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* A link in the navigation menu. Mark the page the reader is on with `active`. For a router's
|
|
99
|
+
* link, pass it as `render`: `<NavigationMenuLink render={<NextLink href="/preise" />}>`.
|
|
100
|
+
*/
|
|
101
|
+
function NavigationMenuLink({ kind = "page", className, ...props }) {
|
|
102
|
+
return /* @__PURE__ */ jsx(NavigationMenu$1.Link, {
|
|
103
|
+
"data-slot": "navigation-menu-link",
|
|
104
|
+
className: mergeClassName(kind === "entry" ? navigationMenuEntryVariants() : [
|
|
105
|
+
"flex flex-col gap-0.5 rounded-md px-3 py-2.5 text-fg-body",
|
|
106
|
+
"transition-colors duration-150 ease-out hover:bg-hover data-active:bg-tint",
|
|
107
|
+
"focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-accent"
|
|
108
|
+
], className),
|
|
109
|
+
...props
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
/** The name of the page a row leads to. */
|
|
113
|
+
function NavigationMenuLinkTitle({ className, ...props }) {
|
|
114
|
+
return /* @__PURE__ */ jsx("span", {
|
|
115
|
+
"data-slot": "navigation-menu-link-title",
|
|
116
|
+
className: cn("text-control leading-snug font-medium text-fg", className),
|
|
117
|
+
...props
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
/** One line that says what is on that page, without a full stop. */
|
|
121
|
+
function NavigationMenuLinkDescription({ className, ...props }) {
|
|
122
|
+
return /* @__PURE__ */ jsx("span", {
|
|
123
|
+
"data-slot": "navigation-menu-link-description",
|
|
124
|
+
className: cn("text-sm text-pretty text-fg-muted", className),
|
|
125
|
+
...props
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
export { NavigationMenu, NavigationMenuContent, NavigationMenuItem, NavigationMenuLink, NavigationMenuLinkDescription, NavigationMenuLinkTitle, NavigationMenuList, NavigationMenuTrigger };
|