@pandacss/preset-base 1.1.0 → 1.3.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/dist/index.js +107 -1
- package/dist/index.mjs +107 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1512,6 +1512,101 @@ var flexGrid = {
|
|
|
1512
1512
|
}
|
|
1513
1513
|
};
|
|
1514
1514
|
|
|
1515
|
+
// src/utilities/focus-ring.ts
|
|
1516
|
+
function createFocusRing(selector, className) {
|
|
1517
|
+
return {
|
|
1518
|
+
className,
|
|
1519
|
+
group: "Focus Ring",
|
|
1520
|
+
values: ["outside", "inside", "mixed", "none"],
|
|
1521
|
+
transform(value) {
|
|
1522
|
+
const fallback = "var(--global-color-focus-ring, #005FCC)";
|
|
1523
|
+
const focusRingColor = `var(--focus-ring-color-prop, ${fallback})`;
|
|
1524
|
+
switch (value) {
|
|
1525
|
+
case "inside":
|
|
1526
|
+
return {
|
|
1527
|
+
"--focus-ring-color": focusRingColor,
|
|
1528
|
+
[selector]: {
|
|
1529
|
+
outlineOffset: "0px",
|
|
1530
|
+
outlineWidth: "var(--focus-ring-width, 1px)",
|
|
1531
|
+
outlineColor: "var(--focus-ring-color)",
|
|
1532
|
+
outlineStyle: "var(--focus-ring-style, solid)",
|
|
1533
|
+
borderColor: "var(--focus-ring-color)"
|
|
1534
|
+
}
|
|
1535
|
+
};
|
|
1536
|
+
case "outside":
|
|
1537
|
+
return {
|
|
1538
|
+
"--focus-ring-color": focusRingColor,
|
|
1539
|
+
[selector]: {
|
|
1540
|
+
outlineWidth: "var(--focus-ring-width, 2px)",
|
|
1541
|
+
outlineOffset: "var(--focus-ring-offset, 2px)",
|
|
1542
|
+
outlineStyle: "var(--focus-ring-style, solid)",
|
|
1543
|
+
outlineColor: "var(--focus-ring-color)"
|
|
1544
|
+
}
|
|
1545
|
+
};
|
|
1546
|
+
case "mixed":
|
|
1547
|
+
return {
|
|
1548
|
+
"--focus-ring-color": focusRingColor,
|
|
1549
|
+
[selector]: {
|
|
1550
|
+
outlineOffset: "0px",
|
|
1551
|
+
outlineWidth: "var(--focus-ring-width, 3px)",
|
|
1552
|
+
outlineStyle: "var(--focus-ring-style, solid)",
|
|
1553
|
+
outlineColor: "color-mix(in srgb, var(--focus-ring-color), transparent 60%)",
|
|
1554
|
+
borderColor: "var(--focus-ring-color)"
|
|
1555
|
+
}
|
|
1556
|
+
};
|
|
1557
|
+
case "none":
|
|
1558
|
+
return {
|
|
1559
|
+
"--focus-ring-color": focusRingColor,
|
|
1560
|
+
[selector]: {
|
|
1561
|
+
outline: "none"
|
|
1562
|
+
}
|
|
1563
|
+
};
|
|
1564
|
+
default:
|
|
1565
|
+
return {};
|
|
1566
|
+
}
|
|
1567
|
+
}
|
|
1568
|
+
};
|
|
1569
|
+
}
|
|
1570
|
+
var focusRing = {
|
|
1571
|
+
focusRing: createFocusRing("&:is(:focus, [data-focus])", "focus-ring"),
|
|
1572
|
+
focusVisibleRing: createFocusRing("&:is(:focus-visible, [data-focus-visible])", "focus-v-ring"),
|
|
1573
|
+
focusRingColor: {
|
|
1574
|
+
className: "focus-ring-c",
|
|
1575
|
+
values: "colors",
|
|
1576
|
+
group: "Focus Ring",
|
|
1577
|
+
transform(value, { utils }) {
|
|
1578
|
+
const prop = "--focus-ring-color-prop";
|
|
1579
|
+
const mix = utils.colorMix(value);
|
|
1580
|
+
if (mix.invalid) return { [prop]: value };
|
|
1581
|
+
const cssVar = "--mix-" + prop;
|
|
1582
|
+
return {
|
|
1583
|
+
[cssVar]: mix.value,
|
|
1584
|
+
[prop]: `var(${cssVar}, ${mix.color})`
|
|
1585
|
+
};
|
|
1586
|
+
}
|
|
1587
|
+
},
|
|
1588
|
+
focusRingOffset: {
|
|
1589
|
+
className: "focus-ring-o",
|
|
1590
|
+
values: "spacing",
|
|
1591
|
+
group: "Focus Ring",
|
|
1592
|
+
transform: (v) => ({ "--focus-ring-offset": v })
|
|
1593
|
+
},
|
|
1594
|
+
focusRingWidth: {
|
|
1595
|
+
className: "focus-ring-w",
|
|
1596
|
+
values: "borderWidths",
|
|
1597
|
+
property: "outlineWidth",
|
|
1598
|
+
group: "Focus Ring",
|
|
1599
|
+
transform: (v) => ({ "--focus-ring-width": v })
|
|
1600
|
+
},
|
|
1601
|
+
focusRingStyle: {
|
|
1602
|
+
className: "focus-ring-s",
|
|
1603
|
+
values: "borderStyles",
|
|
1604
|
+
property: "outlineStyle",
|
|
1605
|
+
group: "Focus Ring",
|
|
1606
|
+
transform: (v) => ({ "--focus-ring-style": v })
|
|
1607
|
+
}
|
|
1608
|
+
};
|
|
1609
|
+
|
|
1515
1610
|
// src/utilities/gradient.ts
|
|
1516
1611
|
var gradientVia = createColorMixTransform("--gradient-via");
|
|
1517
1612
|
var linearGradientDirectionMap = /* @__PURE__ */ new Map([
|
|
@@ -2874,12 +2969,21 @@ var transitionMap = {
|
|
|
2874
2969
|
common: createTransition(
|
|
2875
2970
|
"color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter"
|
|
2876
2971
|
),
|
|
2877
|
-
|
|
2972
|
+
size: createTransition("width, height, min-width, max-width, min-height, max-height"),
|
|
2973
|
+
position: createTransition("left, right, top, bottom, inset, inset-inline, inset-block"),
|
|
2974
|
+
background: createTransition("background, background-color, background-image, background-position"),
|
|
2878
2975
|
colors: createTransition("color, background-color, border-color, outline-color, text-decoration-color, fill, stroke"),
|
|
2879
2976
|
opacity: createTransition("opacity"),
|
|
2880
2977
|
shadow: createTransition("box-shadow"),
|
|
2881
2978
|
transform: createTransition("transform")
|
|
2882
2979
|
};
|
|
2980
|
+
var transitionPropertyMap = {
|
|
2981
|
+
common: "color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter",
|
|
2982
|
+
colors: "color, background-color, border-color, outline-color, text-decoration-color, fill, stroke",
|
|
2983
|
+
size: "width, height, min-width, max-width, min-height, max-height",
|
|
2984
|
+
position: "left, right, top, bottom, inset, inset-inline, inset-block",
|
|
2985
|
+
background: "background, background-color, background-image, background-position"
|
|
2986
|
+
};
|
|
2883
2987
|
var transitions = {
|
|
2884
2988
|
transitionTimingFunction: {
|
|
2885
2989
|
className: "trs-tmf",
|
|
@@ -2911,6 +3015,7 @@ var transitions = {
|
|
|
2911
3015
|
transitionProperty: {
|
|
2912
3016
|
className: "trs-prop",
|
|
2913
3017
|
group: "Transition",
|
|
3018
|
+
values: transitionPropertyMap,
|
|
2914
3019
|
transform(value) {
|
|
2915
3020
|
return {
|
|
2916
3021
|
"--transition-prop": value,
|
|
@@ -3189,6 +3294,7 @@ var utilities = Object.assign(
|
|
|
3189
3294
|
flexGrid,
|
|
3190
3295
|
spacing,
|
|
3191
3296
|
outline,
|
|
3297
|
+
focusRing,
|
|
3192
3298
|
divide,
|
|
3193
3299
|
sizing,
|
|
3194
3300
|
typography,
|
package/dist/index.mjs
CHANGED
|
@@ -1485,6 +1485,101 @@ var flexGrid = {
|
|
|
1485
1485
|
}
|
|
1486
1486
|
};
|
|
1487
1487
|
|
|
1488
|
+
// src/utilities/focus-ring.ts
|
|
1489
|
+
function createFocusRing(selector, className) {
|
|
1490
|
+
return {
|
|
1491
|
+
className,
|
|
1492
|
+
group: "Focus Ring",
|
|
1493
|
+
values: ["outside", "inside", "mixed", "none"],
|
|
1494
|
+
transform(value) {
|
|
1495
|
+
const fallback = "var(--global-color-focus-ring, #005FCC)";
|
|
1496
|
+
const focusRingColor = `var(--focus-ring-color-prop, ${fallback})`;
|
|
1497
|
+
switch (value) {
|
|
1498
|
+
case "inside":
|
|
1499
|
+
return {
|
|
1500
|
+
"--focus-ring-color": focusRingColor,
|
|
1501
|
+
[selector]: {
|
|
1502
|
+
outlineOffset: "0px",
|
|
1503
|
+
outlineWidth: "var(--focus-ring-width, 1px)",
|
|
1504
|
+
outlineColor: "var(--focus-ring-color)",
|
|
1505
|
+
outlineStyle: "var(--focus-ring-style, solid)",
|
|
1506
|
+
borderColor: "var(--focus-ring-color)"
|
|
1507
|
+
}
|
|
1508
|
+
};
|
|
1509
|
+
case "outside":
|
|
1510
|
+
return {
|
|
1511
|
+
"--focus-ring-color": focusRingColor,
|
|
1512
|
+
[selector]: {
|
|
1513
|
+
outlineWidth: "var(--focus-ring-width, 2px)",
|
|
1514
|
+
outlineOffset: "var(--focus-ring-offset, 2px)",
|
|
1515
|
+
outlineStyle: "var(--focus-ring-style, solid)",
|
|
1516
|
+
outlineColor: "var(--focus-ring-color)"
|
|
1517
|
+
}
|
|
1518
|
+
};
|
|
1519
|
+
case "mixed":
|
|
1520
|
+
return {
|
|
1521
|
+
"--focus-ring-color": focusRingColor,
|
|
1522
|
+
[selector]: {
|
|
1523
|
+
outlineOffset: "0px",
|
|
1524
|
+
outlineWidth: "var(--focus-ring-width, 3px)",
|
|
1525
|
+
outlineStyle: "var(--focus-ring-style, solid)",
|
|
1526
|
+
outlineColor: "color-mix(in srgb, var(--focus-ring-color), transparent 60%)",
|
|
1527
|
+
borderColor: "var(--focus-ring-color)"
|
|
1528
|
+
}
|
|
1529
|
+
};
|
|
1530
|
+
case "none":
|
|
1531
|
+
return {
|
|
1532
|
+
"--focus-ring-color": focusRingColor,
|
|
1533
|
+
[selector]: {
|
|
1534
|
+
outline: "none"
|
|
1535
|
+
}
|
|
1536
|
+
};
|
|
1537
|
+
default:
|
|
1538
|
+
return {};
|
|
1539
|
+
}
|
|
1540
|
+
}
|
|
1541
|
+
};
|
|
1542
|
+
}
|
|
1543
|
+
var focusRing = {
|
|
1544
|
+
focusRing: createFocusRing("&:is(:focus, [data-focus])", "focus-ring"),
|
|
1545
|
+
focusVisibleRing: createFocusRing("&:is(:focus-visible, [data-focus-visible])", "focus-v-ring"),
|
|
1546
|
+
focusRingColor: {
|
|
1547
|
+
className: "focus-ring-c",
|
|
1548
|
+
values: "colors",
|
|
1549
|
+
group: "Focus Ring",
|
|
1550
|
+
transform(value, { utils }) {
|
|
1551
|
+
const prop = "--focus-ring-color-prop";
|
|
1552
|
+
const mix = utils.colorMix(value);
|
|
1553
|
+
if (mix.invalid) return { [prop]: value };
|
|
1554
|
+
const cssVar = "--mix-" + prop;
|
|
1555
|
+
return {
|
|
1556
|
+
[cssVar]: mix.value,
|
|
1557
|
+
[prop]: `var(${cssVar}, ${mix.color})`
|
|
1558
|
+
};
|
|
1559
|
+
}
|
|
1560
|
+
},
|
|
1561
|
+
focusRingOffset: {
|
|
1562
|
+
className: "focus-ring-o",
|
|
1563
|
+
values: "spacing",
|
|
1564
|
+
group: "Focus Ring",
|
|
1565
|
+
transform: (v) => ({ "--focus-ring-offset": v })
|
|
1566
|
+
},
|
|
1567
|
+
focusRingWidth: {
|
|
1568
|
+
className: "focus-ring-w",
|
|
1569
|
+
values: "borderWidths",
|
|
1570
|
+
property: "outlineWidth",
|
|
1571
|
+
group: "Focus Ring",
|
|
1572
|
+
transform: (v) => ({ "--focus-ring-width": v })
|
|
1573
|
+
},
|
|
1574
|
+
focusRingStyle: {
|
|
1575
|
+
className: "focus-ring-s",
|
|
1576
|
+
values: "borderStyles",
|
|
1577
|
+
property: "outlineStyle",
|
|
1578
|
+
group: "Focus Ring",
|
|
1579
|
+
transform: (v) => ({ "--focus-ring-style": v })
|
|
1580
|
+
}
|
|
1581
|
+
};
|
|
1582
|
+
|
|
1488
1583
|
// src/utilities/gradient.ts
|
|
1489
1584
|
var gradientVia = createColorMixTransform("--gradient-via");
|
|
1490
1585
|
var linearGradientDirectionMap = /* @__PURE__ */ new Map([
|
|
@@ -2847,12 +2942,21 @@ var transitionMap = {
|
|
|
2847
2942
|
common: createTransition(
|
|
2848
2943
|
"color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter"
|
|
2849
2944
|
),
|
|
2850
|
-
|
|
2945
|
+
size: createTransition("width, height, min-width, max-width, min-height, max-height"),
|
|
2946
|
+
position: createTransition("left, right, top, bottom, inset, inset-inline, inset-block"),
|
|
2947
|
+
background: createTransition("background, background-color, background-image, background-position"),
|
|
2851
2948
|
colors: createTransition("color, background-color, border-color, outline-color, text-decoration-color, fill, stroke"),
|
|
2852
2949
|
opacity: createTransition("opacity"),
|
|
2853
2950
|
shadow: createTransition("box-shadow"),
|
|
2854
2951
|
transform: createTransition("transform")
|
|
2855
2952
|
};
|
|
2953
|
+
var transitionPropertyMap = {
|
|
2954
|
+
common: "color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter",
|
|
2955
|
+
colors: "color, background-color, border-color, outline-color, text-decoration-color, fill, stroke",
|
|
2956
|
+
size: "width, height, min-width, max-width, min-height, max-height",
|
|
2957
|
+
position: "left, right, top, bottom, inset, inset-inline, inset-block",
|
|
2958
|
+
background: "background, background-color, background-image, background-position"
|
|
2959
|
+
};
|
|
2856
2960
|
var transitions = {
|
|
2857
2961
|
transitionTimingFunction: {
|
|
2858
2962
|
className: "trs-tmf",
|
|
@@ -2884,6 +2988,7 @@ var transitions = {
|
|
|
2884
2988
|
transitionProperty: {
|
|
2885
2989
|
className: "trs-prop",
|
|
2886
2990
|
group: "Transition",
|
|
2991
|
+
values: transitionPropertyMap,
|
|
2887
2992
|
transform(value) {
|
|
2888
2993
|
return {
|
|
2889
2994
|
"--transition-prop": value,
|
|
@@ -3162,6 +3267,7 @@ var utilities = Object.assign(
|
|
|
3162
3267
|
flexGrid,
|
|
3163
3268
|
spacing,
|
|
3164
3269
|
outline,
|
|
3270
|
+
focusRing,
|
|
3165
3271
|
divide,
|
|
3166
3272
|
sizing,
|
|
3167
3273
|
typography,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pandacss/preset-base",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "The base preset for Panda CSS that contains the conditions and utilities",
|
|
5
5
|
"author": "Segun Adebayo <joseshegs@gmail.com>",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"dist"
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@pandacss/types": "1.
|
|
35
|
+
"@pandacss/types": "1.3.0"
|
|
36
36
|
},
|
|
37
37
|
"scripts": {
|
|
38
38
|
"build": "tsup src/index.ts --format=esm,cjs --dts",
|