@synerise/ds-switch 1.2.18 → 1.2.19

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
+ ## [1.2.19](https://github.com/synerise/synerise-design/compare/@synerise/ds-switch@1.2.18...@synerise/ds-switch@1.2.19) (2026-03-20)
7
+
8
+ **Note:** Version bump only for package @synerise/ds-switch
9
+
6
10
  ## [1.2.18](https://github.com/synerise/synerise-design/compare/@synerise/ds-switch@1.2.17...@synerise/ds-switch@1.2.18) (2026-03-09)
7
11
 
8
12
  **Note:** Version bump only for package @synerise/ds-switch
package/README.md CHANGED
@@ -23,17 +23,18 @@ Based on [Ant Design Switch](https://ant.design/components/switch/)
23
23
  | className | additional class to Switch | string | - |
24
24
  | defaultChecked | to set the initial state | boolean | `false` |
25
25
  | disabled | Disable switch | boolean | `false` |
26
- | description | Switch description | string | - |
27
- | errorText | Error message, when provided changes switch style | string | - |
28
- | label | switch label | string | - |
29
- | tooltip | tooltip next to label | string | null | `null` |
26
+ | description | Switch description | React.ReactNode | - |
27
+ | errorText | Error message, when provided changes switch style | React.ReactNode | - |
28
+ | label | switch label (required) | React.ReactNode | - |
29
+ | tooltip | tooltip next to label | React.ReactNode | - |
30
30
  | tooltipIcon | icon for tooltip | React.ReactNode | - |
31
- | tooltipConfig | configuration of tooltip | React.ReactNode | - |
31
+ | tooltipConfig | configuration of tooltip | TooltipProps (`@synerise/ds-tooltip`) | - |
32
+ | withFormElementMargin | add 16px bottom margin (standard form field spacing) | boolean | `false` |
32
33
  | loading | loading state of switch | boolean | `false` |
33
34
  | onChange | trigger when the checked state is changing | (checked: boolean, event: Event) => void | - |
34
35
  | onClick | trigger when clicked | (checked: boolean, event: Event) => void | - |
35
36
  | unCheckedChildren | content to be shown when the state is unchecked | string / React.ReactNode | - |
36
- | size | the size of the Switch, | `small` | `default` | `default` |
37
+ | ~~size~~ | ~~the size of the Switch~~ — **not available**, always renders as `small` | — | — |
37
38
 
38
39
  ### Methods
39
40
 
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,135 @@
1
+ import figma from '@figma/code-connect';
2
+ import Switch, { RawSwitch } from './Switch';
3
+ var FIGMA_URL = 'https://www.figma.com/design/fsSZONXpVvtrDsCgtu01Jb/Synerise-Design-System?node-id=249-3688&m=dev';
4
+ var labelProps = {
5
+ labelNested: figma.nestedProps('Label', {
6
+ text: figma.string('Text')
7
+ })
8
+ };
9
+ var descriptionProps = {
10
+ labelNested: figma.nestedProps('Label', {
11
+ text: figma.string('Text')
12
+ }),
13
+ descriptionNested: figma.nestedProps('Description', {
14
+ text: figma.string('Text')
15
+ })
16
+ };
17
+ figma.connect(Switch, FIGMA_URL, {
18
+ variant: {
19
+ State: 'Default',
20
+ 'Content Type': 'Solo'
21
+ },
22
+ example: function example() {
23
+ return /*#__PURE__*/React.createElement(RawSwitch, null);
24
+ }
25
+ });
26
+ figma.connect(Switch, FIGMA_URL, {
27
+ variant: {
28
+ State: 'Default',
29
+ 'Content Type': 'Label'
30
+ },
31
+ props: labelProps,
32
+ example: function example(_ref) {
33
+ var labelNested = _ref.labelNested;
34
+ return /*#__PURE__*/React.createElement(Switch, {
35
+ label: labelNested.text
36
+ });
37
+ }
38
+ });
39
+ figma.connect(Switch, FIGMA_URL, {
40
+ variant: {
41
+ State: 'Default',
42
+ 'Content Type': 'With Description'
43
+ },
44
+ props: descriptionProps,
45
+ example: function example(_ref2) {
46
+ var labelNested = _ref2.labelNested,
47
+ descriptionNested = _ref2.descriptionNested;
48
+ return /*#__PURE__*/React.createElement(Switch, {
49
+ label: labelNested.text,
50
+ description: descriptionNested.text
51
+ });
52
+ }
53
+ });
54
+ figma.connect(Switch, FIGMA_URL, {
55
+ variant: {
56
+ State: 'Selected',
57
+ 'Content Type': 'Solo'
58
+ },
59
+ example: function example() {
60
+ return /*#__PURE__*/React.createElement(RawSwitch, {
61
+ checked: true
62
+ });
63
+ }
64
+ });
65
+ figma.connect(Switch, FIGMA_URL, {
66
+ variant: {
67
+ State: 'Selected',
68
+ 'Content Type': 'Label'
69
+ },
70
+ props: labelProps,
71
+ example: function example(_ref3) {
72
+ var labelNested = _ref3.labelNested;
73
+ return /*#__PURE__*/React.createElement(Switch, {
74
+ checked: true,
75
+ label: labelNested.text
76
+ });
77
+ }
78
+ });
79
+ figma.connect(Switch, FIGMA_URL, {
80
+ variant: {
81
+ State: 'Selected',
82
+ 'Content Type': 'With Description'
83
+ },
84
+ props: descriptionProps,
85
+ example: function example(_ref4) {
86
+ var labelNested = _ref4.labelNested,
87
+ descriptionNested = _ref4.descriptionNested;
88
+ return /*#__PURE__*/React.createElement(Switch, {
89
+ checked: true,
90
+ label: labelNested.text,
91
+ description: descriptionNested.text
92
+ });
93
+ }
94
+ });
95
+ figma.connect(Switch, FIGMA_URL, {
96
+ variant: {
97
+ State: 'Disabled',
98
+ 'Content Type': 'Solo'
99
+ },
100
+ example: function example() {
101
+ return /*#__PURE__*/React.createElement(RawSwitch, {
102
+ disabled: true
103
+ });
104
+ }
105
+ });
106
+ figma.connect(Switch, FIGMA_URL, {
107
+ variant: {
108
+ State: 'Disabled',
109
+ 'Content Type': 'Label'
110
+ },
111
+ props: labelProps,
112
+ example: function example(_ref5) {
113
+ var labelNested = _ref5.labelNested;
114
+ return /*#__PURE__*/React.createElement(Switch, {
115
+ disabled: true,
116
+ label: labelNested.text
117
+ });
118
+ }
119
+ });
120
+ figma.connect(Switch, FIGMA_URL, {
121
+ variant: {
122
+ State: 'Disabled',
123
+ 'Content Type': 'With Description'
124
+ },
125
+ props: descriptionProps,
126
+ example: function example(_ref6) {
127
+ var labelNested = _ref6.labelNested,
128
+ descriptionNested = _ref6.descriptionNested;
129
+ return /*#__PURE__*/React.createElement(Switch, {
130
+ disabled: true,
131
+ label: labelNested.text,
132
+ description: descriptionNested.text
133
+ });
134
+ }
135
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-switch",
3
- "version": "1.2.18",
3
+ "version": "1.2.19",
4
4
  "description": "Switch UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "synerise/synerise-design",
@@ -35,12 +35,12 @@
35
35
  ],
36
36
  "types": "dist/index.d.ts",
37
37
  "dependencies": {
38
- "@synerise/ds-form-field": "^1.3.8",
39
- "@synerise/ds-typography": "^1.1.11",
38
+ "@synerise/ds-form-field": "^1.3.9",
39
+ "@synerise/ds-typography": "^1.1.12",
40
40
  "classnames": "^2.5.1"
41
41
  },
42
42
  "devDependencies": {
43
- "@synerise/ds-tooltip": "^1.4.8"
43
+ "@synerise/ds-tooltip": "^1.4.9"
44
44
  },
45
45
  "peerDependencies": {
46
46
  "@synerise/ds-core": "*",
@@ -48,5 +48,5 @@
48
48
  "react": ">=16.9.0 <= 18.3.1",
49
49
  "styled-components": "^5.3.3"
50
50
  },
51
- "gitHead": "8dfafc5d7278f09d430f1e7499782d05c76b47c0"
51
+ "gitHead": "8efc031fa688c0b87c7b3915bae93546bb63bcac"
52
52
  }