graphen 2.0.5 → 2.0.6
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/package.json +1 -1
- package/src/example.tsx +27 -0
package/package.json
CHANGED
package/src/example.tsx
CHANGED
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
SegmentedControl,
|
|
16
16
|
Separator,
|
|
17
17
|
Stat,
|
|
18
|
+
Switch,
|
|
18
19
|
constants,
|
|
19
20
|
} from "./index";
|
|
20
21
|
|
|
@@ -196,6 +197,7 @@ const NAV = [
|
|
|
196
197
|
{ id: "segmented-control", label: "Segmented control" },
|
|
197
198
|
{ id: "stat", label: "Stat" },
|
|
198
199
|
{ id: "cover-empty", label: "Cover empty" },
|
|
200
|
+
{ id: "switch", label: "Switch" },
|
|
199
201
|
],
|
|
200
202
|
},
|
|
201
203
|
];
|
|
@@ -221,6 +223,7 @@ const TOC = [
|
|
|
221
223
|
["segmented-control", "Segmented control"],
|
|
222
224
|
["stat", "Stat"],
|
|
223
225
|
["cover-empty", "Cover empty"],
|
|
226
|
+
["switch", "Switch"],
|
|
224
227
|
] as const;
|
|
225
228
|
|
|
226
229
|
type IconProps = {
|
|
@@ -1210,6 +1213,30 @@ function App() {
|
|
|
1210
1213
|
</Demo>
|
|
1211
1214
|
</section>
|
|
1212
1215
|
|
|
1216
|
+
<section className="docs-section" id="switch">
|
|
1217
|
+
<div className="docs-section-eyebrow">Components / 15</div>
|
|
1218
|
+
<h2 className="docs-section-title">Switch</h2>
|
|
1219
|
+
<p className="docs-section-desc">
|
|
1220
|
+
A toggle for a single on / off setting that takes effect
|
|
1221
|
+
immediately. The <code>type</code> prop colors the active state to
|
|
1222
|
+
match the semantic palette.
|
|
1223
|
+
</p>
|
|
1224
|
+
<Demo
|
|
1225
|
+
stageClass="center"
|
|
1226
|
+
code={`<Switch onChange={(isSwitched) => console.log(isSwitched)} />
|
|
1227
|
+
<Switch isSwitched />
|
|
1228
|
+
<Switch isSwitched type="success" />
|
|
1229
|
+
<Switch isSwitched type="info" />
|
|
1230
|
+
<Switch isSwitched type="danger" />`}
|
|
1231
|
+
>
|
|
1232
|
+
<Switch />
|
|
1233
|
+
<Switch isSwitched />
|
|
1234
|
+
<Switch isSwitched type="success" />
|
|
1235
|
+
<Switch isSwitched type="info" />
|
|
1236
|
+
<Switch isSwitched type="danger" />
|
|
1237
|
+
</Demo>
|
|
1238
|
+
</section>
|
|
1239
|
+
|
|
1213
1240
|
<footer className="docs-footer">
|
|
1214
1241
|
<div>graphen · {VERSION} · MIT</div>
|
|
1215
1242
|
<div>Built by the CODA_ team</div>
|