@gnist/design-system 3.12.1 → 3.12.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,10 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [3.12.2](https://github.com/mollerdigital/design-system-design-system/compare/@gnist/design-system@3.12.1...@gnist/design-system@3.12.2) (2025-09-16)
7
+
8
+ **Note:** Version bump only for package @gnist/design-system
9
+
6
10
  ## [3.12.1](https://github.com/mollerdigital/design-system-design-system/compare/@gnist/design-system@3.12.0...@gnist/design-system@3.12.1) (2025-09-12)
7
11
 
8
12
  ### Bug Fixes
@@ -6,12 +6,11 @@ const InputHelperText = require("../../../building-blocks/inputs/InputHelperText
6
6
  const ScreenReaderOnly = require("../../../utilities/accessibility/ScreenReaderOnly.cjs");
7
7
  require("../../../utilities/accessibility/visuallyHidden.css.cjs");
8
8
  const index = require("../../../utilities/html/index.cjs");
9
- const React = require("react");
10
9
  const switch_css = require("./switch.css.cjs");
11
10
  const shared_css = require("./shared.css.cjs");
12
11
  const shared = require("./shared.cjs");
13
12
  const defaultRender = (switchElement, description) => jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [switchElement, jsxRuntime.jsx("div", { className: switch_css.switchDescription, children: description })] });
14
- const Switch = React.forwardRef(function Switch2({ offLabel, onLabel, description, value = false, onChange, disabled, validity, id = index.createValidHtmlId(offLabel || onLabel || "toggle"), hideLabel = false, canShowErrorMessage = false, className, ...rest }, ref) {
13
+ function Switch({ offLabel, onLabel, description, value = false, onChange, disabled, validity, id = index.createValidHtmlId(offLabel || onLabel || "toggle"), hideLabel = false, canShowErrorMessage = false, className, ref, ...rest }) {
15
14
  const inputId = id;
16
15
  const labelId = `${id}-label`;
17
16
  const helperId = `${id}-helper`;
@@ -45,5 +44,5 @@ const Switch = React.forwardRef(function Switch2({ offLabel, onLabel, descriptio
45
44
  disabled
46
45
  }), children: onLabel })] }) });
47
46
  return jsxRuntime.jsx(shared.HelperTextWrapper, { ...helperTextProps, children: defaultRender(switchElement, descriptionElement) });
48
- });
47
+ }
49
48
  exports.Switch = Switch;
@@ -1,9 +1,11 @@
1
+ import { Ref } from "react";
1
2
  import { SelectionControlProps } from "./shared.js";
2
3
  export interface SwitchProps extends Omit<SelectionControlProps<boolean>, "render"> {
3
4
  /** The left side label of the switch. */
4
5
  offLabel?: string;
5
6
  /** The right side label of the switch. */
6
7
  onLabel: string;
8
+ ref?: Ref<HTMLSpanElement>;
7
9
  }
8
10
  /**
9
11
  * Use switches to:
@@ -13,5 +15,5 @@ export interface SwitchProps extends Omit<SelectionControlProps<boolean>, "rende
13
15
  *
14
16
  * Documentation: [Switch](https://gnist.moller.no/developers/components/latest/?path=/docs/components-actions-selectioncontrols-switch--docs)
15
17
  */
16
- export declare const Switch: import("react").ForwardRefExoticComponent<SwitchProps & import("react").RefAttributes<HTMLSpanElement>>;
18
+ export declare function Switch({ offLabel, onLabel, description, value, onChange, disabled, validity, id, hideLabel, canShowErrorMessage, className, ref, ...rest }: SwitchProps): import("react/jsx-runtime").JSX.Element;
17
19
  //# sourceMappingURL=Switch.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Switch.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/selectionControls/Switch.tsx"],"names":[],"mappings":"AAYA,OAAO,EAEH,qBAAqB,EAExB,MAAM,aAAa,CAAC;AAErB,MAAM,WAAW,WACb,SAAQ,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC;IACtD,yCAAyC;IACzC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0CAA0C;IAC1C,OAAO,EAAE,MAAM,CAAC;CACnB;AAYD;;;;;;;GAOG;AACH,eAAO,MAAM,MAAM,yGAkHjB,CAAC"}
