@unframed/cli 0.1.0 → 0.3.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 +9 -0
- package/dist/cli.js +7 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/skill.js +34 -0
- package/dist/commands/skill.js.map +1 -0
- package/package.json +6 -4
- package/registry.json +103 -9
- package/skill/unframed/SKILL.md +57 -0
- package/skill/unframed/references/components.md +1830 -0
- package/skill/unframed/references/frameworks.md +383 -0
- package/skill/unframed/references/theming.md +41 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: unframed
|
|
3
|
+
description: Builds UI with Unframed web components (@unframed/core, @unframed/react, @unframed/vue, @unframed/angular, <uf-*> tags) in HTML, React, Vue or Angular, including forms, events, tables, dialogs and theming with --uf-* tokens. Use when the project depends on @unframed/* packages, the code uses <uf-*> tags, or the user asks for Unframed components.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Unframed UI
|
|
7
|
+
|
|
8
|
+
Unframed 0.3.0: accessible UI components as standard custom elements (Lit). Every tag starts with `uf-`. They work in plain HTML and every framework; React, Vue and Angular have wrapper packages for typed props, events and form bindings.
|
|
9
|
+
|
|
10
|
+
## Before writing code
|
|
11
|
+
|
|
12
|
+
1. Check `package.json` for which packages the project uses: `@unframed/react`, `@unframed/vue`, `@unframed/angular`, or `@unframed/core` alone. If `unframed.json` exists, components were copied into the project with the CLI: import them from that folder, not from npm.
|
|
13
|
+
2. Read the setup for that framework in [references/frameworks.md](references/frameworks.md).
|
|
14
|
+
3. Before using a component, read its section in [references/components.md](references/components.md): attributes, events, slots and an example. Don't guess attribute names.
|
|
15
|
+
|
|
16
|
+
## Rules
|
|
17
|
+
|
|
18
|
+
- **Tokens once.** Load `@unframed/tokens/tokens.css` once (app entry or global stylesheet), before any overrides.
|
|
19
|
+
- **Import what you use.** `import '@unframed/core/<component>'` registers that component and the ones it needs. In React/Vue/Angular, import the components from the wrapper package instead.
|
|
20
|
+
- **Booleans are presence attributes** in HTML: `<uf-button disabled>`, never `disabled="false"`. Props/inputs take real booleans.
|
|
21
|
+
- **Events.** Form controls fire native `input` (while typing) and `change` (on commit); read the value from the element (`event.target.value` / `.checked`). Other components fire `uf-*` events (`uf-show`, `uf-hide`, `uf-select`, `uf-tab-change`, `uf-sort`, `uf-page-change`, `uf-request-close`) with data in `event.detail`. React: `onUfHide`, `onUfPageChange`…; Vue: `@uf-hide`; Angular: `(uf-hide)`.
|
|
22
|
+
- **Forms.** Form controls are form-associated: give them a `name` and put them in a `<form>`; `required`, `pattern`, `min`… validate natively and errors show under the field. Vue: `v-model`. Angular: `ngModel` / `formControl` / `formControlName` (import the form directives, e.g. `UNFRAMED` or `UfTextValueAccessor`).
|
|
23
|
+
- **Labels.** Form controls take `label` (and `hint`); icon-only buttons need `label`; `uf-icon` needs `label` only when it means something; tables need `label`; two `uf-pagination` on one page need different `label`s.
|
|
24
|
+
- **Options are children.** `uf-select` and `uf-combobox` take plain `<option>`/`<optgroup>` children. `uf-radio-group` takes `uf-radio`. `uf-tabs` takes `uf-tab` + `uf-tab-panel` (matched by `panel`/`name`).
|
|
25
|
+
- **Objects are properties.** `uf-table`'s `columns` and `rows` are arrays: set them as properties (React/Vue/Angular props do this). Only in plain HTML use JSON attributes.
|
|
26
|
+
- **Dialogs.** Open with `open` or `.show()`; any child with `data-dialog="close"` closes it; cancel a close in `uf-request-close` with `preventDefault()`.
|
|
27
|
+
- **Toasts.** `import { toast } from '@unframed/core'` and call `toast('Saved', { variant: 'success' })`; no element needed.
|
|
28
|
+
- **Theming.** Change colors and shapes with `--uf-*` custom properties (global tokens, then per-component ones like `--uf-button-radius`), then `::part()`. Don't style internals any other way, and don't re-implement a component that exists. See [references/theming.md](references/theming.md).
|
|
29
|
+
- **Dark mode** follows the OS; force it with `data-uf-theme="dark"` (or `"light"`) on any element.
|
|
30
|
+
|
|
31
|
+
## Components
|
|
32
|
+
|
|
33
|
+
| Component | Tags | Import |
|
|
34
|
+
|---|---|---|
|
|
35
|
+
| Button: Triggers an action or navigates to a URL. | `<uf-button>` | `@unframed/core/button` |
|
|
36
|
+
| Input: Lets users enter a single line of text. | `<uf-input>` | `@unframed/core/input` |
|
|
37
|
+
| Textarea: Lets users enter multiple lines of text. | `<uf-textarea>` | `@unframed/core/textarea` |
|
|
38
|
+
| Select: Lets users pick one option from a dropdown list. | `<uf-select>` | `@unframed/core/select` |
|
|
39
|
+
| Combobox: Lets users search a list and pick one option. | `<uf-combobox>` | `@unframed/core/combobox` |
|
|
40
|
+
| Checkbox: Lets users turn an option on or off, or pick several options. | `<uf-checkbox>` `<uf-checkbox-group>` | `@unframed/core/checkbox` `@unframed/core/checkbox-group` |
|
|
41
|
+
| Switch: Turns a setting on or off. | `<uf-switch>` | `@unframed/core/switch` |
|
|
42
|
+
| Radio group: Lets users pick exactly one option from a list. | `<uf-radio-group>` `<uf-radio>` | `@unframed/core/radio-group` `@unframed/core/radio` |
|
|
43
|
+
| Tabs: Organizes content into panels, one visible at a time. | `<uf-tabs>` `<uf-tab>` `<uf-tab-panel>` | `@unframed/core/tabs` |
|
|
44
|
+
| Accordion: A stack of sections that expand and collapse. | `<uf-accordion>` `<uf-accordion-item>` | `@unframed/core/accordion` |
|
|
45
|
+
| Dialog: Shows content in a modal window on top of the page. | `<uf-dialog>` | `@unframed/core/dialog` |
|
|
46
|
+
| Popover: Shows floating content next to a trigger. | `<uf-popover>` | `@unframed/core/popover` |
|
|
47
|
+
| Dropdown menu: Opens a menu of actions from a button. | `<uf-dropdown>` `<uf-menu>` `<uf-menu-item>` | `@unframed/core/dropdown` `@unframed/core/menu` |
|
|
48
|
+
| Tooltip: Shows a short hint for the element it wraps. | `<uf-tooltip>` | `@unframed/core/tooltip` |
|
|
49
|
+
| Toast: Shows short, temporary notifications. | `<uf-toaster>` | `@unframed/core/toast` |
|
|
50
|
+
| Icon: Shows a small symbol. | `<uf-icon>` | `@unframed/core/icon` |
|
|
51
|
+
| Badge: Labels a status, a category or a count. | `<uf-badge>` | `@unframed/core/badge` |
|
|
52
|
+
| Avatar: Shows a person's picture, initials or icon. | `<uf-avatar>` | `@unframed/core/avatar` |
|
|
53
|
+
| Card: Groups related content and actions. | `<uf-card>` | `@unframed/core/card` |
|
|
54
|
+
| Table: Shows data in rows and columns, with sorting. | `<uf-table>` | `@unframed/core/table` |
|
|
55
|
+
| Pagination: Moves between the pages of a long list. | `<uf-pagination>` | `@unframed/core/pagination` |
|
|
56
|
+
|
|
57
|
+
The full API of each, with examples: [references/components.md](references/components.md). Docs: https://p-db.github.io/unframed-ui/
|