figma-kit 1.0.0-beta.1 → 1.0.0-beta.10

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/dist/styles.css CHANGED
@@ -5,28 +5,28 @@
5
5
  --font-family-monospace: 'Roboto Mono', monospace;
6
6
  }
7
7
  :root {
8
- --space-0: 0px;
9
- --space-px: 1px;
10
- --space-0_5: 2px;
11
- --space-1: 4px;
12
- --space-1_5: 6px;
13
- --space-2: 8px;
14
- --space-2_5: 10px;
15
- --space-3: 12px;
16
- --space-3_5: 14px;
17
- --space-4: 16px;
18
- --space-5: 20px;
19
- --space-6: 24px;
20
- --space-7: 28px;
21
- --space-8: 32px;
22
- --space-9: 36px;
23
- --space-10: 40px;
24
- --space-11: 44px;
25
- --space-12: 48px;
26
- --space-13: 52px;
27
- --space-14: 56px;
28
- --space-15: 60px;
29
- --space-16: 64px;
8
+ --space-0: 0rem;
9
+ --space-px: 0.0625rem;
10
+ --space-0_5: 0.125rem;
11
+ --space-1: 0.25rem;
12
+ --space-1_5: 0.375rem;
13
+ --space-2: 0.5rem;
14
+ --space-2_5: 0.625rem;
15
+ --space-3: 0.75rem;
16
+ --space-3_5: 0.875rem;
17
+ --space-4: 1rem;
18
+ --space-5: 1.25rem;
19
+ --space-6: 1.5rem;
20
+ --space-7: 1.75rem;
21
+ --space-8: 2rem;
22
+ --space-9: 2.25rem;
23
+ --space-10: 2.5rem;
24
+ --space-11: 2.75rem;
25
+ --space-12: 3rem;
26
+ --space-13: 3.25rem;
27
+ --space-14: 3.5rem;
28
+ --space-15: 3.75rem;
29
+ --space-16: 4rem;
30
30
  }
31
31
  :root {
32
32
  --radius-extra-small: 0.0625rem;
@@ -626,15 +626,19 @@
626
626
  font-weight: var(--font-weight-default);
627
627
  letter-spacing: var(--letter-spacing-default);
628
628
  line-height: var(--line-height-default);
629
- height: var(--space-6);
629
+ min-height: var(--space-6);
630
630
  color: var(--color-text-tooltip);
631
631
  white-space: pre-wrap;
632
632
  word-break: break-word;
633
633
  border-radius: var(--radius-medium);
634
- box-shadow: var(--elevation-300-tooltip, 0 2px 7px rgba(0, 0, 0, 0.15));
634
+ box-shadow: var(--elevation-300, 0 2px 7px rgba(0, 0, 0, 0.15));
635
635
  }
636
- .fp-arrow {
636
+ .fp-tooltip-arrow {
637
637
  fill: var(--color-bg-tooltip);
638
+ width: var(--space-3_5);
639
+ height: var(--space-1_5);
640
+ position: relative;
641
+ bottom: 1px;
638
642
  }
639
643
  .fp-textarea {
640
644
  all: unset;
@@ -717,6 +721,9 @@
717
721
  padding: 0 var(--space-4);
718
722
  color: var(--color-text-menu-tertiary);
719
723
  }
724
+ .fp-MenuLabel:where(.fp-MenuContent:has(.fp-MenuCheckboxItem, .fp-MenuRadioItem) .fp-MenuLabel) {
725
+ padding-left: var(--space-6);
726
+ }
720
727
  .fp-MenuGroup {
721
728
  padding: var(--space-2) 0;
722
729
  }
@@ -1024,8 +1031,7 @@
1024
1031
  --slider-thumb-width: var(--space-4);
1025
1032
  --color-border-slider-track: #0000001a;
1026
1033
  }