1
+ {"version":3,"file":"Switch.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/selectionControls/Switch.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAgB,GAAG,EAAE,MAAM,OAAO,CAAC;AAS1C,OAAO,EAEH,qBAAqB,EAExB,MAAM,aAAa,CAAC;AAErB,MAAM,WAAW,WACb,SAAQ,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC;IACtD,yCAAyC;IACzC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0CAA0C;IAC1C,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,GAAG,CAAC,eAAe,CAAC,CAAC;CAC9B;AAYD;;;;;;;GAOG;AACH,wBAAgB,MAAM,CAAC,EACnB,QAAQ,EACR,OAAO,EACP,WAAW,EACX,KAAa,EACb,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,EAAuD,EACvD,SAAiB,EACjB,mBAA2B,EAC3B,SAAS,EACT,GAAG,EACH,GAAG,IAAI,EACV,EAAE,WAAW,2CAkGb"}
@@ -4,12 +4,11 @@ import { useInputHelperText } from "../../../building-blocks/inputs/InputHelperT
4
4
  import { ScreenReaderOnly } from "../../../utilities/accessibility/ScreenReaderOnly.js";
5
5
  import "../../../utilities/accessibility/visuallyHidden.css.js";
6
6
  import { createValidHtmlId } from "../../../utilities/html/index.js";
7
- import { forwardRef } from "react";
8
7
  import { switchContainerStyle, SwitchLabelRecipe, SwitchRecipe, SwitchThumbRecipe, switchDescription } from "./switch.css.js";
9
8
  import { InputWrapper, InputStyleRecipe } from "./shared.css.js";
10
9
  import { SelectionDescription, HelperTextWrapper } from "./shared.js";
11
10
  const defaultRender = (switchElement, description) => jsxs(Fragment, { children: [switchElement, jsx("div", { className: switchDescription, children: description })] });
12
- const Switch = forwardRef(function Switch2({ offLabel, onLabel, description, value = false, onChange, disabled, validity, id = createValidHtmlId(offLabel || onLabel || "toggle"), hideLabel = false, canShowErrorMessage = false, className, ...rest }, ref) {
11
+ function Switch({ offLabel, onLabel, description, value = false, onChange, disabled, validity, id = createValidHtmlId(offLabel || onLabel || "toggle"), hideLabel = false, canShowErrorMessage = false, className, ref, ...rest }) {
13
12
  const inputId = id;
14
13
  const labelId = `${id}-label`;
15
14
  const helperId = `${id}-helper`;
@@ -43,7 +42,7 @@ const Switch = forwardRef(function Switch2({ offLabel, onLabel, description, val
43
42
  disabled
44
43
  }), children: onLabel })] }) });
45
44
  return jsx(HelperTextWrapper, { ...helperTextProps, children: defaultRender(switchElement, descriptionElement) });
46
- });
45
+ }
47
46
  export {
48
47
  Switch
49
48
  };
@@ -28,7 +28,7 @@ const Checkbox = require("../../actions/selectionControls/Checkbox.cjs");
28
28
  require("../../actions/selectionControls/radiobutton.css.cjs");
29
29
  require("../../actions/selectionControls/shared.css.cjs");
30
30
  require("../../../utilities/layout/Column.cjs");
31
- require("../../actions/selectionControls/Switch.cjs");
31
+ require("../../actions/selectionControls/switch.css.cjs");
32
32
  require("../../../styles/animations.css.cjs");
33
33
  require("../../actions/chips/styles.css.cjs");
34
34
  const inputField_css = require("../shared-styles/inputField.css.cjs");
@@ -26,7 +26,7 @@ import { Checkbox } from "../../actions/selectionControls/Checkbox.js";
26
26
  import "../../actions/selectionControls/radiobutton.css.js";
27
27
  import "../../actions/selectionControls/shared.css.js";
28
28
  import "../../../utilities/layout/Column.js";
29
- import "../../actions/selectionControls/Switch.js";
29
+ import "../../actions/selectionControls/switch.css.js";
30
30
  import "../../../styles/animations.css.js";
31
31
  import "../../actions/chips/styles.css.js";
