From 69b1b38202ef44f9c25e772ecd4128e7c51d8d19 Mon Sep 17 00:00:00 2001 From: Aleksandr Gumroian Date: Thu, 17 Apr 2025 17:13:54 +0200 Subject: [PATCH] docs: Fix code snippets syntax highlighting & some refactoring --- src/bootstrap/Checkbox.md | 2 +- src/bootstrap/CopyInput.md | 2 +- src/bootstrap/DataTimeInput.md | 2 +- src/bootstrap/DownloadButton.md | 2 +- src/bootstrap/EmailInput.md | 4 +- src/bootstrap/FileInput.md | 4 +- src/bootstrap/Modal.md | 8 +- src/bootstrap/NumberInput.md | 3 +- src/bootstrap/PasswordInput.md | 2 +- src/bootstrap/RadioSet.md | 3 +- src/bootstrap/Select.md | 3 +- src/bootstrap/Spinner.md | 2 +- src/bootstrap/Switch.md | 2 +- src/bootstrap/TextInput.md | 3 +- src/bootstrap/ThreeDotsMenu.md | 2 +- src/common/RichTable/RichTable.md | 128 ++---------------------------- src/common/RichTable/mockData.js | 119 +++++++++++++++++++++++++++ src/form/components/ForisForm.md | 40 +++++----- 18 files changed, 171 insertions(+), 160 deletions(-) create mode 100644 src/common/RichTable/mockData.js diff --git a/src/bootstrap/Checkbox.md b/src/bootstrap/Checkbox.md index ccf1c43..49e82f0 100644 --- a/src/bootstrap/Checkbox.md +++ b/src/bootstrap/Checkbox.md @@ -4,7 +4,7 @@ using in foris forms. All additional `props` are passed to the `` HTML component. -```js +```jsx import { useState } from "react"; const [value, setValue] = useState(false); diff --git a/src/bootstrap/CopyInput.md b/src/bootstrap/CopyInput.md index dcd6b4c..b778664 100644 --- a/src/bootstrap/CopyInput.md +++ b/src/bootstrap/CopyInput.md @@ -4,7 +4,7 @@ be used with `readOnly` and `disabled` parameters, please see an example. All additional `props` are passed to the `` HTML component. -```js +```jsx import React, { useState } from "react"; const [value, setValue] = useState("Text to appear in clipboard."); diff --git a/src/bootstrap/DataTimeInput.md b/src/bootstrap/DataTimeInput.md index 4dfc33f..fb4af69 100644 --- a/src/bootstrap/DataTimeInput.md +++ b/src/bootstrap/DataTimeInput.md @@ -4,7 +4,7 @@ Adopted from `react-datetime/DateTime` datatime picker component. It uses It requires `ForisTranslations.locale` to be defined in order to use right locale. -```js +```jsx ForisTranslations = { locale: "en" }; import { useState, useEffect } from "react"; diff --git a/src/bootstrap/DownloadButton.md b/src/bootstrap/DownloadButton.md index e70e3d6..30066f5 100644 --- a/src/bootstrap/DownloadButton.md +++ b/src/bootstrap/DownloadButton.md @@ -5,6 +5,6 @@ Firefox. See [related issue](https://bugzilla.mozilla.org/show_bug.cgi?id=858538) for more details. -```js +```jsx Download ``` diff --git a/src/bootstrap/EmailInput.md b/src/bootstrap/EmailInput.md index 1178756..fcb22ae 100644 --- a/src/bootstrap/EmailInput.md +++ b/src/bootstrap/EmailInput.md @@ -4,10 +4,12 @@ checking. It's only meaningful using inside `
`. All additional `props` are passed to the `` HTML component. -```js +```jsx import { useState } from "react"; import Button from "./Button"; + const [email, setEmail] = useState("Wrong email"); + e.preventDefault()}> ` HTML component. -```js +```jsx import { useState } from "react"; const [files, setFiles] = useState([]); @@ -23,7 +23,7 @@ const label = files.length === 1 ? files[0].name : "Choose file"; ### FileInput with multiple files -```js +```jsx import { useState } from "react"; const [files, setFiles] = useState([]); diff --git a/src/bootstrap/Modal.md b/src/bootstrap/Modal.md index 08d4878..7e70b6d 100644 --- a/src/bootstrap/Modal.md +++ b/src/bootstrap/Modal.md @@ -6,9 +6,9 @@ the page since modals are rendered in portals. Modals also have three optional sizes, which can be defined through the `size` prop: -- small - `sm` -- large - `lg` -- extra-large - `xl` +- small - `sm` +- large - `lg` +- extra-large - `xl` For more details please visit Bootstrap @@ -18,7 +18,7 @@ documentation.