diff --git a/demo/react-demo/src/App.css b/demo/react-demo/src/App.css index 669f729..01caf94 100644 --- a/demo/react-demo/src/App.css +++ b/demo/react-demo/src/App.css @@ -48,22 +48,27 @@ p { .test-row-icons { padding-right: 4px; } -.test-row-icons > svg { +.test-row-icons > svg, +.test-row-icons > span { color: #afafaf; display: none; } -.test-row-icons > svg.visible { +.test-row-icons > .hidden { + display: none !important; +} +.test-row-icons > .visible { display: inline-block; } -.test-row-icons > svg.success { +.test-row-icons > .success { color: #327335; } -.test-row-icons > svg.failed { +.test-row-icons > .failed { color: #ba3329; } /* 24px icon */ -.icon-24 svg { +.icon-24 svg, +.icon-24 span { font-size: 24px; line-height: 1; vertical-align: -0.25em; @@ -85,7 +90,7 @@ p { clear: both; } -.alert svg { +.alert :is(svg, span) { position: absolute; left: 12px; top: 50%; @@ -110,17 +115,17 @@ p { text-decoration: underline; } -.checkbox svg { +.checkbox :is(svg, span) { margin-right: 4px; color: #afafaf; font-size: 24px; line-height: 1em; vertical-align: -0.25em; } -.checkbox--checked svg { +.checkbox--checked :is(svg, span) { color: #327335; } -.checkbox:hover svg { +.checkbox:hover :is(svg, span) { color: inherit; } @@ -130,7 +135,7 @@ p { } /* Inline demo */ -.inline-demo svg { +.inline-demo :is(svg, span) { color: #06a; margin: 0 8px; position: relative; diff --git a/demo/react-demo/src/demo-components/Checkbox.tsx b/demo/react-demo/src/demo-components/Checkbox.tsx index 478482d..adba336 100644 --- a/demo/react-demo/src/demo-components/Checkbox.tsx +++ b/demo/react-demo/src/demo-components/Checkbox.tsx @@ -12,6 +12,11 @@ interface CheckboxProps { export function Checkbox(props: CheckboxProps) { const [checked, setChecked] = useState(props.checked); + function onClick(event: React.MouseEvent) { + event.preventDefault(); + setChecked((value) => !value); + } + return (
setChecked((value) => !value)} + onClick={onClick} > - + {props.text} {props.hint} diff --git a/demo/react-demo/src/demo-components/Inline.tsx b/demo/react-demo/src/demo-components/Inline.tsx index 6a33d27..f552e22 100644 --- a/demo/react-demo/src/demo-components/Inline.tsx +++ b/demo/react-demo/src/demo-components/Inline.tsx @@ -20,11 +20,13 @@ export function InlineDemo() { id="inline-demo-inline-offline" icon="experiment2" inline={true} + mode="style" />
diff --git a/demo/react-demo/src/demo-components/UsageFull.tsx b/demo/react-demo/src/demo-components/UsageFull.tsx index 01fa8d7..e87b491 100644 --- a/demo/react-demo/src/demo-components/UsageFull.tsx +++ b/demo/react-demo/src/demo-components/UsageFull.tsx @@ -6,7 +6,8 @@ export function FullUsageDemo() {

Usage (full module)

- Icon referenced by name: + Icons referenced by name (as SVG, as SPAN):{' '} +
diff --git a/demo/react-demo/src/demo-components/UsageFullOffline.tsx b/demo/react-demo/src/demo-components/UsageFullOffline.tsx index 5e6e5ae..ded3f83 100644 --- a/demo/react-demo/src/demo-components/UsageFullOffline.tsx +++ b/demo/react-demo/src/demo-components/UsageFullOffline.tsx @@ -8,17 +8,20 @@ export function FullOfflineUsageDemo() {

Usage (full module, offline mode)

- Icon referenced by name: + Icons referenced by name (as SVG, as SPAN): +
- Icon referenced by object: + Icons referenced by object (as SVG, as SPAN):{' '} + +
2 icons imported from icon set: - +
- + Important notice with alert icon!
diff --git a/demo/react-demo/src/demo-components/UsageOffline.tsx b/demo/react-demo/src/demo-components/UsageOffline.tsx index a255ee8..bb0b487 100644 --- a/demo/react-demo/src/demo-components/UsageOffline.tsx +++ b/demo/react-demo/src/demo-components/UsageOffline.tsx @@ -8,15 +8,18 @@ export function OfflineUsageDemo() {

Usage (offline module)

- Icon referenced by name: + Icons referenced by name (as SVG, as SPAN): +
- Icon referenced by object: + Icons referenced by object (as SVG, as SPAN):{' '} + {' '} +
2 icons imported from icon set:{' '} - +
diff --git a/demo/react-demo/src/test-components/TestIcons.tsx b/demo/react-demo/src/test-components/TestIcons.tsx index 7581e85..30aca4c 100644 --- a/demo/react-demo/src/test-components/TestIcons.tsx +++ b/demo/react-demo/src/test-components/TestIcons.tsx @@ -19,18 +19,21 @@ export function TestIcons(props: TestIconsProps) { - Green color from attribute (overrides style) + red from style:{' '} + Red color from attribute + green from style (style overrides + attribute):{' '} { const key = 'full-color3'; diff --git a/demo/react-demo/src/test-components/TestsFullOffline.tsx b/demo/react-demo/src/test-components/TestsFullOffline.tsx index 5ca4ed0..7697f38 100644 --- a/demo/react-demo/src/test-components/TestsFullOffline.tsx +++ b/demo/react-demo/src/test-components/TestsFullOffline.tsx @@ -176,12 +176,13 @@ export function TestsFullOffline() {
- Green color from attribute (overrides style) + red from style:{' '} + Red color from attribute + green from style (style overrides + attribute):{' '} { const key = 'full-offline-color3'; diff --git a/demo/react-demo/src/test-components/TestsOffline.tsx b/demo/react-demo/src/test-components/TestsOffline.tsx index 62b70e9..89b9144 100644 --- a/demo/react-demo/src/test-components/TestsOffline.tsx +++ b/demo/react-demo/src/test-components/TestsOffline.tsx @@ -176,12 +176,13 @@ export function TestsOffline() {
- Green color from attribute (overrides style) + red from style:{' '} + Red color from attribute + green from style (style overrides + attribute):{' '} { const key = 'offline-color3';