@stokelp/styled-system 2.5.0 → 2.7.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.5.0",
3
+ "version": "2.7.0",
4
4
  "description": "Stokelp UI styled-system",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -61,16 +61,22 @@
61
61
  "marginBlock]___[value:space-24",
62
62
  "width]___[value:100%",
63
63
  "gridTemplateColumns]___[value:repeat(3, 1fr)",
64
+ "padding]___[value:space-4",
65
+ "gap]___[value:space-4",
64
66
  "gap]___[value:space-32",
65
67
  "padding]___[value:space-16",
66
68
  "marginTop]___[value:100",
69
+ "flexDirection]___[value:row",
70
+ "color]___[value:primary.500",
71
+ "color]___[value:secondary.500",
72
+ "color]___[value:success.500",
73
+ "color]___[value:warning.500",
67
74
  "borderRadius]___[value:radius-24",
68
75
  "height]___[value:200",
69
76
  "width]___[value:400",
70
77
  "gap]___[value:space-8",
71
78
  "maxHeight]___[value:102",
72
79
  "overflowY]___[value:auto",
73
- "flexDirection]___[value:row",
74
80
  "alignSelf]___[value:flex-end",
75
81
  "gap]___[value:120",
76
82
  "overflow]___[value:auto",
@@ -79,7 +85,6 @@
79
85
  "background]___[value:grey.100",
80
86
  "borderRadius]___[value:radius-4",
81
87
  "display]___[value:inline-flex",
82
- "gap]___[value:space-4",
83
88
  "background]___[value:primary.700",
84
89
  "paddingBlock]___[value:space-8",
85
90
  "paddingInline]___[value:space-16",
@@ -158,12 +163,16 @@
158
163
  ],
159
164
  "actionCard": [],
160
165
  "breadcrumb": [],
166
+ "collapsible": [],
161
167
  "combobox": [
162
168
  "size]___[value:md]___[recipe:combobox"
163
169
  ],
164
170
  "drawer": [
165
171
  "variant]___[value:right]___[recipe:drawer"
166
172
  ],
173
+ "icon": [
174
+ "size]___[value:md]___[recipe:icon"
175
+ ],
167
176
  "illustration": [
168
177
  "pattern]___[value:neutral]___[recipe:illustration"
169
178
  ],
