@lanfermann/ui 0.2.0 → 0.4.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.
Files changed (80) hide show
  1. package/dist/components/accordion/accordion.js +2 -1
  2. package/dist/components/anchor-heading/anchor-heading.d.ts +1 -1
  3. package/dist/components/breadcrumbs/breadcrumbs.js +5 -10
  4. package/dist/components/button/button.d.ts +3 -0
  5. package/dist/components/button/button.js +14 -4
  6. package/dist/components/button-group/button-group-context.js +14 -0
  7. package/dist/components/button-group/button-group-variants.d.ts +14 -0
  8. package/dist/components/button-group/button-group-variants.js +93 -0
  9. package/dist/components/button-group/button-group.d.ts +36 -0
  10. package/dist/components/button-group/button-group.js +46 -0
  11. package/dist/components/code-block/code-block-frame.js +22 -6
  12. package/dist/components/code-block/code-block-live.d.ts +3 -3
  13. package/dist/components/code-block/code-block-live.js +5 -3
  14. package/dist/components/code-block/code-block.d.ts +7 -3
  15. package/dist/components/code-block/code-block.js +9 -3
  16. package/dist/components/code-block/code-keys.d.ts +24 -0
  17. package/dist/components/code-block/code-keys.js +107 -0
  18. package/dist/components/code-block/code-scroll.js +2 -1
  19. package/dist/components/code-block/code-tabs-frame.js +12 -5
  20. package/dist/components/code-block/code-tabs.d.ts +9 -4
  21. package/dist/components/code-block/code-tabs.js +9 -6
  22. package/dist/components/code-block/lines.js +23 -1
  23. package/dist/components/copy-page/copy-page.d.ts +46 -0
  24. package/dist/components/copy-page/copy-page.js +211 -0
  25. package/dist/components/docs-layout/docs-layout.d.ts +4 -2
  26. package/dist/components/docs-layout/docs-layout.js +11 -6
  27. package/dist/components/docs-layout/docs-nav.d.ts +51 -0
  28. package/dist/components/docs-layout/docs-nav.js +60 -0
  29. package/dist/components/grow/grow.d.ts +20 -0
  30. package/dist/components/grow/grow.js +98 -0
  31. package/dist/components/heading/heading.d.ts +4 -0
  32. package/dist/components/heading/heading.js +8 -4
  33. package/dist/components/hover-card/hover-card.d.ts +24 -0
  34. package/dist/components/hover-card/hover-card.js +51 -0
  35. package/dist/components/pager/pager.js +19 -24
  36. package/dist/components/parameter-list/parameter-list.js +2 -1
  37. package/dist/components/scroll-fade/scroll-fade.d.ts +29 -0
  38. package/dist/components/scroll-fade/scroll-fade.js +40 -0
  39. package/dist/components/scroll-fade/use-scroll-edges.d.ts +13 -0
  40. package/dist/{internal/scroll-edges.js → components/scroll-fade/use-scroll-edges.js} +10 -7
  41. package/dist/components/section/section.d.ts +2 -1
  42. package/dist/components/section/section.js +2 -1
  43. package/dist/components/segmented-control/segmented-control.d.ts +7 -1
  44. package/dist/components/segmented-control/segmented-control.js +22 -11
  45. package/dist/components/select/select.d.ts +4 -1
  46. package/dist/components/select/select.js +15 -3
  47. package/dist/components/separator/separator.js +2 -2
  48. package/dist/components/shimmer/shimmer.d.ts +21 -0
  49. package/dist/components/shimmer/shimmer.js +24 -0
  50. package/dist/components/side-nav/side-nav.js +11 -20
  51. package/dist/components/site-header/site-header.d.ts +1 -1
  52. package/dist/components/site-header/site-header.js +6 -3
  53. package/dist/components/slider/slider.d.ts +3 -1
  54. package/dist/components/slider/slider.js +45 -19
  55. package/dist/components/table/table.d.ts +6 -6
  56. package/dist/components/table/table.js +24 -17
  57. package/dist/components/table-of-contents/table-of-contents.js +11 -6
  58. package/dist/components/tabs/tabs.js +4 -8
  59. package/dist/components/theme-switch/theme-switch.d.ts +47 -0
  60. package/dist/components/theme-switch/theme-switch.js +102 -0
  61. package/dist/components/trace/trace.d.ts +71 -0
  62. package/dist/components/trace/trace.js +201 -0
  63. package/dist/index.d.ts +12 -2
  64. package/dist/index.js +11 -2
  65. package/dist/internal/render-as.js +24 -0
  66. package/dist/internal/rule.js +16 -0
  67. package/dist/lib/merge-refs.js +9 -0
  68. package/package.json +1 -1
  69. package/src/styles/button-group.css +57 -0
  70. package/src/styles/code.css +14 -68
  71. package/src/styles/copy.css +46 -0
  72. package/src/styles/marks.css +10 -0
  73. package/src/styles/motion.css +4 -3
  74. package/src/styles/scroll-fade.css +58 -0
  75. package/src/styles/shimmer.css +68 -0
  76. package/src/styles/slider.css +57 -19
  77. package/src/styles.css +4 -1
  78. package/dist/components/page-header/page-header.d.ts +0 -30
  79. package/dist/components/page-header/page-header.js +0 -48
  80. package/src/styles/tabs.css +0 -39
