lino-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/AGENTS.md +216 -0
- package/README.md +29 -2
- package/bin/lino.js +168 -0
- package/docs/agents.md +230 -0
- package/docs/button-group.md +76 -0
- package/docs/button.md +117 -0
- package/docs/colors.md +72 -0
- package/docs/dialog.md +109 -0
- package/docs/dropdown-menu.md +201 -0
- package/docs/icons.md +20 -0
- package/docs/input.md +95 -0
- package/docs/introduction.md +45 -0
- package/docs/kbd.md +61 -0
- package/docs/label.md +38 -0
- package/docs/llms-full.txt +2257 -0
- package/docs/llms.txt +66 -0
- package/docs/menubar.md +82 -0
- package/docs/picture.md +66 -0
- package/docs/plaque.md +49 -0
- package/docs/principles.md +100 -0
- package/docs/separator.md +45 -0
- package/docs/slider.md +89 -0
- package/docs/sounds.md +7 -0
- package/docs/spinner.md +48 -0
- package/docs/surfaces.md +20 -0
- package/docs/switch.md +62 -0
- package/docs/tag.md +54 -0
- package/docs/toggle-group.md +102 -0
- package/docs/toggle.md +51 -0
- package/docs/toolbar.md +88 -0
- package/docs/tooltip.md +75 -0
- package/docs/typography.md +21 -0
- package/fonts/alegreya-sans-sc-cyrillic-500-normal.woff2 +0 -0
- package/fonts/alegreya-sans-sc-cyrillic-700-normal.woff2 +0 -0
- package/fonts/alegreya-sans-sc-cyrillic-800-normal.woff2 +0 -0
- package/fonts/alegreya-sans-sc-latin-500-normal.woff2 +0 -0
- package/fonts/alegreya-sans-sc-latin-700-normal.woff2 +0 -0
- package/fonts/alegreya-sans-sc-latin-800-normal.woff2 +0 -0
- package/fonts/inter-cyrillic-wght-normal.woff2 +0 -0
- package/fonts/inter-latin-wght-normal.woff2 +0 -0
- package/fonts/td-volshebstvo.woff2 +0 -0
- package/package.json +65 -4
- package/site/apple-touch-icon.png +0 -0
- package/site/assets/accent-click-1-C4yMKlL7.mp3 +0 -0
- package/site/assets/accent-click-2-Dn01blTK.mp3 +0 -0
- package/site/assets/accent-hover-1-DX_94LsD.mp3 +0 -0
- package/site/assets/accent-hover-2-CwkP6tLp.mp3 +0 -0
- package/site/assets/accent-hover-3-EqmGpEzM.mp3 +0 -0
- package/site/assets/index-BgVvspgp.css +1 -0
- package/site/assets/index-DGqYYe1O.js +1102 -0
- package/site/assets/owl-1-DMSClExH.mp3 +0 -0
- package/site/assets/owl-2-DadTAnqX.mp3 +0 -0
- package/site/assets/send-click-1-D8oZSriI.mp3 +0 -0
- package/site/assets/send-click-2-Cuq0Ywc4.mp3 +0 -0
- package/site/assets/small-click-B71aagwY.mp3 +0 -0
- package/site/assets/support-accent-BUGjkaKV.mp3 +0 -0
- package/site/assets/view-close-CW4FuJmT.mp3 +0 -0
- package/site/assets/view-open-yAP5VPW3.mp3 +0 -0
- package/site/ds/agents/llms.txt +230 -0
- package/site/ds/button/llms.txt +117 -0
- package/site/ds/button-group/llms.txt +76 -0
- package/site/ds/colors/llms.txt +72 -0
- package/site/ds/dialog/llms.txt +109 -0
- package/site/ds/dropdown-menu/llms.txt +201 -0
- package/site/ds/icons/llms.txt +20 -0
- package/site/ds/input/llms.txt +95 -0
- package/site/ds/introduction/llms.txt +45 -0
- package/site/ds/kbd/llms.txt +61 -0
- package/site/ds/label/llms.txt +38 -0
- package/site/ds/llms-full.txt +2257 -0
- package/site/ds/llms.txt +66 -0
- package/site/ds/menubar/llms.txt +82 -0
- package/site/ds/picture/llms.txt +66 -0
- package/site/ds/plaque/llms.txt +49 -0
- package/site/ds/principles/llms.txt +100 -0
- package/site/ds/separator/llms.txt +45 -0
- package/site/ds/skills/lino-texture/SKILL.md +73 -0
- package/site/ds/skills/lino-texture/references/nslice.md +116 -0
- package/site/ds/skills/lino-texture/references/texture.md +74 -0
- package/site/ds/skills/lino-ui/SKILL.md +49 -0
- package/site/ds/slider/llms.txt +89 -0
- package/site/ds/sounds/llms.txt +7 -0
- package/site/ds/spinner/llms.txt +48 -0
- package/site/ds/surfaces/llms.txt +20 -0
- package/site/ds/switch/llms.txt +62 -0
- package/site/ds/tag/llms.txt +54 -0
- package/site/ds/toggle/llms.txt +51 -0
- package/site/ds/toggle-group/llms.txt +102 -0
- package/site/ds/toolbar/llms.txt +88 -0
- package/site/ds/tooltip/llms.txt +75 -0
- package/site/ds/typography/llms.txt +21 -0
- package/site/favicon-16x16.png +0 -0
- package/site/favicon-32x32.png +0 -0
- package/site/favicon.ico +0 -0
- package/site/fonts/alegreya-sans-sc-cyrillic-500-normal.woff2 +0 -0
- package/site/fonts/alegreya-sans-sc-cyrillic-700-normal.woff2 +0 -0
- package/site/fonts/alegreya-sans-sc-cyrillic-800-normal.woff2 +0 -0
- package/site/fonts/alegreya-sans-sc-latin-500-normal.woff2 +0 -0
- package/site/fonts/alegreya-sans-sc-latin-700-normal.woff2 +0 -0
- package/site/fonts/alegreya-sans-sc-latin-800-normal.woff2 +0 -0
- package/site/fonts/inter-cyrillic-wght-normal.woff2 +0 -0
- package/site/fonts/inter-latin-wght-normal.woff2 +0 -0
- package/site/fonts/td-volshebstvo.woff2 +0 -0
- package/site/icon-192.png +0 -0
- package/site/icon-512.png +0 -0
- package/site/index.html +19 -0
- package/site/map/avatars/bsodpanic.jpg +0 -0
- package/site/map/avatars/uberalien.jpg +0 -0
- package/site/map/avatars/xm1ller.jpg +0 -0
- package/site/site.webmanifest +11 -0
- package/skills/lino-texture/SKILL.md +73 -0
- package/skills/lino-texture/references/nslice.md +116 -0
- package/skills/lino-texture/references/texture.md +74 -0
- package/skills/lino-ui/SKILL.md +49 -0
- package/src/ds/PRINCIPLES.md +98 -0
- package/src/ds/art/plaque-art.js +2 -0
- package/src/ds/icon-bake.js +39 -0
- package/src/ds/icon.js +47 -0
- package/src/ds/icons/paths.js +28 -0
- package/src/ds/keys.js +40 -0
- package/src/ds/nslice.js +204 -0
- package/src/ds/rough.js +117 -0
- package/src/ds/sounds/accent-click-1.mp3 +0 -0
- package/src/ds/sounds/accent-click-2.mp3 +0 -0
- package/src/ds/sounds/accent-hover-1.mp3 +0 -0
- package/src/ds/sounds/accent-hover-2.mp3 +0 -0
- package/src/ds/sounds/accent-hover-3.mp3 +0 -0
- package/src/ds/sounds/owl-1.mp3 +0 -0
- package/src/ds/sounds/owl-2.mp3 +0 -0
- package/src/ds/sounds/send-click-1.mp3 +0 -0
- package/src/ds/sounds/send-click-2.mp3 +0 -0
- package/src/ds/sounds/small-click.mp3 +0 -0
- package/src/ds/sounds/small-hover.mp3 +0 -0
- package/src/ds/sounds/support-accent.mp3 +0 -0
- package/src/ds/sounds/view-close.mp3 +0 -0
- package/src/ds/sounds/view-open.mp3 +0 -0
- package/src/ds/sounds.js +234 -0
- package/src/ds/texture.js +379 -0
- package/src/ds/tier.js +165 -0
- package/src/lib/components/ui/button/button.svelte +49 -0
- package/src/lib/components/ui/button/index.js +13 -0
- package/src/lib/components/ui/button-group/button-group.svelte +11 -0
- package/src/lib/components/ui/button-group/index.js +7 -0
- package/src/lib/components/ui/dialog/dialog-close.svelte +11 -0
- package/src/lib/components/ui/dialog/dialog-content.svelte +40 -0
- package/src/lib/components/ui/dialog/dialog-description.svelte +17 -0
- package/src/lib/components/ui/dialog/dialog-footer.svelte +30 -0
- package/src/lib/components/ui/dialog/dialog-header.svelte +18 -0
- package/src/lib/components/ui/dialog/dialog-overlay.svelte +18 -0
- package/src/lib/components/ui/dialog/dialog-portal.svelte +7 -0
- package/src/lib/components/ui/dialog/dialog-title.svelte +17 -0
- package/src/lib/components/ui/dialog/dialog-trigger.svelte +11 -0
- package/src/lib/components/ui/dialog/dialog.svelte +7 -0
- package/src/lib/components/ui/dialog/index.js +34 -0
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-checkbox-group.svelte +16 -0
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte +30 -0
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-content.svelte +34 -0
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-group-heading.svelte +18 -0
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-group.svelte +7 -0
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-item.svelte +25 -0
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-label.svelte +20 -0
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-portal.svelte +7 -0
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-radio-group.svelte +16 -0
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-radio-item.svelte +26 -0
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-separator.svelte +17 -0
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-shortcut.svelte +18 -0
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-sub-content.svelte +29 -0
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte +25 -0
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-sub.svelte +7 -0
- package/src/lib/components/ui/dropdown-menu/dropdown-menu-trigger.svelte +7 -0
- package/src/lib/components/ui/dropdown-menu/dropdown-menu.svelte +7 -0
- package/src/lib/components/ui/dropdown-menu/index.js +54 -0
- package/src/lib/components/ui/input/index.js +7 -0
- package/src/lib/components/ui/input/input.svelte +19 -0
- package/src/lib/components/ui/kbd/index.js +10 -0
- package/src/lib/components/ui/kbd/kbd-group.svelte +18 -0
- package/src/lib/components/ui/kbd/kbd.svelte +22 -0
- package/src/lib/components/ui/label/index.js +7 -0
- package/src/lib/components/ui/label/label.svelte +17 -0
- package/src/lib/components/ui/menubar/index.js +55 -0
- package/src/lib/components/ui/menubar/menubar-checkbox-item.svelte +32 -0
- package/src/lib/components/ui/menubar/menubar-content.svelte +33 -0
- package/src/lib/components/ui/menubar/menubar-group-heading.svelte +18 -0
- package/src/lib/components/ui/menubar/menubar-group.svelte +10 -0
- package/src/lib/components/ui/menubar/menubar-item.svelte +25 -0
- package/src/lib/components/ui/menubar/menubar-label.svelte +20 -0
- package/src/lib/components/ui/menubar/menubar-menu.svelte +7 -0
- package/src/lib/components/ui/menubar/menubar-portal.svelte +7 -0
- package/src/lib/components/ui/menubar/menubar-radio-group.svelte +11 -0
- package/src/lib/components/ui/menubar/menubar-radio-item.svelte +28 -0
- package/src/lib/components/ui/menubar/menubar-separator.svelte +17 -0
- package/src/lib/components/ui/menubar/menubar-shortcut.svelte +18 -0
- package/src/lib/components/ui/menubar/menubar-sub-content.svelte +29 -0
- package/src/lib/components/ui/menubar/menubar-sub-trigger.svelte +25 -0
- package/src/lib/components/ui/menubar/menubar-sub.svelte +7 -0
- package/src/lib/components/ui/menubar/menubar-trigger.svelte +18 -0
- package/src/lib/components/ui/menubar/menubar.svelte +17 -0
- package/src/lib/components/ui/picture/index.js +7 -0
- package/src/lib/components/ui/picture/picture.svelte +21 -0
- package/src/lib/components/ui/plaque/index.js +7 -0
- package/src/lib/components/ui/plaque/plaque.svelte +16 -0
- package/src/lib/components/ui/separator/index.js +7 -0
- package/src/lib/components/ui/separator/separator.svelte +19 -0
- package/src/lib/components/ui/slider/index.js +7 -0
- package/src/lib/components/ui/slider/slider.svelte +31 -0
- package/src/lib/components/ui/spinner/index.js +1 -0
- package/src/lib/components/ui/spinner/spinner.svelte +16 -0
- package/src/lib/components/ui/swatch/index.js +10 -0
- package/src/lib/components/ui/swatch/swatch-group.svelte +21 -0
- package/src/lib/components/ui/swatch/swatch.svelte +32 -0
- package/src/lib/components/ui/switch/index.js +7 -0
- package/src/lib/components/ui/switch/switch.svelte +23 -0
- package/src/lib/components/ui/tag/index.js +7 -0
- package/src/lib/components/ui/tag/tag.svelte +11 -0
- package/src/lib/components/ui/toggle/index.js +11 -0
- package/src/lib/components/ui/toggle/toggle.svelte +28 -0
- package/src/lib/components/ui/toggle-group/index.js +10 -0
- package/src/lib/components/ui/toggle-group/toggle-group-item.svelte +29 -0
- package/src/lib/components/ui/toggle-group/toggle-group.svelte +82 -0
- package/src/lib/components/ui/toolbar/index.js +7 -0
- package/src/lib/components/ui/toolbar/toolbar.svelte +26 -0
- package/src/lib/components/ui/tooltip/index.js +19 -0
- package/src/lib/components/ui/tooltip/tooltip-content.svelte +44 -0
- package/src/lib/components/ui/tooltip/tooltip-portal.svelte +7 -0
- package/src/lib/components/ui/tooltip/tooltip-provider.svelte +7 -0
- package/src/lib/components/ui/tooltip/tooltip-trigger.svelte +7 -0
- package/src/lib/components/ui/tooltip/tooltip.svelte +7 -0
- package/src/lib/cut.js +12 -0
- package/src/lib/index.js +8 -0
- package/src/lib/lino.css +324 -0
- package/src/lib/press.js +40 -0
- package/src/lib/setup.js +7 -0
- package/src/lib/surfaces.js +3 -0
- package/src/lib/utils.js +7 -0
- package/styles.css +2 -0
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# Button Group
|
|
2
|
+
|
|
3
|
+
Panel buttons joined into one plate: each lies on the one before, its fill over the shared border, so the seam is one hand-cut line.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```js
|
|
8
|
+
import { ButtonGroup } from "lino-ui/button-group";
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
```svelte
|
|
12
|
+
<ButtonGroup aria-label="Actions">
|
|
13
|
+
<Button variant="panel" size="icon-lg" aria-label="Search">{@html icon("search")}</Button>
|
|
14
|
+
<Button variant="panel" size="icon-lg" aria-label="Notifications">{@html icon("bell")}</Button>
|
|
15
|
+
</ButtonGroup>
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Examples
|
|
19
|
+
|
|
20
|
+
```svelte
|
|
21
|
+
<script>
|
|
22
|
+
import { ButtonGroup } from "lino-ui/button-group";
|
|
23
|
+
import { Button } from "lino-ui/button";
|
|
24
|
+
import { icon } from "lino-ui";
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<ButtonGroup aria-label="Actions">
|
|
28
|
+
<Button variant="panel" size="icon-lg" aria-label="Search">{@html icon("search")}</Button>
|
|
29
|
+
<Button variant="panel" size="icon-lg" aria-label="Notifications">{@html icon("bell")}</Button>
|
|
30
|
+
</ButtonGroup>
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
A pair of tiles: search and notifications.
|
|
34
|
+
|
|
35
|
+
### With labels
|
|
36
|
+
|
|
37
|
+
```svelte
|
|
38
|
+
<script>
|
|
39
|
+
import { ButtonGroup } from "lino-ui/button-group";
|
|
40
|
+
import { Button } from "lino-ui/button";
|
|
41
|
+
</script>
|
|
42
|
+
|
|
43
|
+
<ButtonGroup aria-label="Board">
|
|
44
|
+
<Button variant="panel">Share</Button>
|
|
45
|
+
<Button variant="panel">Duplicate</Button>
|
|
46
|
+
<Button variant="panel">Delete</Button>
|
|
47
|
+
</ButtonGroup>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Vertical
|
|
51
|
+
|
|
52
|
+
```svelte
|
|
53
|
+
<script>
|
|
54
|
+
import { ButtonGroup } from "lino-ui/button-group";
|
|
55
|
+
import { Button } from "lino-ui/button";
|
|
56
|
+
import { icon } from "lino-ui";
|
|
57
|
+
</script>
|
|
58
|
+
|
|
59
|
+
<ButtonGroup orientation="vertical" aria-label="Zoom">
|
|
60
|
+
<Button variant="panel" size="icon" aria-label="Zoom in">{@html icon("plus")}</Button>
|
|
61
|
+
<Button variant="panel" size="icon" aria-label="Zoom out">{@html icon("caret")}</Button>
|
|
62
|
+
</ButtonGroup>
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## API reference
|
|
66
|
+
|
|
67
|
+
### ButtonGroup
|
|
68
|
+
|
|
69
|
+
| Prop | Type | Default | Description |
|
|
70
|
+
|---|---|---|---|
|
|
71
|
+
| `orientation` | `"horizontal" \| "vertical"` | `"horizontal"` | A set: a press shrinks a button's content, not its plate |
|
|
72
|
+
| `aria-label` | `string` | — | What the set is for |
|
|
73
|
+
| `class` | `string` | — | More classes; the look itself is lino.css |
|
|
74
|
+
| `ref` | `HTMLElement` | — | Bindable: the element |
|
|
75
|
+
|
|
76
|
+
Import it from `lino-ui/button-group`. Its source, in the package: `src/lib/components/ui/button-group`; its look: `src/lib/lino.css`.
|
package/docs/button.md
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# Button
|
|
2
|
+
|
|
3
|
+
The action control. Four plates for four jobs; a link when given href.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```js
|
|
8
|
+
import { Button } from "lino-ui/button";
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
```svelte
|
|
12
|
+
<Button variant="accent">Publish</Button>
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Examples
|
|
16
|
+
|
|
17
|
+
```svelte
|
|
18
|
+
<script>
|
|
19
|
+
import { Button } from "lino-ui/button";
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<Button>Open board</Button>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Variants
|
|
26
|
+
|
|
27
|
+
action on a surface, panel straight on the paper (it brings its white plate and border), accent for the one primary action, ghost for the quiet ones.
|
|
28
|
+
|
|
29
|
+
```svelte
|
|
30
|
+
<script>
|
|
31
|
+
import { Button } from "lino-ui/button";
|
|
32
|
+
</script>
|
|
33
|
+
|
|
34
|
+
<Button>Action</Button>
|
|
35
|
+
<Button variant="panel">Panel</Button>
|
|
36
|
+
<Button variant="accent">Accent</Button>
|
|
37
|
+
<Button variant="ghost">Ghost</Button>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Sizes
|
|
41
|
+
|
|
42
|
+
```svelte
|
|
43
|
+
<script>
|
|
44
|
+
import { Button } from "lino-ui/button";
|
|
45
|
+
</script>
|
|
46
|
+
|
|
47
|
+
<Button>Default</Button>
|
|
48
|
+
<Button size="sm">Small</Button>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### With an icon
|
|
52
|
+
|
|
53
|
+
Beside a label the icon is thickened to weigh like the bold text.
|
|
54
|
+
|
|
55
|
+
```svelte
|
|
56
|
+
<script>
|
|
57
|
+
import { Button } from "lino-ui/button";
|
|
58
|
+
import { icon } from "lino-ui";
|
|
59
|
+
</script>
|
|
60
|
+
|
|
61
|
+
<Button>{@html icon("plus")}<span>New card</span></Button>
|
|
62
|
+
<Button variant="accent"><span>Continue</span>{@html icon("fwd")}</Button>
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Icon only
|
|
66
|
+
|
|
67
|
+
A square of the button's height: icon-sm 32px, icon 40px, icon-lg 56px. The glyph is 55% of the side and weighs like a bold label. Name it with aria-label.
|
|
68
|
+
|
|
69
|
+
```svelte
|
|
70
|
+
<script>
|
|
71
|
+
import { Button } from "lino-ui/button";
|
|
72
|
+
import { icon } from "lino-ui";
|
|
73
|
+
</script>
|
|
74
|
+
|
|
75
|
+
<Button size="icon-sm" aria-label="Back">{@html icon("back")}</Button>
|
|
76
|
+
<Button size="icon" aria-label="Search">{@html icon("search")}</Button>
|
|
77
|
+
<Button size="icon" variant="panel" aria-label="Add a card">{@html icon("plus")}</Button>
|
|
78
|
+
<Button size="icon-lg" variant="accent" aria-label="Send">{@html icon("send")}</Button>
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Disabled
|
|
82
|
+
|
|
83
|
+
```svelte
|
|
84
|
+
<script>
|
|
85
|
+
import { Button } from "lino-ui/button";
|
|
86
|
+
</script>
|
|
87
|
+
|
|
88
|
+
<Button disabled>Open board</Button>
|
|
89
|
+
<Button variant="accent" disabled>Publish</Button>
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Link
|
|
93
|
+
|
|
94
|
+
```svelte
|
|
95
|
+
<script>
|
|
96
|
+
import { Button } from "lino-ui/button";
|
|
97
|
+
</script>
|
|
98
|
+
|
|
99
|
+
<Button href="#/introduction" variant="panel">Read the introduction</Button>
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## API reference
|
|
103
|
+
|
|
104
|
+
### Button
|
|
105
|
+
|
|
106
|
+
| Prop | Type | Default | Description |
|
|
107
|
+
|---|---|---|---|
|
|
108
|
+
| `variant` | `"action" \| "panel" \| "accent" \| "ghost"` | `"action"` | The plate |
|
|
109
|
+
| `size` | `"default" \| "sm" \| "icon" \| "icon-sm" \| "icon-lg"` | `"default"` | 40px high, 32px, or a square of either; icon-lg is the 56px tile |
|
|
110
|
+
| `href` | `string` | — | Renders an <a> |
|
|
111
|
+
| `type` | `"button" \| "submit" \| "reset"` | `"button"` | |
|
|
112
|
+
| `disabled` | `boolean` | `false` | |
|
|
113
|
+
| `aria-pressed` | `boolean` | — | Full ink while true, like a held key (Toggle sets it) |
|
|
114
|
+
| `class` | `string` | — | More classes; the look itself is lino.css |
|
|
115
|
+
| `ref` | `HTMLElement` | — | Bindable: the element |
|
|
116
|
+
|
|
117
|
+
Import it from `lino-ui/button`. Its source, in the package: `src/lib/components/ui/button`; its look: `src/lib/lino.css`.
|
package/docs/colors.md
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# Colors
|
|
2
|
+
|
|
3
|
+
The base colours, read live from the kit's tokens. Hover, pressed and tints are mixed from them where they are used.
|
|
4
|
+
|
|
5
|
+
## color
|
|
6
|
+
|
|
7
|
+
| Token | Value | Use |
|
|
8
|
+
|---|---|---|
|
|
9
|
+
| `--color-background` | `hsl(50 20% 94.1%)` | paper: page and canvas |
|
|
10
|
+
| `--color-text` | `hsl(0 13.2% 14.9%)` | ink |
|
|
11
|
+
| `--color-surface` | `hsl(0 0% 100%)` | menus, panels |
|
|
12
|
+
| `--color-action-background` | `hsl(40 20% 97.1%)` | |
|
|
13
|
+
| `--color-action-text` | `hsl(30 2.4% 16.1%)` | |
|
|
14
|
+
| `--color-accent` | `hsl(21.5 100% 58.4%)` | boosty orange: focus ring, selection, primary |
|
|
15
|
+
| `--color-highlight` | `hsl(42.6 93.2% 53.5%)` | video action |
|
|
16
|
+
| `--color-muted` | `hsl(24 12.1% 58%)` | captions, secondary text |
|
|
17
|
+
| `--color-link` | `hsl(21.9 61.8% 33.9%)` | |
|
|
18
|
+
| `--color-divider` | `hsl(50 12.5% 90.6%)` | |
|
|
19
|
+
|
|
20
|
+
## borders
|
|
21
|
+
|
|
22
|
+
| Token | Value | Use |
|
|
23
|
+
|---|---|---|
|
|
24
|
+
| `--color-border` | `hsl(var(--border-hue) var(--border-saturation) var(--border-lightness))` | |
|
|
25
|
+
| `--color-border-strong` | `hsl(var(--border-hue) var(--border-saturation) var(--border-lightness-strong))` | |
|
|
26
|
+
|
|
27
|
+
## card palette
|
|
28
|
+
|
|
29
|
+
| Token | Value | Use |
|
|
30
|
+
|---|---|---|
|
|
31
|
+
| `--color-rust` | `hsl(19.6 56% 31.2%)` | |
|
|
32
|
+
| `--color-wine` | `hsl(0 37% 35.5%)` | |
|
|
33
|
+
| `--color-amber` | `hsl(38 92.3% 45.7%)` | |
|
|
34
|
+
| `--color-teal` | `hsl(184.5 75% 31.4%)` | |
|
|
35
|
+
| `--color-night` | `hsl(214.8 58.5% 10.4%)` | |
|
|
36
|
+
| `--color-sky` | `hsl(213.3 79.7% 72.9%)` | |
|
|
37
|
+
|
|
38
|
+
## tiers
|
|
39
|
+
|
|
40
|
+
| Token | Value | Use |
|
|
41
|
+
|---|---|---|
|
|
42
|
+
| `--tier-0-bg` | `hsl(49 18% 88%)` | |
|
|
43
|
+
| `--tier-0-frame` | `hsl(36.4 11.7% 52.9%)` | |
|
|
44
|
+
| `--tier-0-ink` | `hsl(36.3 20.4% 41.4%)` | |
|
|
45
|
+
| `--tier-1-bg` | `hsl(22.9 96.9% 37.6%)` | |
|
|
46
|
+
| `--tier-1-frame` | `hsl(30 56% 9.8%)` | |
|
|
47
|
+
| `--tier-1-ink` | `hsl(0 0% 100%)` | |
|
|
48
|
+
| `--tier-2-bg` | `hsl(38 96.2% 58.8%)` | |
|
|
49
|
+
| `--tier-2-frame` | `hsl(30 56% 9.8%)` | |
|
|
50
|
+
| `--tier-2-ink` | `hsl(30 56% 9.8%)` | |
|
|
51
|
+
|
|
52
|
+
## the overview map's chrome
|
|
53
|
+
|
|
54
|
+
| Token | Value | Use |
|
|
55
|
+
|---|---|---|
|
|
56
|
+
| `--map-paper` | `hsl(49.1 18% 88%)` | #e6e4db: the map's paper |
|
|
57
|
+
| `--map-line` | `hsl(38.2 15.9% 72.9%)` | #c5bdaf: a map button's border |
|
|
58
|
+
| `--map-ink` | `hsl(30 10% 56.9%)` | #9c9186: a map button's glyph |
|
|
59
|
+
| `--map-title` | `hsl(18.5 100% 42%)` | #d64200: the title's letters' outline |
|
|
60
|
+
| `--map-title-back` | `hsl(10.8 100% 26.1%)` | #851800: the title's backing, inside the letters too |
|
|
61
|
+
|
|
62
|
+
## canvas
|
|
63
|
+
|
|
64
|
+
| Token | Value | Use |
|
|
65
|
+
|---|---|---|
|
|
66
|
+
| `--canvas-background` | `var(--color-background)` | |
|
|
67
|
+
| `--canvas-dot` | `hsl(0 13.2% 14.9% / 6%)` | |
|
|
68
|
+
| `--canvas-block` | `hsl(42 16.7% 88.2%)` | |
|
|
69
|
+
| `--canvas-ink` | `hsl(38 16.9% 37.3%)` | ink on a canvas block: the web window's title and bar icons (Figma #6f634f) |
|
|
70
|
+
| `--canvas-selection` | `var(--color-accent)` | |
|
|
71
|
+
|
|
72
|
+
A hover, pressed or tint is mixed where it is used: `color-mix(in srgb, var(--color-text) 6%, transparent)`.
|
package/docs/dialog.md
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# Dialog
|
|
2
|
+
|
|
3
|
+
A panel over the veiled paper that holds the focus until it closes.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```js
|
|
8
|
+
import * as Dialog from "lino-ui/dialog";
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
```svelte
|
|
12
|
+
<Dialog.Root>
|
|
13
|
+
<Dialog.Trigger>Open</Dialog.Trigger>
|
|
14
|
+
<Dialog.Content>
|
|
15
|
+
<Dialog.Header>
|
|
16
|
+
<Dialog.Title>Rename the board</Dialog.Title>
|
|
17
|
+
<Dialog.Description>Everyone with the link sees the new name.</Dialog.Description>
|
|
18
|
+
</Dialog.Header>
|
|
19
|
+
<Dialog.Footer>…</Dialog.Footer>
|
|
20
|
+
</Dialog.Content>
|
|
21
|
+
</Dialog.Root>
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Examples
|
|
25
|
+
|
|
26
|
+
```svelte
|
|
27
|
+
<script>
|
|
28
|
+
import * as Dialog from "lino-ui/dialog";
|
|
29
|
+
import { Button } from "lino-ui/button";
|
|
30
|
+
import { Input } from "lino-ui/input";
|
|
31
|
+
import { Label } from "lino-ui/label";
|
|
32
|
+
|
|
33
|
+
let open = $state(false);
|
|
34
|
+
let name = $state("Moodboard");
|
|
35
|
+
</script>
|
|
36
|
+
|
|
37
|
+
<Dialog.Root bind:open>
|
|
38
|
+
<Dialog.Trigger>
|
|
39
|
+
{#snippet child({ props })}<Button {...props} variant="panel">Rename</Button>{/snippet}
|
|
40
|
+
</Dialog.Trigger>
|
|
41
|
+
<Dialog.Content>
|
|
42
|
+
<Dialog.Header>
|
|
43
|
+
<Dialog.Title>Rename the board</Dialog.Title>
|
|
44
|
+
<Dialog.Description>Everyone with the link sees the new name.</Dialog.Description>
|
|
45
|
+
</Dialog.Header>
|
|
46
|
+
<div class="ds-field">
|
|
47
|
+
<Label for="board-name">Name</Label>
|
|
48
|
+
<Input id="board-name" bind:value={name} />
|
|
49
|
+
</div>
|
|
50
|
+
<Dialog.Footer>
|
|
51
|
+
<Button variant="ghost" onclick={() => (open = false)}>Cancel</Button>
|
|
52
|
+
<Button variant="accent" onclick={() => (open = false)}>Save</Button>
|
|
53
|
+
</Dialog.Footer>
|
|
54
|
+
</Dialog.Content>
|
|
55
|
+
</Dialog.Root>
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### A question
|
|
59
|
+
|
|
60
|
+
Two actions, no close button: the answer is one of them.
|
|
61
|
+
|
|
62
|
+
```svelte
|
|
63
|
+
<script>
|
|
64
|
+
import * as Dialog from "lino-ui/dialog";
|
|
65
|
+
import { Button } from "lino-ui/button";
|
|
66
|
+
|
|
67
|
+
let open = $state(false);
|
|
68
|
+
</script>
|
|
69
|
+
|
|
70
|
+
<Dialog.Root bind:open>
|
|
71
|
+
<Dialog.Trigger>
|
|
72
|
+
{#snippet child({ props })}<Button {...props}>Delete the board</Button>{/snippet}
|
|
73
|
+
</Dialog.Trigger>
|
|
74
|
+
<Dialog.Content showCloseButton={false}>
|
|
75
|
+
<Dialog.Header>
|
|
76
|
+
<Dialog.Title>Delete “Moodboard”?</Dialog.Title>
|
|
77
|
+
<Dialog.Description>Its cards go to the trash for 30 days.</Dialog.Description>
|
|
78
|
+
</Dialog.Header>
|
|
79
|
+
<Dialog.Footer>
|
|
80
|
+
<Button variant="ghost" onclick={() => (open = false)}>Keep</Button>
|
|
81
|
+
<Button variant="accent" onclick={() => (open = false)}>Delete</Button>
|
|
82
|
+
</Dialog.Footer>
|
|
83
|
+
</Dialog.Content>
|
|
84
|
+
</Dialog.Root>
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## API reference
|
|
88
|
+
|
|
89
|
+
### Dialog.Root
|
|
90
|
+
|
|
91
|
+
| Prop | Type | Default | Description |
|
|
92
|
+
|---|---|---|---|
|
|
93
|
+
| `open` | `boolean` | `false` | Bindable |
|
|
94
|
+
|
|
95
|
+
### Dialog.Content
|
|
96
|
+
|
|
97
|
+
| Prop | Type | Default | Description |
|
|
98
|
+
|---|---|---|---|
|
|
99
|
+
| `showCloseButton` | `boolean` | `true` | The cross in the corner |
|
|
100
|
+
| `class` | `string` | — | More classes; the look itself is lino.css |
|
|
101
|
+
|
|
102
|
+
### Dialog.Footer
|
|
103
|
+
|
|
104
|
+
| Prop | Type | Default | Description |
|
|
105
|
+
|---|---|---|---|
|
|
106
|
+
| `showCloseButton` | `boolean` | `false` | Adds a ghost Close |
|
|
107
|
+
| `class` | `string` | — | More classes; the look itself is lino.css |
|
|
108
|
+
|
|
109
|
+
Import it from `lino-ui/dialog`. Its source, in the package: `src/lib/components/ui/dialog`; its look: `src/lib/lino.css`.
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
# Dropdown Menu
|
|
2
|
+
|
|
3
|
+
A menu that opens from a button, or at the pointer.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```js
|
|
8
|
+
import * as DropdownMenu from "lino-ui/dropdown-menu";
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
```svelte
|
|
12
|
+
<DropdownMenu.Root>
|
|
13
|
+
<DropdownMenu.Trigger>
|
|
14
|
+
{#snippet child({ props })}<Button {...props} variant="panel">100%</Button>{/snippet}
|
|
15
|
+
</DropdownMenu.Trigger>
|
|
16
|
+
<DropdownMenu.Content>
|
|
17
|
+
<DropdownMenu.Item>Zoom in</DropdownMenu.Item>
|
|
18
|
+
</DropdownMenu.Content>
|
|
19
|
+
</DropdownMenu.Root>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Examples
|
|
23
|
+
|
|
24
|
+
```svelte
|
|
25
|
+
<script>
|
|
26
|
+
import * as DropdownMenu from "lino-ui/dropdown-menu";
|
|
27
|
+
import { Button } from "lino-ui/button";
|
|
28
|
+
import { Kbd } from "lino-ui/kbd";
|
|
29
|
+
|
|
30
|
+
const ITEMS = [["Zoom in", "mod +"], ["Zoom out", "mod −"], ["Zoom to 100%", "mod 0"], ["Zoom to fit", "shift 1"]];
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
<DropdownMenu.Root>
|
|
34
|
+
<DropdownMenu.Trigger>
|
|
35
|
+
{#snippet child({ props })}<Button {...props} variant="panel">100%</Button>{/snippet}
|
|
36
|
+
</DropdownMenu.Trigger>
|
|
37
|
+
<DropdownMenu.Content align="start">
|
|
38
|
+
{#each ITEMS as [label, keys]}
|
|
39
|
+
<DropdownMenu.Item>
|
|
40
|
+
<span class="lino-label">{label}</span><Kbd {keys} class="lino-row-keys" aria-hidden="true" />
|
|
41
|
+
</DropdownMenu.Item>
|
|
42
|
+
{/each}
|
|
43
|
+
</DropdownMenu.Content>
|
|
44
|
+
</DropdownMenu.Root>
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
A label and its shortcut in each row.
|
|
48
|
+
|
|
49
|
+
### Choices
|
|
50
|
+
|
|
51
|
+
The chosen row is the accent; there is no check mark.
|
|
52
|
+
|
|
53
|
+
```svelte
|
|
54
|
+
<script>
|
|
55
|
+
import * as DropdownMenu from "lino-ui/dropdown-menu";
|
|
56
|
+
import { Button } from "lino-ui/button";
|
|
57
|
+
|
|
58
|
+
let quality = $state("2K");
|
|
59
|
+
</script>
|
|
60
|
+
|
|
61
|
+
<DropdownMenu.Root>
|
|
62
|
+
<DropdownMenu.Trigger>
|
|
63
|
+
{#snippet child({ props })}<Button {...props}>{quality}</Button>{/snippet}
|
|
64
|
+
</DropdownMenu.Trigger>
|
|
65
|
+
<DropdownMenu.Content align="start">
|
|
66
|
+
<DropdownMenu.RadioGroup bind:value={quality}>
|
|
67
|
+
{#each ["4K", "2K", "1K"] as q}
|
|
68
|
+
<DropdownMenu.RadioItem value={q} closeOnSelect>{q}</DropdownMenu.RadioItem>
|
|
69
|
+
{/each}
|
|
70
|
+
</DropdownMenu.RadioGroup>
|
|
71
|
+
</DropdownMenu.Content>
|
|
72
|
+
</DropdownMenu.Root>
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### A grid
|
|
76
|
+
|
|
77
|
+
Tiles in --menu-columns columns, an icon over the label.
|
|
78
|
+
|
|
79
|
+
```svelte
|
|
80
|
+
<script>
|
|
81
|
+
import * as DropdownMenu from "lino-ui/dropdown-menu";
|
|
82
|
+
import { Button } from "lino-ui/button";
|
|
83
|
+
|
|
84
|
+
const RATIOS = ["1:1", "21:9", "16:9", "9:16", "3:2", "2:3", "4:3", "3:4"];
|
|
85
|
+
let ratio = $state("1:1");
|
|
86
|
+
|
|
87
|
+
// a rectangle of the ratio, its longest side 20, in a 24px box
|
|
88
|
+
const box = (r) => {
|
|
89
|
+
const [w, h] = r.split(":").map(Number), k = 20 / Math.max(w, h);
|
|
90
|
+
return { x: (24 - w * k) / 2, y: (24 - h * k) / 2, width: w * k, height: h * k };
|
|
91
|
+
};
|
|
92
|
+
</script>
|
|
93
|
+
|
|
94
|
+
<DropdownMenu.Root>
|
|
95
|
+
<DropdownMenu.Trigger>
|
|
96
|
+
{#snippet child({ props })}<Button {...props}>{ratio}</Button>{/snippet}
|
|
97
|
+
</DropdownMenu.Trigger>
|
|
98
|
+
<DropdownMenu.Content align="start" class="lino-grid" style="--menu-columns: 4">
|
|
99
|
+
<DropdownMenu.RadioGroup bind:value={ratio} style="display: contents">
|
|
100
|
+
{#each RATIOS as r}
|
|
101
|
+
<DropdownMenu.RadioItem value={r} class="lino-tile" closeOnSelect>
|
|
102
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true"><rect {...box(r)} /></svg>
|
|
103
|
+
{r}
|
|
104
|
+
</DropdownMenu.RadioItem>
|
|
105
|
+
{/each}
|
|
106
|
+
</DropdownMenu.RadioGroup>
|
|
107
|
+
</DropdownMenu.Content>
|
|
108
|
+
</DropdownMenu.Root>
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### A submenu
|
|
112
|
+
|
|
113
|
+
```svelte
|
|
114
|
+
<script>
|
|
115
|
+
import * as DropdownMenu from "lino-ui/dropdown-menu";
|
|
116
|
+
import { Button } from "lino-ui/button";
|
|
117
|
+
|
|
118
|
+
let model = $state("GPT 2");
|
|
119
|
+
</script>
|
|
120
|
+
|
|
121
|
+
<DropdownMenu.Root>
|
|
122
|
+
<DropdownMenu.Trigger>
|
|
123
|
+
{#snippet child({ props })}<Button {...props}>Settings</Button>{/snippet}
|
|
124
|
+
</DropdownMenu.Trigger>
|
|
125
|
+
<DropdownMenu.Content align="start">
|
|
126
|
+
<DropdownMenu.Sub>
|
|
127
|
+
<DropdownMenu.SubTrigger><span class="lino-label">Model</span></DropdownMenu.SubTrigger>
|
|
128
|
+
<DropdownMenu.SubContent>
|
|
129
|
+
<DropdownMenu.RadioGroup bind:value={model}>
|
|
130
|
+
{#each ["GPT 2", "GPT 1", "Flux", "SD 3.5"] as m}
|
|
131
|
+
<DropdownMenu.RadioItem value={m}>{m}</DropdownMenu.RadioItem>
|
|
132
|
+
{/each}
|
|
133
|
+
</DropdownMenu.RadioGroup>
|
|
134
|
+
</DropdownMenu.SubContent>
|
|
135
|
+
</DropdownMenu.Sub>
|
|
136
|
+
<DropdownMenu.Separator />
|
|
137
|
+
<DropdownMenu.Item>Reset</DropdownMenu.Item>
|
|
138
|
+
<DropdownMenu.Item disabled>Share</DropdownMenu.Item>
|
|
139
|
+
</DropdownMenu.Content>
|
|
140
|
+
</DropdownMenu.Root>
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### At the pointer
|
|
144
|
+
|
|
145
|
+
A context menu: anchored to where it was asked for.
|
|
146
|
+
|
|
147
|
+
```svelte
|
|
148
|
+
<script>
|
|
149
|
+
import * as DropdownMenu from "lino-ui/dropdown-menu";
|
|
150
|
+
import { Kbd } from "lino-ui/kbd";
|
|
151
|
+
|
|
152
|
+
let open = $state(false);
|
|
153
|
+
let at = $state(null);
|
|
154
|
+
|
|
155
|
+
const show = (e) => {
|
|
156
|
+
e.preventDefault();
|
|
157
|
+
at = { getBoundingClientRect: () => new DOMRect(e.clientX, e.clientY, 0, 0) };
|
|
158
|
+
open = true;
|
|
159
|
+
};
|
|
160
|
+
</script>
|
|
161
|
+
|
|
162
|
+
<div class="ds-area" oncontextmenu={show} role="presentation">Right-click here</div>
|
|
163
|
+
|
|
164
|
+
<DropdownMenu.Root bind:open>
|
|
165
|
+
<DropdownMenu.Content customAnchor={at} side="bottom" align="start" sideOffset={2}>
|
|
166
|
+
<DropdownMenu.Item><span class="lino-label">Paste</span><Kbd keys="mod v" class="lino-row-keys" aria-hidden="true" /></DropdownMenu.Item>
|
|
167
|
+
<DropdownMenu.Item><span class="lino-label">Select all</span><Kbd keys="mod a" class="lino-row-keys" aria-hidden="true" /></DropdownMenu.Item>
|
|
168
|
+
<DropdownMenu.Separator />
|
|
169
|
+
<DropdownMenu.Item><span class="lino-label">Zoom to fit</span><Kbd keys="shift 1" class="lino-row-keys" aria-hidden="true" /></DropdownMenu.Item>
|
|
170
|
+
</DropdownMenu.Content>
|
|
171
|
+
</DropdownMenu.Root>
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
## API reference
|
|
175
|
+
|
|
176
|
+
### DropdownMenu.Content
|
|
177
|
+
|
|
178
|
+
| Prop | Type | Default | Description |
|
|
179
|
+
|---|---|---|---|
|
|
180
|
+
| `side` | `"top" \| "right" \| "bottom" \| "left"` | `"bottom"` | |
|
|
181
|
+
| `align` | `"start" \| "center" \| "end"` | `"center"` | |
|
|
182
|
+
| `sideOffset` | `number` | `4` | Gap to the trigger, px |
|
|
183
|
+
| `customAnchor` | `Element \| { getBoundingClientRect }` | — | Opens at anything with a box |
|
|
184
|
+
| `class` | `string` | — | More classes; the look itself is lino.css |
|
|
185
|
+
|
|
186
|
+
### DropdownMenu.Item
|
|
187
|
+
|
|
188
|
+
| Prop | Type | Default | Description |
|
|
189
|
+
|---|---|---|---|
|
|
190
|
+
| `onSelect` | `() => void` | — | |
|
|
191
|
+
| `disabled` | `boolean` | `false` | |
|
|
192
|
+
| `class` | `"lino-tile"` | — | A tile of a grid menu |
|
|
193
|
+
|
|
194
|
+
### Row content
|
|
195
|
+
|
|
196
|
+
| Prop | Type | Default | Description |
|
|
197
|
+
|---|---|---|---|
|
|
198
|
+
| `.lino-label` | `class` | — | The row's label: takes the width, so a shortcut sits right |
|
|
199
|
+
| `.lino-row-keys` | `class` | — | A Kbd at the end of a row |
|
|
200
|
+
|
|
201
|
+
Import it from `lino-ui/dropdown-menu`. Its source, in the package: `src/lib/components/ui/dropdown-menu`; its look: `src/lib/lino.css`.
|
package/docs/icons.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Icons
|
|
2
|
+
|
|
3
|
+
The design's hand-cut icons, one weight, coloured by currentColor. A new one is baked, never drawn.
|
|
4
|
+
|
|
5
|
+
Hand-cut icons. `icon(name)` (from `lino-ui`) returns the `<svg>`, coloured by `currentColor`.
|
|
6
|
+
|
|
7
|
+
```svelte
|
|
8
|
+
import { icon } from "lino-ui";
|
|
9
|
+
|
|
10
|
+
<Button size="icon" aria-label="Search">{@html icon("search")}</Button>
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Names: `select`, `hand`, `brush`, `text`, `sparkle`, `ratio`, `res`, `plus`, `send`, `back`, `fwd`, `cursor`, `shift`, `ctrl`, `bracket`, `bracket-left`, `close`, `external`, `avatar`, `chevron`, `search`, `bell`, `caret`.
|
|
14
|
+
|
|
15
|
+
- One weight: every glyph is cut with a stroke of .09 of its longer side; where it is drawn it gains a stroke up to the
|
|
16
|
+
stem of the type beside it (`--icon-stem`).
|
|
17
|
+
- Sized by the glyph, not the frame: beside a label .8em, 12px from it; alone `--icon-sm` 20px, `--icon-md` 24px,
|
|
18
|
+
`--icon-lg` 26px on a 32, 40 or 56px control.
|
|
19
|
+
- A new icon is never drawn in code: export its vector (strokes) and bake it, `npx lino icon icons/*.svg --out
|
|
20
|
+
src/lib/icons.js`, then import that module once. Skill: lino-ui.
|
package/docs/input.md
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# Input
|
|
2
|
+
|
|
3
|
+
A text field. Its fill shows focus by deepening, so there is no ring.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```js
|
|
8
|
+
import { Input } from "lino-ui/input";
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
```svelte
|
|
12
|
+
<Input placeholder="Untitled board" />
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Examples
|
|
16
|
+
|
|
17
|
+
```svelte
|
|
18
|
+
<script>
|
|
19
|
+
import { Input } from "lino-ui/input";
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<Input placeholder="Untitled board" class="ds-w-64" />
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### With a label
|
|
26
|
+
|
|
27
|
+
A Label for it, a hint under it.
|
|
28
|
+
|
|
29
|
+
```svelte
|
|
30
|
+
<script>
|
|
31
|
+
import { Input } from "lino-ui/input";
|
|
32
|
+
import { Label } from "lino-ui/label";
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
<div class="ds-field ds-w-64">
|
|
36
|
+
<Label for="slug">Slug</Label>
|
|
37
|
+
<Input id="slug" value="my-board" aria-describedby="slug-hint" />
|
|
38
|
+
<p id="slug-hint" class="ds-hint">Lowercase, dashes only</p>
|
|
39
|
+
</div>
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Invalid
|
|
43
|
+
|
|
44
|
+
aria-invalid tints the fill wine; say why under it.
|
|
45
|
+
|
|
46
|
+
```svelte
|
|
47
|
+
<script>
|
|
48
|
+
import { Input } from "lino-ui/input";
|
|
49
|
+
import { Label } from "lino-ui/label";
|
|
50
|
+
</script>
|
|
51
|
+
|
|
52
|
+
<div class="ds-field ds-w-64">
|
|
53
|
+
<Label for="email">Email</Label>
|
|
54
|
+
<Input id="email" type="email" value="nope" aria-invalid="true" aria-describedby="email-error" />
|
|
55
|
+
<p id="email-error" class="ds-hint is-error">Enter a valid email</p>
|
|
56
|
+
</div>
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Disabled
|
|
60
|
+
|
|
61
|
+
```svelte
|
|
62
|
+
<script>
|
|
63
|
+
import { Input } from "lino-ui/input";
|
|
64
|
+
</script>
|
|
65
|
+
|
|
66
|
+
<Input value="Read only" disabled class="ds-w-64" />
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### With a button
|
|
70
|
+
|
|
71
|
+
```svelte
|
|
72
|
+
<script>
|
|
73
|
+
import { Input } from "lino-ui/input";
|
|
74
|
+
import { Button } from "lino-ui/button";
|
|
75
|
+
</script>
|
|
76
|
+
|
|
77
|
+
<form class="ds-inline" onsubmit={(e) => e.preventDefault()}>
|
|
78
|
+
<Input type="url" placeholder="Paste a link" aria-label="Link" class="ds-w-64" />
|
|
79
|
+
<Button type="submit" variant="accent">Add</Button>
|
|
80
|
+
</form>
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## API reference
|
|
84
|
+
|
|
85
|
+
### Input
|
|
86
|
+
|
|
87
|
+
| Prop | Type | Default | Description |
|
|
88
|
+
|---|---|---|---|
|
|
89
|
+
| `value` | `string` | — | Bindable |
|
|
90
|
+
| `type` | `string` | `"text"` | |
|
|
91
|
+
| `aria-invalid` | `boolean` | — | The wine tint |
|
|
92
|
+
| `class` | `string` | — | More classes; the look itself is lino.css |
|
|
93
|
+
| `ref` | `HTMLInputElement` | — | Bindable |
|
|
94
|
+
|
|
95
|
+
Import it from `lino-ui/input`. Its source, in the package: `src/lib/components/ui/input`; its look: `src/lib/lino.css`.
|