@vygruppen/spor-react 4.0.1 → 4.0.3
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 +11 -11
- package/CHANGELOG.md +16 -0
- package/dist/{CountryCodeSelect-HCQZVKWU.mjs → CountryCodeSelect-RUH47EQH.mjs} +1 -1
- package/dist/{chunk-3SY4N6MP.mjs → chunk-XT6QVKN5.mjs} +127 -57
- package/dist/index.d.mts +65 -38
- package/dist/index.d.ts +65 -38
- package/dist/index.js +138 -56
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
- package/src/button/Button.tsx +1 -1
- package/src/datepicker/TimePicker.tsx +5 -3
- package/src/input/CardSelect.tsx +1 -1
- package/src/input/FormErrorMessage.tsx +1 -1
- package/src/input/InfoSelect.tsx +1 -1
- package/src/input/PasswordInput.tsx +1 -0
- package/src/linjetag/InfoTag.tsx +1 -1
- package/src/linjetag/LineIcon.tsx +1 -1
- package/src/linjetag/TravelTag.tsx +1 -1
- package/src/loader/DarkSpinner.tsx +5 -3
- package/src/theme/components/info-select.ts +23 -36
- package/src/theme/components/input.ts +12 -5
- package/src/theme/components/list.ts +12 -12
- package/src/theme/components/listbox.ts +13 -7
- package/src/theme/components/select.ts +5 -4
- package/src/theme/utils/background-utils.ts +28 -0
- package/src/theme/utils/border-utils.ts +59 -0
package/dist/index.d.ts
CHANGED
@@ -294,7 +294,7 @@ type ButtonProps = Exclude<ButtonProps$1, "colorScheme" | "loadingText" | "size"
|
|
294
294
|
* </Button>
|
295
295
|
* ```
|
296
296
|
*
|
297
|
-
* @see https://spor.vy.no/
|
297
|
+
* @see https://spor.vy.no/components/button
|
298
298
|
*/
|
299
299
|
declare const Button: _chakra_ui_system_dist_system_types.ComponentWithAs<"button", ButtonProps>;
|
300
300
|
|
@@ -493,9 +493,11 @@ type TimePickerProps = Omit<BoxProps, "defaultValue" | "onChange"> & {
|
|
493
493
|
value?: TimeValue;
|
494
494
|
/** A default value, if any.
|
495
495
|
*
|
496
|
-
* A `new Time(hours, minutes)` should be passed.
|
496
|
+
* A `new Time(hours, minutes)` should be passed.
|
497
|
+
* Defaults to the current time if not provided.
|
498
|
+
* Can be set to null if you don't want a time to be selected by default.
|
497
499
|
**/
|
498
|
-
defaultValue?: TimeValue;
|
500
|
+
defaultValue?: TimeValue | null;
|
499
501
|
/** Callback for when the time changes */
|
500
502
|
onChange?: (value: TimeValue) => void;
|
501
503
|
/** The maxiumum number of minutes to move when the step buttons are used.
|
@@ -524,7 +526,7 @@ type TimePickerProps = Omit<BoxProps, "defaultValue" | "onChange"> & {
|
|
524
526
|
*
|
525
527
|
* Note that the TimePicker uses the `Time` class to represent the time. This is a class that is part of the `@internationalized/date` package.
|
526
528
|
*
|
527
|
-
* @see https://spor.vy.no/
|
529
|
+
* @see https://spor.vy.no/komponents/timepicker
|
528
530
|
*/
|
529
531
|
declare const TimePicker: ({ label: externalLabel, value, defaultValue, onChange, minuteInterval, isDisabled: isDisabledExternally, name, ...boxProps }: TimePickerProps) => React__default.JSX.Element;
|
530
532
|
|
@@ -676,7 +678,7 @@ type CardSelectProps = BoxProps & {
|
|
676
678
|
* </CardSelect>
|
677
679
|
* ```
|
678
680
|
*
|
679
|
-
* @see https://spor.vy.no/
|
681
|
+
* @see https://spor.vy.no/components/card-select
|
680
682
|
*/
|
681
683
|
declare const CardSelect: _chakra_ui_system_dist_system_types.ComponentWithAs<"button", CardSelectProps>;
|
682
684
|
|
@@ -831,7 +833,7 @@ type FormErrorMessageProps = BoxProps & {
|
|
831
833
|
* </FormControl>
|
832
834
|
* ```
|
833
835
|
*
|
834
|
-
* @see https://spor.vy.no/
|
836
|
+
* @see https://spor.vy.no/components/form-control
|
835
837
|
*/
|
836
838
|
declare const FormErrorMessage: ({ children, ...boxProps }: FormErrorMessageProps) => React__default.JSX.Element | null;
|
837
839
|
|
@@ -969,7 +971,7 @@ type InfoSelectProps<T extends object> = {
|
|
969
971
|
* </InfoSelect>
|
970
972
|
* ```
|
971
973
|
*
|
972
|
-
* @see https://spor.vy.no/
|
974
|
+
* @see https://spor.vy.no/components/info-select
|
973
975
|
*/
|
974
976
|
declare function InfoSelect<T extends object>({ placeholder, width, height, onChange, value, isLabelSrOnly, defaultValue, ...props }: InfoSelectProps<T>): React__default.JSX.Element;
|
975
977
|
|
@@ -1343,7 +1345,7 @@ type InfoTagProps = TagProps;
|
|
1343
1345
|
* />
|
1344
1346
|
* ```
|
1345
1347
|
*
|
1346
|
-
* @see https://spor.vy.no/
|
1348
|
+
* @see https://spor.vy.no/components/line-tags
|
1347
1349
|
*/
|
1348
1350
|
declare const InfoTag: ({ variant, size, title, description, }: InfoTagProps) => React__default.JSX.Element;
|
1349
1351
|
|
@@ -1366,7 +1368,7 @@ type LineIconProps = BoxProps & {
|
|
1366
1368
|
* <LineIcon variant="subway" size="lg" />
|
1367
1369
|
* ```
|
1368
1370
|
*
|
1369
|
-
* @see https://spor.vy.no/
|
1371
|
+
* @see https://spor.vy.no/components/line-tags
|
1370
1372
|
*/
|
1371
1373
|
declare const LineIcon: ({ variant, size, sx, ...rest }: LineIconProps) => React__default.JSX.Element | null;
|
1372
1374
|
|
@@ -1409,7 +1411,7 @@ type TravelTagProps = TagProps & BoxProps & {
|
|
1409
1411
|
* />
|
1410
1412
|
* ```
|
1411
1413
|
*
|
1412
|
-
* @see https://spor.vy.no/
|
1414
|
+
* @see https://spor.vy.no/components/line-tags
|
1413
1415
|
*/
|
1414
1416
|
declare const TravelTag: _chakra_ui_system_dist_system_types.ComponentWithAs<As, TravelTagProps>;
|
1415
1417
|
|
@@ -3445,7 +3447,7 @@ declare const theme: {
|
|
3445
3447
|
} | undefined;
|
3446
3448
|
defaultProps?: {
|
3447
3449
|
size?: string | number | undefined;
|
3448
|
-
variant?: "base" | "green" | "light" | "
|
3450
|
+
variant?: "base" | "green" | "light" | "dark" | "accent" | "brand" | undefined;
|
3449
3451
|
colorScheme?: string | undefined;
|
3450
3452
|
} | undefined;
|
3451
3453
|
parts: ("text" | "container" | "icon")[];
|
@@ -3527,26 +3529,54 @@ declare const theme: {
|
|
3527
3529
|
};
|
3528
3530
|
button: {
|
3529
3531
|
_disabled: {
|
3530
|
-
boxShadow: string;
|
3531
3532
|
_hover: {
|
3532
3533
|
boxShadow: string;
|
3533
3534
|
};
|
3534
3535
|
_focus: {
|
3535
3536
|
boxShadow: string;
|
3536
3537
|
};
|
3538
|
+
backgroundColor: string;
|
3539
|
+
color: string;
|
3540
|
+
} | {
|
3541
|
+
_hover: {
|
3542
|
+
boxShadow: string;
|
3543
|
+
};
|
3544
|
+
_focus: {
|
3545
|
+
boxShadow: string;
|
3546
|
+
};
|
3547
|
+
backgroundColor?: undefined;
|
3548
|
+
color: string;
|
3549
|
+
};
|
3550
|
+
_active: {
|
3551
|
+
boxShadow: string;
|
3552
|
+
backgroundColor: string;
|
3553
|
+
} | {
|
3554
|
+
boxShadow: string;
|
3555
|
+
backgroundColor?: undefined;
|
3556
|
+
};
|
3557
|
+
_expanded: {
|
3558
|
+
boxShadow: string;
|
3559
|
+
backgroundColor: string;
|
3560
|
+
} | {
|
3561
|
+
boxShadow: string;
|
3562
|
+
backgroundColor?: undefined;
|
3537
3563
|
};
|
3538
3564
|
_invalid: {
|
3539
3565
|
_focus: _chakra_ui_styled_system.SystemStyleObject;
|
3540
3566
|
_focusVisible: _chakra_ui_styled_system.SystemStyleObject;
|
3541
3567
|
"&[data-focus]:not([data-focus-visible])": _chakra_ui_styled_system.SystemStyleObject;
|
3542
|
-
boxShadow: string;
|
3543
3568
|
_hover: {
|
3544
3569
|
boxShadow: string;
|
3545
3570
|
};
|
3571
|
+
boxShadow: string;
|
3546
3572
|
};
|
3547
3573
|
_focus: _chakra_ui_styled_system.SystemStyleObject;
|
3548
3574
|
_focusVisible: _chakra_ui_styled_system.SystemStyleObject;
|
3549
3575
|
"&[data-focus]:not([data-focus-visible])": _chakra_ui_styled_system.SystemStyleObject;
|
3576
|
+
_hover: {
|
3577
|
+
boxShadow: string;
|
3578
|
+
};
|
3579
|
+
boxShadow: string;
|
3550
3580
|
appearance: string;
|
3551
3581
|
borderTopRadius: string;
|
3552
3582
|
borderBottomRadius: string | number;
|
@@ -3556,10 +3586,6 @@ declare const theme: {
|
|
3556
3586
|
justifyContent: string;
|
3557
3587
|
alignItems: string;
|
3558
3588
|
fontSize: string;
|
3559
|
-
boxShadow: string;
|
3560
|
-
_hover: {
|
3561
|
-
boxShadow: string;
|
3562
|
-
};
|
3563
3589
|
};
|
3564
3590
|
arrowIcon: {};
|
3565
3591
|
}) | undefined;
|
@@ -3716,13 +3742,9 @@ declare const theme: {
|
|
3716
3742
|
baseStyle?: ((props: _chakra_ui_styled_system.StyleFunctionProps) => {
|
3717
3743
|
field: {
|
3718
3744
|
_disabled: {
|
3745
|
+
backgroundColor: string;
|
3719
3746
|
boxShadow: string;
|
3720
|
-
|
3721
|
-
boxShadow: string;
|
3722
|
-
};
|
3723
|
-
_focus: {
|
3724
|
-
boxShadow: string;
|
3725
|
-
};
|
3747
|
+
cursor: string;
|
3726
3748
|
};
|
3727
3749
|
_invalid: {
|
3728
3750
|
_focus: _chakra_ui_styled_system.SystemStyleObject;
|
@@ -3777,6 +3799,11 @@ declare const theme: {
|
|
3777
3799
|
element: {
|
3778
3800
|
height: string;
|
3779
3801
|
};
|
3802
|
+
group: {
|
3803
|
+
":has(:disabled)": {
|
3804
|
+
color: string;
|
3805
|
+
};
|
3806
|
+
};
|
3780
3807
|
}) | undefined;
|
3781
3808
|
sizes?: {
|
3782
3809
|
[key: string]: _chakra_ui_styled_system.PartsStyleInterpolation<{
|
@@ -3981,11 +4008,16 @@ declare const theme: {
|
|
3981
4008
|
};
|
3982
4009
|
List: {
|
3983
4010
|
baseStyle?: {
|
4011
|
+
container: {
|
4012
|
+
fontSize: ("mobile.sm" | "desktop.sm")[];
|
4013
|
+
};
|
4014
|
+
item: {
|
4015
|
+
fontFamily: string;
|
4016
|
+
};
|
3984
4017
|
icon: {
|
3985
4018
|
marginEnd: string;
|
3986
4019
|
display: string;
|
3987
4020
|
verticalAlign: string;
|
3988
|
-
fontFamily: string;
|
3989
4021
|
};
|
3990
4022
|
} | undefined;
|
3991
4023
|
sizes?: {
|
@@ -4008,7 +4040,7 @@ declare const theme: {
|
|
4008
4040
|
ListBox: {
|
4009
4041
|
baseStyle?: ((props: _chakra_ui_styled_system.StyleFunctionProps) => {
|
4010
4042
|
container: {
|
4011
|
-
|
4043
|
+
backgroundColor: string;
|
4012
4044
|
boxShadow: string;
|
4013
4045
|
overflowY: string;
|
4014
4046
|
maxHeight: string;
|
@@ -4037,8 +4069,11 @@ declare const theme: {
|
|
4037
4069
|
backgroundColor: string;
|
4038
4070
|
};
|
4039
4071
|
_selected: {
|
4072
|
+
color: string;
|
4040
4073
|
backgroundColor: string;
|
4074
|
+
} | {
|
4041
4075
|
color: string;
|
4076
|
+
backgroundColor?: undefined;
|
4042
4077
|
};
|
4043
4078
|
};
|
4044
4079
|
label: {};
|
@@ -4400,13 +4435,9 @@ declare const theme: {
|
|
4400
4435
|
background: string;
|
4401
4436
|
};
|
4402
4437
|
_disabled: {
|
4438
|
+
backgroundColor: string;
|
4403
4439
|
boxShadow: string;
|
4404
|
-
|
4405
|
-
boxShadow: string;
|
4406
|
-
};
|
4407
|
-
_focus: {
|
4408
|
-
boxShadow: string;
|
4409
|
-
};
|
4440
|
+
cursor: string;
|
4410
4441
|
};
|
4411
4442
|
_invalid: {
|
4412
4443
|
_focus: _chakra_ui_styled_system.SystemStyleObject;
|
@@ -4466,7 +4497,7 @@ declare const theme: {
|
|
4466
4497
|
strokeLinecap: string;
|
4467
4498
|
fontSize: string;
|
4468
4499
|
_disabled: {
|
4469
|
-
|
4500
|
+
color: string;
|
4470
4501
|
};
|
4471
4502
|
};
|
4472
4503
|
}) | undefined;
|
@@ -5217,13 +5248,9 @@ declare const theme: {
|
|
5217
5248
|
};
|
5218
5249
|
};
|
5219
5250
|
_disabled: {
|
5251
|
+
backgroundColor: string;
|
5220
5252
|
boxShadow: string;
|
5221
|
-
|
5222
|
-
boxShadow: string;
|
5223
|
-
};
|
5224
|
-
_focus: {
|
5225
|
-
boxShadow: string;
|
5226
|
-
};
|
5253
|
+
cursor: string;
|
5227
5254
|
};
|
5228
5255
|
_invalid: {
|
5229
5256
|
_focus: _chakra_ui_styled_system.SystemStyleObject;
|
package/dist/index.js
CHANGED
@@ -360,7 +360,9 @@ var init_DarkSpinner = __esm({
|
|
360
360
|
maxWidth,
|
361
361
|
...props
|
362
362
|
}) => {
|
363
|
-
|
363
|
+
const { colorMode } = react.useColorMode();
|
364
|
+
const spinnerData = colorMode === "dark" ? sporLoader.spinnerLightData : sporLoader.spinnerDarkData;
|
365
|
+
return /* @__PURE__ */ React69__namespace.default.createElement(react.Center, { flexDirection: "column", ...props }, /* @__PURE__ */ React69__namespace.default.createElement(react.Box, { width, maxWidth }, /* @__PURE__ */ React69__namespace.default.createElement(ClientOnly, null, () => /* @__PURE__ */ React69__namespace.default.createElement(Lottie, { animationData: spinnerData }))), children && /* @__PURE__ */ React69__namespace.default.createElement(react.Box, { marginTop: 3, fontWeight: "bold" }, children));
|
364
366
|
};
|
365
367
|
}
|
366
368
|
});
|
@@ -5632,7 +5634,8 @@ var init_PasswordInput = __esm({
|
|
5632
5634
|
type: "button",
|
5633
5635
|
onClick: onToggle,
|
5634
5636
|
borderRadius: "sm",
|
5635
|
-
marginRight: 1
|
5637
|
+
marginRight: 1,
|
5638
|
+
isDisabled: props.disabled || props.isDisabled
|
5636
5639
|
},
|
5637
5640
|
isShowingPassword ? t2(texts13.hidePassword) : t2(texts13.showPassword)
|
5638
5641
|
)));
|
@@ -14513,13 +14516,88 @@ var init_sr_utils = __esm({
|
|
14513
14516
|
};
|
14514
14517
|
}
|
14515
14518
|
});
|
14519
|
+
function baseBorder(state2, props) {
|
14520
|
+
switch (state2) {
|
14521
|
+
case "hover":
|
14522
|
+
return {
|
14523
|
+
boxShadow: getBoxShadowString({
|
14524
|
+
borderColor: themeTools.mode("darkGrey", "white")(props),
|
14525
|
+
borderWidth: 2
|
14526
|
+
})
|
14527
|
+
};
|
14528
|
+
case "focus": {
|
14529
|
+
return {
|
14530
|
+
boxShadow: getBoxShadowString({
|
14531
|
+
borderColor: themeTools.mode("greenHaze", "azure")(props),
|
14532
|
+
borderWidth: 2
|
14533
|
+
})
|
14534
|
+
};
|
14535
|
+
}
|
14536
|
+
case "disabled": {
|
14537
|
+
return {
|
14538
|
+
boxShadow: getBoxShadowString({
|
14539
|
+
borderColor: themeTools.mode("platinum", "whiteAlpha.400")(props)
|
14540
|
+
})
|
14541
|
+
};
|
14542
|
+
}
|
14543
|
+
case "selected":
|
14544
|
+
return {
|
14545
|
+
boxShadow: getBoxShadowString({
|
14546
|
+
borderColor: themeTools.mode("greenHaze", "azure")(props)
|
14547
|
+
})
|
14548
|
+
};
|
14549
|
+
case "invalid": {
|
14550
|
+
return {
|
14551
|
+
boxShadow: getBoxShadowString({
|
14552
|
+
borderColor: "brightRed",
|
14553
|
+
borderWidth: 2
|
14554
|
+
})
|
14555
|
+
};
|
14556
|
+
}
|
14557
|
+
case "default":
|
14558
|
+
default:
|
14559
|
+
return {
|
14560
|
+
boxShadow: getBoxShadowString({
|
14561
|
+
borderColor: themeTools.mode("blackAlpha.400", "whiteAlpha.400")(props)
|
14562
|
+
})
|
14563
|
+
};
|
14564
|
+
}
|
14565
|
+
}
|
14566
|
+
var init_border_utils = __esm({
|
14567
|
+
"src/theme/utils/border-utils.ts"() {
|
14568
|
+
init_box_shadow_utils();
|
14569
|
+
}
|
14570
|
+
});
|
14571
|
+
function baseBackground(state2, props) {
|
14572
|
+
switch (state2) {
|
14573
|
+
case "active":
|
14574
|
+
return {
|
14575
|
+
backgroundColor: themeTools.mode("mint", "whiteAlpha.100")(props)
|
14576
|
+
};
|
14577
|
+
case "selected":
|
14578
|
+
return {
|
14579
|
+
backgroundColor: "pine"
|
14580
|
+
};
|
14581
|
+
case "disabled":
|
14582
|
+
return {
|
14583
|
+
backgroundColor: themeTools.mode("silver", "whiteAlpha.100")(props)
|
14584
|
+
};
|
14585
|
+
default:
|
14586
|
+
return {};
|
14587
|
+
}
|
14588
|
+
}
|
14589
|
+
var init_background_utils = __esm({
|
14590
|
+
"src/theme/utils/background-utils.ts"() {
|
14591
|
+
}
|
14592
|
+
});
|
14516
14593
|
var parts6, helpers10, config18, info_select_default;
|
14517
14594
|
var init_info_select = __esm({
|
14518
14595
|
"src/theme/components/info-select.ts"() {
|
14519
14596
|
init_dist4();
|
14520
|
-
init_box_shadow_utils();
|
14521
14597
|
init_focus_utils();
|
14522
14598
|
init_sr_utils();
|
14599
|
+
init_border_utils();
|
14600
|
+
init_background_utils();
|
14523
14601
|
parts6 = anatomy("InfoSelect").parts(
|
14524
14602
|
"container",
|
14525
14603
|
"label",
|
@@ -14544,57 +14622,44 @@ var init_info_select = __esm({
|
|
14544
14622
|
justifyContent: "space-between",
|
14545
14623
|
alignItems: "center",
|
14546
14624
|
fontSize: "mobile.md",
|
14547
|
-
|
14548
|
-
borderColor: themeTools.mode("blackAlpha.400", "whiteAlpha.400")(props)
|
14549
|
-
}),
|
14625
|
+
...baseBorder("default", props),
|
14550
14626
|
_hover: {
|
14551
|
-
|
14552
|
-
borderColor: themeTools.mode("darkGrey", "whiteAlpha.600")(props),
|
14553
|
-
borderWidth: 2
|
14554
|
-
})
|
14627
|
+
...baseBorder("hover", props)
|
14555
14628
|
},
|
14556
14629
|
...focusVisible({
|
14557
14630
|
focus: {
|
14558
|
-
|
14559
|
-
borderColor: "greenHaze",
|
14560
|
-
borderWidth: 2
|
14561
|
-
}),
|
14631
|
+
...baseBorder("focus", props),
|
14562
14632
|
outline: "none"
|
14563
14633
|
},
|
14564
14634
|
notFocus: {
|
14565
|
-
|
14566
|
-
borderColor: themeTools.mode("blackAlpha.400", "whiteAlpha.400")(props)
|
14567
|
-
})
|
14635
|
+
...baseBorder("default", props)
|
14568
14636
|
}
|
14569
14637
|
}),
|
14570
14638
|
_disabled: {
|
14571
|
-
|
14572
|
-
|
14573
|
-
|
14639
|
+
color: "whiteAlpha.400",
|
14640
|
+
...baseBackground("disabled", props),
|
14641
|
+
_hover: { ...baseBorder("disabled", props) },
|
14642
|
+
_focus: { ...baseBorder("disabled", props) }
|
14643
|
+
},
|
14644
|
+
_active: {
|
14645
|
+
...baseBackground("active", props),
|
14646
|
+
...baseBorder("focus", props)
|
14647
|
+
},
|
14648
|
+
_expanded: {
|
14649
|
+
...baseBackground("active", props),
|
14650
|
+
...baseBorder("focus", props)
|
14574
14651
|
},
|
14575
14652
|
_invalid: {
|
14576
|
-
|
14577
|
-
borderColor: "brightRed",
|
14578
|
-
borderWidth: 2
|
14579
|
-
}),
|
14653
|
+
...baseBorder("invalid", props),
|
14580
14654
|
_hover: {
|
14581
|
-
|
14582
|
-
borderColor: "darkGrey",
|
14583
|
-
borderWidth: 2
|
14584
|
-
})
|
14655
|
+
...baseBorder("hover", props)
|
14585
14656
|
},
|
14586
14657
|
...focusVisible({
|
14587
14658
|
focus: {
|
14588
|
-
|
14589
|
-
borderColor: "greenHaze",
|
14590
|
-
borderWidth: 2
|
14591
|
-
})
|
14659
|
+
...baseBorder("focus", props)
|
14592
14660
|
},
|
14593
14661
|
notFocus: {
|
14594
|
-
|
14595
|
-
borderColor: "brightRed",
|
14596
|
-
borderWidth: 2
|
14597
|
-
})
|
14662
|
+
...baseBorder("invalid", props)
|
14598
14663
|
}
|
14599
14664
|
})
|
14600
14665
|
}
|
@@ -14975,13 +15040,15 @@ var init_input2 = __esm({
|
|
14975
15040
|
})
|
14976
15041
|
},
|
14977
15042
|
notFocus: {
|
14978
|
-
boxShadow: getBoxShadowString({ borderColor: "darkGrey" })
|
15043
|
+
boxShadow: getBoxShadowString({ borderColor: themeTools.mode("darkGrey", "white")(props) })
|
14979
15044
|
}
|
14980
15045
|
}),
|
14981
15046
|
_disabled: {
|
14982
|
-
|
14983
|
-
|
14984
|
-
|
15047
|
+
backgroundColor: themeTools.mode("blackAlpha.100", "whiteAlpha.100")(props),
|
15048
|
+
boxShadow: getBoxShadowString({
|
15049
|
+
borderColor: themeTools.mode("blackAlpha.200", "whiteAlpha.200")(props)
|
15050
|
+
}),
|
15051
|
+
cursor: "not-allowed"
|
14985
15052
|
},
|
14986
15053
|
_invalid: {
|
14987
15054
|
boxShadow: getBoxShadowString({
|
@@ -14990,7 +15057,7 @@ var init_input2 = __esm({
|
|
14990
15057
|
}),
|
14991
15058
|
_hover: {
|
14992
15059
|
boxShadow: getBoxShadowString({
|
14993
|
-
borderColor: "darkGrey",
|
15060
|
+
borderColor: themeTools.mode("darkGrey", "white")(props),
|
14994
15061
|
borderWidth: 2
|
14995
15062
|
})
|
14996
15063
|
},
|
@@ -15029,6 +15096,11 @@ var init_input2 = __esm({
|
|
15029
15096
|
},
|
15030
15097
|
element: {
|
15031
15098
|
height: "100%"
|
15099
|
+
},
|
15100
|
+
group: {
|
15101
|
+
":has(:disabled)": {
|
15102
|
+
color: themeTools.mode("blackAlpha.400", "whiteAlpha.400")(props)
|
15103
|
+
}
|
15032
15104
|
}
|
15033
15105
|
})
|
15034
15106
|
});
|
@@ -15248,20 +15320,24 @@ var init_link2 = __esm({
|
|
15248
15320
|
});
|
15249
15321
|
|
15250
15322
|
// src/theme/components/list.ts
|
15251
|
-
var defineMultiStyleConfig28, definePartsStyle28,
|
15323
|
+
var defineMultiStyleConfig28, definePartsStyle28, baseStyle45, list_default;
|
15252
15324
|
var init_list2 = __esm({
|
15253
15325
|
"src/theme/components/list.ts"() {
|
15254
15326
|
init_dist4();
|
15255
15327
|
init_dist3();
|
15256
15328
|
({ defineMultiStyleConfig: defineMultiStyleConfig28, definePartsStyle: definePartsStyle28 } = createMultiStyleConfigHelpers(listAnatomy.keys));
|
15257
|
-
baseStyleIcon8 = defineStyle({
|
15258
|
-
marginEnd: "2",
|
15259
|
-
display: "inline",
|
15260
|
-
verticalAlign: "text-bottom",
|
15261
|
-
fontFamily: "body"
|
15262
|
-
});
|
15263
15329
|
baseStyle45 = definePartsStyle28({
|
15264
|
-
|
15330
|
+
container: {
|
15331
|
+
fontSize: ["mobile.sm", "desktop.sm"]
|
15332
|
+
},
|
15333
|
+
item: {
|
15334
|
+
fontFamily: "body"
|
15335
|
+
},
|
15336
|
+
icon: {
|
15337
|
+
marginEnd: "2",
|
15338
|
+
display: "inline",
|
15339
|
+
verticalAlign: "text-bottom"
|
15340
|
+
}
|
15265
15341
|
});
|
15266
15342
|
list_default = defineMultiStyleConfig28({
|
15267
15343
|
baseStyle: baseStyle45
|
@@ -15272,6 +15348,8 @@ var parts10, helpers15, config24, listbox_default;
|
|
15272
15348
|
var init_listbox = __esm({
|
15273
15349
|
"src/theme/components/listbox.ts"() {
|
15274
15350
|
init_dist4();
|
15351
|
+
init_foundations();
|
15352
|
+
init_background_utils();
|
15275
15353
|
parts10 = anatomy("ListBox").parts(
|
15276
15354
|
"container",
|
15277
15355
|
"item",
|
@@ -15282,7 +15360,11 @@ var init_listbox = __esm({
|
|
15282
15360
|
config24 = helpers15.defineMultiStyleConfig({
|
15283
15361
|
baseStyle: (props) => ({
|
15284
15362
|
container: {
|
15285
|
-
|
15363
|
+
// avoiding extra div by blending a transparent color into darkGrey for dark mode
|
15364
|
+
backgroundColor: themeTools.mode(
|
15365
|
+
"mint",
|
15366
|
+
`color-mix(in srgb, ${colors.darkGrey}, ${colors.white} 10%)`
|
15367
|
+
)(props),
|
15286
15368
|
boxShadow: "sm",
|
15287
15369
|
overflowY: "auto",
|
15288
15370
|
maxHeight: "50vh",
|
@@ -15299,20 +15381,20 @@ var init_listbox = __esm({
|
|
15299
15381
|
color: themeTools.mode("darkGrey", "white")(props),
|
15300
15382
|
cursor: "pointer",
|
15301
15383
|
_hover: {
|
15302
|
-
backgroundColor: themeTools.mode("seaMist", "
|
15384
|
+
backgroundColor: themeTools.mode("seaMist", "pine")(props),
|
15303
15385
|
outline: "none"
|
15304
15386
|
},
|
15305
15387
|
_active: {
|
15306
|
-
backgroundColor: themeTools.mode("mint", "
|
15388
|
+
backgroundColor: themeTools.mode("mint", "pine")(props),
|
15307
15389
|
outline: "none"
|
15308
15390
|
},
|
15309
15391
|
_focus: {
|
15310
15392
|
outline: "none",
|
15311
|
-
backgroundColor: themeTools.mode("seaMist", "
|
15393
|
+
backgroundColor: themeTools.mode("seaMist", "pine")(props)
|
15312
15394
|
},
|
15313
15395
|
_selected: {
|
15314
|
-
|
15315
|
-
color:
|
15396
|
+
...baseBackground("selected", props),
|
15397
|
+
color: "white"
|
15316
15398
|
}
|
15317
15399
|
},
|
15318
15400
|
label: {},
|
@@ -15732,7 +15814,7 @@ var init_select = __esm({
|
|
15732
15814
|
strokeLinecap: "round",
|
15733
15815
|
fontSize: "1.125rem",
|
15734
15816
|
_disabled: {
|
15735
|
-
|
15817
|
+
color: themeTools.mode("blackAlpha.400", "whiteAlpha.400")(props)
|
15736
15818
|
}
|
15737
15819
|
}
|
15738
15820
|
})
|
package/dist/index.mjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export { Accordion, AccordionButton, AccordionIcon, AccordionItem, AccordionPanel, AttachedInputs, Badge, Box, 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, NumericStepper, OrderedList, PasswordInput, PhoneNumberInput, PlayPauseButton, Popover, PopoverAnchor, PopoverArrow, PopoverBody, PopoverCloseButton, PopoverContent, PopoverFooter, PopoverHeader, PopoverTrigger, PopoverWizardBody, Portal, ProgressBar, ProgressLoader, Radio, RadioGroup, ScaleFade, SearchInput, Section, SimpleDrawer, SimpleGrid, SimplePopover, 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, Tr, TravelTag, UnorderedList, VStack, VyLogo, WizardPopover, Wrap, WrapItem, createTexts, extendTheme, fontFaces, theme, tokens, useBreakpointValue, useClipboard, useColorMode, useColorModePreference, useColorModeValue, useControllableProp, useDisclosure, useMediaQuery, useMergeRefs, useOutsideClick, usePrefersReducedMotion, useTheme, useToast, useToken, useTranslation } from './chunk-
|
1
|
+
export { Accordion, AccordionButton, AccordionIcon, AccordionItem, AccordionPanel, AttachedInputs, Badge, Box, 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, NumericStepper, OrderedList, PasswordInput, PhoneNumberInput, PlayPauseButton, Popover, PopoverAnchor, PopoverArrow, PopoverBody, PopoverCloseButton, PopoverContent, PopoverFooter, PopoverHeader, PopoverTrigger, PopoverWizardBody, Portal, ProgressBar, ProgressLoader, Radio, RadioGroup, ScaleFade, SearchInput, Section, SimpleDrawer, SimpleGrid, SimplePopover, 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, Tr, TravelTag, UnorderedList, VStack, VyLogo, WizardPopover, Wrap, WrapItem, createTexts, extendTheme, fontFaces, theme, tokens, useBreakpointValue, useClipboard, useColorMode, useColorModePreference, useColorModeValue, useControllableProp, useDisclosure, useMediaQuery, useMergeRefs, useOutsideClick, usePrefersReducedMotion, useTheme, useToast, useToken, useTranslation } from './chunk-XT6QVKN5.mjs';
|
package/package.json
CHANGED
package/src/button/Button.tsx
CHANGED
@@ -24,9 +24,11 @@ type TimePickerProps = Omit<BoxProps, "defaultValue" | "onChange"> & {
|
|
24
24
|
value?: TimeValue;
|
25
25
|
/** A default value, if any.
|
26
26
|
*
|
27
|
-
* A `new Time(hours, minutes)` should be passed.
|
27
|
+
* A `new Time(hours, minutes)` should be passed.
|
28
|
+
* Defaults to the current time if not provided.
|
29
|
+
* Can be set to null if you don't want a time to be selected by default.
|
28
30
|
**/
|
29
|
-
defaultValue?: TimeValue;
|
31
|
+
defaultValue?: TimeValue | null;
|
30
32
|
/** Callback for when the time changes */
|
31
33
|
onChange?: (value: TimeValue) => void;
|
32
34
|
/** The maxiumum number of minutes to move when the step buttons are used.
|
@@ -55,7 +57,7 @@ type TimePickerProps = Omit<BoxProps, "defaultValue" | "onChange"> & {
|
|
55
57
|
*
|
56
58
|
* Note that the TimePicker uses the `Time` class to represent the time. This is a class that is part of the `@internationalized/date` package.
|
57
59
|
*
|
58
|
-
* @see https://spor.vy.no/
|
60
|
+
* @see https://spor.vy.no/komponents/timepicker
|
59
61
|
*/
|
60
62
|
export const TimePicker = ({
|
61
63
|
label: externalLabel,
|
package/src/input/CardSelect.tsx
CHANGED
package/src/input/InfoSelect.tsx
CHANGED
@@ -147,7 +147,7 @@ type InfoSelectProps<T extends object> = {
|
|
147
147
|
* </InfoSelect>
|
148
148
|
* ```
|
149
149
|
*
|
150
|
-
* @see https://spor.vy.no/
|
150
|
+
* @see https://spor.vy.no/components/info-select
|
151
151
|
*/
|
152
152
|
export function InfoSelect<T extends object>({
|
153
153
|
placeholder,
|
@@ -46,6 +46,7 @@ export const PasswordInput = forwardRef<PasswordInputProps, "input">(
|
|
46
46
|
onClick={onToggle}
|
47
47
|
borderRadius="sm"
|
48
48
|
marginRight={1}
|
49
|
+
isDisabled={props.disabled || props.isDisabled}
|
49
50
|
>
|
50
51
|
{isShowingPassword ? t(texts.hidePassword) : t(texts.showPassword)}
|
51
52
|
</Button>
|