@vygruppen/spor-react 13.1.4 → 13.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.
@@ -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
  };