@photoroom/ui 0.1.85 → 0.1.86
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/content/DesignPreview/DesignPreview.d.ts.map +1 -1
- package/components/editor/ObjectItem/ObjectItem.d.ts.map +1 -1
- package/components/feed/FeedTile/FeedTile.d.ts.map +1 -1
- package/components/input/PromptInput/PromptInput.d.ts.map +1 -1
- package/components/website/AwardsBlock/AwardsItem.d.ts.map +1 -1
- package/components/website/InspirationWallBlock/InspirationWallBlock.d.ts.map +1 -1
- package/components/website/PromoBannerBlock/PromoBannerBlock.d.ts.map +1 -1
- package/index.css +2 -1
- package/index.mjs +842 -841
- package/package.json +1 -1
- package/plugins/backgrounds.js +16 -2
- package/plugins/colors.js +10 -16
- package/plugins/forms.js +2 -2
- package/plugins/misc.js +19 -6
- package/plugins/variants.js +9 -0
- package/tailwind.config.js +17 -48
package/package.json
CHANGED
package/plugins/backgrounds.js
CHANGED
|
@@ -1,8 +1,22 @@
|
|
|
1
1
|
/* oxlint-disable typescript/no-require-imports */
|
|
2
|
-
const { default: flattenColorPalette } = require("tailwindcss/lib/util/flattenColorPalette");
|
|
3
|
-
const { default: toColorValue } = require("tailwindcss/lib/util/toColorValue");
|
|
4
2
|
const plugin = require("tailwindcss/plugin");
|
|
5
3
|
|
|
4
|
+
// Inlined from tailwindcss v3 internals (removed in v4).
|
|
5
|
+
const flattenColorPalette = (colors) =>
|
|
6
|
+
Object.assign(
|
|
7
|
+
{},
|
|
8
|
+
...Object.entries(colors ?? {}).flatMap(([color, values]) =>
|
|
9
|
+
typeof values === "object"
|
|
10
|
+
? Object.entries(flattenColorPalette(values)).map(([number, hex]) => ({
|
|
11
|
+
[color + (number === "DEFAULT" ? "" : `-${number}`)]: hex,
|
|
12
|
+
}))
|
|
13
|
+
: [{ [color]: values }]
|
|
14
|
+
)
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
const toColorValue = (maybeFn, opts = {}) =>
|
|
18
|
+
typeof maybeFn === "function" ? maybeFn(opts) : maybeFn;
|
|
19
|
+
|
|
6
20
|
module.exports = plugin(({ theme, addUtilities, matchUtilities }) => {
|
|
7
21
|
matchUtilities(
|
|
8
22
|
{
|
package/plugins/colors.js
CHANGED
|
@@ -396,31 +396,27 @@ module.exports = plugin(({ addBase, addUtilities }) => {
|
|
|
396
396
|
});
|
|
397
397
|
|
|
398
398
|
// Background (gradient)
|
|
399
|
+
const proGradient = (from, to) =>
|
|
400
|
+
`linear-gradient(to right, var(--color-${from}), var(--color-${to}))`;
|
|
399
401
|
addUtilities({
|
|
400
402
|
".bg-background-pro": {
|
|
401
|
-
"
|
|
402
|
-
"@apply to-magic-accent-500": {},
|
|
403
|
+
"background-image": proGradient("accent-500", "magic-accent-500"),
|
|
403
404
|
},
|
|
404
405
|
".bg-background-pro-hover": {
|
|
405
|
-
"
|
|
406
|
-
"@apply to-magic-accent-400": {},
|
|
406
|
+
"background-image": proGradient("accent-400", "magic-accent-400"),
|
|
407
407
|
},
|
|
408
408
|
".bg-background-pro-down": {
|
|
409
|
-
"
|
|
410
|
-
"@apply to-magic-accent-600": {},
|
|
409
|
+
"background-image": proGradient("accent-600", "magic-accent-600"),
|
|
411
410
|
},
|
|
412
411
|
".theme-dark": {
|
|
413
412
|
".bg-background-pro": {
|
|
414
|
-
"
|
|
415
|
-
"@apply to-magic-accent-500": {},
|
|
413
|
+
"background-image": proGradient("accent-500", "magic-accent-500"),
|
|
416
414
|
},
|
|
417
415
|
".bg-background-pro-hover": {
|
|
418
|
-
"
|
|
419
|
-
"@apply to-magic-accent-600": {},
|
|
416
|
+
"background-image": proGradient("accent-600", "magic-accent-600"),
|
|
420
417
|
},
|
|
421
418
|
".bg-background-pro-down": {
|
|
422
|
-
"
|
|
423
|
-
"@apply to-magic-accent-400": {},
|
|
419
|
+
"background-image": proGradient("accent-400", "magic-accent-400"),
|
|
424
420
|
},
|
|
425
421
|
},
|
|
426
422
|
});
|
|
@@ -428,13 +424,11 @@ module.exports = plugin(({ addBase, addUtilities }) => {
|
|
|
428
424
|
// Content (gradient)
|
|
429
425
|
addUtilities({
|
|
430
426
|
".bg-content-pro": {
|
|
431
|
-
"
|
|
432
|
-
"@apply to-magic-accent-500": {},
|
|
427
|
+
"background-image": proGradient("accent-500", "magic-accent-500"),
|
|
433
428
|
},
|
|
434
429
|
".theme-dark": {
|
|
435
430
|
".bg-content-pro": {
|
|
436
|
-
"
|
|
437
|
-
"@apply to-magic-accent-500": {},
|
|
431
|
+
"background-image": proGradient("accent-500", "magic-accent-500"),
|
|
438
432
|
},
|
|
439
433
|
},
|
|
440
434
|
});
|
package/plugins/forms.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// oxlint-disable-next-line typescript/no-require-imports
|
|
2
2
|
const plugin = require("tailwindcss/plugin");
|
|
3
3
|
|
|
4
|
-
module.exports = plugin(({
|
|
5
|
-
|
|
4
|
+
module.exports = plugin(({ addBase }) => {
|
|
5
|
+
addBase({
|
|
6
6
|
// this removes the up / down arrows in the number inputs
|
|
7
7
|
'input[type="number"]': {
|
|
8
8
|
"-moz-appearance": "textfield",
|
package/plugins/misc.js
CHANGED
|
@@ -72,20 +72,30 @@ module.exports = plugin(({ addComponents, addUtilities }) => {
|
|
|
72
72
|
},
|
|
73
73
|
});
|
|
74
74
|
|
|
75
|
-
// Color picker utilities (overrides for react-colorful)
|
|
75
|
+
// Color picker utilities (overrides for react-colorful).
|
|
76
|
+
// !important is needed because react-colorful injects unlayered <style>,
|
|
77
|
+
// which beats anything inside @layer utilities regardless of specificity.
|
|
76
78
|
addUtilities({
|
|
77
79
|
".misc-color-picker": {
|
|
78
80
|
".react-colorful": {
|
|
79
|
-
"
|
|
81
|
+
display: "flex !important",
|
|
82
|
+
width: "100% !important",
|
|
83
|
+
flexDirection: "column !important",
|
|
84
|
+
gap: "0.75rem !important",
|
|
80
85
|
},
|
|
81
86
|
".react-colorful__saturation": {
|
|
82
|
-
"
|
|
87
|
+
height: "10rem !important",
|
|
88
|
+
width: "100% !important",
|
|
89
|
+
borderRadius: "8px !important",
|
|
90
|
+
border: "0 !important",
|
|
83
91
|
},
|
|
84
92
|
".react-colorful__hue": {
|
|
85
|
-
"
|
|
93
|
+
height: "1rem !important",
|
|
94
|
+
borderRadius: "9999px !important",
|
|
86
95
|
},
|
|
87
96
|
".react-colorful__pointer": {
|
|
88
|
-
"
|
|
97
|
+
height: "1rem !important",
|
|
98
|
+
width: "1rem !important",
|
|
89
99
|
},
|
|
90
100
|
},
|
|
91
101
|
});
|
|
@@ -93,7 +103,10 @@ module.exports = plugin(({ addComponents, addUtilities }) => {
|
|
|
93
103
|
// Magic gradient on HeroBlock
|
|
94
104
|
addUtilities({
|
|
95
105
|
".text-hero-magic": {
|
|
96
|
-
|
|
106
|
+
"background-image": "linear-gradient(to bottom right, #410CD9, #F68EFE)",
|
|
107
|
+
"background-clip": "text",
|
|
108
|
+
"-webkit-background-clip": "text",
|
|
109
|
+
color: "transparent",
|
|
97
110
|
},
|
|
98
111
|
});
|
|
99
112
|
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// oxlint-disable-next-line typescript/no-require-imports
|
|
2
|
+
const plugin = require("tailwindcss/plugin");
|
|
3
|
+
|
|
4
|
+
// Custom variants that aren't expressible as plain breakpoint values in v4.
|
|
5
|
+
// `tall` is a min-height media query; `mobile` is a max-width media query.
|
|
6
|
+
module.exports = plugin(({ addVariant }) => {
|
|
7
|
+
addVariant("tall", "@media (min-height: 780px)");
|
|
8
|
+
addVariant("mobile", "@media (max-width: 600px)");
|
|
9
|
+
});
|
package/tailwind.config.js
CHANGED
|
@@ -1,37 +1,6 @@
|
|
|
1
1
|
// oxlint-disable typescript/no-require-imports
|
|
2
2
|
const defaultTheme = require("tailwindcss/defaultTheme");
|
|
3
3
|
|
|
4
|
-
/**
|
|
5
|
-
* Returns a hex color from a tailwind color name
|
|
6
|
-
* @param {string} color - The desired color – could be a variable (e.g. --my-custom-color) or an hex value (e.g #BADA55)
|
|
7
|
-
* @returns {string} - The formatted string for tailwind
|
|
8
|
-
*/
|
|
9
|
-
function withOpacityValue(color) {
|
|
10
|
-
const isVariable = color.startsWith("--");
|
|
11
|
-
|
|
12
|
-
const rgb = hexToRgb(color);
|
|
13
|
-
|
|
14
|
-
const value = isVariable ? `var(${color})` : `${rgb.r} ${rgb.g} ${rgb.b}`;
|
|
15
|
-
|
|
16
|
-
return ({ opacityValue }) => {
|
|
17
|
-
if (opacityValue === undefined) {
|
|
18
|
-
return `rgb(${value})`;
|
|
19
|
-
}
|
|
20
|
-
return `rgb(${value} / ${opacityValue})`;
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
function hexToRgb(hex) {
|
|
25
|
-
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
|
26
|
-
return result
|
|
27
|
-
? {
|
|
28
|
-
r: parseInt(result[1], 16),
|
|
29
|
-
g: parseInt(result[2], 16),
|
|
30
|
-
b: parseInt(result[3], 16),
|
|
31
|
-
}
|
|
32
|
-
: null;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
4
|
module.exports = {
|
|
36
5
|
darkMode: ["class", ".theme-dark"], // https://tailwindcss.com/docs/dark-mode#basic-usage
|
|
37
6
|
content: [
|
|
@@ -65,9 +34,8 @@ module.exports = {
|
|
|
65
34
|
},
|
|
66
35
|
extend: {
|
|
67
36
|
screens: {
|
|
68
|
-
|
|
69
|
-
"
|
|
70
|
-
"3xl": { raw: "(min-width: 1800px)" },
|
|
37
|
+
"2xl": "1512px",
|
|
38
|
+
"3xl": "1800px",
|
|
71
39
|
},
|
|
72
40
|
// Aspect Ratio: https://tailwindcss.com/docs/aspect-ratio#customizing-your-theme
|
|
73
41
|
aspectRatio: {
|
|
@@ -294,23 +262,23 @@ module.exports = {
|
|
|
294
262
|
/**
|
|
295
263
|
* Do not use the tokens below (deprecated) !!
|
|
296
264
|
*/
|
|
297
|
-
yellow:
|
|
298
|
-
green:
|
|
299
|
-
blue:
|
|
300
|
-
pink:
|
|
265
|
+
yellow: "#FFC710",
|
|
266
|
+
green: "#23D114",
|
|
267
|
+
blue: "#339CFF",
|
|
268
|
+
pink: "#FF47E0",
|
|
301
269
|
pastel: {
|
|
302
|
-
pink:
|
|
303
|
-
coral:
|
|
304
|
-
yellow:
|
|
305
|
-
"cyan-1":
|
|
306
|
-
"cyan-2":
|
|
270
|
+
pink: "#F68EFE",
|
|
271
|
+
coral: "#FFAAAA",
|
|
272
|
+
yellow: "#FFEC8D",
|
|
273
|
+
"cyan-1": "#22CBE8",
|
|
274
|
+
"cyan-2": "#B5F6FB",
|
|
307
275
|
},
|
|
308
276
|
facebook: {
|
|
309
|
-
DEFAULT:
|
|
310
|
-
dark:
|
|
311
|
-
light:
|
|
312
|
-
800:
|
|
313
|
-
900:
|
|
277
|
+
DEFAULT: "#1877F2",
|
|
278
|
+
dark: "#0B63D4",
|
|
279
|
+
light: "#2C83F2",
|
|
280
|
+
800: "#5071FC",
|
|
281
|
+
900: "#4866e3",
|
|
314
282
|
},
|
|
315
283
|
},
|
|
316
284
|
boxShadow: {
|
|
@@ -505,6 +473,7 @@ module.exports = {
|
|
|
505
473
|
require("tailwindcss-radix"),
|
|
506
474
|
// Custom plugins
|
|
507
475
|
require("./src/plugins/forms"),
|
|
476
|
+
require("./src/plugins/variants"),
|
|
508
477
|
require("./src/plugins/typography"),
|
|
509
478
|
require("./src/plugins/backgrounds"),
|
|
510
479
|
require("./src/plugins/colors"),
|