@rogieking/figui3 1.0.91 → 1.0.93

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 (3) hide show
  1. package/example.html +23 -2
  2. package/fig.css +67 -72
  3. package/package.json +1 -1
package/example.html CHANGED
@@ -19,13 +19,33 @@
19
19
  <h2>Heading 2</h2>
20
20
  <h3>Heading 3</h3>
21
21
  <br />
22
+ <fig-button disabled>Button 1</fig-button>
23
+ <br /><br />
24
+ <fig-button variant="secondary"
25
+ disabled>Button 1</fig-button>
26
+ <br /><br />
27
+ <fig-button-combo>
28
+ <fig-button disabled>Button 1</fig-button>
29
+ <fig-button disabled>Button 2</fig-button>
30
+ <fig-button disabled>Button 3</fig-button>
31
+ </fig-button-combo>
32
+ <br /><br />
33
+ <fig-button-combo>
34
+ <fig-button variant="secondary"
35
+ disabled>Button 1</fig-button>
36
+ <fig-button variant="secondary"
37
+ disabled>Button 2</fig-button>
38
+ <fig-button variant="secondary"
39
+ disabled>Button 3</fig-button>
40
+ </fig-button-combo>
41
+ <br /><br />
22
42
  <fig-dropdown>
23
43
  <option>One</option>
24
44
  <option>Two</option>
25
45
  <option>Three</option>
26
46
  <option selected>Four</option>
27
47
  </fig-dropdown>
28
- <br />
48
+ <br /><br />
29
49
  <fig-slider min="0"
30
50
  max="1"
31
51
  transform="100"
@@ -200,7 +220,8 @@
200
220
  <fig-button-combo>
201
221
  <fig-button>Primary</fig-button>
202
222
  <fig-button icon="true"
203
- type="select">
223
+ type="select"
224
+ size="compact">
204
225
  <svg width="24"
205
226
  height="24"
206
227
  viewBox="0 0 24 24"
