@lyeve-labs/ui-kit 0.15.0 → 0.16.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.
|
@@ -10,17 +10,29 @@
|
|
|
10
10
|
* the element, and the element is always a real heading.
|
|
11
11
|
*/
|
|
12
12
|
import type { Snippet } from 'svelte';
|
|
13
|
-
import { sectionHeading } from '../internal/layout.js';
|
|
13
|
+
import { sectionHeading, type SectionVariant } from '../internal/layout.js';
|
|
14
14
|
|
|
15
15
|
interface Props {
|
|
16
|
-
/** 2 under a page title, 3 inside a card. */
|
|
16
|
+
/** 2 under a page title, 3 inside a card. The element, not the treatment. */
|
|
17
17
|
level?: 2 | 3;
|
|
18
|
+
/**
|
|
19
|
+
* `eyebrow` is the small uppercase label the consoles head a band with. It
|
|
20
|
+
* is separate from the level because an eyebrow appears at both, and it was
|
|
21
|
+
* unnamed here while thirty of them shipped hand rolled across two apps.
|
|
22
|
+
*/
|
|
23
|
+
variant?: SectionVariant;
|
|
18
24
|
actions?: Snippet;
|
|
19
25
|
class?: string;
|
|
20
26
|
children: Snippet;
|
|
21
27
|
}
|
|
22
28
|
|
|
23
|
-
let {
|
|
29
|
+
let {
|
|
30
|
+
level = 2,
|
|
31
|
+
variant = 'default',
|
|
32
|
+
actions,
|
|
33
|
+
class: klass = '',
|
|
34
|
+
children,
|
|
35
|
+
}: Props = $props();
|
|
24
36
|
</script>
|
|
25
37
|
|
|
26
38
|
<div class="flex flex-wrap items-center justify-between gap-4 {klass}">
|
|
@@ -28,9 +40,9 @@
|
|
|
28
40
|
structure decision, and a reader of this file should be able to see both
|
|
29
41
|
headings it can produce. -->
|
|
30
42
|
{#if level === 2}
|
|
31
|
-
<h2 class={sectionHeading(2)}>{@render children()}</h2>
|
|
43
|
+
<h2 class={sectionHeading(2, variant)}>{@render children()}</h2>
|
|
32
44
|
{:else}
|
|
33
|
-
<h3 class={sectionHeading(3)}>{@render children()}</h3>
|
|
45
|
+
<h3 class={sectionHeading(3, variant)}>{@render children()}</h3>
|
|
34
46
|
{/if}
|
|
35
47
|
|
|
36
48
|
{#if actions}
|
|
@@ -9,9 +9,16 @@
|
|
|
9
9
|
* the element, and the element is always a real heading.
|
|
10
10
|
*/
|
|
11
11
|
import type { Snippet } from 'svelte';
|
|
12
|
+
import { type SectionVariant } from '../internal/layout.js';
|
|
12
13
|
interface Props {
|
|
13
|
-
/** 2 under a page title, 3 inside a card. */
|
|
14
|
+
/** 2 under a page title, 3 inside a card. The element, not the treatment. */
|
|
14
15
|
level?: 2 | 3;
|
|
16
|
+
/**
|
|
17
|
+
* `eyebrow` is the small uppercase label the consoles head a band with. It
|
|
18
|
+
* is separate from the level because an eyebrow appears at both, and it was
|
|
19
|
+
* unnamed here while thirty of them shipped hand rolled across two apps.
|
|
20
|
+
*/
|
|
21
|
+
variant?: SectionVariant;
|
|
15
22
|
actions?: Snippet;
|
|
16
23
|
class?: string;
|
|
17
24
|
children: Snippet;
|
package/dist/index.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export { default as Table } from './components/Table.svelte';
|
|
|
20
20
|
export { default as DescriptionList } from './components/DescriptionList.svelte';
|
|
21
21
|
export { default as Toolbar } from './components/Toolbar.svelte';
|
|
22
22
|
export { default as TreeView } from './components/TreeView.svelte';
|
|
23
|
-
export type { PageWidth } from './internal/layout.js';
|
|
23
|
+
export type { PageWidth, SectionVariant } from './internal/layout.js';
|
|
24
24
|
export type { TreeNode, TriState } from './internal/tree.js';
|
|
25
25
|
export { default as Button } from './components/Button.svelte';
|
|
26
26
|
export { default as ButtonGroup } from './components/ButtonGroup.svelte';
|
|
@@ -86,4 +86,4 @@ export { openDialog, closeDialog, dismissDialog, dismissAllDialogs, confirm, set
|
|
|
86
86
|
export type { DialogOptions, DialogEntry, DialogSize } from './components/dialog/types.js';
|
|
87
87
|
export { cn, type ClassValue } from './utils/cn.js';
|
|
88
88
|
export { getTheme, setTheme, toggleTheme, themeBootScript, type Theme } from './utils/theme.js';
|
|
89
|
-
export declare const VERSION = "0.
|
|
89
|
+
export declare const VERSION = "0.16.0";
|
package/dist/index.js
CHANGED
|
@@ -92,4 +92,4 @@ export { getTheme, setTheme, toggleTheme, themeBootScript } from './utils/theme.
|
|
|
92
92
|
// ── Version ────────────────────────────────────────────────────────────────
|
|
93
93
|
// Generated from package.json by `pnpm version:sync`. Bump package.json, never
|
|
94
94
|
// this line; the build and the test suite fail when the two disagree.
|
|
95
|
-
export const VERSION = '0.
|
|
95
|
+
export const VERSION = '0.16.0';
|
|
@@ -17,6 +17,8 @@
|
|
|
17
17
|
*
|
|
18
18
|
* Not exported from the package entry point - this is an implementation detail.
|
|
19
19
|
*/
|
|
20
|
+
/** The treatment a section heading takes, independent of its level. */
|
|
21
|
+
export type SectionVariant = 'default' | 'eyebrow';
|
|
20
22
|
/** How much of the viewport a page's content is allowed to fill. */
|
|
21
23
|
export type PageWidth = 'narrow' | 'default' | 'wide' | 'full';
|
|
22
24
|
/**
|
|
@@ -115,8 +117,16 @@ export declare const MODAL_PAD = "px-card py-card-sm";
|
|
|
115
117
|
* page can render at different sizes and weights. Taking the level rather than
|
|
116
118
|
* a free-form string means the class cannot disagree with the heading element
|
|
117
119
|
* the caller is already writing.
|
|
120
|
+
*
|
|
121
|
+
* `eyebrow` is the small uppercase label the consoles use to head a band of
|
|
122
|
+
* content. It is a second treatment rather than a third level because the
|
|
123
|
+
* element is a decision about document structure and the treatment is not: an
|
|
124
|
+
* eyebrow appears at both levels. It went unnamed here while thirty of them
|
|
125
|
+
* shipped hand rolled across two apps in four different bottom margins, and a
|
|
126
|
+
* margin is exactly what this function must not carry - the stack around the
|
|
127
|
+
* heading owns the distance to what follows.
|
|
118
128
|
*/
|
|
119
|
-
export declare function sectionHeading(level: 2 | 3): string;
|
|
129
|
+
export declare function sectionHeading(level: 2 | 3, variant?: SectionVariant): string;
|
|
120
130
|
/**
|
|
121
131
|
* The authed app frame, stated once for every app that has one.
|
|
122
132
|
*
|
package/dist/internal/layout.js
CHANGED
|
@@ -123,8 +123,20 @@ export const MODAL_PAD = 'px-card py-card-sm';
|
|
|
123
123
|
* page can render at different sizes and weights. Taking the level rather than
|
|
124
124
|
* a free-form string means the class cannot disagree with the heading element
|
|
125
125
|
* the caller is already writing.
|
|
126
|
+
*
|
|
127
|
+
* `eyebrow` is the small uppercase label the consoles use to head a band of
|
|
128
|
+
* content. It is a second treatment rather than a third level because the
|
|
129
|
+
* element is a decision about document structure and the treatment is not: an
|
|
130
|
+
* eyebrow appears at both levels. It went unnamed here while thirty of them
|
|
131
|
+
* shipped hand rolled across two apps in four different bottom margins, and a
|
|
132
|
+
* margin is exactly what this function must not carry - the stack around the
|
|
133
|
+
* heading owns the distance to what follows.
|
|
126
134
|
*/
|
|
127
|
-
export function sectionHeading(level) {
|
|
135
|
+
export function sectionHeading(level, variant = 'default') {
|
|
136
|
+
// The eyebrow reads the same at both levels. It is a label for the band under
|
|
137
|
+
// it rather than a title, so it does not take the level's size at all.
|
|
138
|
+
if (variant === 'eyebrow')
|
|
139
|
+
return 'text-xs font-medium uppercase tracking-wide text-faint';
|
|
128
140
|
// Level 3 drops a size rather than a weight. Inside a card it sits under the
|
|
129
141
|
// card's own semibold title, and two semibold lines at the same size read as
|
|
130
142
|
// one heading broken in half.
|
package/package.json
CHANGED