@stokelp/styled-system 2.0.0 → 2.2.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.0.0",
3
+ "version": "2.2.0",
4
4
  "description": "Stokelp UI styled-system",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -28,16 +28,16 @@
28
28
  "background]___[value:error.100]___[cond:_hover",
29
29
  "color]___[value:error.700]___[cond:_hover",
30
30
  "color]___[value:error.700]___[cond:_active",
31
+ "padding]___[value:space-8",
32
+ "textAlign]___[value:center",
33
+ "width]___[value:24",
34
+ "height]___[value:24",
35
+ "truncate]___[value:true",
31
36
  "cursor]___[value:pointer",
32
37
  "marginRight]___[value:space-4",
33
- "padding]___[value:space-8",
34
38
  "width]___[value:16",
35
39
  "height]___[value:16",
36
- "truncate]___[value:true",
37
- "width]___[value:24",
38
- "height]___[value:24",
39
40
  "paddingInline]___[value:space-8",
40
- "textAlign]___[value:center",
41
41
  "transitionProperty]___[value:opacity",
42
42
  "transitionDuration]___[value:fast",
43
43
  "opacity]___[value:0",
@@ -61,11 +61,11 @@
61
61
  "marginBlock]___[value:space-24",
62
62
  "width]___[value:100%",
63
63
  "gridTemplateColumns]___[value:repeat(3, 1fr)",
64
- "borderRadius]___[value:radius-24",
64
+ "gap]___[value:space-32",
65
65
  "padding]___[value:space-16",
66
+ "borderRadius]___[value:radius-24",
66
67
  "height]___[value:200",
67
68
  "width]___[value:400",
68
- "gap]___[value:space-32",
69
69
  "gap]___[value:space-8",
70
70
  "maxHeight]___[value:102",
71
71
  "overflowY]___[value:auto",
@@ -110,10 +110,16 @@
110
110
  "checkboxCard": [
111
111
  "size]___[value:md]___[recipe:checkboxCard"
112
112
  ],
113
- "inputGroup": [],
113
+ "text": [
114
+ "size]___[value:md]___[recipe:text",
115
+ "size]___[value:lg]___[recipe:text",
116
+ "size]___[value:sm]___[recipe:text",
117
+ "bold]___[value:true]___[recipe:text"
118
+ ],
114
119
  "input": [
115
120
  "size]___[value:md]___[recipe:input"
116
121
  ],
122
+ "inputGroup": [],
117
123
  "inputAddon": [],
118
124
  "button": [
119
125
  "size]___[value:sm]___[recipe:button",
@@ -128,12 +134,6 @@
128
134
  "variant]___[value:absolute]___[recipe:formLabel"
129
135
  ],
130
136
  "tooltip": [],
131
- "text": [
132
- "size]___[value:md]___[recipe:text",
133
- "size]___[value:lg]___[recipe:text",
134
- "size]___[value:sm]___[recipe:text",
135
- "bold]___[value:true]___[recipe:text"
136
- ],
137
137
  "switchRecipe": [
138
138
  "size]___[value:md]___[recipe:switchRecipe"
139
139
  ],
@@ -157,6 +157,9 @@
157
157
  ],
158
158
  "actionCard": [],
159
159
  "breadcrumb": [],
160
+ "combobox": [
161
+ "size]___[value:md]___[recipe:combobox"
162
+ ],
160
163
  "drawer": [
161
164
  "variant]___[value:right]___[recipe:drawer"
162
165
  ],
