@vygruppen/spor-react 8.0.1 → 8.1.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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @vygruppen/spor-react@8.0.1 build
2
+ > @vygruppen/spor-react@8.1.0 build
3
3
  > tsup src/index.tsx --dts --treeshake --format cjs,esm
4
4
 
5
5
  CLI Building entry: src/index.tsx
@@ -8,15 +8,15 @@
8
8
  CLI Target: node16
9
9
  CJS Build start
10
10
  ESM Build start
11
- "Collapse" is imported from external module "@chakra-ui/react" but never used in "dist/chunk-5VZ5S46A.mjs".
12
11
  "Collapse" is imported from external module "@chakra-ui/react" but never used in "dist/index.js".
13
12
  DTS Build start
13
+ "Collapse" is imported from external module "@chakra-ui/react" but never used in "dist/chunk-JUNOSADJ.mjs".
14
+ CJS dist/index.js 502.62 KB
15
+ CJS ⚡️ Build success in 2210ms
14
16
  ESM dist/index.mjs 2.01 KB
15
- ESM dist/CountryCodeSelect-SCMCRKY4.mjs 1.19 KB
16
- ESM dist/chunk-5VZ5S46A.mjs 393.00 KB
17
- ESM ⚡️ Build success in 2110ms
18
- CJS dist/index.js 500.11 KB
19
- CJS ⚡️ Build success in 2110ms
20
- DTS ⚡️ Build success in 10383ms
21
- DTS dist/index.d.ts 268.53 KB
22
- DTS dist/index.d.mts 268.53 KB
17
+ ESM dist/CountryCodeSelect-X4ONXTIF.mjs 1.19 KB
18
+ ESM dist/chunk-JUNOSADJ.mjs 394.94 KB
19
+ ESM ⚡️ Build success in 2211ms
20
+ DTS ⚡️ Build success in 11198ms
21
+ DTS dist/index.d.ts 271.10 KB
22
+ DTS dist/index.d.mts 271.10 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @vygruppen/spor-react
2
2
 
3
+ ## 8.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 3c599d7: Combobox: Add inputRef prop
8
+
9
+ ### Patch Changes
10
+
11
+ - c084847: ExpandableAlerts: added new hover and active styling for this component
12
+
3
13
  ## 8.0.1
4
14
 
5
15
  ### Patch Changes
@@ -1,4 +1,4 @@
1
- import { createTexts, useTranslation, InfoSelect, Item } from './chunk-5VZ5S46A.mjs';
1
+ import { createTexts, useTranslation, InfoSelect, Item } from './chunk-JUNOSADJ.mjs';
2
2
  import React from 'react';
3
3
  import { getSupportedCallingCodes } from 'awesome-phonenumber';
4
4
 
