@vygruppen/spor-react 9.8.1 → 9.8.2
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/.turbo/turbo-build.log +9 -9
- package/CHANGELOG.md +8 -0
- package/dist/{CountryCodeSelect-FODJ4ZSF.mjs → CountryCodeSelect-46ZPAYGJ.mjs} +1 -1
- package/dist/{chunk-S335RZ6M.mjs → chunk-4QF4PJTK.mjs} +16 -13
- package/dist/index.d.mts +13 -13
- package/dist/index.d.ts +13 -13
- package/dist/index.js +16 -12
- package/dist/index.mjs +1 -1
- package/package.json +2 -2
- package/src/input/CardSelect.tsx +5 -3
- package/src/layout/PressableCard.tsx +21 -18
- package/src/layout/Stack.tsx +2 -2
- package/src/nudge/Nudge.tsx +1 -1
- package/src/nudge/WizardNudge.tsx +2 -2
- package/src/theme/components/pressable-card.ts +3 -1
- package/src/theme/components/static-card.ts +6 -3
package/.turbo/turbo-build.log
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
|
2
|
-
> @vygruppen/spor-react@9.8.
|
2
|
+
> @vygruppen/spor-react@9.8.2 build
|
3
3
|
> tsup src/index.tsx --dts --treeshake --format cjs,esm
|
4
4
|
|
5
5
|
[34mCLI[39m Building entry: src/index.tsx
|
@@ -9,12 +9,12 @@
|
|
9
9
|
[34mCJS[39m Build start
|
10
10
|
[34mESM[39m Build start
|
11
11
|
[34mDTS[39m Build start
|
12
|
-
[32mCJS[39m [1mdist/index.js [22m[32m508.
|
13
|
-
[32mCJS[39m ⚡️ Build success in
|
12
|
+
[32mCJS[39m [1mdist/index.js [22m[32m508.50 KB[39m
|
13
|
+
[32mCJS[39m ⚡️ Build success in 2284ms
|
14
14
|
[32mESM[39m [1mdist/index.mjs [22m[32m2.11 KB[39m
|
15
|
-
[32mESM[39m [1mdist/
|
16
|
-
[32mESM[39m [1mdist/
|
17
|
-
[32mESM[39m ⚡️ Build success in
|
18
|
-
[32mDTS[39m ⚡️ Build success in
|
19
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[32m337.
|
20
|
-
[32mDTS[39m [1mdist/index.d.mts [22m[32m337.
|
15
|
+
[32mESM[39m [1mdist/CountryCodeSelect-46ZPAYGJ.mjs [22m[32m1.19 KB[39m
|
16
|
+
[32mESM[39m [1mdist/chunk-4QF4PJTK.mjs [22m[32m397.96 KB[39m
|
17
|
+
[32mESM[39m ⚡️ Build success in 2286ms
|
18
|
+
[32mDTS[39m ⚡️ Build success in 11777ms
|
19
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m337.72 KB[39m
|
20
|
+
[32mDTS[39m [1mdist/index.d.mts [22m[32m337.72 KB[39m
|
package/CHANGELOG.md
CHANGED
@@ -845,15 +845,14 @@ var StaticCard = forwardRef(
|
|
845
845
|
return /* @__PURE__ */ React73__default.createElement(Box, { __css: styles3, ...props, ref }, children, /* @__PURE__ */ React73__default.createElement(Card, null));
|
846
846
|
}
|
847
847
|
);
|
848
|
-
var PressableCard = (
|
849
|
-
children,
|
850
|
-
|
851
|
-
|
852
|
-
|
853
|
-
|
854
|
-
|
855
|
-
|
856
|
-
};
|
848
|
+
var PressableCard = forwardRef(
|
849
|
+
({ children, variant = "base", ...props }, ref) => {
|
850
|
+
const styles3 = useStyleConfig("PressableCard", {
|
851
|
+
variant
|
852
|
+
});
|
853
|
+
return /* @__PURE__ */ React73__default.createElement(Box, { __css: styles3, ...props, ref }, children);
|
854
|
+
}
|
855
|
+
);
|
857
856
|
var AccordionContext = React73__default.createContext(null);
|
858
857
|
var AccordionProvider = ({
|
859
858
|
size: size2,
|
@@ -2637,10 +2636,12 @@ var CardSelect = forwardRef(
|
|
2637
2636
|
placement
|
2638
2637
|
},
|
2639
2638
|
/* @__PURE__ */ React73__default.createElement(
|
2640
|
-
|
2639
|
+
StaticCard,
|
2641
2640
|
{
|
2642
2641
|
colorScheme: "white",
|
2643
2642
|
size: "lg",
|
2643
|
+
border: "sm",
|
2644
|
+
borderColor: "grey",
|
2644
2645
|
sx: styles3.card,
|
2645
2646
|
...overlayProps
|
2646
2647
|
},
|
@@ -3427,7 +3428,7 @@ var texts14 = createTexts({
|
|
3427
3428
|
sv: "Telefonnummer"
|
3428
3429
|
}
|
3429
3430
|
});
|
3430
|
-
var LazyCountryCodeSelect = React73__default.lazy(() => import('./CountryCodeSelect-
|
3431
|
+
var LazyCountryCodeSelect = React73__default.lazy(() => import('./CountryCodeSelect-46ZPAYGJ.mjs'));
|
3431
3432
|
var Radio = forwardRef((props, ref) => {
|
3432
3433
|
return /* @__PURE__ */ React73__default.createElement(Radio$1, { ...props, ref });
|
3433
3434
|
});
|
@@ -13660,8 +13661,8 @@ var getColorSchemeBaseProps2 = (props) => {
|
|
13660
13661
|
switch (props.colorScheme) {
|
13661
13662
|
case "white":
|
13662
13663
|
return {
|
13663
|
-
|
13664
|
-
color: "
|
13664
|
+
...floatingBackground("default", props),
|
13665
|
+
color: mode("text.default.light", "text.default.dark")(props)
|
13665
13666
|
};
|
13666
13667
|
case "grey":
|
13667
13668
|
return {
|
@@ -13708,6 +13709,7 @@ var config44 = defineStyleConfig$1({
|
|
13708
13709
|
fontSize: "inherit",
|
13709
13710
|
display: "block",
|
13710
13711
|
borderRadius: "md",
|
13712
|
+
cursor: "pointer",
|
13711
13713
|
...focusVisibleStyles(props),
|
13712
13714
|
_disabled: {
|
13713
13715
|
...baseBackground("disabled", props),
|
@@ -13744,6 +13746,7 @@ var config44 = defineStyleConfig$1({
|
|
13744
13746
|
boxShadow: "sm",
|
13745
13747
|
_hover: {
|
13746
13748
|
...floatingBackground("hover", props),
|
13749
|
+
...floatingBorder("hover", props),
|
13747
13750
|
boxShadow: "md"
|
13748
13751
|
},
|
13749
13752
|
_active: {
|
package/dist/index.d.mts
CHANGED
@@ -58,8 +58,8 @@ type StackProps = Exclude<StackProps$1, "direction"> & {
|
|
58
58
|
*
|
59
59
|
* ```tsx
|
60
60
|
* <Stack spacing={4}>
|
61
|
-
* <
|
62
|
-
* <
|
61
|
+
* <StaticCard>Here's one card</StaticCard>
|
62
|
+
* <StaticCard>Here's another card, with a lot of space between it</StaticCard>
|
63
63
|
* </Stack>
|
64
64
|
* ```
|
65
65
|
*/
|
@@ -209,11 +209,9 @@ type StaticCardProps = BoxProps & {
|
|
209
209
|
*/
|
210
210
|
declare const StaticCard: _chakra_ui_system_dist_system_types.ComponentWithAs<As, StaticCardProps>;
|
211
211
|
|
212
|
-
type PressableCardProps =
|
212
|
+
type PressableCardProps = BoxProps & {
|
213
213
|
/** Defaults to "base" */
|
214
214
|
variant: "floating" | "accent" | "base";
|
215
|
-
/** Defaults to "button" */
|
216
|
-
as: "button" | "a" | "label";
|
217
215
|
};
|
218
216
|
/**
|
219
217
|
* `PressableCard` is a component that renders a pressable card.
|
@@ -222,7 +220,6 @@ type PressableCardProps = Omit<BoxProps, "as"> & {
|
|
222
220
|
* It can be rendered as a button, link, label, or any other HTML element by specifying the `as` prop.
|
223
221
|
* If no `as` prop is provided, it defaults to a button.
|
224
222
|
*
|
225
|
-
* The `size` prop can be used to control the size of the card. It defaults to "sm".
|
226
223
|
* The `variant` prop can be used to control the style variant of the card. It defaults to "base".
|
227
224
|
*
|
228
225
|
* Example usage:
|
@@ -245,7 +242,7 @@ type PressableCardProps = Omit<BoxProps, "as"> & {
|
|
245
242
|
*
|
246
243
|
* @see StaticCard
|
247
244
|
*/
|
248
|
-
declare const PressableCard:
|
245
|
+
declare const PressableCard: _chakra_ui_system_dist_system_types.ComponentWithAs<As, PressableCardProps>;
|
249
246
|
|
250
247
|
type AccordionProps = Omit<AccordionProps$1, "variant" | "size"> & {
|
251
248
|
/**
|
@@ -2109,7 +2106,7 @@ type NudgeProps = {
|
|
2109
2106
|
* name="my-nudge"
|
2110
2107
|
* content="Check out this enormous new feature!"
|
2111
2108
|
* >
|
2112
|
-
* <
|
2109
|
+
* <StaticCard variant="base" padding={2} width="fit-content">My new feature</StaticCard>
|
2113
2110
|
* </Nudge>
|
2114
2111
|
* ```
|
2115
2112
|
*/
|
@@ -2134,9 +2131,9 @@ type WizardNudgeProps = Omit<NudgeProps, "actions" | "content"> & {
|
|
2134
2131
|
* name="my-wizard-nudge"
|
2135
2132
|
* introducedDate="2024-02-19"
|
2136
2133
|
* >
|
2137
|
-
* <
|
2134
|
+
* <StaticCard width="fit-content" padding={2}>
|
2138
2135
|
* My new feature
|
2139
|
-
* </
|
2136
|
+
* </StaticCard>
|
2140
2137
|
* </WizardNudge>
|
2141
2138
|
* ```
|
2142
2139
|
*/
|
@@ -7185,8 +7182,8 @@ declare const theme: {
|
|
7185
7182
|
};
|
7186
7183
|
StaticCard: {
|
7187
7184
|
baseStyle?: ((props: any) => {
|
7188
|
-
backgroundColor: string;
|
7189
7185
|
color: string;
|
7186
|
+
backgroundColor: string;
|
7190
7187
|
_focusVisible: {
|
7191
7188
|
outlineWidth: string;
|
7192
7189
|
outlineColor: string;
|
@@ -7200,8 +7197,7 @@ declare const theme: {
|
|
7200
7197
|
display: string;
|
7201
7198
|
borderRadius: string;
|
7202
7199
|
} | {
|
7203
|
-
backgroundColor:
|
7204
|
-
color: string;
|
7200
|
+
backgroundColor: any;
|
7205
7201
|
_focusVisible: {
|
7206
7202
|
outlineWidth: string;
|
7207
7203
|
outlineColor: string;
|
@@ -7214,6 +7210,7 @@ declare const theme: {
|
|
7214
7210
|
fontSize: string;
|
7215
7211
|
display: string;
|
7216
7212
|
borderRadius: string;
|
7213
|
+
color: string;
|
7217
7214
|
}) | undefined;
|
7218
7215
|
sizes?: {
|
7219
7216
|
[key: string]: _chakra_ui_styled_system.SystemStyleInterpolation;
|
@@ -7247,6 +7244,7 @@ declare const theme: {
|
|
7247
7244
|
fontSize: string;
|
7248
7245
|
display: string;
|
7249
7246
|
borderRadius: string;
|
7247
|
+
cursor: string;
|
7250
7248
|
}) | undefined;
|
7251
7249
|
sizes?: {
|
7252
7250
|
[key: string]: _chakra_ui_styled_system.SystemStyleInterpolation;
|
@@ -7317,6 +7315,8 @@ declare const theme: {
|
|
7317
7315
|
boxShadow: string;
|
7318
7316
|
_hover: {
|
7319
7317
|
boxShadow: string;
|
7318
|
+
outline: string;
|
7319
|
+
outlineColor: string;
|
7320
7320
|
backgroundColor: string;
|
7321
7321
|
};
|
7322
7322
|
_active: {
|
package/dist/index.d.ts
CHANGED
@@ -58,8 +58,8 @@ type StackProps = Exclude<StackProps$1, "direction"> & {
|
|
58
58
|
*
|
59
59
|
* ```tsx
|
60
60
|
* <Stack spacing={4}>
|
61
|
-
* <
|
62
|
-
* <
|
61
|
+
* <StaticCard>Here's one card</StaticCard>
|
62
|
+
* <StaticCard>Here's another card, with a lot of space between it</StaticCard>
|
63
63
|
* </Stack>
|
64
64
|
* ```
|
65
65
|
*/
|
@@ -209,11 +209,9 @@ type StaticCardProps = BoxProps & {
|
|
209
209
|
*/
|
210
210
|
declare const StaticCard: _chakra_ui_system_dist_system_types.ComponentWithAs<As, StaticCardProps>;
|
211
211
|
|
212
|
-
type PressableCardProps =
|
212
|
+
type PressableCardProps = BoxProps & {
|
213
213
|
/** Defaults to "base" */
|
214
214
|
variant: "floating" | "accent" | "base";
|
215
|
-
/** Defaults to "button" */
|
216
|
-
as: "button" | "a" | "label";
|
217
215
|
};
|
218
216
|
/**
|
219
217
|
* `PressableCard` is a component that renders a pressable card.
|
@@ -222,7 +220,6 @@ type PressableCardProps = Omit<BoxProps, "as"> & {
|
|
222
220
|
* It can be rendered as a button, link, label, or any other HTML element by specifying the `as` prop.
|
223
221
|
* If no `as` prop is provided, it defaults to a button.
|
224
222
|
*
|
225
|
-
* The `size` prop can be used to control the size of the card. It defaults to "sm".
|
226
223
|
* The `variant` prop can be used to control the style variant of the card. It defaults to "base".
|
227
224
|
*
|
228
225
|
* Example usage:
|
@@ -245,7 +242,7 @@ type PressableCardProps = Omit<BoxProps, "as"> & {
|
|
245
242
|
*
|
246
243
|
* @see StaticCard
|
247
244
|
*/
|
248
|
-
declare const PressableCard:
|
245
|
+
declare const PressableCard: _chakra_ui_system_dist_system_types.ComponentWithAs<As, PressableCardProps>;
|
249
246
|
|
250
247
|
type AccordionProps = Omit<AccordionProps$1, "variant" | "size"> & {
|
251
248
|
/**
|
@@ -2109,7 +2106,7 @@ type NudgeProps = {
|
|
2109
2106
|
* name="my-nudge"
|
2110
2107
|
* content="Check out this enormous new feature!"
|
2111
2108
|
* >
|
2112
|
-
* <
|
2109
|
+
* <StaticCard variant="base" padding={2} width="fit-content">My new feature</StaticCard>
|
2113
2110
|
* </Nudge>
|
2114
2111
|
* ```
|
2115
2112
|
*/
|
@@ -2134,9 +2131,9 @@ type WizardNudgeProps = Omit<NudgeProps, "actions" | "content"> & {
|
|
2134
2131
|
* name="my-wizard-nudge"
|
2135
2132
|
* introducedDate="2024-02-19"
|
2136
2133
|
* >
|
2137
|
-
* <
|
2134
|
+
* <StaticCard width="fit-content" padding={2}>
|
2138
2135
|
* My new feature
|
2139
|
-
* </
|
2136
|
+
* </StaticCard>
|
2140
2137
|
* </WizardNudge>
|
2141
2138
|
* ```
|
2142
2139
|
*/
|
@@ -7185,8 +7182,8 @@ declare const theme: {
|
|
7185
7182
|
};
|
7186
7183
|
StaticCard: {
|
7187
7184
|
baseStyle?: ((props: any) => {
|
7188
|
-
backgroundColor: string;
|
7189
7185
|
color: string;
|
7186
|
+
backgroundColor: string;
|
7190
7187
|
_focusVisible: {
|
7191
7188
|
outlineWidth: string;
|
7192
7189
|
outlineColor: string;
|
@@ -7200,8 +7197,7 @@ declare const theme: {
|
|
7200
7197
|
display: string;
|
7201
7198
|
borderRadius: string;
|
7202
7199
|
} | {
|
7203
|
-
backgroundColor:
|
7204
|
-
color: string;
|
7200
|
+
backgroundColor: any;
|
7205
7201
|
_focusVisible: {
|
7206
7202
|
outlineWidth: string;
|
7207
7203
|
outlineColor: string;
|
@@ -7214,6 +7210,7 @@ declare const theme: {
|
|
7214
7210
|
fontSize: string;
|
7215
7211
|
display: string;
|
7216
7212
|
borderRadius: string;
|
7213
|
+
color: string;
|
7217
7214
|
}) | undefined;
|
7218
7215
|
sizes?: {
|
7219
7216
|
[key: string]: _chakra_ui_styled_system.SystemStyleInterpolation;
|
@@ -7247,6 +7244,7 @@ declare const theme: {
|
|
7247
7244
|
fontSize: string;
|
7248
7245
|
display: string;
|
7249
7246
|
borderRadius: string;
|
7247
|
+
cursor: string;
|
7250
7248
|
}) | undefined;
|
7251
7249
|
sizes?: {
|
7252
7250
|
[key: string]: _chakra_ui_styled_system.SystemStyleInterpolation;
|
@@ -7317,6 +7315,8 @@ declare const theme: {
|
|
7317
7315
|
boxShadow: string;
|
7318
7316
|
_hover: {
|
7319
7317
|
boxShadow: string;
|
7318
|
+
outline: string;
|
7319
|
+
outlineColor: string;
|
7320
7320
|
backgroundColor: string;
|
7321
7321
|
};
|
7322
7322
|
_active: {
|
package/dist/index.js
CHANGED
@@ -923,15 +923,14 @@ var init_StaticCard = __esm({
|
|
923
923
|
exports.PressableCard = void 0;
|
924
924
|
var init_PressableCard = __esm({
|
925
925
|
"src/layout/PressableCard.tsx"() {
|
926
|
-
exports.PressableCard = (
|
927
|
-
children,
|
928
|
-
|
929
|
-
|
930
|
-
|
931
|
-
|
932
|
-
|
933
|
-
|
934
|
-
};
|
926
|
+
exports.PressableCard = react.forwardRef(
|
927
|
+
({ children, variant = "base", ...props }, ref) => {
|
928
|
+
const styles3 = react.useStyleConfig("PressableCard", {
|
929
|
+
variant
|
930
|
+
});
|
931
|
+
return /* @__PURE__ */ React73__namespace.default.createElement(react.Box, { __css: styles3, ...props, ref }, children);
|
932
|
+
}
|
933
|
+
);
|
935
934
|
}
|
936
935
|
});
|
937
936
|
var init_layout = __esm({
|
@@ -3155,10 +3154,12 @@ var init_CardSelect = __esm({
|
|
3155
3154
|
placement
|
3156
3155
|
},
|
3157
3156
|
/* @__PURE__ */ React73__namespace.default.createElement(
|
3158
|
-
exports.
|
3157
|
+
exports.StaticCard,
|
3159
3158
|
{
|
3160
3159
|
colorScheme: "white",
|
3161
3160
|
size: "lg",
|
3161
|
+
border: "sm",
|
3162
|
+
borderColor: "grey",
|
3162
3163
|
sx: styles3.card,
|
3163
3164
|
...overlayProps
|
3164
3165
|
},
|
@@ -15462,6 +15463,7 @@ var init_static_card = __esm({
|
|
15462
15463
|
"src/theme/components/static-card.ts"() {
|
15463
15464
|
init_foundations();
|
15464
15465
|
init_focus_utils();
|
15466
|
+
init_floating_utils();
|
15465
15467
|
config43 = react.defineStyleConfig({
|
15466
15468
|
baseStyle: (props) => ({
|
15467
15469
|
appearance: "none",
|
@@ -15481,8 +15483,8 @@ var init_static_card = __esm({
|
|
15481
15483
|
switch (props.colorScheme) {
|
15482
15484
|
case "white":
|
15483
15485
|
return {
|
15484
|
-
|
15485
|
-
color: "
|
15486
|
+
...floatingBackground("default", props),
|
15487
|
+
color: themeTools.mode("text.default.light", "text.default.dark")(props)
|
15486
15488
|
};
|
15487
15489
|
case "grey":
|
15488
15490
|
return {
|
@@ -15538,6 +15540,7 @@ var init_pressable_card = __esm({
|
|
15538
15540
|
fontSize: "inherit",
|
15539
15541
|
display: "block",
|
15540
15542
|
borderRadius: "md",
|
15543
|
+
cursor: "pointer",
|
15541
15544
|
...focusVisibleStyles(props),
|
15542
15545
|
_disabled: {
|
15543
15546
|
...baseBackground("disabled", props),
|
@@ -15574,6 +15577,7 @@ var init_pressable_card = __esm({
|
|
15574
15577
|
boxShadow: "sm",
|
15575
15578
|
_hover: {
|
15576
15579
|
...floatingBackground("hover", props),
|
15580
|
+
...floatingBorder("hover", props),
|
15577
15581
|
boxShadow: "md"
|
15578
15582
|
},
|
15579
15583
|
_active: {
|
package/dist/index.mjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export { Accordion, AccordionButton, AccordionIcon, AccordionItem, AccordionPanel, AttachedInputs, Badge, Box, Brand, Breadcrumb, BreadcrumbItem, BreadcrumbLink, Button, ButtonGroup, Card, CardSelect, Center, Checkbox, CheckboxGroup, ChoiceChip, ClosableAlert, CloseButton, Code, Collapse, ColorInlineLoader, ColorSpinner, Combobox, Container, ContentLoader, DarkFullScreenLoader, DarkInlineLoader, DarkMode, DarkSpinner, DatePicker, DateRangePicker, Divider, Drawer, DrawerBody, DrawerCloseButton, DrawerContent, DrawerFooter, ModalHeader as DrawerHeader, DrawerOverlay, Expandable, ExpandableAlert, ExpandableItem, Fade, Flex, FloatingActionButton, FormControl, FormErrorMessage, FormHelperText, FormLabel, FullScreenDrawer, Grid, GridItem, HStack, Heading, IconButton, Image, Img, InfoSelect, InfoTag, Input, InputGroup, InputLeftElement, InputRightElement, Item, ItemDescription, ItemLabel, JumpButton, Language, LanguageProvider, LightFullScreenLoader, LightInlineLoader, LightMode, LightSpinner, LineIcon, ListBox, ListItem, Modal, ModalBody, ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalOverlay, NativeSelect, Nudge, NumericStepper, OrderedList, Pagination, PasswordInput, PhoneNumberInput, PlayPauseButton, Portal, PressableCard, ProgressBar, ProgressIndicator, ProgressLoader, Radio, RadioCard, RadioCardGroup, RadioGroup, ScaleFade, SearchInput, Section, SimpleDrawer, SimpleGrid, Skeleton, SkeletonCircle, SkeletonText, SkipButton, Slide, SlideFade, Spacer, SporProvider, Stack, StaticAlert, StaticCard, Stepper, StepperStep, Switch, Tab, TabList, TabPanel, TabPanels, Table, TableCaption, Tabs, Tbody, Td, Text, TextLink, Textarea, Tfoot, Th, Thead, Time, TimePicker, Tooltip, Tr, TravelTag, UnorderedList, VStack, VyLogo, WizardNudge, Wrap, WrapItem, brandTheme, createTexts, defineStyleConfig, extendTheme, fontFaces, slugify, theme, tokens, useBreakpointValue, useClipboard, useColorMode, useColorModePreference, useColorModeValue, useControllableProp, useDisclosure, useMediaQuery, useMergeRefs, useOutsideClick, usePrefersReducedMotion, useSize, useTheme, useToast, useToken, useTranslation } from './chunk-
|
1
|
+
export { Accordion, AccordionButton, AccordionIcon, AccordionItem, AccordionPanel, AttachedInputs, Badge, Box, Brand, Breadcrumb, BreadcrumbItem, BreadcrumbLink, Button, ButtonGroup, Card, CardSelect, Center, Checkbox, CheckboxGroup, ChoiceChip, ClosableAlert, CloseButton, Code, Collapse, ColorInlineLoader, ColorSpinner, Combobox, Container, ContentLoader, DarkFullScreenLoader, DarkInlineLoader, DarkMode, DarkSpinner, DatePicker, DateRangePicker, Divider, Drawer, DrawerBody, DrawerCloseButton, DrawerContent, DrawerFooter, ModalHeader as DrawerHeader, DrawerOverlay, Expandable, ExpandableAlert, ExpandableItem, Fade, Flex, FloatingActionButton, FormControl, FormErrorMessage, FormHelperText, FormLabel, FullScreenDrawer, Grid, GridItem, HStack, Heading, IconButton, Image, Img, InfoSelect, InfoTag, Input, InputGroup, InputLeftElement, InputRightElement, Item, ItemDescription, ItemLabel, JumpButton, Language, LanguageProvider, LightFullScreenLoader, LightInlineLoader, LightMode, LightSpinner, LineIcon, ListBox, ListItem, Modal, ModalBody, ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalOverlay, NativeSelect, Nudge, NumericStepper, OrderedList, Pagination, PasswordInput, PhoneNumberInput, PlayPauseButton, Portal, PressableCard, ProgressBar, ProgressIndicator, ProgressLoader, Radio, RadioCard, RadioCardGroup, RadioGroup, ScaleFade, SearchInput, Section, SimpleDrawer, SimpleGrid, Skeleton, SkeletonCircle, SkeletonText, SkipButton, Slide, SlideFade, Spacer, SporProvider, Stack, StaticAlert, StaticCard, Stepper, StepperStep, Switch, Tab, TabList, TabPanel, TabPanels, Table, TableCaption, Tabs, Tbody, Td, Text, TextLink, Textarea, Tfoot, Th, Thead, Time, TimePicker, Tooltip, Tr, TravelTag, UnorderedList, VStack, VyLogo, WizardNudge, Wrap, WrapItem, brandTheme, createTexts, defineStyleConfig, extendTheme, fontFaces, slugify, theme, tokens, useBreakpointValue, useClipboard, useColorMode, useColorModePreference, useColorModeValue, useControllableProp, useDisclosure, useMediaQuery, useMergeRefs, useOutsideClick, usePrefersReducedMotion, useSize, useTheme, useToast, useToken, useTranslation } from './chunk-4QF4PJTK.mjs';
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@vygruppen/spor-react",
|
3
|
-
"version": "9.8.
|
3
|
+
"version": "9.8.2",
|
4
4
|
"main": "./dist/index.js",
|
5
5
|
"module": "./dist/index.mjs",
|
6
6
|
"types": "./dist/index.d.ts",
|
@@ -23,7 +23,7 @@
|
|
23
23
|
"@emotion/styled": "^11.10.4",
|
24
24
|
"@internationalized/date": "^3.0.1",
|
25
25
|
"@vygruppen/spor-design-tokens": ">3.4.0",
|
26
|
-
"@vygruppen/spor-icon-react": ">3.
|
26
|
+
"@vygruppen/spor-icon-react": ">3.6.0",
|
27
27
|
"@vygruppen/spor-loader": ">0.3.1",
|
28
28
|
"awesome-phonenumber": "^5.10.0",
|
29
29
|
"deepmerge": "^4.3.1",
|
package/src/input/CardSelect.tsx
CHANGED
@@ -14,7 +14,7 @@ import {
|
|
14
14
|
import React, { useEffect, useRef, useState } from "react";
|
15
15
|
import { AriaPositionProps, useButton, useOverlayTrigger } from "react-aria";
|
16
16
|
import { useOverlayTriggerState } from "react-stately";
|
17
|
-
import {
|
17
|
+
import { StaticCard } from "..";
|
18
18
|
import { Dialog } from "./Dialog";
|
19
19
|
import { Popover } from "./Popover";
|
20
20
|
|
@@ -149,14 +149,16 @@ export const CardSelect = forwardRef<CardSelectProps, "button">(
|
|
149
149
|
crossOffset={crossOffset}
|
150
150
|
placement={placement}
|
151
151
|
>
|
152
|
-
<
|
152
|
+
<StaticCard
|
153
153
|
colorScheme="white"
|
154
154
|
size="lg"
|
155
|
+
border={"sm"}
|
156
|
+
borderColor={"grey"}
|
155
157
|
sx={styles.card}
|
156
158
|
{...overlayProps}
|
157
159
|
>
|
158
160
|
<Dialog aria-label={label}>{children}</Dialog>
|
159
|
-
</
|
161
|
+
</StaticCard>
|
160
162
|
</Popover>
|
161
163
|
)}
|
162
164
|
</Box>
|
@@ -1,11 +1,15 @@
|
|
1
1
|
import React from "react";
|
2
|
-
import {
|
2
|
+
import {
|
3
|
+
As,
|
4
|
+
Box,
|
5
|
+
BoxProps,
|
6
|
+
forwardRef,
|
7
|
+
useStyleConfig,
|
8
|
+
} from "@chakra-ui/react";
|
3
9
|
|
4
|
-
type PressableCardProps =
|
10
|
+
type PressableCardProps = BoxProps & {
|
5
11
|
/** Defaults to "base" */
|
6
12
|
variant: "floating" | "accent" | "base";
|
7
|
-
/** Defaults to "button" */
|
8
|
-
as: "button" | "a" | "label";
|
9
13
|
};
|
10
14
|
|
11
15
|
/**
|
@@ -15,7 +19,6 @@ type PressableCardProps = Omit<BoxProps, "as"> & {
|
|
15
19
|
* It can be rendered as a button, link, label, or any other HTML element by specifying the `as` prop.
|
16
20
|
* If no `as` prop is provided, it defaults to a button.
|
17
21
|
*
|
18
|
-
* The `size` prop can be used to control the size of the card. It defaults to "sm".
|
19
22
|
* The `variant` prop can be used to control the style variant of the card. It defaults to "base".
|
20
23
|
*
|
21
24
|
* Example usage:
|
@@ -39,16 +42,16 @@ type PressableCardProps = Omit<BoxProps, "as"> & {
|
|
39
42
|
* @see StaticCard
|
40
43
|
*/
|
41
44
|
|
42
|
-
export const PressableCard = (
|
43
|
-
children,
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
45
|
+
export const PressableCard = forwardRef<PressableCardProps, As>(
|
46
|
+
({ children, variant = "base", ...props }, ref) => {
|
47
|
+
const styles = useStyleConfig("PressableCard", {
|
48
|
+
variant,
|
49
|
+
});
|
50
|
+
|
51
|
+
return (
|
52
|
+
<Box __css={styles} {...props} ref={ref}>
|
53
|
+
{children}
|
54
|
+
</Box>
|
55
|
+
);
|
56
|
+
},
|
57
|
+
);
|
package/src/layout/Stack.tsx
CHANGED
@@ -30,8 +30,8 @@ export type StackProps = Exclude<ChakraStackProps, "direction"> & {
|
|
30
30
|
*
|
31
31
|
* ```tsx
|
32
32
|
* <Stack spacing={4}>
|
33
|
-
* <
|
34
|
-
* <
|
33
|
+
* <StaticCard>Here's one card</StaticCard>
|
34
|
+
* <StaticCard>Here's another card, with a lot of space between it</StaticCard>
|
35
35
|
* </Stack>
|
36
36
|
* ```
|
37
37
|
*/
|
package/src/nudge/Nudge.tsx
CHANGED
@@ -74,7 +74,7 @@ const EXPIRATION_DELAY = 1000 * 60 * 60 * 24 * 30; // 30 days
|
|
74
74
|
* name="my-nudge"
|
75
75
|
* content="Check out this enormous new feature!"
|
76
76
|
* >
|
77
|
-
* <
|
77
|
+
* <StaticCard variant="base" padding={2} width="fit-content">My new feature</StaticCard>
|
78
78
|
* </Nudge>
|
79
79
|
* ```
|
80
80
|
*/
|
@@ -30,9 +30,9 @@ export type WizardNudgeProps = Omit<NudgeProps, "actions" | "content"> & {
|
|
30
30
|
* name="my-wizard-nudge"
|
31
31
|
* introducedDate="2024-02-19"
|
32
32
|
* >
|
33
|
-
* <
|
33
|
+
* <StaticCard width="fit-content" padding={2}>
|
34
34
|
* My new feature
|
35
|
-
* </
|
35
|
+
* </StaticCard>
|
36
36
|
* </WizardNudge>
|
37
37
|
* ```
|
38
38
|
*/
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { defineStyleConfig } from "@chakra-ui/react";
|
2
2
|
import { baseBackground, baseBorder, baseText } from "../utils/base-utils";
|
3
|
-
import { floatingBackground } from "../utils/floating-utils";
|
3
|
+
import { floatingBackground, floatingBorder } from "../utils/floating-utils";
|
4
4
|
import { focusVisibleStyles } from "../utils/focus-utils";
|
5
5
|
import { accentBackground } from "../utils/accent-utils";
|
6
6
|
|
@@ -12,6 +12,7 @@ const config = defineStyleConfig({
|
|
12
12
|
fontSize: "inherit",
|
13
13
|
display: "block",
|
14
14
|
borderRadius: "md",
|
15
|
+
cursor: "pointer",
|
15
16
|
...focusVisibleStyles(props),
|
16
17
|
_disabled: {
|
17
18
|
...baseBackground("disabled", props),
|
@@ -48,6 +49,7 @@ const config = defineStyleConfig({
|
|
48
49
|
boxShadow: "sm",
|
49
50
|
_hover: {
|
50
51
|
...floatingBackground("hover", props),
|
52
|
+
...floatingBorder("hover", props),
|
51
53
|
boxShadow: "md",
|
52
54
|
},
|
53
55
|
_active: {
|
@@ -1,6 +1,9 @@
|
|
1
1
|
import { defineStyleConfig } from "@chakra-ui/react";
|
2
2
|
import { colors } from "../foundations";
|
3
3
|
import { focusVisibleStyles } from "../utils/focus-utils";
|
4
|
+
import { bg } from "../utils/bg-utils";
|
5
|
+
import { floatingBackground } from "../utils/floating-utils";
|
6
|
+
import { mode } from "@chakra-ui/theme-tools";
|
4
7
|
|
5
8
|
const config = defineStyleConfig({
|
6
9
|
baseStyle: (props: any) => ({
|
@@ -32,12 +35,12 @@ type CardThemeProps = {
|
|
32
35
|
| "darkYellow";
|
33
36
|
};
|
34
37
|
|
35
|
-
const getColorSchemeBaseProps = (props:
|
38
|
+
const getColorSchemeBaseProps = (props: any) => {
|
36
39
|
switch (props.colorScheme) {
|
37
40
|
case "white":
|
38
41
|
return {
|
39
|
-
|
40
|
-
color: "
|
42
|
+
...floatingBackground("default", props),
|
43
|
+
color: mode("text.default.light", "text.default.dark")(props),
|
41
44
|
};
|
42
45
|
case "grey":
|
43
46
|
return {
|