@vygruppen/spor-react 9.0.3 → 9.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.
- package/.turbo/turbo-build.log +9 -9
- package/CHANGELOG.md +23 -0
- package/dist/{CountryCodeSelect-ZL7DHEIA.mjs → CountryCodeSelect-XAG646YQ.mjs} +1 -1
- package/dist/{chunk-FTQF5IX2.mjs → chunk-VLNBMJ7I.mjs} +28 -19
- package/dist/index.d.mts +19 -10
- package/dist/index.d.ts +19 -10
- package/dist/index.js +27 -21
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
- package/src/input/CardSelect.tsx +6 -5
- package/src/theme/components/card-select.ts +6 -1
- package/src/theme/components/card.ts +3 -3
- package/src/theme/components/link.ts +1 -2
- package/src/theme/index.ts +13 -6
package/.turbo/turbo-build.log
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
|
2
|
-
> @vygruppen/spor-react@9.0
|
2
|
+
> @vygruppen/spor-react@9.2.0 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[
|
13
|
-
[32mCJS[39m ⚡️ Build success in
|
12
|
+
[32mCJS[39m [1mdist/index.js [22m[32m488.21 KB[39m
|
13
|
+
[32mCJS[39m ⚡️ Build success in 2042ms
|
14
14
|
[32mESM[39m [1mdist/index.mjs [22m[32m2.02 KB[39m
|
15
|
-
[32mESM[39m [1mdist/CountryCodeSelect-
|
16
|
-
[32mESM[39m [1mdist/chunk-
|
17
|
-
[32mESM[39m ⚡️ Build success in
|
18
|
-
[32mDTS[39m ⚡️ Build success in
|
19
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[32m318.
|
20
|
-
[32mDTS[39m [1mdist/index.d.mts [22m[32m318.
|
15
|
+
[32mESM[39m [1mdist/CountryCodeSelect-XAG646YQ.mjs [22m[32m1.19 KB[39m
|
16
|
+
[32mESM[39m [1mdist/chunk-VLNBMJ7I.mjs [22m[32m382.23 KB[39m
|
17
|
+
[32mESM[39m ⚡️ Build success in 2043ms
|
18
|
+
[32mDTS[39m ⚡️ Build success in 11913ms
|
19
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m318.41 KB[39m
|
20
|
+
[32mDTS[39m [1mdist/index.d.mts [22m[32m318.41 KB[39m
|
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,28 @@
|
|
1
1
|
# @vygruppen/spor-react
|
2
2
|
|
3
|
+
## 9.2.0
|
4
|
+
|
5
|
+
### Minor Changes
|
6
|
+
|
7
|
+
- 8568d79: CardSelect: Add support for not having a visual label, by passing in aria-label instead of label prop
|
8
|
+
|
9
|
+
### Patch Changes
|
10
|
+
|
11
|
+
- 84b4bbf: Change the way cards and card selects are rendered
|
12
|
+
- Updated dependencies [84b4bbf]
|
13
|
+
- @vygruppen/spor-design-tokens@3.5.1
|
14
|
+
|
15
|
+
## 9.1.0
|
16
|
+
|
17
|
+
### Minor Changes
|
18
|
+
|
19
|
+
- 6fe2534: Add support for Brand.CargoNet
|
20
|
+
|
21
|
+
### Patch Changes
|
22
|
+
|
23
|
+
- Updated dependencies [6fe2534]
|
24
|
+
- @vygruppen/spor-design-tokens@3.5.0
|
25
|
+
|
3
26
|
## 9.0.3
|
4
27
|
|
5
28
|
### Patch Changes
|
@@ -2501,7 +2501,6 @@ var CardSelect = forwardRef(
|
|
2501
2501
|
isOpen: externalIsOpen,
|
2502
2502
|
defaultOpen = false,
|
2503
2503
|
onToggle,
|
2504
|
-
label,
|
2505
2504
|
icon,
|
2506
2505
|
children,
|
2507
2506
|
width = "fit-content",
|
@@ -2510,6 +2509,7 @@ var CardSelect = forwardRef(
|
|
2510
2509
|
withChevron = true,
|
2511
2510
|
...props
|
2512
2511
|
}, externalRef) => {
|
2512
|
+
const label = "label" in props ? props.label : props["aria-label"];
|
2513
2513
|
const internalRef = useRef(null);
|
2514
2514
|
const triggerRef = externalRef ?? internalRef;
|
2515
2515
|
const state2 = useOverlayTriggerState({
|
@@ -2535,11 +2535,12 @@ var CardSelect = forwardRef(
|
|
2535
2535
|
type: "button",
|
2536
2536
|
ref: triggerRef,
|
2537
2537
|
sx: styles3.trigger,
|
2538
|
+
"aria-label": label,
|
2538
2539
|
...buttonProps,
|
2539
2540
|
width,
|
2540
2541
|
"data-attachable": true
|
2541
2542
|
},
|
2542
|
-
/* @__PURE__ */ React69__default.createElement(Flex, { gap: 1.5, alignItems: "center" }, icon, /* @__PURE__ */ React69__default.createElement(Box, { as: "span" }, label), withChevron ? /* @__PURE__ */ React69__default.createElement(
|
2543
|
+
/* @__PURE__ */ React69__default.createElement(Flex, { gap: 1.5, alignItems: "center" }, icon, /* @__PURE__ */ React69__default.createElement(Box, { as: "span", display: props["aria-label"] ? "none" : "inline" }, label), withChevron ? /* @__PURE__ */ React69__default.createElement(
|
2543
2544
|
ChevronIcon,
|
2544
2545
|
{
|
2545
2546
|
transform: state2.isOpen ? "rotate(180deg)" : "none"
|
@@ -3340,7 +3341,7 @@ var texts14 = createTexts({
|
|
3340
3341
|
sv: "Telefonnummer"
|
3341
3342
|
}
|
3342
3343
|
});
|
3343
|
-
var LazyCountryCodeSelect = React69__default.lazy(() => import('./CountryCodeSelect-
|
3344
|
+
var LazyCountryCodeSelect = React69__default.lazy(() => import('./CountryCodeSelect-XAG646YQ.mjs'));
|
3344
3345
|
var Radio = forwardRef((props, ref) => {
|
3345
3346
|
return /* @__PURE__ */ React69__default.createElement(Radio$1, { ...props, ref });
|
3346
3347
|
});
|
@@ -10385,8 +10386,8 @@ var shadows2 = {
|
|
10385
10386
|
lg: tokens10__default.depth.shadow.lg.value
|
10386
10387
|
};
|
10387
10388
|
var spacing2 = Object.entries(tokens10__default.size.spacing).reduce(
|
10388
|
-
(
|
10389
|
-
...
|
10389
|
+
(tokens15, [key, token]) => ({
|
10390
|
+
...tokens15,
|
10390
10391
|
[Number(key)]: token
|
10391
10392
|
}),
|
10392
10393
|
{}
|
@@ -10584,7 +10585,7 @@ var getColorSchemeBaseProps = (props) => {
|
|
10584
10585
|
...baseBorder("default", props),
|
10585
10586
|
backgroundColor: mode(
|
10586
10587
|
"white",
|
10587
|
-
`color-mix(in srgb, white 10%, var(--spor-colors-
|
10588
|
+
`color-mix(in srgb, white 10%, var(--spor-colors-bg-default-dark))`
|
10588
10589
|
)(props),
|
10589
10590
|
color: "inherit"
|
10590
10591
|
};
|
@@ -10633,7 +10634,7 @@ var getColorSchemeHoverProps = (props) => {
|
|
10633
10634
|
return {
|
10634
10635
|
backgroundColor: mode(
|
10635
10636
|
"white",
|
10636
|
-
`color-mix(in srgb, white 20%, var(--spor-colors-
|
10637
|
+
`color-mix(in srgb, white 20%, var(--spor-colors-bg-default-dark))`
|
10637
10638
|
)(props),
|
10638
10639
|
...floatingBorder("hover", props)
|
10639
10640
|
};
|
@@ -10654,7 +10655,7 @@ var getColorSchemeActiveProps = (props) => {
|
|
10654
10655
|
switch (colorScheme) {
|
10655
10656
|
case "white":
|
10656
10657
|
return {
|
10657
|
-
backgroundColor: mode("
|
10658
|
+
backgroundColor: mode("bg.tertiary.light", `bg.default.dark`)(props),
|
10658
10659
|
...floatingBorder("active", props)
|
10659
10660
|
};
|
10660
10661
|
case "grey":
|
@@ -10669,8 +10670,6 @@ var getColorSchemeActiveProps = (props) => {
|
|
10669
10670
|
};
|
10670
10671
|
}
|
10671
10672
|
};
|
10672
|
-
|
10673
|
-
// src/theme/components/card-select.ts
|
10674
10673
|
var parts3 = anatomy("card-select").parts("trigger", "card");
|
10675
10674
|
var helpers4 = createMultiStyleConfigHelpers(parts3.keys);
|
10676
10675
|
var config9 = helpers4.defineMultiStyleConfig({
|
@@ -10688,7 +10687,10 @@ var config9 = helpers4.defineMultiStyleConfig({
|
|
10688
10687
|
boxShadow: "md",
|
10689
10688
|
padding: 3,
|
10690
10689
|
...baseText("default", props),
|
10691
|
-
|
10690
|
+
backgroundColor: mode(
|
10691
|
+
"white",
|
10692
|
+
`color-mix(in srgb, white 10%, var(--spor-colors-bg-default-dark))`
|
10693
|
+
)(props)
|
10692
10694
|
}
|
10693
10695
|
}),
|
10694
10696
|
variants: {
|
@@ -10737,7 +10739,8 @@ var config9 = helpers4.defineMultiStyleConfig({
|
|
10737
10739
|
_expanded: {
|
10738
10740
|
...floatingBackground("active", props)
|
10739
10741
|
}
|
10740
|
-
}
|
10742
|
+
},
|
10743
|
+
card: {}
|
10741
10744
|
})
|
10742
10745
|
},
|
10743
10746
|
sizes: {
|
@@ -12097,7 +12100,7 @@ var config24 = defineStyleConfig$1({
|
|
12097
12100
|
}),
|
12098
12101
|
variants: {
|
12099
12102
|
primary: (props) => ({
|
12100
|
-
...
|
12103
|
+
...baseText("default", props),
|
12101
12104
|
_hover: {
|
12102
12105
|
...brandText("hover", props),
|
12103
12106
|
...brandBackground("hover", props)
|
@@ -13254,6 +13257,7 @@ var fontFaces = `
|
|
13254
13257
|
var Brand = /* @__PURE__ */ ((Brand2) => {
|
13255
13258
|
Brand2["VyDigital"] = "VyDigital";
|
13256
13259
|
Brand2["VyUtvikling"] = "VyUtvikling";
|
13260
|
+
Brand2["CargoNet"] = "CargoNet";
|
13257
13261
|
return Brand2;
|
13258
13262
|
})(Brand || {});
|
13259
13263
|
var theme = {
|
@@ -13268,15 +13272,20 @@ var brandTheme = {
|
|
13268
13272
|
["VyDigital" /* VyDigital */]: {},
|
13269
13273
|
["VyUtvikling" /* VyUtvikling */]: {
|
13270
13274
|
colors: {
|
13271
|
-
|
13272
|
-
|
13273
|
-
|
13274
|
-
|
13275
|
-
|
13276
|
-
|
13275
|
+
bg: {
|
13276
|
+
default: {
|
13277
|
+
dark: colors2.darkGrey
|
13278
|
+
}
|
13279
|
+
},
|
13280
|
+
surface: {
|
13281
|
+
default: {
|
13282
|
+
dark: colors2.darkGrey
|
13277
13283
|
}
|
13278
13284
|
}
|
13279
13285
|
}
|
13286
|
+
},
|
13287
|
+
["CargoNet" /* CargoNet */]: {
|
13288
|
+
colors: tokens10__default.color.cargonet
|
13280
13289
|
}
|
13281
13290
|
};
|
13282
13291
|
var BaseToast = ({ children, variant, id }) => {
|
package/dist/index.d.mts
CHANGED
@@ -657,8 +657,6 @@ type CardSelectProps = BoxProps & {
|
|
657
657
|
defaultOpen?: boolean;
|
658
658
|
/** Callback for when the card select opens or closes. */
|
659
659
|
onToggle?: (isOpen: boolean) => void;
|
660
|
-
/** The text of the trigger button */
|
661
|
-
label: string;
|
662
660
|
/** An optional trigger button icon, rendered to the left of the label */
|
663
661
|
icon?: React.ReactNode;
|
664
662
|
/** The content of the card select */
|
@@ -669,7 +667,11 @@ type CardSelectProps = BoxProps & {
|
|
669
667
|
placement?: AriaPositionProps["placement"];
|
670
668
|
/** Whether or not to show the chevron. Defaults to true */
|
671
669
|
withChevron?: boolean;
|
672
|
-
}
|
670
|
+
} & ({
|
671
|
+
label: string;
|
672
|
+
} | {
|
673
|
+
"aria-label": string;
|
674
|
+
});
|
673
675
|
/**
|
674
676
|
* A card select component.
|
675
677
|
*
|
@@ -2127,7 +2129,8 @@ declare const fontFaces: string;
|
|
2127
2129
|
|
2128
2130
|
declare enum Brand {
|
2129
2131
|
VyDigital = "VyDigital",
|
2130
|
-
VyUtvikling = "VyUtvikling"
|
2132
|
+
VyUtvikling = "VyUtvikling",
|
2133
|
+
CargoNet = "CargoNet"
|
2131
2134
|
}
|
2132
2135
|
declare const theme: {
|
2133
2136
|
components: {
|
@@ -3306,6 +3309,7 @@ declare const theme: {
|
|
3306
3309
|
backgroundColor: string;
|
3307
3310
|
boxShadow: string;
|
3308
3311
|
};
|
3312
|
+
card: {};
|
3309
3313
|
};
|
3310
3314
|
} | undefined;
|
3311
3315
|
defaultProps?: {
|
@@ -8685,16 +8689,21 @@ declare const brandTheme: {
|
|
8685
8689
|
VyDigital: {};
|
8686
8690
|
VyUtvikling: {
|
8687
8691
|
colors: {
|
8688
|
-
|
8689
|
-
|
8690
|
-
|
8691
|
-
|
8692
|
-
|
8693
|
-
|
8692
|
+
bg: {
|
8693
|
+
default: {
|
8694
|
+
dark: string;
|
8695
|
+
};
|
8696
|
+
};
|
8697
|
+
surface: {
|
8698
|
+
default: {
|
8699
|
+
dark: string;
|
8694
8700
|
};
|
8695
8701
|
};
|
8696
8702
|
};
|
8697
8703
|
};
|
8704
|
+
CargoNet: {
|
8705
|
+
colors: any;
|
8706
|
+
};
|
8698
8707
|
};
|
8699
8708
|
|
8700
8709
|
type BaseToastProps = {
|
package/dist/index.d.ts
CHANGED
@@ -657,8 +657,6 @@ type CardSelectProps = BoxProps & {
|
|
657
657
|
defaultOpen?: boolean;
|
658
658
|
/** Callback for when the card select opens or closes. */
|
659
659
|
onToggle?: (isOpen: boolean) => void;
|
660
|
-
/** The text of the trigger button */
|
661
|
-
label: string;
|
662
660
|
/** An optional trigger button icon, rendered to the left of the label */
|
663
661
|
icon?: React.ReactNode;
|
664
662
|
/** The content of the card select */
|
@@ -669,7 +667,11 @@ type CardSelectProps = BoxProps & {
|
|
669
667
|
placement?: AriaPositionProps["placement"];
|
670
668
|
/** Whether or not to show the chevron. Defaults to true */
|
671
669
|
withChevron?: boolean;
|
672
|
-
}
|
670
|
+
} & ({
|
671
|
+
label: string;
|
672
|
+
} | {
|
673
|
+
"aria-label": string;
|
674
|
+
});
|
673
675
|
/**
|
674
676
|
* A card select component.
|
675
677
|
*
|
@@ -2127,7 +2129,8 @@ declare const fontFaces: string;
|
|
2127
2129
|
|
2128
2130
|
declare enum Brand {
|
2129
2131
|
VyDigital = "VyDigital",
|
2130
|
-
VyUtvikling = "VyUtvikling"
|
2132
|
+
VyUtvikling = "VyUtvikling",
|
2133
|
+
CargoNet = "CargoNet"
|
2131
2134
|
}
|
2132
2135
|
declare const theme: {
|
2133
2136
|
components: {
|
@@ -3306,6 +3309,7 @@ declare const theme: {
|
|
3306
3309
|
backgroundColor: string;
|
3307
3310
|
boxShadow: string;
|
3308
3311
|
};
|
3312
|
+
card: {};
|
3309
3313
|
};
|
3310
3314
|
} | undefined;
|
3311
3315
|
defaultProps?: {
|
@@ -8685,16 +8689,21 @@ declare const brandTheme: {
|
|
8685
8689
|
VyDigital: {};
|
8686
8690
|
VyUtvikling: {
|
8687
8691
|
colors: {
|
8688
|
-
|
8689
|
-
|
8690
|
-
|
8691
|
-
|
8692
|
-
|
8693
|
-
|
8692
|
+
bg: {
|
8693
|
+
default: {
|
8694
|
+
dark: string;
|
8695
|
+
};
|
8696
|
+
};
|
8697
|
+
surface: {
|
8698
|
+
default: {
|
8699
|
+
dark: string;
|
8694
8700
|
};
|
8695
8701
|
};
|
8696
8702
|
};
|
8697
8703
|
};
|
8704
|
+
CargoNet: {
|
8705
|
+
colors: any;
|
8706
|
+
};
|
8698
8707
|
};
|
8699
8708
|
|
8700
8709
|
type BaseToastProps = {
|
package/dist/index.js
CHANGED
@@ -2247,7 +2247,6 @@ var init_CardSelect = __esm({
|
|
2247
2247
|
isOpen: externalIsOpen,
|
2248
2248
|
defaultOpen = false,
|
2249
2249
|
onToggle,
|
2250
|
-
label,
|
2251
2250
|
icon,
|
2252
2251
|
children,
|
2253
2252
|
width = "fit-content",
|
@@ -2256,6 +2255,7 @@ var init_CardSelect = __esm({
|
|
2256
2255
|
withChevron = true,
|
2257
2256
|
...props
|
2258
2257
|
}, externalRef) => {
|
2258
|
+
const label = "label" in props ? props.label : props["aria-label"];
|
2259
2259
|
const internalRef = React69.useRef(null);
|
2260
2260
|
const triggerRef = externalRef ?? internalRef;
|
2261
2261
|
const state2 = reactStately.useOverlayTriggerState({
|
@@ -2281,11 +2281,12 @@ var init_CardSelect = __esm({
|
|
2281
2281
|
type: "button",
|
2282
2282
|
ref: triggerRef,
|
2283
2283
|
sx: styles3.trigger,
|
2284
|
+
"aria-label": label,
|
2284
2285
|
...buttonProps,
|
2285
2286
|
width,
|
2286
2287
|
"data-attachable": true
|
2287
2288
|
},
|
2288
|
-
/* @__PURE__ */ React69__namespace.default.createElement(react.Flex, { gap: 1.5, alignItems: "center" }, icon, /* @__PURE__ */ React69__namespace.default.createElement(react.Box, { as: "span" }, label), withChevron ? /* @__PURE__ */ React69__namespace.default.createElement(
|
2289
|
+
/* @__PURE__ */ React69__namespace.default.createElement(react.Flex, { gap: 1.5, alignItems: "center" }, icon, /* @__PURE__ */ React69__namespace.default.createElement(react.Box, { as: "span", display: props["aria-label"] ? "none" : "inline" }, label), withChevron ? /* @__PURE__ */ React69__namespace.default.createElement(
|
2289
2290
|
ChevronIcon,
|
2290
2291
|
{
|
2291
2292
|
transform: state2.isOpen ? "rotate(180deg)" : "none"
|
@@ -11793,8 +11794,8 @@ var spacing2, space2;
|
|
11793
11794
|
var init_spacing = __esm({
|
11794
11795
|
"src/theme/foundations/spacing.ts"() {
|
11795
11796
|
spacing2 = Object.entries(tokens10__namespace.default.size.spacing).reduce(
|
11796
|
-
(
|
11797
|
-
...
|
11797
|
+
(tokens15, [key, token]) => ({
|
11798
|
+
...tokens15,
|
11798
11799
|
[Number(key)]: token
|
11799
11800
|
}),
|
11800
11801
|
{}
|
@@ -12078,7 +12079,7 @@ var init_card2 = __esm({
|
|
12078
12079
|
...baseBorder("default", props),
|
12079
12080
|
backgroundColor: themeTools.mode(
|
12080
12081
|
"white",
|
12081
|
-
`color-mix(in srgb, white 10%, var(--spor-colors-
|
12082
|
+
`color-mix(in srgb, white 10%, var(--spor-colors-bg-default-dark))`
|
12082
12083
|
)(props),
|
12083
12084
|
color: "inherit"
|
12084
12085
|
};
|
@@ -12109,7 +12110,7 @@ var init_card2 = __esm({
|
|
12109
12110
|
return {
|
12110
12111
|
backgroundColor: themeTools.mode(
|
12111
12112
|
"white",
|
12112
|
-
`color-mix(in srgb, white 20%, var(--spor-colors-
|
12113
|
+
`color-mix(in srgb, white 20%, var(--spor-colors-bg-default-dark))`
|
12113
12114
|
)(props),
|
12114
12115
|
...floatingBorder("hover", props)
|
12115
12116
|
};
|
@@ -12130,7 +12131,7 @@ var init_card2 = __esm({
|
|
12130
12131
|
switch (colorScheme) {
|
12131
12132
|
case "white":
|
12132
12133
|
return {
|
12133
|
-
backgroundColor: themeTools.mode("
|
12134
|
+
backgroundColor: themeTools.mode("bg.tertiary.light", `bg.default.dark`)(props),
|
12134
12135
|
...floatingBorder("active", props)
|
12135
12136
|
};
|
12136
12137
|
case "grey":
|
@@ -12147,8 +12148,6 @@ var init_card2 = __esm({
|
|
12147
12148
|
};
|
12148
12149
|
}
|
12149
12150
|
});
|
12150
|
-
|
12151
|
-
// src/theme/components/card-select.ts
|
12152
12151
|
var parts3, helpers4, config9, card_select_default;
|
12153
12152
|
var init_card_select = __esm({
|
12154
12153
|
"src/theme/components/card-select.ts"() {
|
@@ -12175,7 +12174,10 @@ var init_card_select = __esm({
|
|
12175
12174
|
boxShadow: "md",
|
12176
12175
|
padding: 3,
|
12177
12176
|
...baseText("default", props),
|
12178
|
-
|
12177
|
+
backgroundColor: themeTools.mode(
|
12178
|
+
"white",
|
12179
|
+
`color-mix(in srgb, white 10%, var(--spor-colors-bg-default-dark))`
|
12180
|
+
)(props)
|
12179
12181
|
}
|
12180
12182
|
}),
|
12181
12183
|
variants: {
|
@@ -12224,7 +12226,8 @@ var init_card_select = __esm({
|
|
12224
12226
|
_expanded: {
|
12225
12227
|
...floatingBackground("active", props)
|
12226
12228
|
}
|
12227
|
-
}
|
12229
|
+
},
|
12230
|
+
card: {}
|
12228
12231
|
})
|
12229
12232
|
},
|
12230
12233
|
sizes: {
|
@@ -13675,7 +13678,6 @@ var init_line_icon = __esm({
|
|
13675
13678
|
var config24, link_default;
|
13676
13679
|
var init_link2 = __esm({
|
13677
13680
|
"src/theme/components/link.ts"() {
|
13678
|
-
init_accent_utils();
|
13679
13681
|
init_base_utils();
|
13680
13682
|
init_brand_utils();
|
13681
13683
|
init_focus_utils();
|
@@ -13712,7 +13714,7 @@ var init_link2 = __esm({
|
|
13712
13714
|
}),
|
13713
13715
|
variants: {
|
13714
13716
|
primary: (props) => ({
|
13715
|
-
...
|
13717
|
+
...baseText("default", props),
|
13716
13718
|
_hover: {
|
13717
13719
|
...brandText("hover", props),
|
13718
13720
|
...brandBackground("hover", props)
|
@@ -15104,8 +15106,6 @@ var init_font_faces = __esm({
|
|
15104
15106
|
`;
|
15105
15107
|
}
|
15106
15108
|
});
|
15107
|
-
|
15108
|
-
// src/theme/index.ts
|
15109
15109
|
exports.Brand = void 0; exports.theme = void 0; exports.brandTheme = void 0;
|
15110
15110
|
var init_theme = __esm({
|
15111
15111
|
"src/theme/index.ts"() {
|
@@ -15116,6 +15116,7 @@ var init_theme = __esm({
|
|
15116
15116
|
exports.Brand = /* @__PURE__ */ ((Brand2) => {
|
15117
15117
|
Brand2["VyDigital"] = "VyDigital";
|
15118
15118
|
Brand2["VyUtvikling"] = "VyUtvikling";
|
15119
|
+
Brand2["CargoNet"] = "CargoNet";
|
15119
15120
|
return Brand2;
|
15120
15121
|
})(exports.Brand || {});
|
15121
15122
|
exports.theme = {
|
@@ -15130,15 +15131,20 @@ var init_theme = __esm({
|
|
15130
15131
|
["VyDigital" /* VyDigital */]: {},
|
15131
15132
|
["VyUtvikling" /* VyUtvikling */]: {
|
15132
15133
|
colors: {
|
15133
|
-
|
15134
|
-
|
15135
|
-
|
15136
|
-
|
15137
|
-
|
15138
|
-
|
15134
|
+
bg: {
|
15135
|
+
default: {
|
15136
|
+
dark: colors2.darkGrey
|
15137
|
+
}
|
15138
|
+
},
|
15139
|
+
surface: {
|
15140
|
+
default: {
|
15141
|
+
dark: colors2.darkGrey
|
15139
15142
|
}
|
15140
15143
|
}
|
15141
15144
|
}
|
15145
|
+
},
|
15146
|
+
["CargoNet" /* CargoNet */]: {
|
15147
|
+
colors: tokens10__namespace.default.color.cargonet
|
15142
15148
|
}
|
15143
15149
|
};
|
15144
15150
|
}
|
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, 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, PasswordInput, PhoneNumberInput, PlayPauseButton, Portal, ProgressBar, ProgressIndicator, ProgressLoader, Radio, RadioGroup, ScaleFade, SearchInput, Section, SimpleDrawer, SimpleGrid, Skeleton, SkeletonCircle, SkeletonText, SkipButton, Slide, SlideFade, Spacer, SporProvider, Stack, StaticAlert, 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, 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, PasswordInput, PhoneNumberInput, PlayPauseButton, Portal, ProgressBar, ProgressIndicator, ProgressLoader, Radio, RadioGroup, ScaleFade, SearchInput, Section, SimpleDrawer, SimpleGrid, Skeleton, SkeletonCircle, SkeletonText, SkipButton, Slide, SlideFade, Spacer, SporProvider, Stack, StaticAlert, 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-VLNBMJ7I.mjs';
|
package/package.json
CHANGED
package/src/input/CardSelect.tsx
CHANGED
@@ -33,8 +33,6 @@ type CardSelectProps = BoxProps & {
|
|
33
33
|
defaultOpen?: boolean;
|
34
34
|
/** Callback for when the card select opens or closes. */
|
35
35
|
onToggle?: (isOpen: boolean) => void;
|
36
|
-
/** The text of the trigger button */
|
37
|
-
label: string;
|
38
36
|
/** An optional trigger button icon, rendered to the left of the label */
|
39
37
|
icon?: React.ReactNode;
|
40
38
|
/** The content of the card select */
|
@@ -45,7 +43,7 @@ type CardSelectProps = BoxProps & {
|
|
45
43
|
placement?: AriaPositionProps["placement"];
|
46
44
|
/** Whether or not to show the chevron. Defaults to true */
|
47
45
|
withChevron?: boolean;
|
48
|
-
};
|
46
|
+
} & ({ label: string } | { "aria-label": string });
|
49
47
|
|
50
48
|
/**
|
51
49
|
* A card select component.
|
@@ -69,7 +67,6 @@ export const CardSelect = forwardRef<CardSelectProps, "button">(
|
|
69
67
|
isOpen: externalIsOpen,
|
70
68
|
defaultOpen = false,
|
71
69
|
onToggle,
|
72
|
-
label,
|
73
70
|
icon,
|
74
71
|
children,
|
75
72
|
width = "fit-content",
|
@@ -80,6 +77,7 @@ export const CardSelect = forwardRef<CardSelectProps, "button">(
|
|
80
77
|
},
|
81
78
|
externalRef,
|
82
79
|
) => {
|
80
|
+
const label = "label" in props ? props.label : props["aria-label"];
|
83
81
|
const internalRef = useRef<HTMLButtonElement>(null);
|
84
82
|
const triggerRef = (externalRef ??
|
85
83
|
internalRef) as React.RefObject<HTMLButtonElement>;
|
@@ -112,13 +110,16 @@ export const CardSelect = forwardRef<CardSelectProps, "button">(
|
|
112
110
|
type="button"
|
113
111
|
ref={triggerRef}
|
114
112
|
sx={styles.trigger}
|
113
|
+
aria-label={label}
|
115
114
|
{...buttonProps}
|
116
115
|
width={width}
|
117
116
|
data-attachable
|
118
117
|
>
|
119
118
|
<Flex gap={1.5} alignItems="center">
|
120
119
|
{icon}
|
121
|
-
<Box as="span"
|
120
|
+
<Box as="span" display={props["aria-label"] ? "none" : "inline"}>
|
121
|
+
{label}
|
122
|
+
</Box>
|
122
123
|
{withChevron ? (
|
123
124
|
<ChevronIcon
|
124
125
|
transform={state.isOpen ? "rotate(180deg)" : "none"}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { anatomy } from "@chakra-ui/anatomy";
|
2
2
|
import { createMultiStyleConfigHelpers } from "@chakra-ui/styled-system";
|
3
|
+
import { mode } from "@chakra-ui/theme-tools";
|
3
4
|
import { baseBackground, baseBorder, baseText } from "../utils/base-utils";
|
4
5
|
import { floatingBackground, floatingBorder } from "../utils/floating-utils";
|
5
6
|
import { focusVisibleStyles } from "../utils/focus-utils";
|
@@ -23,7 +24,10 @@ const config = helpers.defineMultiStyleConfig({
|
|
23
24
|
boxShadow: "md",
|
24
25
|
padding: 3,
|
25
26
|
...baseText("default", props),
|
26
|
-
|
27
|
+
backgroundColor: mode(
|
28
|
+
"white",
|
29
|
+
`color-mix(in srgb, white 10%, var(--spor-colors-bg-default-dark))`,
|
30
|
+
)(props),
|
27
31
|
},
|
28
32
|
}),
|
29
33
|
variants: {
|
@@ -73,6 +77,7 @@ const config = helpers.defineMultiStyleConfig({
|
|
73
77
|
...floatingBackground("active", props),
|
74
78
|
},
|
75
79
|
},
|
80
|
+
card: {},
|
76
81
|
}),
|
77
82
|
},
|
78
83
|
sizes: {
|
@@ -85,7 +85,7 @@ const getColorSchemeBaseProps = (props: CardThemeProps) => {
|
|
85
85
|
...baseBorder("default", props),
|
86
86
|
backgroundColor: mode(
|
87
87
|
"white",
|
88
|
-
`color-mix(in srgb, white 10%, var(--spor-colors-
|
88
|
+
`color-mix(in srgb, white 10%, var(--spor-colors-bg-default-dark))`,
|
89
89
|
)(props),
|
90
90
|
color: "inherit",
|
91
91
|
};
|
@@ -134,7 +134,7 @@ const getColorSchemeHoverProps = (props: CardThemeProps) => {
|
|
134
134
|
return {
|
135
135
|
backgroundColor: mode(
|
136
136
|
"white",
|
137
|
-
`color-mix(in srgb, white 20%, var(--spor-colors-
|
137
|
+
`color-mix(in srgb, white 20%, var(--spor-colors-bg-default-dark))`,
|
138
138
|
)(props),
|
139
139
|
...floatingBorder("hover", props),
|
140
140
|
};
|
@@ -154,7 +154,7 @@ const getColorSchemeActiveProps = (props: CardThemeProps) => {
|
|
154
154
|
switch (colorScheme) {
|
155
155
|
case "white":
|
156
156
|
return {
|
157
|
-
backgroundColor: mode("
|
157
|
+
backgroundColor: mode("bg.tertiary.light", `bg.default.dark`)(props),
|
158
158
|
...floatingBorder("active", props),
|
159
159
|
};
|
160
160
|
case "grey":
|
@@ -1,6 +1,5 @@
|
|
1
1
|
import { defineStyleConfig } from "@chakra-ui/react";
|
2
2
|
import { mode } from "@chakra-ui/theme-tools";
|
3
|
-
import { accentText } from "../utils/accent-utils";
|
4
3
|
import { baseBackground, baseBorder, baseText } from "../utils/base-utils";
|
5
4
|
import { brandBackground, brandText } from "../utils/brand-utils";
|
6
5
|
import { focusVisibleStyles } from "../utils/focus-utils";
|
@@ -41,7 +40,7 @@ const config = defineStyleConfig({
|
|
41
40
|
}),
|
42
41
|
variants: {
|
43
42
|
primary: (props) => ({
|
44
|
-
...
|
43
|
+
...baseText("default", props),
|
45
44
|
_hover: {
|
46
45
|
...brandText("hover", props),
|
47
46
|
...brandBackground("hover", props),
|
package/src/theme/index.ts
CHANGED
@@ -1,10 +1,12 @@
|
|
1
1
|
import { theme as defaultTheme } from "@chakra-ui/theme";
|
2
|
+
import tokens from "@vygruppen/spor-design-tokens";
|
2
3
|
import * as components from "./components";
|
3
4
|
import * as foundations from "./foundations";
|
4
5
|
|
5
6
|
export enum Brand {
|
6
7
|
VyDigital = "VyDigital",
|
7
8
|
VyUtvikling = "VyUtvikling",
|
9
|
+
CargoNet = "CargoNet",
|
8
10
|
}
|
9
11
|
|
10
12
|
export const theme = {
|
@@ -20,16 +22,21 @@ export const brandTheme = {
|
|
20
22
|
[Brand.VyDigital]: {},
|
21
23
|
[Brand.VyUtvikling]: {
|
22
24
|
colors: {
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
25
|
+
bg: {
|
26
|
+
default: {
|
27
|
+
dark: foundations.colors.darkGrey,
|
28
|
+
},
|
29
|
+
},
|
30
|
+
surface: {
|
31
|
+
default: {
|
32
|
+
dark: foundations.colors.darkGrey,
|
29
33
|
},
|
30
34
|
},
|
31
35
|
},
|
32
36
|
},
|
37
|
+
[Brand.CargoNet]: {
|
38
|
+
colors: tokens.color.cargonet as any,
|
39
|
+
},
|
33
40
|
};
|
34
41
|
|
35
42
|
export { fontFaces } from "./font-faces";
|