@ds-mo/ui 1.11.4 → 1.11.5
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 +38 -62
- package/dist/.build-stamp +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@ds-mo/ui)
|
|
4
4
|
|
|
5
|
-
Composable web UI components (Stencil custom elements) styled with [TokoMo](https://github.com/zainadeel/TokoMo) design tokens. Works in any framework — ships Angular proxies
|
|
5
|
+
Composable web UI components (Stencil custom elements) styled with [TokoMo](https://github.com/zainadeel/TokoMo) design tokens. Works in any framework — ships **Stencil-generated** Angular proxies and React wrappers alongside the `<ds-*>` custom elements.
|
|
6
6
|
|
|
7
7
|
## Install
|
|
8
8
|
|
|
@@ -19,84 +19,60 @@ npm install @ds-mo/ui @ds-mo/tokens @ds-mo/icons
|
|
|
19
19
|
|
|
20
20
|
Import TokoMo tokens globally (once, at your app root):
|
|
21
21
|
|
|
22
|
-
```
|
|
23
|
-
import '@ds-mo/tokens';
|
|
24
|
-
import '@ds-mo/tokens/reset';
|
|
25
|
-
import '@ds-mo/tokens/globals';
|
|
22
|
+
```ts
|
|
23
|
+
import '@ds-mo/tokens';
|
|
24
|
+
import '@ds-mo/tokens/reset';
|
|
25
|
+
import '@ds-mo/tokens/globals';
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
-
Register custom elements
|
|
28
|
+
Register the custom elements you render (each import auto-defines its tag):
|
|
29
29
|
|
|
30
30
|
```ts
|
|
31
|
-
import
|
|
32
|
-
import '@ds-mo/
|
|
33
|
-
import
|
|
34
|
-
|
|
35
|
-
defineCustomElements();
|
|
31
|
+
import '@ds-mo/ui/dist/components/ds-button.js';
|
|
32
|
+
import '@ds-mo/ui/dist/components/ds-bar-nav.js';
|
|
33
|
+
// …import only the <ds-*> tags your app uses
|
|
36
34
|
```
|
|
37
35
|
|
|
38
|
-
Your app bundler
|
|
36
|
+
Your app bundler must resolve `@ds-mo/icons` when it bundles `ds-icon` — install `@ds-mo/icons` alongside `@ds-mo/ui`.
|
|
37
|
+
|
|
38
|
+
### Framework wrappers (optional)
|
|
39
|
+
|
|
40
|
+
| Host | Import | Usage |
|
|
41
|
+
| --- | --- | --- |
|
|
42
|
+
| **Angular** | `@ds-mo/ui/angular` | Stencil proxy directives — property/event bindings in templates |
|
|
43
|
+
| **React** | `@ds-mo/ui/react` | `DsButton`, `DsBarNav`, … — thin wrappers around the same custom elements |
|
|
44
|
+
| **Any** | `@ds-mo/ui/dist/components/ds-*.js` | Use `<ds-*>` directly (motive-webapp-lab pattern) |
|
|
39
45
|
|
|
40
|
-
|
|
46
|
+
There is **no** published `@ds-mo/ui/loader` or global `@ds-mo/ui/css` bundle — styles ship scoped inside each custom-element module.
|
|
41
47
|
|
|
42
|
-
**SPA hosts (Angular / React):** `ds-panel-nav` and `ds-bar-nav` need a [first-paint integration contract](docs/framework-integration.md) on hard reload —
|
|
48
|
+
**SPA hosts (Angular / React):** `ds-panel-nav` and `ds-bar-nav` need a [first-paint integration contract](docs/framework-integration.md) on hard reload — seed bar-nav state and stamp `data-nav-style` before custom elements upgrade.
|
|
43
49
|
|
|
44
50
|
## Components
|
|
45
51
|
|
|
52
|
+
All tags are `ds-*` custom elements. Grouped by role (see Storybook for props and stories):
|
|
53
|
+
|
|
46
54
|
### Primitives
|
|
47
|
-
- **Text**
|
|
48
|
-
- **Surface** — container with backgrounds, elevation, edges, radius, interactive states
|
|
49
|
-
- **Card** — elevated content container with header/footer slots
|
|
50
|
-
- **Input** — text input field
|
|
51
|
-
- **Slider** — range slider
|
|
52
|
-
- **Field** — label + input wrapper
|
|
53
|
-
- **Divider** — horizontal or vertical rule
|
|
55
|
+
- **Text**, **Surface**, **Card**, **Input**, **Slider**, **Field**, **Divider**, **Icon**
|
|
54
56
|
|
|
55
57
|
### Actions
|
|
56
|
-
- **Button** — primary/secondary
|
|
57
|
-
- **ButtonGroup**
|
|
58
|
-
- **ToggleButton** — two-state selectable button
|
|
59
|
-
- **ToggleButtonGroup** — radio-style group of toggle buttons
|
|
58
|
+
- **Button** — `primary` / `secondary` variants, intents, sizes, icon slot
|
|
59
|
+
- **ButtonGroup**, **ToggleButton**, **ToggleButtonGroup**
|
|
60
60
|
|
|
61
61
|
### Controls
|
|
62
|
-
- **Toggle**
|
|
63
|
-
- **Checkbox** — with label and indeterminate state
|
|
64
|
-
- **Radio** — single-select radio input
|
|
62
|
+
- **Toggle**, **Checkbox**, **RadioGroup**
|
|
65
63
|
|
|
66
64
|
### Data display
|
|
67
|
-
- **Tag**
|
|
68
|
-
- **Chip** — interactive or removable metadata chip
|
|
69
|
-
- **Badge** — compact counter or notification dot
|
|
70
|
-
- **Table** — sortable, paginated data table
|
|
71
|
-
- **Accordion** — collapsible content sections
|
|
72
|
-
- **Pagination** — page navigation control
|
|
65
|
+
- **Tag**, **Chip**, **Badge**, **Table**, **Accordion**, **Pagination**
|
|
73
66
|
|
|
74
67
|
### Overlays
|
|
75
|
-
- **Modal**
|
|
76
|
-
- **Menu** — dropdown with sections, selection, positioning
|
|
77
|
-
- **Tooltip** — hover tooltip with shortcut key support
|
|
78
|
-
- **Select** — dropdown select
|
|
79
|
-
- **Toast** — transient notification
|
|
80
|
-
- **Banner** — notification bar with intents, toast mode
|
|
68
|
+
- **Modal**, **Menu**, **Tooltip**, **Select**, **ToastProvider** (`ds-toast-provider`), **Banner**
|
|
81
69
|
|
|
82
70
|
### Navigation
|
|
83
|
-
- **
|
|
84
|
-
- **
|
|
85
|
-
- **Breadcrumb** — path navigation
|
|
86
|
-
|
|
87
|
-
### Status
|
|
88
|
-
- **EmptyState** — placeholder states
|
|
89
|
-
- **Loader** — loading indicator
|
|
90
|
-
- **Skeleton** — content placeholder
|
|
91
|
-
|
|
92
|
-
### Layout
|
|
93
|
-
- **Header** — page header with left/center/right slots
|
|
94
|
-
- **PanelNav** — collapsible side navigation panel with sections and items
|
|
71
|
+
- **TabGroup** (pill), **TabGroupNav** (underline), **Breadcrumb**
|
|
72
|
+
- **AppShell**, **PanelNav**, **BarNav**, **BarNavAction**, **PanelTools**
|
|
95
73
|
|
|
96
|
-
###
|
|
97
|
-
- **
|
|
98
|
-
- **Scrollbar** — custom scrollbar
|
|
99
|
-
- **ErrorBoundary** — error catch with fallback
|
|
74
|
+
### Status & layout
|
|
75
|
+
- **EmptyState**, **Loader**, **Skeleton**, **Header**, **Fade**, **Scrollbar**
|
|
100
76
|
|
|
101
77
|
## Token dependency
|
|
102
78
|
|
|
@@ -104,16 +80,16 @@ All styling uses TokoMo CSS custom properties. No hardcoded colors, sizes, or sh
|
|
|
104
80
|
|
|
105
81
|
## Icon pattern
|
|
106
82
|
|
|
107
|
-
Components that accept icons use named
|
|
83
|
+
Components that accept icons use a named `icon` slot:
|
|
108
84
|
|
|
109
85
|
```html
|
|
110
86
|
<ds-button>
|
|
111
|
-
<ds-icon
|
|
87
|
+
<ds-icon name="ArrowRight" slot="icon"></ds-icon>
|
|
112
88
|
Save
|
|
113
89
|
</ds-button>
|
|
114
90
|
```
|
|
115
91
|
|
|
116
|
-
|
|
92
|
+
`name` must be a canonical IcoMo export key (`ArrowRight`, `Bell`, …). You can also slot any custom SVG element.
|
|
117
93
|
|
|
118
94
|
## Figma Code Connect
|
|
119
95
|
|
|
@@ -121,7 +97,7 @@ This repo includes [Figma Code Connect](https://developers.figma.com/docs/code-c
|
|
|
121
97
|
|
|
122
98
|
**Prerequisites**
|
|
123
99
|
|
|
124
|
-
- Node
|
|
100
|
+
- Node **20.19+** or **22.12+** (see `package.json` `engines` and `.nvmrc`).
|
|
125
101
|
- A Figma **personal access token** with **Code Connect (Write)** and **File content (Read)**. Set it locally only — never commit it:
|
|
126
102
|
- `export FIGMA_ACCESS_TOKEN='…'`, or
|
|
127
103
|
- pass `--token` / `-t` when publishing.
|
|
@@ -161,7 +137,7 @@ Each contributor can use their own `FIGMA_ACCESS_TOKEN` in a local shell or `.en
|
|
|
161
137
|
### Dev Mode vs “the template” (why mapping exists)
|
|
162
138
|
|
|
163
139
|
- **The canvas** is whatever designers built (variant names like `Type = Main`, nested structure, etc.). Code Connect does **not** rewrite your Figma file.
|
|
164
|
-
- **Dev Mode** can show a **link to your repo file** (e.g. `Icon.tsx`) when you connect the repo — that answers “where is this implemented?”
|
|
140
|
+
- **Dev Mode** can show a **link to your repo file** (e.g. `src/wc/components/Icon/Icon.tsx`) when you connect the repo — that answers “where is this implemented?”
|
|
165
141
|
- The **Code Connect snippet** is the **copy-paste example** Figma shows in Inspect. That text comes from **your published templates** (or from other Figma features like MCP context), not from magically knowing your Stencil prop names.
|
|
166
142
|
|
|
167
143
|
So: if Figma props already match your API (`intent`, `appearance`), your template can be a thin wrapper and life is easy. If they **do not** match (legacy `Type` vs real `intent`), the template is where you **translate** so the snippet still shows **canonical** usage. You are not making Dev Mode “look like Figma internals” — you are choosing what **engineers should copy** when names diverge.
|
|
@@ -192,4 +168,4 @@ If the secret is missing, the publish step fails with Figma’s “no access tok
|
|
|
192
168
|
|
|
193
169
|
### Icon batch files — CompoMo vs IcoMo
|
|
194
170
|
|
|
195
|
-
**Publish from CompoMo.**
|
|
171
|
+
**Publish from CompoMo.** Code Connect templates live under `code-connect/published/` (see `code-connect/examples/` for starters). `figma connect publish` runs from this repo. Snippets should show **`@ds-mo/ui`** usage (e.g. `<ds-icon name="Bell" />` or `<DsIcon name="Bell" />` from `@ds-mo/ui/react`). **`name`** values must match **IcoMo** export keys.
|
package/dist/.build-stamp
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
1783106409493
|