@@ -0,0 +1,46 @@
1
+ /*
2
+ * The confirmation of a copy, the same in every control that copies (a code block's key, the
3
+ * page copy): the copy symbol shrinks away and a tick is drawn in its place, short leg first, as
4
+ * in a checkbox. When the moment has passed the tick fades where it is (it is not undrawn) and
5
+ * the copy symbol seats back with a little bounce.
6
+ *
7
+ * The control sets `data-copied` while the moment lasts; the symbol and the tick are found inside
8
+ * it by their slots. Under reduced motion nothing scales or draws: the two only cross-fade.
9
+ */
10
+ @layer components {
11
+ :is([data-slot="code-copy-symbol"], [data-slot="copy-page-symbol"]) {
12
+ transition-property: scale, opacity;
13
+ transition-duration: var(--transition-duration-spring-seat);
14
+ transition-timing-function: var(--ease-spring-seat);
15
+ }
16
+ [data-copied] :is([data-slot="code-copy-symbol"], [data-slot="copy-page-symbol"]) {
17
+ scale: 0.5;
18
+ opacity: 0;
19
+ transition-duration: var(--transition-duration-spring-leave);
20
+ transition-timing-function: var(--ease-spring-leave);
21
+ }
22
+ :is([data-slot="code-copy-tick"], [data-slot="copy-page-tick"]) {
23
+ stroke-dasharray: 1;
24
+ stroke-dashoffset: 1;
25
+ opacity: 0;
26
+ transition:
27
+ opacity var(--transition-duration-spring-leave) var(--ease-spring-leave),
28
+ stroke-dashoffset 0s var(--transition-duration-spring-leave);
29
+ }
30
+ [data-copied] :is([data-slot="code-copy-tick"], [data-slot="copy-page-tick"]) {
31
+ stroke-dashoffset: 0;
32
+ opacity: 1;
33
+ transition:
34
+ opacity 60ms linear 60ms,
35
+ stroke-dashoffset 220ms cubic-bezier(0.3, 0, 0.2, 1) 60ms;
36
+ }
37
+
38
+ @media (prefers-reduced-motion: reduce) {
39
+ [data-copied] :is([data-slot="code-copy-symbol"], [data-slot="copy-page-symbol"]) {
40
+ scale: 1;
41
+ }
42
+ :is([data-slot="code-copy-tick"], [data-slot="copy-page-tick"]) {
43
+ stroke-dashoffset: 0;
44
+ }
45
+ }
46
+ }
@@ -28,6 +28,16 @@
28
28
  transition-timing-function: var(--ease-spring-seat);
29
29
  }
30
30
 