1027
- .dark,
1028
- .dark-theme {
1034
+ .figma-dark {
1029
1035
  --color-border-slider-track: #ffffff1a;
1030
1036
  }
1031
1037
  .fp-SliderRoot {
@@ -1442,6 +1448,10 @@
1442
1448
  font-weight: var(--font-weight-default);
1443
1449
  letter-spacing: var(--letter-spacing-default);
1444
1450
  line-height: var(--line-height-default);
1451
+ color: var(--figma-color-text-secondary);
1452
+ }
1453
+ .fp-CollapsibleIndicator {
1454
+ --color-icon: var(--figma-color-icon-secondary);
1445
1455
  }
1446
1456
  [data-state='open'] > .fp-CollapsibleIndicator {
1447
1457
  transform: rotate(90deg);
@@ -0,0 +1,287 @@
1
+ export default {
2
+ theme: {
3
+ colors: {
4
+ current: 'currentColor',
5
+ inherit: 'inherit',
6
+ transparent: 'transparent',
7
+ bg: {
8
+ DEFAULT: 'var(--figma-color-bg)',
9
+ brand: 'var(--figma-color-bg-brand)',
10
+ 'brand-hover': 'var(--figma-color-bg-brand-hover)',
11
+ 'brand-pressed': 'var(--figma-color-bg-brand-pressed)',
12
+ 'brand-secondary': 'var(--figma-color-bg-brand-secondary)',
13
+ 'brand-tertiary': 'var(--figma-color-bg-brand-tertiary)',
14
+ component: 'var(--figma-color-bg-component)',
15
+ 'component-hover': 'var(--figma-color-bg-component-hover)',
16
+ 'component-pressed': 'var(--figma-color-bg-component-pressed)',
17
+ 'component-secondary': 'var(--figma-color-bg-component-secondary)',
18
+ 'component-tertiary': 'var(--figma-color-bg-component-tertiary)',
19
+ danger: 'var(--figma-color-bg-danger)',
20
+ 'danger-hover': 'var(--figma-color-bg-danger-hover)',
21
+ 'danger-pressed': 'var(--figma-color-bg-danger-pressed)',
22
+ 'danger-secondary': 'var(--figma-color-bg-danger-secondary)',
23
+ 'danger-tertiary': 'var(--figma-color-bg-danger-tertiary)',
24
+ disabled: 'var(--figma-color-bg-disabled)',
25
+ 'disabled-secondary': 'var(--figma-color-bg-disabled-secondary)',
26
+ hover: 'var(--figma-color-bg-hover)',
27
+ inverse: 'var(--figma-color-bg-inverse)',
28
+ onselected: 'var(--figma-color-bg-onselected)',
29
+ 'onselected-hover': 'var(--figma-color-bg-onselected-hover)',
30
+ 'onselected-pressed': 'var(--figma-color-bg-onselected-pressed)',
31
+ pressed: 'var(--figma-color-bg-pressed)',
32
+ secondary: 'var(--figma-color-bg-secondary)',
33
+ selected: 'var(--figma-color-bg-selected)',
34
+ 'selected-hover': 'var(--figma-color-bg-selected-hover)',
35
+ 'selected-pressed': 'var(--figma-color-bg-selected-pressed)',
36
+ 'selected-secondary': 'var(--figma-color-bg-selected-secondary)',
37
+ 'selected-strong': 'var(--figma-color-bg-selected-strong)',
38
+ 'selected-tertiary': 'var(--figma-color-bg-selected-tertiary)',
39
+ success: 'var(--figma-color-bg-success)',
40
+ 'success-hover': 'var(--figma-color-bg-success-hover)',
41
+ 'success-pressed': 'var(--figma-color-bg-success-pressed)',
42
+ 'success-secondary': 'var(--figma-color-bg-success-secondary)',
43
+ 'success-tertiary': 'var(--figma-color-bg-success-tertiary)',
44
+ tertiary: 'var(--figma-color-bg-tertiary)',
45
+ warning: 'var(--figma-color-bg-warning)',
46
+ 'warning-hover': 'var(--figma-color-bg-warning-hover)',
47
+ 'warning-pressed': 'var(--figma-color-bg-warning-pressed)',
48
+ 'warning-secondary': 'var(--figma-color-bg-warning-secondary)',
49
+ 'warning-tertiary': 'var(--figma-color-bg-warning-tertiary)',
50
+ },
51
+ border: {
52
+ DEFAULT: 'var(--figma-color-border)',
53
+ brand: 'var(--figma-color-border-brand)',
54
+ 'brand-strong': 'var(--figma-color-border-brand-strong)',
55
+ component: 'var(--figma-color-border-component)',
56
+ 'component-hover': 'var(--figma-color-border-component-hover)',
57
+ 'component-strong': 'var(--figma-color-border-component-strong)',
58
+ danger: 'var(--figma-color-border-danger)',
59
+ 'danger-strong': 'var(--figma-color-border-danger-strong)',
60
+ disabled: 'var(--figma-color-border-disabled)',
61
+ 'disabled-strong': 'var(--figma-color-border-disabled-strong)',
62
+ onbrand: 'var(--figma-color-border-onbrand)',
63
+ 'onbrand-strong': 'var(--figma-color-border-onbrand-strong)',
64
+ oncomponent: 'var(--figma-color-border-oncomponent)',
65
+ 'oncomponent-strong': 'var(--figma-color-border-oncomponent-strong)',
66
+ ondanger: 'var(--figma-color-border-ondanger)',
67
+ 'ondanger-strong': 'var(--figma-color-border-ondanger-strong)',
68
+ onselected: 'var(--figma-color-border-onselected)',
69
+ 'onselected-strong': 'var(--figma-color-border-onselected-strong)',
70
+ onsuccess: 'var(--figma-color-border-onsuccess)',
71
+ 'onsuccess-strong': 'var(--figma-color-border-onsuccess-strong)',
72
+ onwarning: 'var(--figma-color-border-onwarning)',
73
+ 'onwarning-strong': 'var(--figma-color-border-onwarning-strong)',
74
+ selected: 'var(--figma-color-border-selected)',
75
+ 'selected-strong': 'var(--figma-color-border-selected-strong)',
76
+ strong: 'var(--figma-color-border-strong)',
77
+ success: 'var(--figma-color-border-success)',
78
+ 'success-strong': 'var(--figma-color-border-success-strong)',
79
+ warning: 'var(--figma-color-border-warning)',
80
+ 'warning-strong': 'var(--figma-color-border-warning-strong)',
81
+ },
82
+ icon: {
83
+ DEFAULT: 'var(--figma-color-icon)',
84
+ brand: 'var(--figma-color-icon-brand)',
85
+ 'brand-pressed': 'var(--figma-color-icon-brand-pressed)',
86
+ 'brand-secondary': 'var(--figma-color-icon-brand-secondary)',
87
+ 'brand-tertiary': 'var(--figma-color-icon-brand-tertiary)',
88
+ component: 'var(--figma-color-icon-component)',
89
+ 'component-pressed': 'var(--figma-color-icon-component-pressed)',
90
+ 'component-secondary': 'var(--figma-color-icon-component-secondary)',
91
+ 'component-tertiary': 'var(--figma-color-icon-component-tertiary)',
92
+ danger: 'var(--figma-color-icon-danger)',
93
+ 'danger-hover': 'var(--figma-color-icon-danger-hover)',
94
+ 'danger-pressed': 'var(--figma-color-icon-danger-pressed)',
95
+ 'danger-secondary': 'var(--figma-color-icon-danger-secondary)',
96
+ 'danger-secondary-hover': 'var(--figma-color-icon-danger-secondary-hover)',
97
+ 'danger-tertiary': 'var(--figma-color-icon-danger-tertiary)',
98
+ disabled: 'var(--figma-color-icon-disabled)',
99
+ hover: 'var(--figma-color-icon-hover)',
100
+ onbrand: 'var(--figma-color-icon-onbrand)',
101
+ 'onbrand-secondary': 'var(--figma-color-icon-onbrand-secondary)',
102
+ 'onbrand-tertiary': 'var(--figma-color-icon-onbrand-tertiary)',
103
+ oncomponent: 'var(--figma-color-icon-oncomponent)',
104
+ 'oncomponent-secondary': 'var(--figma-color-icon-oncomponent-secondary)',
105
+ 'oncomponent-tertiary': 'var(--figma-color-icon-oncomponent-tertiary)',
106
+ ondanger: 'var(--figma-color-icon-ondanger)',
107
+ 'ondanger-secondary': 'var(--figma-color-icon-ondanger-secondary)',
108
+ 'ondanger-tertiary': 'var(--figma-color-icon-ondanger-tertiary)',
109
+ ondisabled: 'var(--figma-color-icon-ondisabled)',
110
+ oninverse: 'var(--figma-color-icon-oninverse)',
111
+ onselected: 'var(--figma-color-icon-onselected)',
112
+ 'onselected-secondary': 'var(--figma-color-icon-onselected-secondary)',
113
+ 'onselected-strong': 'var(--figma-color-icon-onselected-strong)',
114
+ 'onselected-tertiary': 'var(--figma-color-icon-onselected-tertiary)',
115
+ onsuccess: 'var(--figma-color-icon-onsuccess)',
116
+ 'onsuccess-secondary': 'var(--figma-color-icon-onsuccess-secondary)',
117
+ 'onsuccess-tertiary': 'var(--figma-color-icon-onsuccess-tertiary)',
118
+ onwarning: 'var(--figma-color-icon-onwarning)',
119
+ 'onwarning-secondary': 'var(--figma-color-icon-onwarning-secondary)',
120
+ 'onwarning-tertiary': 'var(--figma-color-icon-onwarning-tertiary)',
121
+ pressed: 'var(--figma-color-icon-pressed)',
122
+ secondary: 'var(--figma-color-icon-secondary)',
123
+ 'secondary-hover': 'var(--figma-color-icon-secondary-hover)',
124
+ selected: 'var(--figma-color-icon-selected)',
125
+ 'selected-secondary': 'var(--figma-color-icon-selected-secondary)',
126
+ 'selected-tertiary': 'var(--figma-color-icon-selected-tertiary)',
127
+ success: 'var(--figma-color-icon-success)',
128
+ 'success-pressed': 'var(--figma-color-icon-success-pressed)',
129
+ 'success-secondary': 'var(--figma-color-icon-success-secondary)',
130
+ 'success-tertiary': 'var(--figma-color-icon-success-tertiary)',
131
+ tertiary: 'var(--figma-color-icon-tertiary)',
132
+ 'tertiary-hover': 'var(--figma-color-icon-tertiary-hover)',
133
+ warning: 'var(--figma-color-icon-warning)',
134
+ 'warning-pressed': 'var(--figma-color-icon-warning-pressed)',
135
+ 'warning-secondary': 'var(--figma-color-icon-warning-secondary)',
136
+ 'warning-tertiary': 'var(--figma-color-icon-warning-tertiary)',
137
+ },
138
+ text: {
139
+ DEFAULT: 'var(--figma-color-text)',
140
+ brand: 'var(--figma-color-text-brand)',
141
+ 'brand-secondary': 'var(--figma-color-text-brand-secondary)',
142
+ 'brand-tertiary': 'var(--figma-color-text-brand-tertiary)',
143
+ component: 'var(--figma-color-text-component)',
144
+ 'component-pressed': 'var(--figma-color-text-component-pressed)',
145
+ 'component-secondary': 'var(--figma-color-text-component-secondary)',
146
+ 'component-tertiary': 'var(--figma-color-text-component-tertiary)',
147
+ danger: 'var(--figma-color-text-danger)',
148
+ 'danger-secondary': 'var(--figma-color-text-danger-secondary)',
149
+ 'danger-tertiary': 'var(--figma-color-text-danger-tertiary)',
150
+ disabled: 'var(--figma-color-text-disabled)',
151
+ hover: 'var(--figma-color-text-hover)',
152
+ onbrand: 'var(--figma-color-text-onbrand)',
153
+ 'onbrand-secondary': 'var(--figma-color-text-onbrand-secondary)',
154
+ 'onbrand-tertiary': 'var(--figma-color-text-onbrand-tertiary)',
155
+ oncomponent: 'var(--figma-color-text-oncomponent)',
156
+ 'oncomponent-secondary': 'var(--figma-color-text-oncomponent-secondary)',
157
+ 'oncomponent-tertiary': 'var(--figma-color-text-oncomponent-tertiary)',
158
+ ondanger: 'var(--figma-color-text-ondanger)',
159
+ 'ondanger-secondary': 'var(--figma-color-text-ondanger-secondary)',
160
+ 'ondanger-tertiary': 'var(--figma-color-text-ondanger-tertiary)',
161
+ ondisabled: 'var(--figma-color-text-ondisabled)',
162
+ oninverse: 'var(--figma-color-text-oninverse)',
163
+ onselected: 'var(--figma-color-text-onselected)',
164
+ 'onselected-secondary': 'var(--figma-color-text-onselected-secondary)',
165
+ 'onselected-strong': 'var(--figma-color-text-onselected-strong)',
166
+ 'onselected-tertiary': 'var(--figma-color-text-onselected-tertiary)',
167
+ onsuccess: 'var(--figma-color-text-onsuccess)',
168
+ 'onsuccess-secondary': 'var(--figma-color-text-onsuccess-secondary)',
169
+ 'onsuccess-tertiary': 'var(--figma-color-text-onsuccess-tertiary)',
170
+ onwarning: 'var(--figma-color-text-onwarning)',
171
+ 'onwarning-secondary': 'var(--figma-color-text-onwarning-secondary)',
172
+ 'onwarning-tertiary': 'var(--figma-color-text-onwarning-tertiary)',
173
+ secondary: 'var(--figma-color-text-secondary)',
174
+ 'secondary-hover': 'var(--figma-color-text-secondary-hover)',
175
+ selected: 'var(--figma-color-text-selected)',
176
+ 'selected-secondary': 'var(--figma-color-text-selected-secondary)',
177
+ 'selected-tertiary': 'var(--figma-color-text-selected-tertiary)',
178
+ success: 'var(--figma-color-text-success)',
179
+ 'success-secondary': 'var(--figma-color-text-success-secondary)',
180
+ 'success-tertiary': 'var(--figma-color-text-success-tertiary)',
181
+ tertiary: 'var(--figma-color-text-tertiary)',
182
+ 'tertiary-hover': 'var(--figma-color-text-tertiary-hover)',
183
+ warning: 'var(--figma-color-text-warning)',
184
+ 'warning-secondary': 'var(--figma-color-text-warning-secondary)',
185
+ 'warning-tertiary': 'var(--figma-color-text-warning-tertiary)',
186
+ },
187
+ },
188
+ fontFamily: {
189
+ default: 'var(--font-family-default)',
190
+ monospace: 'var(--font-family-monospace)',
191
+ },
192
+ fontWeight: {
193
+ default: 'var(--font-weight-default)',
194
+ strong: 'var(--font-weight-strong)',
195
+ },
196
+ fontSize: {
197
+ 'size-1': 'var(--font-size-1)',
198
+ 'size-2': 'var(--font-size-2)',
199
+ 'size-3': 'var(--font-size-3)',
200
+ 'size-4': 'var(--font-size-4)',
201
+ 'size-5': 'var(--font-size-5)',
202
+ 'size-6': 'var(--font-size-6)',
203
+ 'size-7': 'var(--font-size-7)',
204
+ 'size-8': 'var(--font-size-8)',
205
+ 'size-9': 'var(--font-size-9)',
206
+ 'size-10': 'var(--font-size-10)',
207
+ 'size-default': 'var(--font-size-default)',
208
+ small: 'var(--font-size-1)',
209
+ medium: 'var(--font-size-3)',
210
+ large: 'var(--font-size-5)',
211
+ },
212
+ letterSpacing: {
213
+ 1: 'var(--letter-spacing-1)',
214
+ 2: 'var(--letter-spacing-2)',
215
+ 3: 'var(--letter-spacing-3)',
216
+ 4: 'var(--letter-spacing-4)',
217
+ 5: 'var(--letter-spacing-5)',
218
+ 6: 'var(--letter-spacing-6)',
219
+ 7: 'var(--letter-spacing-7)',
220
+ 8: 'var(--letter-spacing-8)',
221
+ 9: 'var(--letter-spacing-9)',
222
+ 10: 'var(--letter-spacing-10)',
223
+ default: 'var(--letter-spacing-default)',
224
+ small: 'var(--letter-spacing-1)',
225
+ medium: 'var(--letter-spacing-3)',
226
+ large: 'var(--letter-spacing-5)',
227
+ },
228
+ lineHeight: {
229
+ 1: 'var(--line-height-1)',
230
+ 2: 'var(--line-height-2)',
231
+ 3: 'var(--line-height-3)',
232
+ 4: 'var(--line-height-4)',
233
+ 5: 'var(--line-height-5)',
234
+ 6: 'var(--line-height-6)',
235
+ 7: 'var(--line-height-7)',
236
+ 8: 'var(--line-height-8)',
237
+ 9: 'var(--line-height-9)',
238
+ 10: 'var(--line-height-10)',
239
+ default: 'var(--line-height-default)',
240
+ small: 'var(--line-height-1)',
241
+ medium: 'var(--line-height-3)',
242
+ large: 'var(--line-height-5)',
243
+ },
244
+ borderRadius: {
245
+ none: 'none',
246
+ 'extra-small': 'var(--radius-extra-small)',
247
+ small: 'var(--radius-small)',
248
+ medium: 'var(--radius-medium)',
249
+ large: 'var(--radius-large)',
250
+ full: 'var(--radius-full)',
251
+ default: 'var(--radius-default)',
252
+ },
253
+ boxShadow: {
254
+ none: 'none',
255
+ 100: 'var(--elevation-100)',
256
+ 200: 'var(--elevation-200)',
257
+ 300: 'var(--elevation-300)',
258
+ 400: 'var(--elevation-400)',
259
+ 500: 'var(--elevation-500)',
260
+ },
261
+ textColor: ({ theme }) => {
262
+ return {
263
+ current: 'currentColor',
264
+ inherit: 'inherit',
265
+ transparent: 'transparent',
266
+ ...theme('colors').text,
267
+ };
268
+ },
269
+ backgroundColor: ({ theme }) => {
270
+ return {
271
+ current: 'currentColor',
272
+ inherit: 'inherit',
273
+ transparent: 'transparent',
274
+ ...theme('colors').bg,
275
+ };
276
+ },
277
+ borderColor: ({ theme }) => {
278
+ return {
279
+ current: 'currentColor',
280
+ inherit: 'inherit',
281
+ transparent: 'transparent',
282
+ DEFAULT: theme('colors').border.DEFAULT,
283
+ ...theme('colors').border,
284
+ };
285
+ },
286
+ },
287
+ };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "figma-kit",
3
3
  "description": "A set of React components for building Figma plugins.",
4
4
  "homepage": "https://figma-kit.dev",
5
- "version": "1.0.0-beta.1",
5
+ "version": "1.0.0-beta.10",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",
@@ -13,7 +13,8 @@
13
13
  "figma",
14
14
  "figma react components",
15
15
  "figma design system",
16
- "hook"
16
+ "UI3",
17
+ "component-library"
17
18
  ],
18
19
  "type": "module",
19
20
  "files": [
@@ -28,6 +29,9 @@
28
29
  "import": "./dist/index.mjs",
29
30
  "types": "./dist/index.d.ts"
30
31
  },
32
+ "./tailwind.preset.js": {
33
+ "require": "./dist/tailwind.preset.js"
34
+ },
31
35
  "./*": "./*"
32
36
  },
33
37
  "main": "dist/index.cjs",
@@ -36,10 +40,11 @@
36
40
  "sideEffects": false,
37
41
  "scripts": {
38
42
  "dev": "vite build --mode development --watch",
39
- "build": "pnpm build:js && pnpm build:css && pnpm build:figma-dev-theme-css",
43
+ "build": "pnpm build:js && pnpm build:css && pnpm build:figma-dev-theme-css && pnpm build:tailwind-preset",
40
44
  "build:js": "vite build",
41
45
  "build:css": "postcss src/styles/index.css -o dist/styles.css",
42
46
  "build:figma-dev-theme-css": "postcss src/styles/figma-development-theme.css -o dist/figma-development-theme.css",
47
+ "build:tailwind-preset": "cp src/tailwind/preset.js dist/tailwind.preset.js",
43
48
  "test": "vitest"
44
49
  },
45
50
  "peerDependencies": {