@stokelp/styled-system 1.11.0 → 1.12.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.11.0",
3
+ "version": "1.12.0",
4
4
  "description": "Stokelp UI styled-system",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -48,7 +48,8 @@
48
48
  "gap]___[value:space-16",
49
49
  "borderColor]___[value:primary.100",
50
50
  "marginBlock]___[value:space-24",
51
- "gap]___[value:10px"
51
+ "gap]___[value:10px",
52
+ "flexDirection]___[value:row"
52
53
  ],
53
54
  "recipes": {
54
55
  "checkbox": [
@@ -96,6 +97,9 @@
96
97
  "variant]___[value:right]___[recipe:drawer"
97
98
  ],
98
99
  "radioButtonGroup": [],
100
+ "radioGroup": [
101
+ "size]___[value:md]___[recipe:radioGroup"
102
+ ],
99
103
  "tabs": [
100
104
  "variant]___[value:line]___[recipe:tabs"
101
105
  ],
@@ -11,6 +11,7 @@ export * from './input-addon';
11
11
  export * from './input-group';
12
12
  export * from './drawer';
13
13
  export * from './radio-button-group';
14
+ export * from './radio-group';
14
15
  export * from './accordion';
15
16
  export * from './form-label';
16
17
  export * from './checkbox';
package/recipes/index.mjs CHANGED
@@ -10,6 +10,7 @@ export * from './input-addon.mjs';
10
10
  export * from './input-group.mjs';
11
11
  export * from './drawer.mjs';
12
12
  export * from './radio-button-group.mjs';
13
+ export * from './radio-group.mjs';
13
14
  export * from './accordion.mjs';
14
15
  export * from './form-label.mjs';
15
16
  export * from './checkbox.mjs';
@@ -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 RadioGroupVariant {
6
+ /**
7
+ * @default "md"
8
+ */
9
+ size: "md"
10
+ }
11
+
12
+ type RadioGroupVariantMap = {
13
+ [key in keyof RadioGroupVariant]: Array<RadioGroupVariant[key]>
14
+ }
15
+
16
+ export type RadioGroupVariantProps = {
17
+ [key in keyof RadioGroupVariant]?: ConditionalValue<RadioGroupVariant[key]> | undefined
18
+ }
19
+
20
+ export interface RadioGroupRecipe {
21
+ __type: RadioGroupVariantProps
22
+ (props?: RadioGroupVariantProps): Pretty<Record<"root" | "label" | "item" | "itemText" | "itemControl" | "indicator", string>>
23
+ raw: (props?: RadioGroupVariantProps) => RadioGroupVariantProps
24
+ variantMap: RadioGroupVariantMap
25
+ variantKeys: Array<keyof RadioGroupVariant>
26
+ splitVariantProps<Props extends RadioGroupVariantProps>(props: Props): [RadioGroupVariantProps, Pretty<DistributiveOmit<Props, keyof RadioGroupVariantProps>>]
27
+ getVariantProps: (props?: RadioGroupVariantProps) => RadioGroupVariantProps
28
+ }
29
+
30
+
31
+ export declare const radioGroup: RadioGroupRecipe
@@ -0,0 +1,60 @@
1
+ import { compact, getSlotCompoundVariant, memo, splitProps } from '../helpers.mjs';
2
+ import { createRecipe } from './create-recipe.mjs';
3
+
4
+ const radioGroupDefaultVariants = {
5
+ "size": "md"
6
+ }
7
+ const radioGroupCompoundVariants = []
8
+
9
+ const radioGroupSlotNames = [
10
+ [
11
+ "root",
12
+ "radio-group__root"
13
+ ],
14
+ [
15
+ "label",
16
+ "radio-group__label"
17
+ ],
18
+ [
19
+ "item",
20
+ "radio-group__item"
21
+ ],
22
+ [
23
+ "itemText",
24
+ "radio-group__itemText"
25
+ ],
26
+ [
27
+ "itemControl",
28
+ "radio-group__itemControl"
29
+ ],
30
+ [
31
+ "indicator",
32
+ "radio-group__indicator"
33
+ ]
34
+ ]
35
+ const radioGroupSlotFns = /* @__PURE__ */ radioGroupSlotNames.map(([slotName, slotKey]) => [slotName, createRecipe(slotKey, radioGroupDefaultVariants, getSlotCompoundVariant(radioGroupCompoundVariants, slotName))])
36
+
37
+ const radioGroupFn = memo((props = {}) => {
38
+ return Object.fromEntries(radioGroupSlotFns.map(([slotName, slotFn]) => [slotName, slotFn.recipeFn(props)]))
39
+ })
40
+
41
+ const radioGroupVariantKeys = [
42
+ "size"
43
+ ]
44
+ const getVariantProps = (variants) => ({ ...radioGroupDefaultVariants, ...compact(variants) })
45
+
46
+ export const radioGroup = /* @__PURE__ */ Object.assign(radioGroupFn, {
47
+ __recipe__: false,
48
+ __name__: 'radioGroup',
49
+ raw: (props) => props,
50
+ variantKeys: radioGroupVariantKeys,
51
+ variantMap: {
52
+ "size": [
53
+ "md"
54
+ ]
55
+ },
56
+ splitVariantProps(props) {
57
+ return splitProps(props, radioGroupVariantKeys)
58
+ },
59
+ getVariantProps
60
+ })