31
+ /*
32
+ * A disc that appears already closed starts as the ring and closes where it stands: the step of
33
+ * a `Trace` that has just finished, whose mark was the spinner a moment ago. Beside `mark-on`.
34
+ */
35
+ @utility mark-closes {
36
+ @starting-style {
37
+ box-shadow: inset 0 0 0 1.5px var(--mark-ring, var(--lf-line));
38
+ }
39
+ }
40
+
31
41
  /* Forced colours drop box-shadows: draw the ring as an outline and the disc as a fill. */
32
42
  @media (forced-colors: active) {
33
43
  .mark {
@@ -24,9 +24,10 @@
24
24
  }
25
25
 
26
26
  /*
27
- * The three keyframe animations in the system. All show ongoing work nobody triggered a state
28
- * change for: the spinner turns, a progress bar without a known end runs through its trough, and
29
- * under reduced motion both breathe instead.
27
+ * Three of the four keyframe animations in the system (the fourth is the shimmer of a line of
28
+ * text, shimmer.css). All show ongoing work nobody triggered a state change for: the spinner
29
+ * turns, a progress bar without a known end runs through its trough, and under reduced motion
30
+ * all of them breathe instead.
30
31
  */
31
32
  @theme {
32
33
  --animate-spinner: spinner 0.75s linear infinite;
@@ -0,0 +1,58 @@
1
+ /*
2
+ * A box that scrolls fades at the edges where more waits: what the edge cuts says that it goes
3
+ * on, instead of looking cut off. It is the one fade of the library: a `ScrollFade`, a wide
4
+ * table, the side columns of a docs page, a code block's long lines and a long row of tabs all
5
+ * carry `data-scroll-fade` with their axis, and `useScrollEdges` sets `data-overflow` on them
6
+ * from the scroll position. A box that fits has no mask.
7
+ *
8
+ * `--scroll-fade-size` is how deep the fade is (40px). The two lengths the mask is drawn from
9
+ * are registered, so they can move between nothing and that depth on `settle`.
10
+ *
11
+ * The mask cuts everything the box paints, its outline too: a box that takes the keyboard
12
+ * focus has its outline drawn by a box around it (`Table`). What takes the focus inside is
13
+ * scrolled clear of the fade.
14
+ */
15
+ @property --scroll-fade-start {
16
+ syntax: "<length>";
17
+ inherits: false;
18
+ initial-value: 0px;
19
+ }
20
+ @property --scroll-fade-end {
21
+ syntax: "<length>";
22
+ inherits: false;
23
+ initial-value: 0px;
24
+ }
25
+
26
+ @layer components {
27
+ [data-scroll-fade] {
28
+ transition:
29
+ --scroll-fade-start var(--transition-duration-spring-settle) var(--ease-spring-settle),
30
+ --scroll-fade-end var(--transition-duration-spring-settle) var(--ease-spring-settle);
31
+ }
32
+ [data-scroll-fade="x"] {
33
+ --scroll-fade-to: right;
34
+ scroll-padding-inline: var(--scroll-fade-size, 2.5rem);
35
+ &:dir(rtl) {
36
+ --scroll-fade-to: left;
37
+ }
38
+ }
39
+ [data-scroll-fade="y"] {
40
+ --scroll-fade-to: bottom;
41
+ scroll-padding-block: var(--scroll-fade-size, 2.5rem);
42
+ }
43
+ [data-scroll-fade][data-overflow] {
44
+ mask-image: linear-gradient(
45
+ to var(--scroll-fade-to),
46
+ transparent,
47
+ #000 var(--scroll-fade-start),
48
+ #000 calc(100% - var(--scroll-fade-end)),
49
+ transparent
50
+ );
51
+ }
52
+ [data-scroll-fade][data-overflow~="start"]:not([data-fade-edges="end"]) {
53
+ --scroll-fade-start: var(--scroll-fade-size, 2.5rem);
54
+ }
55
+ [data-scroll-fade][data-overflow~="end"]:not([data-fade-edges="start"]) {
56
+ --scroll-fade-end: var(--scroll-fade-size, 2.5rem);
57
+ }
58
+ }
@@ -0,0 +1,68 @@
1
+ /*
2
+ * Shimmer: a soft light that passes through a line of text while the work it names is going on
3
+ * ("Zahlungen werden abgeglichen"). The text stands in the muted colour and the light is the
4
+ * ground's strongest text colour, so nothing is brighter than what stands beside it: it is a
5
+ * sign of life, not a glare. Both come from the ground the line stands on.
6
+ *
7
+ * It is one of the system's four keyframe animations (motion.css): work that goes on by itself,
8
+ * which nobody triggered a state change for.
9
+ *
10
+ * How it is drawn: the text is filled with a gradient three times its width, with one narrow
11
+ * band of light in its middle, and the gradient is pushed through from one side to the other.
12
+ * For half of the way the band is on the text; before and after, it is outside it. That is the
13
+ * rest between two passes, which keeps the line calm.
14
+ *
15
+ * --shimmer-duration one pass and its rest (2.4s)
16
+ * --shimmer-band half the width of the light (3em: it grows with the type)
17
+ * --shimmer-from, --shimmer-to the text's colour and the light's
18
+ *
19
+ * It is a paint, not a transform: a browser redraws the line on every frame. That is fine for a
20
+ * line of text and wrong for a block of it. Under reduced motion nothing passes and the line
21
+ * breathes like the spinner; in forced colours and where text cannot clip a background it is
22
+ * plain text.
23
+ */
24
+ @keyframes shimmer {
25
+ from {
26
+ background-position: 100% 0;
27
+ }
28
+ to {
29
+ background-position: 0 0;
30
+ }
31
+ }
32
+
33
+ @utility shimmer {
34
+ --shimmer-from: var(--lf-text-muted);
35
+ --shimmer-to: var(--lf-text);
36
+ color: var(--shimmer-from);
37
+
38
+ @supports ((background-clip: text) or (-webkit-background-clip: text)) {
39
+ @media (prefers-reduced-motion: no-preference) and (forced-colors: none) {
40
+ background-image: linear-gradient(
41
+ 100deg,
42
+ var(--shimmer-from) calc(50% - var(--shimmer-band, 3em)),
43
+ var(--shimmer-to) 50%,
44
+ var(--shimmer-from) calc(50% + var(--shimmer-band, 3em))
45
+ );
46
+ background-size: 300% 100%;
47
+ background-repeat: no-repeat;
48
+ -webkit-background-clip: text;
49
+ background-clip: text;
50
+ -webkit-text-fill-color: transparent;
51
+ animation: shimmer var(--shimmer-duration, 2.4s) linear infinite;
52
+
53
+ /* Read from the right, the light passes from the right. */
54
+ &:dir(rtl) {
55
+ animation-direction: reverse;
56
+ }
57
+ /* Selected, the text is filled again: a transparent fill would leave the selection empty. */
58
+ &::selection,
59
+ & ::selection {
60
+ -webkit-text-fill-color: currentColor;
61
+ }
62
+ }
63
+ }
64
+
65
+ @media (prefers-reduced-motion: reduce) {
66
+ animation: var(--animate-breathe);
67
+ }
68
+ }
@@ -6,8 +6,16 @@
6
6
  * phone), where anything that needs layout is redone on the main thread, at half that or less.
7
7
  *
8
8
  * Places are worked out in CSS from one number per thumb, `--p` (0 at the lowest value, 1 at the
9
- * highest), and the width of the control (`100cqw`: the control is a size container). Nothing is
10
- * measured in JavaScript, so the first frame is already right.
9
+ * highest). A part rides in a lane: a box as wide as the way a thumb can go, moved by `--p`
10
+ * times its own width. That is a percentage, and a percentage stays a percentage in the
11
+ * computed style: it changes when the value changes and at no other time. So nothing is
12
+ * measured in JavaScript, the first frame is already right, and a slider that changes its
13
+ * width does not glide to its new place.
14
+ *
15
+ * (The places were lengths first, from the width of the control as `100cqw`. Firefox works such
16
+ * a length out against the window before it knows the container, then corrects it, and the
17
+ * correction is a change of the computed style like any other: on load, the thumb of a full
18
+ * slider glided in from a window's width away. Justin's Firefox, 2026-11-16.)
11
19
  *
