lldlab-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.
- package/README.md +90 -4
- package/dist/index.d.ts +284 -77
- package/dist/index.js +504 -290
- package/dist/index.js.map +1 -1
- package/dist/theme.css +19 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -12,8 +12,9 @@ Design-system components for [LLD Lab](https://lldlab.com), built for React 19 a
|
|
|
12
12
|
|
|
13
13
|
## Table of contents
|
|
14
14
|
|
|
15
|
-
**Quick links:** [Install](#install) · [Setup](#setup) · [Component index](#component-index) · [Mobile navigation](#mobile-navigation) · [Design tokens](#design-tokens) · [Troubleshooting](#troubleshooting)
|
|
15
|
+
**Quick links:** [What's new in 0.4.0](#whats-new-in-040) · [Install](#install) · [Setup](#setup) · [Component index](#component-index) · [Mobile navigation](#mobile-navigation) · [Design tokens](#design-tokens) · [Troubleshooting](#troubleshooting)
|
|
16
16
|
|
|
17
|
+
1. [What's new in 0.4.0](#whats-new-in-040) · [0.3.0](#whats-new-in-030)
|
|
17
18
|
1. [Install](#install)
|
|
18
19
|
2. [Setup](#setup)
|
|
19
20
|
- [1. Styles](#1-styles) · [2. Fonts](#2-fonts) · [3. Icons](#3-icons) · [4. Use it](#4-use-it)
|
|
@@ -25,7 +26,7 @@ Design-system components for [LLD Lab](https://lldlab.com), built for React 19 a
|
|
|
25
26
|
- **[Typography](#typography):** [`Text`](#text) · [`Heading`](#heading) · [`Eyebrow`](#eyebrow) · [`Code`](#code) · [`CodeBlock`](#codeblock) · [`TextLink`](#textlink) · [`Markdown`](#markdown)
|
|
26
27
|
- **[Display](#display):** [`Icon`](#icon) · [`Dot`](#dot) · [`Badge`](#badge) · [`Chip`](#chip) · [`Stat`](#stat) · [`ProgressBar`](#progressbar) · [`SectionHeader`](#sectionheader) · [`Callout`](#callout) · [`ResultRow`](#resultrow) · [`Message`](#message) · [`EmptyState`](#emptystate) · [`CheckList`](#checklist) · [`Card`](#card) · [`IconTile`](#icontile) · [`Skeleton`](#skeleton) · [`Table`](#table) · [`DescriptionList`](#descriptionlist) · [`Timeline`](#timeline) · [`BarChart`](#barchart) · [`VerdictBanner`](#verdictbanner) · [`TerminalOutput`](#terminaloutput) · [`DiffViewer`](#diffviewer) · [`Overlay`](#overlay)
|
|
27
28
|
- **[Inputs and interaction](#inputs-and-interaction):** [`Button`](#button) · [`IconButton`](#iconbutton) · [`Kbd`](#kbd) · [`TextField`](#textfield) · [`Select`](#select) · [`Tabs`](#tabs) · [`SegmentedControl`](#segmentedcontrol) · [`Dialog`](#dialog) · [`Menu`](#menu) · [`Checkbox`](#checkbox) · [`Switch`](#switch) · [`Disclosure`](#disclosure) · [`CopyButton`](#copybutton) · [`Tooltip`](#tooltip)
|
|
28
|
-
- **[Navigation and overlays](#navigation-and-overlays):** [`NavList`](#navlist) · [`Pagination`](#pagination) · [`Drawer`](#drawer) · [`CommandPalette`](#commandpalette) · [`Toaster`](#toaster)
|
|
29
|
+
- **[Navigation and overlays](#navigation-and-overlays):** [`NavList`](#navlist) · [`Pagination`](#pagination) · [`Drawer`](#drawer) · [`FullScreen`](#fullscreen) · [`CommandPalette`](#commandpalette) · [`Toaster`](#toaster)
|
|
29
30
|
- **[IDE shell](#ide-shell):** [`Workbench`](#workbench) · [`FileTree`](#filetree) · [`EditorTabs`](#editortabs) · [`Breadcrumbs`](#breadcrumbs) · [`StatusBar`](#statusbar) · [`MetricTile`](#metrictile) · [`Avatar`](#avatar) · [`AvatarGroup`](#avatargroup) · [`Countdown`](#countdown) · [`UmlClass`](#umlclass) · [`UmlDiagram`](#umldiagram)
|
|
30
31
|
5. [Mobile navigation](#mobile-navigation)
|
|
31
32
|
6. [Design tokens](#design-tokens)
|
|
@@ -37,6 +38,66 @@ Design-system components for [LLD Lab](https://lldlab.com), built for React 19 a
|
|
|
37
38
|
|
|
38
39
|
---
|
|
39
40
|
|
|
41
|
+
## What's new in 0.4.0
|
|
42
|
+
|
|
43
|
+
Layout additions for full-height and full-width screens. Nothing changed for existing props.
|
|
44
|
+
|
|
45
|
+
| Component | Added |
|
|
46
|
+
|---|---|
|
|
47
|
+
| `FullScreen` (new) | A modal surface over the whole viewport, for an IDE focus mode. See [`FullScreen`](#fullscreen). |
|
|
48
|
+
| `Box` | `height` (sm/md/lg/xl: 20, 28, 32, 40rem), `fill`, `grow` |
|
|
49
|
+
| `Stack` | `fill`, `grow` |
|
|
50
|
+
| `Card` | `fill` |
|
|
51
|
+
| `Container` | `size="full"` (no max width) |
|
|
52
|
+
|
|
53
|
+
## What's new in 0.3.0
|
|
54
|
+
|
|
55
|
+
A fidelity pass against the Stitch mockups. **Visual defaults changed**; the API only grew.
|
|
56
|
+
|
|
57
|
+
**Changed defaults**
|
|
58
|
+
|
|
59
|
+
- Surfaces separate by shadow, not borders: `Card` is `shadow-sm` with no border (add `outlined` for the hairline); `Card.Header` / `Card.Footer` are tinted bars with no rule (add `divider`).
|
|
60
|
+
- `AppBar` floats on a soft shadow (`divider="border"` restores the hairline).
|
|
61
|
+
- Tokens: `rounded` is 2px; `shadow-sm/md/lg/xl` use the lighter Tailwind v3 scale; `fg-brand` is `#2563EB`.
|
|
62
|
+
- `MetricTile`, boxed `ResultRow` and `Badge uppercase` drop their border / extra tracking; `Eyebrow` text takes its tone colour.
|
|
63
|
+
- Nav `Tabs` keep one font weight so the active item never shifts its neighbours.
|
|
64
|
+
|
|
65
|
+
**New props**
|
|
66
|
+
|
|
67
|
+
| Component | Added |
|
|
68
|
+
|---|---|
|
|
69
|
+
| `Card` | `shadow` (none/sm/md/xl), `outlined`, `gap`; `Card.Header`/`Footer`: `divider`, `density` (md/sm), `tone` (default/slate/none) |
|
|
70
|
+
| `AppBar` | `divider` (shadow/border) |
|
|
71
|
+
| `Section` | `paddingTop`, `paddingBottom` (spacing scale), `padding="none"`, `pattern="dots-brand"` |
|
|
72
|
+
| `Split` | `ratio` `7/5`, `5/7`; `breakpoint` (lg/xl); `asideAs` (aside/div) |
|
|
73
|
+
| `GridItem` | new: `span` (responsive column span) |
|
|
74
|
+
| `Show` | `above` / `below` `2xl` |
|
|
75
|
+
| `Heading` | `balance`, `leading="none"` |
|
|
76
|
+
| `Text` | `underline="wavy"` |
|
|
77
|
+
| `Eyebrow` | `variant` `tinted`, `dot` |
|
|
78
|
+
| `Tabs` | `variant` `nav` / `solid` / `label`; item `icon`, `countTone`, `disabled`, `title`, `hideBelow` |
|
|
79
|
+
| `SegmentedControl` | `variant="label"` (compact mono, for toolbars) |
|
|
80
|
+
| `Button` | `size` `xs` / `ms`; `variant` `raised` / `slate` |
|
|
81
|
+
| `IconButton` | `size="ms"` (36px) |
|
|
82
|
+
| `Badge` | `shape="pill"`, `outlined`, `size="xs"`, tones `subtle` / `container` |
|
|
83
|
+
| `TextField` | `variant` (outline/filled/raised), `size` `ms` / `lg`, `width` (auto/full/sm/md/lg), `iconPosition` |
|
|
84
|
+
| `Select` | `variant="raised"`, `size="lg"` |
|
|
85
|
+
| `Kbd` | `variant="raised"` |
|
|
86
|
+
| `Stat` | `variant="tile"`, `iconTone` |
|
|
87
|
+
| `MetricTile` | `variant="centered"` |
|
|
88
|
+
| `Box` | `tone="container"` |
|
|
89
|
+
| `Dot` / `Icon` | `size="lg"` (12px) / `size` `xs` (14px), `ms` (18px) |
|
|
90
|
+
| `Avatar` | `size` `ms` (32px), `ml` (40px) |
|
|
91
|
+
| `SectionHeader` | `divider`, `metaUppercase` |
|
|
92
|
+
| `EmptyState` | `headingLevel` (1–3) |
|
|
93
|
+
| `Checkbox` | `size="sm"` |
|
|
94
|
+
| `CodeBlock` | `bare`; dark blocks are now a dark theme scope |
|
|
95
|
+
| `Countdown` | `variant="chip"` |
|
|
96
|
+
| `StatusBar` | `tone="raised"` |
|
|
97
|
+
| `UmlClass` | `variant="tinted"`, `headerTone`, `columns` |
|
|
98
|
+
|
|
99
|
+
<sub>[↑ Back to top](#table-of-contents)</sub>
|
|
100
|
+
|
|
40
101
|
## Install
|
|
41
102
|
|
|
42
103
|
```bash
|
|
@@ -296,6 +357,7 @@ In the tables, **Req.** marks required props, and the default is given where one
|
|
|
296
357
|
| [`NavList`](#navlist) | Navigation and overlays | Sidebar / table of contents |
|
|
297
358
|
| [`Pagination`](#pagination) | Navigation and overlays | Page navigation |
|
|
298
359
|
| [`Drawer`](#drawer) | Navigation and overlays | Slide-over panel (mobile nav) |
|
|
360
|
+
| [`FullScreen`](#fullscreen) | Navigation and overlays | Modal surface over the whole viewport (IDE focus mode) |
|
|
299
361
|
| [`CommandPalette`](#commandpalette) | Navigation and overlays | ⌘K search palette |
|
|
300
362
|
| [`Toaster`](#toaster) | Navigation and overlays | Toast notifications (useToast) |
|
|
301
363
|
| [`Workbench`](#workbench) | IDE shell | Resizable IDE layout |
|
|
@@ -339,6 +401,9 @@ A generic surface. Polymorphic, default `div`.
|
|
|
339
401
|
| `border` | `'none' \| 'subtle' \| 'strong'` | `'none'` |
|
|
340
402
|
| `shadow` | `'none' \| 'sm' \| 'md'` | `'none'` |
|
|
341
403
|
| `dimmed` | `boolean`: greys the content out and makes it `inert` (for example, a panel waiting on a runtime) | `false` |
|
|
404
|
+
| `height` | `'sm' \| 'md' \| 'lg' \| 'xl'`: fixed height of 20, 28, 32 or 40rem | none |
|
|
405
|
+
| `fill` | `boolean`: takes the parent's full height | `false` |
|
|
406
|
+
| `grow` | `boolean`: takes the space left in a flex column (for example, an editor under a tab bar) | `false` |
|
|
342
407
|
|
|
343
408
|
`tone="inverse"` also switches its contents to the dark tokens (`data-theme="dark"`), so text and badges inside stay readable.
|
|
344
409
|
|
|
@@ -357,6 +422,8 @@ A flex row or column. Polymorphic, default `div`.
|
|
|
357
422
|
| `align` | `Responsive<Align>` | none |
|
|
358
423
|
| `justify` | `Responsive<Justify>` | none |
|
|
359
424
|
| `wrap` | `boolean` | `false` |
|
|
425
|
+
| `fill` | `boolean`: takes the parent's full height | `false` |
|
|
426
|
+
| `grow` | `boolean`: takes the space left in a flex column | `false` |
|
|
360
427
|
|
|
361
428
|
```tsx
|
|
362
429
|
<Stack direction={{ base: 'column', md: 'row' }} gap="sm" align="center" justify="between" wrap>…</Stack>
|
|
@@ -384,7 +451,7 @@ A centred, max-width page column with fluid side gutters (1rem up to 2rem). Poly
|
|
|
384
451
|
|
|
385
452
|
| Prop | Type | Default |
|
|
386
453
|
|---|---|---|
|
|
387
|
-
| `size` | `'md' \| 'lg' \| 'xl'`: 48rem, 64rem, 80rem max width | `'xl'` |
|
|
454
|
+
| `size` | `'md' \| 'lg' \| 'xl' \| 'full'`: 48rem, 64rem, 80rem max width, or none (`full`, for example a coding workspace) | `'xl'` |
|
|
388
455
|
|
|
389
456
|
#### `Section`
|
|
390
457
|
|
|
@@ -746,6 +813,7 @@ A bordered, rounded surface. Polymorphic, default `div`.
|
|
|
746
813
|
| `tone` | `'default' \| 'subtle' \| 'inverse'` (`inverse` is a dark obsidian card that also switches its contents to the dark tokens) | `'default'` |
|
|
747
814
|
| `pattern` | `'none' \| 'dots' \| 'grid'`: background pattern | `'none'` |
|
|
748
815
|
| `interactive` | `boolean`: hover shadow and focus ring, for link cards | `false` |
|
|
816
|
+
| `fill` | `boolean`: takes the parent's full height; the body can shrink, so a `grow` child (an editor) fits | `false` |
|
|
749
817
|
|
|
750
818
|
Sub-components:
|
|
751
819
|
|
|
@@ -1188,6 +1256,24 @@ A modal slide-over panel, for example the mobile navigation. It has the same foc
|
|
|
1188
1256
|
| `size` | `'sm' \| 'md'` | `'sm'` |
|
|
1189
1257
|
| `children` | `ReactNode` | none |
|
|
1190
1258
|
|
|
1259
|
+
#### `FullScreen`
|
|
1260
|
+
|
|
1261
|
+
A modal surface over the whole viewport, for example an IDE in focus mode. It has the same focus trap, Escape, scroll lock, focus restore and theme behaviour as `Dialog`. Escape closes it unless a widget inside already handled the key (an editor closing its suggestions calls `preventDefault`). Its children fill it: use a `Workbench`, or give the child `fill`.
|
|
1262
|
+
|
|
1263
|
+
| Prop | Type | Default |
|
|
1264
|
+
|---|---|---|
|
|
1265
|
+
| `open` **Req.** | `boolean` | none |
|
|
1266
|
+
| `onClose` **Req.** | `() => void` | none |
|
|
1267
|
+
| `label` **Req.** | `string`: accessible name | none |
|
|
1268
|
+
| `initialFocusRef` | `RefObject<HTMLElement \| null>`: element to focus on open | first focusable |
|
|
1269
|
+
| `children` | `ReactNode` | none |
|
|
1270
|
+
|
|
1271
|
+
```tsx
|
|
1272
|
+
<FullScreen open={focus} onClose={() => setFocus(false)} label="Workspace" initialFocusRef={exitRef}>
|
|
1273
|
+
<Workbench header={…} left={…} main={…} bottom={…} />
|
|
1274
|
+
</FullScreen>
|
|
1275
|
+
```
|
|
1276
|
+
|
|
1191
1277
|
#### `CommandPalette`
|
|
1192
1278
|
|
|
1193
1279
|
A ⌘K search palette: a dialog with a combobox over grouped results. You do the filtering: pass the matching `groups` for the current `query`. Up and Down move through results, Enter selects and closes, and Escape closes.
|
|
@@ -1452,7 +1538,7 @@ Every token under Surfaces, Text, Status text, Borders and Badges changes inside
|
|
|
1452
1538
|
- **Interactive widgets:** they follow the WAI-ARIA Authoring Practices.
|
|
1453
1539
|
- `Tabs` is a tablist, `SegmentedControl` a radio group, and `Menu` a menu button.
|
|
1454
1540
|
- `FileTree` is a tree view, and the `Workbench` resize handles are separators with values.
|
|
1455
|
-
- `Dialog`, `Drawer` and `CommandPalette` are modal dialogs; `CommandPalette` uses the combobox pattern.
|
|
1541
|
+
- `Dialog`, `Drawer`, `FullScreen` and `CommandPalette` are modal dialogs; `CommandPalette` uses the combobox pattern.
|
|
1456
1542
|
- `Disclosure` is a disclosure button, `Switch` a switch, `Tooltip` a tooltip, and `Timeline` marks the current step.
|
|
1457
1543
|
- **Accessible names:** icon-only controls require a `label` (`IconButton`), and status icons have names (`ResultRow`).
|
|
1458
1544
|
- **Focus and touch:** focus rings are visible on keyboard focus, and touch targets are at least 44px below `md`.
|