@@ -1509,6 +1509,7 @@ var ExpandableAlert = ({
1509
1509
  },
1510
1510
  ...boxProps
1511
1511
  }) => {
1512
+ const styles3 = useMultiStyleConfig("AlertExpandable", { variant });
1512
1513
  return /* @__PURE__ */ React69__default.createElement(BaseAlert, { variant, ...boxProps, paddingX: 0, paddingY: 0 }, /* @__PURE__ */ React69__default.createElement(
1513
1514
  Accordion$1,
1514
1515
  {
@@ -1517,7 +1518,7 @@ var ExpandableAlert = ({
1517
1518
  allowToggle: true,
1518
1519
  flexGrow: "1"
1519
1520
  },
1520
- /* @__PURE__ */ React69__default.createElement(AccordionItem, null, /* @__PURE__ */ React69__default.createElement(AccordionButton, { paddingX: 3, paddingY: 2, fontSize: "inherit" }, /* @__PURE__ */ React69__default.createElement(
1521
+ /* @__PURE__ */ React69__default.createElement(AccordionItem, null, /* @__PURE__ */ React69__default.createElement(AccordionButton, { sx: styles3.container }, /* @__PURE__ */ React69__default.createElement(
1521
1522
  Flex,
1522
1523
  {
1523
1524
  justifyContent: "space-between",
@@ -2667,10 +2668,12 @@ function Combobox({
2667
2668
  paddingX,
2668
2669
  paddingY,
2669
2670
  emptyContent,
2671
+ inputRef: externalInputRef,
2670
2672
  ...rest
2671
2673
  }) {
2672
2674
  const { contains: contains2 } = useFilter({ sensitivity: "base" });
2673
- const inputRef = useRef(null);
2675
+ const fallbackInputRef = useRef(null);
2676
+ const inputRef = externalInputRef ?? fallbackInputRef;
2674
2677
  const listBoxRef = useRef(null);
2675
2678
  const popoverRef = useRef(null);
2676
2679
  const inputWidth = useInputWidth(inputRef);
@@ -3429,7 +3432,7 @@ var texts14 = createTexts({
3429
3432
  sv: "Telefonnummer"
3430
3433
  }
3431
3434
  });
3432
- var LazyCountryCodeSelect = React69__default.lazy(() => import('./CountryCodeSelect-SCMCRKY4.mjs'));
3435
+ var LazyCountryCodeSelect = React69__default.lazy(() => import('./CountryCodeSelect-X4ONXTIF.mjs'));
3433
3436
  var Radio = forwardRef((props, ref) => {
3434
3437
  return /* @__PURE__ */ React69__default.createElement(Radio$1, { ...props, ref });
3435
3438
  });
@@ -6246,16 +6249,16 @@ Object.assign({}, space, layout, flexbox, grid, position);
6246
6249
  function defineStyle(styles3) {
6247
6250
  return styles3;
6248
6251
  }
6249
- function defineStyleConfig(config38) {
6250
- return config38;
6252
+ function defineStyleConfig(config39) {
6253
+ return config39;
6251
6254
  }
6252
- function createMultiStyleConfigHelpers(parts15) {
6255
+ function createMultiStyleConfigHelpers(parts16) {
6253
6256
  return {
6254
- definePartsStyle(config38) {
6255
- return config38;
6257
+ definePartsStyle(config39) {
6258
+ return config39;
6256
6259
  },
6257
- defineMultiStyleConfig(config38) {
6258
- return { parts: parts15, ...config38 };
6260
+ defineMultiStyleConfig(config39) {
6261
+ return { parts: parts16, ...config39 };
6259
6262
  }
6260
6263
  };
6261
6264
  }
@@ -6418,7 +6421,7 @@ function anatomy(name, map = {}) {
6418
6421
  "[anatomy] .part(...) should only be called once. Did you mean to use .extend(...) ?"
6419
6422
  );
6420
6423
  }
6421
- function parts15(...values) {
6424
+ function parts16(...values) {
6422
6425
  assert();
6423
6426
  for (const part of values) {
6424
6427
  map[part] = toPart(part);
@@ -6458,7 +6461,7 @@ function anatomy(name, map = {}) {
6458
6461
  }
6459
6462
  const __type = {};
6460
6463
  return {
6461
- parts: parts15,
6464
+ parts: parts16,
6462
6465
  toPart,
6463
6466
  extend,
6464
6467
  selectors,
@@ -9512,6 +9515,7 @@ var components_exports = {};
9512
9515
  __export(components_exports, {
9513
9516
  Accordion: () => accordion_default,
9514
9517
  Alert: () => alert_default,
9518
+ AlertExpandable: () => alert_expandable_default,
9515
9519
  Badge: () => badge_default,
9516
9520
  Breadcrumb: () => breadcrumb_default,
9517
9521
  Button: () => button_default,
@@ -13581,6 +13585,93 @@ var config37 = defineStyleConfig$1({
13581
13585
  }
13582
13586
  });
13583
13587
  var toast_default = config37;
13588
+
13589
+ // src/theme/components/alert-expandable.ts
13590
+ var parts15 = anatomy("alertExpandable").parts("container");
13591
+ var helpers26 = createMultiStyleConfigHelpers(parts15.keys);
13592
+ var config38 = helpers26.defineMultiStyleConfig({
13593
+ baseStyle: {
13594
+ container: {
13595
+ paddingX: 3,
13596
+ paddingY: 2,
13597
+ fontSize: "inherit",
13598
+ _expanded: {
13599
+ borderBottomRadius: "none"
13600
+ }
13601
+ }
13602
+ },
13603
+ variants: {
13604
+ info: {
13605
+ container: {
13606
+ _hover: {
13607
+ boxShadow: getBoxShadowString({
13608
+ borderColor: "sky",
13609
+ borderWidth: 2
13610
+ })
13611
+ },
13612
+ _active: {
13613
+ backgroundColor: "icyBlue"
13614
+ }
13615
+ }
13616
+ },
13617
+ success: {
13618
+ container: {
13619
+ _hover: {
13620
+ boxShadow: getBoxShadowString({
13621
+ borderColor: "blueGreen",
13622
+ borderWidth: 2
13623
+ })
13624
+ },
13625
+ _active: {
13626
+ backgroundColor: "mint"
13627
+ }
13628
+ }
13629
+ },
13630
+ warning: {
13631
+ container: {
13632
+ _hover: {
13633
+ boxShadow: getBoxShadowString({
13634
+ borderColor: "sunshine",
13635
+ borderWidth: 2
13636
+ })
13637
+ },
13638
+ _active: {
13639
+ backgroundColor: "cornSilk"
13640
+ }
13641
+ }
13642
+ },
13643
+ "alt-transport": {
13644
+ container: {
13645
+ _hover: {
13646
+ boxShadow: getBoxShadowString({
13647
+ borderColor: "golden",
13648
+ borderWidth: 2
13649
+ })
13650
+ },
13651
+ _active: {
13652
+ backgroundColor: "sunshine"
13653
+ }
13654
+ }
13655
+ },
13656
+ error: {
13657
+ container: {
13658
+ _hover: {
13659
+ boxShadow: getBoxShadowString({
13660
+ borderColor: "apricot",
13661
+ borderWidth: 2
13662
+ })
13663
+ },
13664
+ _active: {
13665
+ backgroundColor: "pink"
13666
+ }
13667
+ }
13668
+ }
13669
+ },
13670
+ defaultProps: {
13671
+ variant: "info"
13672
+ }
13673
+ });
13674
+ var alert_expandable_default = config38;
13584
13675
  var fontFaces = `
13585
13676
  @font-face {
13586
13677
  font-family: ${tokens10__default.asset.font["vy-sans"]["light"].name};
package/dist/index.d.mts CHANGED
@@ -774,6 +774,8 @@ type ComboboxProps<T> = AriaComboBoxProps<T> & {
774
774
  isLoading?: boolean;
775
775
  /** Optional UI to show when there are no matching items */
776
776
  emptyContent?: React.ReactNode;
777
+ /** A ref to the input field */
778
+ inputRef?: React.RefObject<HTMLInputElement>;
777
779
  } & Pick<InputProps, "marginTop" | "marginBottom" | "marginRight" | "marginLeft" | "marginY" | "marginX" | "paddingTop" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingY" | "paddingX" | "leftIcon" | "rightIcon" | "borderTopRightRadius" | "borderTopLeftRadius" | "borderBottomRightRadius" | "borderBottomLeftRadius" | "onFocus">;
778
780
  /**
779
781
  * A combobox is a combination of an input and a list of suggestions.
@@ -798,7 +800,7 @@ type ComboboxProps<T> = AriaComboBoxProps<T> & {
798
800
  * </Combobox>
799
801
  * ```
800
802
  */
801
- declare function Combobox<T extends object>({ label, isLoading, leftIcon, rightIcon, borderBottomLeftRadius, borderBottomRightRadius, borderTopLeftRadius, borderTopRightRadius, marginBottom, marginTop, marginX, marginY, marginRight, marginLeft, paddingBottom, paddingRight, paddingTop, paddingLeft, paddingX, paddingY, emptyContent, ...rest }: ComboboxProps<T>): React.JSX.Element;
803
+ declare function Combobox<T extends object>({ label, isLoading, leftIcon, rightIcon, borderBottomLeftRadius, borderBottomRightRadius, borderTopLeftRadius, borderTopRightRadius, marginBottom, marginTop, marginX, marginY, marginRight, marginLeft, paddingBottom, paddingRight, paddingTop, paddingLeft, paddingX, paddingY, emptyContent, inputRef: externalInputRef, ...rest }: ComboboxProps<T>): React.JSX.Element;
802
804
 
803
805
  type FormControlProps = FormControlProps$1;
804
806
  declare const FormControl: _chakra_ui_system_dist_system_types.ComponentWithAs<"div", FormControlProps$1>;
@@ -5807,6 +5809,81 @@ declare const theme: {
5807
5809
  } | undefined;
5808
5810
  parts: ("title" | "container" | "icon" | "description" | "iconContainer" | "textContainer" | "deviationIcon")[];
5809
5811
  };
5812
+ AlertExpandable: {
5813
+ baseStyle?: {
5814
+ container: {
5815
+ paddingX: number;
5816
+ paddingY: number;
5817
+ fontSize: string;
5818
+ _expanded: {
5819
+ borderBottomRadius: string;
5820
+ };
5821
+ };
5822
+ } | undefined;
5823
+ sizes?: {
5824
+ [key: string]: _chakra_ui_styled_system.PartsStyleInterpolation<{
5825
+ keys: "container"[];
5826
+ }>;
5827
+ } | undefined;
5828
+ variants?: {
5829
+ info: {
5830
+ container: {
5831
+ _hover: {
5832
+ boxShadow: string;
5833
+ };
5834
+ _active: {
5835
+ backgroundColor: string;
5836
+ };
5837
+ };
5838
+ };
5839
+ success: {
5840
+ container: {
5841
+ _hover: {
5842
+ boxShadow: string;
5843
+ };
5844
+ _active: {
5845
+ backgroundColor: string;
5846
+ };
5847
+ };
5848
+ };
5849
+ warning: {
5850
+ container: {
5851
+ _hover: {
5852
+ boxShadow: string;
5853
+ };
5854
+ _active: {
5855
+ backgroundColor: string;
5856
+ };
5857
+ };
5858
+ };
5859
+ "alt-transport": {
5860
+ container: {
5861
+ _hover: {
5862
+ boxShadow: string;
5863
+ };
5864
+ _active: {
5865
+ backgroundColor: string;
5866
+ };
5867
+ };
5868
+ };
5869
+ error: {
5870
+ container: {
5871
+ _hover: {
5872
+ boxShadow: string;
5873
+ };
5874
+ _active: {
5875
+ backgroundColor: string;
5876
+ };
5877
+ };
5878
+ };
5879
+ } | undefined;
5880
+ defaultProps?: {
5881
+ size?: string | number | undefined;
5882
+ variant?: "error" | "info" | "success" | "warning" | "alt-transport" | undefined;
5883
+ colorScheme?: string | undefined;
5884
+ } | undefined;
5885
+ parts: "container"[];
5886
+ };
5810
5887
  Avatar: {
5811
5888
  baseStyle?: ((props: _chakra_ui_styled_system.StyleFunctionProps) => {
5812
5889
  badge: {
package/dist/index.d.ts CHANGED
@@ -774,6 +774,8 @@ type ComboboxProps<T> = AriaComboBoxProps<T> & {
774
774
  isLoading?: boolean;
775
775
  /** Optional UI to show when there are no matching items */
776
776
  emptyContent?: React.ReactNode;
777
+ /** A ref to the input field */
778
+ inputRef?: React.RefObject<HTMLInputElement>;
777
779
  } & Pick<InputProps, "marginTop" | "marginBottom" | "marginRight" | "marginLeft" | "marginY" | "marginX" | "paddingTop" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingY" | "paddingX" | "leftIcon" | "rightIcon" | "borderTopRightRadius" | "borderTopLeftRadius" | "borderBottomRightRadius" | "borderBottomLeftRadius" | "onFocus">;
778
780
  /**
779
781
  * A combobox is a combination of an input and a list of suggestions.
@@ -798,7 +800,7 @@ type ComboboxProps<T> = AriaComboBoxProps<T> & {
798
800
  * </Combobox>
799
801
  * ```
800
802
  */
801
- declare function Combobox<T extends object>({ label, isLoading, leftIcon, rightIcon, borderBottomLeftRadius, borderBottomRightRadius, borderTopLeftRadius, borderTopRightRadius, marginBottom, marginTop, marginX, marginY, marginRight, marginLeft, paddingBottom, paddingRight, paddingTop, paddingLeft, paddingX, paddingY, emptyContent, ...rest }: ComboboxProps<T>): React.JSX.Element;
803
+ declare function Combobox<T extends object>({ label, isLoading, leftIcon, rightIcon, borderBottomLeftRadius, borderBottomRightRadius, borderTopLeftRadius, borderTopRightRadius, marginBottom, marginTop, marginX, marginY, marginRight, marginLeft, paddingBottom, paddingRight, paddingTop, paddingLeft, paddingX, paddingY, emptyContent, inputRef: externalInputRef, ...rest }: ComboboxProps<T>): React.JSX.Element;
802
804
 
803
805
  type FormControlProps = FormControlProps$1;
804
806
  declare const FormControl: _chakra_ui_system_dist_system_types.ComponentWithAs<"div", FormControlProps$1>;
@@ -5807,6 +5809,81 @@ declare const theme: {
5807
5809
  } | undefined;
5808
5810
  parts: ("title" | "container" | "icon" | "description" | "iconContainer" | "textContainer" | "deviationIcon")[];
5809
5811
  };
5812
+ AlertExpandable: {
5813
+ baseStyle?: {
5814
+ container: {
5815
+ paddingX: number;
5816
+ paddingY: number;
5817
+ fontSize: string;
5818
+ _expanded: {
5819
+ borderBottomRadius: string;
5820
+ };
5821
+ };
5822
+ } | undefined;
5823
+ sizes?: {
5824
+ [key: string]: _chakra_ui_styled_system.PartsStyleInterpolation<{
5825
+ keys: "container"[];
5826
+ }>;
5827
+ } | undefined;
5828
+ variants?: {
5829
+ info: {
5830
+ container: {
5831
+ _hover: {
5832
+ boxShadow: string;
5833
+ };
5834
+ _active: {
5835
+ backgroundColor: string;
5836
+ };
5837
+ };
5838
+ };
5839
+ success: {
5840
+ container: {
5841
+ _hover: {
5842
+ boxShadow: string;
5843
+ };
5844
+ _active: {
5845
+ backgroundColor: string;
5846
+ };
5847
+ };
5848
+ };
5849
+ warning: {
5850
+ container: {
5851
+ _hover: {
5852
+ boxShadow: string;
5853
+ };
5854
+ _active: {
5855
+ backgroundColor: string;
5856
+ };
5857
+ };
5858
+ };
5859
+ "alt-transport": {
5860
+ container: {
5861
+ _hover: {
5862
+ boxShadow: string;
5863
+ };
5864
+ _active: {
5865
+ backgroundColor: string;
5866
+ };
5867
+ };
5868
+ };
5869
+ error: {
5870
+ container: {
5871
+ _hover: {
5872
+ boxShadow: string;
5873
+ };
5874
+ _active: {
5875
+ backgroundColor: string;
5876
+ };
5877
+ };
5878
+ };
5879
+ } | undefined;
5880
+ defaultProps?: {
5881
+ size?: string | number | undefined;
5882
+ variant?: "error" | "info" | "success" | "warning" | "alt-transport" | undefined;
5883
+ colorScheme?: string | undefined;
5884
+ } | undefined;
5885
+ parts: "container"[];
5886
+ };
5810
5887
  Avatar: {
5811
5888
  baseStyle?: ((props: _chakra_ui_styled_system.StyleFunctionProps) => {
5812
5889
  badge: {
package/dist/index.js CHANGED
@@ -1046,6 +1046,7 @@ var init_ExpandableAlert = __esm({
1046
1046
  },
1047
1047
  ...boxProps
1048
1048
  }) => {
1049
+ const styles3 = react.useMultiStyleConfig("AlertExpandable", { variant });
1049
1050
  return /* @__PURE__ */ React69__namespace.default.createElement(BaseAlert, { variant, ...boxProps, paddingX: 0, paddingY: 0 }, /* @__PURE__ */ React69__namespace.default.createElement(
1050
1051
  react.Accordion,
1051
1052
  {
@@ -1054,7 +1055,7 @@ var init_ExpandableAlert = __esm({
1054
1055
  allowToggle: true,
1055
1056
  flexGrow: "1"
1056
1057
  },
1057
- /* @__PURE__ */ React69__namespace.default.createElement(react.AccordionItem, null, /* @__PURE__ */ React69__namespace.default.createElement(react.AccordionButton, { paddingX: 3, paddingY: 2, fontSize: "inherit" }, /* @__PURE__ */ React69__namespace.default.createElement(
1058
+ /* @__PURE__ */ React69__namespace.default.createElement(react.AccordionItem, null, /* @__PURE__ */ React69__namespace.default.createElement(react.AccordionButton, { sx: styles3.container }, /* @__PURE__ */ React69__namespace.default.createElement(
1058
1059
  react.Flex,
1059
1060
  {
1060
1061
  justifyContent: "space-between",
@@ -3171,10 +3172,12 @@ function Combobox({
3171
3172
  paddingX,
3172
3173
  paddingY,
3173
3174
  emptyContent,
3175
+ inputRef: externalInputRef,
3174
3176
  ...rest
3175
3177
  }) {
3176
3178
  const { contains: contains2 } = reactAria.useFilter({ sensitivity: "base" });
3177
- const inputRef = React69.useRef(null);
3179
+ const fallbackInputRef = React69.useRef(null);
3180
+ const inputRef = externalInputRef ?? fallbackInputRef;
3178
3181
  const listBoxRef = React69.useRef(null);
3179
3182
  const popoverRef = React69.useRef(null);
3180
3183
  const inputWidth = useInputWidth(inputRef);
@@ -6081,16 +6084,16 @@ function defineCssVars(scope, keys2) {
6081
6084
  function defineStyle(styles3) {
6082
6085
  return styles3;
6083
6086
  }
6084
- function defineStyleConfig(config38) {
6085
- return config38;
6087
+ function defineStyleConfig(config39) {
6088
+ return config39;
6086
6089
  }
6087
- function createMultiStyleConfigHelpers(parts15) {
6090
+ function createMultiStyleConfigHelpers(parts16) {
6088
6091
  return {
6089
- definePartsStyle(config38) {
6090
- return config38;
6092
+ definePartsStyle(config39) {
6093
+ return config39;
6091
6094
  },
6092
- defineMultiStyleConfig(config38) {
6093
- return { parts: parts15, ...config38 };
6095
+ defineMultiStyleConfig(config39) {
6096
+ return { parts: parts16, ...config39 };
6094
6097
  }
6095
6098
  };
6096
6099
  }
@@ -7413,7 +7416,7 @@ function anatomy(name, map = {}) {
7413
7416
  "[anatomy] .part(...) should only be called once. Did you mean to use .extend(...) ?"
7414
7417
  );
7415
7418
  }
7416
- function parts15(...values) {
7419
+ function parts16(...values) {
7417
7420
  assert();
7418
7421
  for (const part of values) {
7419
7422
  map[part] = toPart(part);
@@ -7453,7 +7456,7 @@ function anatomy(name, map = {}) {
7453
7456
  }
7454
7457
  const __type = {};
7455
7458
  return {
7456
- parts: parts15,
7459
+ parts: parts16,
7457
7460
  toPart,
7458
7461
  extend,
7459
7462
  selectors,
@@ -15276,11 +15279,107 @@ var init_toast = __esm({
15276
15279
  }
15277
15280
  });
15278
15281
 
15282
+ // src/theme/components/alert-expandable.ts
15283
+ var parts15, helpers26, config38, alert_expandable_default;
15284
+ var init_alert_expandable = __esm({
15285
+ "src/theme/components/alert-expandable.ts"() {
15286
+ init_dist4();
15287
+ init_dist3();
15288
+ init_box_shadow_utils();
15289
+ parts15 = anatomy("alertExpandable").parts("container");
15290
+ helpers26 = createMultiStyleConfigHelpers(parts15.keys);
15291
+ config38 = helpers26.defineMultiStyleConfig({
15292
+ baseStyle: {
15293
+ container: {
15294
+ paddingX: 3,
15295
+ paddingY: 2,
15296
+ fontSize: "inherit",
15297
+ _expanded: {
15298
+ borderBottomRadius: "none"
15299
+ }
15300
+ }
15301
+ },
15302
+ variants: {
15303
+ info: {
15304
+ container: {
15305
+ _hover: {
15306
+ boxShadow: getBoxShadowString({
15307
+ borderColor: "sky",
15308
+ borderWidth: 2
15309
+ })
15310
+ },
15311
+ _active: {
15312
+ backgroundColor: "icyBlue"
15313
+ }
15314
+ }
15315
+ },
15316
+ success: {
15317
+ container: {
15318
+ _hover: {
15319
+ boxShadow: getBoxShadowString({
15320
+ borderColor: "blueGreen",
15321
+ borderWidth: 2
15322
+ })
15323
+ },
15324
+ _active: {
15325
+ backgroundColor: "mint"
15326
+ }
15327
+ }
15328
+ },
15329
+ warning: {
15330
+ container: {
15331
+ _hover: {
15332
+ boxShadow: getBoxShadowString({
15333
+ borderColor: "sunshine",
15334
+ borderWidth: 2
15335
+ })
15336
+ },
15337
+ _active: {
15338
+ backgroundColor: "cornSilk"
15339
+ }
15340
+ }
15341
+ },
15342
+ "alt-transport": {
15343
+ container: {
15344
+ _hover: {
15345
+ boxShadow: getBoxShadowString({
15346
+ borderColor: "golden",
15347
+ borderWidth: 2
15348
+ })
15349
+ },
15350
+ _active: {
15351
+ backgroundColor: "sunshine"
15352
+ }
15353
+ }
15354
+ },
15355
+ error: {
15356
+ container: {
15357
+ _hover: {
15358
+ boxShadow: getBoxShadowString({
15359
+ borderColor: "apricot",
15360
+ borderWidth: 2
15361
+ })
15362
+ },
15363
+ _active: {
15364
+ backgroundColor: "pink"
15365
+ }
15366
+ }
15367
+ }
15368
+ },
15369
+ defaultProps: {
15370
+ variant: "info"
15371
+ }
15372
+ });
15373
+ alert_expandable_default = config38;
15374
+ }
15375
+ });
15376
+
15279
15377
  // src/theme/components/index.ts
15280
15378
  var components_exports = {};
15281
15379
  __export(components_exports, {
15282
15380
  Accordion: () => accordion_default,
15283
15381
  Alert: () => alert_default,
15382
+ AlertExpandable: () => alert_expandable_default,
15284
15383
  Badge: () => badge_default,
15285
15384
  Breadcrumb: () => breadcrumb_default,
15286
15385
  Button: () => button_default,
@@ -15358,6 +15457,7 @@ var init_components = __esm({
15358
15457
  init_textarea();
15359
15458
  init_toast();
15360
15459
  init_travel_tag();
15460
+ init_alert_expandable();
15361
15461
  }
15362
15462
  });
15363
15463
  exports.fontFaces = void 0;
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, 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-5VZ5S46A.mjs';
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, 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-JUNOSADJ.mjs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vygruppen/spor-react",
3
- "version": "8.0.1",
3
+ "version": "8.1.0",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",
@@ -6,6 +6,7 @@ import {
6
6
  AccordionPanel,
7
7
  Box,
8
8
  Flex,
9
+ useMultiStyleConfig,
9
10
  } from "@chakra-ui/react";
10
11
  import React from "react";
11
12
  import { AlertIcon } from "./AlertIcon";
@@ -44,6 +45,7 @@ export const ExpandableAlert = ({
44
45
  onToggle = () => {},
45
46
  ...boxProps
46
47
  }: ExpandableAlertProps) => {
48
+ const styles = useMultiStyleConfig("AlertExpandable", { variant });
47
49
  return (
48
50
  <BaseAlert variant={variant} {...boxProps} paddingX={0} paddingY={0}>
49
51
  <Accordion
@@ -53,7 +55,7 @@ export const ExpandableAlert = ({
53
55
  flexGrow="1"
54
56
  >
55
57
  <AccordionItem>
56
- <AccordionButton paddingX={3} paddingY={2} fontSize="inherit">
58
+ <AccordionButton sx={styles.container}>
57
59
  <Flex
58
60
  justifyContent="space-between"
59
61
  alignItems="center"
@@ -11,6 +11,8 @@ export type ComboboxProps<T> = AriaComboBoxProps<T> & {
11
11
  isLoading?: boolean;
12
12
  /** Optional UI to show when there are no matching items */
13
13
  emptyContent?: React.ReactNode;
14
+ /** A ref to the input field */
15
+ inputRef?: React.RefObject<HTMLInputElement>;
14
16
  } & Pick<
15
17
  InputProps,
16
18
  | "marginTop"
@@ -78,11 +80,13 @@ export function Combobox<T extends object>({
78
80
  paddingX,
79
81
  paddingY,
80
82
  emptyContent,
83
+ inputRef: externalInputRef,
81
84
  ...rest
82
85
  }: ComboboxProps<T>) {
83
86
  const { contains } = useFilter({ sensitivity: "base" });
84
87
 
85
- const inputRef = useRef<HTMLInputElement>(null);
88
+ const fallbackInputRef = useRef<HTMLInputElement>(null);
89
+ const inputRef = externalInputRef ?? fallbackInputRef;
86
90
  const listBoxRef = useRef(null);
87
91
  const popoverRef = useRef(null);
88
92
 
@@ -0,0 +1,91 @@
1
+ import { anatomy } from "@chakra-ui/anatomy";
2
+ import { createMultiStyleConfigHelpers } from "@chakra-ui/styled-system";
3
+ import { getBoxShadowString } from "../utils/box-shadow-utils";
4
+
5
+ const parts = anatomy("alertExpandable").parts("container");
6
+ const helpers = createMultiStyleConfigHelpers(parts.keys);
7
+
8
+ const config = helpers.defineMultiStyleConfig({
9
+ baseStyle: {
10
+ container: {
11
+ paddingX: 3,
12
+ paddingY: 2,
13
+ fontSize: "inherit",
14
+ _expanded: {
15
+ borderBottomRadius: "none",
16
+ },
17
+ },
18
+ },
19
+ variants: {
20
+ info: {
21
+ container: {
22
+ _hover: {
23
+ boxShadow: getBoxShadowString({
24
+ borderColor: "sky",
25
+ borderWidth: 2,
26
+ }),
27
+ },
28
+ _active: {
29
+ backgroundColor: "icyBlue",
30
+ },
31
+ },
32
+ },
33
+ success: {
34
+ container: {
35
+ _hover: {
36
+ boxShadow: getBoxShadowString({
37
+ borderColor: "blueGreen",
38
+ borderWidth: 2,
39
+ }),
40
+ },
41
+ _active: {
42
+ backgroundColor: "mint",
43
+ },
44
+ },
45
+ },
46
+ warning: {
47
+ container: {
48
+ _hover: {
49
+ boxShadow: getBoxShadowString({
50
+ borderColor: "sunshine",
51
+ borderWidth: 2,
52
+ }),
53
+ },
54
+ _active: {
55
+ backgroundColor: "cornSilk",
56
+ },
57
+ },
58
+ },
59
+ "alt-transport": {
60
+ container: {
61
+ _hover: {
62
+ boxShadow: getBoxShadowString({
63
+ borderColor: "golden",
64
+ borderWidth: 2,
65
+ }),
66
+ },
67
+ _active: {
68
+ backgroundColor: "sunshine",
69
+ },
70
+ },
71
+ },
72
+ error: {
73
+ container: {
74
+ _hover: {
75
+ boxShadow: getBoxShadowString({
76
+ borderColor: "apricot",
77
+ borderWidth: 2,
78
+ }),
79
+ },
80
+ _active: {
81
+ backgroundColor: "pink",
82
+ },
83
+ },
84
+ },
85
+ },
86
+ defaultProps: {
87
+ variant: "info",
88
+ },
89
+ });
90
+
91
+ export default config;
@@ -36,3 +36,4 @@ export { default as Tabs } from "./tabs";
36
36
  export { default as Textarea } from "./textarea";
37
37
  export { default as Toast } from "./toast";
38
38
  export { default as TravelTag } from "./travel-tag";
39
+ export { default as AlertExpandable } from "./alert-expandable";