@rogieking/figui3 1.0.87 → 1.0.89

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.
Files changed (2) hide show
  1. package/README.md +330 -40
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,89 +1,379 @@
1
- # Figma UI3 Web Components
1
+ # FigUI3
2
2
 
3
- figUI3 is a collection of custom web components that provide various UI elements and functionality for web applications. These components are designed to be easily integrated into your projects, offering a set of reusable and customizable UI elements.
3
+ A lightweight, customizable web component library that uses Figmas UI3 style for modern web applications, but specifically for Figma plugins.
4
4
 
5
- ## Table of Contents
5
+ ## Features
6
6
 
7
- - [Components](#components)
8
- - [Installation](#installation)
9
- - [Usage](#usage)
10
- - [Contributing](#contributing)
11
- - [License](#license)
7
+ - 🎨 Figma-inspired design system
8
+ - 📦 Zero dependencies
9
+ - 🚀 Lightweight and performant
10
+ - 🎯 Built with Web Components
11
+ - 🔧 Highly customizable
12
+ - 🌐 Framework agnostic
12
13
 
13
14
  ## Components
14
15
 
15
- The Fig Components library includes the following custom elements:
16
-
17
- 1. `<fig-button>`: A customizable button component.
18
- 2. `<fig-dropdown>`: A dropdown select component.
19
- 3. `<fig-tooltip>`: A tooltip component that can be triggered by hover or click.
20
- 4. `<fig-popover>`: A popover component similar to tooltip but with more flexibility.
21
- 5. `<fig-dialog>`: A dialog/modal component.
22
- 6. `<fig-tabs>`: A tabbed interface component.
23
- 7. `<fig-segmented-control>`: A segmented control component for mutually exclusive options.
24
- 8. `<fig-slider>`: A slider input component with optional text input.
25
- 9. `<fig-input-text>`: A text input component with optional append and prepend slots.
26
- 10. `<fig-field>`: A form field wrapper component.
27
- 11. `<fig-input-color>`: A color input component with optional text and alpha inputs.
28
- 12. `<fig-checkbox>`: A checkbox input component.
29
- 13. `<fig-switch>`: A switch/toggle input component.
16
+ The library includes the following components:
17
+
18
+ - `<fig-button>` - Versatile button component with multiple variants
19
+ - `<fig-checkbox>` - Checkbox input with indeterminate state support
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
+ - `<fig-input-color>` - Color picker with hex/rgba support
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
30
35
 
31
36
  ## Installation
32
37
 
33
- To use Fig Components in your project, include the JavaScript file in your HTML:
38
+ ```bash
39
+ npm install fig-js
40
+ ```
41
+
42
+ Or include directly in your HTML:
34
43
 
35
44
  ```html
36
- <script src="path/to/fig-components.js"></script>
45
+ <script src="https://unpkg.com/fig-js@latest/dist/fig.js"></script>
37
46
  ```
38
47
 
39
- Make sure to replace `path/to/fig-components.js` with the actual path to the JavaScript file containing the component definitions.
40
-
41
48
  ## Usage
42
49
 
43
- After including the Fig Components script in your HTML, you can use the custom elements in your markup. Here are some examples:
50
+ ```html
51
+ <!-- Basic button -->
52
+ <fig-button>Click me</fig-button>
53
+
54
+ <!-- Slider with text input -->
55
+ <fig-field direction="horizontal">
56
+ <label>Opacity</label>
57
+ <fig-slider type="opacity" value="0.75" color="#ff0000" units="%" text="true">
58
+ </fig-slider>
59
+ </fig-field>
60
+ ```
61
+
62
+ ## Documentation
63
+
64
+ For detailed documentation and examples, visit our [documentation site](https://your-docs-site.com).
65
+
66
+ ## Browser Support
44
67
 
45
- ### Button
68
+ Fig.js supports all modern browsers that implement the Web Components standard:
69
+
70
+ - Chrome/Edge (Chromium) 67+
71
+ - Firefox 63+
72
+ - Safari 10.1+
73
+
74
+ ## Contributing
75
+
76
+ Contributions are welcome! Please read our [contributing guidelines](CONTRIBUTING.md) before submitting a pull request.
77
+
78
+ ## License
79
+
80
+ [MIT License](LICENSE)
81
+
82
+ ## Component Examples
83
+
84
+ ### Button (`<fig-button>`)
46
85
 
47
86
  ```html
87
+ <!-- Basic button -->
48
88
  <fig-button>Click me</fig-button>
89
+
90
+ <!-- Primary variant -->
91
+ <fig-button variant="primary">Primary Button</fig-button>
92
+
93
+ <!-- Secondary variant -->
94
+ <fig-button variant="secondary">Secondary Button</fig-button>
95
+
96
+ <!-- Ghost variant -->
97
+ <fig-button variant="ghost">Ghost Button</fig-button>
98
+
99
+ <!-- Ghost variant with icon -->
100
+ <fig-button variant="ghost" icon="true">
101
+ <svg><!-- your icon svg --></svg>
102
+ </fig-button>
103
+
104
+ <!-- Link variant -->
105
+ <fig-button variant="link">Link Button</fig-button>
106
+
107
+ <!-- Disabled state -->
108
+ <fig-button disabled>Disabled</fig-button>
109
+
110
+ <!-- Toggle button -->
111
+ <fig-button type="toggle">Toggle Me</fig-button>
112
+
113
+ <!-- Submit button -->
114
+ <fig-button type="submit">Submit</fig-button>
115
+
116
+ <!-- Select list button -->
117
+ <fig-button type="select">
118
+ Select Me
119
+ <fig-dropdown>
120
+ <option value="1">Option 1</option>
121
+ <option value="2">Option 2</option>
122
+ <option value="3">Option 3</option>
123
+ </fig-dropdown>
124
+ </fig-button>
125
+
126
+ <!-- Default button -->
127
+ <fig-button type="button">Default</fig-button>
128
+
129
+ <!-- Upload button -->
130
+ <fig-button type="upload">
131
+ Upload
132
+ <input type="file" />
133
+ </fig-button>
49
134
  ```
50
135
 
51
- ### Dropdown
136
+ ### Dropdown (`<fig-dropdown>`)
52
137
 
53
138
  ```html
139
+ <!-- Basic dropdown -->
54
140
  <fig-dropdown>
55
141
  <option value="1">Option 1</option>
56
142
  <option value="2">Option 2</option>
57
143
  <option value="3">Option 3</option>
58
144
  </fig-dropdown>
145
+
146
+ <!-- With default selection -->
147
+ <fig-dropdown value="2">
148
+ <option value="1">Option 1</option>
149
+ <option value="2">Option 2</option>
150
+ <option value="3">Option 3</option>
151
+ </fig-dropdown>
59
152
  ```
60
153
 
61
- ### Tooltip
154
+ ### Tooltip (`<fig-tooltip>`)
62
155
 
63
156
  ```html
157
+ <!-- Hover tooltip -->
64
158
  <fig-tooltip text="This is a tooltip" action="hover">
65
159
  Hover over me
66
160
  </fig-tooltip>
161
+
162
+ <!-- Click tooltip -->
163
+ <fig-tooltip text="Click tooltip" action="click"> Click me </fig-tooltip>
67
164
  ```
68
165
 
69
- ### Slider
166
+ ### Popover (`<fig-popover>`)
70
167
 
71
168
  ```html
72
- <fig-slider min="0" max="100" value="50" text></fig-slider>
169
+ <!-- Basic popover -->
170
+ <fig-popover>
171
+ <button slot="trigger">Open Popover</button>
172
+ <div slot="content">
173
+ <h3>Popover Title</h3>
174
+ <p>This is the popover content.</p>
175
+ </div>
176
+ </fig-popover>
73
177
  ```
74
178
 
75
- ### Color Input
179
+ ### Dialog (`<fig-dialog>`)
76
180
 
77
181
  ```html
78
- <fig-input-color value="#ff0000" text alpha></fig-input-color>
182
+ <!-- Basic dialog -->
183
+ <fig-dialog>
184
+ <fig-header>Dialog Title</fig-header>
185
+ <div slot="content">
186
+ <p>Dialog content goes here.</p>
187
+ </div>
188
+ <div slot="footer">
189
+ <fig-button>Cancel</fig-button>
190
+ <fig-button variant="primary">Confirm</fig-button>
191
+ </div>
192
+ </fig-dialog>
79
193
  ```
80
194
 
81
- For more detailed usage instructions and examples for each component, please refer to the individual component documentation.
195
+ ### Tabs (`<fig-tabs>`)
82
196
 
83
- ## Contributing
197
+ ```html
198
+ <fig-tabs>
199
+ <fig-tab label="Tab 1">Content 1</fig-tab>
200
+ <fig-tab label="Tab 2">Content 2</fig-tab>
201
+ <fig-tab label="Tab 3">Content 3</fig-tab>
202
+ </fig-tabs>
203
+ ```
84
204
 
85
- Contributions to Fig Components are welcome! Please feel free to submit a Pull Request.
205
+ ### Segmented Control (`<fig-segmented-control>`)
86
206
 
87
- ## License
207
+ ```html
208
+ <fig-segmented-control>
209
+ <button value="1">Option 1</button>
210
+ <button value="2">Option 2</button>
211
+ <button value="3">Option 3</button>
212
+ </fig-segmented-control>
213
+ ```
88
214
 
89
- [MIT License](LICENSE)
215
+ ### Slider (`<fig-slider>`)
216
+
217
+ ```html
218
+ <!-- Basic range slider -->
219
+ <fig-slider min="0" max="100" value="50"></fig-slider>
220
+
221
+ <!-- Slider with text input and units -->
222
+ <fig-slider min="0" max="100" value="75" text="true" units="%"> </fig-slider>
223
+
224
+ <!-- Hue slider -->
225
+ <fig-slider type="hue" value="55"></fig-slider>
226
+
227
+ <!-- Stepper slider with discrete snapping values-->
228
+ <fig-slider type="stepper" value="25" default="50" step="25">
229
+ <datalist id="markers">
230
+ <option value="0"></option>
231
+ <option value="25"></option>
232
+ <option value="50"></option>
233
+ <option value="75"></option>
234
+ <option value="100"></option>
235
+ </datalist>
236
+ </fig-slider>
237
+
238
+ <!-- Delta slider -->
239
+ <fig-slider type="delta" value=".25" default="0" step="0.25" min="-5" max="5">
240
+ <datalist id="markers">
241
+ <option value="0"></option>
242
+ </datalist>
243
+ </fig-slider>
244
+
245
+ <!-- Opacity slider with color -->
246
+ <fig-slider type="opacity" value="0.75" color="#ff0000" units="%" text="true">
247
+ </fig-slider>
248
+
249
+ <!-- Number slider with number transform and percentage units -->
250
+ <fig-slider
251
+ min="0"
252
+ max="1"
253
+ transform="100"
254
+ units="%"
255
+ step="0.01"
256
+ text="true"
257
+ value="0.5"
258
+ >
259
+ </fig-slider>
260
+ ```
261
+
262
+ ### Text Input (`<fig-input-text>`)
263
+
264
+ ```html
265
+ <!-- Basic text input -->
266
+ <fig-input-text value="Hello World"></fig-input-text>
267
+
268
+ <!-- With placeholder -->
269
+ <fig-input-text placeholder="Enter text..."></fig-input-text>
270
+
271
+ <!-- With prepend and append slots -->
272
+ <fig-input-text>
273
+ <span slot="prepend">$</span>
274
+ <span slot="append">.00</span>
275
+ </fig-input-text>
276
+ ```
277
+
278
+ ### Field (`<fig-field>`)
279
+
280
+ ```html
281
+ <!-- Vertical layout -->
282
+ <fig-field>
283
+ <label>Username</label>
284
+ <fig-input-text></fig-input-text>
285
+ <span class="help">Enter your username</span>
286
+ </fig-field>
287
+
288
+ <!-- Horizontal layout -->
289
+ <fig-field direction="horizontal">
290
+ <label>Volume</label>
291
+ <fig-slider min="0" max="100" value="50"></fig-slider>
292
+ </fig-field>
293
+ ```
294
+
295
+ ### Color Input (`<fig-input-color>`)
296
+
297
+ ```html
298
+ <!-- Basic color picker -->
299
+ <fig-input-color value="#ff0000"></fig-input-color>
300
+
301
+ <!-- With text input and alpha channel -->
302
+ <fig-input-color value="#ff0000" text="true" alpha="true"> </fig-input-color>
303
+ ```
304
+
305
+ ### Checkbox (`<fig-checkbox>`)
306
+
307
+ ```html
308
+ <!-- Basic checkbox -->
309
+ <fig-checkbox>Accept terms</fig-checkbox>
310
+
311
+ <!-- Checked state -->
312
+ <fig-checkbox checked>Selected option</fig-checkbox>
313
+
314
+ <!-- Indeterminate state -->
315
+ <fig-checkbox indeterminate>Parent option</fig-checkbox>
316
+ ```
317
+
318
+ ### Switch (`<fig-switch>`)
319
+
320
+ ```html
321
+ <!-- Basic switch -->
322
+ <fig-switch></fig-switch>
323
+
324
+ <!-- With label -->
325
+ <fig-switch>Enable notifications</fig-switch>
326
+
327
+ <!-- Checked state -->
328
+ <fig-switch checked>Active</fig-switch>
329
+ ```
330
+
331
+ ### Spinner (`<fig-spinner>`)
332
+
333
+ ```html
334
+ <!-- Basic spinner -->
335
+ <fig-spinner></fig-spinner>
336
+ ```
337
+
338
+ ### Combo Input (`<fig-combo-input>`)
339
+
340
+ ```html
341
+ <!-- Basic combo input -->
342
+ <fig-combo-input
343
+ options="House, Apartment, Condo, Other"
344
+ placeholder="Type of residence"
345
+ ></fig-combo-input>
346
+ ```
347
+
348
+ ### Chit (`<fig-chit>`)
349
+
350
+ ```html
351
+ <!-- Basic chit -->
352
+ <fig-chit type="color" value="#ff0000"></fig-chit>
353
+ ```
354
+
355
+ ### Image (`<fig-image>`)
356
+
357
+ ```html
358
+ <!-- Basic image -->
359
+ <fig-image src="https://via.placeholder.com/150"></fig-image>
360
+ ```
361
+
362
+ ### Header (`<fig-header>`)
363
+
364
+ ```html
365
+ <!-- Basic header -->
366
+ <fig-header>
367
+ <h3>Header</h3>
368
+ </fig-header>
369
+ ```
370
+
371
+ ### fig-segmented-control (`<fig-segmented-control>`)
372
+
373
+ ```html
374
+ <!-- Basic segmented control -->
375
+ <fig-segmented-control>
376
+ <fig-segment value="1" selected="true">Option 1</fig-segment>
377
+ <fig-segment value="2">Option 2</fig-segment>
378
+ </fig-segmented-control>
379
+ ```
package/package.json CHANGED
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@rogieking/figui3",
3
- "version": "1.0.87"
3
+ "version": "1.0.89"
4
4
  }