@@ -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(props11, { map }) {
6
- const { ratio = 4 / 3, ...rest } = props11;
5
+ transform(props12, { map }) {
6
+ const { ratio = 4 / 3, ...rest } = props12;
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(props11, { map, isCssUnit, isCssVar }) {
6
- const { inline, block, ...rest } = props11;
5
+ transform(props12, { map, isCssUnit, isCssVar }) {
6
+ const { inline, block, ...rest } = props12;
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(props11) {
6
- return props11;
5
+ transform(props12) {
6
+ return props12;
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(props11) {
6
- const { inline, ...rest } = props11;
5
+ transform(props12) {
6
+ const { inline, ...rest } = props12;
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(props11) {
6
- const { size, ...rest } = props11;
5
+ transform(props12) {
6
+ const { size, ...rest } = props12;
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(props11) {
5
+ transform(props12) {
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
- ...props11
11
+ ...props12
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(props11) {
6
- const { name, type, ...rest } = props11;
5
+ transform(props12) {
6
+ const { name, type, ...rest } = props12;
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(props11, { map }) {
6
- const { orientation, thickness, color, ...rest } = props11;
5
+ transform(props12, { map }) {
6
+ const { orientation, thickness, color, ...rest } = props12;
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(props11) {
6
- const { direction, align, justify, wrap: wrap22, basis, grow, shrink, ...rest } = props11;
5
+ transform(props12) {
6
+ const { direction, align, justify, wrap: wrap22, basis, grow, shrink, ...rest } = props12;
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(props11, { map }) {
6
- const { offset, offsetX, offsetY, placement, ...rest } = props11;
5
+ transform(props12, { map }) {
6
+ const { offset, offsetX, offsetY, placement, ...rest } = props12;
7
7
  return {
8
8
  display: "inline-flex",
9
9
  justifyContent: "center",
@@ -38,8 +38,8 @@ transform(props11, { map }) {
38
38
  ...rest
39
39
  };
40
40
  },
41
- defaultValues(props11) {
42
- const offset = props11.offset || "0";
41
+ defaultValues(props12) {
42
+ const offset = props12.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(props11, { map }) {
6
- const { colSpan, rowSpan, colStart, rowStart, colEnd, rowEnd, ...rest } = props11;
5
+ transform(props12, { map }) {
6
+ const { colSpan, rowSpan, colStart, rowStart, colEnd, rowEnd, ...rest } = props12;
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(props11, { map, isCssUnit }) {
6
- const { columnGap, rowGap, gap, columns, minChildWidth, ...rest } = props11;
5
+ transform(props12, { map, isCssUnit }) {
6
+ const { columnGap, rowGap, gap, columns, minChildWidth, ...rest } = props12;
7
7
  const getValue = (v) => isCssUnit(v) ? v : `token(sizes.${v}, ${v})`;
8
8
  return {
9
9
  display: "grid",
@@ -14,8 +14,8 @@ transform(props11, { map, isCssUnit }) {
14
14
  ...rest
15
15
  };
16
16
  },
17
- defaultValues(props11) {
18
- return { gap: props11.columnGap || props11.rowGap ? void 0 : "10px" };
17
+ defaultValues(props12) {
18
+ return { gap: props12.columnGap || props12.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(props11) {
6
- const { justify, gap, ...rest } = props11;
5
+ transform(props12) {
6
+ const { justify, gap, ...rest } = props12;
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(props11) {
5
+ transform(props12) {
6
6
  return {
7
7
  _before: {
8
8
  content: '""',
9
9
  position: "absolute",
10
10
  inset: "0",
11
11
  zIndex: "0",
12
- ...props11["_before"]
12
+ ...props12["_before"]
13
13
  },
14
- ...props11
14
+ ...props12
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(props11, { map }) {
6
- const { size, ...rest } = props11;
5
+ transform(props12, { map }) {
6
+ const { size, ...rest } = props12;
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(props11) {
6
- const { size, ...rest } = props11;
5
+ transform(props12) {
6
+ const { size, ...rest } = props12;
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(props11) {
6
- const { align, justify, direction, gap, ...rest } = props11;
5
+ transform(props12) {
6
+ const { align, justify, direction, gap, ...rest } = props12;
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(props11) {
5
+ transform(props12) {
6
6
  return {
7
7
  srOnly: true,
8
- ...props11
8
+ ...props12
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(props11) {
6
- const { justify, gap, ...rest } = props11;
5
+ transform(props12) {
6
+ const { justify, gap, ...rest } = props12;
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(props11) {
6
- const { columnGap, rowGap, gap = columnGap || rowGap ? void 0 : "10px", align, justify, ...rest } = props11;
5
+ transform(props12) {
6
+ const { columnGap, rowGap, gap = columnGap || rowGap ? void 0 : "10px", align, justify, ...rest } = props12;
7
7
  return {
8
8
  display: "flex",
9
9
  flexWrap: "wrap",
@@ -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 CollapsibleVariant {
6
+
7
+ }
8
+
9
+ type CollapsibleVariantMap = {
10
+ [key in keyof CollapsibleVariant]: Array<CollapsibleVariant[key]>
11
+ }
12
+
13
+ export type CollapsibleVariantProps = {
14
+ [key in keyof CollapsibleVariant]?: ConditionalValue<CollapsibleVariant[key]> | undefined
15
+ }
16
+
17
+ export interface CollapsibleRecipe {
18
+ __type: CollapsibleVariantProps
19
+ (props?: CollapsibleVariantProps): Pretty<Record<"root" | "trigger" | "content", string>>
20
+ raw: (props?: CollapsibleVariantProps) => CollapsibleVariantProps
21
+ variantMap: CollapsibleVariantMap
22
+ variantKeys: Array<keyof CollapsibleVariant>
23
+ splitVariantProps<Props extends CollapsibleVariantProps>(props: Props): [CollapsibleVariantProps, Pretty<DistributiveOmit<Props, keyof CollapsibleVariantProps>>]
24
+ getVariantProps: (props?: CollapsibleVariantProps) => CollapsibleVariantProps
25
+ }
26
+
27
+
28
+ export declare const collapsible: CollapsibleRecipe
@@ -0,0 +1,40 @@
1
+ import { compact, getSlotCompoundVariant, memo, splitProps } from '../helpers.mjs';
2
+ import { createRecipe } from './create-recipe.mjs';
3
+
4
+ const collapsibleDefaultVariants = {}
5
+ const collapsibleCompoundVariants = []
6
+
7
+ const collapsibleSlotNames = [
8
+ [
9
+ "root",
10
+ "collapsible__root"
11
+ ],
12
+ [
13
+ "trigger",
14
+ "collapsible__trigger"
15
+ ],
16
+ [
17
+ "content",
18
+ "collapsible__content"
19
+ ]
20
+ ]
21
+ const collapsibleSlotFns = /* @__PURE__ */ collapsibleSlotNames.map(([slotName, slotKey]) => [slotName, createRecipe(slotKey, collapsibleDefaultVariants, getSlotCompoundVariant(collapsibleCompoundVariants, slotName))])
22
+
23
+ const collapsibleFn = memo((props = {}) => {
24
+ return Object.fromEntries(collapsibleSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]))
25
+ })
26
+
27
+ const collapsibleVariantKeys = []
28
+ const getVariantProps = (variants) => ({ ...collapsibleDefaultVariants, ...compact(variants) })
29
+
30
+ export const collapsible = /* @__PURE__ */ Object.assign(collapsibleFn, {
31
+ __recipe__: false,
32
+ __name__: 'collapsible',
33
+ raw: (props) => props,
34
+ variantKeys: collapsibleVariantKeys,
35
+ variantMap: {},
36
+ splitVariantProps(props) {
37
+ return splitProps(props, collapsibleVariantKeys)
38
+ },
39
+ getVariantProps
40
+ })
@@ -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 IconVariant {
6
+ /**
7
+ * @default "md"
8
+ */
9
+ size: "md"
10
+ }
11
+
12
+ type IconVariantMap = {
13
+ [key in keyof IconVariant]: Array<IconVariant[key]>
14
+ }
15
+
16
+ export type IconVariantProps = {
17
+ [key in keyof IconVariant]?: ConditionalValue<IconVariant[key]> | undefined
18
+ }
19
+
20
+ export interface IconRecipe {
21
+ __type: IconVariantProps
22
+ (props?: IconVariantProps): string
23
+ raw: (props?: IconVariantProps) => IconVariantProps
24
+ variantMap: IconVariantMap
25
+ variantKeys: Array<keyof IconVariant>
26
+ splitVariantProps<Props extends IconVariantProps>(props: Props): [IconVariantProps, Pretty<DistributiveOmit<Props, keyof IconVariantProps>>]
27
+ getVariantProps: (props?: IconVariantProps) => IconVariantProps
28
+ }
29
+
30
+
31
+ export declare const icon: IconRecipe
@@ -0,0 +1,30 @@
1
+ import { memo, splitProps } from '../helpers.mjs';
2
+ import { createRecipe, mergeRecipes } from './create-recipe.mjs';
3
+
4
+ const iconFn = /* @__PURE__ */ createRecipe('icon', {
5
+ "size": "md"
6
+ }, [])
7
+
8
+ const iconVariantMap = {
9
+ "size": [
10
+ "md"
11
+ ]
12
+ }
13
+
14
+ const iconVariantKeys = Object.keys(iconVariantMap)
15
+
16
+ export const icon = /* @__PURE__ */ Object.assign(memo(iconFn.recipeFn), {
17
+ __recipe__: true,
18
+ __name__: 'icon',
19
+ __getCompoundVariantCss__: iconFn.__getCompoundVariantCss__,
20
+ raw: (props) => props,
21
+ variantKeys: iconVariantKeys,
22
+ variantMap: iconVariantMap,
23
+ merge(recipe) {
24
+ return mergeRecipes(this, recipe)
25
+ },
26
+ splitVariantProps(props) {
27
+ return splitProps(props, iconVariantKeys)
28
+ },
29
+ getVariantProps: iconFn.getVariantProps,
30
+ })
@@ -16,6 +16,7 @@ export * from './table-container';
16
16
  export * from './illustration';
17
17
  export * from './button-filter';
18
18
  export * from './phone-number-input';
19
+ export * from './icon';
19
20
  export * from './drawer';
20
21
  export * from './radio-button-group';
21
22
  export * from './radio-group';
@@ -39,4 +40,5 @@ export * from './product-card-catalog';
39
40
  export * from './switch-card';
40
41
  export * from './radio-card-group';
41
42
  export * from './checkbox-card';
42
- export * from './combobox';
43
+ export * from './combobox';
44
+ export * from './collapsible';
package/recipes/index.mjs CHANGED
@@ -15,6 +15,7 @@ export * from './table-container.mjs';
15
15
  export * from './illustration.mjs';
16
16
  export * from './button-filter.mjs';
17
17
  export * from './phone-number-input.mjs';
18
+ export * from './icon.mjs';
18
19
  export * from './drawer.mjs';
19
20
  export * from './radio-button-group.mjs';
20
21
  export * from './radio-group.mjs';
@@ -38,4 +39,5 @@ export * from './product-card-catalog.mjs';
38
39
  export * from './switch-card.mjs';
39
40
  export * from './radio-card-group.mjs';
40
41
  export * from './checkbox-card.mjs';
41
- export * from './combobox.mjs';
42
+ export * from './combobox.mjs';
43
+ export * from './collapsible.mjs';