@maskingtech/designsystem 0.0.1
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/LICENCE +23 -0
- package/README.md +528 -0
- package/dist/mtds.css +1 -0
- package/dist/mtds.d.ts +241 -0
- package/dist/mtds.js +491 -0
- package/package.json +40 -0
package/LICENCE
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
|
|
2
|
+
(The MIT License)
|
|
3
|
+
|
|
4
|
+
Copyright (c) 2025 Masking Technology B.V. <https://masking.tech>
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
7
|
+
a copy of this software and associated documentation files (the
|
|
8
|
+
'Software'), to deal in the Software without restriction, including
|
|
9
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
10
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
11
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
12
|
+
the following conditions:
|
|
13
|
+
|
|
14
|
+
The above copyright notice and this permission notice shall be
|
|
15
|
+
included in all copies or substantial portions of the Software.
|
|
16
|
+
|
|
17
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
18
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
19
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
20
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
21
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
22
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
23
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,528 @@
|
|
|
1
|
+
# Design System | Masking Technology
|
|
2
|
+
|
|
3
|
+
Simple design system used for our internal projects.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @maskingtech/designsystem
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Basic elements
|
|
12
|
+
|
|
13
|
+
### Avatar
|
|
14
|
+
|
|
15
|
+
A rounded image element.
|
|
16
|
+
|
|
17
|
+
Properties:
|
|
18
|
+
|
|
19
|
+
- **source** - string (required)
|
|
20
|
+
- **title** - string (optional)
|
|
21
|
+
- **alt** - string (optional)
|
|
22
|
+
- **width** - string (optional)
|
|
23
|
+
- **height** - string (optional)
|
|
24
|
+
- **fit** - `fill` | `contain` | `cover` | `none` | `scale-down` (optional, default `contain`)
|
|
25
|
+
|
|
26
|
+
Example:
|
|
27
|
+
|
|
28
|
+
```tsx
|
|
29
|
+
import { Avatar } from '@maskingtech/designsystem';
|
|
30
|
+
|
|
31
|
+
<Avatar
|
|
32
|
+
source='http://example.com/avatar.png'
|
|
33
|
+
title='My avatar'
|
|
34
|
+
alt='My avatar'
|
|
35
|
+
width='100px'
|
|
36
|
+
/>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Border
|
|
40
|
+
|
|
41
|
+
A bordered container element.
|
|
42
|
+
|
|
43
|
+
Properties:
|
|
44
|
+
|
|
45
|
+
- **type** - `normal`| `dashed` | `dotted` (optional, default `normal`)
|
|
46
|
+
- **size** - `large` | `medium` | `small` (optional, default `large`)
|
|
47
|
+
- **padding** - `large` | `medium` | `small` | `none` (optional, default `large`)
|
|
48
|
+
|
|
49
|
+
Example:
|
|
50
|
+
|
|
51
|
+
```tsx
|
|
52
|
+
import { Border } from '@maskingtech/designsystem';
|
|
53
|
+
|
|
54
|
+
<Border size='small' padding='small'>
|
|
55
|
+
<p>This is the bordered content</p>
|
|
56
|
+
</Border>
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Button
|
|
60
|
+
|
|
61
|
+
A clickable input element styled as a button.
|
|
62
|
+
|
|
63
|
+
Properties:
|
|
64
|
+
|
|
65
|
+
- **type** - `submit` | `primary` | `secondary` | `disabled` (optional, default `primary`)
|
|
66
|
+
- **size** - `large` | `medium` | `small` (optional, default `medium`)
|
|
67
|
+
- **text** - string (required)
|
|
68
|
+
- **onClick** - `() => void` (optional)
|
|
69
|
+
|
|
70
|
+
Example:
|
|
71
|
+
|
|
72
|
+
```tsx
|
|
73
|
+
import { Button } from '@maskingtech.designsystem';
|
|
74
|
+
|
|
75
|
+
<Button type='primary' size='medium' text='Save' onClick={() => console.log('clicked')} />
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Cell
|
|
79
|
+
|
|
80
|
+
A layout cell that can be fixed or fluid.
|
|
81
|
+
|
|
82
|
+
Properties:
|
|
83
|
+
|
|
84
|
+
- **sizing** - `fixed` | `fluid` (optional, default `fluid`)
|
|
85
|
+
- **children** - ReactNode
|
|
86
|
+
|
|
87
|
+
Example:
|
|
88
|
+
|
|
89
|
+
```tsx
|
|
90
|
+
import { Cell } from '@maskingtech.designsystem';
|
|
91
|
+
|
|
92
|
+
<Cell sizing='fixed'>Fixed content</Cell>
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### ClickArea
|
|
96
|
+
|
|
97
|
+
A wrapper element that handles clicks and optional padding.
|
|
98
|
+
|
|
99
|
+
Properties:
|
|
100
|
+
|
|
101
|
+
- **padding** - `large` | `medium` | `small` | `none` (optional, default `none`)
|
|
102
|
+
- **onClick** - `() => void` (optional)
|
|
103
|
+
- **children** - ReactNode (optional)
|
|
104
|
+
|
|
105
|
+
Example:
|
|
106
|
+
|
|
107
|
+
```tsx
|
|
108
|
+
import { ClickArea } from '@maskingtech.designsystem';
|
|
109
|
+
|
|
110
|
+
<ClickArea padding='small' onClick={() => alert('clicked')}>Clickable content</ClickArea>
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Column
|
|
114
|
+
|
|
115
|
+
A vertical layout container with alignment and gap options.
|
|
116
|
+
|
|
117
|
+
Properties:
|
|
118
|
+
|
|
119
|
+
- **alignX** - `left` | `center` | `right` | `stretch` (optional, default `left`)
|
|
120
|
+
- **alignY** - `top` | `center` | `bottom` | `justify` (optional, default `top`)
|
|
121
|
+
- **gap** - `large` | `medium` | `small` | `none` (optional, default `medium`)
|
|
122
|
+
- **wrap** - `wrap` | `nowrap` (optional, default `nowrap`)
|
|
123
|
+
- **children** - ReactNode
|
|
124
|
+
|
|
125
|
+
Example:
|
|
126
|
+
|
|
127
|
+
```tsx
|
|
128
|
+
import { Column } from '@maskingtech.designsystem';
|
|
129
|
+
|
|
130
|
+
<Column alignX='center' gap='small'>
|
|
131
|
+
<div>Item 1</div>
|
|
132
|
+
<div>Item 2</div>
|
|
133
|
+
</Column>
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### Form
|
|
137
|
+
|
|
138
|
+
A form wrapper that prevents default submit and forwards the form element via a handler.
|
|
139
|
+
|
|
140
|
+
Properties:
|
|
141
|
+
|
|
142
|
+
- **children** - ReactNode
|
|
143
|
+
- **submitHandler** - `(form: HTMLFormElement) => void` (optional)
|
|
144
|
+
|
|
145
|
+
Example:
|
|
146
|
+
|
|
147
|
+
```tsx
|
|
148
|
+
import { Form } from '@maskingtech.designsystem';
|
|
149
|
+
|
|
150
|
+
<Form submitHandler={(form) => console.log('submit', form)}>
|
|
151
|
+
{/* inputs here */}
|
|
152
|
+
</Form>
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### Grid
|
|
156
|
+
|
|
157
|
+
A grid layout with preset column layouts and gaps.
|
|
158
|
+
|
|
159
|
+
Properties:
|
|
160
|
+
|
|
161
|
+
- **layout** - `two-columns` | `three-columns` | `four-columns` (required)
|
|
162
|
+
- **gap** - `large` | `medium` | `small` | `none` (optional, default `medium`)
|
|
163
|
+
- **children** - ReactNode
|
|
164
|
+
|
|
165
|
+
Example:
|
|
166
|
+
|
|
167
|
+
```tsx
|
|
168
|
+
import { Grid } from '@maskingtech.designsystem';
|
|
169
|
+
|
|
170
|
+
<Grid layout='three-columns' gap='small'>
|
|
171
|
+
<div>1</div>
|
|
172
|
+
<div>2</div>
|
|
173
|
+
<div>3</div>
|
|
174
|
+
</Grid>
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### Icon
|
|
178
|
+
|
|
179
|
+
A simple icon span using a set of predefined icon types.
|
|
180
|
+
|
|
181
|
+
Properties:
|
|
182
|
+
|
|
183
|
+
- **type** - one of the supported icon identifiers (e.g. `attachment`, `bookmark`, `close`, `user`, `search`, etc.) (required)
|
|
184
|
+
|
|
185
|
+
Example:
|
|
186
|
+
|
|
187
|
+
```tsx
|
|
188
|
+
import { Icon } from '@maskingtech.designsystem';
|
|
189
|
+
|
|
190
|
+
<Icon type='search' />
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
### Image
|
|
194
|
+
|
|
195
|
+
A styled image element.
|
|
196
|
+
|
|
197
|
+
Properties:
|
|
198
|
+
|
|
199
|
+
- **source** - string (required)
|
|
200
|
+
- **title** - string (optional)
|
|
201
|
+
- **alt** - string (optional)
|
|
202
|
+
- **width** - string (optional)
|
|
203
|
+
- **height** - string (optional)
|
|
204
|
+
- **fit** - `fill` | `contain` | `cover` | `none` | `scale-down` (optional, default `contain`)
|
|
205
|
+
|
|
206
|
+
Example:
|
|
207
|
+
|
|
208
|
+
```tsx
|
|
209
|
+
import { Image } from '@maskingtech.designsystem';
|
|
210
|
+
|
|
211
|
+
<Image source='http://example.com/photo.jpg' alt='Example' width='200px' fit='cover' />
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
### Input
|
|
215
|
+
|
|
216
|
+
A labeled input wrapper that composes `Label` with an input element (`TextBox`, `TextArea` or `Select`).
|
|
217
|
+
|
|
218
|
+
Properties:
|
|
219
|
+
|
|
220
|
+
- **label** - `ReactElement<LabelProps>` (required)
|
|
221
|
+
- **element** - `ReactElement<TextBoxProps | TextAreaProps | SelectProps>` (required)
|
|
222
|
+
|
|
223
|
+
Example:
|
|
224
|
+
|
|
225
|
+
```tsx
|
|
226
|
+
import { Input, Label, TextBox } from '@maskingtech.designsystem';
|
|
227
|
+
|
|
228
|
+
<Input label={<Label value='Name' />} element={<TextBox name='name' />} />
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
### Label
|
|
232
|
+
|
|
233
|
+
Simple text label for inputs.
|
|
234
|
+
|
|
235
|
+
Properties:
|
|
236
|
+
|
|
237
|
+
- **value** - string (required)
|
|
238
|
+
|
|
239
|
+
Example:
|
|
240
|
+
|
|
241
|
+
```tsx
|
|
242
|
+
import { Label } from '@maskingtech.designsystem';
|
|
243
|
+
|
|
244
|
+
<Label value='Email' />
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
### Link
|
|
248
|
+
|
|
249
|
+
A styled anchor element.
|
|
250
|
+
|
|
251
|
+
Properties:
|
|
252
|
+
|
|
253
|
+
- **url** - string (optional)
|
|
254
|
+
- **target** - string (optional)
|
|
255
|
+
- **children** - ReactNode
|
|
256
|
+
|
|
257
|
+
Example:
|
|
258
|
+
|
|
259
|
+
```tsx
|
|
260
|
+
import { Link } from '@maskingtech.designsystem';
|
|
261
|
+
|
|
262
|
+
<Link url='https://example.com' target='_blank'>Visit</Link>
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
### Modal
|
|
266
|
+
|
|
267
|
+
A modal dialog built on the native `<dialog>` element.
|
|
268
|
+
|
|
269
|
+
Properties:
|
|
270
|
+
|
|
271
|
+
- **open** - boolean (required)
|
|
272
|
+
- **sizing** - `full` | `content` (optional, default `content`)
|
|
273
|
+
- **children** - ReactNode (optional)
|
|
274
|
+
|
|
275
|
+
Example:
|
|
276
|
+
|
|
277
|
+
```tsx
|
|
278
|
+
import { Modal } from '@maskingtech.designsystem';
|
|
279
|
+
|
|
280
|
+
<Modal open={true} sizing='content'>
|
|
281
|
+
<p>Modal content</p>
|
|
282
|
+
</Modal>
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
### Panel
|
|
286
|
+
|
|
287
|
+
A versatile container for contextual content (alerts, messages, etc.).
|
|
288
|
+
|
|
289
|
+
Properties:
|
|
290
|
+
|
|
291
|
+
- **type** - `normal` | `alert` | `warning` | `success` | `error` | `transparent` (optional, default `normal`)
|
|
292
|
+
- **padding** - `large` | `medium` | `small` (optional, default `large`)
|
|
293
|
+
- **children** - ReactNode (optional)
|
|
294
|
+
|
|
295
|
+
Example:
|
|
296
|
+
|
|
297
|
+
```tsx
|
|
298
|
+
import { Panel } from '@maskingtech.designsystem';
|
|
299
|
+
|
|
300
|
+
<Panel type='warning' padding='small'>Check this out</Panel>
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
### Paragraph
|
|
304
|
+
|
|
305
|
+
Styled paragraph element.
|
|
306
|
+
|
|
307
|
+
Properties:
|
|
308
|
+
|
|
309
|
+
- **size** - `large` | `medium` | `small` (optional, default `medium`)
|
|
310
|
+
- **children** - ReactNode
|
|
311
|
+
|
|
312
|
+
Example:
|
|
313
|
+
|
|
314
|
+
```tsx
|
|
315
|
+
import { Paragraph } from '@maskingtech.designsystem';
|
|
316
|
+
|
|
317
|
+
<Paragraph size='small'>A short paragraph.</Paragraph>
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
### Row
|
|
321
|
+
|
|
322
|
+
A horizontal layout container with alignment and gap options.
|
|
323
|
+
|
|
324
|
+
Properties:
|
|
325
|
+
|
|
326
|
+
- **alignX** - `left` | `center` | `right` | `justify` (optional, default `left`)
|
|
327
|
+
- **alignY** - `top` | `center` | `bottom` | `stretch` (optional, default `top`)
|
|
328
|
+
- **gap** - `large` | `medium` | `small` | `none` (optional, default `medium`)
|
|
329
|
+
- **wrap** - `wrap` | `nowrap` (optional, default `nowrap`)
|
|
330
|
+
- **children** - ReactNode
|
|
331
|
+
|
|
332
|
+
Example:
|
|
333
|
+
|
|
334
|
+
```tsx
|
|
335
|
+
import { Row } from '@maskingtech.designsystem';
|
|
336
|
+
|
|
337
|
+
<Row alignX='center' gap='large'>
|
|
338
|
+
<div>Left</div>
|
|
339
|
+
<div>Right</div>
|
|
340
|
+
</Row>
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
### Ruler
|
|
344
|
+
|
|
345
|
+
A decorative divider either horizontal or vertical.
|
|
346
|
+
|
|
347
|
+
Properties:
|
|
348
|
+
|
|
349
|
+
- **direction** - `horizontal` | `vertical` (required)
|
|
350
|
+
- **size** - `small` | `medium` | `large` (optional, default `medium`)
|
|
351
|
+
|
|
352
|
+
Example:
|
|
353
|
+
|
|
354
|
+
```tsx
|
|
355
|
+
import { Ruler } from '@maskingtech.designsystem';
|
|
356
|
+
|
|
357
|
+
<Ruler direction='horizontal' />
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
### Select
|
|
361
|
+
|
|
362
|
+
A styled select element that accepts a `Map` of options.
|
|
363
|
+
|
|
364
|
+
Properties:
|
|
365
|
+
|
|
366
|
+
- **name** - string (required)
|
|
367
|
+
- **options** - `Map<string, string>` (required)
|
|
368
|
+
- **value** - string (optional)
|
|
369
|
+
- **size** - `large` | `medium` | `small` (optional, default `medium`)
|
|
370
|
+
- **onChange** - `ChangeEventHandler<HTMLSelectElement>` (optional)
|
|
371
|
+
|
|
372
|
+
Example:
|
|
373
|
+
|
|
374
|
+
```tsx
|
|
375
|
+
import { Select } from '@maskingtech.designsystem';
|
|
376
|
+
|
|
377
|
+
const options = new Map([['a', 'Option A'], ['b', 'Option B']]);
|
|
378
|
+
|
|
379
|
+
<Select name='example' options={options} />
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
### Spinner
|
|
383
|
+
|
|
384
|
+
A small loading indicator.
|
|
385
|
+
|
|
386
|
+
Properties:
|
|
387
|
+
|
|
388
|
+
- **active** - boolean (optional, default `true`)
|
|
389
|
+
|
|
390
|
+
Example:
|
|
391
|
+
|
|
392
|
+
```tsx
|
|
393
|
+
import { Spinner } from '@maskingtech.designsystem';
|
|
394
|
+
|
|
395
|
+
<Spinner active={true} />
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
### Text
|
|
399
|
+
|
|
400
|
+
Inline text element with variants for type, size and weight.
|
|
401
|
+
|
|
402
|
+
Properties:
|
|
403
|
+
|
|
404
|
+
- **value** - string (required)
|
|
405
|
+
- **type** - `primary` | `secondary` (optional, default `primary`)
|
|
406
|
+
- **size** - `large` | `medium` | `small` (optional, default `medium`)
|
|
407
|
+
- **weight** - `light` | `normal` | `bold` (optional, default `normal`)
|
|
408
|
+
- **wrap** - `none` | `normal` | `break-word` (optional, default `none`)
|
|
409
|
+
|
|
410
|
+
Example:
|
|
411
|
+
|
|
412
|
+
```tsx
|
|
413
|
+
import { Text } from '@maskingtech.designsystem';
|
|
414
|
+
|
|
415
|
+
<Text value='Label' type='secondary' size='small' />
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
### TextArea
|
|
419
|
+
|
|
420
|
+
A multiline text input.
|
|
421
|
+
|
|
422
|
+
Properties:
|
|
423
|
+
|
|
424
|
+
- **name** - string (required)
|
|
425
|
+
- **placeholder** - string (optional)
|
|
426
|
+
- **value** - string (optional)
|
|
427
|
+
- **size** - `large` | `medium` | `small` (optional, default `medium`)
|
|
428
|
+
- **rows** - number (optional)
|
|
429
|
+
- **limit** - number (optional)
|
|
430
|
+
- **onChange** - `ChangeEventHandler<HTMLTextAreaElement>` (optional)
|
|
431
|
+
|
|
432
|
+
Example:
|
|
433
|
+
|
|
434
|
+
```tsx
|
|
435
|
+
import { TextArea } from '@maskingtech.designsystem';
|
|
436
|
+
|
|
437
|
+
<TextArea name='message' placeholder='Write...' rows={4} />
|
|
438
|
+
```
|
|
439
|
+
|
|
440
|
+
### TextBox
|
|
441
|
+
|
|
442
|
+
A single-line text input.
|
|
443
|
+
|
|
444
|
+
Properties:
|
|
445
|
+
|
|
446
|
+
- **name** - string (required)
|
|
447
|
+
- **placeholder** - string (optional)
|
|
448
|
+
- **value** - string (optional)
|
|
449
|
+
- **limit** - number (optional)
|
|
450
|
+
- **pattern** - string (optional)
|
|
451
|
+
- **title** - string (optional)
|
|
452
|
+
- **size** - `large` | `medium` | `small` (optional, default `medium`)
|
|
453
|
+
- **required** - boolean (optional)
|
|
454
|
+
- **onChange** - `ChangeEventHandler<HTMLInputElement>` (optional)
|
|
455
|
+
|
|
456
|
+
Example:
|
|
457
|
+
|
|
458
|
+
```tsx
|
|
459
|
+
import { TextBox } from '@maskingtech.designsystem';
|
|
460
|
+
|
|
461
|
+
<TextBox name='firstName' placeholder='First name' />
|
|
462
|
+
```
|
|
463
|
+
|
|
464
|
+
### Title
|
|
465
|
+
|
|
466
|
+
Heading element that maps `size` to `h1`/`h2`/`h3`.
|
|
467
|
+
|
|
468
|
+
Properties:
|
|
469
|
+
|
|
470
|
+
- **size** - `large` | `medium` | `small` (optional, default `large`)
|
|
471
|
+
- **children** - ReactNode
|
|
472
|
+
|
|
473
|
+
Example:
|
|
474
|
+
|
|
475
|
+
```tsx
|
|
476
|
+
import { Title } from '@maskingtech.designsystem';
|
|
477
|
+
|
|
478
|
+
<Title size='medium'>Section title</Title>
|
|
479
|
+
```
|
|
480
|
+
|
|
481
|
+
## Components
|
|
482
|
+
|
|
483
|
+
### Dropdown
|
|
484
|
+
|
|
485
|
+
Simple selection dropdown (custom UI) that accepts a `Map` of options.
|
|
486
|
+
|
|
487
|
+
Properties:
|
|
488
|
+
|
|
489
|
+
- **options** - `Map<string, string>` (required)
|
|
490
|
+
- **selected** - string (optional, key of the selected option)
|
|
491
|
+
- **onChange** - `(oldKey: string, newKey: string) => void` (optional)
|
|
492
|
+
|
|
493
|
+
Example:
|
|
494
|
+
|
|
495
|
+
```tsx
|
|
496
|
+
import { Dropdown } from '@maskingtech.designsystem';
|
|
497
|
+
|
|
498
|
+
const opts = new Map([['a','A'],['b','B']]);
|
|
499
|
+
<Dropdown options={opts} selected='a' onChange={(o,n)=>console.log(o,n)} />
|
|
500
|
+
```
|
|
501
|
+
|
|
502
|
+
### Tabs / Tab
|
|
503
|
+
|
|
504
|
+
Tabs provide a tabbed navigation. Use `Tab` elements as children of `Tabs`.
|
|
505
|
+
|
|
506
|
+
`Tabs` Properties:
|
|
507
|
+
|
|
508
|
+
- **separator** - ReactNode (optional)
|
|
509
|
+
- **selectedId** - string (optional)
|
|
510
|
+
- **children** - one or more `Tab` elements (required)
|
|
511
|
+
- **onChange** - `(newId: string, oldId?: string) => void` (optional)
|
|
512
|
+
|
|
513
|
+
`Tab` Properties:
|
|
514
|
+
|
|
515
|
+
- **id** - string (required)
|
|
516
|
+
- **title** - ReactNode (required)
|
|
517
|
+
- **children** - ReactNode (required)
|
|
518
|
+
|
|
519
|
+
Example:
|
|
520
|
+
|
|
521
|
+
```tsx
|
|
522
|
+
import { Tabs, Tab } from '@maskingtech.designsystem';
|
|
523
|
+
|
|
524
|
+
<Tabs selectedId='tab1' onChange={(n,o)=>console.log(n,o)}>
|
|
525
|
+
<Tab id='tab1' title='First'>First content</Tab>
|
|
526
|
+
<Tab id='tab2' title='Second'>Second content</Tab>
|
|
527
|
+
</Tabs>
|
|
528
|
+
```
|
package/dist/mtds.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.ds .selection{--background-color: transparent;--background-color-options: var(--color-primary-background);--background-color-options-hover: var(--color-background-hover);--arrow-color: var(--color-alert-foreground);--border-color: var(--color-border);display:inline-block;position:relative;min-width:fit-content;cursor:pointer}.ds .selection .text{background-color:var(--background-color);padding:.8em 2em .8em 0}.ds .selection .text:after{content:"";position:absolute;right:.7em;top:1.2em;border:.45em solid transparent;border-color:var(--arrow-color) transparent transparent transparent}.ds .selection .text.active:after{top:.8em;border-color:transparent transparent var(--arrow-color) transparent}.ds .selection .options{position:absolute;min-width:fit-content;white-space:nowrap;text-align:left;background-color:var(--background-color-options);border:.1em solid var(--border-color)}.ds .selection .options .option{padding:.8em 2em .8em .8em;background:var(--color-primary-background);cursor:pointer}.ds .selection .options .option:hover{background-color:var(--background-color-options-hover)}.ds .tabs{--margin: var(--margin-container);--foreground-color: var(--color-primary-foreground);--font-size-nav: 1.1em;--background-color-nav-item: transparent;--background-color-nav-item-active: var(--background-color-nav-item);--background-color-nav-item-hover: var(--color-background-hover);--padding-nav-item: .5em 1em;--margin-separator: .2em 0 1em 0;display:flex;flex-direction:column;margin:var(--margin)}.ds .tabs .nav{display:flex;flex-direction:row;justify-content:center;color:var(--foreground-color);font-size:var(--font-size-nav)}.ds .tabs .nav .item{background:var(--background-color-nav-item);cursor:pointer;padding:var(--padding-nav-item);width:100%;text-align:center}.ds .tabs .nav .item:hover,.ds .tabs .nav .item.active:hover{background:var(--background-color-nav-item-hover)}.ds .tabs .nav .item.active{background:var(--background-color-nav-item-active);font-weight:var(--font-weight-bold)}.ds .tabs .separator{margin:var(--margin-separator)}.ds .avatar{border-radius:50%}.ds .avatar.fit-fill{object-fit:fill}.ds .avatar.fit-contain{object-fit:contain}.ds .avatar.fit-cover{object-fit:cover}.ds .avatar.fit-none{object-fit:none}.ds .avatar.fit-scale-down{object-fit:scale-down}.ds .border{--border-radius: 0;--margin: 0;--color: var(--color-border);--size-large: .3em;--size-medium: .2em;--size-small: .1em;--padding-large: 2em;--padding-medium: 1.5em;--padding-small: 1em;border-color:var(--color);border-radius:var(--border-radius);margin:var(--margin);min-width:0}.ds .border.type-normal{border-style:solid}.ds .border.type-dashed{border-style:dashed}.ds .border.type-dotted{border-style:dotted}.ds .border.size-large{border-width:var(--size-large)}.ds .border.size-medium{border-width:var(--size-medium)}.ds .border.size-small{border-width:var(--size-small)}.ds .border.padding-none{padding:0}.ds .border.padding-small{padding:var(--padding-small)}.ds .border.padding-medium{padding:var(--padding-medium)}.ds .border.padding-large{padding:var(--padding-large)}.ds .button{--margin: 0em;--padding-small: .2em 2.2em;--padding-medium: .5em 2.2em;--padding-large: .9em 2.2em;--border-radius: 2em;--border-style: solid;--border-color: var(--color-border);--border-width: var(--width-border);--primary-background-color: var(--color-primary-action-background);--primary-foreground-color: var(--color-primary-action-foreground);--secondary-background-color: var(--color-secondary-action-background);--secondary-foreground-color: var(--color-secondary-action-foreground);--disabled-background-color: transparent;border-radius:var(--border-radius);border:0;cursor:pointer;margin:var(--margin);text-align:center;width:fit-content;font-family:inherit;font-size:inherit}.ds .button.size-small{padding:var(--padding-small)}.ds .button.size-medium{padding:var(--padding-medium)}.ds .button.size-large{padding:var(--padding-large)}.ds .button.type-primary,.ds .button.type-submit{background-color:var(--primary-background-color);color:var(--primary-foreground-color);font-weight:var(--font-weight-bold)}.ds .button.type-primary:hover,.ds .button.type-submit:hover{background-color:color-mix(in srgb,black 10%,var(--primary-background-color))}.ds .button.type-primary:focus{background-color:color-mix(in srgb,black 20%,var(--primary-background-color))}.ds .button.type-secondary{background-color:var(--secondary-background-color);color:var(--secondary-foreground-color);font-weight:var(--font-weight-normal)}.ds .button.type-secondary:hover{background-color:color-mix(in srgb,black 10%,var(--secondary-background-color))}.ds .button.type-secondary:focus{background-color:color-mix(in srgb,black 20%,var(--secondary-background-color))}.ds .button.type-disabled{background-color:var(--disabled-background-color);border-color:var(--border-color);border-style:var(--border-style);border-width:var(--border-width);font-weight:var(--font-weight-light);cursor:default}.ds .cell.sizing-fixed{flex-grow:0;flex-shrink:0;overflow:hidden}.ds .cell.sizing-fluid{flex-grow:1;flex-shrink:1;overflow:auto}.ds .clickarea{--margin: 0;--padding-large: 2em;--padding-medium: 1.5em;--padding-small: 1em;--padding-none: 0;cursor:pointer;display:inline-block;margin:var(--margin);padding:var(--padding)}.ds .clickarea.padding-none{padding:var(--padding-none)}.ds .clickarea.padding-small{padding:var(--padding-small)}.ds .clickarea.padding-medium{padding:var(--padding-medium)}.ds .clickarea.padding-large{padding:var(--padding-large)}.ds .column{--gap-small: .4em;--gap-medium: 1em;--gap-large: 2em;display:flex;flex-direction:column;min-width:0;width:100%}.ds .column>div,.ds .column>h1,.ds .column>h2,.ds .column>h3,.ds .column>p,.ds .column>form,.ds .column>label,.ds .column>input,.ds .column>textarea,.ds .column>select{margin:0}.ds .column.align-y-top{justify-content:flex-start}.ds .column.align-y-center{justify-content:center}.ds .column.align-y-bottom{justify-content:flex-end}.ds .column.align-y-justify{justify-content:space-between}.ds .column.align-x-left{align-items:flex-start}.ds .column.align-x-center{align-items:center}.ds .column.align-x-right{align-items:flex-end}.ds .column.align-x-stretch{align-items:stretch}.ds .column.gap-small{gap:var(--gap-small)}.ds .column.gap-medium{gap:var(--gap-medium)}.ds .column.gap-large{gap:var(--gap-large)}.ds .column.wrap-nowrap{flex-wrap:nowrap}.ds .column.wrap-wrap{flex-wrap:wrap}.ds .form{--margin: var(--margin-container);margin:var(--margin);min-width:0}.ds .grid{--gap-small: .5em;--gap-medium: 1em;--gap-large: 2em;display:grid;min-width:0}.ds .grid>div,.ds .grid>h1,.ds .grid>h2,.ds .grid>h3,.ds .grid>p,.ds .grid>form,.ds .grid>label,.ds .grid>input,.ds .grid>textarea,.ds .grid>select{margin:0}.ds .grid.layout-two-columns{grid-template-columns:1fr 1fr}.ds .grid.layout-three-columns{grid-template-columns:1fr 1fr 1fr}.ds .grid.layout-four-columns{grid-template-columns:1fr 1fr 1fr 1fr}.ds .grid.gap-small{grid-gap:var(--gap-small)}.ds .grid.gap-medium{grid-gap:var(--gap-medium)}.ds .grid.gap-large{grid-gap:var(--gap-large)}.ds .icon{--icon-attachment: "📎";--icon-bookmark: "🔖";--icon-box: "☐";--icon-box-checked: "☑";--icon-box-crossed: "☒";--icon-calendar: "📅";--icon-caution: "☡";--icon-check: "✓";--icon-clock: "🕔";--icon-close: "✕";--icon-cloud: "☁";--icon-comment: "💬";--icon-diamond: "♦";--icon-eye: "👁";--icon-flag: "⚑";--icon-heart: "♥";--icon-home: "⌂";--icon-info: "ℹ";--icon-lock: "🔒";--icon-mail: "✉";--icon-music: "♫";--icon-phone: "☎";--icon-piece: "☮";--icon-plus: "➕";--icon-question: "❓";--icon-rain: "⛆";--icon-recycle: "♻";--icon-search: "🔍";--icon-settings: "⚙";--icon-star: "★";--icon-sun: "☀";--icon-tag: "🏷";--icon-trash: "🗑";--icon-umbrella: "☂";--icon-unlock: "🔓";--icon-user: "👤";--icon-video: "🎬";--icon-warning: "⚠";--icon-yinyang: "☯"}.ds .icon.attachment:before{content:var(--icon-attachment)}.ds .icon.bookmark:before{content:var(--icon-bookmark)}.ds .icon.box:before{content:var(--icon-box)}.ds .icon.box-checked:before{content:var(--icon-box-checked)}.ds .icon.box-crossed:before{content:var(--icon-box-crossed)}.ds .icon.calendar:before{content:var(--icon-calendar)}.ds .icon.caution:before{content:var(--icon-caution)}.ds .icon.check:before{content:var(--icon-check)}.ds .icon.clock:before{content:var(--icon-clock)}.ds .icon.close:before{content:var(--icon-close)}.ds .icon.cloud:before{content:var(--icon-cloud)}.ds .icon.comment:before{content:var(--icon-comment)}.ds .icon.diamond:before{content:var(--icon-diamond)}.ds .icon.eye:before{content:var(--icon-eye)}.ds .icon.flag:before{content:var(--icon-flag)}.ds .icon.heart:before{content:var(--icon-heart)}.ds .icon.home:before{content:var(--icon-home)}.ds .icon.info:before{content:var(--icon-info)}.ds .icon.lock:before{content:var(--icon-lock)}.ds .icon.mail:before{content:var(--icon-mail)}.ds .icon.music:before{content:var(--icon-music)}.ds .icon.phone:before{content:var(--icon-phone)}.ds .icon.piece:before{content:var(--icon-piece)}.ds .icon.plus:before{content:var(--icon-plus)}.ds .icon.question:before{content:var(--icon-question)}.ds .icon.rain:before{content:var(--icon-rain)}.ds .icon.recycle:before{content:var(--icon-recycle)}.ds .icon.search:before{content:var(--icon-search)}.ds .icon.settings:before{content:var(--icon-settings)}.ds .icon.star:before{content:var(--icon-star)}.ds .icon.sun:before{content:var(--icon-sun)}.ds .icon.tag:before{content:var(--icon-tag)}.ds .icon.trash:before{content:var(--icon-trash)}.ds .icon.umbrella:before{content:var(--icon-umbrella)}.ds .icon.unlock:before{content:var(--icon-unlock)}.ds .icon.user:before{content:var(--icon-user)}.ds .icon.video:before{content:var(--icon-video)}.ds .icon.warning:before{content:var(--icon-warning)}.ds .icon.yinyang:before{content:var(--icon-yinyang)}.ds .image.fit-fill{object-fit:fill}.ds .image.fit-contain{object-fit:contain}.ds .image.fit-cover{object-fit:cover}.ds .image.fit-none{object-fit:none}.ds .image.fit-scale-down{object-fit:scale-down}.ds .input{--margin: 0 0 1em 0;--gap: .5em;display:flex;flex-direction:column;gap:var(--gap);margin:var(--margin)}.ds .input .label{font-weight:var(--font-weight-medium)}.ds .label{--margin: 0;margin:var(--margin)}.ds .link{--color: var(--color-primary-foreground);--color-hover: var(--color-primary-foreground);--text-decoration: dotted underline;--text-decoration-hover: underline;color:var(--color);text-decoration:var(--text-decoration)}.ds .link:hover{color:var(--color-hover);text-decoration:var(--text-decoration-hover)}.ds .modal{border:0;padding:0;min-width:0}.ds .modal.sizing-full{width:100%}.ds .modal.sizing-content{width:fit-content}.ds .panel{--border-radius: 0;--margin: 0 0 1.5em 0;--padding-large: 2em;--padding-medium: 1.5em;--padding-small: 1em;--alert-background-color: var(--color-alert-background);--alert-foreground-color: var(--color-alert-foreground);--error-background-color: var(--color-error-background);--error-foreground-color: var(--color-error-foreground);--normal-background-color: var(--color-secondary-background);--normal-foreground-color: var(--color-primary-foreground);--success-background-color: var(--color-success-background);--success-foreground-color: var(--color-success-foreground);--warning-background-color: var(--color-warning-background);--warning-foreground-color: var(--color-warning-foreground);border-radius:var(--border-radius);padding:var(--padding);margin:var(--margin);min-width:0}.ds .panel.type-alert{background-color:var(--alert-background-color);color:var(--alert-foreground-color)}.ds .panel.type-error{background-color:var(--error-background-color);color:var(--error-foreground-color)}.ds .panel.type-normal{background-color:var(--normal-background-color);color:var(--normal-foreground-color)}.ds .panel.type-success{background-color:var(--success-background-color);color:var(--success-foreground-color)}.ds .panel.type-warning{background-color:var(--warning-background-color);color:var(--warning-foreground-color)}.ds .panel.type-transparent{background-color:transparent}.ds .panel.padding-small{padding:var(--padding-small)}.ds .panel.padding-medium{padding:var(--padding-medium)}.ds .panel.padding-large{padding:var(--padding-large)}.ds .paragraph{--margin: var(--margin-container);--line-height: 1.5em;--font-size-large: 1.5em;--font-size-medium: 1em;--font-size-small: .75em;margin:var(--margin);line-height:var(--line-height);min-width:0}.ds .paragraph.size-large{font-size:var(--font-size-large)}.ds .paragraph.size-medium{font-size:var(--font-size-medium)}.ds .paragraph.size-small{font-size:var(--font-size-small)}.ds .row{--gap-small: .4em;--gap-medium: 1em;--gap-large: 2em;display:flex;flex-direction:row;min-width:0;height:100%}.ds .row>div,.ds .row>h1,.ds .row>h2,.ds .row>h3,.ds .row>p,.ds .row>form,.ds .row>label,.ds .row>input,.ds .row>textarea,.ds .row>select{margin:0}.ds .row.align-x-left{justify-content:flex-start}.ds .row.align-x-center{justify-content:center}.ds .row.align-x-right{justify-content:flex-end}.ds .row.align-x-justify{justify-content:space-between}.ds .row.align-y-top{align-items:flex-start}.ds .row.align-y-center{align-items:center}.ds .row.align-y-bottom{align-items:flex-end}.ds .row.align-y-stretch{align-items:stretch}.ds .row.gap-small{gap:var(--gap-small)}.ds .row.gap-medium{gap:var(--gap-medium)}.ds .row.gap-large{gap:var(--gap-large)}.ds .row.wrap-nowrap{flex-wrap:nowrap}.ds .row.wrap-wrap{flex-wrap:wrap}.ds .ruler{--border-width-small: .1rem;--border-width-medium: .2rem;--border-width-large: .3rem;--color: var(--color-border);background-color:var(--color)}.ds .ruler.direction-horizontal{width:100%}.ds .ruler.direction-horizontal.size-small{height:var(--border-width-small)}.ds .ruler.direction-horizontal.size-medium{height:var(--border-width-medium)}.ds .ruler.direction-horizontal.size-large{height:var(--border-width-large)}.ds .ruler.direction-vertical{height:100%}.ds .ruler.direction-vertical.size-small{width:var(--border-width-small)}.ds .ruler.direction-vertical.size-medium{width:var(--border-width-medium)}.ds .ruler.direction-vertical.size-large{width:var(--border-width-large)}.ds .select{--margin: 0;--padding-small: .4em;--padding-medium: .8em;--padding-large: 1.2em;--border-style: solid;--border-color: var(--color-border);--border-width: var(--width-border);margin:var(--margin);padding:var(--padding);border-style:var(--border-style);border-width:var(--border-width);border-color:var(--border-color);background-color:var(--color-input-background);font-family:inherit;font-size:inherit}.ds .select:focus-visible{outline-color:color-mix(in srgb,black 10%,var(--border-color))}.ds .select.size-small{padding:var(--padding-small)}.ds .select.size-medium{padding:var(--padding-medium)}.ds .select.size-large{padding:var(--padding-large)}.ds .spinner{--color: var(--color-border);--size: 2em;--speed: 1.2s;--thickness: .3em;display:inline-block;width:var(--size);height:var(--size)}.ds .spinner:after{content:" ";display:block;width:var(--size);height:var(--size);border-radius:50%;border:var(--thickness) solid var(--color);border-color:transparent var(--color) transparent var(--color)}.ds .spinner.active:after{animation:ds-spinner var(--speed) linear infinite}@keyframes ds-spinner{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.ds .text{--primary-color: var(--color-primary-foreground);--secondary-color: var(--color-secondary-foreground);display:inline-block}.ds .text.type-primary{color:var(--primary-color)}.ds .text.type-secondary{color:var(--secondary-color)}.ds .text.size-small{font-size:.9em}.ds .text.size-medium{font-size:1em}.ds .text.size-large{font-size:1.2em}.ds .text.weight-light{font-weight:var(--font-weight-light)}.ds .text.weight-normal{font-weight:var(--font-weight-normal)}.ds .text.weight-bold{font-weight:var(--font-weight-bold)}.ds .text.wrap-none{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.ds .text.wrap-normal{white-space:normal}.ds .text.wrap-break-word{word-wrap:break-word}.ds .textarea{--margin: 0;--padding-small: .4em;--padding-medium: .8em;--padding-large: 1.2em;--border-style: solid;--border-color: var(--color-border);--border-width: var(--width-border);margin:var(--margin);padding:var(--padding);border-style:var(--border-style);border-width:var(--border-width);border-color:var(--border-color);background-color:var(--color-input-background);font-family:inherit;font-size:inherit;resize:vertical;width:100%}.ds .textarea:focus-visible{outline-color:color-mix(in srgb,black 10%,var(--border-color))}.ds .textarea.size-small{padding:var(--padding-small)}.ds .textarea.size-medium{padding:var(--padding-medium)}.ds .textarea.size-large{padding:var(--padding-large)}.ds .textbox{--margin: 0;--padding-small: .4em;--padding-medium: .8em;--padding-large: 1.2em;--border-style: solid;--border-color: var(--color-border);--border-width: var(--width-border);margin:var(--margin);border-style:var(--border-style);border-width:var(--border-width);border-color:var(--border-color);background-color:var(--color-input-background);font-family:inherit;font-size:inherit}.ds .textbox:focus-visible{outline-color:color-mix(in srgb,black 10%,var(--border-color))}.ds .textbox.size-small{padding:var(--padding-small)}.ds .textbox.size-medium{padding:var(--padding-medium)}.ds .textbox.size-large{padding:var(--padding-large)}.ds .title{--margin: 0 0 .8em 0;--font-size-large: 2em;--font-size-medium: 1.5em;--font-size-small: 1em;margin:var(--margin)}.ds .title.size-large{font-size:var(--font-size-large)}.ds .title.size-medium{font-size:var(--font-size-medium)}.ds .title.size-small{font-size:var(--font-size-small)}
|
package/dist/mtds.d.ts
ADDED
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
import { ChangeEventHandler } from 'react';
|
|
2
|
+
import { ForwardRefExoticComponent } from 'react';
|
|
3
|
+
import { JSX } from 'react/jsx-runtime';
|
|
4
|
+
import { ReactElement } from 'react';
|
|
5
|
+
import { ReactNode } from 'react';
|
|
6
|
+
import { RefAttributes } from 'react';
|
|
7
|
+
|
|
8
|
+
export declare function Avatar({ source, title, alt, width, height, fit }: Props_4): JSX.Element;
|
|
9
|
+
|
|
10
|
+
export declare function Border({ type, size, padding, children }: Props_5): JSX.Element;
|
|
11
|
+
|
|
12
|
+
export declare function Button({ type, size, text, onClick }: Props_6): JSX.Element;
|
|
13
|
+
|
|
14
|
+
export declare function Cell({ sizing, children }: Props_7): JSX.Element;
|
|
15
|
+
|
|
16
|
+
export declare function ClickArea({ padding, onClick, children }: Props_8): JSX.Element;
|
|
17
|
+
|
|
18
|
+
export declare function Column({ alignX, alignY, gap, wrap, children }: Props_9): JSX.Element;
|
|
19
|
+
|
|
20
|
+
export declare function Dropdown({ options, selected, onChange }: Props): JSX.Element;
|
|
21
|
+
|
|
22
|
+
export declare const Form: ForwardRefExoticComponent<Props_10 & RefAttributes<HTMLFormElement>>;
|
|
23
|
+
|
|
24
|
+
export declare function Grid({ layout, gap, children }: Props_11): JSX.Element;
|
|
25
|
+
|
|
26
|
+
export declare function Icon({ type }: Props_12): JSX.Element;
|
|
27
|
+
|
|
28
|
+
declare function Image_2({ source, title, alt, width, height, fit }: Props_13): JSX.Element;
|
|
29
|
+
export { Image_2 as Image }
|
|
30
|
+
|
|
31
|
+
export declare function Input({ label, element }: Props_14): JSX.Element;
|
|
32
|
+
|
|
33
|
+
export declare function Label({ value }: Props_15): JSX.Element;
|
|
34
|
+
|
|
35
|
+
export declare function Link({ url, target, children }: Props_19): JSX.Element;
|
|
36
|
+
|
|
37
|
+
export declare function Modal({ open, sizing, children }: Props_20): JSX.Element;
|
|
38
|
+
|
|
39
|
+
export declare function Panel({ type, padding, children }: Props_21): JSX.Element;
|
|
40
|
+
|
|
41
|
+
export declare function Paragraph({ size, children }: Props_22): JSX.Element;
|
|
42
|
+
|
|
43
|
+
declare type Props = {
|
|
44
|
+
readonly options: Map<string, string>;
|
|
45
|
+
readonly selected?: string;
|
|
46
|
+
readonly onChange?: (oldKey: string, newKey: string) => void;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
declare type Props_10 = {
|
|
50
|
+
readonly children: ReactNode;
|
|
51
|
+
readonly submitHandler?: (form: HTMLFormElement) => void;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
declare type Props_11 = {
|
|
55
|
+
readonly layout: 'two-columns' | 'three-columns' | 'four-columns';
|
|
56
|
+
readonly gap?: 'large' | 'medium' | 'small' | 'none';
|
|
57
|
+
readonly children: ReactNode;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
declare type Props_12 = {
|
|
61
|
+
readonly type: 'attachment' | 'bookmark' | 'box' | 'box-checked' | 'box-crossed' | 'calendar' | 'caution' | 'check' | 'clock' | 'close' | 'cloud' | 'comment' | 'diamond' | 'eye' | 'flag' | 'heart' | 'home' | 'info' | 'lock' | 'mail' | 'music' | 'phone' | 'piece' | 'plus' | 'question' | 'rain' | 'recycle' | 'search' | 'settings' | 'star' | 'sun' | 'tag' | 'trash' | 'umbrella' | 'unlock' | 'user' | 'video' | 'warning' | 'yinyang';
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
declare type Props_13 = {
|
|
65
|
+
readonly source: string;
|
|
66
|
+
readonly title?: string;
|
|
67
|
+
readonly alt?: string;
|
|
68
|
+
readonly width?: string;
|
|
69
|
+
readonly height?: string;
|
|
70
|
+
readonly fit?: 'fill' | 'contain' | 'cover' | 'none' | 'scale-down';
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
declare type Props_14 = {
|
|
74
|
+
readonly label: ReactElement<Props_15>;
|
|
75
|
+
readonly element: ReactElement<Props_16> | ReactElement<Props_17> | ReactElement<Props_18>;
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
declare type Props_15 = {
|
|
79
|
+
readonly value: string;
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
declare type Props_16 = {
|
|
83
|
+
readonly name: string;
|
|
84
|
+
readonly placeholder?: string;
|
|
85
|
+
readonly value?: string;
|
|
86
|
+
readonly limit?: number;
|
|
87
|
+
readonly pattern?: string;
|
|
88
|
+
readonly title?: string;
|
|
89
|
+
readonly size?: 'large' | 'medium' | 'small';
|
|
90
|
+
readonly required?: boolean;
|
|
91
|
+
readonly onChange?: ChangeEventHandler<HTMLInputElement>;
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
declare type Props_17 = {
|
|
95
|
+
readonly name: string;
|
|
96
|
+
readonly placeholder?: string;
|
|
97
|
+
readonly value?: string;
|
|
98
|
+
readonly size?: 'large' | 'medium' | 'small';
|
|
99
|
+
readonly rows?: number;
|
|
100
|
+
readonly limit?: number;
|
|
101
|
+
readonly onChange?: ChangeEventHandler<HTMLTextAreaElement>;
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
declare type Props_18 = {
|
|
105
|
+
readonly name: string;
|
|
106
|
+
readonly options: Map<string, string>;
|
|
107
|
+
readonly value?: string;
|
|
108
|
+
readonly size?: 'large' | 'medium' | 'small';
|
|
109
|
+
readonly onChange?: ChangeEventHandler<HTMLSelectElement>;
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
declare type Props_19 = {
|
|
113
|
+
readonly url?: string;
|
|
114
|
+
readonly target?: string;
|
|
115
|
+
readonly children: ReactNode;
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
declare type Props_2 = {
|
|
119
|
+
readonly id: string;
|
|
120
|
+
readonly title: ReactNode;
|
|
121
|
+
readonly children: ReactNode;
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
declare type Props_20 = {
|
|
125
|
+
readonly open: boolean;
|
|
126
|
+
readonly sizing?: 'full' | 'content';
|
|
127
|
+
readonly children?: ReactNode;
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
declare type Props_21 = {
|
|
131
|
+
readonly type?: 'normal' | 'alert' | 'warning' | 'success' | 'error' | 'transparent';
|
|
132
|
+
readonly padding?: 'large' | 'medium' | 'small';
|
|
133
|
+
readonly children?: ReactNode;
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
declare type Props_22 = {
|
|
137
|
+
readonly size?: 'large' | 'medium' | 'small';
|
|
138
|
+
readonly children: ReactNode;
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
declare type Props_23 = {
|
|
142
|
+
readonly alignX?: 'left' | 'center' | 'right' | 'justify';
|
|
143
|
+
readonly alignY?: 'top' | 'center' | 'bottom' | 'stretch';
|
|
144
|
+
readonly gap?: 'large' | 'medium' | 'small' | 'none';
|
|
145
|
+
readonly wrap?: 'wrap' | 'nowrap';
|
|
146
|
+
readonly children: ReactNode;
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
declare type Props_24 = {
|
|
150
|
+
readonly direction: 'horizontal' | 'vertical';
|
|
151
|
+
readonly size?: 'small' | 'medium' | 'large';
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
declare type Props_25 = {
|
|
155
|
+
readonly active?: boolean;
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
declare type Props_26 = {
|
|
159
|
+
readonly value: string;
|
|
160
|
+
readonly type?: 'primary' | 'secondary';
|
|
161
|
+
readonly size?: 'large' | 'medium' | 'small';
|
|
162
|
+
readonly weight?: 'light' | 'normal' | 'bold';
|
|
163
|
+
readonly wrap?: 'none' | 'normal' | 'break-word';
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
declare type Props_27 = {
|
|
167
|
+
readonly size?: 'large' | 'medium' | 'small';
|
|
168
|
+
readonly children: ReactNode;
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
declare type Props_3 = {
|
|
172
|
+
readonly separator?: ReactNode;
|
|
173
|
+
readonly selectedId?: string;
|
|
174
|
+
readonly children: ReactElement<Props_2> | ReactElement<Props_2>[];
|
|
175
|
+
readonly onChange?: (newId: string, oldId?: string) => void;
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
declare type Props_4 = {
|
|
179
|
+
readonly source: string;
|
|
180
|
+
readonly title?: string;
|
|
181
|
+
readonly alt?: string;
|
|
182
|
+
readonly width?: string;
|
|
183
|
+
readonly height?: string;
|
|
184
|
+
readonly fit?: 'fill' | 'contain' | 'cover' | 'none' | 'scale-down';
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
declare type Props_5 = {
|
|
188
|
+
readonly type?: 'normal' | 'dashed' | 'dotted';
|
|
189
|
+
readonly size?: 'large' | 'medium' | 'small';
|
|
190
|
+
readonly padding?: 'large' | 'medium' | 'small' | 'none';
|
|
191
|
+
readonly children?: ReactNode;
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
declare type Props_6 = {
|
|
195
|
+
readonly type?: 'submit' | 'primary' | 'secondary' | 'disabled';
|
|
196
|
+
readonly size?: 'large' | 'medium' | 'small';
|
|
197
|
+
readonly text: string;
|
|
198
|
+
readonly onClick?: () => void;
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
declare type Props_7 = {
|
|
202
|
+
readonly sizing?: 'fixed' | 'fluid';
|
|
203
|
+
readonly children: ReactNode;
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
declare type Props_8 = {
|
|
207
|
+
readonly padding?: 'large' | 'medium' | 'small' | 'none';
|
|
208
|
+
readonly onClick?: () => void;
|
|
209
|
+
readonly children?: ReactNode;
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
declare type Props_9 = {
|
|
213
|
+
readonly alignX?: 'left' | 'center' | 'right' | 'stretch';
|
|
214
|
+
readonly alignY?: 'top' | 'center' | 'bottom' | 'justify';
|
|
215
|
+
readonly gap?: 'large' | 'medium' | 'small' | 'none';
|
|
216
|
+
readonly wrap?: 'wrap' | 'nowrap';
|
|
217
|
+
readonly children: ReactNode;
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
export declare function Row({ alignX, alignY, gap, wrap, children }: Props_23): JSX.Element;
|
|
221
|
+
|
|
222
|
+
export declare function Ruler({ direction, size }: Props_24): JSX.Element;
|
|
223
|
+
|
|
224
|
+
export declare const Select: ForwardRefExoticComponent<Props_18 & RefAttributes<HTMLSelectElement>>;
|
|
225
|
+
|
|
226
|
+
export declare function Spinner({ active }: Props_25): JSX.Element;
|
|
227
|
+
|
|
228
|
+
export declare function Tab({ children }: Props_2): JSX.Element;
|
|
229
|
+
|
|
230
|
+
export declare function Tabs({ separator, selectedId, children, onChange }: Props_3): JSX.Element;
|
|
231
|
+
|
|
232
|
+
declare function Text_2({ value, type, size, weight, wrap }: Props_26): JSX.Element;
|
|
233
|
+
export { Text_2 as Text }
|
|
234
|
+
|
|
235
|
+
export declare const TextArea: ForwardRefExoticComponent<Props_17 & RefAttributes<HTMLTextAreaElement>>;
|
|
236
|
+
|
|
237
|
+
export declare const TextBox: ForwardRefExoticComponent<Props_16 & RefAttributes<HTMLInputElement>>;
|
|
238
|
+
|
|
239
|
+
export declare function Title({ size, children }: Props_27): JSX.Element;
|
|
240
|
+
|
|
241
|
+
export { }
|
package/dist/mtds.js
ADDED
|
@@ -0,0 +1,491 @@
|
|
|
1
|
+
import ae, { useState as k, useMemo as V, useEffectEvent as se, useEffect as J, forwardRef as w, useRef as oe } from "react";
|
|
2
|
+
var y = { exports: {} }, T = {};
|
|
3
|
+
var W;
|
|
4
|
+
function le() {
|
|
5
|
+
if (W) return T;
|
|
6
|
+
W = 1;
|
|
7
|
+
var t = Symbol.for("react.transitional.element"), r = Symbol.for("react.fragment");
|
|
8
|
+
function n(a, s, c) {
|
|
9
|
+
var i = null;
|
|
10
|
+
if (c !== void 0 && (i = "" + c), s.key !== void 0 && (i = "" + s.key), "key" in s) {
|
|
11
|
+
c = {};
|
|
12
|
+
for (var f in s)
|
|
13
|
+
f !== "key" && (c[f] = s[f]);
|
|
14
|
+
} else c = s;
|
|
15
|
+
return s = c.ref, {
|
|
16
|
+
$$typeof: t,
|
|
17
|
+
type: a,
|
|
18
|
+
key: i,
|
|
19
|
+
ref: s !== void 0 ? s : null,
|
|
20
|
+
props: c
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
return T.Fragment = r, T.jsx = n, T.jsxs = n, T;
|
|
24
|
+
}
|
|
25
|
+
var N = {};
|
|
26
|
+
var U;
|
|
27
|
+
function ce() {
|
|
28
|
+
return U || (U = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
29
|
+
function t(e) {
|
|
30
|
+
if (e == null) return null;
|
|
31
|
+
if (typeof e == "function")
|
|
32
|
+
return e.$$typeof === te ? null : e.displayName || e.name || null;
|
|
33
|
+
if (typeof e == "string") return e;
|
|
34
|
+
switch (e) {
|
|
35
|
+
case R:
|
|
36
|
+
return "Fragment";
|
|
37
|
+
case G:
|
|
38
|
+
return "Profiler";
|
|
39
|
+
case S:
|
|
40
|
+
return "StrictMode";
|
|
41
|
+
case Z:
|
|
42
|
+
return "Suspense";
|
|
43
|
+
case H:
|
|
44
|
+
return "SuspenseList";
|
|
45
|
+
case ee:
|
|
46
|
+
return "Activity";
|
|
47
|
+
}
|
|
48
|
+
if (typeof e == "object")
|
|
49
|
+
switch (typeof e.tag == "number" && console.error(
|
|
50
|
+
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
51
|
+
), e.$$typeof) {
|
|
52
|
+
case A:
|
|
53
|
+
return "Portal";
|
|
54
|
+
case X:
|
|
55
|
+
return e.displayName || "Context";
|
|
56
|
+
case B:
|
|
57
|
+
return (e._context.displayName || "Context") + ".Consumer";
|
|
58
|
+
case K:
|
|
59
|
+
var o = e.render;
|
|
60
|
+
return e = e.displayName, e || (e = o.displayName || o.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
|
61
|
+
case Q:
|
|
62
|
+
return o = e.displayName || null, o !== null ? o : t(e.type) || "Memo";
|
|
63
|
+
case O:
|
|
64
|
+
o = e._payload, e = e._init;
|
|
65
|
+
try {
|
|
66
|
+
return t(e(o));
|
|
67
|
+
} catch {
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
function r(e) {
|
|
73
|
+
return "" + e;
|
|
74
|
+
}
|
|
75
|
+
function n(e) {
|
|
76
|
+
try {
|
|
77
|
+
r(e);
|
|
78
|
+
var o = !1;
|
|
79
|
+
} catch {
|
|
80
|
+
o = !0;
|
|
81
|
+
}
|
|
82
|
+
if (o) {
|
|
83
|
+
o = console;
|
|
84
|
+
var u = o.error, d = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
85
|
+
return u.call(
|
|
86
|
+
o,
|
|
87
|
+
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
88
|
+
d
|
|
89
|
+
), r(e);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
function a(e) {
|
|
93
|
+
if (e === R) return "<>";
|
|
94
|
+
if (typeof e == "object" && e !== null && e.$$typeof === O)
|
|
95
|
+
return "<...>";
|
|
96
|
+
try {
|
|
97
|
+
var o = t(e);
|
|
98
|
+
return o ? "<" + o + ">" : "<...>";
|
|
99
|
+
} catch {
|
|
100
|
+
return "<...>";
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
function s() {
|
|
104
|
+
var e = P.A;
|
|
105
|
+
return e === null ? null : e.getOwner();
|
|
106
|
+
}
|
|
107
|
+
function c() {
|
|
108
|
+
return Error("react-stack-top-frame");
|
|
109
|
+
}
|
|
110
|
+
function i(e) {
|
|
111
|
+
if (I.call(e, "key")) {
|
|
112
|
+
var o = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
113
|
+
if (o && o.isReactWarning) return !1;
|
|
114
|
+
}
|
|
115
|
+
return e.key !== void 0;
|
|
116
|
+
}
|
|
117
|
+
function f(e, o) {
|
|
118
|
+
function u() {
|
|
119
|
+
z || (z = !0, console.error(
|
|
120
|
+
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
121
|
+
o
|
|
122
|
+
));
|
|
123
|
+
}
|
|
124
|
+
u.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
125
|
+
get: u,
|
|
126
|
+
configurable: !0
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
function x() {
|
|
130
|
+
var e = t(this.type);
|
|
131
|
+
return L[e] || (L[e] = !0, console.error(
|
|
132
|
+
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
133
|
+
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
134
|
+
}
|
|
135
|
+
function v(e, o, u, d, h, C) {
|
|
136
|
+
var p = u.ref;
|
|
137
|
+
return e = {
|
|
138
|
+
$$typeof: j,
|
|
139
|
+
type: e,
|
|
140
|
+
key: o,
|
|
141
|
+
props: u,
|
|
142
|
+
_owner: d
|
|
143
|
+
}, (p !== void 0 ? p : null) !== null ? Object.defineProperty(e, "ref", {
|
|
144
|
+
enumerable: !1,
|
|
145
|
+
get: x
|
|
146
|
+
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
147
|
+
configurable: !1,
|
|
148
|
+
enumerable: !1,
|
|
149
|
+
writable: !0,
|
|
150
|
+
value: 0
|
|
151
|
+
}), Object.defineProperty(e, "_debugInfo", {
|
|
152
|
+
configurable: !1,
|
|
153
|
+
enumerable: !1,
|
|
154
|
+
writable: !0,
|
|
155
|
+
value: null
|
|
156
|
+
}), Object.defineProperty(e, "_debugStack", {
|
|
157
|
+
configurable: !1,
|
|
158
|
+
enumerable: !1,
|
|
159
|
+
writable: !0,
|
|
160
|
+
value: h
|
|
161
|
+
}), Object.defineProperty(e, "_debugTask", {
|
|
162
|
+
configurable: !1,
|
|
163
|
+
enumerable: !1,
|
|
164
|
+
writable: !0,
|
|
165
|
+
value: C
|
|
166
|
+
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
167
|
+
}
|
|
168
|
+
function m(e, o, u, d, h, C) {
|
|
169
|
+
var p = o.children;
|
|
170
|
+
if (p !== void 0)
|
|
171
|
+
if (d)
|
|
172
|
+
if (re(p)) {
|
|
173
|
+
for (d = 0; d < p.length; d++)
|
|
174
|
+
E(p[d]);
|
|
175
|
+
Object.freeze && Object.freeze(p);
|
|
176
|
+
} else
|
|
177
|
+
console.error(
|
|
178
|
+
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
179
|
+
);
|
|
180
|
+
else E(p);
|
|
181
|
+
if (I.call(o, "key")) {
|
|
182
|
+
p = t(e);
|
|
183
|
+
var g = Object.keys(o).filter(function(ne) {
|
|
184
|
+
return ne !== "key";
|
|
185
|
+
});
|
|
186
|
+
d = 0 < g.length ? "{key: someKey, " + g.join(": ..., ") + ": ...}" : "{key: someKey}", M[p + d] || (g = 0 < g.length ? "{" + g.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
187
|
+
`A props object containing a "key" prop is being spread into JSX:
|
|
188
|
+
let props = %s;
|
|
189
|
+
<%s {...props} />
|
|
190
|
+
React keys must be passed directly to JSX without using spread:
|
|
191
|
+
let props = %s;
|
|
192
|
+
<%s key={someKey} {...props} />`,
|
|
193
|
+
d,
|
|
194
|
+
p,
|
|
195
|
+
g,
|
|
196
|
+
p
|
|
197
|
+
), M[p + d] = !0);
|
|
198
|
+
}
|
|
199
|
+
if (p = null, u !== void 0 && (n(u), p = "" + u), i(o) && (n(o.key), p = "" + o.key), "key" in o) {
|
|
200
|
+
u = {};
|
|
201
|
+
for (var Y in o)
|
|
202
|
+
Y !== "key" && (u[Y] = o[Y]);
|
|
203
|
+
} else u = o;
|
|
204
|
+
return p && f(
|
|
205
|
+
u,
|
|
206
|
+
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
207
|
+
), v(
|
|
208
|
+
e,
|
|
209
|
+
p,
|
|
210
|
+
u,
|
|
211
|
+
s(),
|
|
212
|
+
h,
|
|
213
|
+
C
|
|
214
|
+
);
|
|
215
|
+
}
|
|
216
|
+
function E(e) {
|
|
217
|
+
_(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === O && (e._payload.status === "fulfilled" ? _(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
|
|
218
|
+
}
|
|
219
|
+
function _(e) {
|
|
220
|
+
return typeof e == "object" && e !== null && e.$$typeof === j;
|
|
221
|
+
}
|
|
222
|
+
var b = ae, j = Symbol.for("react.transitional.element"), A = Symbol.for("react.portal"), R = Symbol.for("react.fragment"), S = Symbol.for("react.strict_mode"), G = Symbol.for("react.profiler"), B = Symbol.for("react.consumer"), X = Symbol.for("react.context"), K = Symbol.for("react.forward_ref"), Z = Symbol.for("react.suspense"), H = Symbol.for("react.suspense_list"), Q = Symbol.for("react.memo"), O = Symbol.for("react.lazy"), ee = Symbol.for("react.activity"), te = Symbol.for("react.client.reference"), P = b.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, I = Object.prototype.hasOwnProperty, re = Array.isArray, $ = console.createTask ? console.createTask : function() {
|
|
223
|
+
return null;
|
|
224
|
+
};
|
|
225
|
+
b = {
|
|
226
|
+
react_stack_bottom_frame: function(e) {
|
|
227
|
+
return e();
|
|
228
|
+
}
|
|
229
|
+
};
|
|
230
|
+
var z, L = {}, D = b.react_stack_bottom_frame.bind(
|
|
231
|
+
b,
|
|
232
|
+
c
|
|
233
|
+
)(), F = $(a(c)), M = {};
|
|
234
|
+
N.Fragment = R, N.jsx = function(e, o, u) {
|
|
235
|
+
var d = 1e4 > P.recentlyCreatedOwnerStacks++;
|
|
236
|
+
return m(
|
|
237
|
+
e,
|
|
238
|
+
o,
|
|
239
|
+
u,
|
|
240
|
+
!1,
|
|
241
|
+
d ? Error("react-stack-top-frame") : D,
|
|
242
|
+
d ? $(a(e)) : F
|
|
243
|
+
);
|
|
244
|
+
}, N.jsxs = function(e, o, u) {
|
|
245
|
+
var d = 1e4 > P.recentlyCreatedOwnerStacks++;
|
|
246
|
+
return m(
|
|
247
|
+
e,
|
|
248
|
+
o,
|
|
249
|
+
u,
|
|
250
|
+
!0,
|
|
251
|
+
d ? Error("react-stack-top-frame") : D,
|
|
252
|
+
d ? $(a(e)) : F
|
|
253
|
+
);
|
|
254
|
+
};
|
|
255
|
+
})()), N;
|
|
256
|
+
}
|
|
257
|
+
var q;
|
|
258
|
+
function ie() {
|
|
259
|
+
return q || (q = 1, process.env.NODE_ENV === "production" ? y.exports = le() : y.exports = ce()), y.exports;
|
|
260
|
+
}
|
|
261
|
+
var l = ie();
|
|
262
|
+
function fe({ options: t, selected: r, onChange: n }) {
|
|
263
|
+
const a = r ?? [...t.keys()][0], s = t.get(a) ?? "", [c, i] = k(a), [f, x] = k(s), [v, m] = k(!1), E = () => {
|
|
264
|
+
m(!v);
|
|
265
|
+
}, _ = (b) => {
|
|
266
|
+
const j = b.target, A = c, R = j.getAttribute("data-key") ?? a, S = t.get(R) ?? s;
|
|
267
|
+
i(R), x(S), m(!1), n && n(A, R);
|
|
268
|
+
};
|
|
269
|
+
return /* @__PURE__ */ l.jsxs("div", { className: "selection", children: [
|
|
270
|
+
/* @__PURE__ */ l.jsx("div", { className: v ? "text active" : "text", onClick: E, children: f }),
|
|
271
|
+
v && /* @__PURE__ */ l.jsx("div", { className: "options", children: Array.from(t).map(([b, j]) => /* @__PURE__ */ l.jsx("div", { className: "option", "data-key": b, onClick: _, children: j }, b)) })
|
|
272
|
+
] });
|
|
273
|
+
}
|
|
274
|
+
function me({ children: t }) {
|
|
275
|
+
return /* @__PURE__ */ l.jsx("div", { className: "ds-tabs-tab", children: t });
|
|
276
|
+
}
|
|
277
|
+
function de({ separator: t, selectedId: r, children: n, onChange: a }) {
|
|
278
|
+
const [s, c] = k(r ?? ""), i = V(() => Array.isArray(n) ? n : [n], [n]), f = V(() => {
|
|
279
|
+
const m = {};
|
|
280
|
+
return i.forEach((E) => {
|
|
281
|
+
const _ = E.props.id;
|
|
282
|
+
m[_] = E;
|
|
283
|
+
}), m;
|
|
284
|
+
}, [i]), x = se((m) => {
|
|
285
|
+
const E = i[0]?.props.id;
|
|
286
|
+
c(m ?? E);
|
|
287
|
+
});
|
|
288
|
+
J(() => {
|
|
289
|
+
x(r);
|
|
290
|
+
}, [r, i]);
|
|
291
|
+
const v = (m) => {
|
|
292
|
+
a !== void 0 && a(m, s), c(m);
|
|
293
|
+
};
|
|
294
|
+
return /* @__PURE__ */ l.jsxs("div", { className: "tabs", children: [
|
|
295
|
+
/* @__PURE__ */ l.jsx("div", { className: "nav", children: i.map((m) => {
|
|
296
|
+
const E = m.props.id, _ = `tab-${E}`, b = E === s ? "active" : "inactive", j = () => v(m.props.id);
|
|
297
|
+
return /* @__PURE__ */ l.jsx("div", { className: "item " + b, onClick: j, children: m.props.title }, _);
|
|
298
|
+
}) }),
|
|
299
|
+
t !== void 0 ? /* @__PURE__ */ l.jsx("div", { className: "separator", children: t }) : null,
|
|
300
|
+
/* @__PURE__ */ l.jsx("div", { className: "content", children: f[s] })
|
|
301
|
+
] });
|
|
302
|
+
}
|
|
303
|
+
function pe({ source: t, title: r, alt: n = "Avatar", width: a, height: s, fit: c = "contain" }) {
|
|
304
|
+
const i = "avatar fit-" + c, f = { width: a, height: s };
|
|
305
|
+
return /* @__PURE__ */ l.jsx(
|
|
306
|
+
"img",
|
|
307
|
+
{
|
|
308
|
+
className: i,
|
|
309
|
+
title: r,
|
|
310
|
+
alt: n,
|
|
311
|
+
style: f,
|
|
312
|
+
src: t
|
|
313
|
+
}
|
|
314
|
+
);
|
|
315
|
+
}
|
|
316
|
+
function Ee({ type: t = "normal", size: r = "large", padding: n = "large", children: a }) {
|
|
317
|
+
const s = "border type-" + t + " size-" + r + " padding-" + n;
|
|
318
|
+
return /* @__PURE__ */ l.jsx("div", { className: s, children: a });
|
|
319
|
+
}
|
|
320
|
+
function ve({ type: t = "primary", size: r = "medium", text: n, onClick: a }) {
|
|
321
|
+
const s = "button type-" + t + " size-" + r, c = t === "disabled", i = t === "submit" ? "submit" : "button";
|
|
322
|
+
return /* @__PURE__ */ l.jsx("input", { type: i, onClick: a, className: s, disabled: c, value: n });
|
|
323
|
+
}
|
|
324
|
+
function xe({ sizing: t = "fluid", children: r }) {
|
|
325
|
+
const n = "cell sizing-" + t;
|
|
326
|
+
return /* @__PURE__ */ l.jsx("div", { className: n, children: r });
|
|
327
|
+
}
|
|
328
|
+
function be({ padding: t = "none", onClick: r, children: n }) {
|
|
329
|
+
const a = "clickarea padding-" + t;
|
|
330
|
+
return /* @__PURE__ */ l.jsx("div", { className: a, onClick: r, children: n });
|
|
331
|
+
}
|
|
332
|
+
function _e({ alignX: t = "left", alignY: r = "top", gap: n = "medium", wrap: a = "nowrap", children: s }) {
|
|
333
|
+
const c = "column align-x-" + t + " align-y-" + r + " gap-" + n + " wrap-" + a;
|
|
334
|
+
return /* @__PURE__ */ l.jsx("div", { className: c, children: s });
|
|
335
|
+
}
|
|
336
|
+
const je = w(function({ children: r, submitHandler: n }, a) {
|
|
337
|
+
const s = (c) => {
|
|
338
|
+
c.preventDefault(), n && n(c.target);
|
|
339
|
+
};
|
|
340
|
+
return /* @__PURE__ */ l.jsx("form", { onSubmit: s, className: "form", ref: a, children: r });
|
|
341
|
+
});
|
|
342
|
+
function Re({ layout: t, gap: r = "medium", children: n }) {
|
|
343
|
+
const a = "grid layout-" + t + " gap-" + r;
|
|
344
|
+
return /* @__PURE__ */ l.jsx("div", { className: a, children: n });
|
|
345
|
+
}
|
|
346
|
+
function ge({ type: t }) {
|
|
347
|
+
return /* @__PURE__ */ l.jsx("span", { className: "icon " + t });
|
|
348
|
+
}
|
|
349
|
+
function Te({ source: t, title: r, alt: n, width: a, height: s, fit: c = "contain" }) {
|
|
350
|
+
const i = "image fit-" + c, f = { width: a, height: s };
|
|
351
|
+
return /* @__PURE__ */ l.jsx(
|
|
352
|
+
"img",
|
|
353
|
+
{
|
|
354
|
+
className: i,
|
|
355
|
+
title: r,
|
|
356
|
+
alt: n,
|
|
357
|
+
style: f,
|
|
358
|
+
src: t
|
|
359
|
+
}
|
|
360
|
+
);
|
|
361
|
+
}
|
|
362
|
+
function Ne({ label: t, element: r }) {
|
|
363
|
+
return /* @__PURE__ */ l.jsxs("div", { className: "input", children: [
|
|
364
|
+
t,
|
|
365
|
+
r
|
|
366
|
+
] });
|
|
367
|
+
}
|
|
368
|
+
function he({ value: t }) {
|
|
369
|
+
return /* @__PURE__ */ l.jsx("label", { className: "label", children: t });
|
|
370
|
+
}
|
|
371
|
+
function ye({ url: t, target: r, children: n }) {
|
|
372
|
+
return /* @__PURE__ */ l.jsx("a", { className: "link", href: t, target: r, children: n });
|
|
373
|
+
}
|
|
374
|
+
function ke({ open: t, sizing: r = "content", children: n }) {
|
|
375
|
+
const a = oe(null), s = "modal sizing-" + r;
|
|
376
|
+
return J(() => {
|
|
377
|
+
t ? a.current?.showModal() : a.current?.close();
|
|
378
|
+
}, [t]), /* @__PURE__ */ l.jsx("dialog", { ref: a, className: s, children: /* @__PURE__ */ l.jsx("form", { method: "dialog", children: n }) });
|
|
379
|
+
}
|
|
380
|
+
function we({ type: t = "normal", padding: r = "large", children: n }) {
|
|
381
|
+
const a = "panel type-" + t + " padding-" + r;
|
|
382
|
+
return /* @__PURE__ */ l.jsx("div", { className: a, children: n });
|
|
383
|
+
}
|
|
384
|
+
function Ae({ size: t = "medium", children: r }) {
|
|
385
|
+
const n = "paragraph size-" + t;
|
|
386
|
+
return /* @__PURE__ */ l.jsx("p", { className: n, children: r });
|
|
387
|
+
}
|
|
388
|
+
function Se({ alignX: t = "left", alignY: r = "top", gap: n = "medium", wrap: a = "nowrap", children: s }) {
|
|
389
|
+
const c = "row align-x-" + t + " align-y-" + r + " gap-" + n + " wrap-" + a;
|
|
390
|
+
return /* @__PURE__ */ l.jsx("div", { className: c, children: s });
|
|
391
|
+
}
|
|
392
|
+
function Oe({ direction: t, size: r = "medium" }) {
|
|
393
|
+
const n = "ruler direction-" + t + " size-" + r;
|
|
394
|
+
return /* @__PURE__ */ l.jsx("div", { className: n });
|
|
395
|
+
}
|
|
396
|
+
const Pe = w(function({ name: r, options: n, value: a, size: s = "medium", onChange: c }, i) {
|
|
397
|
+
const f = "select size-" + s;
|
|
398
|
+
return /* @__PURE__ */ l.jsx(
|
|
399
|
+
"select",
|
|
400
|
+
{
|
|
401
|
+
className: f,
|
|
402
|
+
name: r,
|
|
403
|
+
defaultValue: a,
|
|
404
|
+
onChange: c,
|
|
405
|
+
ref: i,
|
|
406
|
+
children: Array.from(n).map(([x, v]) => /* @__PURE__ */ l.jsx("option", { value: x, children: v }, x))
|
|
407
|
+
}
|
|
408
|
+
);
|
|
409
|
+
});
|
|
410
|
+
function $e({ active: t = !0 }) {
|
|
411
|
+
const r = "spinner" + (t ? " active" : "");
|
|
412
|
+
return /* @__PURE__ */ l.jsx("div", { className: r });
|
|
413
|
+
}
|
|
414
|
+
function Ce({ value: t, type: r = "primary", size: n = "medium", weight: a = "normal", wrap: s = "none" }) {
|
|
415
|
+
const c = "text type-" + r + " size-" + n + " weight-" + a + " wrap-" + s;
|
|
416
|
+
return /* @__PURE__ */ l.jsx("span", { className: c, children: t });
|
|
417
|
+
}
|
|
418
|
+
const Ye = w(function({ name: r, placeholder: n, value: a, size: s = "medium", rows: c, limit: i, onChange: f }, x) {
|
|
419
|
+
const v = "textarea size-" + s;
|
|
420
|
+
return /* @__PURE__ */ l.jsx(
|
|
421
|
+
"textarea",
|
|
422
|
+
{
|
|
423
|
+
className: v,
|
|
424
|
+
name: r,
|
|
425
|
+
placeholder: n,
|
|
426
|
+
defaultValue: a,
|
|
427
|
+
rows: c,
|
|
428
|
+
ref: x,
|
|
429
|
+
maxLength: i,
|
|
430
|
+
onChange: f
|
|
431
|
+
}
|
|
432
|
+
);
|
|
433
|
+
}), Ie = w(function({ name: r, placeholder: n, value: a, limit: s, pattern: c, title: i, size: f = "medium", required: x, onChange: v }, m) {
|
|
434
|
+
const E = "textbox size-" + f;
|
|
435
|
+
return /* @__PURE__ */ l.jsx(
|
|
436
|
+
"input",
|
|
437
|
+
{
|
|
438
|
+
className: E,
|
|
439
|
+
type: "text",
|
|
440
|
+
name: r,
|
|
441
|
+
placeholder: n,
|
|
442
|
+
defaultValue: a,
|
|
443
|
+
maxLength: s,
|
|
444
|
+
pattern: c,
|
|
445
|
+
title: i,
|
|
446
|
+
ref: m,
|
|
447
|
+
required: x,
|
|
448
|
+
onChange: v
|
|
449
|
+
}
|
|
450
|
+
);
|
|
451
|
+
});
|
|
452
|
+
function ze({ size: t = "large", children: r }) {
|
|
453
|
+
const n = "title size-" + t;
|
|
454
|
+
switch (t) {
|
|
455
|
+
case "large":
|
|
456
|
+
return /* @__PURE__ */ l.jsx("h1", { className: n, children: r });
|
|
457
|
+
case "medium":
|
|
458
|
+
return /* @__PURE__ */ l.jsx("h2", { className: n, children: r });
|
|
459
|
+
case "small":
|
|
460
|
+
return /* @__PURE__ */ l.jsx("h3", { className: n, children: r });
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
export {
|
|
464
|
+
pe as Avatar,
|
|
465
|
+
Ee as Border,
|
|
466
|
+
ve as Button,
|
|
467
|
+
xe as Cell,
|
|
468
|
+
be as ClickArea,
|
|
469
|
+
_e as Column,
|
|
470
|
+
fe as Dropdown,
|
|
471
|
+
je as Form,
|
|
472
|
+
Re as Grid,
|
|
473
|
+
ge as Icon,
|
|
474
|
+
Te as Image,
|
|
475
|
+
Ne as Input,
|
|
476
|
+
he as Label,
|
|
477
|
+
ye as Link,
|
|
478
|
+
ke as Modal,
|
|
479
|
+
we as Panel,
|
|
480
|
+
Ae as Paragraph,
|
|
481
|
+
Se as Row,
|
|
482
|
+
Oe as Ruler,
|
|
483
|
+
Pe as Select,
|
|
484
|
+
$e as Spinner,
|
|
485
|
+
me as Tab,
|
|
486
|
+
de as Tabs,
|
|
487
|
+
Ce as Text,
|
|
488
|
+
Ye as TextArea,
|
|
489
|
+
Ie as TextBox,
|
|
490
|
+
ze as Title
|
|
491
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@maskingtech/designsystem",
|
|
3
|
+
"private": false,
|
|
4
|
+
"version": "0.0.1",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build": "vite build",
|
|
8
|
+
"clean": "rimraf dist",
|
|
9
|
+
"lint": "eslint",
|
|
10
|
+
"prepublishOnly": "npm run build"
|
|
11
|
+
},
|
|
12
|
+
"exports": {
|
|
13
|
+
".": "./dist/mtds.js",
|
|
14
|
+
"./style.css": "./dist/mtds.css"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"README.md",
|
|
18
|
+
"dist"
|
|
19
|
+
],
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"react": "19.2.0"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"@eslint/js": "9.39.1",
|
|
25
|
+
"@types/node": "24.10.1",
|
|
26
|
+
"@types/react": "19.2.6",
|
|
27
|
+
"@vitejs/plugin-react": "5.1.1",
|
|
28
|
+
"eslint-plugin-react": "7.37.5",
|
|
29
|
+
"eslint-plugin-react-hooks": "7.0.1",
|
|
30
|
+
"eslint-plugin-sonarjs": "3.0.5",
|
|
31
|
+
"rimraf": "6.1.2",
|
|
32
|
+
"typescript": "5.9.3",
|
|
33
|
+
"typescript-eslint": "8.47.0",
|
|
34
|
+
"vite": "7.2.4",
|
|
35
|
+
"vite-plugin-dts": "4.5.4"
|
|
36
|
+
},
|
|
37
|
+
"optionalDependencies": {
|
|
38
|
+
"@rollup/rollup-linux-x64-gnu": "4.53.3"
|
|
39
|
+
}
|
|
40
|
+
}
|