@rogieking/figui3 1.0.88 → 1.0.90
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +148 -9
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# FigUI3
|
|
2
2
|
|
|
3
|
-
A lightweight, customizable web component library that
|
|
3
|
+
A lightweight, customizable web component library that uses Figmas UI3 style for modern web applications, but specifically for Figma plugins.
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
@@ -16,13 +16,22 @@ A lightweight, customizable web component library that provides Figma-inspired U
|
|
|
16
16
|
The library includes the following components:
|
|
17
17
|
|
|
18
18
|
- `<fig-button>` - Versatile button component with multiple variants
|
|
19
|
-
- `<fig-
|
|
20
|
-
- `<fig-field>` - Form field wrapper with flexible layout options
|
|
21
|
-
- `<fig-dropdown>` - Customizable dropdown select
|
|
22
|
-
- `<fig-tooltip>` - Hover and click-triggered tooltips
|
|
19
|
+
- `<fig-checkbox>` - Checkbox input with indeterminate state support
|
|
23
20
|
- `<fig-dialog>` - Modal dialog component
|
|
21
|
+
- `<fig-dropdown>` - Customizable dropdown select
|
|
22
|
+
- `<fig-field>` - Form field wrapper with flexible layout options
|
|
23
|
+
- `<fig-header>` - Section header component
|
|
24
24
|
- `<fig-input-color>` - Color picker with hex/rgba support
|
|
25
|
-
-
|
|
25
|
+
- `<fig-input-text>` - Text/Number input with optional prefix/suffix slots
|
|
26
|
+
- `<fig-slider>` - Input slider with optional text input and units
|
|
27
|
+
- `<fig-switch>` - Toggle switch component
|
|
28
|
+
- `<fig-tooltip>` - Hover and click-triggered tooltips
|
|
29
|
+
- `<fig-spinner>` - Loading spinner component
|
|
30
|
+
- `<fig-combo-input>` - Combobox input
|
|
31
|
+
- `<fig-chit>` - Color/Gradient/Pattern/Image/Icon/Text chit component
|
|
32
|
+
- `<fig-tabs>` - Tabbed navigation component
|
|
33
|
+
- `<fig-segmented-control>` - Segmented control component
|
|
34
|
+
- `<fig-image>` - Image display or input component
|
|
26
35
|
|
|
27
36
|
## Installation
|
|
28
37
|
|
|
@@ -30,12 +39,25 @@ The library includes the following components:
|
|
|
30
39
|
npm install fig-js
|
|
31
40
|
```
|
|
32
41
|
|
|
42
|
+
```jsx
|
|
43
|
+
import "@rogieking/figui3/fig.css";
|
|
44
|
+
import "@rogieking/figui3/fig.js";
|
|
45
|
+
```
|
|
46
|
+
|
|
33
47
|
Or include directly in your HTML:
|
|
34
48
|
|
|
35
49
|
```html
|
|
50
|
+
<link rel="stylesheet" href="https://unpkg.com/fig-js@latest/dist/fig.css" />
|
|
36
51
|
<script src="https://unpkg.com/fig-js@latest/dist/fig.js"></script>
|
|
37
52
|
```
|
|
38
53
|
|
|
54
|
+
or
|
|
55
|
+
|
|
56
|
+
```html
|
|
57
|
+
<link rel="stylesheet" href="https://esm.sh/@rogieking/figui3@latest/fig.css" />
|
|
58
|
+
<script src="https://esm.sh/@rogieking/figui3@latest/fig.js"></script>
|
|
59
|
+
```
|
|
60
|
+
|
|
39
61
|
## Usage
|
|
40
62
|
|
|
41
63
|
```html
|
|
@@ -78,16 +100,50 @@ Contributions are welcome! Please read our [contributing guidelines](CONTRIBUTIN
|
|
|
78
100
|
<!-- Basic button -->
|
|
79
101
|
<fig-button>Click me</fig-button>
|
|
80
102
|
|
|
103
|
+
<!-- Primary variant -->
|
|
104
|
+
<fig-button variant="primary">Primary Button</fig-button>
|
|
105
|
+
|
|
106
|
+
<!-- Secondary variant -->
|
|
107
|
+
<fig-button variant="secondary">Secondary Button</fig-button>
|
|
108
|
+
|
|
109
|
+
<!-- Ghost variant -->
|
|
110
|
+
<fig-button variant="ghost">Ghost Button</fig-button>
|
|
111
|
+
|
|
81
112
|
<!-- Ghost variant with icon -->
|
|
82
113
|
<fig-button variant="ghost" icon="true">
|
|
83
114
|
<svg><!-- your icon svg --></svg>
|
|
84
115
|
</fig-button>
|
|
85
116
|
|
|
117
|
+
<!-- Link variant -->
|
|
118
|
+
<fig-button variant="link">Link Button</fig-button>
|
|
119
|
+
|
|
86
120
|
<!-- Disabled state -->
|
|
87
121
|
<fig-button disabled>Disabled</fig-button>
|
|
88
122
|
|
|
89
123
|
<!-- Toggle button -->
|
|
90
124
|
<fig-button type="toggle">Toggle Me</fig-button>
|
|
125
|
+
|
|
126
|
+
<!-- Submit button -->
|
|
127
|
+
<fig-button type="submit">Submit</fig-button>
|
|
128
|
+
|
|
129
|
+
<!-- Select list button -->
|
|
130
|
+
<fig-button type="select">
|
|
131
|
+
Select Me
|
|
132
|
+
<fig-dropdown>
|
|
133
|
+
<option value="1">Option 1</option>
|
|
134
|
+
<option value="2">Option 2</option>
|
|
135
|
+
<option value="3">Option 3</option>
|
|
136
|
+
</fig-dropdown>
|
|
137
|
+
</fig-button>
|
|
138
|
+
|
|
139
|
+
<!-- Default button -->
|
|
140
|
+
<fig-button type="button">Default</fig-button>
|
|
141
|
+
|
|
142
|
+
<!-- Upload button -->
|
|
143
|
+
<fig-button type="upload">
|
|
144
|
+
Upload
|
|
145
|
+
<input type="file" />
|
|
146
|
+
</fig-button>
|
|
91
147
|
```
|
|
92
148
|
|
|
93
149
|
### Dropdown (`<fig-dropdown>`)
|
|
@@ -138,7 +194,7 @@ Contributions are welcome! Please read our [contributing guidelines](CONTRIBUTIN
|
|
|
138
194
|
```html
|
|
139
195
|
<!-- Basic dialog -->
|
|
140
196
|
<fig-dialog>
|
|
141
|
-
<
|
|
197
|
+
<fig-header>Dialog Title</fig-header>
|
|
142
198
|
<div slot="content">
|
|
143
199
|
<p>Dialog content goes here.</p>
|
|
144
200
|
</div>
|
|
@@ -172,15 +228,48 @@ Contributions are welcome! Please read our [contributing guidelines](CONTRIBUTIN
|
|
|
172
228
|
### Slider (`<fig-slider>`)
|
|
173
229
|
|
|
174
230
|
```html
|
|
175
|
-
<!-- Basic slider -->
|
|
231
|
+
<!-- Basic range slider -->
|
|
176
232
|
<fig-slider min="0" max="100" value="50"></fig-slider>
|
|
177
233
|
|
|
178
234
|
<!-- Slider with text input and units -->
|
|
179
235
|
<fig-slider min="0" max="100" value="75" text="true" units="%"> </fig-slider>
|
|
180
236
|
|
|
237
|
+
<!-- Hue slider -->
|
|
238
|
+
<fig-slider type="hue" value="55"></fig-slider>
|
|
239
|
+
|
|
240
|
+
<!-- Stepper slider with discrete snapping values-->
|
|
241
|
+
<fig-slider type="stepper" value="25" default="50" step="25">
|
|
242
|
+
<datalist id="markers">
|
|
243
|
+
<option value="0"></option>
|
|
244
|
+
<option value="25"></option>
|
|
245
|
+
<option value="50"></option>
|
|
246
|
+
<option value="75"></option>
|
|
247
|
+
<option value="100"></option>
|
|
248
|
+
</datalist>
|
|
249
|
+
</fig-slider>
|
|
250
|
+
|
|
251
|
+
<!-- Delta slider -->
|
|
252
|
+
<fig-slider type="delta" value=".25" default="0" step="0.25" min="-5" max="5">
|
|
253
|
+
<datalist id="markers">
|
|
254
|
+
<option value="0"></option>
|
|
255
|
+
</datalist>
|
|
256
|
+
</fig-slider>
|
|
257
|
+
|
|
181
258
|
<!-- Opacity slider with color -->
|
|
182
259
|
<fig-slider type="opacity" value="0.75" color="#ff0000" units="%" text="true">
|
|
183
260
|
</fig-slider>
|
|
261
|
+
|
|
262
|
+
<!-- Number slider with number transform and percentage units -->
|
|
263
|
+
<fig-slider
|
|
264
|
+
min="0"
|
|
265
|
+
max="1"
|
|
266
|
+
transform="100"
|
|
267
|
+
units="%"
|
|
268
|
+
step="0.01"
|
|
269
|
+
text="true"
|
|
270
|
+
value="0.5"
|
|
271
|
+
>
|
|
272
|
+
</fig-slider>
|
|
184
273
|
```
|
|
185
274
|
|
|
186
275
|
### Text Input (`<fig-input-text>`)
|
|
@@ -251,3 +340,53 @@ Contributions are welcome! Please read our [contributing guidelines](CONTRIBUTIN
|
|
|
251
340
|
<!-- Checked state -->
|
|
252
341
|
<fig-switch checked>Active</fig-switch>
|
|
253
342
|
```
|
|
343
|
+
|
|
344
|
+
### Spinner (`<fig-spinner>`)
|
|
345
|
+
|
|
346
|
+
```html
|
|
347
|
+
<!-- Basic spinner -->
|
|
348
|
+
<fig-spinner></fig-spinner>
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
### Combo Input (`<fig-combo-input>`)
|
|
352
|
+
|
|
353
|
+
```html
|
|
354
|
+
<!-- Basic combo input -->
|
|
355
|
+
<fig-combo-input
|
|
356
|
+
options="House, Apartment, Condo, Other"
|
|
357
|
+
placeholder="Type of residence"
|
|
358
|
+
></fig-combo-input>
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
### Chit (`<fig-chit>`)
|
|
362
|
+
|
|
363
|
+
```html
|
|
364
|
+
<!-- Basic chit -->
|
|
365
|
+
<fig-chit type="color" value="#ff0000"></fig-chit>
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
### Image (`<fig-image>`)
|
|
369
|
+
|
|
370
|
+
```html
|
|
371
|
+
<!-- Basic image -->
|
|
372
|
+
<fig-image src="https://via.placeholder.com/150"></fig-image>
|
|
373
|
+
```
|
|
374
|
+
|
|
375
|
+
### Header (`<fig-header>`)
|
|
376
|
+
|
|
377
|
+
```html
|
|
378
|
+
<!-- Basic header -->
|
|
379
|
+
<fig-header>
|
|
380
|
+
<h3>Header</h3>
|
|
381
|
+
</fig-header>
|
|
382
|
+
```
|
|
383
|
+
|
|
384
|
+
### fig-segmented-control (`<fig-segmented-control>`)
|
|
385
|
+
|
|
386
|
+
```html
|
|
387
|
+
<!-- Basic segmented control -->
|
|
388
|
+
<fig-segmented-control>
|
|
389
|
+
<fig-segment value="1" selected="true">Option 1</fig-segment>
|
|
390
|
+
<fig-segment value="2">Option 2</fig-segment>
|
|
391
|
+
</fig-segmented-control>
|
|
392
|
+
```
|
package/package.json
CHANGED