@stokelp/styled-system 1.19.1 → 1.21.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.1",
3
+ "version": "1.21.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,11 @@
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
+ "width]___[value:16",
35
+ "height]___[value:16",
34
36
  "truncate]___[value:true",
35
37
  "width]___[value:24",
36
38
  "height]___[value:24",
@@ -78,6 +80,14 @@
78
80
  "textStyle]___[value:body.sm"
79
81
  ],
80
82
  "recipes": {
83
+ "iconButton": [
84
+ "size]___[value:sm]___[recipe:iconButton",
85
+ "variant]___[value:tertiary]___[recipe:iconButton",
86
+ "severity]___[value:none]___[recipe:iconButton",
87
+ "variant]___[value:secondary]___[recipe:iconButton",
88
+ "size]___[value:md]___[recipe:iconButton",
89
+ "variant]___[value:primary]___[recipe:iconButton"
90
+ ],
81
91
  "checkbox": [
82
92
  "size]___[value:md]___[recipe:checkbox"
83
93
  ],
@@ -94,18 +104,11 @@
94
104
  "variant]___[value:tertiary]___[recipe:button",
95
105
  "variant]___[value:primary]___[recipe:button"
96
106
  ],
97
- "iconButton": [
98
- "size]___[value:sm]___[recipe:iconButton",
99
- "variant]___[value:secondary]___[recipe:iconButton",
100
- "severity]___[value:none]___[recipe:iconButton",
101
- "size]___[value:md]___[recipe:iconButton",
102
- "variant]___[value:tertiary]___[recipe:iconButton",
103
- "variant]___[value:primary]___[recipe:iconButton"
104
- ],
105
107
  "formControl": [],
106
108
  "formLabel": [
107
109
  "variant]___[value:absolute]___[recipe:formLabel"
108
110
  ],
111
+ "tooltip": [],
109
112
  "text": [
110
113
  "size]___[value:md]___[recipe:text",
111
114
  "size]___[value:lg]___[recipe:text",
@@ -138,7 +141,6 @@
138
141
  "tabs": [
139
142
  "variant]___[value:line]___[recipe:tabs"
140
143
  ],
141
- "tooltip": [],
142
144
  "datepicker": [],
143
145
  "formHelperText": [],
144
146
  "select": [
@@ -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
+ })
@@ -19,7 +19,7 @@ export type FormLabelVariantProps = {
19
19
 
20
20
  export interface FormLabelRecipe {
21
21
  __type: FormLabelVariantProps
22
- (props?: FormLabelVariantProps): Pretty<Record<"root" | "addon", string>>
22
+ (props?: FormLabelVariantProps): Pretty<Record<"root" | "addon" | "icon", string>>
23
23
  raw: (props?: FormLabelVariantProps) => FormLabelVariantProps
24
24
  variantMap: FormLabelVariantMap
25
25
  variantKeys: Array<keyof FormLabelVariant>
@@ -14,6 +14,10 @@ const formLabelSlotNames = [
14
14
  [
15
15
  "addon",
16
16
  "form-label__addon"
17
+ ],
18
+ [
19
+ "icon",
20
+ "form-label__icon"
17
21
  ]
18
22
  ]
19
23
  const formLabelSlotFns = /* @__PURE__ */ formLabelSlotNames.map(([slotName, slotKey]) => [slotName, createRecipe(slotKey, formLabelDefaultVariants, getSlotCompoundVariant(formLabelCompoundVariants, slotName))])
@@ -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';