@bodynarf/react.components 1.13.8 → 1.14.1

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.
Files changed (132) hide show
  1. package/changelog.md +55 -0
  2. package/components/accordion/component/index.js +1 -1
  3. package/components/accordion/component/style.css +21 -0
  4. package/components/anchor/component/style.css +12 -0
  5. package/components/button/component/style.css +10 -0
  6. package/components/dropdown/component/style.css +101 -0
  7. package/components/dropdown/components/compact/index.d.ts.map +1 -1
  8. package/components/dropdown/components/compact/index.js +3 -3
  9. package/components/dropdown/components/label/components/empty/index.js +1 -1
  10. package/components/dropdown/components/label/components/withSearch/style.css +21 -0
  11. package/components/dropdown/types.d.ts +6 -6
  12. package/components/dropdown/types.d.ts.map +1 -1
  13. package/components/file/component/styles.css +74 -0
  14. package/components/icon/component/style.css +19 -0
  15. package/components/index.d.ts +14 -2
  16. package/components/index.d.ts.map +1 -1
  17. package/components/index.js +14 -2
  18. package/components/modal/component/index.d.ts +7 -0
  19. package/components/modal/component/index.d.ts.map +1 -0
  20. package/components/modal/component/index.js +42 -0
  21. package/components/modal/component/style.css +32 -0
  22. package/components/modal/component/style.scss +42 -0
  23. package/components/modal/index.d.ts +3 -0
  24. package/components/modal/index.d.ts.map +1 -0
  25. package/components/modal/index.js +2 -0
  26. package/components/modal/types.d.ts +44 -0
  27. package/components/modal/types.d.ts.map +1 -0
  28. package/components/modal/types.js +1 -0
  29. package/components/multiselect/component/style.css +20 -0
  30. package/components/multiselect/components/withoutLabel/index.d.ts.map +1 -1
  31. package/components/multiselect/components/withoutLabel/index.js +5 -5
  32. package/components/primitives/checkbox/component/style.css +19 -0
  33. package/components/primitives/color/component/style.css +15 -0
  34. package/components/primitives/date/component/style.css +9 -0
  35. package/components/primitives/index.d.ts +4 -0
  36. package/components/primitives/index.d.ts.map +1 -1
  37. package/components/primitives/index.js +4 -0
  38. package/components/primitives/internal/hint/style.css +4 -0
  39. package/components/primitives/number/components/withLabel/index.d.ts.map +1 -1
  40. package/components/primitives/number/components/withLabel/index.js +10 -2
  41. package/components/primitives/number/components/withoutLabel/index.d.ts.map +1 -1
  42. package/components/primitives/number/components/withoutLabel/index.js +12 -4
  43. package/components/primitives/number/types.d.ts +6 -0
  44. package/components/primitives/number/types.d.ts.map +1 -1
  45. package/components/primitives/password/component/style.css +10 -0
  46. package/components/primitives/radioGroup/component/index.d.ts +7 -0
  47. package/components/primitives/radioGroup/component/index.d.ts.map +1 -0
  48. package/components/primitives/radioGroup/component/index.js +42 -0
  49. package/components/primitives/radioGroup/component/style.css +382 -0
  50. package/components/primitives/radioGroup/component/style.scss +271 -0
  51. package/components/primitives/radioGroup/index.d.ts +3 -0
  52. package/components/primitives/radioGroup/index.d.ts.map +1 -0
  53. package/components/primitives/radioGroup/index.js +2 -0
  54. package/components/primitives/radioGroup/types.d.ts +61 -0
  55. package/components/primitives/radioGroup/types.d.ts.map +1 -0
  56. package/components/primitives/radioGroup/types.js +1 -0
  57. package/components/primitives/slider/component/index.d.ts +7 -0
  58. package/components/primitives/slider/component/index.d.ts.map +1 -0
  59. package/components/primitives/slider/component/index.js +47 -0
  60. package/components/primitives/slider/component/style.css +438 -0
  61. package/components/primitives/slider/component/style.scss +321 -0
  62. package/components/primitives/slider/index.d.ts +3 -0
  63. package/components/primitives/slider/index.d.ts.map +1 -0
  64. package/components/primitives/slider/index.js +2 -0
  65. package/components/primitives/slider/types.d.ts +51 -0
  66. package/components/primitives/slider/types.d.ts.map +1 -0
  67. package/components/primitives/slider/types.js +1 -0
  68. package/components/primitives/switch/component/index.d.ts +7 -0
  69. package/components/primitives/switch/component/index.d.ts.map +1 -0
  70. package/components/primitives/switch/component/index.js +39 -0
  71. package/components/primitives/switch/component/style.css +482 -0
  72. package/components/primitives/switch/component/style.scss +216 -0
  73. package/components/primitives/switch/index.d.ts +3 -0
  74. package/components/primitives/switch/index.d.ts.map +1 -0
  75. package/components/primitives/switch/index.js +2 -0
  76. package/components/primitives/switch/types.d.ts +23 -0
  77. package/components/primitives/switch/types.d.ts.map +1 -0
  78. package/components/primitives/switch/types.js +1 -0
  79. package/components/primitives/timePicker/component/index.d.ts +8 -0
  80. package/components/primitives/timePicker/component/index.d.ts.map +1 -0
  81. package/components/primitives/timePicker/component/index.js +65 -0
  82. package/components/primitives/timePicker/component/style.css +21 -0
  83. package/components/primitives/timePicker/component/style.scss +26 -0
  84. package/components/primitives/timePicker/index.d.ts +3 -0
  85. package/components/primitives/timePicker/index.d.ts.map +1 -0
  86. package/components/primitives/timePicker/index.js +2 -0
  87. package/components/primitives/timePicker/types.d.ts +33 -0
  88. package/components/primitives/timePicker/types.d.ts.map +1 -0
  89. package/components/primitives/timePicker/types.js +1 -0
  90. package/components/progress/component/style.css +167 -0
  91. package/components/search/component/index.d.ts.map +1 -1
  92. package/components/search/component/index.js +9 -3
  93. package/components/search/component/style.css +18 -0
  94. package/components/search/types.d.ts +5 -0
  95. package/components/search/types.d.ts.map +1 -1
  96. package/components/stepper/component/index.d.ts +7 -0
  97. package/components/stepper/component/index.d.ts.map +1 -0
  98. package/components/stepper/component/index.js +56 -0
  99. package/components/stepper/component/style.css +510 -0
  100. package/components/stepper/component/style.scss +432 -0
  101. package/components/stepper/index.d.ts +3 -0
  102. package/components/stepper/index.d.ts.map +1 -0
  103. package/components/stepper/index.js +2 -0
  104. package/components/stepper/types.d.ts +65 -0
  105. package/components/stepper/types.d.ts.map +1 -0
  106. package/components/stepper/types.js +1 -0
  107. package/components/table/component/style.css +14 -0
  108. package/components/tabs/component/style.css +6 -0
  109. package/components/tag/component/style.css +19 -0
  110. package/components/timeline/component/index.d.ts +7 -0
  111. package/components/timeline/component/index.d.ts.map +1 -0
  112. package/components/timeline/component/index.js +36 -0
  113. package/components/timeline/component/style.css +488 -0
  114. package/components/timeline/component/style.scss +397 -0
  115. package/components/timeline/index.d.ts +3 -0
  116. package/components/timeline/index.d.ts.map +1 -0
  117. package/components/timeline/index.js +2 -0
  118. package/components/timeline/types.d.ts +55 -0
  119. package/components/timeline/types.d.ts.map +1 -0
  120. package/components/timeline/types.js +1 -0
  121. package/components/tooltip/component/index.d.ts +6 -0
  122. package/components/tooltip/component/index.d.ts.map +1 -0
  123. package/components/tooltip/component/index.js +80 -0
  124. package/components/tooltip/index.d.ts +3 -0
  125. package/components/tooltip/index.d.ts.map +1 -0
  126. package/components/tooltip/index.js +2 -0
  127. package/components/tooltip/types.d.ts +31 -0
  128. package/components/tooltip/types.d.ts.map +1 -0
  129. package/components/tooltip/types.js +1 -0
  130. package/package.json +10 -3
  131. package/readme.md +18 -3
  132. package/tsconfig.tsbuildinfo +1 -1