12
20
  * What follows a finger eases on `--slider-chase`: the `snap` spring written as a plain bezier
13
21
  * (within 0.02 of it; a test compares the two). Safari's compositor takes a bezier whose values
@@ -17,10 +25,7 @@
17
25
 
18
26
  /* On the control: the lengths the parts below share. */
19
27
  @utility slider-geometry {
20
- container-type: inline-size;
21
28
  --slider-thumb: calc(var(--switch-h) - 4px);
22
- /* How far a thumb's centre can go: it stops inside the trough, 2px from its wall. */
23
- --slider-travel: calc(100cqw - var(--slider-thumb));
24
29
  --slider-chase: cubic-bezier(0.3, 0.95, 0.25, 1);
25
30
  --slider-dir: 1;
26
31
  &:dir(rtl) {
@@ -28,12 +33,39 @@
28
33
  }
29
34
  }
30
35
 
31
- /* A part that rides with a thumb. Set `--p` on it; its box starts where the travel starts. */
36
+ /*
37
+ * A lane: as wide as the way a thumb's centre can go, which is the control less one thumb (it
38
+ * stops inside the trough, 2px from its wall). Set `--p` on it. The trough is wider than the
39
+ * control by its two walls: a lane inside it takes them off again (`--slider-walls`).
40
+ *
41
+ * A lane ENDS where the way has got to, and what rides in it stands at its end. At the lowest
42
+ * value the whole lane lies before the control, at the highest it lies in it. It is an empty
43
+ * box, but a box that reached past the control's end would make a page scroll sideways to it;
44
+ * before the start of a line there is nowhere to scroll to.
45
+ */
46
+ @utility slider-lane {
47
+ position: absolute;
48
+ inset-block: 0;
49
+ inset-inline-start: 0;
50
+ width: calc(100% - var(--slider-thumb) - var(--slider-walls, 0px));
51
+ translate: calc(var(--slider-dir) * (var(--p, 0) - 1) * 100%);
52
+ }
53
+
54
+ /* A lane for a part that rides with a thumb, centred on the trough's line. Give it a height. */
32
55
  @utility slider-at {
33
56
  position: absolute;
34
57
  top: 50%;
35
58
  inset-inline-start: 0;
36
- translate: calc(var(--slider-dir) * var(--p, 0) * var(--slider-travel)) -50%;
59
+ width: calc(100% - var(--slider-thumb) - var(--slider-walls, 0px));
60
+ translate: calc(var(--slider-dir) * (var(--p, 0) - 1) * 100%) -50%;
61
+ }
62
+
63
+ /* The place of the part in its lane: a box of the part's own size, from the lane's end on. */
64
+ @utility slider-seat {
65
+ position: absolute;
66
+ inset-block: 0;
67
+ inset-inline-start: 100%;
68
+ aspect-ratio: 1;
37
69
  }
