@vygruppen/spor-react 9.8.3 → 9.10.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/dist/index.d.mts CHANGED
@@ -65,13 +65,8 @@ type StackProps = Exclude<StackProps$1, "direction"> & {
65
65
  */
66
66
  declare const Stack: _chakra_ui_system_dist_system_types.ComponentWithAs<"div", StackProps>;
67
67
 
68
- type RadioCardProps = UseRadioProps & BoxProps & {
69
- children: React.ReactNode;
70
- /** Defaults to "base" */
71
- variant: "floating" | "base";
72
- };
73
68
  /**
74
- * Renders a radio card.
69
+ * Radio cards are used to present a set of options where only one option can be selected.
75
70
  *
76
71
  * The most basic version looks like this:
77
72
  *
@@ -81,6 +76,14 @@ type RadioCardProps = UseRadioProps & BoxProps & {
81
76
  * </RadioCard>
82
77
  * ```
83
78
  *
79
+ * In order to use RadioCard outside a RadioCardGroup, you need to pass the `isChecked` and `onChange` props.
80
+ *
81
+ * ```tsx
82
+ * <RadioCard isChecked={true} onChange={(e) => console.log(e.target.value)}>
83
+ * Content
84
+ * </RadioCard>
85
+ * ```
86
+ *
84
87
  * In order to use RadioCard, you typically want to place these components in a group with several other RadioCards.
85
88
  *
86
89
  * ```tsx
@@ -112,6 +115,15 @@ type RadioCardProps = UseRadioProps & BoxProps & {
112
115
  * </RadioCard>
113
116
  * ```
114
117
  */
118
+ type RadioCardProps = UseRadioProps & BoxProps & {
119
+ children: React.ReactNode;
120
+ /** Defaults to "base" */
121
+ variant?: "floating" | "base";
122
+ /** Needs to be defined if RadioCard is used outside RadioCardGroup */
123
+ isChecked?: boolean;
124
+ /** Needs to be defined if RadioCard is used outside RadioCardGroup */
125
+ onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
126
+ };
115
127
  declare const RadioCard: _chakra_ui_system_dist_system_types.ComponentWithAs<"div", RadioCardProps>;
116
128
 
117
129
  type RadioCardGroupProps = RadioGroupProps$1 & {
@@ -211,7 +223,7 @@ declare const StaticCard: _chakra_ui_system_dist_system_types.ComponentWithAs<As
211
223
 
212
224
  type PressableCardProps = BoxProps & {
213
225
  /** Defaults to "base" */
214
- variant: "floating" | "accent" | "base";
226
+ variant?: "floating" | "accent" | "base";
215
227
  };
216
228
  /**
217
229
  * `PressableCard` is a component that renders a pressable card.
@@ -333,6 +345,8 @@ type BaseAlertProps = BoxProps & {
333
345
  variant: "info" | "success" | "warning" | "alt-transport" | "error";
334
346
  /** The body content of the alert */
335
347
  children: React.ReactNode;
348
+ /** The title of the alert */
349
+ title?: string;
336
350
  };
337
351
 
338
352
  type ClosableAlertProps = BaseAlertProps & {
@@ -361,7 +375,7 @@ type ClosableAlertProps = BaseAlertProps & {
361
375
  * <Text>Some info here</Text>
362
376
  * </ClosableAlert>
363
377
  */
364
- declare const ClosableAlert: ({ variant, children, onClose: externalOnClose, }: ClosableAlertProps) => React.JSX.Element | null;
378
+ declare const ClosableAlert: ({ variant, title, children, onClose: externalOnClose, }: ClosableAlertProps) => React.JSX.Element | null;
365
379
 
366
380
  type ExpandableAlertProps = BaseAlertProps & {
367
381
  /** The title string */
@@ -401,7 +415,7 @@ type StaticAlertProps = BaseAlertProps;
401
415
  * </StaticAlert>
402
416
  * ```
403
417
  */
404
- declare const StaticAlert: ({ children, ...props }: StaticAlertProps) => React.JSX.Element;
418
+ declare const StaticAlert: ({ children, title, ...props }: StaticAlertProps) => React.JSX.Element;
405
419
 
406
420
  type BreadcrumbProps = Omit<BreadcrumbProps$1, "variant"> & {
407
421
  variant?: "base" | "ghost";
@@ -1174,7 +1188,7 @@ type InfoSelectProps<T extends object> = {
1174
1188
  *
1175
1189
  * @see https://spor.vy.no/components/info-select
1176
1190
  */
1177
- declare function InfoSelect<T extends object>({ placeholder, width, height, onChange, value, isLabelSrOnly, defaultValue, variant, ...props }: InfoSelectProps<T>): React.JSX.Element;
1191
+ declare function InfoSelect<T extends object>({ placeholder, onChange, value, isLabelSrOnly, defaultValue, variant, ...props }: InfoSelectProps<T>): React.JSX.Element;
1178
1192
 
1179
1193
  type InputProps = Omit<InputProps$1, "variant" | "size"> & {
1180
1194
  /** The input's label */
@@ -2534,6 +2548,7 @@ declare const theme: {
2534
2548
  position: string;
2535
2549
  top: number;
2536
2550
  right: number;
2551
+ color: string;
2537
2552
  };
2538
2553
  } | undefined;
2539
2554
  sizes?: {
@@ -4619,6 +4634,13 @@ declare const theme: {
4619
4634
  position: string;
4620
4635
  width?: string | undefined;
4621
4636
  whiteSpace?: string | undefined;
4637
+ fontSize: ("desktop.sm" | "mobile.xs")[];
4638
+ };
4639
+ innerButton: {
4640
+ display: string;
4641
+ flexDir: string;
4642
+ alignItems: string;
4643
+ justifyContent: string;
4622
4644
  };
4623
4645
  button: {
4624
4646
  _disabled: {
@@ -4657,15 +4679,18 @@ declare const theme: {
4657
4679
  outlineColor: string;
4658
4680
  outlineStyle: string;
4659
4681
  outlineOffset: string;
4682
+ display: string;
4660
4683
  appearance: string;
4684
+ width: string;
4685
+ height: string;
4661
4686
  borderTopRadius: string;
4662
4687
  borderBottomRadius: string | number;
4663
4688
  paddingY: number;
4664
4689
  paddingX: number;
4665
- display: string;
4666
4690
  justifyContent: string;
4667
4691
  alignItems: string;
4668
4692
  fontSize: string;
4693
+ h: number;
4669
4694
  } | {
4670
4695
  _disabled: {
4671
4696
  backgroundColor: string;
@@ -4701,16 +4726,20 @@ declare const theme: {
4701
4726
  };
4702
4727
  outline: string;
4703
4728
  outlineColor: string;
4729
+ display: string;
4704
4730
  appearance: string;
4731
+ width: string;
4732
+ height: string;
4705
4733
  borderTopRadius: string;
4706
4734
  borderBottomRadius: string | number;
4707
4735
  paddingY: number;
4708
4736
  paddingX: number;
4709
- display: string;
4710
4737
  justifyContent: string;
4711
4738
  alignItems: string;
4712
4739
  fontSize: string;
4740
+ h: number;
4713
4741
  };
4742
+ placeholder: {};
4714
4743
  arrowIcon: {};
4715
4744
  }) | undefined;
4716
4745
  sizes?: {
@@ -5369,12 +5398,6 @@ declare const theme: {
5369
5398
  backgroundColor: string;
5370
5399
  };
5371
5400
  item: {
5372
- paddingX: number;
5373
- paddingY: number;
5374
- marginY: number;
5375
- marginX: number;
5376
- borderRadius: string;
5377
- color: string;
5378
5401
  cursor: string;
5379
5402
  outline: string;
5380
5403
  _active: {
@@ -5389,14 +5412,20 @@ declare const theme: {
5389
5412
  _selected: {
5390
5413
  backgroundColor: string;
5391
5414
  };
5415
+ color: string;
5416
+ paddingX: number;
5417
+ paddingY: number;
5418
+ marginY: number;
5419
+ marginX: number;
5420
+ borderRadius: string;
5392
5421
  };
5393
5422
  label: {};
5394
5423
  description: {
5395
- fontSize: ("mobile.xs" | "desktop.xs")[];
5396
- color: string;
5397
5424
  "[aria-selected='true'] &": {
5398
5425
  color: string;
5399
5426
  };
5427
+ color: string;
5428
+ fontSize: ("mobile.xs" | "desktop.xs")[];
5400
5429
  };
5401
5430
  }) | undefined;
5402
5431
  sizes?: {
@@ -5876,105 +5905,168 @@ declare const theme: {
5876
5905
  };
5877
5906
  RadioCard: {
5878
5907
  baseStyle?: ((props: any) => {
5879
- _checked: {
5880
- _hover: {
5881
- backgroundColor: string;
5882
- };
5883
- backgroundColor: string;
5884
- outline: string;
5885
- outlineColor: string;
5886
- };
5887
- _disabled: {
5888
- color: string;
5889
- outlineWidth: string;
5890
- outlineColor: string;
5891
- outlineStyle: string;
5892
- outlineOffset: string;
5893
- backgroundColor: string;
5894
- pointerEvents: string;
5895
- } | {
5896
- color: string;
5897
- outline: string;
5898
- outlineColor: string;
5899
- backgroundColor: string;
5900
- pointerEvents: string;
5901
- };
5902
- _focusVisible: {
5903
- outlineWidth: string;
5904
- outlineColor: string;
5905
- outlineStyle: string;
5906
- outlineOffset: string;
5907
- };
5908
- appearance: string;
5909
- border: string;
5910
- overflow: string;
5911
- fontSize: string;
5912
- display: string;
5913
- borderRadius: string;
5914
- }) | undefined;
5915
- sizes?: {
5916
- [key: string]: _chakra_ui_styled_system.SystemStyleInterpolation;
5917
- } | undefined;
5918
- variants?: {
5919
- base: (props: _chakra_ui_styled_system.StyleFunctionProps) => {
5920
- _hover: {
5908
+ container: {
5909
+ transitionProperty: string;
5910
+ transitionDuration: string;
5911
+ _disabled: {
5912
+ color: string;
5921
5913
  outlineWidth: string;
5922
5914
  outlineColor: string;
5923
5915
  outlineStyle: string;
5924
5916
  outlineOffset: string;
5925
5917
  backgroundColor: string;
5918
+ pointerEvents: string;
5926
5919
  } | {
5920
+ color: string;
5927
5921
  outline: string;
5928
5922
  outlineColor: string;
5929
5923
  backgroundColor: string;
5924
+ pointerEvents: string;
5930
5925
  };
5931
- _active: {
5932
- backgroundColor: string;
5926
+ _focusVisible: {
5927
+ outlineWidth: string;
5928
+ outlineColor: string;
5929
+ outlineStyle: string;
5930
+ outlineOffset: string;
5933
5931
  };
5934
- outlineWidth: string;
5935
- outlineColor: string;
5936
- outlineStyle: string;
5937
- outlineOffset: string;
5932
+ appearance: string;
5933
+ border: string;
5934
+ overflow: string;
5935
+ fontSize: string;
5936
+ display: string;
5937
+ cursor: string;
5938
+ borderRadius: string;
5939
+ };
5940
+ checked: {
5938
5941
  backgroundColor: string;
5939
- } | {
5940
- _hover: {
5942
+ outlineColor: string;
5943
+ outline: string;
5944
+ };
5945
+ radioInput: {
5946
+ appearance: string;
5947
+ position: string;
5948
+ opacity: number;
5949
+ zIndex: number;
5950
+ };
5951
+ }) | undefined;
5952
+ sizes?: {
5953
+ [key: string]: _chakra_ui_styled_system.PartsStyleInterpolation<{
5954
+ keys: ("container" | "checked" | "radioInput")[];
5955
+ }>;
5956
+ } | undefined;
5957
+ variants?: {
5958
+ base: (props: _chakra_ui_styled_system.StyleFunctionProps) => {
5959
+ container: {
5960
+ _hover: {
5961
+ outlineWidth: string;
5962
+ outlineColor: string;
5963
+ outlineStyle: string;
5964
+ outlineOffset: string;
5965
+ backgroundColor: string;
5966
+ } | {
5967
+ outline: string;
5968
+ outlineColor: string;
5969
+ backgroundColor: string;
5970
+ };
5971
+ _active: {
5972
+ outlineWidth: string;
5973
+ outlineColor: string;
5974
+ outlineStyle: string;
5975
+ outlineOffset: string;
5976
+ backgroundColor: string;
5977
+ } | {
5978
+ outline: string;
5979
+ outlineColor: string;
5980
+ backgroundColor: string;
5981
+ };
5941
5982
  outlineWidth: string;
5942
5983
  outlineColor: string;
5943
5984
  outlineStyle: string;
5944
5985
  outlineOffset: string;
5945
5986
  backgroundColor: string;
5987
+ color: string;
5946
5988
  } | {
5989
+ _hover: {
5990
+ outlineWidth: string;
5991
+ outlineColor: string;
5992
+ outlineStyle: string;
5993
+ outlineOffset: string;
5994
+ backgroundColor: string;
5995
+ } | {
5996
+ outline: string;
5997
+ outlineColor: string;
5998
+ backgroundColor: string;
5999
+ };
6000
+ _active: {
6001
+ outlineWidth: string;
6002
+ outlineColor: string;
6003
+ outlineStyle: string;
6004
+ outlineOffset: string;
6005
+ backgroundColor: string;
6006
+ } | {
6007
+ outline: string;
6008
+ outlineColor: string;
6009
+ backgroundColor: string;
6010
+ };
5947
6011
  outline: string;
5948
6012
  outlineColor: string;
5949
6013
  backgroundColor: string;
6014
+ color: string;
5950
6015
  };
5951
- _active: {
5952
- backgroundColor: string;
6016
+ checked: {
6017
+ _hover: {
6018
+ outlineWidth: string;
6019
+ outlineColor: string;
6020
+ outlineStyle: string;
6021
+ outlineOffset: string;
6022
+ } | {
6023
+ outline: string;
6024
+ outlineColor: string;
6025
+ };
6026
+ _active: {
6027
+ outlineWidth: string;
6028
+ outlineColor: string;
6029
+ outlineStyle: string;
6030
+ outlineOffset: string;
6031
+ backgroundColor: string;
6032
+ } | {
6033
+ outline: string;
6034
+ outlineColor: string;
6035
+ backgroundColor: string;
6036
+ };
5953
6037
  };
5954
- outline: string;
5955
- outlineColor: string;
5956
- backgroundColor: string;
5957
6038
  };
5958
6039
  floating: (props: _chakra_ui_styled_system.StyleFunctionProps) => {
5959
- boxShadow: string;
5960
- _hover: {
6040
+ container: {
5961
6041
  boxShadow: string;
6042
+ _hover: {
6043
+ boxShadow: string;
6044
+ outline: string;
6045
+ outlineColor: string;
6046
+ backgroundColor: string;
6047
+ };
6048
+ _active: {
6049
+ outline: string;
6050
+ outlineColor: string;
6051
+ backgroundColor: string;
6052
+ };
5962
6053
  outline: string;
5963
6054
  outlineColor: string;
5964
6055
  backgroundColor: string;
6056
+ color: string;
5965
6057
  };
5966
- _active: {
5967
- outline: string;
5968
- outlineColor: string;
5969
- backgroundColor: string;
5970
- };
5971
- _checked: {
6058
+ checked: {
6059
+ cursor: string;
5972
6060
  _hover: {
5973
6061
  outline: string;
5974
6062
  outlineColor: string;
5975
6063
  };
6064
+ _active: {
6065
+ outline: string;
6066
+ outlineColor: string;
6067
+ backgroundColor: string;
6068
+ };
5976
6069
  };
5977
- backgroundColor: string;
5978
6070
  };
5979
6071
  } | undefined;
5980
6072
  defaultProps?: {
@@ -5982,6 +6074,7 @@ declare const theme: {
5982
6074
  variant?: "base" | "floating" | undefined;
5983
6075
  colorScheme?: string | undefined;
5984
6076
  } | undefined;
6077
+ parts: ("container" | "checked" | "radioInput")[];
5985
6078
  };
5986
6079
  Radio: {
5987
6080
  baseStyle?: ((props: _chakra_ui_styled_system.StyleFunctionProps) => {
@@ -7224,25 +7317,39 @@ declare const theme: {
7224
7317
  };
7225
7318
  PressableCard: {
7226
7319
  baseStyle?: ((props: _chakra_ui_styled_system.StyleFunctionProps) => {
7320
+ appearance: string;
7321
+ border: string;
7322
+ overflow: string;
7323
+ fontSize: string;
7324
+ display: string;
7325
+ borderRadius: string;
7326
+ cursor: string;
7327
+ transitionProperty: string;
7328
+ transitionDuration: string;
7329
+ "button&, a&, label&, &.is-clickable": {
7330
+ _focusVisible: {
7331
+ outlineWidth: string;
7332
+ outlineColor: string;
7333
+ outlineStyle: string;
7334
+ outlineOffset: string;
7335
+ };
7336
+ };
7227
7337
  _disabled: {
7228
7338
  outline: string;
7229
7339
  pointerEvents: string;
7230
7340
  color: string;
7231
- backgroundColor: string;
7232
- };
7233
- _focusVisible: {
7234
7341
  outlineWidth: string;
7235
7342
  outlineColor: string;
7236
7343
  outlineStyle: string;
7237
7344
  outlineOffset: string;
7345
+ backgroundColor: string;
7346
+ } | {
7347
+ outline: string;
7348
+ pointerEvents: string;
7349
+ color: string;
7350
+ outlineColor: string;
7351
+ backgroundColor: string;
7238
7352
  };
7239
- appearance: string;
7240
- border: string;
7241
- overflow: string;
7242
- fontSize: string;
7243
- display: string;
7244
- borderRadius: string;
7245
- cursor: string;
7246
7353
  }) | undefined;
7247
7354
  sizes?: {
7248
7355
  [key: string]: _chakra_ui_styled_system.SystemStyleInterpolation;
@@ -7273,6 +7380,7 @@ declare const theme: {
7273
7380
  outlineColor: string;
7274
7381
  outlineStyle: string;
7275
7382
  outlineOffset: string;
7383
+ cursor: string;
7276
7384
  } | {
7277
7385
  _hover: {
7278
7386
  outlineWidth: string;
@@ -7296,6 +7404,7 @@ declare const theme: {
7296
7404
  };
7297
7405
  outline: string;
7298
7406
  outlineColor: string;
7407
+ cursor: string;
7299
7408
  };
7300
7409
  accent: (props: _chakra_ui_styled_system.StyleFunctionProps) => {
7301
7410
  boxShadow: string;
@@ -7320,7 +7429,11 @@ declare const theme: {
7320
7429
  _active: {
7321
7430
  boxShadow: string;
7322
7431
  backgroundColor: string;
7432
+ outline: string;
7433
+ outlineColor: string;
7323
7434
  };
7435
+ outline: string;
7436
+ outlineColor: string;
7324
7437
  backgroundColor: string;
7325
7438
  };
7326
7439
  } | undefined;