@@ -0,0 +1,321 @@
1
+ @import "bulma/sass/utilities/derived-variables";
2
+
3
+ $slider-radius: $radius !default;
4
+ $slider-track-background: $grey-lighter !default;
5
+ $slider-track-radius: $radius !default;
6
+ $slider-track-border: 0px solid $grey !default;
7
+ $slider-track-shadow: 0px 0px 0px $grey !default;
8
+ $slider-thumb-background: $white !default;
9
+ $slider-thumb-radius: $radius !default;
10
+ $slider-thumb-border: 1px solid $grey-light !default;
11
+ $slider-thumb-shadow: none !default;
12
+ $slider-thumb-to-track-ratio: 2 !default;
13
+ $slider-output-width: 3rem !default;
14
+ $slider-output-background: $primary !default;
15
+ $slider-output-radius: $radius !default;
16
+
17
+ @mixin slider-size($size) {
18
+ $track-height: calc($size / $slider-thumb-to-track-ratio);
19
+ $thumb-size: $size;
20
+
21
+ &::-webkit-slider-runnable-track {
22
+ height: $track-height;
23
+ }
24
+
25
+ &::-moz-range-track {
26
+ height: $track-height;
27
+ }
28
+
29
+ &::-ms-track {
30
+ height: $track-height;
31
+ }
32
+
33
+ &::-webkit-slider-thumb {
34
+ height: $thumb-size;
35
+ width: $thumb-size;
36
+ margin-top: calc(($track-height - $thumb-size) / 2);
37
+ }
38
+
39
+ &::-moz-range-thumb {
40
+ height: $thumb-size;
41
+ width: $thumb-size;
42
+ }
43
+
44
+ &::-ms-thumb {
45
+ height: $thumb-size;
46
+ width: $thumb-size;
47
+ margin-top: 0;
48
+ }
49
+ }
50
+
51
+ .bbr-slider-container {
52
+ position: relative;
53
+ display: flex;
54
+ flex-direction: column;
55
+ width: 100%;
56
+ padding-top: 0.5rem;
57
+
58
+ &.is-vertical {
59
+ flex-direction: row;
60
+ width: auto;
61
+ height: 200px;
62
+ padding-top: 0;
63
+ padding-left: 0.5rem;
64
+ }
65
+ }
66
+
67
+ .bbr-slider-output {
68
+ position: absolute;
69
+ top: -1.5rem;
70
+ display: inline-block;
71
+ width: $slider-output-width;
72
+ padding: 0.25rem 0.5rem;
73
+ font-size: 0.75rem;
74
+ text-align: center;
75
+ color: $white;
76
+ background-color: $slider-output-background;
77
+ border-radius: $slider-output-radius;
78
+ pointer-events: none;
79
+
80
+ &::after {
81
+ content: "";
82
+ position: absolute;
83
+ top: 100%;
84
+ left: 50%;
85
+ margin-left: -5px;
86
+ border-width: 5px;
87
+ border-style: solid;
88
+ border-color: $slider-output-background transparent transparent transparent;
89
+ }
90
+ }
91
+
92
+ .bbr-slider-labels {
93
+ display: flex;
94
+ justify-content: space-between;
95
+ margin-top: 0.25rem;
96
+ font-size: 0.75rem;
97
+ color: $grey;
98
+ }
99
+
100
+ input[type="range"].slider.bbr-slider {
101
+ --progress-percent: 0%;
102
+
103
+ appearance: none;
104
+ width: 100%;
105
+ margin: 0;
106
+ padding: 0;
107
+ background: transparent;
108
+ cursor: pointer;
109
+
110
+ // Track styles
111
+ &::-webkit-slider-runnable-track {
112
+ box-sizing: border-box;
113
+ width: 100%;
114
+ height: 0.5rem;
115
+ background: linear-gradient(
116
+ to right,
117
+ $primary var(--progress-percent),
118
+ $slider-track-background var(--progress-percent)
119
+ );
120
+ border: $slider-track-border;
121
+ border-radius: $slider-track-radius;
122
+ box-shadow: $slider-track-shadow;
123
+ }
124
+
125
+ &::-moz-range-track {
126
+ box-sizing: border-box;
127
+ width: 100%;
128
+ height: 0.5rem;
129
+ background: $slider-track-background;
130
+ border: $slider-track-border;
131
+ border-radius: $slider-track-radius;
132
+ box-shadow: $slider-track-shadow;
133
+ }
134
+
135
+ &::-moz-range-progress {
136
+ height: 0.5rem;
137
+ background: $primary;
138
+ border-radius: $slider-track-radius;
139
+ }
140
+
141
+ &::-ms-track {
142
+ box-sizing: border-box;
143
+ width: 100%;
144
+ height: 0.5rem;
145
+ background: transparent;
146
+ border-color: transparent;
147
+ color: transparent;
148
+ }
149
+
150
+ &::-ms-fill-lower {
151
+ background: $primary;
152
+ border-radius: $slider-track-radius;
153
+ }
154
+
155
+ &::-ms-fill-upper {
156
+ background: $slider-track-background;
157
+ border-radius: $slider-track-radius;
158
+ }
159
+
160
+ // Thumb styles
161
+ &::-webkit-slider-thumb {
162
+ appearance: none;
163
+ width: 1rem;
164
+ height: 1rem;
165
+ margin-top: -0.25rem;
166
+ background: $slider-thumb-background;
167
+ border: $slider-thumb-border;
168
+ border-radius: $slider-thumb-radius;
169
+ box-shadow: $slider-thumb-shadow;
170
+ transition: transform 0.2s ease;
171
+
172
+ &:hover {
173
+ transform: scale(1.1);
174
+ }
175
+ }
176
+
177
+ &::-moz-range-thumb {
178
+ width: 1rem;
179
+ height: 1rem;
180
+ background: $slider-thumb-background;
181
+ border: $slider-thumb-border;
182
+ border-radius: $slider-thumb-radius;
183
+ box-shadow: $slider-thumb-shadow;
184
+ transition: transform 0.2s ease;
185
+
186
+ &:hover {
187
+ transform: scale(1.1);
188
+ }
189
+ }
190
+
191
+ &::-ms-thumb {
192
+ width: 1rem;
193
+ height: 1rem;
194
+ background: $slider-thumb-background;
195
+ border: $slider-thumb-border;
196
+ border-radius: $slider-thumb-radius;
197
+ box-shadow: $slider-thumb-shadow;
198
+ }
199
+
200
+ // Focus state
201
+ &:focus {
202
+ outline: none;
203
+
204
+ &::-webkit-slider-thumb {
205
+ border-color: $primary;
206
+ box-shadow: 0 0 0 0.125em rgba($primary, 0.25);
207
+ }
208
+
209
+ &::-moz-range-thumb {
210
+ border-color: $primary;
211
+ box-shadow: 0 0 0 0.125em rgba($primary, 0.25);
212
+ }
213
+ }
214
+
215
+ // Disabled state
216
+ &:disabled {
217
+ cursor: not-allowed;
218
+ opacity: 0.5;
219
+ }
220
+
221
+ // Circle style
222
+ &.is-circle {
223
+ &::-webkit-slider-thumb {
224
+ border-radius: 50%;
225
+ }
226
+
227
+ &::-moz-range-thumb {
228
+ border-radius: 50%;
229
+ }
230
+
231
+ &::-ms-thumb {
232
+ border-radius: 50%;
233
+ }
234
+ }
235
+
236
+ // Size variations
237
+ &.is-small {
238
+ @include slider-size($size-small);
239
+ }
240
+
241
+ &.is-medium {
242
+ @include slider-size($size-medium);
243
+ }
244
+
245
+ &.is-large {
246
+ @include slider-size($size-large);
247
+ }
248
+
249
+ // Color variations
250
+ @each $name, $pair in $colors {
251
+ $color: nth($pair, 1);
252
+
253
+ &.is-#{$name} {
254
+ &::-webkit-slider-runnable-track {
255
+ background: linear-gradient(
256
+ to right,
257
+ $color var(--progress-percent),
258
+ $slider-track-background var(--progress-percent)
259
+ );
260
+ }
261
+
262
+ &::-moz-range-progress {
263
+ background: $color;
264
+ }
265
+
266
+ &::-ms-fill-lower {
267
+ background: $color;
268
+ }
269
+
270
+ &:focus {
271
+ &::-webkit-slider-thumb {
272
+ border-color: $color;
273
+ box-shadow: 0 0 0 0.125em rgba($color, 0.25);
274
+ }
275
+
276
+ &::-moz-range-thumb {
277
+ border-color: $color;
278
+ box-shadow: 0 0 0 0.125em rgba($color, 0.25);
279
+ }
280
+ }
281
+ }
282
+ }
283
+
284
+ // Vertical mode
285
+ &.is-vertical {
286
+ writing-mode: vertical-lr;
287
+ direction: rtl;
288
+ width: 0.5rem;
289
+ height: 100%;
290
+ min-height: 100px;
291
+
292
+ &::-webkit-slider-runnable-track {
293
+ width: 0.5rem;
294
+ height: 100%;
295
+ background: linear-gradient(
296
+ to top,
297
+ $primary var(--progress-percent),
298
+ $slider-track-background var(--progress-percent)
299
+ );
300
+ }
301
+
302
+ &::-webkit-slider-thumb {
303
+ margin-top: 0;
304
+ margin-left: -0.25rem;
305
+ }
306
+
307
+ @each $name, $pair in $colors {
308
+ $color: nth($pair, 1);
309
+
310
+ &.is-#{$name} {
311
+ &::-webkit-slider-runnable-track {
312
+ background: linear-gradient(
313
+ to top,
314
+ $color var(--progress-percent),
315
+ $slider-track-background var(--progress-percent)
316
+ );
317
+ }
318
+ }
319
+ }
320
+ }
321
+ }
@@ -0,0 +1,3 @@
1
+ export { default } from "./component";
2
+ export * from "./types";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/primitives/slider/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,cAAc,SAAS,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { default } from "./component";
2
+ export * from "./types";
@@ -0,0 +1,51 @@
1
+ import { BaseNotNullableInputElementProps, BlurableElement } from "../../../types";
2
+ /** Slider/Range component props type */
3
+ export type SliderProps = Omit<BaseNotNullableInputElementProps<number>, "readonly" | "validationState" | "loading" | "placeholder" | "hint" | "autofocus" | "label" | "rounded"> & BlurableElement & {
4
+ /** Minimum value */
5
+ min?: number;
6
+ /** Maximum value */
7
+ max?: number;
8
+ /**
9
+ * Step increment.
10
+ * @default 1
11
+ */
12
+ step?: number;
13
+ /**
14
+ * Display current value as tooltip/bubble above the slider.
15
+ * @default false
16
+ */
17
+ showValue?: boolean;
18
+ /**
19
+ * Display min and max labels below the slider.
20
+ * @default false
21
+ */
22
+ showMinMax?: boolean;
23
+ /**
24
+ * Fill the track from start to current value with color.
25
+ * @default true
26
+ */
27
+ showProgress?: boolean;
28
+ /**
29
+ * Make the slider vertical instead of horizontal.
30
+ * @default false
31
+ */
32
+ vertical?: boolean;
33
+ /**
34
+ * Height of the slider in vertical mode (in px or any CSS unit).
35
+ * @default "200px"
36
+ */
37
+ verticalHeight?: string;
38
+ /**
39
+ * Display as circle/rounded style.
40
+ * @default false
41
+ */
42
+ circle?: boolean;
43
+ /**
44
+ * Format the displayed value.
45
+ * Used when `showValue` is true.
46
+ * @example (value) => `${value}%`
47
+ * @example (value) => `${value}°C`
48
+ */
49
+ valueFormatter?: (value: number) => string;
50
+ };
51
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/primitives/slider/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gCAAgC,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE/E,wCAAwC;AACxC,MAAM,MAAM,WAAW,GAAG,IAAI,CAAC,gCAAgC,CAAC,MAAM,CAAC,EACjE,UAAU,GAAG,iBAAiB,GAC9B,SAAS,GAAG,aAAa,GACzB,MAAM,GAAG,WAAW,GACpB,OAAO,GAAG,SAAS,CACxB,GAAG,eAAe,GAAG;IAClB,oBAAoB;IACpB,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb,oBAAoB;IACpB,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;;;;OAKG;IACH,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;CAC9C,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,7 @@
1
+ import { FC } from "react";
2
+ import "./style.scss";
3
+ import { SwitchProps } from "..";
4
+ /** Switch/Toggle input component */
5
+ declare const Switch: FC<SwitchProps>;
6
+ export default Switch;
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/primitives/switch/component/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAe,EAAE,EAAe,MAAM,OAAO,CAAC;AAQrD,OAAO,cAAc,CAAC;AAEtB,OAAO,EAAE,WAAW,EAAE,MAAM,IAAI,CAAC;AAEjC,oCAAoC;AACpC,QAAA,MAAM,MAAM,EAAE,EAAE,CAAC,WAAW,CA8F3B,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -0,0 +1,39 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useCallback } from "react";
3
+ import { emptyFn, generateGuid, getClassName, isNotNullish, isNullish } from "@bodynarf/utils";
4
+ import { ElementSize } from "../../../../types";
5
+ import { getElementColorClassName, getSizeClassName, mapDataAttributes } from "../../../../utils";
6
+ import ComponentWithLabel from "../../internal/componentWithLabel";
7
+ import "./style.scss";
8
+ /** Switch/Toggle input component */
9
+ const Switch = ({ onValueChange = emptyFn, defaultValue, label, name = generateGuid(), size = ElementSize.Normal, style, disabled = false, rounded = false, outlined = false, thin = false, rtl = false, isFormLabel = false, className, data, title }) => {
10
+ const onChecked = useCallback((event) => onValueChange(event.target.checked), [onValueChange]);
11
+ const elClassName = getClassName([
12
+ "switch",
13
+ "bbr-switch",
14
+ className,
15
+ getSizeClassName(size, ElementSize.Normal),
16
+ getElementColorClassName(style),
17
+ rounded ? "is-rounded" : "",
18
+ outlined ? "is-outlined" : "",
19
+ thin ? "is-thin" : "",
20
+ rtl ? "is-rtl" : "",
21
+ ]);
22
+ const dataAttributes = mapDataAttributes(data);
23
+ if (isNotNullish(label) && isFormLabel) {
24
+ return (_jsxs(ComponentWithLabel, { id: name, size: size, label: {
25
+ ...label,
26
+ horizontal: label.horizontal ?? false,
27
+ horizontalContainerClassName: getClassName([label.horizontalContainerClassName, "p-0"]),
28
+ }, children: [_jsx("input", { id: name, name: name, type: "checkbox", disabled: disabled, ...dataAttributes, onChange: onChecked, className: elClassName, defaultChecked: defaultValue }), _jsx("label", { title: title, htmlFor: name, className: "is-empty" })] }));
29
+ }
30
+ const isEmptyLabel = isNullish(label);
31
+ const labelClassName = isEmptyLabel
32
+ ? "is-empty"
33
+ : undefined;
34
+ const labelDataAttributes = isNullish(label?.data)
35
+ ? undefined
36
+ : mapDataAttributes(label.data);
37
+ return (_jsxs("div", { className: "bbr-field bbr-input field mr-2", children: [_jsx("input", { id: name, name: name, type: "checkbox", disabled: disabled, ...dataAttributes, onChange: onChecked, className: elClassName, defaultChecked: defaultValue }), _jsx("label", { htmlFor: name, ...labelDataAttributes, className: labelClassName, title: isEmptyLabel ? title : label?.title, children: label?.caption })] }));
38
+ };
39
+ export default Switch;