38
70
 
39
71
  /*
@@ -54,7 +86,7 @@
54
86
 
55
87
  /*
56
88
  * The part that deforms: the thumb's face, and the cap of the fill that holds it. It is centred
57
- * in its rider. Set `--size` (its length at rest), `--s` (how stretched: 1 at rest) and `--d`
89
+ * in its seat. Set `--size` (its length at rest), `--s` (how stretched: 1 at rest) and `--d`
58
90
  * (the way it travels on screen: 1 to the right, -1 to the left).
59
91
  *
60
92
  * Stretched, it is longer and a little thinner, and it moves back by half of what it gained:
@@ -91,20 +123,26 @@
91
123
  }
92
124
 
93
125
  /*
94
- * The fill is a bar as long as the trough that is pushed out of it at the start, so only its end
95
- * shows: `--fill-end` is where it ends, from the start of the trough. In a range a window with
96
- * the same trick cuts its beginning: `--fill-start`.
126
+ * The fill is a bar as long as the trough that hangs from a lane, so its end is where the lane
127
+ * ends and its beginning lies outside the trough, which cuts it round. `--fill-lead` is how far
128
+ * past the lane's end it reaches: half a cap, the middle of the thumb it runs up to.
129
+ *
130
+ * In a range the bar must begin at the first thumb. A lane takes a window there (`--p` of the
131
+ * first thumb), which cuts everything before its edge, and the bar's lane inside it goes on by
132
+ * the way between the two thumbs. Both lanes ease alike, so the end stands where the second
133
+ * thumb is at every moment. The window reaches past the trough's end, where the trough cuts it.
97
134
  */
