@omni-design/components 0.11.0 → 0.12.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/.claude/commands/ScanComponents.md +1 -1
- package/.claude/commands/ShareComponent.md +1 -1
- package/CLAUDE.md +5 -3
- package/dist/index.esm.js +3 -3
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/types/components/Button/Button.d.ts +3 -1
- package/dist/types/components/ButtonGroup/ButtonGroup.d.ts +3 -2
- package/dist/types/components/Chip/Chip.d.ts +1 -1
- package/dist/types/components/IconBadge/IconBadge.d.ts +1 -1
- package/dist/types/components/Loader/Loader.d.ts +66 -0
- package/dist/types/components/Loader/index.d.ts +1 -0
- package/dist/types/components/MiniSwatch/MiniSwatch.d.ts +7 -0
- package/dist/types/components/MiniSwatch/index.d.ts +1 -0
- package/dist/types/components/Swatch/Swatch.d.ts +14 -0
- package/dist/types/components/Swatch/index.d.ts +1 -0
- package/dist/types/components/Switch/Switch.d.ts +24 -8
- package/dist/types/components/Switch/index.d.ts +1 -1
- package/dist/types/components/index.d.ts +5 -0
- package/dist/types/docs/DocPanels.d.ts +39 -0
- package/dist/types/docs/components.d.ts +212 -0
- package/dist/types/docs/componentsData.d.ts +587 -0
- package/dist/types/docs/componentsForms.d.ts +597 -0
- package/dist/types/docs/componentsNav.d.ts +420 -0
- package/dist/types/docs/componentsOverlays.d.ts +379 -0
- package/dist/types/docs/componentsRest.d.ts +158 -0
- package/dist/types/docs/componentsSurfaces.d.ts +339 -0
- package/dist/types/docs/docsLink.d.ts +32 -0
- package/dist/types/docs/examples.d.ts +37 -0
- package/dist/types/docs/foundations.d.ts +28 -0
- package/dist/types/docs/index.d.ts +5 -0
- package/docs/components.md +71 -55
- package/package.json +1 -1
- package/public/styles/Dark-Mode.css +12056 -13009
- package/public/styles/Light-Mode.css +11240 -12370
- package/public/styles/base.css +364 -182
- package/public/styles/core.css +480 -123
- package/public/styles/foundation.css +124 -53
- package/public/styles/styles.css +5 -5
- package/public/styles/theme.json +2 -2
- package/public/styles/typography-tokens.css +686 -158
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
export namespace ICON_DOC {
|
|
2
|
+
let name: string;
|
|
3
|
+
let summary: string;
|
|
4
|
+
let insteadUse: {
|
|
5
|
+
when: string;
|
|
6
|
+
use: string;
|
|
7
|
+
}[];
|
|
8
|
+
let props: ({
|
|
9
|
+
name: string;
|
|
10
|
+
type: string;
|
|
11
|
+
default: string;
|
|
12
|
+
values: string[];
|
|
13
|
+
note: string;
|
|
14
|
+
} | {
|
|
15
|
+
name: string;
|
|
16
|
+
type: string;
|
|
17
|
+
values: string[];
|
|
18
|
+
default: string;
|
|
19
|
+
note?: undefined;
|
|
20
|
+
} | {
|
|
21
|
+
name: string;
|
|
22
|
+
type: string;
|
|
23
|
+
default: string;
|
|
24
|
+
note: string;
|
|
25
|
+
values?: undefined;
|
|
26
|
+
} | {
|
|
27
|
+
name: string;
|
|
28
|
+
type: string;
|
|
29
|
+
default: string;
|
|
30
|
+
values?: undefined;
|
|
31
|
+
note?: undefined;
|
|
32
|
+
})[];
|
|
33
|
+
let states: {
|
|
34
|
+
state: string;
|
|
35
|
+
setBy: string;
|
|
36
|
+
note: string;
|
|
37
|
+
}[];
|
|
38
|
+
let theming: {
|
|
39
|
+
collection: string;
|
|
40
|
+
inCode: string;
|
|
41
|
+
inFigma: string;
|
|
42
|
+
}[];
|
|
43
|
+
let themingNotes: string[];
|
|
44
|
+
let tokens: {
|
|
45
|
+
name: string;
|
|
46
|
+
sets: string;
|
|
47
|
+
variesWith: string;
|
|
48
|
+
figma: string;
|
|
49
|
+
}[];
|
|
50
|
+
let composition: string[];
|
|
51
|
+
let accessibility: string[];
|
|
52
|
+
let gotchas: string[];
|
|
53
|
+
}
|
|
54
|
+
export namespace FAB_DOC {
|
|
55
|
+
let name_1: string;
|
|
56
|
+
export { name_1 as name };
|
|
57
|
+
let summary_1: string;
|
|
58
|
+
export { summary_1 as summary };
|
|
59
|
+
let insteadUse_1: {
|
|
60
|
+
when: string;
|
|
61
|
+
use: string;
|
|
62
|
+
}[];
|
|
63
|
+
export { insteadUse_1 as insteadUse };
|
|
64
|
+
let props_1: ({
|
|
65
|
+
name: string;
|
|
66
|
+
type: string;
|
|
67
|
+
default: string;
|
|
68
|
+
note?: undefined;
|
|
69
|
+
values?: undefined;
|
|
70
|
+
} | {
|
|
71
|
+
name: string;
|
|
72
|
+
type: string;
|
|
73
|
+
default: string;
|
|
74
|
+
note: string;
|
|
75
|
+
values?: undefined;
|
|
76
|
+
} | {
|
|
77
|
+
name: string;
|
|
78
|
+
type: string;
|
|
79
|
+
values: string[];
|
|
80
|
+
default: string;
|
|
81
|
+
note?: undefined;
|
|
82
|
+
})[];
|
|
83
|
+
export { props_1 as props };
|
|
84
|
+
let states_1: ({
|
|
85
|
+
state: string;
|
|
86
|
+
setBy: string;
|
|
87
|
+
note: string;
|
|
88
|
+
} | {
|
|
89
|
+
state: string;
|
|
90
|
+
setBy: string;
|
|
91
|
+
note?: undefined;
|
|
92
|
+
})[];
|
|
93
|
+
export { states_1 as states };
|
|
94
|
+
let theming_1: {
|
|
95
|
+
collection: string;
|
|
96
|
+
inCode: string;
|
|
97
|
+
inFigma: string;
|
|
98
|
+
}[];
|
|
99
|
+
export { theming_1 as theming };
|
|
100
|
+
let themingNotes_1: string[];
|
|
101
|
+
export { themingNotes_1 as themingNotes };
|
|
102
|
+
let tokens_1: {
|
|
103
|
+
name: string;
|
|
104
|
+
sets: string;
|
|
105
|
+
variesWith: string;
|
|
106
|
+
figma: string;
|
|
107
|
+
}[];
|
|
108
|
+
export { tokens_1 as tokens };
|
|
109
|
+
let composition_1: string[];
|
|
110
|
+
export { composition_1 as composition };
|
|
111
|
+
let accessibility_1: string[];
|
|
112
|
+
export { accessibility_1 as accessibility };
|
|
113
|
+
let gotchas_1: string[];
|
|
114
|
+
export { gotchas_1 as gotchas };
|
|
115
|
+
}
|
|
116
|
+
export namespace SNACKBAR_DOC {
|
|
117
|
+
let name_2: string;
|
|
118
|
+
export { name_2 as name };
|
|
119
|
+
let summary_2: string;
|
|
120
|
+
export { summary_2 as summary };
|
|
121
|
+
let insteadUse_2: {
|
|
122
|
+
when: string;
|
|
123
|
+
use: string;
|
|
124
|
+
}[];
|
|
125
|
+
export { insteadUse_2 as insteadUse };
|
|
126
|
+
let props_2: ({
|
|
127
|
+
name: string;
|
|
128
|
+
type: string;
|
|
129
|
+
default: string;
|
|
130
|
+
values?: undefined;
|
|
131
|
+
note?: undefined;
|
|
132
|
+
} | {
|
|
133
|
+
name: string;
|
|
134
|
+
type: string;
|
|
135
|
+
values: string[];
|
|
136
|
+
default: string;
|
|
137
|
+
note?: undefined;
|
|
138
|
+
} | {
|
|
139
|
+
name: string;
|
|
140
|
+
type: string;
|
|
141
|
+
default: string;
|
|
142
|
+
note: string;
|
|
143
|
+
values?: undefined;
|
|
144
|
+
})[];
|
|
145
|
+
export { props_2 as props };
|
|
146
|
+
let states_2: ({
|
|
147
|
+
state: string;
|
|
148
|
+
setBy: string;
|
|
149
|
+
note?: undefined;
|
|
150
|
+
} | {
|
|
151
|
+
state: string;
|
|
152
|
+
setBy: string;
|
|
153
|
+
note: string;
|
|
154
|
+
})[];
|
|
155
|
+
export { states_2 as states };
|
|
156
|
+
let theming_2: {
|
|
157
|
+
collection: string;
|
|
158
|
+
inCode: string;
|
|
159
|
+
inFigma: string;
|
|
160
|
+
}[];
|
|
161
|
+
export { theming_2 as theming };
|
|
162
|
+
let tokens_2: {
|
|
163
|
+
name: any;
|
|
164
|
+
sets: any;
|
|
165
|
+
variesWith: string;
|
|
166
|
+
figma: string;
|
|
167
|
+
}[];
|
|
168
|
+
export { tokens_2 as tokens };
|
|
169
|
+
let composition_2: string[];
|
|
170
|
+
export { composition_2 as composition };
|
|
171
|
+
let accessibility_2: string[];
|
|
172
|
+
export { accessibility_2 as accessibility };
|
|
173
|
+
let gotchas_2: string[];
|
|
174
|
+
export { gotchas_2 as gotchas };
|
|
175
|
+
}
|
|
176
|
+
export namespace ACCORDION_DOC {
|
|
177
|
+
let name_3: string;
|
|
178
|
+
export { name_3 as name };
|
|
179
|
+
let summary_3: string;
|
|
180
|
+
export { summary_3 as summary };
|
|
181
|
+
let insteadUse_3: {
|
|
182
|
+
when: string;
|
|
183
|
+
use: string;
|
|
184
|
+
}[];
|
|
185
|
+
export { insteadUse_3 as insteadUse };
|
|
186
|
+
let props_3: ({
|
|
187
|
+
name: string;
|
|
188
|
+
type: string;
|
|
189
|
+
values: string[];
|
|
190
|
+
default: string;
|
|
191
|
+
note?: undefined;
|
|
192
|
+
} | {
|
|
193
|
+
name: string;
|
|
194
|
+
type: string;
|
|
195
|
+
default: string;
|
|
196
|
+
values?: undefined;
|
|
197
|
+
note?: undefined;
|
|
198
|
+
} | {
|
|
199
|
+
name: string;
|
|
200
|
+
type: string;
|
|
201
|
+
default: string;
|
|
202
|
+
note: string;
|
|
203
|
+
values?: undefined;
|
|
204
|
+
})[];
|
|
205
|
+
export { props_3 as props };
|
|
206
|
+
let states_3: ({
|
|
207
|
+
state: string;
|
|
208
|
+
setBy: string;
|
|
209
|
+
note?: undefined;
|
|
210
|
+
} | {
|
|
211
|
+
state: string;
|
|
212
|
+
setBy: string;
|
|
213
|
+
note: string;
|
|
214
|
+
})[];
|
|
215
|
+
export { states_3 as states };
|
|
216
|
+
let theming_3: {
|
|
217
|
+
collection: string;
|
|
218
|
+
inCode: string;
|
|
219
|
+
inFigma: string;
|
|
220
|
+
}[];
|
|
221
|
+
export { theming_3 as theming };
|
|
222
|
+
let themingNotes_2: string[];
|
|
223
|
+
export { themingNotes_2 as themingNotes };
|
|
224
|
+
let tokens_3: {
|
|
225
|
+
name: any;
|
|
226
|
+
sets: any;
|
|
227
|
+
variesWith: string;
|
|
228
|
+
figma: string;
|
|
229
|
+
}[];
|
|
230
|
+
export { tokens_3 as tokens };
|
|
231
|
+
let composition_3: string[];
|
|
232
|
+
export { composition_3 as composition };
|
|
233
|
+
let accessibility_3: string[];
|
|
234
|
+
export { accessibility_3 as accessibility };
|
|
235
|
+
let gotchas_3: string[];
|
|
236
|
+
export { gotchas_3 as gotchas };
|
|
237
|
+
}
|
|
238
|
+
export const SURFACE_DOCS: ({
|
|
239
|
+
name: string;
|
|
240
|
+
summary: string;
|
|
241
|
+
insteadUse: {
|
|
242
|
+
when: string;
|
|
243
|
+
use: string;
|
|
244
|
+
}[];
|
|
245
|
+
props: ({
|
|
246
|
+
name: string;
|
|
247
|
+
type: string;
|
|
248
|
+
default: string;
|
|
249
|
+
values: string[];
|
|
250
|
+
note: string;
|
|
251
|
+
} | {
|
|
252
|
+
name: string;
|
|
253
|
+
type: string;
|
|
254
|
+
values: string[];
|
|
255
|
+
default: string;
|
|
256
|
+
note?: undefined;
|
|
257
|
+
} | {
|
|
258
|
+
name: string;
|
|
259
|
+
type: string;
|
|
260
|
+
default: string;
|
|
261
|
+
note: string;
|
|
262
|
+
values?: undefined;
|
|
263
|
+
} | {
|
|
264
|
+
name: string;
|
|
265
|
+
type: string;
|
|
266
|
+
default: string;
|
|
267
|
+
values?: undefined;
|
|
268
|
+
note?: undefined;
|
|
269
|
+
})[];
|
|
270
|
+
states: {
|
|
271
|
+
state: string;
|
|
272
|
+
setBy: string;
|
|
273
|
+
note: string;
|
|
274
|
+
}[];
|
|
275
|
+
theming: {
|
|
276
|
+
collection: string;
|
|
277
|
+
inCode: string;
|
|
278
|
+
inFigma: string;
|
|
279
|
+
}[];
|
|
280
|
+
themingNotes: string[];
|
|
281
|
+
tokens: {
|
|
282
|
+
name: string;
|
|
283
|
+
sets: string;
|
|
284
|
+
variesWith: string;
|
|
285
|
+
figma: string;
|
|
286
|
+
}[];
|
|
287
|
+
composition: string[];
|
|
288
|
+
accessibility: string[];
|
|
289
|
+
gotchas: string[];
|
|
290
|
+
} | {
|
|
291
|
+
name: string;
|
|
292
|
+
summary: string;
|
|
293
|
+
insteadUse: {
|
|
294
|
+
when: string;
|
|
295
|
+
use: string;
|
|
296
|
+
}[];
|
|
297
|
+
props: ({
|
|
298
|
+
name: string;
|
|
299
|
+
type: string;
|
|
300
|
+
default: string;
|
|
301
|
+
values?: undefined;
|
|
302
|
+
note?: undefined;
|
|
303
|
+
} | {
|
|
304
|
+
name: string;
|
|
305
|
+
type: string;
|
|
306
|
+
values: string[];
|
|
307
|
+
default: string;
|
|
308
|
+
note?: undefined;
|
|
309
|
+
} | {
|
|
310
|
+
name: string;
|
|
311
|
+
type: string;
|
|
312
|
+
default: string;
|
|
313
|
+
note: string;
|
|
314
|
+
values?: undefined;
|
|
315
|
+
})[];
|
|
316
|
+
states: ({
|
|
317
|
+
state: string;
|
|
318
|
+
setBy: string;
|
|
319
|
+
note?: undefined;
|
|
320
|
+
} | {
|
|
321
|
+
state: string;
|
|
322
|
+
setBy: string;
|
|
323
|
+
note: string;
|
|
324
|
+
})[];
|
|
325
|
+
theming: {
|
|
326
|
+
collection: string;
|
|
327
|
+
inCode: string;
|
|
328
|
+
inFigma: string;
|
|
329
|
+
}[];
|
|
330
|
+
tokens: {
|
|
331
|
+
name: any;
|
|
332
|
+
sets: any;
|
|
333
|
+
variesWith: string;
|
|
334
|
+
figma: string;
|
|
335
|
+
}[];
|
|
336
|
+
composition: string[];
|
|
337
|
+
accessibility: string[];
|
|
338
|
+
gotchas: string[];
|
|
339
|
+
})[];
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/** A component name as it appears in a URL. */
|
|
2
|
+
export function docsSlug(component: any): any;
|
|
3
|
+
/**
|
|
4
|
+
* Where one component's docs live for one design system.
|
|
5
|
+
*
|
|
6
|
+
* A path per component rather than an anchor on a single long page: an anchor
|
|
7
|
+
* depends on the page rendering headings a browser can jump to, and the
|
|
8
|
+
* existing /api/tokens/:uuid/md route serves its content into a <pre>, which
|
|
9
|
+
* has none. A path cannot half-work.
|
|
10
|
+
*/
|
|
11
|
+
export function componentDocsUrl(designSystemId: any, component: any, origin?: string): string;
|
|
12
|
+
/** The index of every component, for the same design system. */
|
|
13
|
+
export function componentDocsIndexUrl(designSystemId: any, origin?: string): string;
|
|
14
|
+
/**
|
|
15
|
+
* The public URL of one component's reference page.
|
|
16
|
+
*
|
|
17
|
+
* Per DESIGN SYSTEM, not per component library: every user imports their own
|
|
18
|
+
* copy of the .fig and gets their own uuid, so a link baked into the template
|
|
19
|
+
* would send all of them to whoever built it.
|
|
20
|
+
*
|
|
21
|
+
* That splits the two Figma fields:
|
|
22
|
+
*
|
|
23
|
+
* description generic. Identical for every user, so it can live in
|
|
24
|
+
* the template and be written once.
|
|
25
|
+
* documentationLinks per user. The plugin writes it at import time, when it
|
|
26
|
+
* knows the design system id and nothing else does.
|
|
27
|
+
*
|
|
28
|
+
* Any path resolves on the host — `public/_redirects` is `/* /index.html 200`,
|
|
29
|
+
* a catch-all that hands every URL to the router — so this needs no server
|
|
30
|
+
* configuration and no anchor.
|
|
31
|
+
*/
|
|
32
|
+
export const DOCS_ORIGIN: "https://omni-design.netlify.app";
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export function hasExample(component: any): boolean;
|
|
2
|
+
/** Does this component have a sample for this prop? */
|
|
3
|
+
export function hasPropExample(component: any, prop: any): boolean;
|
|
4
|
+
export namespace EXAMPLES {
|
|
5
|
+
function Button(): JSX.Element;
|
|
6
|
+
function ButtonGroup(): JSX.Element;
|
|
7
|
+
function Chip(): JSX.Element;
|
|
8
|
+
function Badge(): JSX.Element;
|
|
9
|
+
function Alert(): JSX.Element;
|
|
10
|
+
function Card(): JSX.Element;
|
|
11
|
+
function Avatar(): JSX.Element;
|
|
12
|
+
function Icon(): JSX.Element;
|
|
13
|
+
function Link(): JSX.Element;
|
|
14
|
+
function Divider(): JSX.Element;
|
|
15
|
+
function Checkbox(): JSX.Element;
|
|
16
|
+
function Radio(): JSX.Element;
|
|
17
|
+
function Input(): JSX.Element;
|
|
18
|
+
function SwitchInput(): JSX.Element;
|
|
19
|
+
function Slider(): JSX.Element;
|
|
20
|
+
function Rating(): JSX.Element;
|
|
21
|
+
function Breadcrumbs(): JSX.Element;
|
|
22
|
+
function Pagination(): JSX.Element;
|
|
23
|
+
function Accordion(): JSX.Element;
|
|
24
|
+
function Tabs(): JSX.Element;
|
|
25
|
+
}
|
|
26
|
+
export namespace PROP_EXAMPLES {
|
|
27
|
+
let Button_1: {
|
|
28
|
+
variant: () => JSX.Element;
|
|
29
|
+
size: () => JSX.Element;
|
|
30
|
+
disabled: () => JSX.Element;
|
|
31
|
+
'startDecorator / endDecorator': () => JSX.Element;
|
|
32
|
+
iconOnly: () => JSX.Element;
|
|
33
|
+
elevated: () => JSX.Element;
|
|
34
|
+
fullWidth: () => JSX.Element;
|
|
35
|
+
};
|
|
36
|
+
export { Button_1 as Button };
|
|
37
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export function renderFoundations(): string;
|
|
2
|
+
/**
|
|
3
|
+
* The facts that are not about any one component.
|
|
4
|
+
*
|
|
5
|
+
* Same test as the component docs: every line has to change what an agent
|
|
6
|
+
* writes. That kept five sections and cut the raw tone ramp — an agent uses
|
|
7
|
+
* semantic names, and Color-1..Color-12 across nine palettes is generator
|
|
8
|
+
* internals, volume without decisions.
|
|
9
|
+
*
|
|
10
|
+
* The first section exists because the system does the opposite of what every
|
|
11
|
+
* other one does, and an agent will assume otherwise without being told.
|
|
12
|
+
*/
|
|
13
|
+
export const FOUNDATIONS: ({
|
|
14
|
+
title: string;
|
|
15
|
+
lede: string;
|
|
16
|
+
body: string[];
|
|
17
|
+
table: {
|
|
18
|
+
head: string[];
|
|
19
|
+
rows: string[][];
|
|
20
|
+
};
|
|
21
|
+
trap: string;
|
|
22
|
+
} | {
|
|
23
|
+
title: string;
|
|
24
|
+
lede: string;
|
|
25
|
+
body: string[];
|
|
26
|
+
trap: string;
|
|
27
|
+
table?: undefined;
|
|
28
|
+
})[];
|
package/docs/components.md
CHANGED
|
@@ -33,7 +33,7 @@ special chromeless variant for low-emphasis actions.
|
|
|
33
33
|
### Import
|
|
34
34
|
|
|
35
35
|
```jsx
|
|
36
|
-
import { Button } from '@
|
|
36
|
+
import { Button } from '@omni-design/components';
|
|
37
37
|
```
|
|
38
38
|
|
|
39
39
|
### Props
|
|
@@ -108,7 +108,7 @@ spaced and connected (border-collapsing) layouts.
|
|
|
108
108
|
### Import
|
|
109
109
|
|
|
110
110
|
```jsx
|
|
111
|
-
import { ButtonGroup, Button } from '@
|
|
111
|
+
import { ButtonGroup, Button } from '@omni-design/components';
|
|
112
112
|
```
|
|
113
113
|
|
|
114
114
|
### Props
|
|
@@ -176,7 +176,7 @@ import {
|
|
|
176
176
|
CheckboxGroup,
|
|
177
177
|
CheckboxWithDescription,
|
|
178
178
|
IndeterminateCheckbox,
|
|
179
|
-
} from '@
|
|
179
|
+
} from '@omni-design/components';
|
|
180
180
|
```
|
|
181
181
|
|
|
182
182
|
### Checkbox Props
|
|
@@ -300,7 +300,7 @@ label positions, three sizes, and validation states.
|
|
|
300
300
|
### Import
|
|
301
301
|
|
|
302
302
|
```jsx
|
|
303
|
-
import { Input } from '@
|
|
303
|
+
import { Input } from '@omni-design/components';
|
|
304
304
|
```
|
|
305
305
|
|
|
306
306
|
### Props
|
|
@@ -395,84 +395,100 @@ variable resolves correctly.
|
|
|
395
395
|
|
|
396
396
|
## Chip
|
|
397
397
|
|
|
398
|
-
|
|
399
|
-
|
|
398
|
+
A small surface you can toggle — a filter, a choice, a tag on an input. If it
|
|
399
|
+
only labels something and cannot be clicked, use **Tag** instead.
|
|
400
400
|
|
|
401
401
|
### Import
|
|
402
402
|
|
|
403
403
|
```jsx
|
|
404
|
-
import { Chip } from '@
|
|
404
|
+
import { Chip } from '@omni-design/components';
|
|
405
405
|
```
|
|
406
406
|
|
|
407
|
+
### Colour and selection are different axes
|
|
408
|
+
|
|
409
|
+
This is the part worth reading. **There is no solid/outline shape axis**, and
|
|
410
|
+
there is no `color` prop.
|
|
411
|
+
|
|
412
|
+
- **Colour** comes from `variant`, which sets `data-theme` on the chip.
|
|
413
|
+
- **Selection** is a SURFACE LEVEL, not a different fill:
|
|
414
|
+
|
|
415
|
+
| | `data-surface` |
|
|
416
|
+
| --- | --- |
|
|
417
|
+
| unselected | `Surface-Brightest` |
|
|
418
|
+
| selected | `Surface-Dimmest` |
|
|
419
|
+
|
|
420
|
+
Both levels paint `var(--Background)` with a `var(--Border)` edge, so one
|
|
421
|
+
`data-theme` drives both states and `--Text`, `--Hover` and `--Pressed` come
|
|
422
|
+
along paired. Change the theme and both states move together.
|
|
423
|
+
|
|
424
|
+
`variant="default"` sets no `data-theme` at all and INHERITS, so a chip inside a
|
|
425
|
+
themed region takes that region's colour.
|
|
426
|
+
|
|
427
|
+
`-outline` and `-light` still render and warn once in development. Do not write
|
|
428
|
+
new ones: `-outline` was the unselected chip under another name, which let the
|
|
429
|
+
component express four combinations against the design's two.
|
|
430
|
+
|
|
407
431
|
### Props
|
|
408
432
|
|
|
409
|
-
| Prop | Type | Default |
|
|
433
|
+
| Prop | Type | Default | Notes |
|
|
410
434
|
|---|---|---|---|
|
|
411
|
-
| `
|
|
412
|
-
| `
|
|
413
|
-
| `
|
|
414
|
-
| `
|
|
435
|
+
| `variant` | string | `'primary'` | The COLOUR: `default` + the 8 palettes |
|
|
436
|
+
| `label` | node | — | Also accepts `children` |
|
|
437
|
+
| `selected` | boolean | `false` | Switches the surface level, not the fill |
|
|
438
|
+
| `selectionMode` | string | — | `radio` or `checkbox` — adds the ARIA role |
|
|
415
439
|
| `clickable` | boolean | `false` | — |
|
|
416
|
-
| `
|
|
417
|
-
| `onDelete` | function | — |
|
|
418
|
-
| `
|
|
419
|
-
| `icon` | node | — | Leading icon |
|
|
420
|
-
| `selected` | boolean | `false` | Visual selected state for clickable chips |
|
|
440
|
+
| `onClick` | function | — | Implies `clickable` |
|
|
441
|
+
| `onDelete` | function | — | Adds the dismiss affordance |
|
|
442
|
+
| `startDecorator` / `endDecorator` | node | — | Icon or avatar |
|
|
421
443
|
| `disabled` | boolean | `false` | — |
|
|
422
444
|
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
**Non-clickable outline:** `--Tags-{Color}-BG` (border), `--Text`
|
|
445
|
+
**There is no `size` prop.** Chip has ONE size, 24px, matching the Figma set,
|
|
446
|
+
which carries no size axis. Component sizing in this system comes from the
|
|
447
|
+
`Component-Size` modes rather than a per-component ladder. A `size` passed
|
|
448
|
+
anyway is ignored and warns once.
|
|
428
449
|
|
|
429
|
-
|
|
430
|
-
`--Buttons-{Color}-Hover`, `--Buttons-{Color}-Active`
|
|
450
|
+
### Tokens consumed
|
|
431
451
|
|
|
432
|
-
|
|
433
|
-
`--
|
|
452
|
+
All of them resolve from the chip's own `data-theme` + `data-surface` zone:
|
|
453
|
+
`--Background` (the body), `--Text` (the label), `--Border` (the outline), plus
|
|
454
|
+
`--Hover` and `--Pressed`.
|
|
434
455
|
|
|
435
456
|
### Examples
|
|
436
457
|
|
|
437
458
|
```jsx
|
|
438
|
-
//
|
|
439
|
-
<Chip
|
|
440
|
-
<Chip
|
|
441
|
-
|
|
459
|
+
// Colour comes from variant
|
|
460
|
+
<Chip variant="success">Active</Chip>
|
|
461
|
+
<Chip variant="warning">Pending</Chip>
|
|
462
|
+
|
|
463
|
+
// Inherits the surrounding theme
|
|
464
|
+
<Chip variant="default">Neutral</Chip>
|
|
442
465
|
|
|
443
|
-
//
|
|
466
|
+
// Selectable — selection changes the SURFACE, not the colour
|
|
444
467
|
<Chip
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
clickable
|
|
468
|
+
variant="primary"
|
|
469
|
+
selectionMode="checkbox"
|
|
448
470
|
selected={selected}
|
|
449
471
|
onClick={() => setSelected(!selected)}
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
<Chip
|
|
454
|
-
label="React"
|
|
455
|
-
color="info"
|
|
456
|
-
deletable
|
|
457
|
-
onDelete={() => removeTag('react')}
|
|
458
|
-
/>
|
|
459
|
-
|
|
460
|
-
// With icon
|
|
461
|
-
<Chip label="Verified" color="success" icon={<CheckIcon />} />
|
|
472
|
+
>
|
|
473
|
+
Design
|
|
474
|
+
</Chip>
|
|
462
475
|
|
|
463
|
-
//
|
|
464
|
-
<Chip
|
|
465
|
-
|
|
476
|
+
// Dismissible, with a leading icon
|
|
477
|
+
<Chip variant="info" startDecorator={<TagIcon />} onDelete={() => remove('react')}>
|
|
478
|
+
React
|
|
479
|
+
</Chip>
|
|
466
480
|
```
|
|
467
481
|
|
|
468
482
|
### Accessibility notes
|
|
469
483
|
|
|
470
|
-
-
|
|
471
|
-
-
|
|
472
|
-
-
|
|
484
|
+
- A dismissible chip's X is labelled with what it removes, not "close".
|
|
485
|
+
- A selectable chip announces its own selected state — do not add `aria-pressed`.
|
|
486
|
+
- The 24x24 minimum touch target (WCAG 2.5.8) is carried by a pseudo-element,
|
|
487
|
+
so the chip stays 24px tall without the target shrinking.
|
|
473
488
|
|
|
474
489
|
---
|
|
475
490
|
|
|
491
|
+
|
|
476
492
|
## Stack
|
|
477
493
|
|
|
478
494
|
Flexible layout primitive for arranging children in a row or column with
|
|
@@ -494,7 +510,7 @@ import {
|
|
|
494
510
|
InsetStack,
|
|
495
511
|
ScrollStack,
|
|
496
512
|
WrapStack,
|
|
497
|
-
} from '@
|
|
513
|
+
} from '@omni-design/components';
|
|
498
514
|
```
|
|
499
515
|
|
|
500
516
|
### Stack Props
|
|
@@ -576,7 +592,7 @@ as Button.
|
|
|
576
592
|
### Import
|
|
577
593
|
|
|
578
594
|
```jsx
|
|
579
|
-
import { Tabs, TabPanel } from '@
|
|
595
|
+
import { Tabs, TabPanel } from '@omni-design/components';
|
|
580
596
|
```
|
|
581
597
|
|
|
582
598
|
### Tabs Props
|
|
@@ -686,7 +702,7 @@ all child components automatically inherit the correct color context.
|
|
|
686
702
|
### Import
|
|
687
703
|
|
|
688
704
|
```jsx
|
|
689
|
-
import { Card } from '@
|
|
705
|
+
import { Card } from '@omni-design/components';
|
|
690
706
|
```
|
|
691
707
|
|
|
692
708
|
### Props
|
package/package.json
CHANGED