@@ -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 ComboboxVariant {
6
+ /**
7
+ * @default "md"
8
+ */
9
+ size: "md"
10
+ }
11
+
12
+ type ComboboxVariantMap = {
13
+ [key in keyof ComboboxVariant]: Array<ComboboxVariant[key]>
14
+ }
15
+
16
+ export type ComboboxVariantProps = {
17
+ [key in keyof ComboboxVariant]?: ConditionalValue<ComboboxVariant[key]> | undefined
18
+ }
19
+
20
+ export interface ComboboxRecipe {
21
+ __type: ComboboxVariantProps
22
+ (props?: ComboboxVariantProps): Pretty<Record<"root" | "clearTrigger" | "content" | "control" | "input" | "item" | "itemGroup" | "itemGroupLabel" | "itemIndicator" | "itemText" | "label" | "list" | "positioner" | "trigger", string>>
23
+ raw: (props?: ComboboxVariantProps) => ComboboxVariantProps
24
+ variantMap: ComboboxVariantMap
25
+ variantKeys: Array<keyof ComboboxVariant>
26
+ splitVariantProps<Props extends ComboboxVariantProps>(props: Props): [ComboboxVariantProps, Pretty<DistributiveOmit<Props, keyof ComboboxVariantProps>>]
27
+ getVariantProps: (props?: ComboboxVariantProps) => ComboboxVariantProps
28
+ }
29
+
30
+
31
+ export declare const combobox: ComboboxRecipe
@@ -0,0 +1,92 @@
1
+ import { compact, getSlotCompoundVariant, memo, splitProps } from '../helpers.mjs';
2
+ import { createRecipe } from './create-recipe.mjs';
3
+
4
+ const comboboxDefaultVariants = {
5
+ "size": "md"
6
+ }
7
+ const comboboxCompoundVariants = []
8
+
9
+ const comboboxSlotNames = [
10
+ [
11
+ "root",
12
+ "combobox__root"
13
+ ],
14
+ [
15
+ "clearTrigger",
16
+ "combobox__clearTrigger"
17
+ ],
18
+ [
19
+ "content",
20
+ "combobox__content"
21
+ ],
22
+ [
23
+ "control",
24
+ "combobox__control"
25
+ ],
26
+ [
27
+ "input",
28
+ "combobox__input"
29
+ ],
30
+ [
31
+ "item",
32
+ "combobox__item"
33
+ ],
34
+ [
35
+ "itemGroup",
36
+ "combobox__itemGroup"
37
+ ],
38
+ [
39
+ "itemGroupLabel",
40
+ "combobox__itemGroupLabel"
41
+ ],
42
+ [
43
+ "itemIndicator",
44
+ "combobox__itemIndicator"
45
+ ],
46
+ [
47
+ "itemText",
48
+ "combobox__itemText"
49
+ ],
50
+ [
51
+ "label",
52
+ "combobox__label"
53
+ ],
54
+ [
55
+ "list",
56
+ "combobox__list"
57
+ ],
58
+ [
59
+ "positioner",
60
+ "combobox__positioner"
61
+ ],
62
+ [
63
+ "trigger",
64
+ "combobox__trigger"
65
+ ]
66
+ ]
67
+ const comboboxSlotFns = /* @__PURE__ */ comboboxSlotNames.map(([slotName, slotKey]) => [slotName, createRecipe(slotKey, comboboxDefaultVariants, getSlotCompoundVariant(comboboxCompoundVariants, slotName))])
68
+
69
+ const comboboxFn = memo((props = {}) => {
70
+ return Object.fromEntries(comboboxSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]))
71
+ })
72
+
73
+ const comboboxVariantKeys = [
74
+ "size"
75
+ ]
76
+ const getVariantProps = (variants) => ({ ...comboboxDefaultVariants, ...compact(variants) })
77
+
78
+ export const combobox = /* @__PURE__ */ Object.assign(comboboxFn, {
79
+ __recipe__: false,
80
+ __name__: 'combobox',
81
+ raw: (props) => props,
82
+ variantKeys: comboboxVariantKeys,
83
+ variantMap: {
84
+ "size": [
85
+ "md"
86
+ ]
87
+ },
88
+ splitVariantProps(props) {
89
+ return splitProps(props, comboboxVariantKeys)
90
+ },
91
+ getVariantProps
92
+ })
@@ -37,4 +37,5 @@ export * from './pagination';
37
37
  export * from './product-card-catalog';
38
38
  export * from './switch-card';
39
39
  export * from './radio-card-group';
40
- export * from './checkbox-card';
40
+ export * from './checkbox-card';
41
+ export * from './combobox';
package/recipes/index.mjs CHANGED
@@ -36,4 +36,5 @@ export * from './pagination.mjs';
36
36
  export * from './product-card-catalog.mjs';
37
37
  export * from './switch-card.mjs';
38
38
  export * from './radio-card-group.mjs';
39
- export * from './checkbox-card.mjs';
39
+ export * from './checkbox-card.mjs';
40
+ export * from './combobox.mjs';