package/fig.css CHANGED
@@ -584,7 +584,7 @@ textarea {
584
584
  select,
585
585
  input[type="text"][list] {
586
586
  height: var(--spacer-4);
587
- padding: 0 var(--spacer-2);
587
+ padding: 0 calc(var(--spacer-2) - 1px);
588
588
  appearance: none;
589
589
  border-radius: var(--radius-medium);
590
590
  display: flex;
@@ -641,7 +641,6 @@ fig-dropdown,
641
641
  /* Button */
642
642
  .fig-button,
643
643
  fig-button {
644
- box-shadow: inset 0 0 0 1px var(--figma-color-bordertranslucent);
645
644
  color: var(--figma-color-text-onbrand);
646
645
  display: flex;
647
646
  align-items: center;
@@ -656,25 +655,6 @@ fig-button {
656
655
  background-color: var(--figma-color-bg-brand);
657
656
  font-weight: 500;
658
657
 
659
- & > button {
660
- background: transparent;
661
- box-shadow: none;
662
- border: 0;
663
- appearance: none;
664
- outline: 0;
665
- display: flex;
666
- align-items: center;
667
- justify-content: center;
668
- border-radius: var(--radius-medium);
669
- height: var(--spacer-4);
670
- padding: 0 var(--spacer-2);
671
- color: currentColor;
672
- }
673
-
674
- &:has(> button) {
675
- padding: 0;
676
- }
677
-
678
658
  &:active {
679
659
  background-color: var(--figma-color-bg-brand-pressed);
680
660
  }
@@ -696,7 +676,7 @@ fig-button {
696
676
  }
697
677
  }
698
678
 
699
- &[variant="ghost"][disabled="true"] {
679
+ &[variant="ghost"][disabled]:not([disabled="false"]) {
700
680
  background-color: transparent;
701
681
  }
702
682
 
@@ -706,7 +686,8 @@ fig-button {
706
686
 
707
687
  /* Variant: Secondary */
708
688
  &[variant="secondary"] {
709
- box-shadow: inset 0 0 0 1px var(--figma-color-border);
689
+ border: 1px solid var(--figma-color-border);
690
+ padding: 0 calc(var(--spacer-2) - 1px);
710
691
  background: none;
711
692
  color: var(--figma-color-text);
712
693
 
@@ -722,21 +703,31 @@ fig-button {
722
703
  }
723
704
 
724
705
  /* Icon only */
725
- &[icon],
726
- &[icon] > button {
706
+ &[icon]{
727
707
  width: var(--spacer-4);
728
708
  padding: 0;
729
709
  flex-grow: 0;
730
710
  flex-shrink: 0;
731
711
  flex-basis: var(--spacer-4);
712
+ &[size="compact"]{
713
+ width: var(--spacer-3);
714
+ flex-basis: var(--spacer-3);
715
+ }
732
716
  }
733
717
 
734
718
  /* Disabled */
735
- &[disabled="true"],
736
- &[disabled="true"] > button {
719
+ &[disabled]:not([disabled="false"]){
737
720
  background-color: var(--figma-color-bg-disabled);
738
- color: var(--figma-color-text-disabled);
721
+
739
722
  pointer-events: none;
723
+ &:not([variant="secondary"]){
724
+ color: var(--figma-color-text-ondisabled);
725
+ box-shadow: none;
726
+ }
727
+ &[variant="secondary"]{
728
+ color: var(--figma-color-text-disabled);
729
+ background-color: transparent;
730
+ }
740
731
  }
741
732
 
742
733
  /* Size */
@@ -795,18 +786,60 @@ fig-button {
795
786
 
796
787
  &:focus,
797
788
  &:focus-within {
798
- outline: 0;
799
- box-shadow: inset 0 0 0 1px var(--figma-color-border-selected);
789
+ &:not(:active) {
790
+ outline: 0;
791
+ box-shadow: inset 0 0 0 1px var(--figma-color-border-selected);
792
+ }
800
793
  }
801
794
  }
802
795
 
803
- fig-button > button {
804
- width: 100%;
796
+ /* Combo button */
797
+ .fig-button-combo,
798
+ fig-button-combo,
799
+ .fig-input-combo,
800
+ fig-input-combo {
801
+ display: inline-flex;
802
+ flex-wrap: nowrap;
803
+ align-items: center;
804
+ gap: 0px;
805
+ & > * {
806
+ &:first-child,
807
+ &:first-child > * {
808
+ border-top-right-radius: 0;
809
+ border-bottom-right-radius: 0;
810
+ }
811
+
812
+ &:last-child,
813
+ &:last-child > * {
814
+ border-top-left-radius: 0;
815
+ border-bottom-left-radius: 0;
816
+ }
817
+
818
+ &:not(:last-child):not(:first-child),
819
+ &:not(:last-child):not(:first-child) > * {
820
+ border-radius: 0;
821
+ }
822
+ }
823
+ }
824
+ .fig-button-combo,
825
+ fig-button-combo {
826
+ > *:not([variant="secondary"]):not(:first-child) {
827
+ box-shadow: inset 1px 0 0 0 var(--figma-color-bg-brand-hover);
828
+ &[disabled]:not([disabled="false"]) {
829
+ box-shadow: inset 1px 0 0 0 var(--figma-color-border-disabled);
830
+ }
831
+ }
832
+ > *[variant="secondary"]:not(:first-child) {
833
+ border-left-width: 0 !important;
834
+ &[disabled]:not([disabled="false"]) {
835
+ border-left-width: 0 !important;
836
+ }
837
+ }
805
838
  }
806
839
 
807
840
  /* Tabs */
808
841
  fig-tab,
809
- .tab {
842
+ .fig-tab {
810
843
  display: inline-flex;
811
844
  flex-direction: column;
812
845
  align-items: center;
@@ -838,7 +871,7 @@ fig-tab,
838
871
  }
839
872
 
840
873
  &:has(:checked),
841
- &[selected] {
874
+ &[selected]:not([selected="false"]) {
842
875
  background-color: var(--figma-color-bg-secondary);
843
876
  font-weight: var(--body-medium-strong-fontWeight);
844
877
  color: var(--figma-color-text);
@@ -1116,45 +1149,7 @@ fig-image {
1116
1149
  }
1117
1150
  }
1118
1151
 
1119
- /* Combo button */
1120
- .fig-button-combo,
1121
- fig-button-combo,
1122
- .fig-input-combo,
1123
- fig-input-combo {
1124
- display: inline-flex;
1125
- flex-wrap: nowrap;
1126
- align-items: center;
1127
- gap: 0px;
1128
- & > * {
1129
- &:first-child,
1130
- &:first-child > * {
1131
- border-top-right-radius: 0;
1132
- border-bottom-right-radius: 0;
1133
- }
1134
-
1135
- &:last-child,
1136
- &:last-child > * {
1137
- border-top-left-radius: 0;
1138
- border-bottom-left-radius: 0;
1139
- }
1140
1152
 
1141
- &:not(:last-child):not(:first-child),
1142
- &:not(:last-child):not(:first-child) > * {
1143
- border-radius: 0;
1144
- }
1145
- }
1146
- }
1147
- .fig-button-combo,
1148
- fig-button-combo {
1149
- > *:not(:first-child) {
1150
- border-left: 1px solid var(--figma-color-bg-brand-hover);
1151
- margin-left: -1px;
1152
- }
1153
- > *[variant="secondary"]:not(:first-child) {
1154
- border-left: transparent;
1155
- margin-left: -1px;
1156
- }
1157
- }
1158
1153
 
1159
1154
  /* Combo input */
1160
1155
  .input-combo {
package/package.json CHANGED
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@rogieking/figui3",
3
- "version": "1.0.91"
3
+ "version": "1.0.93"
4
4
  }