@stokelp/styled-system 1.15.0 → 1.16.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.15.0",
3
+ "version": "1.16.0",
4
4
  "description": "Stokelp UI styled-system",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -0,0 +1,39 @@
1
+ /* eslint-disable */
2
+ import type { ConditionalValue } from '../types/index';
3
+ import type { DistributiveOmit, Pretty } from '../types/system-types';
4
+
5
+ interface ChipVariant {
6
+ /**
7
+ * @default "md"
8
+ */
9
+ size: "lg" | "md" | "sm"
10
+ /**
11
+ * @default "secondary"
12
+ */
13
+ colorScheme: "secondary" | "grey" | "red" | "yellow" | "green" | "blue" | "purple" | "brown"
14
+ }
15
+
16
+ type ChipVariantMap = {
17
+ [key in keyof ChipVariant]: Array<ChipVariant[key]>
18
+ }
19
+
20
+ export type ChipVariantProps = {
21
+ [key in keyof ChipVariant]?: ConditionalValue<ChipVariant[key]> | undefined
22
+ }
23
+
24
+ export interface ChipRecipe {
25
+ __type: ChipVariantProps
26
+ (props?: ChipVariantProps): Pretty<Record<"root" | "avatar" | "body" | "clearTrigger", string>>
27
+ raw: (props?: ChipVariantProps) => ChipVariantProps
28
+ variantMap: ChipVariantMap
29
+ variantKeys: Array<keyof ChipVariant>
30
+ splitVariantProps<Props extends ChipVariantProps>(props: Props): [ChipVariantProps, Pretty<DistributiveOmit<Props, keyof ChipVariantProps>>]
31
+ getVariantProps: (props?: ChipVariantProps) => ChipVariantProps
32
+ }
33
+
34
+ /**
35
+ * The styles for the Chip component
36
+
37
+
38
+ */
39
+ export declare const chip: ChipRecipe
@@ -0,0 +1,66 @@
1
+ import { compact, getSlotCompoundVariant, memo, splitProps } from '../helpers.mjs';
2
+ import { createRecipe } from './create-recipe.mjs';
3
+
4
+ const chipDefaultVariants = {
5
+ "size": "md",
6
+ "colorScheme": "secondary"
7
+ }
8
+ const chipCompoundVariants = []
9
+
10
+ const chipSlotNames = [
11
+ [
12
+ "root",
13
+ "chip__root"
14
+ ],
15
+ [
16
+ "avatar",
17
+ "chip__avatar"
18
+ ],
19
+ [
20
+ "body",
21
+ "chip__body"
22
+ ],
23
+ [
24
+ "clearTrigger",
25
+ "chip__clearTrigger"
26
+ ]
27
+ ]
28
+ const chipSlotFns = /* @__PURE__ */ chipSlotNames.map(([slotName, slotKey]) => [slotName, createRecipe(slotKey, chipDefaultVariants, getSlotCompoundVariant(chipCompoundVariants, slotName))])
29
+
30
+ const chipFn = memo((props = {}) => {
31
+ return Object.fromEntries(chipSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]))
32
+ })
33
+
34
+ const chipVariantKeys = [
35
+ "size",
36
+ "colorScheme"
37
+ ]
38
+ const getVariantProps = (variants) => ({ ...chipDefaultVariants, ...compact(variants) })
39
+
40
+ export const chip = /* @__PURE__ */ Object.assign(chipFn, {
41
+ __recipe__: false,
42
+ __name__: 'chip',
43
+ raw: (props) => props,
44
+ variantKeys: chipVariantKeys,
45
+ variantMap: {
46
+ "size": [
47
+ "lg",
48
+ "md",
49
+ "sm"
50
+ ],
51
+ "colorScheme": [
52
+ "secondary",
53
+ "grey",
54
+ "red",
55
+ "yellow",
56
+ "green",
57
+ "blue",
58
+ "purple",
59
+ "brown"
60
+ ]
61
+ },
62
+ splitVariantProps(props) {
63
+ return splitProps(props, chipVariantKeys)
64
+ },
65
+ getVariantProps
66
+ })
@@ -19,4 +19,5 @@ export * from './datepicker';
19
19
  export * from './tabs';
20
20
  export * from './tag';
21
21
  export * from './select';
22
+ export * from './chip';
22
23
  export * from './action-card';
package/recipes/index.mjs CHANGED
@@ -18,4 +18,5 @@ export * from './datepicker.mjs';
18
18
  export * from './tabs.mjs';
19
19
  export * from './tag.mjs';
20
20
  export * from './select.mjs';
21
+ export * from './chip.mjs';
21
22
  export * from './action-card.mjs';