32
32
  import { inputFieldWrapperRecipe, inputContentWrapper, wrapperStyle } from "../shared-styles/inputField.css.js";
@@ -32,7 +32,7 @@ require("../../actions/selectionControls/checkbox.css.cjs");
32
32
  require("../../actions/selectionControls/shared.css.cjs");
33
33
  require("../../../utilities/layout/Column.cjs");
34
34
  require("../../actions/selectionControls/radiobutton.css.cjs");
35
- require("../../actions/selectionControls/Switch.cjs");
35
+ require("../../actions/selectionControls/switch.css.cjs");
36
36
  require("../../../styles/animations.css.cjs");
37
37
  require("../../actions/chips/styles.css.cjs");
38
38
  const Calendar_css = require("./Calendar.css.cjs");
@@ -30,7 +30,7 @@ import "../../actions/selectionControls/checkbox.css.js";
30
30
  import "../../actions/selectionControls/shared.css.js";
31
31
  import "../../../utilities/layout/Column.js";
32
32
  import "../../actions/selectionControls/radiobutton.css.js";
33
- import "../../actions/selectionControls/Switch.js";
33
+ import "../../actions/selectionControls/switch.css.js";
34
34
  import "../../../styles/animations.css.js";
35
35
  import "../../actions/chips/styles.css.js";
36
36
  import { headerCell, containerStyle, selectMonthRow, buttonRow, arrowButton, gridStyle, rowStyle, cellSkeletonStyle, firstDay, cellRecipe } from "./Calendar.css.js";
@@ -26,7 +26,7 @@ require("../../actions/selectionControls/shared.css.cjs");
26
26
  require("../../../utilities/layout/Column.cjs");
27
27
  require("../../../utilities/layout/Row.cjs");
28
28
  require("../../actions/selectionControls/radiobutton.css.cjs");
29
- require("../../actions/selectionControls/Switch.cjs");
29
+ require("../../actions/selectionControls/switch.css.cjs");
30
30
  require("../../../styles/animations.css.cjs");
31
31
  require("../../actions/chips/styles.css.cjs");
32
32
  const index = require("../../../translations/index.cjs");
@@ -24,7 +24,7 @@ import "../../actions/selectionControls/shared.css.js";
24
24
  import "../../../utilities/layout/Column.js";
25
25
  import "../../../utilities/layout/Row.js";
26
26
  import "../../actions/selectionControls/radiobutton.css.js";
27
- import "../../actions/selectionControls/Switch.js";
27
+ import "../../actions/selectionControls/switch.css.js";
28
28
  import "../../../styles/animations.css.js";
29
29
  import "../../actions/chips/styles.css.js";
30
30
  import { useTranslation } from "../../../translations/index.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gnist/design-system",
3
- "version": "3.12.1",
3
+ "version": "3.12.2",
4
4
  "license": "UNLICENSED",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -48,8 +48,8 @@
48
48
  },
49
49
  "dependencies": {
50
50
  "@formkit/auto-animate": "^0.8.2",
51
- "@gnist/component-utils": "3.0.9",
52
- "@gnist/themes": "^3.16.0",
51
+ "@gnist/component-utils": "3.0.10",
52
+ "@gnist/themes": "^3.17.0",
53
53
  "@mui/base": "^5.0.0-beta.70",
54
54
  "@vanilla-extract/css": "^1.17.4",
55
55
  "@vanilla-extract/css-utils": "^0.1.6",
@@ -90,7 +90,7 @@
90
90
  "tslib": "^2.8.1",
91
91
  "tsx": "^4.20.4",
92
92
  "typescript-transform-paths": "^3.5.5",
93
- "vite": "7.1.2",
93
+ "vite": "7.1.5",
94
94
  "vite-plugin-svgr": "^4.3.0",
95
95
  "vite-tsconfig-paths": "^5.1.4"
96
96
  },
@@ -102,5 +102,5 @@
102
102
  "optional": true
103
103
  }
104
104
  },
105
- "gitHead": "0991cca0228700718ae27f309495a2afe3b67634"
105
+ "gitHead": "737f5891d67b2547a7dc0d2a34d476e2fb31335e"
106
106
  }