@rogieking/figui3 1.6.9 → 1.7.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/components.css CHANGED
@@ -437,6 +437,8 @@
437
437
  /* Icons */
438
438
  --icon-chevron: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5.87868 7.12132L8 9.24264L10.1213 7.12132' stroke='rgb(0 0 0 / 90%)' stroke-linecap='round'/%3E%3C/svg%3E%0A");
439
439
  --icon-checkmark: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M11.7773 4.08403C12.0071 4.2372 12.0692 4.54764 11.916 4.7774L7.91603 10.7774C7.83293 10.902 7.69834 10.9829 7.54927 10.9976C7.4002 11.0124 7.25237 10.9595 7.14645 10.8536L4.14645 7.85361C3.95118 7.65834 3.95118 7.34176 4.14645 7.1465C4.34171 6.95124 4.65829 6.95124 4.85355 7.1465L7.42229 9.71523L11.084 4.2227C11.2372 3.99294 11.5476 3.93085 11.7773 4.08403Z' fill='white'/%3E%3C/svg%3E%0A");
440
+ --icon-steppers: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11.7245 6.08191C11.9186 5.95386 12.1826 5.97562 12.3534 6.14637L14.3534 8.14637L14.4179 8.22449C14.546 8.41852 14.5242 8.68253 14.3534 8.8534C14.1826 9.02426 13.9186 9.04601 13.7245 8.91785L13.6464 8.8534L11.9999 7.20691L10.3534 8.8534C10.1582 9.04866 9.84166 9.04866 9.6464 8.8534C9.45123 8.65813 9.45117 8.3416 9.6464 8.14637L11.6464 6.14637L11.7245 6.08191Z' fill='black'/%3E%3Cpath d='M13.7248 15.0822C13.9189 14.9541 14.1829 14.9758 14.3537 15.1467C14.5246 15.3176 14.5463 15.5815 14.4182 15.7756L14.3537 15.8537L12.3537 17.8537C12.1829 18.0246 11.9189 18.0463 11.7248 17.9182L11.6467 17.8537L9.64669 15.8537L9.58224 15.7756C9.45407 15.5815 9.47583 15.3176 9.64669 15.1467C9.81756 14.9758 10.0815 14.9541 10.2756 15.0822L10.3537 15.1467L12.0002 16.7932L13.6467 15.1467L13.7248 15.0822Z' fill='black' /%3E%3C/svg%3E%0A");
441
+
440
442
  /* Elevations */
441
443
  --figma-elevation-100: 0px 0px 0.5px 0px rgba(0, 0, 0, 0.3),
442
444
  0px 1px 3px 0px rgba(0, 0, 0, 0.15);
@@ -451,6 +453,7 @@
451
453
 
452
454
  :root.figma-dark {
453
455
  --icon-chevron: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5.87868 7.12132L8 9.24264L10.1213 7.12132' stroke='rgb(255 255 255 / 100%)' stroke-linecap='round'/%3E%3C/svg%3E%0A");
456
+
454
457
  --handle-shadow: 0px 0 0 0.75px 0px 0 0 0.75px rgba(0, 0, 0, 0.1),
455
458
  0px 0px 0.5px 0px rgba(255, 255, 255, 0.1);
456
459
  --figma-color-bg-ghost-hover: rgba(255, 255, 255, 0.05);
@@ -506,10 +509,33 @@ input[type="password"],
506
509
  &::-webkit-outer-spin-button,
507
510
  &::-webkit-inner-spin-button {
508
511
  display: none;
512
+ -webkit-appearance: none;
509
513
  margin: 0;
510
514
  }
511
515
  }
512
516
 
517
+ fig-input-text {
518
+ &:has([slot="append"]) input[type="number"] {
519
+ &::-webkit-outer-spin-button,
520
+ &::-webkit-inner-spin-button {
521
+ display: none;
522
+ margin: 0;
523
+ opacity: 0;
524
+ }
525
+ }
526
+ &[steppers="true"] {
527
+ input[type="number"]::-webkit-inner-spin-button {
528
+ display: block;
529
+ opacity: 1;
530
+ height: 1.5rem;
531
+ width: 1.5rem;
532
+ margin-right: calc(var(--spacer-2) * -1);
533
+ background-color: var(--figma-color-text-secondary);
534
+ mask-image: var(--icon-steppers);
535
+ }
536
+ }
537
+ }
538
+
513
539
  /* Textarea */
514
540
  textarea {
515
541
  min-height: 2rem;
package/example.html CHANGED
@@ -272,15 +272,7 @@
272
272
  label="Upload image"
273
273
  size="large"></fig-image>
274
274
  </fig-field>
275
- <br /><br />
276
- <fig-field>
277
- <label>Large (with upload)</label>
278
- <fig-image upload="true"
279
- label="Change image"
280
- aspect-ratio="auto"
281
- src="charli.jpeg"
282
- size="large"></fig-image>
283
- </fig-field>
275
+
284
276
  <br /><br />
285
277
  <fig-header>
286
278
  <h2>Button</h2>
@@ -575,7 +567,8 @@
575
567
  <fig-field>
576
568
  <label>Numeric input</label>
577
569
  <fig-input-text placeholder="###"
578
- type="number"></fig-input-text>
570
+ type="number"
571
+ steppers="true"></fig-input-text>
579
572
  </fig-field>
580
573
  <fig-field>
581
574
  <label>Password input</label>
@@ -920,15 +913,7 @@
920
913
  </fig-button>
921
914
  </fig-field>
922
915
  </fig-content>
923
- <script>
924
- let elements = Array.from(document.querySelectorAll('*'));
925
- elements.filter(n => n.tagName.toLowerCase().indexOf("fig-slider") > -1).forEach(n => n.addEventListener('input', (e) => {
926
- console.log('input:', n.tagName, e.target)
927
- }))
928
- document.querySelectorAll('fig-input-color').forEach(n => n.addEventListener('change', (e) => {
929
- console.log('change:', n.tagName, e.target.value)
930
- }))
931
- </script>
916
+
932
917
  </body>
933
918
 
934
919
  </html>
package/fig.js CHANGED
@@ -450,7 +450,6 @@ class FigDialog extends HTMLDialogElement {
450
450
  connectedCallback() {
451
451
  this.modal =
452
452
  this.hasAttribute("modal") && this.getAttribute("modal") !== "false";
453
-
454
453
  requestAnimationFrame(() => {
455
454
  this.#addCloseListeners();
456
455
  });
@@ -983,8 +982,8 @@ class FigInputText extends HTMLElement {
983
982
 
984
983
  //child nodes hack
985
984
  requestAnimationFrame(() => {
986
- const append = this.querySelector("[slot=append]");
987
- const prepend = this.querySelector("[slot=prepend]");
985
+ let append = this.querySelector("[slot=append]");
986
+ let prepend = this.querySelector("[slot=prepend]");
988
987
 
989
988
  this.innerHTML = html;
990
989
 
@@ -1845,7 +1844,6 @@ class FigImage extends HTMLElement {
1845
1844
  await new Promise((resolve) => {
1846
1845
  this.image = new Image();
1847
1846
  this.image.crossOrigin = "Anonymous";
1848
- console.log("loading image", this.src);
1849
1847
  this.image.onload = async () => {
1850
1848
  this.aspectRatio = this.image.width / this.image.height;
1851
1849
  this.style.setProperty(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rogieking/figui3",
3
- "version": "1.6.9",
3
+ "version": "1.7.0",
4
4
  "module": "index.ts",
5
5
  "type": "module",
6
6
  "devDependencies": {
package/bun.lockb DELETED
Binary file