@rogieking/figui3 3.3.0 → 3.4.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
@@ -257,6 +257,19 @@
257
257
  );
258
258
 
259
259
  /* Gradients */
260
+ --eased-fade-stops:
261
+ var(--figma-color-bg) 0%,
262
+ color-mix(in oklch, var(--figma-color-bg) 99.9%, transparent) 10%,
263
+ color-mix(in oklch, var(--figma-color-bg) 99.2%, transparent) 20%,
264
+ color-mix(in oklch, var(--figma-color-bg) 97.3%, transparent) 30%,
265
+ color-mix(in oklch, var(--figma-color-bg) 93.6%, transparent) 40%,
266
+ color-mix(in oklch, var(--figma-color-bg) 87.5%, transparent) 50%,
267
+ color-mix(in oklch, var(--figma-color-bg) 78.4%, transparent) 60%,
268
+ color-mix(in oklch, var(--figma-color-bg) 65.7%, transparent) 70%,
269
+ color-mix(in oklch, var(--figma-color-bg) 48.8%, transparent) 80%,
270
+ color-mix(in oklch, var(--figma-color-bg) 27.1%, transparent) 90%,
271
+ transparent 100%;
272
+
260
273
  --checkerboard: repeating-conic-gradient(
261
274
  rgba(0, 0, 0, 0.1) 0% 25%,
262
275
  rgba(255, 255, 255, 0.1) 0% 50%
@@ -1167,6 +1180,7 @@ fig-chit {
1167
1180
  width: var(--size);
1168
1181
  height: var(--size);
1169
1182
  border-radius: var(--radius-medium);
1183
+ cursor: default;
1170
1184
 
1171
1185
  &::before,
1172
1186
  &::after,
@@ -3998,6 +4012,207 @@ fig-fill-picker {
3998
4012
  }
3999
4013
  }
4000
4014
 
4015
+ /* Chooser */
4016
+ fig-chooser {
4017
+ --chooser-fade-size: var(--spacer-4);
4018
+
4019
+ display: flex;
4020
+ flex-direction: column;
4021
+ gap: 1px;
4022
+ overflow: hidden auto;
4023
+ scrollbar-width: none;
4024
+
4025
+ &[overflow="scrollbar"] {
4026
+ scrollbar-width: thin;
4027
+ scrollbar-color: var(--figma-color-border) transparent;
4028
+ }
4029
+
4030
+ &[layout="horizontal"] {
4031
+ flex-direction: row;
4032
+ flex-wrap: nowrap;
4033
+ overflow: auto hidden;
4034
+ scrollbar-width: none;
4035
+
4036
+ &[overflow="scrollbar"] {
4037
+ scrollbar-width: thin;
4038
+ scrollbar-color: var(--figma-color-border) transparent;
4039
+ }
4040
+
4041
+ > :not(.fig-chooser-nav-start):not(.fig-chooser-nav-end) {
4042
+ flex: 1 1 0%;
4043
+ }
4044
+ fig-image[full] {
4045
+ min-width: 3rem;
4046
+ }
4047
+ }
4048
+
4049
+ &[layout="grid"] {
4050
+ display: grid;
4051
+ grid-template-columns: 1fr 1fr;
4052
+
4053
+ > * {
4054
+ min-width: 0;
4055
+ width: 100%;
4056
+ }
4057
+
4058
+ > .fig-chooser-nav-start,
4059
+ > .fig-chooser-nav-end {
4060
+ grid-column: 1 / -1;
4061
+ }
4062
+ }
4063
+
4064
+ &[full]:not([full="false"]) {
4065
+ width: 100%;
4066
+ }
4067
+
4068
+ &[disabled]:not([disabled="false"]) {
4069
+ pointer-events: none;
4070
+ opacity: 0.4;
4071
+ }
4072
+
4073
+ .fig-chooser-nav-start,
4074
+ .fig-chooser-nav-end {
4075
+ all: unset;
4076
+ position: sticky;
4077
+ z-index: 3;
4078
+ flex-shrink: 0;
4079
+ display: flex;
4080
+ align-items: center;
4081
+ justify-content: center;
4082
+ cursor: pointer;
4083
+ opacity: 0;
4084
+ pointer-events: none;
4085
+ color: var(--figma-color-icon);
4086
+ transition: opacity 0.2s ease;
4087
+
4088
+ &:hover {
4089
+ background: var(--figma-color-bg) !important;
4090
+ }
4091
+
4092
+ &::after {
4093
+ content: "";
4094
+ display: block;
4095
+ width: 1rem;
4096
+ height: 1rem;
4097
+ mask-image: var(--icon-chevron);
4098
+ mask-size: contain;
4099
+ mask-repeat: no-repeat;
4100
+ mask-position: center;
4101
+ background: currentColor;
4102
+ }
4103
+ }
4104
+
4105
+ .fig-chooser-nav-start {
4106
+ top: 0;
4107
+ left: 0;
4108
+ right: 0;
4109
+ width: 100%;
4110
+ height: var(--chooser-fade-size);
4111
+ margin-bottom: calc(var(--chooser-fade-size) * -1);
4112
+ background: linear-gradient(to bottom, var(--eased-fade-stops));
4113
+
4114
+ &:hover {
4115
+ box-shadow: 0 1px 0 0 var(--figma-color-border) !important;
4116
+ }
4117
+
4118
+ &::after {
4119
+ rotate: 180deg;
4120
+ }
4121
+ }
4122
+
4123
+ .fig-chooser-nav-end {
4124
+ bottom: 0;
4125
+ left: 0;
4126
+ right: 0;
4127
+ width: 100%;
4128
+ height: var(--chooser-fade-size);
4129
+ margin-top: calc(var(--chooser-fade-size) * -1);
4130
+ background: linear-gradient(to top, var(--eased-fade-stops));
4131
+
4132
+ &:hover {
4133
+ box-shadow: 0 -1px 0 0 var(--figma-color-border) !important;
4134
+ }
4135
+ }
4136
+
4137
+ &[layout="horizontal"] {
4138
+ .fig-chooser-nav-start,
4139
+ .fig-chooser-nav-end {
4140
+ top: 0;
4141
+ bottom: 0;
4142
+ height: auto;
4143
+ width: var(--chooser-fade-size);
4144
+ align-self: stretch;
4145
+ margin: 0;
4146
+ }
4147
+
4148
+ .fig-chooser-nav-start {
4149
+ left: 0;
4150
+ right: auto;
4151
+ margin-right: calc(var(--chooser-fade-size) * -1);
4152
+ background: linear-gradient(to right, var(--eased-fade-stops));
4153
+
4154
+ &:hover {
4155
+ box-shadow: 1px 0 0 0 var(--figma-color-border) !important;
4156
+ }
4157
+
4158
+ &::after {
4159
+ rotate: 90deg;
4160
+ }
4161
+ }
4162
+
4163
+ .fig-chooser-nav-end {
4164
+ right: 0;
4165
+ left: auto;
4166
+ margin-left: calc(var(--chooser-fade-size) * -1);
4167
+ background: linear-gradient(to left, var(--eased-fade-stops));
4168
+
4169
+ &:hover {
4170
+ box-shadow: -1px 0 0 0 var(--figma-color-border) !important;
4171
+ }
4172
+
4173
+ &::after {
4174
+ rotate: -90deg;
4175
+ }
4176
+ }
4177
+ }
4178
+
4179
+ &.overflow-start > .fig-chooser-nav-start {
4180
+ opacity: 1;
4181
+ pointer-events: auto;
4182
+ }
4183
+
4184
+ &.overflow-end > .fig-chooser-nav-end {
4185
+ opacity: 1;
4186
+ pointer-events: auto;
4187
+ }
4188
+ }
4189
+
4190
+ fig-choice {
4191
+ display: flex;
4192
+ align-items: center;
4193
+ flex-direction: column;
4194
+ border-radius: var(--radius-large);
4195
+ padding: var(--spacer-2);
4196
+ gap: var(--spacer-2);
4197
+ outline: none;
4198
+ border: 1px solid transparent;
4199
+
4200
+ &:hover:not([selected]):not([disabled]):not([aria-disabled="true"]) {
4201
+ background-color: var(--figma-color-bg-secondary);
4202
+ }
4203
+
4204
+ &[selected] {
4205
+ background-color: var(--figma-color-bg-selected);
4206
+ }
4207
+
4208
+ &[disabled]:not([disabled="false"]),
4209
+ &[aria-disabled="true"] {
4210
+ pointer-events: none;
4211
+ opacity: 0.4;
4212
+ cursor: default;
4213
+ }
4214
+ }
4215
+
4001
4216
  @keyframes fig-shimmer {
4002
4217
  0% {
4003
4218
  background-position: 100% 100%;