|
1 | 1 | import React, { useState, useEffect } from 'react'; |
2 | | -import { dh, IconDefinition } from '@deephaven/icons'; |
| 2 | +import { |
| 3 | + dh, |
| 4 | + IconDefinition, |
| 5 | + vsOrganization, |
| 6 | + dhSquareFilled, |
| 7 | + dhAddSmall, |
| 8 | +} from '@deephaven/icons'; |
3 | 9 | import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; |
4 | 10 | import { Button } from '@deephaven/components'; |
5 | 11 | import PropTypes from 'prop-types'; |
@@ -105,11 +111,79 @@ function Icons(): React.ReactElement { |
105 | 111 | ); |
106 | 112 | }); |
107 | 113 |
|
| 114 | + const compositionExample = ` |
| 115 | + <div className="fa-md fa-layers"> |
| 116 | + <FontAwesomeIcon |
| 117 | + mask={vsOrganization} |
| 118 | + icon={dhSquareFilled} |
| 119 | + transform="down-7 right-7" |
| 120 | + /> |
| 121 | + <FontAwesomeIcon icon={dhAddSmall} /> |
| 122 | + </div>`; |
| 123 | + |
108 | 124 | return ( |
109 | 125 | <div> |
110 | 126 | <h2 className="ui-title">Icons</h2> |
| 127 | + |
| 128 | + <div className="row"> |
| 129 | + <div className="col"> |
| 130 | + <h4>Icon Composition</h4> |
| 131 | + <p> |
| 132 | + Icons can be used indivudally or composed together using |
| 133 | + font-awesome composition: |
| 134 | + </p> |
| 135 | + <div className="icons"> |
| 136 | + <div className="icon card"> |
| 137 | + <FontAwesomeIcon icon={vsOrganization} /> |
| 138 | + </div> |
| 139 | + <div className="icon card"> |
| 140 | + <FontAwesomeIcon icon={dhSquareFilled} /> |
| 141 | + </div> |
| 142 | + <div className="icon card"> |
| 143 | + <FontAwesomeIcon icon={dhAddSmall} /> |
| 144 | + </div> |
| 145 | + <div className="icon card">=</div> |
| 146 | + <Button |
| 147 | + kind="inline" |
| 148 | + className="card" |
| 149 | + onClick={() => { |
| 150 | + // new object, so it always flashes even on same string |
| 151 | + copyText(compositionExample) |
| 152 | + .then(() => { |
| 153 | + setFlashText({ |
| 154 | + text: <span>Copied composition example</span>, |
| 155 | + }); |
| 156 | + }) |
| 157 | + .catch(err => { |
| 158 | + setFlashText({ |
| 159 | + text: <span className="text-danger">{err.message}</span>, |
| 160 | + }); |
| 161 | + }); |
| 162 | + }} |
| 163 | + > |
| 164 | + <div className="icon"> |
| 165 | + <div className="fa-md fa-layers"> |
| 166 | + <FontAwesomeIcon |
| 167 | + mask={vsOrganization} |
| 168 | + icon={dhSquareFilled} |
| 169 | + transform="down-7 right-7" |
| 170 | + /> |
| 171 | + <FontAwesomeIcon icon={dhAddSmall} /> |
| 172 | + </div> |
| 173 | + </div> |
| 174 | + <label>Custom</label> |
| 175 | + </Button> |
| 176 | + </div> |
| 177 | + </div> |
| 178 | + </div> |
| 179 | + <hr /> |
111 | 180 | <div className="row"> |
112 | 181 | <div className="col"> |
| 182 | + <h4>All available icons</h4> |
| 183 | + <p> |
| 184 | + If you cannot find or compose a relevant icon for your use case, |
| 185 | + please request a new one to be created from design. |
| 186 | + </p> |
113 | 187 | <div className="form-inline mb-3"> |
114 | 188 | <input |
115 | 189 | type="search" |
|
0 commit comments