Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(): create new documentation #3469

Open
wants to merge 234 commits into
base: 5.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
234 commits
Select commit Hold shift + click to select a range
3cc6c79
feat(retail-ui): update common dev dependencies (#3398)
HelenaIsh Apr 8, 2024
a66303d
feat(react-ui): update runtime dependencies (#3397)
HelenaIsh Apr 9, 2024
be20024
feat(react-ui): update react and testing packages (#3402)
HelenaIsh Apr 22, 2024
02a82cf
Merge branch '5.x' into update-dependencies-5.0
HelenaIsh Apr 24, 2024
69383ee
Merge branch 'update-dependencies-5.0' into update-react-ui-all-dev-d…
HelenaIsh Apr 24, 2024
43d2a02
chore: fix after merge
HelenaIsh Apr 24, 2024
cce656b
feat(react-ui): update babel and webpack (#3411)
HelenaIsh Apr 24, 2024
5efbcec
feat(react-ui): update typescript and others (#3413)
HelenaIsh Apr 27, 2024
38a6f8b
feat: upgrade storybook to 7 version
HelenaIsh May 3, 2024
336d5bc
chore: delete stories
HelenaIsh May 3, 2024
7e33c4a
chore: fix Button stories
HelenaIsh May 3, 2024
78cffec
chore: refactor
HelenaIsh May 3, 2024
ba09215
chore: fix storybook config
HelenaIsh May 6, 2024
530e0a0
feat: update creevey
HelenaIsh May 6, 2024
7aeab71
chore: fix creevey config
HelenaIsh May 8, 2024
1ba37b3
chore: fix Button test
HelenaIsh May 8, 2024
89dcc02
chore: fix Button test
HelenaIsh May 8, 2024
067fb80
chore: fix Autocomplete test
HelenaIsh May 8, 2024
f5d225c
chore: fix Autocomplete test
HelenaIsh May 8, 2024
468197c
chore: fix baseline test
HelenaIsh May 8, 2024
4af759e
chore: fix Calendar test
HelenaIsh May 8, 2024
a51a273
chore: fix Center test
HelenaIsh May 8, 2024
8d7871f
chore: fix Checkbox test
HelenaIsh May 8, 2024
00ae528
chore: fix Combobox test
HelenaIsh May 8, 2024
af6b581
chore: fix CurrencyInput test
HelenaIsh May 8, 2024
e81effe
chore: fix CurrencyLabel test
HelenaIsh May 13, 2024
04fa17c
chore: rename static method in Select
HelenaIsh May 13, 2024
ed0d744
chore: fix DateInput test
HelenaIsh May 13, 2024
709b0bd
chore: fix DatePicker test
HelenaIsh May 13, 2024
0fe7a1b
chore: fix Dropdown test
HelenaIsh May 13, 2024
d7fc51d
chore: fix DropdownMenu test
HelenaIsh May 13, 2024
cccff29
chore: fix FileUploader test
HelenaIsh May 13, 2024
ef3399f
chore: fix FxInput test
HelenaIsh May 13, 2024
0af3607
chore: fix Gapped test
HelenaIsh May 13, 2024
00be7d6
chore: fix GlobalLoader test
HelenaIsh May 13, 2024
0bc33ad
chore: fix Group test
HelenaIsh May 13, 2024
c56fbe5
chore: fix Hint test
HelenaIsh May 13, 2024
c1a5efb
chore: fix Input test
HelenaIsh May 14, 2024
16d302f
chore: fix Kebab test
HelenaIsh May 14, 2024
753dcfe
chore: fix Link test
HelenaIsh May 14, 2024
cd2ed4b
chore: fix Loader test
HelenaIsh May 14, 2024
beff2c0
chore: fix MaskedInput test
HelenaIsh May 14, 2024
8c59154
chore: fix MenuFooter test
HelenaIsh May 14, 2024
de4bf51
chore: fix MenuHeader test
HelenaIsh May 14, 2024
c2458ea
chore: fix MenuItem test
HelenaIsh May 14, 2024
eb138e7
chore: fix MiniModal test
HelenaIsh May 14, 2024
058d57d
chore: fix Modal test
HelenaIsh May 14, 2024
4059d08
chore: fix Paging test
HelenaIsh May 14, 2024
00495ff
chore: fix PasswordInput test
HelenaIsh May 14, 2024
7d06d93
chore: fix Radio test
HelenaIsh May 14, 2024
8947b11
chore: fix RadioGroup test
HelenaIsh May 14, 2024
b5b7292
chore: fix ScrollContainer test
HelenaIsh May 14, 2024
c0b0005
chore: fix Select test
HelenaIsh May 14, 2024
3d825d4
chore: fix SidePage test
HelenaIsh May 15, 2024
1faee3a
chore: fix SingleToast test
HelenaIsh May 15, 2024
ef013ce
chore: fix Spinner test
HelenaIsh May 15, 2024
3978dc0
chore: fix Sticky test
HelenaIsh May 15, 2024
d284ad4
chore: fix Switcher test
HelenaIsh May 15, 2024
792d5fd
chore: fix Tabs test
HelenaIsh May 15, 2024
df16998
chore: fix Textarea test
HelenaIsh May 15, 2024
e54186c
chore: fix Toast test
HelenaIsh May 15, 2024
6281e81
chore: fix Toggle test
HelenaIsh May 15, 2024
34851f6
chore: fix Token test
HelenaIsh May 15, 2024
8e524d7
chore: fix TokenInput test
HelenaIsh May 15, 2024
9fe937d
chore: fix Tooltip test
HelenaIsh May 15, 2024
255a0b1
chore: fix TooltipMenu test
HelenaIsh May 15, 2024
456603d
chore: fix CloseButtonIcon test
HelenaIsh May 15, 2024
3429292
chore: fix ComboBoxView test
HelenaIsh May 15, 2024
35c428a
chore: fix FileUploaderFile test
HelenaIsh May 15, 2024
d6c2969
chore: fix HideBodyVerticalScroll test
HelenaIsh May 15, 2024
a02f11b
chore: fix IgnoreLayerClick test
HelenaIsh May 15, 2024
7e86260
chore: fix Menu test
HelenaIsh May 15, 2024
6957159
chore: fix PerformanceMetrics test
HelenaIsh May 15, 2024
d577793
chore: fix Popup test
HelenaIsh May 15, 2024
bfe3f42
chore: fix PopupMenu test
HelenaIsh May 15, 2024
7a2a58c
chore: fix ThemePlayground test
HelenaIsh May 15, 2024
8a33651
chore: fix ThemeShowcase test
HelenaIsh May 15, 2024
2c8a16c
chore: fix ZIndex test
HelenaIsh May 15, 2024
7e29711
chore: delete unused import
HelenaIsh May 15, 2024
9a7c97e
chore: rollback storybook version in validations
HelenaIsh May 15, 2024
ab39c44
chore: fix lint
HelenaIsh May 15, 2024
568fc21
chore: fix prettier
HelenaIsh May 15, 2024
552108c
chore: add example and autoprops to button
SchwJ May 16, 2024
d1e7fb4
chore: fix storySort
HelenaIsh May 16, 2024
1d2f15b
chore: fix yarn lock
HelenaIsh May 16, 2024
aa2f041
chore: fix creevey in validations
HelenaIsh May 16, 2024
f60990a
chore: fix yarn lock
HelenaIsh May 16, 2024
c66e6e9
chore: add table of contents
SchwJ May 16, 2024
47a1a0c
chore: add structure and usage example
SchwJ May 16, 2024
165ec16
Merge branch 'update-storybook-7' into mdx-exaples-on-storybook-7
SchwJ May 16, 2024
de256c6
chore: delete test component
SchwJ May 16, 2024
31011ca
chore(Button): link, ?examples, !props
SchwJ May 20, 2024
2d3a02e
feat(react-ui): update all dev dependencies (#3409)
HelenaIsh May 28, 2024
c825a45
feat: update codemod (#3429)
HelenaIsh May 30, 2024
a09aad0
feat: update validations package (#3428)
HelenaIsh May 30, 2024
cf13fa6
Merge remote-tracking branch 'origin/update-dependencies-5.0' into md…
SchwJ May 31, 2024
dedde9f
chore(Button): props work!
SchwJ Jun 2, 2024
0b7bf19
chore(Button): props, folders, examples view, no examples code, have …
SchwJ Jun 3, 2024
8352256
chore(): props, folders, examples view, no examples code, have stories
SchwJ Jun 3, 2024
267e270
chore(): add storybook documentation comand, remove stories from docs
SchwJ Jun 3, 2024
0aed97d
docs(Checkbox): add examples to .mdx
Jul 11, 2024
3de264a
docs(Checkbox): add examples to .mdx
Jul 11, 2024
28cb039
Merge branch 'mdx-checkbox' of github.com:skbkontur/retail-ui into md…
Jul 11, 2024
f39efc3
docs(ValidationContainer): returned deleted screenshot img from Valid…
Jul 11, 2024
514768b
docs(): create mdx docs and create default stories
SchwJ Jul 12, 2024
65f2f3c
fix(): add @types/webpack-env dependency
SchwJ Jul 12, 2024
e9cb6ba
Merge branch 'mdx-exaples-on-storybook-7' into mdx-checkbox
SchwJ Jul 12, 2024
958b8df
fix(): mini-fix indents to start CI tests
SchwJ Jul 12, 2024
1d8722e
fix(): mini-fix indents to start CI tests
SchwJ Jul 14, 2024
06f1821
Merge branch 'mdx-exaples-on-storybook-7' into mdx-checkbox
SchwJ Jul 14, 2024
e5cd861
chore(): try to use correct type
SchwJ Jul 15, 2024
51424a5
chore(): try to change require type
SchwJ Jul 15, 2024
3c1f2d3
Merge remote-tracking branch 'refs/remotes/origin/5.x' into mdx-exapl…
SchwJ Jul 16, 2024
6206426
docs(Versions): add versions react-ui library
Jul 16, 2024
59a32bd
chore(): try to fix context
SchwJ Jul 16, 2024
5e5f7e4
chore(): fix many lint errors
SchwJ Jul 16, 2024
3c411b3
chore(): fix creating hybridStoriesProvider
SchwJ Jul 16, 2024
1bc96a8
docs(LocaleDecorator): add locale decarator in storybook
Jul 17, 2024
b3ba4da
docs(LocaleDecorator): add hideLocaleBtnInUnsupportedControls
Jul 18, 2024
3740010
chore(): fix problems in docs
SchwJ Jul 22, 2024
fea442c
docs(LocaleDecorator): add dynamic text with icon, prettier
Jul 22, 2024
f407a56
chore(): remove currency input doc!
SchwJ Jul 22, 2024
43956a2
Merge remote-tracking branch 'origin/5.x' into mdx-exaples-on-storybo…
SchwJ Jul 23, 2024
a17d5bc
docs(featureFlags): add addon feature-flag storybook
Jul 24, 2024
0d4247f
docs(featureFlags): update typings for storybook-addon-multiple
Jul 24, 2024
39e0d51
docs(FeatureFlags): rename featureFlags to featureFlagsConfig, change…
Jul 24, 2024
1609a91
chore(): fix for screenshot tests
SchwJ Jul 25, 2024
b7c67d9
chore(): fix screenshot tests
SchwJ Jul 25, 2024
a66f39d
chore(): fix screenshot tests 4
SchwJ Jul 25, 2024
24365df
chore(): fix Tooltip screenshot test
SchwJ Jul 29, 2024
59f7722
chore(): add delay for screenshot tests
SchwJ Jul 29, 2024
f711f88
chore(): add delay for screenshot tests
SchwJ Jul 29, 2024
5f86c7e
chore(): add delay before screenshot test
SchwJ Jul 29, 2024
5c2d769
chore(): add delay before screenshot test
SchwJ Jul 29, 2024
143db33
chore(): add huge delay before screenshot tests
SchwJ Jul 29, 2024
ef1776d
chore(): skip 5 screenshot tests
SchwJ Jul 29, 2024
66bd18a
chore(): skip 5 affected screenshot tests
SchwJ Jul 29, 2024
08fe4db
Merge branch 'mdx-exaples-on-storybook-7' into mdx-toolbar-locale
SchwJ Jul 30, 2024
89b6db9
Merge branch 'mdx-exaples-on-storybook-7' into mdx-toolbar-features
SchwJ Jul 30, 2024
2be392b
Merge branch 'mdx-exaples-on-storybook-7' into mdx-checkbox
SchwJ Jul 30, 2024
aa18c41
chore(Checkbox): fix screenshots
SchwJ Jul 30, 2024
a457625
chore(Checkbox): fix screenshots and lint
SchwJ Jul 30, 2024
05b0a55
Merge pull request #3466 from skbkontur/mdx-checkbox
SchwJ Jul 30, 2024
5315b84
chore(): fix merge error
SchwJ Jul 30, 2024
ddcceed
chore(): fix lint errors
SchwJ Jul 31, 2024
47a32ee
chore(): fix lint errors
SchwJ Jul 31, 2024
3b3efd9
chore(): fix lint error
SchwJ Jul 31, 2024
7cc21b0
docs(featureFlags): update featureFlagsConfig.tsx
Aug 7, 2024
a3193de
docs(LocaleDecorator): update LocaleDecorator
Aug 8, 2024
65a5de8
Merge pull request #3473 from skbkontur/mdx-toolbar-features
SchwJ Aug 8, 2024
86eb79b
Merge branch 'mdx-exaples-on-storybook-7' into mdx-toolbar-locale
SchwJ Aug 8, 2024
f7c5816
Merge pull request #3471 from skbkontur/mdx-toolbar-locale
SchwJ Aug 8, 2024
cfb428a
chore(): improve props
SchwJ Aug 13, 2024
7e90d78
Merge remote-tracking branch 'origin/mdx-exaples-on-storybook-7' into…
Aug 14, 2024
84a0bd1
docs(featureFlags): add Feature flags storybook validations
Aug 14, 2024
157d936
docs(featureFlags): add Feature flags storybook validations
Aug 14, 2024
81e42e2
docs(featureFlags): update ValidationContextWrapper
Aug 14, 2024
66a27cb
docs(versions): update Versions mdx,tsx
Aug 16, 2024
0afbb46
Merge branch 'mdx-exaples-on-storybook-7' into mdx-versions
Aug 16, 2024
8ce9224
docs(versions): fix lint
Aug 16, 2024
b56f433
docs(featureFlags): add message empty featureFlags
Aug 16, 2024
d3dd031
docs(featureFlags): add comments in webpack.config storybook
Aug 16, 2024
de63dec
docs(featureFlags): update webpack.config storybook
Aug 16, 2024
56e051e
docs(featureFlags): update webpack.config storybook
Aug 16, 2024
8ad8c59
docs(featureFlags): update webpack.config storybook
Aug 19, 2024
85100a6
Merge pull request #3485 from skbkontur/mdx-toolbar-features-validati…
SchwJ Aug 19, 2024
25ac743
docs(featureFlags): update webpack.config storybook, featureFlagsConfig
Aug 19, 2024
7eb47a7
docs(featureFlags): update featureFlagsConfig filter
Aug 19, 2024
d6978ba
docs(versions): update catch err
Aug 19, 2024
b8e25d8
Merge pull request #3488 from skbkontur/mdx-toolbar-features-validati…
SchwJ Aug 20, 2024
ae8221c
Merge pull request #3487 from skbkontur/mdx-feature-flags-config
SchwJ Aug 20, 2024
d60e023
docs(versions): update error message
Aug 20, 2024
ff2701e
docs(versions): update error message
Aug 20, 2024
15da262
docs(config): update storybook config, disable notifications update
Aug 21, 2024
78f0e85
Merge pull request #3486 from skbkontur/mdx-versions
SchwJ Aug 21, 2024
1ebd71e
Merge branch 'mdx-exaples-on-storybook-7' into mdx-hide-popup
Aug 21, 2024
f798918
docs(config): update storybook initial page
Aug 21, 2024
82b936e
docs(featureFlags): remove testFeatureFlags validations
Aug 21, 2024
d301ae2
Merge pull request #3490 from skbkontur/mdx-hide-popup
SchwJ Aug 21, 2024
1b188b0
Merge pull request #3491 from skbkontur/mdx-remove-test-feature-flags…
SchwJ Aug 21, 2024
319a947
docs(Paging): update story example
Aug 27, 2024
a4216b0
Merge pull request #3495 from skbkontur/mdx-examples-paging
SchwJ Aug 27, 2024
ac0299a
chore(): fix mistakes
SchwJ Aug 28, 2024
0ccaad7
Merge pull request #3492 from skbkontur/mdx-description
SchwJ Aug 28, 2024
bfddcfc
chore(): fix md examples and get translated docs
SchwJ Aug 28, 2024
b9211a3
chore(): fix mistake
SchwJ Aug 28, 2024
ea6573c
docs(Versions): disable table of contents
Aug 29, 2024
bf41e4c
docs(Versions): disable table of contents
Aug 29, 2024
cf91b35
Merge pull request #3497 from skbkontur/mdx-versions-without-toc
SchwJ Aug 29, 2024
5687e14
Merge branch 'mdx-exaples-on-storybook-7' into update-examples-descri…
SchwJ Aug 30, 2024
2e6eabd
chore(): fix lint errors in mdx
SchwJ Aug 30, 2024
c2bd781
chore(): fix settings.kts
SchwJ Sep 3, 2024
c124b14
chore(): fix rm parameters
SchwJ Sep 3, 2024
981a8d0
chore(): fix rm parameters
SchwJ Sep 3, 2024
6b67064
chore(): read settings.kts variables
SchwJ Sep 3, 2024
8df9877
chore(): try to add /
SchwJ Sep 3, 2024
1ef9e83
chore(): try to add *
SchwJ Sep 3, 2024
c5f415d
chore(): fix story order and queryselector
SchwJ Sep 4, 2024
59c9450
chore(): fix base url in versions component
SchwJ Sep 4, 2024
eae31a0
chore(): fix links to guides and figma
SchwJ Sep 4, 2024
ea75553
chore(): exclude __docs__ from prod typecheck
SchwJ Sep 5, 2024
019add1
chore(): fix all lint checks
SchwJ Sep 5, 2024
c15eac6
chore(): not screenshot docs examples
SchwJ Sep 6, 2024
44896fb
chore(): fix import in DatePicker.docs.stories.tsx
SchwJ Sep 6, 2024
9789560
Merge pull request #3499 from skbkontur/update-examples-description-i…
SchwJ Sep 6, 2024
f269e32
chore(): transer screenshots from groups to main directory
SchwJ Sep 6, 2024
6159685
Merge pull request #3505 from skbkontur/transfer-screenshots-back
SchwJ Sep 6, 2024
09d3736
chore(): create accessibility doc
SchwJ Sep 10, 2024
f22fa03
chore(): create mobiles doc
SchwJ Sep 10, 2024
e791451
chore(): create ssr doc
SchwJ Sep 11, 2024
a457959
chore(): create ecosystem doc
SchwJ Sep 12, 2024
0e879e6
chore(): create migration doc
SchwJ Sep 13, 2024
3c321db
chore(): create contributing doc
SchwJ Sep 13, 2024
51eddd5
chore(): fix migration doc
SchwJ Sep 13, 2024
a00f641
chore(): create changelog doc
SchwJ Sep 13, 2024
f603e99
chore(): move versions doc
SchwJ Sep 13, 2024
8985a8c
chore(): change doc files processing
SchwJ Sep 13, 2024
078f11f
chore(): remove design details from documentation
SchwJ Sep 13, 2024
9f60f78
chore(): fix lint ignore
SchwJ Sep 13, 2024
9cb708c
chore(): fix lint ignore
SchwJ Sep 16, 2024
ff2ef3a
Merge pull request #3509 from skbkontur/mdx-description-fix
SchwJ Sep 16, 2024
fdf8796
Merge pull request #3507 from skbkontur/mdx-common-doc-files
SchwJ Sep 16, 2024
65fc281
chore(): new component groups
SchwJ Sep 16, 2024
22fc517
Merge branch 'mdx-exaples-on-storybook-7' into mdx-group-components
SchwJ Sep 16, 2024
7376a6d
chore(): fix group order
SchwJ Sep 16, 2024
1cfc6ec
chore(): fix lint error
SchwJ Sep 16, 2024
504097b
Merge pull request #3510 from skbkontur/mdx-group-components
SchwJ Sep 16, 2024
94aa555
chore(): done versions page
SchwJ Sep 17, 2024
eddc401
chore(): fix versions sort
SchwJ Sep 17, 2024
6b76eaa
chore(): fix versions sort
SchwJ Sep 18, 2024
af748e0
Merge pull request #3511 from skbkontur/mdx-versions
SchwJ Sep 18, 2024
ad5a3ab
chore(): fix examples errors
SchwJ Sep 19, 2024
2cea1a7
chore(): fix lint error
SchwJ Sep 19, 2024
e205534
Merge pull request #3514 from skbkontur/fix-docs-examples
SchwJ Sep 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
31 changes: 19 additions & 12 deletions .teamcity/settings.kts
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ object ReactUI_Storybook : BuildType({
name = "Build Storybook"
id = "RUNNER_2"
type = "jonnyzzz.yarn"
param("yarn_commands", "workspace @skbkontur/react-ui storybook:build")
param("yarn_commands", "workspace @skbkontur/react-ui storybook:docs-build")
}
script {
name = "Git clone"
Expand All @@ -451,13 +451,19 @@ object ReactUI_Storybook : BuildType({
${'$'}version_from_git = "%teamcity.build.branch%".replace('@skbkontur/react-ui@', '')
${'$'}version_from_env = ${'$'}env:STORYBOOK_VERSION
${'$'}storybook_version = If (${'$'}version_from_env) {${'$'}version_from_env} Else {${'$'}version_from_git}

Write-Host "##teamcity[setParameter name='env.STORYBOOK_VERSION' value='${'$'}storybook_version']"

${'$'}src_path = "./packages/react-ui/.storybook/build"
Write-Host "___________________________"

${'$'}src_path = "./packages/react-ui/.storybook/build/*"
${'$'}dest_path = "./docs-repo/docs/storybook/react-ui/${'$'}storybook_version"
if (Test-Path ${'$'}dest_path) { rm ${'$'}dest_path -force -recurse }
mkdir ${'$'}src_path
Write-Host "src_path: \${'$'}src_path"
Write-Host "dest_path: \${'$'}dest_path"
Write-Host "storybook_version: \${'$'}storybook_version"
Write-Host "version_from_env: \${'$'}version_from_env"
Write-Host "version_from_git: \${'$'}version_from_git"
if (Test-Path ${'$'}dest_path) { rm ${'$'}dest_path -Recurse -Force }
mkdir ${'$'}dest_path
cp -r ${'$'}src_path ${'$'}dest_path
""".trimIndent()
}
Expand Down Expand Up @@ -489,7 +495,7 @@ object ReactUI_Storybook : BuildType({
branchFilter = "+:refs/tags/@skbkontur/react-ui@*"
}
}

disableSettings("COMMIT_STATUS_PUBLISHER", "PULL_REQUESTS")
})

Expand Down Expand Up @@ -840,7 +846,7 @@ object Validations_Storybook : BuildType({
name = "Build Storybook"
id = "RUNNER_2"
type = "jonnyzzz.yarn"
param("yarn_commands", "workspace react-ui-validations storybook:build")
param("yarn_commands", "workspace react-ui-validations storybook:docs-build")
}
script {
name = "Git clone"
Expand All @@ -855,12 +861,13 @@ object Validations_Storybook : BuildType({
${'$'}version_from_git = "%teamcity.build.branch%".replace('react-ui-validations@', '')
${'$'}version_from_env = ${'$'}env:STORYBOOK_VERSION
${'$'}storybook_version = If (${'$'}version_from_env) {${'$'}version_from_env} Else {${'$'}version_from_git}

Write-Host "##teamcity[setParameter name='env.STORYBOOK_VERSION' value='${'$'}storybook_version']"

${'$'}src_path = "./packages/react-ui-validations/.storybook/build"
${'$'}dest_path = "./docs-repo/docs/storybook/react-ui-validations/${'$'}storybook_version"
if (Test-Path ${'$'}dest_path) { rm ${'$'}dest_path -force -recurse }
if (Test-Path ${'$'}dest_path) { rm ${'$'}dest_path -Recurse -Force }
mkdir ${'$'}dest_path
cp -r ${'$'}src_path ${'$'}dest_path
""".trimIndent()
}
Expand Down Expand Up @@ -892,6 +899,6 @@ object Validations_Storybook : BuildType({
branchFilter = "+:refs/tags/@skbkontur/react-ui-validations@*"
}
}

disableSettings("COMMIT_STATUS_PUBLISHER", "PULL_REQUESTS")
})
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
}
},
"resolutions": {
"selenium-webdriver": "4.0.0-beta.4"
"selenium-webdriver": "4.0.0-beta.4",
"@storybook/addons": "7.6.18",
"react-docgen-typescript": "2.3.0-beta.0"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import React from 'react';
import type { Decorator } from '@storybook/react';

import { ValidationsFeatureFlagsContext } from '../../../src/';

const createFeatureFlagsWithBoolean = (featureFlags: string[]) =>
featureFlags.reduce((acc, featureFlag) => {
return { ...acc, [featureFlag]: true };
}, {});

const FeatureFlagsDecorator: Decorator = (Story, context) => {
const { globals } = context;
const { activeFeatureFlags }: { [key: string]: string[] } = globals.multiselect;
const activeFeatureFlagsWithBoolean =
activeFeatureFlags?.length > 0 ? createFeatureFlagsWithBoolean(activeFeatureFlags) : {};
return (
<ValidationsFeatureFlagsContext.Provider value={{ ...activeFeatureFlagsWithBoolean }}>
<Story />
</ValidationsFeatureFlagsContext.Provider>
);
};

export default FeatureFlagsDecorator;
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import { AddonConfig, ElementsType } from '../../typings/storybookAddonMultiple';
import { validationsFeatureFlagsDefault } from '../../src';

const featureFlags = Object.keys(validationsFeatureFlagsDefault).map((featureFlag) => ({
value: featureFlag,
title: featureFlag,
}));

const createFeatureFlagsElements = (): ElementsType => {
const elements: ElementsType = [
{
type: 'userDefinedSelect',
allowEmpty: true,
queryKey: 'activeFeatureFlags',
options: featureFlags,
},
{
type: 'singleSelect',
queryKey: 'emptyFeatureFlags',
options: [
{
value: 'Фиче-флаги не созданы',
title: 'Фиче-флаги не созданы',
},
],
},
{ type: 'reset' },
];

return elements.filter((el) =>
featureFlags.length === 0
? 'queryKey' in el && el.queryKey === 'emptyFeatureFlags'
: !('queryKey' in el && el.queryKey === 'emptyFeatureFlags'),
);
};

export const featureFlagsConfig: AddonConfig = {
featureFlags: {
icon: 'flag',
viewMode: 'docs',
elements: createFeatureFlagsElements(),
},
};
24 changes: 22 additions & 2 deletions packages/react-ui-validations/.storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,34 @@
import type { StorybookConfig } from '@storybook/react-webpack5';

const isDocsEnv = Boolean(process.env.STORYBOOK_REACT_UI_VALIDATIONS_DOCS);

const config: StorybookConfig = {
stories: ['../stories/**/*.stories.tsx'],
addons: ['creevey'],
stories: ['../stories/**/*.stories.tsx', '../stories/**/*.mdx'],
docs: {
docsMode: isDocsEnv,
},
addons: [
'creevey',
'storybook-addon-multiselect',
'@storybook/blocks',
'@storybook/addon-docs',
{
name: '@storybook/addon-essentials',
options: {
docsMode: true,
},
},
],
framework: {
name: '@storybook/react-webpack5',
options: {
fastRefresh: true,
strictMode: true,
},
},
core: {
disableWhatsNewNotifications: true,
},
};

export default config;
11 changes: 11 additions & 0 deletions packages/react-ui-validations/.storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import { findAmongParents } from '@skbkontur/react-sorge/lib';
import { withCreevey } from 'creevey/addon';
import React from 'react';

import { featureFlagsConfig } from './featureFlagsConfig/featureFlagsConfig';
import FeatureFlagsDecorator from './decorators/Features/FeatureFlagsDecorator';

setFilter((fiber) => {
// Транслируем все пропы только для контролов
const isControlComponent = !!findAmongParents(
Expand All @@ -22,11 +25,19 @@ export const decorators = [
<Story />
</div>
),
FeatureFlagsDecorator,
withCreevey(),
];

export const parameters = {
creevey: {
captureElement: '#test-element',
},
options: {
storySort: {
method: 'alphabetical',
order: ['FeatureFlags validations'],
},
},
multiselect: featureFlagsConfig,
};
4 changes: 4 additions & 0 deletions packages/react-ui-validations/.storybook/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ module.exports = async ({ config }) => {

config.entry.unshift('core-js/stable');

// storybook's rule for css doesn't handle .mdx
const filteredStorybooksWebpackRules = (config.module.rules || []).filter((r) => r.test && r.test.test('.mdx'));

config.module.rules = [
...filteredStorybooksWebpackRules,
{
test: /\.(ts|tsx)$/,
exclude: /node_modules/,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
Для этого в таком контроле/обёртке необходимо обеспечить следующие пропы:

1. `ref` - DOM элемент нужен для правильной авто-прокрутки страницы до элемента с ошибкой ([подробнее](#/scroll-to-validation)).
1. `error` - сеттит true, для соответствующего уровня валидации.
1. `warning` - сеттит true, для соответствующего уровня валидации.
1. `onBlur` - обеспечивает работу зависимых валидаций ([подробнее](#/dependent-validation)).
1. `onChange` - отслеживается начало процесса ввода данных.
2. `error` - сеттит true, для соответствующего уровня валидации.
3. `warning` - сеттит true, для соответствующего уровня валидации.
4. `onBlur` - обеспечивает работу зависимых валидаций ([подробнее](#/dependent-validation)).
5. `onChange` - отслеживается начало процесса ввода данных.

В типах их можно представить так:

Expand All @@ -20,8 +20,8 @@
onChange?: React.ChangeEventHandler<Elem>;
}

Для контролов `react-ui` также прокидывается проп `onValueChange`. Чтобы избежать предупреждения в консоле (`Unknown event handler property 'onValueChange'`), этот проп можно "вырезать" из пропов (см. пример).
Для контролов `react-ui` также прокидывается проп `onValueChange`. Чтобы избежать предупреждения в консоле (`Unknown event handler property 'onValueChange'`), этот проп можно "вырезать" из пропов (см. пример).

### Пример

!!DemoWithCode!!./CustomControls
4 changes: 4 additions & 0 deletions packages/react-ui-validations/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"deploy:docs": "gh-pages -a -d dist -r [email protected]:skbkontur/react-ui-validations.git",
"storybook": "node ../../scripts/patch-node-options.js \"cross-env STORYBOOK_REACT_UI_TEST=true storybook dev -p 6060\"",
"storybook:build": "node ../../scripts/patch-node-options.js \"cross-env STORYBOOK_REACT_UI_TEST=true storybook build -o .storybook/build --quiet\"",
"storybook:docs": "node ../../scripts/patch-node-options.js \"cross-env STORYBOOK_REACT_UI_VALIDATIONS_DOCS=false storybook dev --docs -p 6061\"",
"storybook:serve": "serve -l 6060 .storybook/build",
"start:docs": "node ../../scripts/patch-node-options.js \"webpack-dev-server --config webpack.docs.config.js --hot \"",
"lint": "npm-run-all --continue-on-error --parallel lint:*",
Expand Down Expand Up @@ -71,6 +72,8 @@
"@skbkontur/react-props2attrs": "0.1.3",
"@skbkontur/react-sorge": "0.2.1",
"@storybook/addon-docs": "7.6.18",
"@storybook/blocks": "7.6.18",
"@storybook/components": "7.6.18",
"@storybook/react": "7.6.18",
"@storybook/react-webpack5": "7.6.18",
"@testing-library/jest-dom": "6.4.5",
Expand Down Expand Up @@ -116,6 +119,7 @@
"serve": "^13.0.2",
"shelljs": "^0.8.3",
"storybook": "7.6.18",
"storybook-addon-multiselect": "^2.0.1",
"string-replace-loader": "^3.1.0",
"style-loader": "^4.0.0",
"styled-components": "^6.1.11",
Expand Down
9 changes: 9 additions & 0 deletions packages/react-ui-validations/stories/docs/FeatureFlags.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { Meta } from '@storybook/blocks';

<Meta title="FeatureFlags validations" />

# Feature flags validations

Включение и отключение отдельных фич через ValidationsFeatureFlagsContext

## Нет доступных фиче-флагов
55 changes: 55 additions & 0 deletions packages/react-ui-validations/typings/storybookAddonMultiple.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
// нужно для типизации конфига при использовании аддона storybook-addon-multiselect, при импорте библиотеки появляется ошибка ts.
import { ReactNode } from 'react';
import { API } from '@storybook/manager-api';

export type AddonConfig = AddonDisabled | Addon;

export type AddonDisabled = {
disable: boolean;
};

export type Addon = { [key: string]: AddonEntry };

export type ElementsType = Array<Reset | SingleSelect | MultiSelect>;

export type AddonEntry = {
name?: string;
description?: string;
icon?: ReactNode;
elements: ElementsType;
viewMode?: 'story' | 'docs' | 'both';
};

export type Reset = {
type: 'reset';
};

export type SelectSharedProps = {
title?: string;
allowEmpty?: boolean;
queryKey: string;
localStorageKey?: string;
};

export type SingleSelectOnChange = (value: string | undefined, storybookApi: API) => string | undefined;
export type SingleSelect = SelectSharedProps & {
type: 'singleSelect';
options: Option[];
defaultValue?: string;
onChange?: string | SingleSelectOnChange;
};

export type MultiSelectOnChange = (value: string[], storybookApi: API) => string[];
export type MultiSelect = SelectSharedProps & {
type: 'multiSelect' | 'userDefinedSelect';
options: Option[];
defaultValues?: string[];
onChange?: string | MultiSelectOnChange;
};

export type Option = {
value: string;
title: ReactNode;
right?: ReactNode;
icon?: ReactNode;
};
5 changes: 5 additions & 0 deletions packages/react-ui/.babelrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const isDocsEnv = Boolean(process.env.STORYBOOK_REACT_UI_DOCS);

module.exports = {
assumptions: {
setPublicClassFields: true,
Expand All @@ -12,5 +14,8 @@ module.exports = {
plugins: [
['@babel/plugin-transform-runtime', { useESModules: true, version: '7.16.5' }],
['@babel/plugin-proposal-decorators', { legacy: true }],
...(isDocsEnv
? [['transform-react-remove-prop-types', { mode: 'remove', ignoreFilenames: ['node_modules'] }]]
: []),
],
};
2 changes: 1 addition & 1 deletion packages/react-ui/.creevey/config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
const path = require('path');

const axios = require('axios');
const { hybridStoriesProvider } = require('creevey');

require('dotenv').config({ path: '../../.env' });
const { hybridStoriesProvider } = require('creevey');

/**
* Debuggin instructions: https://wiki.skbkontur.ru/pages/viewpage.action?pageId=418699157
Expand Down
3 changes: 3 additions & 0 deletions packages/react-ui/.creevey/images/Checkbox/Default/chrome.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading