@stokelp/styled-system 1.24.0 → 1.26.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 +8 -1
- 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/popover.d.ts +28 -0
- package/recipes/popover.mjs +68 -0
- package/recipes/table.d.ts +1 -1
- package/recipes/table.mjs +8 -0
package/package.json
CHANGED
package/panda.buildinfo.json
CHANGED
|
@@ -54,7 +54,13 @@
|
|
|
54
54
|
"display]___[value:grid",
|
|
55
55
|
"gridTemplateColumns]___[value:repeat(3, 1fr)",
|
|
56
56
|
"gap]___[value:10px",
|
|
57
|
+
"width]___[value:400",
|
|
58
|
+
"gap]___[value:space-32",
|
|
59
|
+
"gap]___[value:space-8",
|
|
60
|
+
"maxHeight]___[value:102",
|
|
61
|
+
"overflowY]___[value:auto",
|
|
57
62
|
"flexDirection]___[value:row",
|
|
63
|
+
"alignSelf]___[value:flex-end",
|
|
58
64
|
"gap]___[value:120",
|
|
59
65
|
"overflow]___[value:auto",
|
|
60
66
|
"padding]___[value:space-64",
|
|
@@ -117,6 +123,7 @@
|
|
|
117
123
|
"switchRecipe": [
|
|
118
124
|
"size]___[value:md]___[recipe:switchRecipe"
|
|
119
125
|
],
|
|
126
|
+
"table": [],
|
|
120
127
|
"tag": [
|
|
121
128
|
"size]___[value:md]___[recipe:tag",
|
|
122
129
|
"severity]___[value:neutral]___[recipe:tag",
|
|
@@ -135,11 +142,11 @@
|
|
|
135
142
|
"drawer": [
|
|
136
143
|
"variant]___[value:right]___[recipe:drawer"
|
|
137
144
|
],
|
|
145
|
+
"popover": [],
|
|
138
146
|
"radioButtonGroup": [],
|
|
139
147
|
"radioGroup": [
|
|
140
148
|
"size]___[value:md]___[recipe:radioGroup"
|
|
141
149
|
],
|
|
142
|
-
"table": [],
|
|
143
150
|
"tableGroupTitle": [
|
|
144
151
|
"variant]___[value:primary]___[recipe:tableGroupTitle",
|
|
145
152
|
"variant]___[value:secondary]___[recipe:tableGroupTitle"
|
|
@@ -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(props11, { map }) {
|
|
6
|
+
const { ratio = 4 / 3, ...rest } = props11;
|
|
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(props11, { map, isCssUnit, isCssVar }) {
|
|
6
|
+
const { inline, block, ...rest } = props11;
|
|
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
|
@@ -2,8 +2,8 @@ import { getPatternStyles, patternFns } from '../helpers.mjs';
|
|
|
2
2
|
import { css } from '../css/index.mjs';
|
|
3
3
|
|
|
4
4
|
const boxConfig = {
|
|
5
|
-
transform(
|
|
6
|
-
return
|
|
5
|
+
transform(props11) {
|
|
6
|
+
return props11;
|
|
7
7
|
}}
|
|
8
8
|
|
|
9
9
|
export const getBoxStyle = (styles = {}) => {
|
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(props11) {
|
|
6
|
+
const { inline, ...rest } = props11;
|
|
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(props11) {
|
|
6
|
+
const { size, ...rest } = props11;
|
|
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(props11) {
|
|
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
|
+
...props11
|
|
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(props11) {
|
|
6
|
+
const { name, type, ...rest } = props11;
|
|
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(props11, { map }) {
|
|
6
|
+
const { orientation, thickness, color, ...rest } = props11;
|
|
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(props11) {
|
|
6
|
+
const { direction, align, justify, wrap: wrap22, basis, grow, shrink, ...rest } = props11;
|
|
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(props11, { map }) {
|
|
6
|
+
const { offset, offsetX, offsetY, placement, ...rest } = props11;
|
|
7
7
|
return {
|
|
8
8
|
display: "inline-flex",
|
|
9
9
|
justifyContent: "center",
|
|
@@ -38,8 +38,8 @@ transform(props10, { map }) {
|
|
|
38
38
|
...rest
|
|
39
39
|
};
|
|
40
40
|
},
|
|
41
|
-
defaultValues(
|
|
42
|
-
const offset =
|
|
41
|
+
defaultValues(props11) {
|
|
42
|
+
const offset = props11.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(props11, { map }) {
|
|
6
|
+
const { colSpan, rowSpan, colStart, rowStart, colEnd, rowEnd, ...rest } = props11;
|
|
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(props11, { map, isCssUnit }) {
|
|
6
|
+
const { columnGap, rowGap, gap, columns, minChildWidth, ...rest } = props11;
|
|
7
7
|
const getValue = (v) => isCssUnit(v) ? v : `token(sizes.${v}, ${v})`;
|
|
8
8
|
return {
|
|
9
9
|
display: "grid",
|
|
@@ -14,8 +14,8 @@ transform(props10, { map, isCssUnit }) {
|
|
|
14
14
|
...rest
|
|
15
15
|
};
|
|
16
16
|
},
|
|
17
|
-
defaultValues(
|
|
18
|
-
return { gap:
|
|
17
|
+
defaultValues(props11) {
|
|
18
|
+
return { gap: props11.columnGap || props11.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(props11) {
|
|
6
|
+
const { justify, gap, ...rest } = props11;
|
|
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(props11) {
|
|
6
6
|
return {
|
|
7
7
|
_before: {
|
|
8
8
|
content: '""',
|
|
9
9
|
position: "absolute",
|
|
10
10
|
inset: "0",
|
|
11
11
|
zIndex: "0",
|
|
12
|
-
...
|
|
12
|
+
...props11["_before"]
|
|
13
13
|
},
|
|
14
|
-
...
|
|
14
|
+
...props11
|
|
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(props11, { map }) {
|
|
6
|
+
const { size, ...rest } = props11;
|
|
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(props11) {
|
|
6
|
+
const { size, ...rest } = props11;
|
|
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(props11) {
|
|
6
|
+
const { align, justify, direction, gap, ...rest } = props11;
|
|
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(props11) {
|
|
6
|
+
const { justify, gap, ...rest } = props11;
|
|
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(props11) {
|
|
6
|
+
const { columnGap, rowGap, gap = columnGap || rowGap ? void 0 : "10px", align, justify, ...rest } = props11;
|
|
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 PopoverVariant {
|
|
6
|
+
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
type PopoverVariantMap = {
|
|
10
|
+
[key in keyof PopoverVariant]: Array<PopoverVariant[key]>
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export type PopoverVariantProps = {
|
|
14
|
+
[key in keyof PopoverVariant]?: ConditionalValue<PopoverVariant[key]> | undefined
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface PopoverRecipe {
|
|
18
|
+
__type: PopoverVariantProps
|
|
19
|
+
(props?: PopoverVariantProps): Pretty<Record<"arrow" | "arrowTip" | "anchor" | "trigger" | "indicator" | "positioner" | "content" | "title" | "description" | "closeTrigger", string>>
|
|
20
|
+
raw: (props?: PopoverVariantProps) => PopoverVariantProps
|
|
21
|
+
variantMap: PopoverVariantMap
|
|
22
|
+
variantKeys: Array<keyof PopoverVariant>
|
|
23
|
+
splitVariantProps<Props extends PopoverVariantProps>(props: Props): [PopoverVariantProps, Pretty<DistributiveOmit<Props, keyof PopoverVariantProps>>]
|
|
24
|
+
getVariantProps: (props?: PopoverVariantProps) => PopoverVariantProps
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
export declare const popover: PopoverRecipe
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { compact, getSlotCompoundVariant, memo, splitProps } from '../helpers.mjs';
|
|
2
|
+
import { createRecipe } from './create-recipe.mjs';
|
|
3
|
+
|
|
4
|
+
const popoverDefaultVariants = {}
|
|
5
|
+
const popoverCompoundVariants = []
|
|
6
|
+
|
|
7
|
+
const popoverSlotNames = [
|
|
8
|
+
[
|
|
9
|
+
"arrow",
|
|
10
|
+
"popover__arrow"
|
|
11
|
+
],
|
|
12
|
+
[
|
|
13
|
+
"arrowTip",
|
|
14
|
+
"popover__arrowTip"
|
|
15
|
+
],
|
|
16
|
+
[
|
|
17
|
+
"anchor",
|
|
18
|
+
"popover__anchor"
|
|
19
|
+
],
|
|
20
|
+
[
|
|
21
|
+
"trigger",
|
|
22
|
+
"popover__trigger"
|
|
23
|
+
],
|
|
24
|
+
[
|
|
25
|
+
"indicator",
|
|
26
|
+
"popover__indicator"
|
|
27
|
+
],
|
|
28
|
+
[
|
|
29
|
+
"positioner",
|
|
30
|
+
"popover__positioner"
|
|
31
|
+
],
|
|
32
|
+
[
|
|
33
|
+
"content",
|
|
34
|
+
"popover__content"
|
|
35
|
+
],
|
|
36
|
+
[
|
|
37
|
+
"title",
|
|
38
|
+
"popover__title"
|
|
39
|
+
],
|
|
40
|
+
[
|
|
41
|
+
"description",
|
|
42
|
+
"popover__description"
|
|
43
|
+
],
|
|
44
|
+
[
|
|
45
|
+
"closeTrigger",
|
|
46
|
+
"popover__closeTrigger"
|
|
47
|
+
]
|
|
48
|
+
]
|
|
49
|
+
const popoverSlotFns = /* @__PURE__ */ popoverSlotNames.map(([slotName, slotKey]) => [slotName, createRecipe(slotKey, popoverDefaultVariants, getSlotCompoundVariant(popoverCompoundVariants, slotName))])
|
|
50
|
+
|
|
51
|
+
const popoverFn = memo((props = {}) => {
|
|
52
|
+
return Object.fromEntries(popoverSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]))
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
const popoverVariantKeys = []
|
|
56
|
+
const getVariantProps = (variants) => ({ ...popoverDefaultVariants, ...compact(variants) })
|
|
57
|
+
|
|
58
|
+
export const popover = /* @__PURE__ */ Object.assign(popoverFn, {
|
|
59
|
+
__recipe__: false,
|
|
60
|
+
__name__: 'popover',
|
|
61
|
+
raw: (props) => props,
|
|
62
|
+
variantKeys: popoverVariantKeys,
|
|
63
|
+
variantMap: {},
|
|
64
|
+
splitVariantProps(props) {
|
|
65
|
+
return splitProps(props, popoverVariantKeys)
|
|
66
|
+
},
|
|
67
|
+
getVariantProps
|
|
68
|
+
})
|
package/recipes/table.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export type TableVariantProps = {
|
|
|
16
16
|
|
|
17
17
|
export interface TableRecipe {
|
|
18
18
|
__type: TableVariantProps
|
|
19
|
-
(props?: TableVariantProps): Pretty<Record<"root" | "thead" | "tbody" | "tr" | "th" | "td", string>>
|
|
19
|
+
(props?: TableVariantProps): Pretty<Record<"root" | "thead" | "tbody" | "tr" | "th" | "td" | "sortIndicatorRoot" | "sortIndicator", string>>
|
|
20
20
|
raw: (props?: TableVariantProps) => TableVariantProps
|
|
21
21
|
variantMap: TableVariantMap
|
|
22
22
|
variantKeys: Array<keyof TableVariant>
|
package/recipes/table.mjs
CHANGED
|
@@ -28,6 +28,14 @@ const tableSlotNames = [
|
|
|
28
28
|
[
|
|
29
29
|
"td",
|
|
30
30
|
"table__td"
|
|
31
|
+
],
|
|
32
|
+
[
|
|
33
|
+
"sortIndicatorRoot",
|
|
34
|
+
"table__sortIndicatorRoot"
|
|
35
|
+
],
|
|
36
|
+
[
|
|
37
|
+
"sortIndicator",
|
|
38
|
+
"table__sortIndicator"
|
|
31
39
|
]
|
|
32
40
|
]
|
|
33
41
|
const tableSlotFns = /* @__PURE__ */ tableSlotNames.map(([slotName, slotKey]) => [slotName, createRecipe(slotKey, tableDefaultVariants, getSlotCompoundVariant(tableCompoundVariants, slotName))])
|