98
- @utility slider-fill-window {
135
+ @utility slider-fill-bar {
99
136
  position: absolute;
100
137
  inset-block: 0;
101
- inset-inline-start: 0;
102
- width: 100%;
103
- overflow: hidden;
104
- translate: calc(var(--slider-dir) * var(--fill-start, 0px));
138
+ inset-inline-end: calc(var(--fill-lead, 0px) * -1);
139
+ /* The lane, a thumb and the two walls: the trough. */
140
+ width: calc(100% + var(--slider-thumb) + var(--slider-walls, 0px));
105
141
  }
106
- @utility slider-fill-bar {
142
+ @utility slider-fill-window {
107
143
  position: absolute;
108
- inset: 0;
109
- translate: calc(var(--slider-dir) * (var(--fill-end, 0px) - var(--fill-start, 0px) - 100%));
144
+ inset-block: 0;
145
+ inset-inline-start: calc(100% + var(--switch-h) / 2);
146
+ width: calc(100% + var(--slider-thumb) + var(--slider-walls, 0px));
147
+ overflow: hidden;
110
148
  }
package/src/styles.css CHANGED
@@ -15,6 +15,7 @@
15
15
  @import "./styles/grounds.css";
16
16
  @import "./styles/status.css";
17
17
  @import "./styles/code.css";
18
+ @import "./styles/copy.css";
18
19
  @import "./styles/type.css";
19
20
  @import "./styles/radius.css";
20
21
  @import "./styles/density.css";
@@ -26,7 +27,9 @@
26
27
  @import "./styles/toast.css";
27
28
  @import "./styles/slider.css";
28
29
  @import "./styles/segmented.css";
29
- @import "./styles/tabs.css";
30
+ @import "./styles/button-group.css";
31
+ @import "./styles/scroll-fade.css";
32
+ @import "./styles/shimmer.css";
30
33
  @import "./styles/calendar.css";
31
34
  @import "./styles/prose.css";
32
35
  @import "./styles/base.css";
@@ -1,30 +0,0 @@
1
- import { HeadingProps } from "../heading/heading.js";
2
- import { TextProps } from "../text/text.js";
3
- import { ComponentProps } from "react";
4
- export type PageHeaderProps = ComponentProps<"div"> & {
5
- /**
6
- * Opens the block with the 2px rule. Every section of a page has one; its opening has none, and
7
- * neither has a section that a `Seam` opens.
8
- */
9
- rule?: boolean;
10
- };
11
- /**
12
- * What opens a page or one of its sections: a title, then a lead, then what the reader can do.
13
- * Nothing stands above the title, no label and no number. Everything is set left.
14
- */
15
- export declare function PageHeader({ rule, className, ...props }: PageHeaderProps): import("react").JSX.Element;
16
- declare const titleOnAPhone: {
17
- readonly display: "max-sm:text-2xl";
18
- readonly title: "max-sm:text-xl";
19
- };
20
- export type PageHeaderTitleProps = Omit<HeadingProps, "size"> & {
21
- /** `display` (54px) once on a page, for its opening. `title` (36px) for every section. */
22
- size?: keyof typeof titleOnAPhone;
23
- };
24
- /** A sentence with a full stop, in sentence case. It states the thing, not a topic. */
25
- export declare function PageHeaderTitle({ level, size, className, ...props }: PageHeaderTitleProps): import("react").JSX.Element;
26
- /** One or two sentences under the title, at lines of about 55 characters. */
27
- export declare function PageHeaderLead({ className, ...props }: TextProps): import("react").JSX.Element;
28
- /** The next step: one button, and at most one quiet way beside it. */
29
- export declare function PageHeaderActions({ className, ...props }: ComponentProps<"div">): import("react").JSX.Element;
30
- export {};
@@ -1,48 +0,0 @@
1
- import { Heading } from "../heading/heading.js";
2
- import { Text } from "../text/text.js";
3
- import { cn } from "../../lib/cn.js";
4
- import { jsx } from "react/jsx-runtime";
5
- // src/components/page-header/page-header.tsx
6
- /**
7
- * What opens a page or one of its sections: a title, then a lead, then what the reader can do.
8
- * Nothing stands above the title, no label and no number. Everything is set left.
9
- */
10
- function PageHeader({ rule = false, className, ...props }) {
11
- return /* @__PURE__ */ jsx("div", {
12
- "data-slot": "page-header",
13
- className: cn("flex flex-col items-start gap-4", rule && "border-t-2 border-rule pt-6", className),
14
- ...props
15
- });
16
- }
17
- const titleOnAPhone = {
18
- display: "max-sm:text-2xl",
19
- title: "max-sm:text-xl"
20
- };
21
- /** A sentence with a full stop, in sentence case. It states the thing, not a topic. */
22
- function PageHeaderTitle({ level = 2, size = "title", className, ...props }) {
23
- return /* @__PURE__ */ jsx(Heading, {
24
- "data-slot": "page-header-title",
25
- level,
26
- size,
27
- className: cn("max-w-[44rem]", titleOnAPhone[size], className),
28
- ...props
29
- });
30
- }
31
- /** One or two sentences under the title, at lines of about 55 characters. */
32
- function PageHeaderLead({ className, ...props }) {
33
- return /* @__PURE__ */ jsx(Text, {
34
- "data-slot": "page-header-lead",
35
- size: "lg",
36
- className: cn("max-w-[34rem] text-pretty", className),
37
- ...props
38
- });
39
- }
40
- /** The next step: one button, and at most one quiet way beside it. */
41
- function PageHeaderActions({ className, ...props }) {
42
- return /* @__PURE__ */ jsx("div", {
43
- "data-slot": "page-header-actions",
44
- className: cn("flex flex-wrap items-center gap-x-5 gap-y-3 pt-2", className),
45
- ...props
46
- });
47
- }
48
- export { PageHeader, PageHeaderActions, PageHeaderLead, PageHeaderTitle };
@@ -1,39 +0,0 @@
1
- /*
2
- * A row of tabs wider than its place scrolls sideways inside itself (tabs.tsx), and its edges
3
- * fade where more tabs wait, as a code block's long lines do (code.css): a tab cut by the edge
4
- * says that the row goes on. The two lengths are registered so the mask moves on a spring;
5
- * `useScrollEdges` sets `data-overflow` from the scroll position. A row that fits has no mask.
6
- */
7
- @property --tabs-fade-start {
8
- syntax: "<length>";
9
- inherits: false;
10
- initial-value: 0px;
11
- }
12
- @property --tabs-fade-end {
13
- syntax: "<length>";
14
- inherits: false;
15
- initial-value: 0px;
16
- }
17
-
18
- @layer components {
19
- [data-slot="tabs-list"] {
20
- transition:
21
- --tabs-fade-start var(--transition-duration-spring-settle) var(--ease-spring-settle),
22
- --tabs-fade-end var(--transition-duration-spring-settle) var(--ease-spring-settle);
23
- }
24
- [data-slot="tabs-list"][data-overflow] {
25
- mask-image: linear-gradient(
26
- to right,
27
- transparent,
28
- #000 var(--tabs-fade-start),
29
- #000 calc(100% - var(--tabs-fade-end)),
30
- transparent
31
- );
32
- }
33
- [data-slot="tabs-list"][data-overflow~="start"] {
34
- --tabs-fade-start: 2.5rem;
35
- }
36
- [data-slot="tabs-list"][data-overflow~="end"] {
37
- --tabs-fade-end: 2.5rem;
38
- }
39
- }