@stokelp/styled-system 1.19.0 → 1.20.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": "1.19.0",
3
+ "version": "1.20.0",
4
4
  "description": "Stokelp UI styled-system",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -3,9 +3,7 @@
3
3
  "styles": {
4
4
  "atomic": [
5
5
  "fill]___[value:none",
6
- "cursor]___[value:pointer",
7
- "marginRight]___[value:space-4",
8
- "padding]___[value:space-8",
6
+ "marginLeft]___[value:auto",
9
7
  "background]___[value:error.500]___[cond:_disabled<___>_hover",
10
8
  "background]___[value:error.500]___[cond:_disabled<___>_active",
11
9
  "background]___[value:error.500]___[cond:_disabled",
@@ -30,7 +28,9 @@
30
28
  "background]___[value:error.100]___[cond:_hover",
31
29
  "color]___[value:error.700]___[cond:_hover",
32
30
  "color]___[value:error.700]___[cond:_active",
33
- "marginLeft]___[value:auto",
31
+ "cursor]___[value:pointer",
32
+ "marginRight]___[value:space-4",
33
+ "padding]___[value:space-8",
34
34
  "truncate]___[value:true",
35
35
  "width]___[value:24",
36
36
  "height]___[value:24",
@@ -71,12 +71,21 @@
71
71
  "textStyle]___[value:heading.h4",
72
72
  "textStyle]___[value:heading.h6",
73
73
  "fontFamily]___[value:satoshi",
74
+ "textTransform]___[value:uppercase",
74
75
  "color]___[value:grey.100",
75
76
  "textStyle]___[value:body.lg",
76
77
  "textStyle]___[value:body.md",
77
78
  "textStyle]___[value:body.sm"
78
79
  ],
79
80
  "recipes": {
81
+ "iconButton": [
82
+ "size]___[value:sm]___[recipe:iconButton",
83
+ "variant]___[value:tertiary]___[recipe:iconButton",
84
+ "severity]___[value:none]___[recipe:iconButton",
85
+ "variant]___[value:secondary]___[recipe:iconButton",
86
+ "size]___[value:md]___[recipe:iconButton",
87
+ "variant]___[value:primary]___[recipe:iconButton"
88
+ ],
80
89
  "checkbox": [
81
90
  "size]___[value:md]___[recipe:checkbox"
82
91
  ],
@@ -93,14 +102,6 @@
93
102
  "variant]___[value:tertiary]___[recipe:button",
94
103
  "variant]___[value:primary]___[recipe:button"
95
104
  ],
96
- "iconButton": [
97
- "size]___[value:sm]___[recipe:iconButton",
98
- "variant]___[value:secondary]___[recipe:iconButton",
99
- "severity]___[value:none]___[recipe:iconButton",
100
- "size]___[value:md]___[recipe:iconButton",
101
- "variant]___[value:tertiary]___[recipe:iconButton",
102
- "variant]___[value:primary]___[recipe:iconButton"
103
- ],
104
105
  "formControl": [],
105
106
  "formLabel": [
106
107
  "variant]___[value:absolute]___[recipe:formLabel"
@@ -0,0 +1,35 @@
1
+ /* eslint-disable */
2
+ import type { ConditionalValue } from '../types/index';
3
+ import type { DistributiveOmit, Pretty } from '../types/system-types';
4
+
5
+ interface AlertVariant {
6
+ /**
7
+ * @default "neutral"
8
+ */
9
+ severity: "neutral" | "info" | "success" | "warning" | "error"
10
+ }
11
+
12
+ type AlertVariantMap = {
13
+ [key in keyof AlertVariant]: Array<AlertVariant[key]>
14
+ }
15
+
16
+ export type AlertVariantProps = {
17
+ [key in keyof AlertVariant]?: ConditionalValue<AlertVariant[key]> | undefined
18
+ }
19
+
20
+ export interface AlertRecipe {
21
+ __type: AlertVariantProps
22
+ (props?: AlertVariantProps): Pretty<Record<"root" | "icon" | "title" | "description", string>>
23
+ raw: (props?: AlertVariantProps) => AlertVariantProps
24
+ variantMap: AlertVariantMap
25
+ variantKeys: Array<keyof AlertVariant>
26
+ splitVariantProps<Props extends AlertVariantProps>(props: Props): [AlertVariantProps, Pretty<DistributiveOmit<Props, keyof AlertVariantProps>>]
27
+ getVariantProps: (props?: AlertVariantProps) => AlertVariantProps
28
+ }
29
+
30
+ /**
31
+ * The styles for the Alert component
32
+
33
+
34
+ */
35
+ export declare const alert: AlertRecipe
@@ -0,0 +1,56 @@
1
+ import { compact, getSlotCompoundVariant, memo, splitProps } from '../helpers.mjs';
2
+ import { createRecipe } from './create-recipe.mjs';
3
+
4
+ const alertDefaultVariants = {
5
+ "severity": "neutral"
6
+ }
7
+ const alertCompoundVariants = []
8
+
9
+ const alertSlotNames = [
10
+ [
11
+ "root",
12
+ "alert__root"
13
+ ],
14
+ [
15
+ "icon",
16
+ "alert__icon"
17
+ ],
18
+ [
19
+ "title",
20
+ "alert__title"
21
+ ],
22
+ [
23
+ "description",
24
+ "alert__description"
25
+ ]
26
+ ]
27
+ const alertSlotFns = /* @__PURE__ */ alertSlotNames.map(([slotName, slotKey]) => [slotName, createRecipe(slotKey, alertDefaultVariants, getSlotCompoundVariant(alertCompoundVariants, slotName))])
28
+
29
+ const alertFn = memo((props = {}) => {
30
+ return Object.fromEntries(alertSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]))
31
+ })
32
+
33
+ const alertVariantKeys = [
34
+ "severity"
35
+ ]
36
+ const getVariantProps = (variants) => ({ ...alertDefaultVariants, ...compact(variants) })
37
+
38
+ export const alert = /* @__PURE__ */ Object.assign(alertFn, {
39
+ __recipe__: false,
40
+ __name__: 'alert',
41
+ raw: (props) => props,
42
+ variantKeys: alertVariantKeys,
43
+ variantMap: {
44
+ "severity": [
45
+ "neutral",
46
+ "info",
47
+ "success",
48
+ "warning",
49
+ "error"
50
+ ]
51
+ },
52
+ splitVariantProps(props) {
53
+ return splitProps(props, alertVariantKeys)
54
+ },
55
+ getVariantProps
56
+ })
@@ -22,4 +22,5 @@ export * from './tag';
22
22
  export * from './select';
23
23
  export * from './chip';
24
24
  export * from './action-card';
25
- export * from './tooltip';
25
+ export * from './tooltip';
26
+ export * from './alert';
package/recipes/index.mjs CHANGED
@@ -21,4 +21,5 @@ export * from './tag.mjs';
21
21
  export * from './select.mjs';
22
22
  export * from './chip.mjs';
23
23
  export * from './action-card.mjs';
24
- export * from './tooltip.mjs';
24
+ export * from './tooltip.mjs';
25
+ export * from './alert.mjs';