dce-reactkit 3.7.16 → 3.7.17
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/cjs/index.js +2 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/ToggleSwitch.d.ts +1 -0
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/ToggleSwitch.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/components/ToggleSwitch.tsx +4 -1
package/dist/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -29,6 +29,8 @@ type Props = {
|
|
|
29
29
|
onToggle: (isOn: boolean) => void,
|
|
30
30
|
// Unique ID for the toggle switch
|
|
31
31
|
id?: string,
|
|
32
|
+
// Custom className for the toggle switch
|
|
33
|
+
className?: string,
|
|
32
34
|
// A description for what it means when the toggle switch is on
|
|
33
35
|
// E.g. "airplane mode is active"
|
|
34
36
|
// Description will be placed into a sentence with the structure:
|
|
@@ -54,6 +56,7 @@ const ToggleSwitch: React.FC<Props> = (props) => {
|
|
|
54
56
|
isOn,
|
|
55
57
|
onToggle,
|
|
56
58
|
id,
|
|
59
|
+
className,
|
|
57
60
|
description,
|
|
58
61
|
backgroundVariantWhenOn = Variant.Info,
|
|
59
62
|
} = props;
|
|
@@ -76,7 +79,7 @@ const ToggleSwitch: React.FC<Props> = (props) => {
|
|
|
76
79
|
<button
|
|
77
80
|
id={id}
|
|
78
81
|
aria-label={`If on, ${description}. Currently ${isOn ? 'on' : 'off'}. Click to turn ${isOn ? 'off' : 'on'}.`}
|
|
79
|
-
className={`alert alert-${backgroundVariant} bg-${backgroundVariant} mb-0 rounded-pill d-inline-block pt-0 pb-0 px-3`}
|
|
82
|
+
className={`alert alert-${backgroundVariant} bg-${backgroundVariant} mb-0 rounded-pill d-inline-block pt-0 pb-0 px-3 ${className ?? ''}`}
|
|
80
83
|
onClick={() => {
|
|
81
84
|
onToggle(!isOn);
|
|
82
85
|
}}
|