@stokelp/styled-system 1.10.0 → 1.11.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 +1 -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 +1 -0
- package/recipes/index.mjs +1 -0
- package/recipes/radio-button-group.d.ts +28 -0
- package/recipes/radio-button-group.mjs +52 -0
package/package.json
CHANGED
package/panda.buildinfo.json
CHANGED
|
@@ -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(props9, { map }) {
|
|
6
|
+
const { ratio = 4 / 3, ...rest } = props9;
|
|
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(props9, { map, isCssUnit, isCssVar }) {
|
|
6
|
+
const { inline, block, ...rest } = props9;
|
|
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(props9) {
|
|
6
|
+
const { inline, ...rest } = props9;
|
|
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(props9) {
|
|
6
|
+
const { size, ...rest } = props9;
|
|
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(props9) {
|
|
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
|
+
...props9
|
|
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(props9) {
|
|
6
|
+
const { name, type, ...rest } = props9;
|
|
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(props9, { map }) {
|
|
6
|
+
const { orientation, thickness, color, ...rest } = props9;
|
|
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(props9) {
|
|
6
|
+
const { direction, align, justify, wrap: wrap22, basis, grow, shrink, ...rest } = props9;
|
|
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(props9, { map }) {
|
|
6
|
+
const { offset, offsetX, offsetY, placement, ...rest } = props9;
|
|
7
7
|
return {
|
|
8
8
|
display: "inline-flex",
|
|
9
9
|
justifyContent: "center",
|
|
@@ -38,8 +38,8 @@ transform(props8, { map }) {
|
|
|
38
38
|
...rest
|
|
39
39
|
};
|
|
40
40
|
},
|
|
41
|
-
defaultValues(
|
|
42
|
-
const offset =
|
|
41
|
+
defaultValues(props9) {
|
|
42
|
+
const offset = props9.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(props9, { map }) {
|
|
6
|
+
const { colSpan, rowSpan, colStart, rowStart, colEnd, rowEnd, ...rest } = props9;
|
|
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(props9, { map, isCssUnit }) {
|
|
6
|
+
const { columnGap, rowGap, gap, columns, minChildWidth, ...rest } = props9;
|
|
7
7
|
const getValue = (v) => isCssUnit(v) ? v : `token(sizes.${v}, ${v})`;
|
|
8
8
|
return {
|
|
9
9
|
display: "grid",
|
|
@@ -14,8 +14,8 @@ transform(props8, { map, isCssUnit }) {
|
|
|
14
14
|
...rest
|
|
15
15
|
};
|
|
16
16
|
},
|
|
17
|
-
defaultValues(
|
|
18
|
-
return { gap:
|
|
17
|
+
defaultValues(props9) {
|
|
18
|
+
return { gap: props9.columnGap || props9.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(props9) {
|
|
6
|
+
const { justify, gap, ...rest } = props9;
|
|
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(props9) {
|
|
6
6
|
return {
|
|
7
7
|
_before: {
|
|
8
8
|
content: '""',
|
|
9
9
|
position: "absolute",
|
|
10
10
|
inset: "0",
|
|
11
11
|
zIndex: "0",
|
|
12
|
-
...
|
|
12
|
+
...props9["_before"]
|
|
13
13
|
},
|
|
14
|
-
...
|
|
14
|
+
...props9
|
|
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(props9, { map }) {
|
|
6
|
+
const { size, ...rest } = props9;
|
|
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(props9) {
|
|
6
|
+
const { size, ...rest } = props9;
|
|
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(props9) {
|
|
6
|
+
const { align, justify, direction, gap, ...rest } = props9;
|
|
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(props9) {
|
|
6
|
+
const { justify, gap, ...rest } = props9;
|
|
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(props9) {
|
|
6
|
+
const { columnGap, rowGap, gap = columnGap || rowGap ? void 0 : "10px", align, justify, ...rest } = props9;
|
|
7
7
|
return {
|
|
8
8
|
display: "flex",
|
|
9
9
|
flexWrap: "wrap",
|
package/recipes/index.d.ts
CHANGED
package/recipes/index.mjs
CHANGED
|
@@ -9,6 +9,7 @@ export * from './input.mjs';
|
|
|
9
9
|
export * from './input-addon.mjs';
|
|
10
10
|
export * from './input-group.mjs';
|
|
11
11
|
export * from './drawer.mjs';
|
|
12
|
+
export * from './radio-button-group.mjs';
|
|
12
13
|
export * from './accordion.mjs';
|
|
13
14
|
export * from './form-label.mjs';
|
|
14
15
|
export * from './checkbox.mjs';
|
|
@@ -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 RadioButtonGroupVariant {
|
|
6
|
+
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
type RadioButtonGroupVariantMap = {
|
|
10
|
+
[key in keyof RadioButtonGroupVariant]: Array<RadioButtonGroupVariant[key]>
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export type RadioButtonGroupVariantProps = {
|
|
14
|
+
[key in keyof RadioButtonGroupVariant]?: ConditionalValue<RadioButtonGroupVariant[key]> | undefined
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface RadioButtonGroupRecipe {
|
|
18
|
+
__type: RadioButtonGroupVariantProps
|
|
19
|
+
(props?: RadioButtonGroupVariantProps): Pretty<Record<"root" | "label" | "item" | "itemText" | "itemControl" | "indicator", string>>
|
|
20
|
+
raw: (props?: RadioButtonGroupVariantProps) => RadioButtonGroupVariantProps
|
|
21
|
+
variantMap: RadioButtonGroupVariantMap
|
|
22
|
+
variantKeys: Array<keyof RadioButtonGroupVariant>
|
|
23
|
+
splitVariantProps<Props extends RadioButtonGroupVariantProps>(props: Props): [RadioButtonGroupVariantProps, Pretty<DistributiveOmit<Props, keyof RadioButtonGroupVariantProps>>]
|
|
24
|
+
getVariantProps: (props?: RadioButtonGroupVariantProps) => RadioButtonGroupVariantProps
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
export declare const radioButtonGroup: RadioButtonGroupRecipe
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { compact, getSlotCompoundVariant, memo, splitProps } from '../helpers.mjs';
|
|
2
|
+
import { createRecipe } from './create-recipe.mjs';
|
|
3
|
+
|
|
4
|
+
const radioButtonGroupDefaultVariants = {}
|
|
5
|
+
const radioButtonGroupCompoundVariants = []
|
|
6
|
+
|
|
7
|
+
const radioButtonGroupSlotNames = [
|
|
8
|
+
[
|
|
9
|
+
"root",
|
|
10
|
+
"radio-button-group__root"
|
|
11
|
+
],
|
|
12
|
+
[
|
|
13
|
+
"label",
|
|
14
|
+
"radio-button-group__label"
|
|
15
|
+
],
|
|
16
|
+
[
|
|
17
|
+
"item",
|
|
18
|
+
"radio-button-group__item"
|
|
19
|
+
],
|
|
20
|
+
[
|
|
21
|
+
"itemText",
|
|
22
|
+
"radio-button-group__itemText"
|
|
23
|
+
],
|
|
24
|
+
[
|
|
25
|
+
"itemControl",
|
|
26
|
+
"radio-button-group__itemControl"
|
|
27
|
+
],
|
|
28
|
+
[
|
|
29
|
+
"indicator",
|
|
30
|
+
"radio-button-group__indicator"
|
|
31
|
+
]
|
|
32
|
+
]
|
|
33
|
+
const radioButtonGroupSlotFns = /* @__PURE__ */ radioButtonGroupSlotNames.map(([slotName, slotKey]) => [slotName, createRecipe(slotKey, radioButtonGroupDefaultVariants, getSlotCompoundVariant(radioButtonGroupCompoundVariants, slotName))])
|
|
34
|
+
|
|
35
|
+
const radioButtonGroupFn = memo((props = {}) => {
|
|
36
|
+
return Object.fromEntries(radioButtonGroupSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]))
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
const radioButtonGroupVariantKeys = []
|
|
40
|
+
const getVariantProps = (variants) => ({ ...radioButtonGroupDefaultVariants, ...compact(variants) })
|
|
41
|
+
|
|
42
|
+
export const radioButtonGroup = /* @__PURE__ */ Object.assign(radioButtonGroupFn, {
|
|
43
|
+
__recipe__: false,
|
|
44
|
+
__name__: 'radioButtonGroup',
|
|
45
|
+
raw: (props) => props,
|
|
46
|
+
variantKeys: radioButtonGroupVariantKeys,
|
|
47
|
+
variantMap: {},
|
|
48
|
+
splitVariantProps(props) {
|
|
49
|
+
return splitProps(props, radioButtonGroupVariantKeys)
|
|
50
|
+
},
|
|
51
|
+
getVariantProps
|
|
52
|
+
})
|