@stokelp/styled-system 1.18.0 → 1.19.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/package.json +1 -1
- package/panda.buildinfo.json +6 -0
- package/patterns/aspect-ratio.mjs +2 -2
- package/patterns/bleed.mjs +2 -2
- package/patterns/box.mjs +2 -2
- package/patterns/center.mjs +2 -2
- package/patterns/circle.mjs +2 -2
- package/patterns/container.mjs +2 -2
- package/patterns/cq.mjs +2 -2
- package/patterns/divider.mjs +2 -2
- package/patterns/flex.mjs +2 -2
- package/patterns/float.mjs +4 -4
- package/patterns/grid-item.mjs +2 -2
- package/patterns/grid.mjs +4 -4
- package/patterns/hstack.mjs +2 -2
- package/patterns/link-overlay.mjs +3 -3
- package/patterns/spacer.mjs +2 -2
- package/patterns/square.mjs +2 -2
- package/patterns/stack.mjs +2 -2
- package/patterns/visually-hidden.mjs +2 -2
- package/patterns/vstack.mjs +2 -2
- package/patterns/wrap.mjs +2 -2
- package/recipes/index.d.ts +2 -1
- package/recipes/index.mjs +2 -1
- package/recipes/tooltip.d.ts +28 -0
- package/recipes/tooltip.mjs +48 -0
package/package.json
CHANGED
package/panda.buildinfo.json
CHANGED
|
@@ -53,6 +53,11 @@
|
|
|
53
53
|
"gridTemplateColumns]___[value:repeat(3, 1fr)",
|
|
54
54
|
"gap]___[value:10px",
|
|
55
55
|
"flexDirection]___[value:row",
|
|
56
|
+
"gap]___[value:120",
|
|
57
|
+
"overflow]___[value:auto",
|
|
58
|
+
"padding]___[value:space-64",
|
|
59
|
+
"height]___[value:500",
|
|
60
|
+
"background]___[value:grey.100",
|
|
56
61
|
"borderRadius]___[value:radius-4",
|
|
57
62
|
"display]___[value:inline-flex",
|
|
58
63
|
"gap]___[value:space-4",
|
|
@@ -132,6 +137,7 @@
|
|
|
132
137
|
"tabs": [
|
|
133
138
|
"variant]___[value:line]___[recipe:tabs"
|
|
134
139
|
],
|
|
140
|
+
"tooltip": [],
|
|
135
141
|
"datepicker": [],
|
|
136
142
|
"formHelperText": [],
|
|
137
143
|
"select": [
|
|
@@ -2,8 +2,8 @@ import { getPatternStyles, patternFns } from '../helpers.mjs';
|
|
|
2
2
|
import { css } from '../css/index.mjs';
|
|
3
3
|
|
|
4
4
|
const aspectRatioConfig = {
|
|
5
|
-
transform(
|
|
6
|
-
const { ratio = 4 / 3, ...rest } =
|
|
5
|
+
transform(props10, { map }) {
|
|
6
|
+
const { ratio = 4 / 3, ...rest } = props10;
|
|
7
7
|
return {
|
|
8
8
|
position: "relative",
|
|
9
9
|
_before: {
|
package/patterns/bleed.mjs
CHANGED
|
@@ -2,8 +2,8 @@ import { getPatternStyles, patternFns } from '../helpers.mjs';
|
|
|
2
2
|
import { css } from '../css/index.mjs';
|
|
3
3
|
|
|
4
4
|
const bleedConfig = {
|
|
5
|
-
transform(
|
|
6
|
-
const { inline, block, ...rest } =
|
|
5
|
+
transform(props10, { map, isCssUnit, isCssVar }) {
|
|
6
|
+
const { inline, block, ...rest } = props10;
|
|
7
7
|
const valueFn = (v) => isCssUnit(v) || isCssVar(v) ? v : `token(spacing.${v}, ${v})`;
|
|
8
8
|
return {
|
|
9
9
|
"--bleed-x": map(inline, valueFn),
|
package/patterns/box.mjs
CHANGED
package/patterns/center.mjs
CHANGED
|
@@ -2,8 +2,8 @@ import { getPatternStyles, patternFns } from '../helpers.mjs';
|
|
|
2
2
|
import { css } from '../css/index.mjs';
|
|
3
3
|
|
|
4
4
|
const centerConfig = {
|
|
5
|
-
transform(
|
|
6
|
-
const { inline, ...rest } =
|
|
5
|
+
transform(props10) {
|
|
6
|
+
const { inline, ...rest } = props10;
|
|
7
7
|
return {
|
|
8
8
|
display: inline ? "inline-flex" : "flex",
|
|
9
9
|
alignItems: "center",
|
package/patterns/circle.mjs
CHANGED
|
@@ -2,8 +2,8 @@ import { getPatternStyles, patternFns } from '../helpers.mjs';
|
|
|
2
2
|
import { css } from '../css/index.mjs';
|
|
3
3
|
|
|
4
4
|
const circleConfig = {
|
|
5
|
-
transform(
|
|
6
|
-
const { size, ...rest } =
|
|
5
|
+
transform(props10) {
|
|
6
|
+
const { size, ...rest } = props10;
|
|
7
7
|
return {
|
|
8
8
|
display: "flex",
|
|
9
9
|
alignItems: "center",
|
package/patterns/container.mjs
CHANGED
|
@@ -2,13 +2,13 @@ import { getPatternStyles, patternFns } from '../helpers.mjs';
|
|
|
2
2
|
import { css } from '../css/index.mjs';
|
|
3
3
|
|
|
4
4
|
const containerConfig = {
|
|
5
|
-
transform(
|
|
5
|
+
transform(props10) {
|
|
6
6
|
return {
|
|
7
7
|
position: "relative",
|
|
8
8
|
maxWidth: "8xl",
|
|
9
9
|
mx: "auto",
|
|
10
10
|
px: { base: "4", md: "6", lg: "8" },
|
|
11
|
-
...
|
|
11
|
+
...props10
|
|
12
12
|
};
|
|
13
13
|
}}
|
|
14
14
|
|
package/patterns/cq.mjs
CHANGED
|
@@ -2,8 +2,8 @@ import { getPatternStyles, patternFns } from '../helpers.mjs';
|
|
|
2
2
|
import { css } from '../css/index.mjs';
|
|
3
3
|
|
|
4
4
|
const cqConfig = {
|
|
5
|
-
transform(
|
|
6
|
-
const { name, type, ...rest } =
|
|
5
|
+
transform(props10) {
|
|
6
|
+
const { name, type, ...rest } = props10;
|
|
7
7
|
return {
|
|
8
8
|
containerType: type,
|
|
9
9
|
containerName: name,
|
package/patterns/divider.mjs
CHANGED
|
@@ -2,8 +2,8 @@ import { getPatternStyles, patternFns } from '../helpers.mjs';
|
|
|
2
2
|
import { css } from '../css/index.mjs';
|
|
3
3
|
|
|
4
4
|
const dividerConfig = {
|
|
5
|
-
transform(
|
|
6
|
-
const { orientation, thickness, color, ...rest } =
|
|
5
|
+
transform(props10, { map }) {
|
|
6
|
+
const { orientation, thickness, color, ...rest } = props10;
|
|
7
7
|
return {
|
|
8
8
|
"--thickness": thickness,
|
|
9
9
|
width: map(orientation, (v) => v === "vertical" ? void 0 : "100%"),
|
package/patterns/flex.mjs
CHANGED
|
@@ -2,8 +2,8 @@ import { getPatternStyles, patternFns } from '../helpers.mjs';
|
|
|
2
2
|
import { css } from '../css/index.mjs';
|
|
3
3
|
|
|
4
4
|
const flexConfig = {
|
|
5
|
-
transform(
|
|
6
|
-
const { direction, align, justify, wrap: wrap22, basis, grow, shrink, ...rest } =
|
|
5
|
+
transform(props10) {
|
|
6
|
+
const { direction, align, justify, wrap: wrap22, basis, grow, shrink, ...rest } = props10;
|
|
7
7
|
return {
|
|
8
8
|
display: "flex",
|
|
9
9
|
flexDirection: direction,
|
package/patterns/float.mjs
CHANGED
|
@@ -2,8 +2,8 @@ import { getPatternStyles, patternFns } from '../helpers.mjs';
|
|
|
2
2
|
import { css } from '../css/index.mjs';
|
|
3
3
|
|
|
4
4
|
const floatConfig = {
|
|
5
|
-
transform(
|
|
6
|
-
const { offset, offsetX, offsetY, placement, ...rest } =
|
|
5
|
+
transform(props10, { map }) {
|
|
6
|
+
const { offset, offsetX, offsetY, placement, ...rest } = props10;
|
|
7
7
|
return {
|
|
8
8
|
display: "inline-flex",
|
|
9
9
|
justifyContent: "center",
|
|
@@ -38,8 +38,8 @@ transform(props9, { map }) {
|
|
|
38
38
|
...rest
|
|
39
39
|
};
|
|
40
40
|
},
|
|
41
|
-
defaultValues(
|
|
42
|
-
const offset =
|
|
41
|
+
defaultValues(props10) {
|
|
42
|
+
const offset = props10.offset || "0";
|
|
43
43
|
return { offset, offsetX: offset, offsetY: offset, placement: "top-end" };
|
|
44
44
|
}}
|
|
45
45
|
|
package/patterns/grid-item.mjs
CHANGED
|
@@ -2,8 +2,8 @@ import { getPatternStyles, patternFns } from '../helpers.mjs';
|
|
|
2
2
|
import { css } from '../css/index.mjs';
|
|
3
3
|
|
|
4
4
|
const gridItemConfig = {
|
|
5
|
-
transform(
|
|
6
|
-
const { colSpan, rowSpan, colStart, rowStart, colEnd, rowEnd, ...rest } =
|
|
5
|
+
transform(props10, { map }) {
|
|
6
|
+
const { colSpan, rowSpan, colStart, rowStart, colEnd, rowEnd, ...rest } = props10;
|
|
7
7
|
const spanFn = (v) => v === "auto" ? v : `span ${v}`;
|
|
8
8
|
return {
|
|
9
9
|
gridColumn: colSpan != null ? map(colSpan, spanFn) : void 0,
|
package/patterns/grid.mjs
CHANGED
|
@@ -2,8 +2,8 @@ import { getPatternStyles, patternFns } from '../helpers.mjs';
|
|
|
2
2
|
import { css } from '../css/index.mjs';
|
|
3
3
|
|
|
4
4
|
const gridConfig = {
|
|
5
|
-
transform(
|
|
6
|
-
const { columnGap, rowGap, gap, columns, minChildWidth, ...rest } =
|
|
5
|
+
transform(props10, { map, isCssUnit }) {
|
|
6
|
+
const { columnGap, rowGap, gap, columns, minChildWidth, ...rest } = props10;
|
|
7
7
|
const getValue = (v) => isCssUnit(v) ? v : `token(sizes.${v}, ${v})`;
|
|
8
8
|
return {
|
|
9
9
|
display: "grid",
|
|
@@ -14,8 +14,8 @@ transform(props9, { map, isCssUnit }) {
|
|
|
14
14
|
...rest
|
|
15
15
|
};
|
|
16
16
|
},
|
|
17
|
-
defaultValues(
|
|
18
|
-
return { gap:
|
|
17
|
+
defaultValues(props10) {
|
|
18
|
+
return { gap: props10.columnGap || props10.rowGap ? void 0 : "10px" };
|
|
19
19
|
}}
|
|
20
20
|
|
|
21
21
|
export const getGridStyle = (styles = {}) => {
|
package/patterns/hstack.mjs
CHANGED
|
@@ -2,8 +2,8 @@ import { getPatternStyles, patternFns } from '../helpers.mjs';
|
|
|
2
2
|
import { css } from '../css/index.mjs';
|
|
3
3
|
|
|
4
4
|
const hstackConfig = {
|
|
5
|
-
transform(
|
|
6
|
-
const { justify, gap, ...rest } =
|
|
5
|
+
transform(props10) {
|
|
6
|
+
const { justify, gap, ...rest } = props10;
|
|
7
7
|
return {
|
|
8
8
|
display: "flex",
|
|
9
9
|
alignItems: "center",
|
|
@@ -2,16 +2,16 @@ import { getPatternStyles, patternFns } from '../helpers.mjs';
|
|
|
2
2
|
import { css } from '../css/index.mjs';
|
|
3
3
|
|
|
4
4
|
const linkOverlayConfig = {
|
|
5
|
-
transform(
|
|
5
|
+
transform(props10) {
|
|
6
6
|
return {
|
|
7
7
|
_before: {
|
|
8
8
|
content: '""',
|
|
9
9
|
position: "absolute",
|
|
10
10
|
inset: "0",
|
|
11
11
|
zIndex: "0",
|
|
12
|
-
...
|
|
12
|
+
...props10["_before"]
|
|
13
13
|
},
|
|
14
|
-
...
|
|
14
|
+
...props10
|
|
15
15
|
};
|
|
16
16
|
}}
|
|
17
17
|
|
package/patterns/spacer.mjs
CHANGED
|
@@ -2,8 +2,8 @@ import { getPatternStyles, patternFns } from '../helpers.mjs';
|
|
|
2
2
|
import { css } from '../css/index.mjs';
|
|
3
3
|
|
|
4
4
|
const spacerConfig = {
|
|
5
|
-
transform(
|
|
6
|
-
const { size, ...rest } =
|
|
5
|
+
transform(props10, { map }) {
|
|
6
|
+
const { size, ...rest } = props10;
|
|
7
7
|
return {
|
|
8
8
|
alignSelf: "stretch",
|
|
9
9
|
justifySelf: "stretch",
|
package/patterns/square.mjs
CHANGED
|
@@ -2,8 +2,8 @@ import { getPatternStyles, patternFns } from '../helpers.mjs';
|
|
|
2
2
|
import { css } from '../css/index.mjs';
|
|
3
3
|
|
|
4
4
|
const squareConfig = {
|
|
5
|
-
transform(
|
|
6
|
-
const { size, ...rest } =
|
|
5
|
+
transform(props10) {
|
|
6
|
+
const { size, ...rest } = props10;
|
|
7
7
|
return {
|
|
8
8
|
display: "flex",
|
|
9
9
|
alignItems: "center",
|
package/patterns/stack.mjs
CHANGED
|
@@ -2,8 +2,8 @@ import { getPatternStyles, patternFns } from '../helpers.mjs';
|
|
|
2
2
|
import { css } from '../css/index.mjs';
|
|
3
3
|
|
|
4
4
|
const stackConfig = {
|
|
5
|
-
transform(
|
|
6
|
-
const { align, justify, direction, gap, ...rest } =
|
|
5
|
+
transform(props10) {
|
|
6
|
+
const { align, justify, direction, gap, ...rest } = props10;
|
|
7
7
|
return {
|
|
8
8
|
display: "flex",
|
|
9
9
|
flexDirection: direction,
|
package/patterns/vstack.mjs
CHANGED
|
@@ -2,8 +2,8 @@ import { getPatternStyles, patternFns } from '../helpers.mjs';
|
|
|
2
2
|
import { css } from '../css/index.mjs';
|
|
3
3
|
|
|
4
4
|
const vstackConfig = {
|
|
5
|
-
transform(
|
|
6
|
-
const { justify, gap, ...rest } =
|
|
5
|
+
transform(props10) {
|
|
6
|
+
const { justify, gap, ...rest } = props10;
|
|
7
7
|
return {
|
|
8
8
|
display: "flex",
|
|
9
9
|
alignItems: "center",
|
package/patterns/wrap.mjs
CHANGED
|
@@ -2,8 +2,8 @@ import { getPatternStyles, patternFns } from '../helpers.mjs';
|
|
|
2
2
|
import { css } from '../css/index.mjs';
|
|
3
3
|
|
|
4
4
|
const wrapConfig = {
|
|
5
|
-
transform(
|
|
6
|
-
const { columnGap, rowGap, gap = columnGap || rowGap ? void 0 : "10px", align, justify, ...rest } =
|
|
5
|
+
transform(props10) {
|
|
6
|
+
const { columnGap, rowGap, gap = columnGap || rowGap ? void 0 : "10px", align, justify, ...rest } = props10;
|
|
7
7
|
return {
|
|
8
8
|
display: "flex",
|
|
9
9
|
flexWrap: "wrap",
|
package/recipes/index.d.ts
CHANGED
package/recipes/index.mjs
CHANGED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import type { ConditionalValue } from '../types/index';
|
|
3
|
+
import type { DistributiveOmit, Pretty } from '../types/system-types';
|
|
4
|
+
|
|
5
|
+
interface TooltipVariant {
|
|
6
|
+
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
type TooltipVariantMap = {
|
|
10
|
+
[key in keyof TooltipVariant]: Array<TooltipVariant[key]>
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export type TooltipVariantProps = {
|
|
14
|
+
[key in keyof TooltipVariant]?: ConditionalValue<TooltipVariant[key]> | undefined
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface TooltipRecipe {
|
|
18
|
+
__type: TooltipVariantProps
|
|
19
|
+
(props?: TooltipVariantProps): Pretty<Record<"trigger" | "arrow" | "arrowTip" | "positioner" | "content", string>>
|
|
20
|
+
raw: (props?: TooltipVariantProps) => TooltipVariantProps
|
|
21
|
+
variantMap: TooltipVariantMap
|
|
22
|
+
variantKeys: Array<keyof TooltipVariant>
|
|
23
|
+
splitVariantProps<Props extends TooltipVariantProps>(props: Props): [TooltipVariantProps, Pretty<DistributiveOmit<Props, keyof TooltipVariantProps>>]
|
|
24
|
+
getVariantProps: (props?: TooltipVariantProps) => TooltipVariantProps
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
export declare const tooltip: TooltipRecipe
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { compact, getSlotCompoundVariant, memo, splitProps } from '../helpers.mjs';
|
|
2
|
+
import { createRecipe } from './create-recipe.mjs';
|
|
3
|
+
|
|
4
|
+
const tooltipDefaultVariants = {}
|
|
5
|
+
const tooltipCompoundVariants = []
|
|
6
|
+
|
|
7
|
+
const tooltipSlotNames = [
|
|
8
|
+
[
|
|
9
|
+
"trigger",
|
|
10
|
+
"tooltip__trigger"
|
|
11
|
+
],
|
|
12
|
+
[
|
|
13
|
+
"arrow",
|
|
14
|
+
"tooltip__arrow"
|
|
15
|
+
],
|
|
16
|
+
[
|
|
17
|
+
"arrowTip",
|
|
18
|
+
"tooltip__arrowTip"
|
|
19
|
+
],
|
|
20
|
+
[
|
|
21
|
+
"positioner",
|
|
22
|
+
"tooltip__positioner"
|
|
23
|
+
],
|
|
24
|
+
[
|
|
25
|
+
"content",
|
|
26
|
+
"tooltip__content"
|
|
27
|
+
]
|
|
28
|
+
]
|
|
29
|
+
const tooltipSlotFns = /* @__PURE__ */ tooltipSlotNames.map(([slotName, slotKey]) => [slotName, createRecipe(slotKey, tooltipDefaultVariants, getSlotCompoundVariant(tooltipCompoundVariants, slotName))])
|
|
30
|
+
|
|
31
|
+
const tooltipFn = memo((props = {}) => {
|
|
32
|
+
return Object.fromEntries(tooltipSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]))
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
const tooltipVariantKeys = []
|
|
36
|
+
const getVariantProps = (variants) => ({ ...tooltipDefaultVariants, ...compact(variants) })
|
|
37
|
+
|
|
38
|
+
export const tooltip = /* @__PURE__ */ Object.assign(tooltipFn, {
|
|
39
|
+
__recipe__: false,
|
|
40
|
+
__name__: 'tooltip',
|
|
41
|
+
raw: (props) => props,
|
|
42
|
+
variantKeys: tooltipVariantKeys,
|
|
43
|
+
variantMap: {},
|
|
44
|
+
splitVariantProps(props) {
|
|
45
|
+
return splitProps(props, tooltipVariantKeys)
|
|
46
|
+
},
|
|
47
|
+
getVariantProps
|
|
48
|
+
})
|