@juspay/svelte-ui-components 4.33.3 → 4.34.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/dist/Accordion/Accordion.svelte +26 -2
- package/dist/Accordion/properties.d.ts +7 -0
- package/dist/ArmedButton/ArmedButton.svelte +147 -0
- package/dist/ArmedButton/ArmedButton.svelte.d.ts +4 -0
- package/dist/ArmedButton/properties.d.ts +24 -0
- package/dist/ArmedButton/properties.js +1 -0
- package/dist/Banner/Banner.svelte +13 -8
- package/dist/Banner/properties.d.ts +8 -1
- package/dist/Button/Button.svelte +26 -0
- package/dist/Button/properties.d.ts +17 -0
- package/dist/ChatComposer/ChatComposer.svelte +314 -1
- package/dist/ChatComposer/properties.d.ts +42 -0
- package/dist/ChatMessageList/ChatMessageList.svelte +22 -2
- package/dist/ChatMessageList/ChatMessageList.svelte.d.ts +1 -1
- package/dist/CommandMenu/CommandMenu.svelte +53 -20
- package/dist/CommandMenu/properties.d.ts +24 -0
- package/dist/DiffViewer/DiffViewer.svelte +210 -0
- package/dist/DiffViewer/DiffViewer.svelte.d.ts +4 -0
- package/dist/DiffViewer/properties.d.ts +25 -0
- package/dist/DiffViewer/properties.js +1 -0
- package/dist/EmptyState/EmptyState.svelte +22 -3
- package/dist/EmptyState/properties.d.ts +9 -0
- package/dist/HITL/HITL.svelte +318 -49
- package/dist/HITL/properties.d.ts +113 -11
- package/dist/Input/Input.svelte +45 -1
- package/dist/Input/properties.d.ts +15 -0
- package/dist/KeyValue/KeyValue.svelte +16 -3
- package/dist/KeyValue/properties.d.ts +2 -0
- package/dist/Progress/Progress.svelte +96 -41
- package/dist/Progress/properties.d.ts +19 -0
- package/dist/Snippet/Snippet.svelte +45 -1
- package/dist/Snippet/properties.d.ts +8 -0
- package/dist/Tabs/Tabs.svelte +75 -16
- package/dist/Tabs/properties.d.ts +21 -0
- package/dist/ThinkingIndicator/ThinkingIndicator.svelte.d.ts +1 -1
- package/dist/Toolbar/Toolbar.svelte +81 -3
- package/dist/Toolbar/properties.d.ts +37 -0
- package/dist/WindowedList/WindowedList.svelte +129 -0
- package/dist/WindowedList/WindowedList.svelte.d.ts +25 -0
- package/dist/WindowedList/properties.d.ts +38 -0
- package/dist/WindowedList/properties.js +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +3 -0
- package/dist/styles/theme-dark.css +42 -0
- package/dist-wc/index.js +2637 -1642
- package/package.json +2 -1
|
@@ -4,6 +4,11 @@
|
|
|
4
4
|
let {
|
|
5
5
|
showBackButton = true,
|
|
6
6
|
text,
|
|
7
|
+
title,
|
|
8
|
+
headingLevel,
|
|
9
|
+
subtitle,
|
|
10
|
+
rootTag,
|
|
11
|
+
variant = 'chrome',
|
|
7
12
|
backIcon,
|
|
8
13
|
backLabel = 'Back',
|
|
9
14
|
backHref,
|
|
@@ -18,6 +23,19 @@
|
|
|
18
23
|
headingTestId
|
|
19
24
|
}: ToolbarProperties = $props();
|
|
20
25
|
|
|
26
|
+
// Same validation `Sheet`'s `headingLevel` already applies: through a web
|
|
27
|
+
// component, an untyped attribute reaches this as anything, and a getter
|
|
28
|
+
// can throw, so an unusable level degrades to the plain-tag fallback rather
|
|
29
|
+
// than emitting an invalid `<h7>`/`<h0>`/`<hNaN>`.
|
|
30
|
+
const headingTag = $derived(
|
|
31
|
+
typeof headingLevel === 'number' &&
|
|
32
|
+
Number.isInteger(headingLevel) &&
|
|
33
|
+
headingLevel >= 1 &&
|
|
34
|
+
headingLevel <= 6
|
|
35
|
+
? `h${headingLevel}`
|
|
36
|
+
: null
|
|
37
|
+
);
|
|
38
|
+
|
|
21
39
|
// `backIcon={null}` (or '') has always meant "render no back control at all", and consumers
|
|
22
40
|
// rely on it; only the DEFAULT changes, from a CDN image to the inline icon.
|
|
23
41
|
const showBackControl = $derived(showBackButton && backIcon !== null && backIcon !== '');
|
|
@@ -42,7 +60,13 @@
|
|
|
42
60
|
};
|
|
43
61
|
</script>
|
|
44
62
|
|
|
45
|
-
<
|
|
63
|
+
<svelte:element
|
|
64
|
+
this={rootTag ?? 'div'}
|
|
65
|
+
class="toolbar {classes ?? ''}"
|
|
66
|
+
data-variant={variant === 'page-header' ? 'page-header' : null}
|
|
67
|
+
data-pw={testId}
|
|
68
|
+
testID={testId}
|
|
69
|
+
>
|
|
46
70
|
<div
|
|
47
71
|
class="content"
|
|
48
72
|
data-pw={typeof testId === 'string' ? `${testId}-content` : null}
|
|
@@ -82,6 +106,17 @@
|
|
|
82
106
|
<div class="center-content">
|
|
83
107
|
{@render centerContent()}
|
|
84
108
|
</div>
|
|
109
|
+
{:else if typeof title === 'string' && title.length > 0}
|
|
110
|
+
<div class="titles" data-pw={headingTestId} testID={headingTestId}>
|
|
111
|
+
{#if headingTag !== null}
|
|
112
|
+
<svelte:element this={headingTag}>{title}</svelte:element>
|
|
113
|
+
{:else}
|
|
114
|
+
<span>{title}</span>
|
|
115
|
+
{/if}
|
|
116
|
+
{#if typeof subtitle === 'string' && subtitle.length > 0}
|
|
117
|
+
<p class="subtitle">{subtitle}</p>
|
|
118
|
+
{/if}
|
|
119
|
+
</div>
|
|
85
120
|
{:else if typeof text === 'string' && text.length > 0}
|
|
86
121
|
<div class="text" data-pw={headingTestId} testID={headingTestId}>
|
|
87
122
|
{text}
|
|
@@ -98,7 +133,7 @@
|
|
|
98
133
|
{@render additionalContent()}
|
|
99
134
|
{/if}
|
|
100
135
|
</div>
|
|
101
|
-
</
|
|
136
|
+
</svelte:element>
|
|
102
137
|
|
|
103
138
|
<style>
|
|
104
139
|
.toolbar {
|
|
@@ -117,6 +152,25 @@
|
|
|
117
152
|
border-radius: var(--toolbar-border-radius, 0px);
|
|
118
153
|
}
|
|
119
154
|
|
|
155
|
+
/* In the page's flow rather than pinned over it: only the fallbacks change,
|
|
156
|
+
so a consumer's own --toolbar-* values still win. */
|
|
157
|
+
/* Literal values, not the chrome's variables with other fallbacks: an app
|
|
158
|
+
that themes its bars at :root (--toolbar-background: white,
|
|
159
|
+
--toolbar-position: fixed) would otherwise paint and pin every page
|
|
160
|
+
header too. These six properties ARE the variant; everything else still
|
|
161
|
+
reads the shared variables. */
|
|
162
|
+
.toolbar[data-variant='page-header'] {
|
|
163
|
+
position: static;
|
|
164
|
+
width: 100%;
|
|
165
|
+
background: transparent;
|
|
166
|
+
box-shadow: none;
|
|
167
|
+
z-index: auto;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.toolbar[data-variant='page-header'] > .content {
|
|
171
|
+
flex-wrap: wrap;
|
|
172
|
+
}
|
|
173
|
+
|
|
120
174
|
.content {
|
|
121
175
|
display: flex;
|
|
122
176
|
flex-direction: row;
|
|
@@ -160,7 +214,7 @@
|
|
|
160
214
|
/* A native button so Enter/Space and the accessible name come for free; the reset keeps
|
|
161
215
|
the box identical to the div it replaces. */
|
|
162
216
|
appearance: none;
|
|
163
|
-
background: none;
|
|
217
|
+
background: var(--toolbar-back-button-background, none);
|
|
164
218
|
border: 0;
|
|
165
219
|
margin: 0;
|
|
166
220
|
box-sizing: content-box;
|
|
@@ -214,4 +268,28 @@
|
|
|
214
268
|
color: var(--toolbar-text-color, inherit);
|
|
215
269
|
flex: var(--toolbar-text-flex, 1);
|
|
216
270
|
}
|
|
271
|
+
|
|
272
|
+
/* `title`/`subtitle`'s heading tag is deliberately unstyled here: a consumer's
|
|
273
|
+
own global heading rules (size, weight, tracking) already reach it the
|
|
274
|
+
same way they reach any other heading on the page, and a component-level
|
|
275
|
+
font-size/font-weight here — even with an `inherit` fallback — would
|
|
276
|
+
outrank a bare `h1`/`h2` element selector by specificity and silently
|
|
277
|
+
break that inheritance for every consumer that has one. Only layout and
|
|
278
|
+
the subtitle's own (independent) presentation get hooks. Both rules are written down the
|
|
279
|
+
structure they live in (.content > .titles > .subtitle), so a `titles` or `subtitle`
|
|
280
|
+
class a consumer passes through `classes`, which lands on the root, cannot match them,
|
|
281
|
+
and the variant is a data attribute rather than a class for the same reason: a class
|
|
282
|
+
directive would strip a consumer's own `page-header` class (the one the docs recipe
|
|
283
|
+
uses) from `classes`. */
|
|
284
|
+
.content > .titles {
|
|
285
|
+
display: grid;
|
|
286
|
+
gap: var(--toolbar-titles-gap, 2px);
|
|
287
|
+
min-width: var(--toolbar-titles-min-width, 0);
|
|
288
|
+
flex: var(--toolbar-titles-flex, 1);
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
.titles > .subtitle {
|
|
292
|
+
color: var(--toolbar-subtitle-color, inherit);
|
|
293
|
+
text-wrap: var(--toolbar-subtitle-text-wrap, pretty);
|
|
294
|
+
}
|
|
217
295
|
</style>
|
|
@@ -2,6 +2,42 @@ import type { Snippet } from 'svelte';
|
|
|
2
2
|
export type ToolbarProperties = ToolbarEventProperties & {
|
|
3
3
|
showBackButton?: boolean;
|
|
4
4
|
text?: string | null;
|
|
5
|
+
/**
|
|
6
|
+
* A real heading, separate from `text` — which has always rendered a plain,
|
|
7
|
+
* non-heading div and keeps doing so for existing consumers. Renders as a
|
|
8
|
+
* heading only once `headingLevel` also resolves to a real level 1-6;
|
|
9
|
+
* otherwise renders in a plain, non-heading tag instead, same as `text`.
|
|
10
|
+
*/
|
|
11
|
+
title?: string;
|
|
12
|
+
/**
|
|
13
|
+
* The tag `title` renders as (`<svelte:element this={`h${headingLevel}`}>`).
|
|
14
|
+
* Only 1-6 resolve to a real heading; anything else (including omitting it)
|
|
15
|
+
* renders `title` in a plain, non-heading tag instead — the same reasoning
|
|
16
|
+
* `Sheet`'s `headingLevel` already uses, so a stray "7"/"0"/`NaN` reaching
|
|
17
|
+
* through a web component's untyped attribute degrades the same way there
|
|
18
|
+
* too, rather than emitting an invalid `<h7>`/`<h0>`/`<hNaN>`.
|
|
19
|
+
*/
|
|
20
|
+
headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
21
|
+
/** Rendered as `<p class="subtitle">` under `title`. Ignored without `title`. */
|
|
22
|
+
subtitle?: string;
|
|
23
|
+
/**
|
|
24
|
+
* The root element's tag, via `<svelte:element>`. Defaults to `div`, i.e.
|
|
25
|
+
* unconditionally unchanged from every version before this. Set it to give
|
|
26
|
+
* the toolbar its own landmark (`header`, `nav`, `aside`, `footer`) instead
|
|
27
|
+
* of a consumer wrapping it in one purely to supply that semantics.
|
|
28
|
+
*/
|
|
29
|
+
rootTag?: 'div' | 'header' | 'nav' | 'aside' | 'footer';
|
|
30
|
+
/**
|
|
31
|
+
* `'chrome'` (the default) is the fixed, full-viewport-width app bar every
|
|
32
|
+
* version before this rendered. `'page-header'` is the same bar in the page's
|
|
33
|
+
* flow: position static, width 100%, transparent background, no shadow,
|
|
34
|
+
* z-index auto, and a content row that wraps (actions drop under the title
|
|
35
|
+
* when they don't fit). Those six are set directly, not through the chrome's
|
|
36
|
+
* `--toolbar-position`/`-width`/`-background`/`-box-shadow`/`-z-index`/
|
|
37
|
+
* `--toolbar-content-flex-wrap`, so a bar themed at :root never leaks into a
|
|
38
|
+
* page header. Every other `--toolbar-*` variable applies to both.
|
|
39
|
+
*/
|
|
40
|
+
variant?: ToolbarVariant;
|
|
5
41
|
backIcon?: string | null;
|
|
6
42
|
backLabel?: string;
|
|
7
43
|
/**
|
|
@@ -27,3 +63,4 @@ export type ToolbarEventProperties = {
|
|
|
27
63
|
onbackclick?: () => void;
|
|
28
64
|
onkeydown?: (event: KeyboardEvent) => void;
|
|
29
65
|
};
|
|
66
|
+
export type ToolbarVariant = 'chrome' | 'page-header';
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
<script lang="ts" generics="T">
|
|
2
|
+
import { tick } from 'svelte';
|
|
3
|
+
import Button from '../Button/Button.svelte';
|
|
4
|
+
import type { WindowedListProperties } from './properties';
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
items,
|
|
8
|
+
getKey,
|
|
9
|
+
row,
|
|
10
|
+
initialCount = 200,
|
|
11
|
+
step = 200,
|
|
12
|
+
earlier,
|
|
13
|
+
earlierLabel = (next: number, hidden: number) => `Show ${next} earlier (${hidden} hidden)`,
|
|
14
|
+
classes,
|
|
15
|
+
testId
|
|
16
|
+
}: WindowedListProperties<T> = $props();
|
|
17
|
+
|
|
18
|
+
/* The window is anchored by KEY, not index. An index would slide with every
|
|
19
|
+
append (the newest N), pushing rows out from under a reader who scrolled up;
|
|
20
|
+
WebKit has no scroll anchoring to hide that jump. A key stays put while the
|
|
21
|
+
list grows at the end. If the anchor's key disappears (the list was replaced
|
|
22
|
+
or truncated), the window re-anchors to the newest `initialCount` -- whichever
|
|
23
|
+
anchor it was, so a reveal that has since been truncated away cannot fall back
|
|
24
|
+
to an older, stale one, and the new anchor then holds through later appends.
|
|
25
|
+
|
|
26
|
+
`anchorKey` and `appliedReveal` are plain latches, not $state: they are
|
|
27
|
+
written only inside the derived below, while it recomputes because `items` or
|
|
28
|
+
`reveal` changed, and nothing else reads them. `reveal` is state: only the
|
|
29
|
+
"show earlier" handler writes it, as a fresh object per click so a repeated
|
|
30
|
+
key still reads as a new request. */
|
|
31
|
+
let anchorKey: string | null = null;
|
|
32
|
+
let appliedReveal: { key: string | null } | null = null;
|
|
33
|
+
let reveal = $state.raw<{ key: string | null } | null>(null);
|
|
34
|
+
|
|
35
|
+
function indexOfKey(key: string | null): number {
|
|
36
|
+
return key === null ? -1 : items.findIndex((item) => getKey(item) === key);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function keyAt(index: number): string | null {
|
|
40
|
+
return items.slice(index, index + 1).map(getKey)[0] ?? null;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const start = $derived.by(() => {
|
|
44
|
+
if (reveal !== appliedReveal) {
|
|
45
|
+
appliedReveal = reveal;
|
|
46
|
+
anchorKey = reveal?.key ?? null;
|
|
47
|
+
}
|
|
48
|
+
const anchored = indexOfKey(anchorKey);
|
|
49
|
+
if (anchored >= 0) {
|
|
50
|
+
return anchored;
|
|
51
|
+
}
|
|
52
|
+
const fresh = Math.max(0, items.length - initialCount);
|
|
53
|
+
anchorKey = keyAt(fresh);
|
|
54
|
+
return fresh;
|
|
55
|
+
});
|
|
56
|
+
const shown = $derived(items.slice(start));
|
|
57
|
+
const next = $derived(Math.min(step, start));
|
|
58
|
+
|
|
59
|
+
let controlEl: HTMLElement | null = $state(null);
|
|
60
|
+
|
|
61
|
+
function scrollParent(node: HTMLElement): HTMLElement | null {
|
|
62
|
+
for (let el = node.parentElement; el !== null; el = el.parentElement) {
|
|
63
|
+
if (/(auto|scroll|overlay)/.test(getComputedStyle(el).overflowY)) {
|
|
64
|
+
return el;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return document.scrollingElement instanceof HTMLElement ? document.scrollingElement : null;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/* Reveals `next` more above the window. The first row that was already
|
|
71
|
+
rendered is measured before and after, and the scroller moves by the
|
|
72
|
+
difference, so what the reader was looking at stays where it was. Browser
|
|
73
|
+
scroll anchoring may already have done this (the difference is then ~0);
|
|
74
|
+
WebKit has none, and there it is the whole fix. */
|
|
75
|
+
async function showEarlier(): Promise<void> {
|
|
76
|
+
if (start === 0) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
const firstRow = controlEl?.nextElementSibling ?? null;
|
|
80
|
+
const before = firstRow instanceof HTMLElement ? firstRow.getBoundingClientRect().top : null;
|
|
81
|
+
reveal = { key: keyAt(Math.max(0, start - step)) };
|
|
82
|
+
await tick();
|
|
83
|
+
if (firstRow instanceof HTMLElement && before !== null && firstRow.isConnected) {
|
|
84
|
+
const scroller = scrollParent(firstRow);
|
|
85
|
+
const delta = firstRow.getBoundingClientRect().top - before;
|
|
86
|
+
if (scroller !== null && delta !== 0) {
|
|
87
|
+
scroller.scrollTop += delta;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
</script>
|
|
92
|
+
|
|
93
|
+
<div
|
|
94
|
+
class="windowed-list {classes ?? ''}"
|
|
95
|
+
data-pw={typeof testId === 'string' ? testId : null}
|
|
96
|
+
testID={typeof testId === 'string' ? testId : null}
|
|
97
|
+
>
|
|
98
|
+
{#if start > 0}
|
|
99
|
+
<div class="windowed-list-earlier" bind:this={controlEl}>
|
|
100
|
+
{#if typeof earlier === 'function'}
|
|
101
|
+
{@render earlier({ hidden: start, next, showEarlier })}
|
|
102
|
+
{:else}
|
|
103
|
+
<Button text={earlierLabel(next, start)} onclick={() => void showEarlier()} />
|
|
104
|
+
{/if}
|
|
105
|
+
</div>
|
|
106
|
+
{/if}
|
|
107
|
+
{#each shown as item, i (getKey(item))}
|
|
108
|
+
{@render row({ item, index: start + i, isFirst: i === 0 })}
|
|
109
|
+
{/each}
|
|
110
|
+
</div>
|
|
111
|
+
|
|
112
|
+
<style>
|
|
113
|
+
/* `contents` by default: the rows stay children of the consumer's own layout
|
|
114
|
+
(a flex column's gap, a grid's tracks), exactly as if they were rendered
|
|
115
|
+
without this wrapper. Set `--windowed-list-display` to give the list a box
|
|
116
|
+
of its own. */
|
|
117
|
+
.windowed-list {
|
|
118
|
+
display: var(--windowed-list-display, contents);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.windowed-list-earlier {
|
|
122
|
+
display: flex;
|
|
123
|
+
justify-content: var(--windowed-list-earlier-justify, center);
|
|
124
|
+
padding: var(--windowed-list-earlier-padding, 8px 0);
|
|
125
|
+
/* The control must never be what the browser anchors on: it is about to
|
|
126
|
+
have rows inserted directly under it. */
|
|
127
|
+
overflow-anchor: none;
|
|
128
|
+
}
|
|
129
|
+
</style>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { WindowedListProperties } from './properties';
|
|
2
|
+
declare function $$render<T>(): {
|
|
3
|
+
props: WindowedListProperties<T>;
|
|
4
|
+
exports: {};
|
|
5
|
+
bindings: "";
|
|
6
|
+
slots: {};
|
|
7
|
+
events: {};
|
|
8
|
+
};
|
|
9
|
+
declare class __sveltets_Render<T> {
|
|
10
|
+
props(): ReturnType<typeof $$render<T>>['props'];
|
|
11
|
+
events(): ReturnType<typeof $$render<T>>['events'];
|
|
12
|
+
slots(): ReturnType<typeof $$render<T>>['slots'];
|
|
13
|
+
bindings(): "";
|
|
14
|
+
exports(): {};
|
|
15
|
+
}
|
|
16
|
+
interface $$IsomorphicComponent {
|
|
17
|
+
new <T>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<T>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<T>['props']>, ReturnType<__sveltets_Render<T>['events']>, ReturnType<__sveltets_Render<T>['slots']>> & {
|
|
18
|
+
$$bindings?: ReturnType<__sveltets_Render<T>['bindings']>;
|
|
19
|
+
} & ReturnType<__sveltets_Render<T>['exports']>;
|
|
20
|
+
<T>(internal: unknown, props: ReturnType<__sveltets_Render<T>['props']> & {}): ReturnType<__sveltets_Render<T>['exports']>;
|
|
21
|
+
z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
|
|
22
|
+
}
|
|
23
|
+
declare const WindowedList: $$IsomorphicComponent;
|
|
24
|
+
type WindowedList<T> = InstanceType<typeof WindowedList<T>>;
|
|
25
|
+
export default WindowedList;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
/** What the `row` snippet receives for each rendered item. */
|
|
3
|
+
export type WindowedListRow<T> = {
|
|
4
|
+
item: T;
|
|
5
|
+
/** Position in the FULL `items` list, not in the rendered window. */
|
|
6
|
+
index: number;
|
|
7
|
+
/** True for the first rendered item — the one directly under the "show earlier" control. */
|
|
8
|
+
isFirst: boolean;
|
|
9
|
+
};
|
|
10
|
+
/** What the `earlier` snippet receives when it replaces the default control. */
|
|
11
|
+
export type WindowedListEarlier = {
|
|
12
|
+
/** Items above the window that are not rendered. */
|
|
13
|
+
hidden: number;
|
|
14
|
+
/** How many the next reveal adds: `step`, or fewer when fewer are left. */
|
|
15
|
+
next: number;
|
|
16
|
+
/** Renders `next` more above the window, keeping the reader's place. */
|
|
17
|
+
showEarlier: () => void;
|
|
18
|
+
};
|
|
19
|
+
export type WindowedListProperties<T> = {
|
|
20
|
+
items: T[];
|
|
21
|
+
/** A stable, unique key per item: it drives the keyed render and anchors the window. */
|
|
22
|
+
getKey: (item: T) => string;
|
|
23
|
+
row: Snippet<[WindowedListRow<T>]>;
|
|
24
|
+
/**
|
|
25
|
+
* How many of the newest items render at first. Items appended later join the
|
|
26
|
+
* window at the bottom without pushing earlier ones out, so the window does not
|
|
27
|
+
* slide under a reader.
|
|
28
|
+
*/
|
|
29
|
+
initialCount?: number;
|
|
30
|
+
/** How many more each "show earlier" reveals. */
|
|
31
|
+
step?: number;
|
|
32
|
+
/** Replaces the default "show earlier" button. */
|
|
33
|
+
earlier?: Snippet<[WindowedListEarlier]>;
|
|
34
|
+
/** Text of the default button. */
|
|
35
|
+
earlierLabel?: (next: number, hidden: number) => string;
|
|
36
|
+
classes?: string;
|
|
37
|
+
testId?: string;
|
|
38
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { default as ArmedButton } from './ArmedButton/ArmedButton.svelte';
|
|
1
2
|
export { default as Modal } from './Modal/Modal.svelte';
|
|
2
3
|
export { default as BrandLoader } from './BrandLoader/BrandLoader.svelte';
|
|
3
4
|
export { default as Button } from './Button/Button.svelte';
|
|
@@ -17,6 +18,8 @@ export { default as Badge } from './Badge/Badge.svelte';
|
|
|
17
18
|
export { default as Banner } from './Banner/Banner.svelte';
|
|
18
19
|
export { default as Toggle } from './Toggle/Toggle.svelte';
|
|
19
20
|
export { default as Accordion } from './Accordion/Accordion.svelte';
|
|
21
|
+
export { default as DiffViewer } from './DiffViewer/DiffViewer.svelte';
|
|
22
|
+
export { default as WindowedList } from './WindowedList/WindowedList.svelte';
|
|
20
23
|
export { default as CheckListItem } from './CheckListItem/CheckListItem.svelte';
|
|
21
24
|
export { default as Table } from './Table/Table.svelte';
|
|
22
25
|
export { normalizeColumns } from './Table/normalizeColumns';
|
|
@@ -119,6 +122,7 @@ export type * from './ListItem/properties';
|
|
|
119
122
|
export type * from './KeyValue/properties';
|
|
120
123
|
export type * from './types';
|
|
121
124
|
export type * from './Icon/properties';
|
|
125
|
+
export type * from './ArmedButton/properties';
|
|
122
126
|
export type * from './BrandLoader/properties';
|
|
123
127
|
export type * from './Status/properties';
|
|
124
128
|
export type * from './Select/properties';
|
|
@@ -127,6 +131,8 @@ export type * from './Carousel/properties';
|
|
|
127
131
|
export type * from './Badge/properties';
|
|
128
132
|
export type * from './Banner/properties';
|
|
129
133
|
export type * from './Accordion/properties';
|
|
134
|
+
export type * from './DiffViewer/properties';
|
|
135
|
+
export type * from './WindowedList/properties';
|
|
130
136
|
export type * from './Table/properties';
|
|
131
137
|
export type { NormalizedColumns } from './Table/normalizeColumns';
|
|
132
138
|
export type { SortTableRowsOptions, TableSortType } from './Table/sortEngine';
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { default as ArmedButton } from './ArmedButton/ArmedButton.svelte';
|
|
1
2
|
export { default as Modal } from './Modal/Modal.svelte';
|
|
2
3
|
export { default as BrandLoader } from './BrandLoader/BrandLoader.svelte';
|
|
3
4
|
export { default as Button } from './Button/Button.svelte';
|
|
@@ -17,6 +18,8 @@ export { default as Badge } from './Badge/Badge.svelte';
|
|
|
17
18
|
export { default as Banner } from './Banner/Banner.svelte';
|
|
18
19
|
export { default as Toggle } from './Toggle/Toggle.svelte';
|
|
19
20
|
export { default as Accordion } from './Accordion/Accordion.svelte';
|
|
21
|
+
export { default as DiffViewer } from './DiffViewer/DiffViewer.svelte';
|
|
22
|
+
export { default as WindowedList } from './WindowedList/WindowedList.svelte';
|
|
20
23
|
export { default as CheckListItem } from './CheckListItem/CheckListItem.svelte';
|
|
21
24
|
export { default as Table } from './Table/Table.svelte';
|
|
22
25
|
export { normalizeColumns } from './Table/normalizeColumns';
|
|
@@ -131,6 +131,17 @@
|
|
|
131
131
|
/* ChatComposer */
|
|
132
132
|
--chat-composer-background: #1e1e2e;
|
|
133
133
|
--chat-composer-border: 1px solid #2a2a3c;
|
|
134
|
+
--chat-composer-slash-menu-background: #1e1e2e;
|
|
135
|
+
--chat-composer-slash-menu-border: 1px solid #2a2a3c;
|
|
136
|
+
--chat-composer-slash-menu-box-shadow: 0 8px 24px rgb(0 0 0 / 40%);
|
|
137
|
+
--chat-composer-slash-foot-border: 1px solid #2a2a3c;
|
|
138
|
+
--chat-composer-slash-foot-color: #9ca3af;
|
|
139
|
+
--chat-composer-slash-name-color: #93c5fd;
|
|
140
|
+
--chat-composer-slash-hint-color: #9ca3af;
|
|
141
|
+
--chat-composer-slash-desc-color: #d1d5db;
|
|
142
|
+
--chat-composer-slash-badge-background: #1e3a5f;
|
|
143
|
+
--chat-composer-slash-badge-color: #93c5fd;
|
|
144
|
+
--chat-composer-slash-item-selected-background: #2a2a3c;
|
|
134
145
|
--chat-composer-color: #e5e7eb;
|
|
135
146
|
--chat-composer-placeholder-color: #9ca3af;
|
|
136
147
|
--chat-composer-action-color: #9ca3af;
|
|
@@ -573,6 +584,20 @@
|
|
|
573
584
|
--delta-indicator-neutral-color: #9ca3af;
|
|
574
585
|
--delta-indicator-positive-color: #4ade80;
|
|
575
586
|
|
|
587
|
+
/* DiffViewer */
|
|
588
|
+
--diff-background: #1a1a26;
|
|
589
|
+
--diff-border: 1px solid #2a2a3c;
|
|
590
|
+
--diff-header-background: #1e1e2e;
|
|
591
|
+
--diff-color: #d1d5db;
|
|
592
|
+
--diff-filename-color: #f3f4f6;
|
|
593
|
+
--diff-gutter-color: #9ca3af;
|
|
594
|
+
--diff-add-background: #123222;
|
|
595
|
+
--diff-add-color: #86efac;
|
|
596
|
+
--diff-remove-background: #3a1f22;
|
|
597
|
+
--diff-remove-color: #fca5a5;
|
|
598
|
+
--diff-created-background: #14532d;
|
|
599
|
+
--diff-created-color: #bbf7d0;
|
|
600
|
+
|
|
576
601
|
/* FileInput */
|
|
577
602
|
--file-input-error-color: #f87171;
|
|
578
603
|
--file-input-info-color: #9ca3af;
|
|
@@ -800,3 +825,20 @@
|
|
|
800
825
|
--doc-text: #d1d5db;
|
|
801
826
|
--doc-text-secondary: #9ca3af;
|
|
802
827
|
}
|
|
828
|
+
|
|
829
|
+
/* ----------------------------------------------------------------------------
|
|
830
|
+
Fifth pass — ArmedButton.
|
|
831
|
+
---------------------------------------------------------------------------- */
|
|
832
|
+
[data-theme='dark'] {
|
|
833
|
+
/* ArmedButton */
|
|
834
|
+
--armed-btn-bg: #2a2a3c;
|
|
835
|
+
--armed-btn-color: #9ca3af;
|
|
836
|
+
--armed-btn-hover-color: #e5e7eb;
|
|
837
|
+
--armed-btn-border: 1px solid #3f3f52;
|
|
838
|
+
/* The armed (confirm) state is a fixed danger red regardless of theme --
|
|
839
|
+
restated explicitly rather than left to fall through, so it reads as a
|
|
840
|
+
deliberate choice and not an omission the next sweep has to re-discover. */
|
|
841
|
+
--armed-btn-armed-bg: #dc2626;
|
|
842
|
+
--armed-btn-armed-color: #ffffff;
|
|
843
|
+
--armed-btn-armed-border: #dc2626;
|
|
844
|
+
}
|