@stokelp/styled-system 2.26.0 → 2.27.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stokelp/styled-system",
3
- "version": "2.26.0",
3
+ "version": "2.27.0",
4
4
  "description": "Stokelp UI styled-system",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -71,6 +71,8 @@
71
71
  "marginBlock]___[value:space-24",
72
72
  "width]___[value:100%",
73
73
  "gridTemplateColumns]___[value:repeat(3, 1fr)",
74
+ "background]___[value:red.100",
75
+ "color]___[value:red.500",
74
76
  "padding]___[value:space-4",
75
77
  "gap]___[value:space-4",
76
78
  "gap]___[value:space-32",
@@ -176,6 +178,9 @@
176
178
  "size]___[value:md]___[recipe:accordion"
177
179
  ],
178
180
  "actionCard": [],
181
+ "avatar": [
182
+ "size]___[value:md]___[recipe:avatar"
183
+ ],
179
184
  "breadcrumb": [],
180
185
  "combobox": [
181
186
  "size]___[value:md]___[recipe:combobox"
@@ -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(props12, { map }) {
6
- const { ratio = 4 / 3, ...rest } = props12;
5
+ transform(props13, { map }) {
6
+ const { ratio = 4 / 3, ...rest } = props13;
7
7
  return {
8
8
  position: "relative",
9
9
  _before: {
@@ -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(props12, { map, isCssUnit, isCssVar }) {
6
- const { inline, block, ...rest } = props12;
5
+ transform(props13, { map, isCssUnit, isCssVar }) {
6
+ const { inline, block, ...rest } = props13;
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(props12) {
6
- return props12;
5
+ transform(props13) {
6
+ return props13;
7
7
  }}
8
8
 
9
9
  export const getBoxStyle = (styles = {}) => {
@@ -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(props12) {
6
- const { inline, ...rest } = props12;
5
+ transform(props13) {
6
+ const { inline, ...rest } = props13;
7
7
  return {
8
8
  display: inline ? "inline-flex" : "flex",
9
9
  alignItems: "center",
@@ -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(props12) {
6
- const { size, ...rest } = props12;
5
+ transform(props13) {
6
+ const { size, ...rest } = props13;
7
7
  return {
8
8
  display: "flex",
9
9
  alignItems: "center",
@@ -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(props12) {
5
+ transform(props13) {
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
- ...props12
11
+ ...props13
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(props12) {
6
- const { name, type, ...rest } = props12;
5
+ transform(props13) {
6
+ const { name, type, ...rest } = props13;
7
7
  return {
8
8
  containerType: type,
9
9
  containerName: name,
@@ -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(props12, { map }) {
6
- const { orientation, thickness, color, ...rest } = props12;
5
+ transform(props13, { map }) {
6
+ const { orientation, thickness, color, ...rest } = props13;
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(props12) {
6
- const { direction, align, justify, wrap: wrap22, basis, grow, shrink, ...rest } = props12;
5
+ transform(props13) {
6
+ const { direction, align, justify, wrap: wrap22, basis, grow, shrink, ...rest } = props13;
7
7
  return {
8
8
  display: "flex",
9
9
  flexDirection: direction,
@@ -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(props12, { map }) {
6
- const { offset, offsetX, offsetY, placement, ...rest } = props12;
5
+ transform(props13, { map }) {
6
+ const { offset, offsetX, offsetY, placement, ...rest } = props13;
7
7
  return {
8
8
  display: "inline-flex",
9
9
  justifyContent: "center",
@@ -38,8 +38,8 @@ transform(props12, { map }) {
38
38
  ...rest
39
39
  };
40
40
  },
41
- defaultValues(props12) {
42
- const offset = props12.offset || "0";
41
+ defaultValues(props13) {
42
+ const offset = props13.offset || "0";
43
43
  return { offset, offsetX: offset, offsetY: offset, placement: "top-end" };
44
44
  }}
45
45
 
@@ -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(props12, { map }) {
6
- const { colSpan, rowSpan, colStart, rowStart, colEnd, rowEnd, ...rest } = props12;
5
+ transform(props13, { map }) {
6
+ const { colSpan, rowSpan, colStart, rowStart, colEnd, rowEnd, ...rest } = props13;
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(props12, { map, isCssUnit }) {
6
- const { columnGap, rowGap, gap, columns, minChildWidth, ...rest } = props12;
5
+ transform(props13, { map, isCssUnit }) {
6
+ const { columnGap, rowGap, gap, columns, minChildWidth, ...rest } = props13;
7
7
  const getValue = (v) => isCssUnit(v) ? v : `token(sizes.${v}, ${v})`;
8
8
  return {
9
9
  display: "grid",
@@ -14,8 +14,8 @@ transform(props12, { map, isCssUnit }) {
14
14
  ...rest
15
15
  };
16
16
  },
17
- defaultValues(props12) {
18
- return { gap: props12.columnGap || props12.rowGap ? void 0 : "10px" };
17
+ defaultValues(props13) {
18
+ return { gap: props13.columnGap || props13.rowGap ? void 0 : "10px" };
19
19
  }}
20
20
 
21
21
  export const getGridStyle = (styles = {}) => {
@@ -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(props12) {
6
- const { justify, gap, ...rest } = props12;
5
+ transform(props13) {
6
+ const { justify, gap, ...rest } = props13;
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(props12) {
5
+ transform(props13) {
6
6
  return {
7
7
  _before: {
8
8
  content: '""',
9
9
  position: "absolute",
10
10
  inset: "0",
11
11
  zIndex: "0",
12
- ...props12["_before"]
12
+ ...props13["_before"]
13
13
  },
14
- ...props12
14
+ ...props13
15
15
  };
16
16
  }}
17
17
 
@@ -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(props12, { map }) {
6
- const { size, ...rest } = props12;
5
+ transform(props13, { map }) {
6
+ const { size, ...rest } = props13;
7
7
  return {
8
8
  alignSelf: "stretch",
9
9
  justifySelf: "stretch",
@@ -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(props12) {
6
- const { size, ...rest } = props12;
5
+ transform(props13) {
6
+ const { size, ...rest } = props13;
7
7
  return {
8
8
  display: "flex",
9
9
  alignItems: "center",
@@ -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(props12) {
6
- const { align, justify, direction, gap, ...rest } = props12;
5
+ transform(props13) {
6
+ const { align, justify, direction, gap, ...rest } = props13;
7
7
  return {
8
8
  display: "flex",
9
9
  flexDirection: direction,
@@ -2,10 +2,10 @@ import { getPatternStyles, patternFns } from '../helpers.mjs';
2
2
  import { css } from '../css/index.mjs';
3
3
 
4
4
  const visuallyHiddenConfig = {
5
- transform(props12) {
5
+ transform(props13) {
6
6
  return {
7
7
  srOnly: true,
8
- ...props12
8
+ ...props13
9
9
  };
10
10
  }}
11
11
 
@@ -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(props12) {
6
- const { justify, gap, ...rest } = props12;
5
+ transform(props13) {
6
+ const { justify, gap, ...rest } = props13;
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(props12) {
6
- const { columnGap, rowGap, gap = columnGap || rowGap ? void 0 : "10px", align, justify, ...rest } = props12;
5
+ transform(props13) {
6
+ const { columnGap, rowGap, gap = columnGap || rowGap ? void 0 : "10px", align, justify, ...rest } = props13;
7
7
  return {
8
8
  display: "flex",
9
9
  flexWrap: "wrap",
@@ -0,0 +1,31 @@
1
+ /* eslint-disable */
2
+ import type { ConditionalValue } from '../types/index';
3
+ import type { DistributiveOmit, Pretty } from '../types/system-types';
4
+
5
+ interface AvatarVariant {
6
+ /**
7
+ * @default "md"
8
+ */
9
+ size: "sm" | "md" | "lg"
10
+ }
11
+
12
+ type AvatarVariantMap = {
13
+ [key in keyof AvatarVariant]: Array<AvatarVariant[key]>
14
+ }
15
+
16
+ export type AvatarVariantProps = {
17
+ [key in keyof AvatarVariant]?: ConditionalValue<AvatarVariant[key]> | undefined
18
+ }
19
+
20
+ export interface AvatarRecipe {
21
+ __type: AvatarVariantProps
22
+ (props?: AvatarVariantProps): Pretty<Record<"root" | "image" | "fallback", string>>
23
+ raw: (props?: AvatarVariantProps) => AvatarVariantProps
24
+ variantMap: AvatarVariantMap
25
+ variantKeys: Array<keyof AvatarVariant>
26
+ splitVariantProps<Props extends AvatarVariantProps>(props: Props): [AvatarVariantProps, Pretty<DistributiveOmit<Props, keyof AvatarVariantProps>>]
27
+ getVariantProps: (props?: AvatarVariantProps) => AvatarVariantProps
28
+ }
29
+
30
+
31
+ export declare const avatar: AvatarRecipe
@@ -0,0 +1,50 @@
1
+ import { compact, getSlotCompoundVariant, memo, splitProps } from '../helpers.mjs';
2
+ import { createRecipe } from './create-recipe.mjs';
3
+
4
+ const avatarDefaultVariants = {
5
+ "size": "md"
6
+ }
7
+ const avatarCompoundVariants = []
8
+
9
+ const avatarSlotNames = [
10
+ [
11
+ "root",
12
+ "avatar__root"
13
+ ],
14
+ [
15
+ "image",
16
+ "avatar__image"
17
+ ],
18
+ [
19
+ "fallback",
20
+ "avatar__fallback"
21
+ ]
22
+ ]
23
+ const avatarSlotFns = /* @__PURE__ */ avatarSlotNames.map(([slotName, slotKey]) => [slotName, createRecipe(slotKey, avatarDefaultVariants, getSlotCompoundVariant(avatarCompoundVariants, slotName))])
24
+
25
+ const avatarFn = memo((props = {}) => {
26
+ return Object.fromEntries(avatarSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]))
27
+ })
28
+
29
+ const avatarVariantKeys = [
30
+ "size"
31
+ ]
32
+ const getVariantProps = (variants) => ({ ...avatarDefaultVariants, ...compact(variants) })
33
+
34
+ export const avatar = /* @__PURE__ */ Object.assign(avatarFn, {
35
+ __recipe__: false,
36
+ __name__: 'avatar',
37
+ raw: (props) => props,
38
+ variantKeys: avatarVariantKeys,
39
+ variantMap: {
40
+ "size": [
41
+ "sm",
42
+ "md",
43
+ "lg"
44
+ ]
45
+ },
46
+ splitVariantProps(props) {
47
+ return splitProps(props, avatarVariantKeys)
48
+ },
49
+ getVariantProps
50
+ })
@@ -45,4 +45,5 @@ export * from './combobox';
45
45
  export * from './collapsible';
46
46
  export * from './app-navigation';
47
47
  export * from './dialog';
48
- export * from './app-navigation-language-select';
48
+ export * from './app-navigation-language-select';
49
+ export * from './avatar';
package/recipes/index.mjs CHANGED
@@ -44,4 +44,5 @@ export * from './combobox.mjs';
44
44
  export * from './collapsible.mjs';
45
45
  export * from './app-navigation.mjs';
46
46
  export * from './dialog.mjs';
47
- export * from './app-navigation-language-select.mjs';
47
+ export * from './app-navigation-language-select.mjs';
48
+ export * from './avatar.mjs';