@lofid/web 0.0.0-stage → 1.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/README.md +104 -2
- package/custom-elements.json +12890 -0
- package/dist/index.d.ts +3192 -0
- package/dist/index.js +20807 -0
- package/dist/index.js.map +1 -0
- package/dist/styles/ag-grid.css +145 -0
- package/dist/styles/motion.css +32 -0
- package/dist/styles/motion.tokens.json +38 -0
- package/dist/styles/typography.css +41 -0
- package/dist/styles/typography.json +858 -0
- package/dist/styles/vars.css +1225 -0
- package/package.json +46 -4
- package/readmes/lof-accordion/README.md +140 -0
- package/readmes/lof-alert/README.md +142 -0
- package/readmes/lof-autocomplete/README.md +209 -0
- package/readmes/lof-avatar/README.md +228 -0
- package/readmes/lof-badge/README.md +102 -0
- package/readmes/lof-breadcrumb/README.md +97 -0
- package/readmes/lof-button/README.md +189 -0
- package/readmes/lof-calendar/README.md +111 -0
- package/readmes/lof-card/README.md +105 -0
- package/readmes/lof-cardmedia/README.md +100 -0
- package/readmes/lof-carousel/README.md +187 -0
- package/readmes/lof-checkbox/README.md +159 -0
- package/readmes/lof-chip/README.md +153 -0
- package/readmes/lof-container/README.md +107 -0
- package/readmes/lof-date-picker/README.md +221 -0
- package/readmes/lof-divider/README.md +88 -0
- package/readmes/lof-drawer/README.md +188 -0
- package/readmes/lof-empty-state/README.md +78 -0
- package/readmes/lof-image-input/README.md +75 -0
- package/readmes/lof-kbd/README.md +188 -0
- package/readmes/lof-layout/README.md +122 -0
- package/readmes/lof-link/README.md +67 -0
- package/readmes/lof-menu/README.md +187 -0
- package/readmes/lof-menubar/README.md +218 -0
- package/readmes/lof-nav/README.md +90 -0
- package/readmes/lof-otp/README.md +167 -0
- package/readmes/lof-page-header/README.md +71 -0
- package/readmes/lof-pagination/README.md +141 -0
- package/readmes/lof-popover/README.md +220 -0
- package/readmes/lof-progress/README.md +88 -0
- package/readmes/lof-radio/README.md +142 -0
- package/readmes/lof-range-picker/README.md +194 -0
- package/readmes/lof-rating/README.md +90 -0
- package/readmes/lof-resizable/README.md +220 -0
- package/readmes/lof-segmented-button/README.md +158 -0
- package/readmes/lof-select/README.md +193 -0
- package/readmes/lof-sheet/README.md +170 -0
- package/readmes/lof-signature-pad/README.md +161 -0
- package/readmes/lof-skeleton/README.md +104 -0
- package/readmes/lof-slider/README.md +140 -0
- package/readmes/lof-snackbar/README.md +170 -0
- package/readmes/lof-split-button/README.md +129 -0
- package/readmes/lof-stat/README.md +73 -0
- package/readmes/lof-stepper/README.md +171 -0
- package/readmes/lof-switch/README.md +122 -0
- package/readmes/lof-tab/README.md +188 -0
- package/readmes/lof-table/README.md +114 -0
- package/readmes/lof-textfield/README.md +206 -0
- package/readmes/lof-time-picker/README.md +188 -0
- package/readmes/lof-toast/README.md +174 -0
- package/readmes/lof-tooltip/README.md +120 -0
- package/readmes/lof-tree/README.md +157 -0
- package/readmes/lof-upload/README.md +223 -0
package/README.md
CHANGED
|
@@ -1,3 +1,105 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @lofid/web
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Lofid Design System web components, built with Lit 3: 45 components, 55 custom elements, plus design tokens
|
|
4
|
+
for light and dark themes.
|
|
5
|
+
|
|
6
|
+
```js
|
|
7
|
+
import "@lofid/web/vars.css"; // design tokens, light + dark ([data-theme="dark"] or .dark)
|
|
8
|
+
import "@lofid/web"; // registers the elements below and lof-icon
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
| Element | Notes |
|
|
12
|
+
| --- | --- |
|
|
13
|
+
| `lof-accordion` | `content-type="custom"`; open bodies are not height-capped |
|
|
14
|
+
| `lof-alert` | |
|
|
15
|
+
| `lof-autocomplete` | |
|
|
16
|
+
| `lof-avatar` + `lof-avatar-group` | `ring`, `badge`, `icon`; the group is new in 1.5.0 |
|
|
17
|
+
| `lof-badge` | quiet by default (`role="img"`); `live` announces |
|
|
18
|
+
| `lof-breadcrumbs` | folder `lof-breadcrumb`; `aria-label` |
|
|
19
|
+
| `lof-button` | also accepts `size="sm"`/`"md"`/`"lg"` |
|
|
20
|
+
| `lof-calendar` | unavailable days are `aria-disabled` with `::part(unavailable)` |
|
|
21
|
+
| `lof-card` | |
|
|
22
|
+
| `lof-card-media` | folder `lof-cardmedia` |
|
|
23
|
+
| `lof-carousel` | loop works under reduced motion; no runaway width in flex rows (see FINDINGS) |
|
|
24
|
+
| `lof-checkbox` | form-associated; `disabled`; `supporting-text` |
|
|
25
|
+
| `lof-chip` | `presentational`, `field-aria-label`, `::part(remove)` |
|
|
26
|
+
| `lof-container` | |
|
|
27
|
+
| `lof-date-picker` | |
|
|
28
|
+
| `lof-divider` | |
|
|
29
|
+
| `lof-drawer` + `lof-drawer-footer` | footer only with content; scrolling body is a Tab stop |
|
|
30
|
+
| `lof-kbd` + `lof-kbd-group` | `key-name`, `platform`, Mac symbols |
|
|
31
|
+
| `lof-layout` | |
|
|
32
|
+
| `lof-menu` + `lof-menu-item` | item icons, `focusItem()`, top-layer flyouts |
|
|
33
|
+
| `lof-menubar` + `lof-menubar-menu` | |
|
|
34
|
+
| `lof-modal` | folder `lof-sheet`; scrolling body is a Tab stop |
|
|
35
|
+
| `lof-otp` | |
|
|
36
|
+
| `lof-pagination` | `type="page-select"`, `show-rows-per-page` |
|
|
37
|
+
| `lof-popover` + `lof-popover-content` | focus moves in and back; `has-popup` |
|
|
38
|
+
| `lof-progress` | |
|
|
39
|
+
| `lof-radio` | form-associated |
|
|
40
|
+
| `lof-range-picker` | editable From / To boxes |
|
|
41
|
+
| `lof-resizable-group` + `lof-resizable-panel` + `lof-resizable-handle` | folder `lof-resizable`; `panel-label` |
|
|
42
|
+
| `lof-segmented-button` | `disabled` |
|
|
43
|
+
| `lof-select` | multi-select chips in an overlay beside the trigger |
|
|
44
|
+
| `lof-signature-pad` | new in 1.5.0; form-associated |
|
|
45
|
+
| `lof-skeleton` | |
|
|
46
|
+
| `lof-slider` | |
|
|
47
|
+
| `lof-snackbar` | |
|
|
48
|
+
| `lof-split-button` | new in 1.5.0 |
|
|
49
|
+
| `lof-stepper` | |
|
|
50
|
+
| `lof-switch` | form-associated |
|
|
51
|
+
| `lof-tab` + `lof-tab-item` | `orientation="vertical"`, `icon-placement="top"` |
|
|
52
|
+
| `lof-textfield` | |
|
|
53
|
+
| `lof-time-picker` | |
|
|
54
|
+
| `lof-toast` | `success` / `info` tones with a leading icon |
|
|
55
|
+
| `lof-tooltip` | announced through `aria-description` |
|
|
56
|
+
| `lof-tree` | new in 1.5.0 |
|
|
57
|
+
| `lof-upload` + `lof-upload-actions` | `max-files`, `lof-upload-complete`, `lof-file-replaced`, image previews |
|
|
58
|
+
|
|
59
|
+
Every element extends `LofElement` (`src/internal/lof-element.ts`): `="false"` turns a Boolean attribute off, a string
|
|
60
|
+
assigned to an Array / Object / Number / Boolean property is converted (React 19), and the 33 old run-together
|
|
61
|
+
attribute spellings keep working with a one-time deprecation notice (declared per property with `legacy` / `kebab`).
|
|
62
|
+
|
|
63
|
+
## Typography
|
|
64
|
+
|
|
65
|
+
Text styles are purpose tokens, named for what the text is for: `--lof-{heading|body|paragraph|label|action}-{purpose}`,
|
|
66
|
+
for example `--lof-heading-dialog`, `--lof-body-field-label` or `--lof-action-button-small`. Each is a `font` shorthand
|
|
67
|
+
plus five longhands (`-font-family`, `-font-weight`, `-font-size`, `-line-height`, `-letter-spacing`); set
|
|
68
|
+
letter-spacing next to the shorthand, since `font` doesn't include it. They are built from pixel-named primitives
|
|
69
|
+
(`--lof-font-size-24`, `--lof-font-line-height-32`, `--lof-font-weight-semibold`…). Every component reads them;
|
|
70
|
+
none hard-codes a size.
|
|
71
|
+
|
|
72
|
+
```css
|
|
73
|
+
.card-title { font: var(--lof-heading-card); letter-spacing: var(--lof-heading-card-letter-spacing); }
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
The earlier size-letter names (`--lof-headings-lg-*`, `--lof-body-md-regular-*`, `--lof-fonts-*`) still work as
|
|
77
|
+
deprecated aliases with identical values and go in 3.0. The values and the migration map live in
|
|
78
|
+
`scripts/typography-spec.mjs`; `node scripts/typography-tokens.mjs` writes them into `tokens/tokens.json`.
|
|
79
|
+
|
|
80
|
+
## Other exports
|
|
81
|
+
|
|
82
|
+
| Export | What it is |
|
|
83
|
+
| --- | --- |
|
|
84
|
+
| `@lofid/web/typography.css` | Utility classes for the typography purpose tokens (`.lof-heading-card`, `.lof-body-default`…); each sets `font` and `letter-spacing`. Needs `vars.css` |
|
|
85
|
+
| `@lofid/web/typography.json` | The purpose tokens with their values, what each is for, which components use it, and the old-name migration map |
|
|
86
|
+
| `@lofid/web/motion.css` | Motion v1 tokens (also in `vars.css`); recipe durations drop to 0ms under reduced motion |
|
|
87
|
+
| `@lofid/web/motion.tokens.json` | The same tokens in DTCG format (source: `tokens/motion.tokens.json`) |
|
|
88
|
+
| `@lofid/web/ag-grid.css` | AG Grid 33+ theme on the tokens; scope it with `.lof-data-table` (source: `styles/ag-grid.css`) |
|
|
89
|
+
| `@lofid/web/custom-elements.json` | Custom Elements Manifest, generated by `scripts/cem.mjs` |
|
|
90
|
+
| `createGridNavigation(grid, options)` | WAI-ARIA grid keyboard for plain markup |
|
|
91
|
+
| `detectKbdPlatform()`, `resolveKbdKey()` | the named-key helpers behind `lof-kbd` |
|
|
92
|
+
| `announce(message, politeness?)` | the shared screen-reader announcer |
|
|
93
|
+
|
|
94
|
+
The API reference for each element ships with the package in `readmes/<element>/README.md`.
|
|
95
|
+
`tools/parity/FINDINGS.md` in the repo lists where an element departs from its README.
|
|
96
|
+
|
|
97
|
+
## Build and test
|
|
98
|
+
|
|
99
|
+
- `npm run build` runs `scripts/build-vars.mjs` (`tokens/tokens.json` + `tokens/motion.tokens.json` →
|
|
100
|
+
`dist/styles/vars.css`, `motion.css`, `motion.tokens.json`; copies `styles/ag-grid.css`), then `scripts/cem.mjs`
|
|
101
|
+
(→ `custom-elements.json`), then `tsup`.
|
|
102
|
+
- `npm test` bundles `src/` and checks component behaviour in Chromium (`test/browser.mjs`; pass a word to run only
|
|
103
|
+
matching checks, e.g. `node test/browser.mjs tree`).
|
|
104
|
+
- From the repo root, `node tools/parity/cemdiff.mjs` lists any property, attribute or event the published manifest
|
|
105
|
+
has that ours lacks (currently none).
|