@vygruppen/spor-react 13.1.4 → 13.2.1

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.
@@ -1,43 +1,33 @@
1
1
  import { defineSlotRecipe } from "@chakra-ui/react";
2
2
 
3
- import { checkboxCardAnatomy } from "./anatomy";
3
+ import { radioCardAnatomy } from "./anatomy";
4
4
 
5
5
  export const choiceChipSlotRecipe = defineSlotRecipe({
6
- slots: checkboxCardAnatomy.keys(),
7
- className: "chakra-checkbox-card",
6
+ className: "spor-choice-chip",
7
+ slots: radioCardAnatomy.keys(),
8
8
  base: {
9
9
  root: {
10
- display: "inline-flex",
11
- alignItems: "center",
12
- boxAlign: "center",
13
- cursor: "pointer",
10
+ display: "flex",
11
+ flexDirection: "row",
12
+ gap: "1",
13
+ width: "fit-content",
14
+ },
15
+ item: {
16
+ display: "flex-inline",
14
17
  transitionProperty: "all",
15
- borderRadius: "xl",
16
18
  transitionDuration: "fast",
17
- paddingInlineStart: "2",
18
- paddingInlineEnd: "2",
19
19
 
20
- outline: "1px solid",
21
- outlineColor: "outline.core",
22
20
  _checked: {
23
- backgroundColor: "surface.brand",
24
- borderRadius: "sm",
25
21
  outline: "none",
26
- color: "text.brand",
22
+ _focusVisible: {
23
+ outline: "2px solid",
24
+ outlineColor: "outline.focus",
25
+ outlineOffset: "1px",
26
+ },
27
27
  _hover: {
28
- backgroundColor: "surface.brand.hover",
29
- _active: {
30
- backgroundColor: "surface.brand.active",
31
- },
28
+ outline: "none",
32
29
  },
33
30
  },
34
-
35
- _focusVisible: {
36
- outline: "2px solid",
37
- outlineColor: "outline.focus",
38
- outlineOffset: "1px",
39
- },
40
-
41
31
  _disabled: {
42
32
  pointerEvents: "none",
43
33
  boxShadow: "none",
@@ -63,34 +53,44 @@ export const choiceChipSlotRecipe = defineSlotRecipe({
63
53
  },
64
54
  },
65
55
  },
66
-
56
+ itemControl: {
57
+ display: "flex",
58
+ alignItems: "center",
59
+ justifyContent: "center",
60
+ },
67
61
  label: {
68
62
  display: "flex",
69
63
  alignItems: "center",
64
+ justifyContent: "center",
70
65
  gap: "1",
71
66
  },
72
67
  },
73
-
74
68
  variants: {
75
69
  size: {
76
70
  xs: {
77
- root: {
71
+ item: {
72
+ borderRadius: "xl",
78
73
  _checked: {
79
- borderRadius: "0.563rem",
74
+ borderRadius: "9px",
80
75
  },
76
+ },
77
+ itemControl: {
81
78
  height: 5,
82
79
  paddingX: 1.5,
83
80
  },
84
81
  label: {
85
82
  fontSize: { base: "mobile.sm", sm: "desktop.sm" },
86
- fontWeight: "medium",
83
+ fontWeight: "regular",
87
84
  },
88
85
  },
89
86
  sm: {
90
- root: {
87
+ item: {
88
+ borderRadius: "xl",
91
89
  _checked: {
92
90
  borderRadius: "sm",
93
91
  },
92
+ },
93
+ itemControl: {
94
94
  height: 6,
95
95
  paddingX: 2,
96
96
  },
@@ -100,10 +100,13 @@ export const choiceChipSlotRecipe = defineSlotRecipe({
100
100
  },
101
101
  },
102
102
  md: {
103
- root: {
103
+ item: {
104
+ borderRadius: "xl",
104
105
  _checked: {
105
106
  borderRadius: "sm",
106
107
  },
108
+ },
109
+ itemControl: {
107
110
  height: 7,
108
111
  paddingX: 2,
109
112
  },
@@ -113,10 +116,13 @@ export const choiceChipSlotRecipe = defineSlotRecipe({
113
116
  },
114
117
  },
115
118
  lg: {
116
- root: {
119
+ item: {
120
+ borderRadius: "xl",
117
121
  _checked: {
118
122
  borderRadius: "md",
119
123
  },
124
+ },
125
+ itemControl: {
120
126
  height: 8,
121
127
  paddingX: 3,
122
128
  },
@@ -126,13 +132,20 @@ export const choiceChipSlotRecipe = defineSlotRecipe({
126
132
  },
127
133
  },
128
134
  },
129
-
130
135
  variant: {
131
136
  core: {
132
- root: {
133
- color: "text.core",
134
- outlineColor: "outline.core",
135
-
137
+ itemControl: {
138
+ _checked: {
139
+ backgroundColor: "surface.brand",
140
+ color: "text.brand",
141
+ outline: "none",
142
+ _hover: {
143
+ backgroundColor: "surface.brand.hover",
144
+ _active: {
145
+ backgroundColor: "surface.brand.active",
146
+ },
147
+ },
148
+ },
136
149
  _hover: {
137
150
  outline: "2px solid",
138
151
  outlineColor: "outline.core.hover",
@@ -146,11 +159,22 @@ export const choiceChipSlotRecipe = defineSlotRecipe({
146
159
  },
147
160
  },
148
161
  accent: {
149
- root: {
162
+ itemControl: {
150
163
  backgroundColor: "surface.accent",
151
164
  color: "text.accent",
152
165
  outline: "none",
153
-
166
+ border: "none",
167
+ _checked: {
168
+ backgroundColor: "surface.brand",
169
+ color: "text.brand",
170
+ outline: "none",
171
+ _hover: {
172
+ backgroundColor: "surface.brand.hover",
173
+ _active: {
174
+ backgroundColor: "surface.brand.active",
175
+ },
176
+ },
177
+ },
154
178
  _hover: {
155
179
  backgroundColor: "surface.accent.hover",
156
180
 
@@ -161,13 +185,24 @@ export const choiceChipSlotRecipe = defineSlotRecipe({
161
185
  },
162
186
  },
163
187
  floating: {
164
- root: {
188
+ itemControl: {
165
189
  backgroundColor: "surface.floating",
166
190
  outline: "1px solid",
167
191
  outlineColor: "outline.floating",
168
192
  color: "text.floating",
169
193
 
170
194
  boxShadow: "sm",
195
+ _checked: {
196
+ backgroundColor: "surface.brand",
197
+ color: "text.brand",
198
+ outline: "none",
199
+ _hover: {
200
+ backgroundColor: "surface.brand.hover",
201
+ _active: {
202
+ backgroundColor: "surface.brand.active",
203
+ },
204
+ },
205
+ },
171
206
  _hover: {
172
207
  backgroundColor: "surface.floating.hover",
173
208
  outline: "1px solid",
@@ -182,16 +217,9 @@ export const choiceChipSlotRecipe = defineSlotRecipe({
182
217
  },
183
218
  },
184
219
  },
185
- chipType: {
186
- icon: {},
187
- choice: {},
188
- filter: {},
189
- },
190
220
  },
191
-
192
221
  defaultVariants: {
193
222
  size: "sm",
194
223
  variant: "core",
195
- chipType: "choice",
196
224
  },
197
225
  });
@@ -0,0 +1,197 @@
1
+ import { defineSlotRecipe } from "@chakra-ui/react";
2
+
3
+ import { checkboxCardAnatomy } from "./anatomy";
4
+
5
+ export const filterChipSlotRecipe = defineSlotRecipe({
6
+ slots: checkboxCardAnatomy.keys(),
7
+ className: "chakra-checkbox-card",
8
+ base: {
9
+ root: {
10
+ display: "inline-flex",
11
+ alignItems: "center",
12
+ boxAlign: "center",
13
+ cursor: "pointer",
14
+ transitionProperty: "all",
15
+ borderRadius: "xl",
16
+ transitionDuration: "fast",
17
+ paddingInlineStart: "2",
18
+ paddingInlineEnd: "2",
19
+
20
+ outline: "1px solid",
21
+ outlineColor: "outline.core",
22
+ _checked: {
23
+ backgroundColor: "surface.brand",
24
+ borderRadius: "sm",
25
+ outline: "none",
26
+ color: "text.brand",
27
+ _hover: {
28
+ outline: "none",
29
+ backgroundColor: "surface.brand.hover",
30
+ _active: {
31
+ backgroundColor: "surface.brand.active",
32
+ },
33
+ },
34
+ },
35
+
36
+ _focusVisible: {
37
+ outline: "2px solid",
38
+ outlineColor: "outline.focus",
39
+ outlineOffset: "1px",
40
+ },
41
+
42
+ _disabled: {
43
+ pointerEvents: "none",
44
+ boxShadow: "none",
45
+ backgroundColor: "surface.disabled",
46
+ color: "text.disabled",
47
+ outline: "none",
48
+
49
+ _hover: {
50
+ backgroundColor: "surface.disabled",
51
+ boxShadow: "none",
52
+ color: "text.disabled",
53
+ },
54
+ _checked: {
55
+ cursor: "not-allowed",
56
+ boxShadow: "none",
57
+ color: "text.disabled",
58
+ backgroundColor: "surface.disabled",
59
+ _hover: {
60
+ backgroundColor: "surface.disabled",
61
+ boxShadow: "none",
62
+ color: "text.disabled",
63
+ },
64
+ },
65
+ },
66
+ },
67
+
68
+ label: {
69
+ display: "flex",
70
+ alignItems: "center",
71
+ gap: "1",
72
+ },
73
+ },
74
+
75
+ variants: {
76
+ size: {
77
+ xs: {
78
+ root: {
79
+ _checked: {
80
+ borderRadius: "0.563rem",
81
+ },
82
+ height: 5,
83
+ paddingX: 1.5,
84
+ },
85
+ label: {
86
+ fontSize: { base: "mobile.sm", sm: "desktop.sm" },
87
+ fontWeight: "medium",
88
+ },
89
+ },
90
+ sm: {
91
+ root: {
92
+ _checked: {
93
+ borderRadius: "sm",
94
+ },
95
+ height: 6,
96
+ paddingX: 2,
97
+ },
98
+ label: {
99
+ fontSize: { base: "mobile.sm", sm: "desktop.sm" },
100
+ fontWeight: "bold",
101
+ },
102
+ },
103
+ md: {
104
+ root: {
105
+ _checked: {
106
+ borderRadius: "sm",
107
+ },
108
+ height: 7,
109
+ paddingX: 2,
110
+ },
111
+ label: {
112
+ fontSize: { base: "mobile.md", sm: "desktop.md" },
113
+ fontWeight: "bold",
114
+ },
115
+ },
116
+ lg: {
117
+ root: {
118
+ _checked: {
119
+ borderRadius: "md",
120
+ },
121
+ height: 8,
122
+ paddingX: 3,
123
+ },
124
+ label: {
125
+ fontSize: { base: "mobile.md", sm: "desktop.md" },
126
+ fontWeight: "bold",
127
+ },
128
+ },
129
+ },
130
+
131
+ variant: {
132
+ core: {
133
+ root: {
134
+ color: "text.core",
135
+ outlineColor: "outline.core",
136
+
137
+ _hover: {
138
+ outline: "2px solid",
139
+ outlineColor: "outline.core.hover",
140
+ _active: {
141
+ outline: "1px solid",
142
+ outlineColor: "outline.core",
143
+ backgroundColor: "surface.core.active",
144
+ },
145
+ },
146
+ },
147
+ },
148
+ accent: {
149
+ root: {
150
+ backgroundColor: "surface.accent",
151
+ color: "text.accent",
152
+ outline: "none",
153
+
154
+ _hover: {
155
+ backgroundColor: "surface.accent.hover",
156
+
157
+ _active: {
158
+ backgroundColor: "surface.accent.active",
159
+ },
160
+ },
161
+ },
162
+ },
163
+ floating: {
164
+ root: {
165
+ backgroundColor: "surface.floating",
166
+ outline: "1px solid",
167
+ outlineColor: "outline.floating",
168
+ color: "text.floating",
169
+
170
+ boxShadow: "sm",
171
+ _hover: {
172
+ backgroundColor: "surface.floating.hover",
173
+ outline: "1px solid",
174
+ outlineColor: "outline.floating.hover",
175
+
176
+ _active: {
177
+ backgroundColor: "surface.floating.active",
178
+ outline: "1px solid",
179
+ outlineColor: "outline.floating",
180
+ },
181
+ },
182
+ },
183
+ },
184
+ },
185
+ chipType: {
186
+ icon: {},
187
+ choice: {},
188
+ filter: {},
189
+ },
190
+ },
191
+
192
+ defaultVariants: {
193
+ size: "sm",
194
+ variant: "core",
195
+ chipType: "choice",
196
+ },
197
+ });
@@ -11,6 +11,7 @@ import { datePickerSlotRecipe } from "./datepicker";
11
11
  import { dialogSlotRecipe } from "./dialog";
12
12
  import { drawerSlotRecipe } from "./drawer";
13
13
  import { fieldSlotRecipe } from "./field";
14
+ import { filterChipSlotRecipe } from "./filter-chip";
14
15
  import { floatingActionButtonSlotRecipe } from "./floating-action-button";
15
16
  import { infoTagSlotRecipe } from "./info-tag";
16
17
  import { inputChipSlotRecipe } from "./input-chip";
@@ -68,9 +69,10 @@ export const slotRecipes = {
68
69
  tabs: tabsSlotRecipe,
69
70
  travelTag: travelTagSlotRecipe,
70
71
  toast: toastSlotRecipe,
71
- checkboxCard: choiceChipSlotRecipe,
72
+ checkboxCard: filterChipSlotRecipe,
72
73
  collapsible: collapsibleSlotRecipe,
73
74
  tooltip: popoverSlotRecipe,
74
75
  tag: inputChipSlotRecipe,
75
76
  menu: menuSlotRecipe,
77
+ choiceChip: choiceChipSlotRecipe,
76
78
  };
@@ -11,16 +11,17 @@ export const numericStepperRecipe = defineSlotRecipe({
11
11
  display: "flex",
12
12
  flexDirection: "row",
13
13
  alignItems: "center",
14
+ gap: 1,
14
15
  },
15
16
  },
16
17
  input: {
17
18
  fontSize: "sm",
18
19
  fontWeight: "bold",
19
- marginX: 0.5,
20
20
  padding: 0,
21
21
  paddingX: 0.5,
22
22
  borderRadius: "xs",
23
- outline: "none",
23
+ outline: "1px solid",
24
+ outlineColor: "outline.core",
24
25
  height: "auto",
25
26
  textAlign: "center",
26
27
  transitionProperty: "common",