From 0f3152ca6de5b133a9659ff015eb47318c8efeb2 Mon Sep 17 00:00:00 2001 From: Rim Zabarov Date: Sun, 15 Nov 2026 14:39:57 +0300 Subject: [PATCH 01/75] English interface strings: seven viewer keys, orphan dropped, all 85 accepted (LG-13) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The English header read Russian: publish-current publishes only accepted lang strings, and 78 of them were unverified, so every one fell back to the Russian source (Язык, Открыть настройки чтения, Главное). The seven example-viewer keys were missing and examples.fullscreen was an orphan of the Russian file. Each English string was read against its Russian source and accepted as ai_verified through a hash-bound plan (5f62b953). Co-Authored-By: Claude Opus 5.5 --- content/en/lang.json | 6 +- translations.lock.json | 1020 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 1024 insertions(+), 2 deletions(-) diff --git a/content/en/lang.json b/content/en/lang.json index 2ea6599cd..af00a66f0 100644 --- a/content/en/lang.json +++ b/content/en/lang.json @@ -45,8 +45,10 @@ "wrap": "Wrap long lines", "unwrap": "Keep original line layout" }, "examples": { - "fullscreen": "Open example fullscreen", - "fullscreen_exit": "Exit fullscreen" + "fullscreen_exit": "Exit fullscreen", + "viewer": "Check responsiveness", "viewer_exit": "Exit viewer", + "viewer_dialog": "Responsive example viewer", "viewport_group": "Example width", + "viewport_desktop": "Desktop", "viewport_tablet": "Tablet", "viewport_mobile": "Phone" }, "common": {"continue": "Continue", "greeting": "Hello, {name}!"} } diff --git a/translations.lock.json b/translations.lock.json index f25c9d8a5..c08928bf9 100644 --- a/translations.lock.json +++ b/translations.lock.json @@ -1,5 +1,53 @@ { "entries": [ + { + "key": "code.copied", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/code/copied", + "source_sha256": "d2d08c715ee66cbdc425b3af67b87f2f3c9fbe845a8a2b3414e8b737af54484b", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/code/copied", + "target_sha256": "8d525e5f158b9afe05f3122af363ac67763bdc4e1395b46597b320c289766ce3", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "code.copy", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/code/copy", + "source_sha256": "f02956c16588a7186fd04ebe0496d889f5eadfd2c3ee07387f445b61acd98df6", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/code/copy", + "target_sha256": "e21f935f11d7e966dbbae78da9daa378fe8142a14e7c0cd7434183005faa6c5c", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "code.unwrap", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/code/unwrap", + "source_sha256": "4ad707899aeecea9421854f6e4beb5bb44af007d918bb51cf2c7edb44fc62a53", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/code/unwrap", + "target_sha256": "97b3df44168b00fb4436d620f2978fe71fcde009b14c18dbd410be85547f00fa", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "code.wrap", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/code/wrap", + "source_sha256": "d775dff1fb8f98a5b06958de3aac66d609f73dbe917a1ec4a646c626a554ab65", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/code/wrap", + "target_sha256": "59f3fdfea75e1912a85c39e6a043953a0fbb47b54d3524b2cd4cf4d88ca5214f", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, { "key": "common.continue", "kind": "lang", @@ -24,6 +72,978 @@ "target_sha256": "48e1645a3bf4c08fc0e1819c5ba4813f9fb385f957556196a6aedb88721e2266", "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" }, + { + "key": "examples.fullscreen_exit", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/examples/fullscreen_exit", + "source_sha256": "cc2057c744b27c51e5f21d22feaa9cb468c1647650a8e694ff28efd179bd90f3", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/examples/fullscreen_exit", + "target_sha256": "37fd4e355ba33fd221d96b521f19c383896d2deb4e2c85fb9bc9a889c1f5caa5", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "examples.viewer", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/examples/viewer", + "source_sha256": "e45d4b72923ef7f5b8a55d2ea2e35f5b7bcae1cc75db477c6576d7679c31a836", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/examples/viewer", + "target_sha256": "233854b7f48391c039dfc479dd8740c5d888ae576623b62816d0efc120967849", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "examples.viewer_dialog", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/examples/viewer_dialog", + "source_sha256": "8224f82720f6d4f8b95d6605876c14235db51c934c570ca306f2e65f58f7e656", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/examples/viewer_dialog", + "target_sha256": "9895c7ea6408dfab0d252012ecf9deb5f88962a3da3b3a03b9fb0f58f37db339", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "examples.viewer_exit", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/examples/viewer_exit", + "source_sha256": "2209131e0152e9d39916d3f473e44ee556bfceb775f7199d509c5e83a1948df3", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/examples/viewer_exit", + "target_sha256": "0d7e366bbb29c977f6d4cf0c91ae2e55da222c1acb8d587436a286e5f2d7eae3", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "examples.viewport_desktop", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/examples/viewport_desktop", + "source_sha256": "0ca57e209f5664eba7a169cab71e5a669c5435912e06b3c5b24f9ddc4aa558f2", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/examples/viewport_desktop", + "target_sha256": "9bd88f2485acbb9426ad3dd9e06842ede8c7516d0ba8559298675f09419681fa", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "examples.viewport_group", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/examples/viewport_group", + "source_sha256": "68fb7d9685ef721722a25b2dc05e92e3cd6abd8c4b5ccdfc9113496631a01e84", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/examples/viewport_group", + "target_sha256": "c8908a7f3ccb6148179fcf9e85e814731f2e61cc5be9e60ce408723878b8f9b1", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "examples.viewport_mobile", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/examples/viewport_mobile", + "source_sha256": "822f9fd9ba2d117e7a4c1dd10c410eab7a3a5cc0417cd149633649cc5fb23c1b", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/examples/viewport_mobile", + "target_sha256": "63dceb8800b2dd4af9567a1f54f03b7c3dbdc27fac4799091ebfcc4928899ee5", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "examples.viewport_tablet", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/examples/viewport_tablet", + "source_sha256": "87ec3a36e9c9a4a53a3aecba0c84e1a686225f4bb59da8efca390a907a1ae9a9", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/examples/viewport_tablet", + "target_sha256": "e34a879c8b8b67effd9e14878e1443829419cf2aba09a03252d2a4f137e49941", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "language.label", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/language/label", + "source_sha256": "5bd57038dbadd6517fcaab9deb791efdc1c05a17fccdb975be51452a6c5326b2", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/language/label", + "target_sha256": "a4fe65264ef7dbb38d104b1e81eb3350f3142f3d16f32bdec39b1d9b42c1b8d1", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "navigation.backlinks_empty", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/navigation/backlinks_empty", + "source_sha256": "b6e8f0aa77df59d69fa44cc685fb52fa6b7fcf44677e4cf85508000c90b0fd1e", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/navigation/backlinks_empty", + "target_sha256": "f6f72c5831ce3e2695a6933fdfc0b3928b4a15a0186085f98869d359e7cf34d8", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "navigation.backlinks_heading", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/navigation/backlinks_heading", + "source_sha256": "b13242be3810c8b01a38fcf261222bc38ed5fe0abeaaa324154099fa544290d1", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/navigation/backlinks_heading", + "target_sha256": "04cf23a495f3a2e18170d90475b1641e585bdcbd31baa077f909a0ce64959495", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "navigation.breadcrumbs", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/navigation/breadcrumbs", + "source_sha256": "b84b8a3662e23b36c69bfaa08f3aacdf38a97bab490811fd02d40e60a0911da7", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/navigation/breadcrumbs", + "target_sha256": "73667278486b9c9d3958f9449418af7d1caac4e1db5a70209b6d0bad7d9e301e", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "navigation.breadcrumbs_expand", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/navigation/breadcrumbs_expand", + "source_sha256": "4852c902bcee1bfbf3c072f43d64b544787a3755b1aa6f988a30c67701823979", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/navigation/breadcrumbs_expand", + "target_sha256": "9da5272fd699250ddbee2c531dfc628545957712c61f33f5e126f6cb63bba630", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "navigation.close", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/navigation/close", + "source_sha256": "97778b9d9e31b4af0b5f7b05376dcc1c631ea86d34842f06e1a5c97e5e3e843f", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/navigation/close", + "target_sha256": "99904db30de4a2a32ee6672a99e77e79c482d4e188860695723d3dd306749879", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "navigation.collapse", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/navigation/collapse", + "source_sha256": "c25d7f2b3c76d009f7d4c3179fbb20fbdabf220156cdef121fc8cfd666778113", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/navigation/collapse", + "target_sha256": "208bdfb6a3c2503439cd01a4c1398499ede4d628a03b6615ece64afe6ec724dd", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "navigation.contains_current", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/navigation/contains_current", + "source_sha256": "8841d6e56c939a08a25d0115aa479464dfed3ad808a0604f1167d1b33cc7fa82", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/navigation/contains_current", + "target_sha256": "a718df0bffc591c5e5ca3ad7d3c1bc93f05b7b5426be1b28d0ee7768a512a845", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "navigation.expand", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/navigation/expand", + "source_sha256": "58ece00c879e876d31cd69d6d847efd18baf33fbcdc35208d79de093ed17c960", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/navigation/expand", + "target_sha256": "67d28844e2de33c6eac8e66848fa19ec9f138deed1b0a2c45bb7004f1b6f95e2", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "navigation.mobile_title", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/navigation/mobile_title", + "source_sha256": "e638fc3afbee1219bd4b5e8bb6619cc0c7631563dba029ea4c54ce0270c9f589", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/navigation/mobile_title", + "target_sha256": "3db65f8c2a7d1861b4bca37da3adec5aa7905931eb6faddbc595a35f75e6ca40", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "navigation.next", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/navigation/next", + "source_sha256": "08c05789f573ba9f2c4bf66515698142a2ccc31a4df618ff83ea7e03a4fe3727", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/navigation/next", + "target_sha256": "1ff57a29d7c9d11bdf61c1b80f2b289b44c1ea844824d4b94a0d52b6ba5fc858", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "navigation.open", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/navigation/open", + "source_sha256": "f6d98cbb2d97318145b109017237c804d4d0c27c7f22220d7c5fc6e731e97fcc", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/navigation/open", + "target_sha256": "0ed77fd2619ba8ab3e1cce72c8e61d887d551ca1220164b88ab1aa66bba7177d", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "navigation.outline", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/navigation/outline", + "source_sha256": "15efcfe5319fcc99fc415fc8e1050b2429be75bf28e35e90a6e5412fc52e713f", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/navigation/outline", + "target_sha256": "437aea62a5bd6ad4762e494c81b88532809a231477c82bdecf6fd6636908b7ab", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "navigation.outline_close", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/navigation/outline_close", + "source_sha256": "1d217b8d611588e13e440bc08a7e749ed85f5865923076c51065a1ec727edd05", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/navigation/outline_close", + "target_sha256": "fb401746fba1e8d53ad2b135e7d50d340defc6c1fa61652d75a1cd46b38ae73e", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "navigation.previous", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/navigation/previous", + "source_sha256": "1ff33e572cc8cf416ebccd41e143d74cd886bb203285ae593dc4b3d0fbf1e75c", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/navigation/previous", + "target_sha256": "a57b08a480b822a0a572b993391c292ede593bf8000b406675b180bbb16260fa", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "navigation.previous_next", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/navigation/previous_next", + "source_sha256": "0f891a202091ef5b208d015f61ec87901635794c8103aff0d8290e5cd0c65187", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/navigation/previous_next", + "target_sha256": "024148d6099b7d63a971f0907735592389e9b1eb1858f9ce593a83cfa4f071ab", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "navigation.primary", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/navigation/primary", + "source_sha256": "b757623f24f402f68977512b085a2b1d00f5d0932f702ccc1be34d3a87a32123", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/navigation/primary", + "target_sha256": "efe10c80ec8a9f38624cbb47103010a8cf32488a503e4b4bfe4f92307a9cefa7", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "navigation.sections", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/navigation/sections", + "source_sha256": "b123be6f8236801a70650fcaf5218da12b896992d2e963bf27f5cd0488299a50", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/navigation/sections", + "target_sha256": "c205924de0fe636ccdde4ed616fef66f75b78e98b03620637965c033fd161141", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "navigation.title", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/navigation/title", + "source_sha256": "682554aad26a4b9f31c542eebc7889280b740a91cfc19e634cdfdc559847a5a3", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/navigation/title", + "target_sha256": "9bae918add9affa51189bde5fefc7390ee2866831e894bb5f72b472a79d4ade8", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "reader.appearance", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/reader/appearance", + "source_sha256": "1731619efa3a66aa6bb21c14c275f1f612828ec36f8331c61951c8b0bed64ca9", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/reader/appearance", + "target_sha256": "3907fa7f80722a6fc58cd8c1bd30abf7638095d6774f183b6e831b7093957d1b", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "reader.appearance_description", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/reader/appearance_description", + "source_sha256": "5f79333a1e1fa074cd0527ec99d6f5c65110a1a541c1e8c7792fcbe5bf14bdb7", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/reader/appearance_description", + "target_sha256": "edfd1a146707084d58932687c2e8ecb8b3613e9694219480bb623951647469e0", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "reader.applied_not_saved", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/reader/applied_not_saved", + "source_sha256": "1a5f7a5fd2b9bf7fe5c45873aa14c2391d2816d44fb46dbd560cfd0f2b055026", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/reader/applied_not_saved", + "target_sha256": "3a4e98b9ebb334dc93e8b01abd84af1eb401fcef4b91c288827cfdc788034d21", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "reader.close", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/reader/close", + "source_sha256": "e2ed8a05d685889d7a64b592a472a1f2b5a6dcbccd73b30cf5e8e041e5261249", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/reader/close", + "target_sha256": "1f7830b542ec8d1efce066c5f6051b7f921fb4c9497201dc91ce48f344de49cf", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "reader.help", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/reader/help", + "source_sha256": "5f79333a1e1fa074cd0527ec99d6f5c65110a1a541c1e8c7792fcbe5bf14bdb7", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/reader/help", + "target_sha256": "edfd1a146707084d58932687c2e8ecb8b3613e9694219480bb623951647469e0", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "reader.modal_blur_description", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/reader/modal_blur_description", + "source_sha256": "de3a898eb0465d4a5fcb31fc792d829e1298b6711822fc8d1febe2a82e39d126", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/reader/modal_blur_description", + "target_sha256": "5fb329c18943f3d5cc377a47b8d6b727feb54f4a9d8840351b66cc2a73485edd", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "reader.modal_blur_large", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/reader/modal_blur_large", + "source_sha256": "bc622d6b13a3abef8868aea257f5419b54af3b71ff87af9a2e0b195aa80751d0", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/reader/modal_blur_large", + "target_sha256": "66c9ab177708cbc6b9770301ef0caa3f4fdcab0e3741a7f555b025a5d7dac2eb", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "reader.modal_blur_large_description", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/reader/modal_blur_large_description", + "source_sha256": "d817a569042e0a0332db1f8ce01799659ed5a1dab71a87eef61b76aab56fdb97", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/reader/modal_blur_large_description", + "target_sha256": "643274b62dc3d6807bf2ca4944e22aede9e58c0402450d6ed7739ca9f6818ff7", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "reader.modal_blur_medium", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/reader/modal_blur_medium", + "source_sha256": "cca5c7ff9e17fbd1384e4b2a660061f4320b8df32206f568ab9e4321e567cee6", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/reader/modal_blur_medium", + "target_sha256": "8e588cd187741f1cd76f5fab77b7208782a8c21d764ce7d7a4cf3ac4e0968873", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "reader.modal_blur_medium_description", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/reader/modal_blur_medium_description", + "source_sha256": "1ec98dec92469929587371c040a68d5131bdd4b9543b526d0a0b19eb521c8346", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/reader/modal_blur_medium_description", + "target_sha256": "08d15fd8809e80eef4b4c84b72f08e058d23e16f56de7a24dcb99a7104366e14", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "reader.modal_blur_none", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/reader/modal_blur_none", + "source_sha256": "3c21ac303e6a371c3028caef34c191babc2a6de14f8b7147e3db465dfecd2113", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/reader/modal_blur_none", + "target_sha256": "7d7b6876867ccecc154677c56dd03d417714a20570308f1e861c91fa0c37186b", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "reader.modal_blur_none_description", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/reader/modal_blur_none_description", + "source_sha256": "3a168e0db32adf57f964f5c1ade3f0b213a6c845e30b95c2d7124d7bf97c5aaf", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/reader/modal_blur_none_description", + "target_sha256": "09ec14cef175e8723b8949017d86668a9f7be902dcb05e1f806161e64a4220df", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "reader.modal_blur_small", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/reader/modal_blur_small", + "source_sha256": "c83d5c30b816847b02aa03267e30ff339a69fba124e4b68dfd56b276ae09646f", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/reader/modal_blur_small", + "target_sha256": "5263293fc202649bdc8135573ac9cd3b0bcea4355e0d8f0a59f1ddeea8eefc15", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "reader.modal_blur_small_description", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/reader/modal_blur_small_description", + "source_sha256": "3c8fe2d4d3a7d2ab001cd5b94c02de5d5b1648eda7da87a7e6f1847bbb29dab7", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/reader/modal_blur_small_description", + "target_sha256": "25fdc63bf7697bd79b48bba8fb6284344b694b2e95200e0a0deafdfcc7191291", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "reader.modal_blur_title", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/reader/modal_blur_title", + "source_sha256": "0d7a7f521555c3f1df59fe0bd929f192d1c14c02a815c7a957267bcd56bf7103", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/reader/modal_blur_title", + "target_sha256": "fa5fd5aa2ccf03ff7a9c5fff9cc2f66da0cb84a439d7a658559667305300d5ff", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "reader.open", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/reader/open", + "source_sha256": "d1a1c039ae4e39865adfd020b8112e1197adbd7647c293701414d8da8016e909", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/reader/open", + "target_sha256": "c81bd36294f8e3149a4f94899a60edfe417cbc4bd0d35a9278ebaa7173eec9fc", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "reader.reset", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/reader/reset", + "source_sha256": "ac879721ea38d1ea5071457beaed35348c7639c37b0ae6946604bb8fd2dafc37", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/reader/reset", + "target_sha256": "97ad6a87360b2b91dc4cde313c01f6fc014f7c0cfbeeeeb4c31755c40904fe53", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "reader.restored", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/reader/restored", + "source_sha256": "c5271f955310bd9c33c396a8c4dffe2b423293e77a45bff6bd1b1e8080d89834", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/reader/restored", + "target_sha256": "0694fcf8eccd825c57334c364ef54f8e3dc42586bde2eb5f90123225f9d4072e", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "reader.saved", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/reader/saved", + "source_sha256": "7f0b5897fc6e91099456c1f9ad578275e71ea25b2301af2b7aee848c676b396c", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/reader/saved", + "target_sha256": "f7935d6de008c715bb04d05011f4db59404aff34d85a6efcfea3f5e93ad12e80", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "reader.theme_dark", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/reader/theme_dark", + "source_sha256": "1eecfcaa7bdb1269175440b36a706d202324b7de1221ca6c3b7839dbcce76287", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/reader/theme_dark", + "target_sha256": "60acc53f13a5d1bf115878c4a785e9a43e8286c4139a8402a6ac7d23966f9153", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "reader.theme_dark_description", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/reader/theme_dark_description", + "source_sha256": "2ddf963612e9eec308667f3f582b95c64616c68aeef736ac9d18c9d4733db430", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/reader/theme_dark_description", + "target_sha256": "4a6ead7c666d7656ca38802b5fe23e368c13aecf9b89048e319791f169317668", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "reader.theme_description", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/reader/theme_description", + "source_sha256": "3fd386ef4dc5f64da34d9653ba552e413bbc2fc6bfe1807b61e5a194716df77b", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/reader/theme_description", + "target_sha256": "43bc04814dc6e2b0b689a244904c73d591090f6e89881d031668f7adfabcb7b9", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "reader.theme_light", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/reader/theme_light", + "source_sha256": "f0cd3a6033724d440a2ff1059d729da14367d1d985508fdf017bdf44f569b2f2", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/reader/theme_light", + "target_sha256": "dbcd5e7bb7a0f538810de44c3efbd813037ee3fa358747bb71fa58e157af45f7", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "reader.theme_light_description", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/reader/theme_light_description", + "source_sha256": "d37572c3e4ad6d68865f6aa5c09472f295ee1e34c8e9b5d23bb30ef5afc7ec03", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/reader/theme_light_description", + "target_sha256": "4b925bfbb601a4a1e8e09dd65eb2f3ff8c6074ebae441816f3868d064a3f0906", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "reader.theme_system", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/reader/theme_system", + "source_sha256": "29e4a4bd7a1756c4a4f33bc3dba78b0e756c1623e8ec263002ed10a658db1768", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/reader/theme_system", + "target_sha256": "0a5ddcc967f0258bd7d077e5cc6a3f311d62713c148d40e908077b1e0def434e", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "reader.theme_system_description", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/reader/theme_system_description", + "source_sha256": "4d76bcc3661ec2ec26943b65823bf78179f5bd074adc0f800c3384e412261630", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/reader/theme_system_description", + "target_sha256": "a47e5e71c4a63be0b241a124fe91dc14fcc54dba0123b7dc095b437cac574f29", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "reader.theme_title", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/reader/theme_title", + "source_sha256": "682f961a0751cc04c3404f37a6a66ea81fdaa1aa85ce239c443997d53cded6ba", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/reader/theme_title", + "target_sha256": "efb52e7172b77731d996ff4f51cd7b3dcfd55fc6f07392994619418d58d170dd", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "reader.title", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/reader/title", + "source_sha256": "694b865d27a5d0d0509fcb1d8a34fbf4e2c25fc195845233297a55e6864912eb", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/reader/title", + "target_sha256": "8bbdec5fe9ebaef12b438213d4fff241de0be65660e8230f9ced1eb90fab07b0", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "reader.ui_radius_default", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/reader/ui_radius_default", + "source_sha256": "c2727bb73bed812b5172f5b554d1347d353389746f5a463ddf9c29e8b6b7c679", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/reader/ui_radius_default", + "target_sha256": "21b111cbfe6e8fca2d181c43f53ad548b22e38aca955b9824706a504b0a07a2d", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "reader.ui_radius_default_description", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/reader/ui_radius_default_description", + "source_sha256": "e688ad4dfcf08c3ad5dd349d79fb2086548176d44f2e80346dc869312413a0ff", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/reader/ui_radius_default_description", + "target_sha256": "21d59e5c9d2bbf91bc263091c85542f5f226c29111f4b74926e375ff94d43ec9", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "reader.ui_radius_description", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/reader/ui_radius_description", + "source_sha256": "c8b8458ce0092092d0da67b9a8eef60b62bef0431929d5fd8afb4a5004094ef0", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/reader/ui_radius_description", + "target_sha256": "2c4423d03e1626d0ca99b1bcc1f7196888ad988bf4206e40b3846c7ed5cb5f1f", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "reader.ui_radius_large", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/reader/ui_radius_large", + "source_sha256": "36e06ff65aa85278357665d7679b2d1842ffd566ced9ae960d2aca1c7597008d", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/reader/ui_radius_large", + "target_sha256": "ab80540d98d274565e355f59f0683df6fb23ff86f735a6f8da60020d3ce05d7b", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "reader.ui_radius_large_description", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/reader/ui_radius_large_description", + "source_sha256": "18fc64b436c7abda915c6222bb249cf010048451a975ff1dbd6d24fc8966fe9f", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/reader/ui_radius_large_description", + "target_sha256": "3f7b1d4be9a00713f64b3c84a0725f7b7db868912b442a25babc63d15b20af50", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "reader.ui_radius_medium", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/reader/ui_radius_medium", + "source_sha256": "cca5c7ff9e17fbd1384e4b2a660061f4320b8df32206f568ab9e4321e567cee6", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/reader/ui_radius_medium", + "target_sha256": "8e588cd187741f1cd76f5fab77b7208782a8c21d764ce7d7a4cf3ac4e0968873", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "reader.ui_radius_medium_description", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/reader/ui_radius_medium_description", + "source_sha256": "9ad753c909cf59d3b99be499fff2de9fc1c3bada281c3b94a49ef3730c994de8", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/reader/ui_radius_medium_description", + "target_sha256": "26bd7f252cb1f9c7a5b263d7bf49c3f98f9004730af4a9397322583d079d84a2", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "reader.ui_radius_title", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/reader/ui_radius_title", + "source_sha256": "e3470161f8c522a433f7eac9a64084ca67d5f4e00c9206a7afb59437a487dafc", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/reader/ui_radius_title", + "target_sha256": "dea1479a5e6b58e09b682b9c5a437871dada05ad9e6cb0c235400134cd31d231", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "redirect.link", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/redirect/link", + "source_sha256": "6e169324acbd229fd6f698abb2485f56d0523b776e85946cede1302bfa26358d", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/redirect/link", + "target_sha256": "f4f8027facc7ac70f746d7aa007508f85e44f1e045431cf5359c173f6b6712ee", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "redirect.message", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/redirect/message", + "source_sha256": "6f89ebaf516f4f08f01cd6f1e8b2016df5fa87fa77c0bdf26665204ddf458118", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/redirect/message", + "target_sha256": "d6074ce78c57a1a3e26dd9a0c440ac3d4ffb20eb4b2ee948e6395e5f80085847", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "redirect.title", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/redirect/title", + "source_sha256": "ecb5224a2bd3952c933739501c3791665fcf6279e16701947ea8b3d611eb02a4", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/redirect/title", + "target_sha256": "ce1e56fe592031db7b099de5d61768727bc5c90e795280a49207c2edc8b601b0", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "search.close", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/search/close", + "source_sha256": "28b28dba9eb1f1e1d2f7c2f64ded3970629f8eaa3951bca56925b2889e8cba2c", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/search/close", + "target_sha256": "55656b5e434f4c069877f0c12174a14e67ef9619d30e796834b1216a03d9f677", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "search.dismiss", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/search/dismiss", + "source_sha256": "f7838dbabbd5b03ecc5609101a54336c2c9e48d61544d41ced1fc5d2adb822e6", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/search/dismiss", + "target_sha256": "310ff200149b44a32f124023d7caba19a1a890763a980606813d3a3d4a085d36", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "search.empty", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/search/empty", + "source_sha256": "480fae1c4bc97f4b7ad22f8266f5a5e0aebe98824c5de52abc9cd577c291468b", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/search/empty", + "target_sha256": "7d7e360586090927c7aeee67c8a46d8354694e7aa4b722ff5b421347f798057a", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "search.error", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/search/error", + "source_sha256": "4108423d185b1026467c03342d40946c6a1844901eedacb389af5ebbf1ba00c7", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/search/error", + "target_sha256": "be2e37a441ada3e0932ddcff619934d153ad4d6ed4cd70d0b1a6ecdf6b350d5f", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "search.found", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/search/found", + "source_sha256": "4e9490430f53dae9ea6a209359db794b649fe2fa986d1eaa57e8653cf414ee63", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/search/found", + "target_sha256": "2d68c263b9819cef3d876fad34121f40c8d90968f6da2eeede8a276523c36c42", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "search.idle", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/search/idle", + "source_sha256": "5ad0bbc99232be3160d9d214d29d009ee154b74cfaeba30edddba2b0a0b568cc", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/search/idle", + "target_sha256": "373e69318142dcae073b0c27a3d34df387706b9ee7321cf63c593f2cdda091d0", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "search.label", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/search/label", + "source_sha256": "180f58ab975323f98064952d056a0fdf5ca7479de168c77b8c0799aaf011aa92", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/search/label", + "target_sha256": "49c266baaaa70981ea188fa714d5c40cf13830d786a861c9943ae0d26a7f3fe9", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "search.loading", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/search/loading", + "source_sha256": "5ba6cfe09a1d3e55766af2703cd18bcb71beb612c99fdaa9ff2a523b469f1610", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/search/loading", + "target_sha256": "d09007321623bd03ab9af437604422103c8412cc57b2caf2961cc067495d90cc", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "search.navigate", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/search/navigate", + "source_sha256": "e98b7d5e2b781c8e30790eff6386fbbbb4e99bf16dc33b1430d33651ae91520a", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/search/navigate", + "target_sha256": "d0cda6559bb347db706f6fa92a5b2491658e0c1e5bda98bb14e3c8a711b8fa33", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "search.open", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/search/open", + "source_sha256": "42a6594a87c92fcf8192ab60600b7ad4260f773bc507d84f5cf1c0a6c1e75374", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/search/open", + "target_sha256": "76a18503273f928135082c91a150057662961155cab3124cae7c190a6c58d6e6", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "search.open_result", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/search/open_result", + "source_sha256": "6b45f0159bcdf06ec99ee8d64c6306ecdd913ad0c813bb7da751adc02c5e278f", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/search/open_result", + "target_sha256": "2348f998744212575d85959674f9607ab26f67708a917157472832386337c904", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "search.placeholder", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/search/placeholder", + "source_sha256": "a4781fe09e3af0f86ea84ed579af86fb1568f0197eaa43a20b600d5a309e3695", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/search/placeholder", + "target_sha256": "30f458d177e7fe1b8fdc5226d9bfe5ce73e4d71f78e9804d244d55032ce1fe84", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "search.query", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/search/query", + "source_sha256": "e08bc1c8b18c165bc8b785bc6baad6dcbd8aa0872101df4c3c1cca3b3fee7a22", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/search/query", + "target_sha256": "b80a37564fbb3c0753202a1f92d5da8ccfb906b244f2842bba2232cea9883abd", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "search.title", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/search/title", + "source_sha256": "24496388840df4bbcf8ab9346c44883063d44384a10a66c27e934b6f480bb4cc", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/search/title", + "target_sha256": "ea582e69cce77d672df1926e1a0c2e99083a3964e6711512d064a7e17722fd1b", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, + { + "key": "shell.skip_to_content", + "kind": "lang", + "locale": "en", + "review": "ai_verified", + "source_path": "content/ru/lang.json#/shell/skip_to_content", + "source_sha256": "0f72b8346b4f7c82cb481c8511251c97248c5711928b3559a65b9b23a928678f", + "source_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687", + "target_path": "content/en/lang.json#/shell/skip_to_content", + "target_sha256": "ac576a66d4563e600314a2ce6e731725e9826fd88baf2399e05f60bfb177dbc0", + "target_structure_sha256": "44e194478eef1bdbd7567d0cf92c6aa09c6ff3a713a572f870a8c3e3e0263687" + }, { "key": "index.md", "kind": "page", From b04e4a2eb52f273626c0204b0aa10c7ab74ac39c Mon Sep 17 00:00:00 2001 From: Rim Zabarov Date: Sun, 15 Nov 2026 14:51:24 +0300 Subject: [PATCH 02/75] Recipes: eighteen pages from the C189 and C190 drafts, grouped by the job MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The page drafts of ui-control control/recipes/drafts (registry state page-draft) move into content/ru/recipes, each with its examples as folders under examples/recipes// (overview, variants, states, phone, density, do-dont). Scripts with a top-level await run inside an async function: Docara loads index.js as a classic script. Four density demos find their parts by data-demo, not by a class no sheet defines; the dark brand sample carries its own page and ink classes. Owner decisions applied on top of the drafts: - C200: on a phone the site header puts the language into the menu; the examples carry it in tools (hidden sm:inline-flex) and in actions (sm:hidden), the text and the AI copy say so. - C197, C198: checkout and report period say the calendar icon moves to the end of the field and that holiday dots and names are drawn only with holiday data; both are on the way, the pair keeps weekend. - C199: the system bar's «Ещё N» list stays under the bar, in the flow. The index lists all 27 recipes in the seven groups of C135 (progress first) and names the four mandatory parts; the navigation order follows the groups. Only parts of pair ui-994f9db407fa and package pro. Co-Authored-By: Claude Opus 5.5 --- content/ru/recipes/admin-frame.md | 154 +++++++++++++++ content/ru/recipes/admin-frame.page.json | 1 + content/ru/recipes/brand-theme.md | 144 ++++++++++++++ content/ru/recipes/brand-theme.page.json | 1 + content/ru/recipes/bulk-actions.md | 147 ++++++++++++++ content/ru/recipes/bulk-actions.page.json | 1 + content/ru/recipes/checkout.md | 150 +++++++++++++++ content/ru/recipes/checkout.page.json | 1 + content/ru/recipes/choice-cards.md | 161 ++++++++++++++++ content/ru/recipes/choice-cards.page.json | 1 + content/ru/recipes/copy.page.json | 2 +- content/ru/recipes/dashboard.page.json | 2 +- content/ru/recipes/delete.page.json | 2 +- content/ru/recipes/dialog-form.md | 179 +++++++++++++++++ content/ru/recipes/dialog-form.page.json | 1 + content/ru/recipes/empty-state.page.json | 2 +- content/ru/recipes/file-upload-progress.md | 140 ++++++++++++++ .../ru/recipes/file-upload-progress.page.json | 1 + content/ru/recipes/first-paint.md | 147 ++++++++++++++ content/ru/recipes/first-paint.page.json | 1 + content/ru/recipes/hero-and-promo.md | 170 ++++++++++++++++ content/ru/recipes/hero-and-promo.page.json | 1 + content/ru/recipes/index.md | 65 ++++++- content/ru/recipes/list-bottom.md | 153 +++++++++++++++ content/ru/recipes/list-bottom.page.json | 1 + content/ru/recipes/list-toolbar.md | 145 ++++++++++++++ content/ru/recipes/list-toolbar.page.json | 1 + content/ru/recipes/mail-chat-list.md | 147 ++++++++++++++ content/ru/recipes/mail-chat-list.page.json | 1 + content/ru/recipes/notifications.page.json | 2 +- content/ru/recipes/order-status.md | 147 ++++++++++++++ content/ru/recipes/order-status.page.json | 1 + content/ru/recipes/record-card.page.json | 2 +- content/ru/recipes/report-period.md | 173 +++++++++++++++++ content/ru/recipes/report-period.page.json | 1 + content/ru/recipes/resource-list.page.json | 2 +- content/ru/recipes/save-and-errors.md | 182 ++++++++++++++++++ content/ru/recipes/save-and-errors.page.json | 1 + content/ru/recipes/settings-form.page.json | 2 +- content/ru/recipes/site-header.md | 170 ++++++++++++++++ content/ru/recipes/site-header.page.json | 1 + content/ru/recipes/system-bar.md | 173 +++++++++++++++++ content/ru/recipes/system-bar.page.json | 1 + content/ru/recipes/which-message.md | 158 +++++++++++++++ content/ru/recipes/which-message.page.json | 1 + .../recipes/admin-frame/density/index.css | 4 + .../recipes/admin-frame/density/index.html | 10 + examples/recipes/admin-frame/density/index.js | 2 + .../recipes/admin-frame/do-dont/index.html | 10 + .../recipes/admin-frame/overview/index.css | 12 ++ .../recipes/admin-frame/overview/index.html | 22 +++ .../recipes/admin-frame/overview/index.js | 32 +++ examples/recipes/admin-frame/states/index.css | 4 + .../recipes/admin-frame/states/index.html | 38 ++++ examples/recipes/admin-frame/states/index.js | 6 + .../recipes/brand-theme/density/index.html | 13 ++ .../recipes/brand-theme/do-dont/index.html | 11 ++ .../recipes/brand-theme/overview/index.css | 7 + .../recipes/brand-theme/overview/index.html | 24 +++ .../recipes/brand-theme/overview/index.js | 25 +++ examples/recipes/brand-theme/states/index.css | 3 + .../recipes/brand-theme/states/index.html | 25 +++ .../recipes/bulk-actions/density/index.html | 26 +++ .../recipes/bulk-actions/overview/index.html | 24 +++ .../recipes/bulk-actions/overview/index.js | 65 +++++++ .../recipes/bulk-actions/phone/index.html | 10 + .../recipes/bulk-actions/states/index.html | 38 ++++ examples/recipes/checkout/density/index.html | 12 ++ examples/recipes/checkout/density/index.js | 10 + examples/recipes/checkout/overview/index.css | 1 + examples/recipes/checkout/overview/index.html | 44 +++++ examples/recipes/checkout/overview/index.js | 68 +++++++ examples/recipes/checkout/phone/index.html | 11 ++ examples/recipes/checkout/phone/index.js | 7 + examples/recipes/checkout/states/index.html | 29 +++ examples/recipes/checkout/states/index.js | 18 ++ .../recipes/choice-cards/density/index.html | 10 + .../recipes/choice-cards/do-dont/index.html | 10 + .../recipes/choice-cards/overview/index.html | 8 + .../recipes/choice-cards/overview/index.js | 21 ++ .../recipes/choice-cards/states/index.html | 18 ++ .../choice-cards/variants-2/index.html | 4 + .../recipes/choice-cards/variants-2/index.js | 29 +++ .../recipes/choice-cards/variants/index.html | 4 + .../recipes/choice-cards/variants/index.js | 8 + .../recipes/dialog-form/density/index.html | 16 ++ .../recipes/dialog-form/do-dont/index.html | 16 ++ .../recipes/dialog-form/overview/index.html | 37 ++++ .../recipes/dialog-form/overview/index.js | 48 +++++ examples/recipes/dialog-form/phone/index.css | 4 + examples/recipes/dialog-form/phone/index.html | 17 ++ examples/recipes/dialog-form/phone/index.js | 11 ++ .../recipes/dialog-form/states/index.html | 66 +++++++ .../file-upload-progress/density/index.html | 12 ++ .../file-upload-progress/density/index.js | 10 + .../file-upload-progress/overview/index.css | 7 + .../file-upload-progress/overview/index.html | 12 ++ .../file-upload-progress/overview/index.js | 85 ++++++++ .../file-upload-progress/phone/index.html | 4 + .../file-upload-progress/phone/index.js | 10 + .../file-upload-progress/states/index.html | 35 ++++ .../file-upload-progress/states/index.js | 18 ++ .../recipes/first-paint/density/index.html | 12 ++ .../recipes/first-paint/do-dont/index.html | 12 ++ .../recipes/first-paint/overview/index.css | 10 + .../recipes/first-paint/overview/index.html | 22 +++ .../recipes/first-paint/overview/index.js | 77 ++++++++ examples/recipes/first-paint/phone/index.html | 7 + .../recipes/first-paint/states/index.html | 34 ++++ examples/recipes/first-paint/states/index.js | 7 + .../recipes/hero-and-promo/density/index.css | 1 + .../recipes/hero-and-promo/density/index.html | 10 + .../recipes/hero-and-promo/do-dont/index.html | 10 + .../recipes/hero-and-promo/overview/index.css | 19 ++ .../hero-and-promo/overview/index.html | 21 ++ .../recipes/hero-and-promo/overview/index.js | 12 ++ .../recipes/hero-and-promo/states/index.css | 2 + .../recipes/hero-and-promo/states/index.html | 18 ++ .../hero-and-promo/variants-2/index.css | 6 + .../hero-and-promo/variants-2/index.html | 14 ++ .../hero-and-promo/variants-2/index.js | 3 + .../recipes/hero-and-promo/variants/index.css | 5 + .../hero-and-promo/variants/index.html | 7 + .../recipes/list-bottom/density/index.css | 3 + .../recipes/list-bottom/density/index.html | 10 + .../recipes/list-bottom/do-dont/index.html | 10 + .../recipes/list-bottom/overview/index.css | 9 + .../recipes/list-bottom/overview/index.html | 9 + .../recipes/list-bottom/overview/index.js | 43 +++++ examples/recipes/list-bottom/phone/index.css | 9 + examples/recipes/list-bottom/phone/index.html | 18 ++ examples/recipes/list-bottom/states/index.css | 4 + .../recipes/list-bottom/states/index.html | 28 +++ .../recipes/list-toolbar/density/index.html | 18 ++ .../recipes/list-toolbar/overview/index.html | 25 +++ .../recipes/list-toolbar/overview/index.js | 89 +++++++++ .../recipes/list-toolbar/phone/index.html | 10 + .../recipes/list-toolbar/states/index.html | 23 +++ examples/recipes/list-toolbar/states/index.js | 6 + .../recipes/mail-chat-list/density/index.css | 1 + .../recipes/mail-chat-list/density/index.html | 10 + .../recipes/mail-chat-list/density/index.js | 6 + .../recipes/mail-chat-list/do-dont/index.html | 10 + .../recipes/mail-chat-list/overview/index.css | 8 + .../mail-chat-list/overview/index.html | 7 + .../recipes/mail-chat-list/overview/index.js | 37 ++++ .../recipes/mail-chat-list/states/index.css | 1 + .../recipes/mail-chat-list/states/index.html | 18 ++ .../recipes/mail-chat-list/states/index.js | 11 ++ .../recipes/order-status/density/index.html | 12 ++ .../recipes/order-status/density/index.js | 11 ++ .../recipes/order-status/overview/index.html | 21 ++ .../recipes/order-status/overview/index.js | 39 ++++ .../recipes/order-status/phone/index.html | 4 + examples/recipes/order-status/phone/index.js | 14 ++ .../recipes/order-status/states/index.html | 25 +++ examples/recipes/order-status/states/index.js | 9 + .../order-status/variants-2/index.html | 3 + .../recipes/order-status/variants-2/index.js | 9 + .../recipes/order-status/variants/index.html | 4 + .../recipes/order-status/variants/index.js | 9 + .../recipes/report-period/density/index.css | 3 + .../recipes/report-period/density/index.html | 10 + .../recipes/report-period/do-dont/index.html | 10 + .../recipes/report-period/overview/index.css | 3 + .../recipes/report-period/overview/index.html | 7 + .../recipes/report-period/overview/index.js | 29 +++ .../recipes/report-period/states/index.css | 1 + .../recipes/report-period/states/index.html | 25 +++ .../recipes/report-period/variants/index.css | 1 + .../recipes/report-period/variants/index.html | 5 + .../recipes/report-period/variants/index.js | 19 ++ .../save-and-errors/density/index.html | 14 ++ .../save-and-errors/overview/index.html | 31 +++ .../recipes/save-and-errors/overview/index.js | 73 +++++++ .../recipes/save-and-errors/phone/index.html | 11 ++ .../recipes/save-and-errors/states/index.html | 36 ++++ .../recipes/site-header/density/index.css | 1 + .../recipes/site-header/density/index.html | 22 +++ examples/recipes/site-header/density/index.js | 2 + .../recipes/site-header/do-dont/index.html | 18 ++ .../recipes/site-header/overview/index.css | 1 + .../recipes/site-header/overview/index.html | 16 ++ .../recipes/site-header/overview/index.js | 28 +++ examples/recipes/site-header/phone/index.css | 1 + examples/recipes/site-header/phone/index.html | 33 ++++ examples/recipes/site-header/phone/index.js | 6 + examples/recipes/site-header/states/index.css | 2 + .../recipes/site-header/states/index.html | 36 ++++ examples/recipes/site-header/states/index.js | 3 + .../recipes/system-bar/density/index.html | 12 ++ examples/recipes/system-bar/density/index.js | 10 + .../recipes/system-bar/overview/index.html | 15 ++ examples/recipes/system-bar/overview/index.js | 27 +++ examples/recipes/system-bar/phone/index.html | 4 + examples/recipes/system-bar/phone/index.js | 11 ++ examples/recipes/system-bar/states/index.html | 20 ++ examples/recipes/system-bar/states/index.js | 16 ++ .../recipes/system-bar/variants/index.html | 11 ++ examples/recipes/system-bar/variants/index.js | 31 +++ .../recipes/which-message/density/index.html | 12 ++ .../recipes/which-message/overview/index.html | 41 ++++ .../recipes/which-message/overview/index.js | 43 +++++ .../recipes/which-message/phone/index.html | 5 + examples/recipes/which-message/phone/index.js | 6 + .../recipes/which-message/states/index.html | 28 +++ .../recipes/which-message/states/index.js | 4 + .../contents/{compact => sheet}/index.css | 0 .../contents/{compact => sheet}/index.html | 0 .../menu/{compact => rail}/index.html | 0 210 files changed, 5694 insertions(+), 11 deletions(-) create mode 100644 content/ru/recipes/admin-frame.md create mode 100644 content/ru/recipes/admin-frame.page.json create mode 100644 content/ru/recipes/brand-theme.md create mode 100644 content/ru/recipes/brand-theme.page.json create mode 100644 content/ru/recipes/bulk-actions.md create mode 100644 content/ru/recipes/bulk-actions.page.json create mode 100644 content/ru/recipes/checkout.md create mode 100644 content/ru/recipes/checkout.page.json create mode 100644 content/ru/recipes/choice-cards.md create mode 100644 content/ru/recipes/choice-cards.page.json create mode 100644 content/ru/recipes/dialog-form.md create mode 100644 content/ru/recipes/dialog-form.page.json create mode 100644 content/ru/recipes/file-upload-progress.md create mode 100644 content/ru/recipes/file-upload-progress.page.json create mode 100644 content/ru/recipes/first-paint.md create mode 100644 content/ru/recipes/first-paint.page.json create mode 100644 content/ru/recipes/hero-and-promo.md create mode 100644 content/ru/recipes/hero-and-promo.page.json create mode 100644 content/ru/recipes/list-bottom.md create mode 100644 content/ru/recipes/list-bottom.page.json create mode 100644 content/ru/recipes/list-toolbar.md create mode 100644 content/ru/recipes/list-toolbar.page.json create mode 100644 content/ru/recipes/mail-chat-list.md create mode 100644 content/ru/recipes/mail-chat-list.page.json create mode 100644 content/ru/recipes/order-status.md create mode 100644 content/ru/recipes/order-status.page.json create mode 100644 content/ru/recipes/report-period.md create mode 100644 content/ru/recipes/report-period.page.json create mode 100644 content/ru/recipes/save-and-errors.md create mode 100644 content/ru/recipes/save-and-errors.page.json create mode 100644 content/ru/recipes/site-header.md create mode 100644 content/ru/recipes/site-header.page.json create mode 100644 content/ru/recipes/system-bar.md create mode 100644 content/ru/recipes/system-bar.page.json create mode 100644 content/ru/recipes/which-message.md create mode 100644 content/ru/recipes/which-message.page.json create mode 100644 examples/recipes/admin-frame/density/index.css create mode 100644 examples/recipes/admin-frame/density/index.html create mode 100644 examples/recipes/admin-frame/density/index.js create mode 100644 examples/recipes/admin-frame/do-dont/index.html create mode 100644 examples/recipes/admin-frame/overview/index.css create mode 100644 examples/recipes/admin-frame/overview/index.html create mode 100644 examples/recipes/admin-frame/overview/index.js create mode 100644 examples/recipes/admin-frame/states/index.css create mode 100644 examples/recipes/admin-frame/states/index.html create mode 100644 examples/recipes/admin-frame/states/index.js create mode 100644 examples/recipes/brand-theme/density/index.html create mode 100644 examples/recipes/brand-theme/do-dont/index.html create mode 100644 examples/recipes/brand-theme/overview/index.css create mode 100644 examples/recipes/brand-theme/overview/index.html create mode 100644 examples/recipes/brand-theme/overview/index.js create mode 100644 examples/recipes/brand-theme/states/index.css create mode 100644 examples/recipes/brand-theme/states/index.html create mode 100644 examples/recipes/bulk-actions/density/index.html create mode 100644 examples/recipes/bulk-actions/overview/index.html create mode 100644 examples/recipes/bulk-actions/overview/index.js create mode 100644 examples/recipes/bulk-actions/phone/index.html create mode 100644 examples/recipes/bulk-actions/states/index.html create mode 100644 examples/recipes/checkout/density/index.html create mode 100644 examples/recipes/checkout/density/index.js create mode 100644 examples/recipes/checkout/overview/index.css create mode 100644 examples/recipes/checkout/overview/index.html create mode 100644 examples/recipes/checkout/overview/index.js create mode 100644 examples/recipes/checkout/phone/index.html create mode 100644 examples/recipes/checkout/phone/index.js create mode 100644 examples/recipes/checkout/states/index.html create mode 100644 examples/recipes/checkout/states/index.js create mode 100644 examples/recipes/choice-cards/density/index.html create mode 100644 examples/recipes/choice-cards/do-dont/index.html create mode 100644 examples/recipes/choice-cards/overview/index.html create mode 100644 examples/recipes/choice-cards/overview/index.js create mode 100644 examples/recipes/choice-cards/states/index.html create mode 100644 examples/recipes/choice-cards/variants-2/index.html create mode 100644 examples/recipes/choice-cards/variants-2/index.js create mode 100644 examples/recipes/choice-cards/variants/index.html create mode 100644 examples/recipes/choice-cards/variants/index.js create mode 100644 examples/recipes/dialog-form/density/index.html create mode 100644 examples/recipes/dialog-form/do-dont/index.html create mode 100644 examples/recipes/dialog-form/overview/index.html create mode 100644 examples/recipes/dialog-form/overview/index.js create mode 100644 examples/recipes/dialog-form/phone/index.css create mode 100644 examples/recipes/dialog-form/phone/index.html create mode 100644 examples/recipes/dialog-form/phone/index.js create mode 100644 examples/recipes/dialog-form/states/index.html create mode 100644 examples/recipes/file-upload-progress/density/index.html create mode 100644 examples/recipes/file-upload-progress/density/index.js create mode 100644 examples/recipes/file-upload-progress/overview/index.css create mode 100644 examples/recipes/file-upload-progress/overview/index.html create mode 100644 examples/recipes/file-upload-progress/overview/index.js create mode 100644 examples/recipes/file-upload-progress/phone/index.html create mode 100644 examples/recipes/file-upload-progress/phone/index.js create mode 100644 examples/recipes/file-upload-progress/states/index.html create mode 100644 examples/recipes/file-upload-progress/states/index.js create mode 100644 examples/recipes/first-paint/density/index.html create mode 100644 examples/recipes/first-paint/do-dont/index.html create mode 100644 examples/recipes/first-paint/overview/index.css create mode 100644 examples/recipes/first-paint/overview/index.html create mode 100644 examples/recipes/first-paint/overview/index.js create mode 100644 examples/recipes/first-paint/phone/index.html create mode 100644 examples/recipes/first-paint/states/index.html create mode 100644 examples/recipes/first-paint/states/index.js create mode 100644 examples/recipes/hero-and-promo/density/index.css create mode 100644 examples/recipes/hero-and-promo/density/index.html create mode 100644 examples/recipes/hero-and-promo/do-dont/index.html create mode 100644 examples/recipes/hero-and-promo/overview/index.css create mode 100644 examples/recipes/hero-and-promo/overview/index.html create mode 100644 examples/recipes/hero-and-promo/overview/index.js create mode 100644 examples/recipes/hero-and-promo/states/index.css create mode 100644 examples/recipes/hero-and-promo/states/index.html create mode 100644 examples/recipes/hero-and-promo/variants-2/index.css create mode 100644 examples/recipes/hero-and-promo/variants-2/index.html create mode 100644 examples/recipes/hero-and-promo/variants-2/index.js create mode 100644 examples/recipes/hero-and-promo/variants/index.css create mode 100644 examples/recipes/hero-and-promo/variants/index.html create mode 100644 examples/recipes/list-bottom/density/index.css create mode 100644 examples/recipes/list-bottom/density/index.html create mode 100644 examples/recipes/list-bottom/do-dont/index.html create mode 100644 examples/recipes/list-bottom/overview/index.css create mode 100644 examples/recipes/list-bottom/overview/index.html create mode 100644 examples/recipes/list-bottom/overview/index.js create mode 100644 examples/recipes/list-bottom/phone/index.css create mode 100644 examples/recipes/list-bottom/phone/index.html create mode 100644 examples/recipes/list-bottom/states/index.css create mode 100644 examples/recipes/list-bottom/states/index.html create mode 100644 examples/recipes/list-toolbar/density/index.html create mode 100644 examples/recipes/list-toolbar/overview/index.html create mode 100644 examples/recipes/list-toolbar/overview/index.js create mode 100644 examples/recipes/list-toolbar/phone/index.html create mode 100644 examples/recipes/list-toolbar/states/index.html create mode 100644 examples/recipes/list-toolbar/states/index.js create mode 100644 examples/recipes/mail-chat-list/density/index.css create mode 100644 examples/recipes/mail-chat-list/density/index.html create mode 100644 examples/recipes/mail-chat-list/density/index.js create mode 100644 examples/recipes/mail-chat-list/do-dont/index.html create mode 100644 examples/recipes/mail-chat-list/overview/index.css create mode 100644 examples/recipes/mail-chat-list/overview/index.html create mode 100644 examples/recipes/mail-chat-list/overview/index.js create mode 100644 examples/recipes/mail-chat-list/states/index.css create mode 100644 examples/recipes/mail-chat-list/states/index.html create mode 100644 examples/recipes/mail-chat-list/states/index.js create mode 100644 examples/recipes/order-status/density/index.html create mode 100644 examples/recipes/order-status/density/index.js create mode 100644 examples/recipes/order-status/overview/index.html create mode 100644 examples/recipes/order-status/overview/index.js create mode 100644 examples/recipes/order-status/phone/index.html create mode 100644 examples/recipes/order-status/phone/index.js create mode 100644 examples/recipes/order-status/states/index.html create mode 100644 examples/recipes/order-status/states/index.js create mode 100644 examples/recipes/order-status/variants-2/index.html create mode 100644 examples/recipes/order-status/variants-2/index.js create mode 100644 examples/recipes/order-status/variants/index.html create mode 100644 examples/recipes/order-status/variants/index.js create mode 100644 examples/recipes/report-period/density/index.css create mode 100644 examples/recipes/report-period/density/index.html create mode 100644 examples/recipes/report-period/do-dont/index.html create mode 100644 examples/recipes/report-period/overview/index.css create mode 100644 examples/recipes/report-period/overview/index.html create mode 100644 examples/recipes/report-period/overview/index.js create mode 100644 examples/recipes/report-period/states/index.css create mode 100644 examples/recipes/report-period/states/index.html create mode 100644 examples/recipes/report-period/variants/index.css create mode 100644 examples/recipes/report-period/variants/index.html create mode 100644 examples/recipes/report-period/variants/index.js create mode 100644 examples/recipes/save-and-errors/density/index.html create mode 100644 examples/recipes/save-and-errors/overview/index.html create mode 100644 examples/recipes/save-and-errors/overview/index.js create mode 100644 examples/recipes/save-and-errors/phone/index.html create mode 100644 examples/recipes/save-and-errors/states/index.html create mode 100644 examples/recipes/site-header/density/index.css create mode 100644 examples/recipes/site-header/density/index.html create mode 100644 examples/recipes/site-header/density/index.js create mode 100644 examples/recipes/site-header/do-dont/index.html create mode 100644 examples/recipes/site-header/overview/index.css create mode 100644 examples/recipes/site-header/overview/index.html create mode 100644 examples/recipes/site-header/overview/index.js create mode 100644 examples/recipes/site-header/phone/index.css create mode 100644 examples/recipes/site-header/phone/index.html create mode 100644 examples/recipes/site-header/phone/index.js create mode 100644 examples/recipes/site-header/states/index.css create mode 100644 examples/recipes/site-header/states/index.html create mode 100644 examples/recipes/site-header/states/index.js create mode 100644 examples/recipes/system-bar/density/index.html create mode 100644 examples/recipes/system-bar/density/index.js create mode 100644 examples/recipes/system-bar/overview/index.html create mode 100644 examples/recipes/system-bar/overview/index.js create mode 100644 examples/recipes/system-bar/phone/index.html create mode 100644 examples/recipes/system-bar/phone/index.js create mode 100644 examples/recipes/system-bar/states/index.html create mode 100644 examples/recipes/system-bar/states/index.js create mode 100644 examples/recipes/system-bar/variants/index.html create mode 100644 examples/recipes/system-bar/variants/index.js create mode 100644 examples/recipes/which-message/density/index.html create mode 100644 examples/recipes/which-message/overview/index.html create mode 100644 examples/recipes/which-message/overview/index.js create mode 100644 examples/recipes/which-message/phone/index.html create mode 100644 examples/recipes/which-message/phone/index.js create mode 100644 examples/recipes/which-message/states/index.html create mode 100644 examples/recipes/which-message/states/index.js rename examples/smart-components/contents/{compact => sheet}/index.css (100%) rename examples/smart-components/contents/{compact => sheet}/index.html (100%) rename examples/smart-components/menu/{compact => rail}/index.html (100%) diff --git a/content/ru/recipes/admin-frame.md b/content/ru/recipes/admin-frame.md new file mode 100644 index 000000000..08105b60f --- /dev/null +++ b/content/ru/recipes/admin-frame.md @@ -0,0 +1,154 @@ +--- +title: "Каркас админки" +description: "Столбец разделов слева и шапка страницы с путём: человек всегда видит, где он и куда перейти; на телефоне разделы за кнопкой меню." +--- + +# Каркас админки + +Столбец разделов слева и шапка страницы с путём над заголовком: человек +всегда видит, где он и куда можно перейти. Всё приложение — в +компактной плотности. На телефоне столбец прячется за кнопку меню и +выезжает панелью с той же стороны. + +## Пример + +Админка магазина на Larena. Выберите раздел в столбце — он станет +текущим, а заголовок страницы сменится. «Каталог» раскрывает подразделы. +Сузьте пример до телефона — столбец уйдёт за кнопку меню. + +:::example {id="recipes/admin-frame/overview" label="Админка магазина" preview=sandbox log="sf-menu-navigate" log_console=true log_open=false} +::: + +## Когда брать + +| Если | Так | +|:---|:---| +| Приложение с разделами: админка сайта, SIMAI Pro, личный кабинет | Этот рецепт | +| Сайт, магазин, документация | Рецепт «Шапка сайта»: разделы строкой в шапке | +| Группы и пункты рядом в две колонки | Пока не делаем: столбец с двумя уровнями | + +## Состояния + +Каркас остаётся на месте во всех состояниях: меню работает, меняется +только содержимое страницы. + +:::example {id="recipes/admin-frame/states" label="Состояния каркаса" preview=sandbox} +::: + +## На телефоне + +Откройте первый пример в ширине телефона. Столбца нет, слева — кнопка +меню. Нажатие открывает панель с тем же меню с той же стороны; выбор +раздела закрывает панель. Путь над заголовком сокращается до «… › +родитель» в одну строку. + +## Плотность + +Админки — компактные, это и есть их вид: строки меню и кнопки 32, текст +14. Обычная плотность — только если продукт так решил, например личный +кабинет на сайте. Столбец меню — 16rem в обеих плотностях. + +:::example {id="recipes/admin-frame/density" label="Обычная и компактная" preview=sandbox} +::: + +## Тексты + +- Разделы — существительные: «Страницы», «Заказы», «Резервные копии». +- Группы меню — по смыслу: «Сайт», «Управление». +- Путь — только родители, без текущей страницы: она уже в заголовке. +- Главная кнопка страницы называет действие: «Создать страницу». +- Ошибка говорит, что остальное работает: «Сервер не ответил. Остальные + разделы работают». + +## Из чего собрано + +| Часть | Компонент | Как задано | +|:---|:---|:---| +| Столбец разделов | [Меню](/ru/smart/navigation/menu/) | `appearance="navigation"`; группы `{group: true, label, items}`; значки только на первом уровне; текущий — `current`; поиск — `search` | +| Ширина столбца | правило страницы | `16rem` в обеих плотностях; уже 60rem — кнопка меню и панель | +| Путь | [Хлебные крошки](/ru/smart/navigation/breadcrumbs/) | `slot="path"`, `current="none"` — только родители | +| Заголовок, число, действие | [Заголовок страницы](/ru/smart/composite/page-header/) | `heading`, `count`, главная кнопка в слоте `actions` | +| Пусто и ошибка | [Пустой раздел](/ru/smart/feedback/empty-state/) | `kind="no-data"`, `kind="error"` | +| Кнопка меню и панель | [Кнопка с иконкой](/ru/smart/actions/icon-buttons/), [Шторка](/ru/smart/overlays/drawer/) | `aria-controls` — id панели; `placement="inline-start"`, `controlled` | +| Плотность | `data-sf-density="compact"` | на всём приложении | + +## Доступность + +Путь с клавиатуры: + +1. Первые остановки Tab — пункты меню; текущий объявляется как текущая + страница. +2. «Каталог» раскрывается Enter или пробелом на его кнопке; дальше — + обычный Tab по ссылкам. +3. Затем путь, заголовок страницы, «Создать страницу», содержимое. +4. На телефоне кнопка меню сообщает, открыта ли панель; панель держит + фокус, Escape закрывает её и возвращает фокус на кнопку. + +| Что | Что слышит человек с экранным диктором | Откуда | +|:---|:---|:---| +| Меню | навигация «Разделы админки» | `label` у меню | +| Число у «Заказы» | «Заказы, 12» | поле `count` пункта | +| Кнопка меню | «Разделы, свёрнуто» | `aria-label`, `aria-controls` | +| Панель | диалог «shop.example.ru» | `heading` у шторки | + +## Как делать + +:::example {id="recipes/admin-frame/do-dont" label="Как делать" preview=sandbox} +::: + +- **Текущий раздел — заливкой и полужирной подписью.** Видно с первого + взгляда, где человек. +- **Каркас не мигает.** Ошибка и загрузка — только в содержимом, меню и + шапка остаются на месте. +- **Панель — с той же стороны, что кнопка меню.** Рука и взгляд не + прыгают через экран. + +## Копия для ИИ + +```html + +
+ +
+ + + + +
+
+… + +``` + +## Где используется + +| Продукт | Экран | +|:---|:---| +| Larena, админка | все разделы сайта и магазина | +| SIMAI Pro | приложение целиком | +| Портал simai.io | личный кабинет (обычная плотность) | + +## Что ещё в пути + +> **Появится в следующей версии.** Своя заготовка первого кадра у меню — +> пока её рисует страница. Крестик панели на телефоне встанет на место +> кнопки меню, как у шапки сайта; сейчас он в дальнем углу панели. +> Меню с группами в обычном виде получит заливку текущего раздела — до +> тех пор берите `appearance="navigation"`, как в примере. + +## См. также + +- [Меню](/ru/smart/navigation/menu/) — группы, уровни, поиск +- [Заголовок страницы](/ru/smart/composite/page-header/) — путь, число, действия +- [Шторка](/ru/smart/overlays/drawer/) — панель на телефоне diff --git a/content/ru/recipes/admin-frame.page.json b/content/ru/recipes/admin-frame.page.json new file mode 100644 index 000000000..9dd34fbc1 --- /dev/null +++ b/content/ru/recipes/admin-frame.page.json @@ -0,0 +1 @@ +{"schema": "docara.page.v1", "navigation": {"order": 250}} diff --git a/content/ru/recipes/brand-theme.md b/content/ru/recipes/brand-theme.md new file mode 100644 index 000000000..1fe447efe --- /dev/null +++ b/content/ru/recipes/brand-theme.md @@ -0,0 +1,144 @@ +--- +title: "Оформление: цвет и тема" +description: "Владелец сайта выбирает фирменный цвет и тему: образец меняется сразу, а сайт — только по «Сохранить»." +--- + +# Оформление: цвет и тема + +Владелец сайта выбирает фирменный цвет и тему — светлую, тёмную или как +в системе — и сразу видит на образце, как будет выглядеть сайт. Сам сайт +меняется только по «Сохранить»: пока человек пробует цвета, посетители +видят прежние. + +## Пример + +Экран «Оформление» в админке Larena. Выберите «Логотип» — образец справа +окрасится сразу, светлый цвет получит тёмный текст. Под кнопками +появится напоминание, что сайт ещё не изменился. Нажмите «Сохранить». +Включите «Сервер ответит ошибкой», чтобы увидеть отказ. + +:::example {id="recipes/brand-theme/overview" label="Оформление сайта" preview=sandbox log="sf-input-color-change change" log_console=true log_open=false} +::: + +## Когда брать + +| Если | Так | +|:---|:---| +| Владелец сайта задаёт фирменный цвет и тему | Этот рецепт: экран «Оформление» с полем цвета, темой и образцом | +| Быстро выбрать цвет прямо в шапке | Кружок цвета `variant="theme"`: только цвет, без подписи и темы | +| Посетителю — тема и цвет для себя | [Меню настроек](/ru/smart/navigation/settings/) со строками «Тема» и «Цвет» | +| Цвет метки или серии графика | Обычное [Поле цвета](/ru/smart/forms/color/), не этот рецепт | + +## Состояния + +:::example {id="recipes/brand-theme/states" label="Состояния оформления" preview=sandbox} +::: + +## На телефоне + +Откройте первый пример в ширине телефона. Поле, тема и кнопки встают +столбиком, образец — под ними. Окно выбора цвета на телефоне открывается +листом снизу. + +## Плотность + +Админка Larena — компактная; экран брендинга на портале может быть в +обычной плотности. + +:::example {id="recipes/brand-theme/density" label="Обычная и компактная" preview=sandbox} +::: + +## Тексты + +- Подписи — «Фирменный цвет» и «Тема сайта»; темы — «Светлая», «Тёмная», + «Как в системе». +- Готовые цвета названы: «Синий SIMAI», «Логотип». +- Пока не сохранено: «Есть несохранённые изменения: на сайте пока прежнее + оформление». +- Сохранено: «Оформление сохранено: сайт обновлён». +- Отказ говорит, что видят посетители: «Сайт показывает прежние цвета — + нажмите «Сохранить» ещё раз». + +## Из чего собрано + +| Часть | Компонент | Как задано | +|:---|:---|:---| +| Фирменный цвет | [Поле цвета](/ru/smart/forms/color/) | `variant="brand"`; `swatches` — цвета продукта; `target` — образец, тема строится на нём сразу; `clearable` — вернуть цвет SIMAI | +| Тема сайта | [Сегментный переключатель](/ru/smart/actions/segmented/) | «Светлая», «Тёмная», «Как в системе»; меняет только образец | +| Образец | разметка страницы | шапка на `--sf-brand` и `--sf-on-brand`, обложка и кнопки — цвета темы | +| Сохранить | [Кнопка](/ru/smart/actions/buttons/) | главная первой; «Вернуть цвет SIMAI» — `appearance="ghost"` `scheme="on-surface"`; при сохранении — `loading` | +| Напоминание и итог | строка с `role="status"` | под кнопками | +| Ошибка | [Сообщение](/ru/smart/feedback/alert/) | `status="error"` | + +## Доступность + +Путь с клавиатуры: + +1. Tab: поле цвета — Enter открывает окно выбора; готовые цвета — + стрелками, Enter выбирает; Escape закрывает окно и возвращает фокус. +2. Тема — одна остановка Tab, стрелки меняют вариант. +3. «Сохранить», «Вернуть цвет SIMAI». Напоминание и итог объявляются + сами. + +| Что | Что слышит человек с экранным диктором | Откуда | +|:---|:---|:---| +| Поле | «Фирменный цвет, Синий SIMAI» | `label`, название из `swatches` | +| Тема | «Тема сайта, Как в системе, выбрано» | `aria-labelledby` | +| Образец | «Образец сайта» | `aria-label` | +| Напоминание | «Есть несохранённые изменения…» | `role="status"` | + +## Как делать + +:::example {id="recipes/brand-theme/do-dont" label="Как делать" preview=sandbox} +::: + +- **Образец — сразу, сайт — по «Сохранить».** Пока человек пробует + цвета, посетители видят прежнее оформление. +- **Админка остаётся в своих цветах.** Тема ложится только на образец, + чтобы кнопки админки не меняли цвет под рукой. +- **Цвет текста на фирменном цвете выбирает ядро.** Светлому цвету — + тёмный текст, тёмному — белый. + +## Копия для ИИ + +```html + +
+ + +
+ + +
+

+
…
+
+``` + +## Где используется + +| Продукт | Экран | +|:---|:---| +| Larena, админка | «Оформление» сайта | +| Портал simai.io | брендинг организации | + +## Что ещё в пути + +> **Появится в следующей версии.** Кнопки внутри поля цвета с очисткой +> получат промежуток, как у остальных кнопок; подпись кнопки очистки в +> фирменном режиме — «Вернуть цвет SIMAI» вместо «Вернуть +> унаследованный». + +## См. также + +- [Поле цвета](/ru/smart/forms/color/) — режимы `brand` и `theme` +- [Меню настроек](/ru/smart/navigation/settings/) — тема и цвет для посетителя +- [Форма настроек](/ru/recipes/settings-form/) — остальные настройки сайта diff --git a/content/ru/recipes/brand-theme.page.json b/content/ru/recipes/brand-theme.page.json new file mode 100644 index 000000000..6c71b0aab --- /dev/null +++ b/content/ru/recipes/brand-theme.page.json @@ -0,0 +1 @@ +{"schema": "docara.page.v1", "navigation": {"order": 170}} diff --git a/content/ru/recipes/bulk-actions.md b/content/ru/recipes/bulk-actions.md new file mode 100644 index 000000000..55c8783e5 --- /dev/null +++ b/content/ru/recipes/bulk-actions.md @@ -0,0 +1,147 @@ +--- +title: "Выбор строк и общие действия" +description: "Как отметить несколько строк и сделать с ними одно действие: строка «Выбрано N» с действиями на месте панели, до трёх значков у строки и вопрос перед тем, что нельзя вернуть." +--- + +# Выбор строк и общие действия + +В списке записей, в таблице или в письмах человек отмечает строки и +делает с ними одно действие: опубликовать, снять с публикации, удалить. +Как только выбрана хотя бы одна строка, панель над списком сменяется +строкой «Выбрано N» с действиями выбора. У самой строки — до трёх частых +значков и «⋯» для остального. Перед тем, что нельзя быстро вернуть, — +вопрос с залитой красной кнопкой; после — «Удалено 3 новости» с +«Отменить». + +## Пример + +Отметьте две-три новости: над таблицей появится строка «Выбрано N». +«Снять с публикации» — обратимо и без вопроса, «Удалить» спросит, а после +ответа покажет «Отменить». + +:::example {id="recipes/bulk-actions/overview" label="Новости" preview=sandbox log="sf-view-table-select sf-confirm-answer sf-modal-closed" log_console=true log_open=false} +::: + +Таблица — компонент [Представление данных](/ru/pro/admin/table/) набора Pro. +Строку «Выбрано N» собирает страница по событию выбора. + +## Когда брать + +| Если | Так | +|:---|:---| +| Одно и то же делают с многими записями: опубликовать, перенести, удалить | Флажки строк и строка «Выбрано N» | +| Записей много и их выбирают поиском или фильтром | То же, «выбрать все» в шапке таблицы | +| У строки одно–три частых действия | Значки в строке, остальное — в «⋯» | +| Действие одно и всегда со всеми: «Очистить корзину» | Кнопка над списком, без выбора | +| Выбор — это ответ формы: кому отправить | Поле выбора, а не таблица | +| Личное и обратимое: свой вид, свой фильтр | Без вопроса, только «Вернуть» — [Удаление](/ru/recipes/delete/) | + +## Состояния + +:::example {id="recipes/bulk-actions/states" label="Состояния" preview=sandbox} +::: + +## На телефоне + +На телефоне — только список. Выбор — флажком или долгим нажатием; строка +«Выбрано N» встаёт над списком, действия уходят под неё. Вопрос — окном. +Откройте пример во весь экран и выберите ширину телефона. + +:::example {id="recipes/bulk-actions/phone" label="Телефон" preview=sandbox} +::: + +## Плотность + +Таблицы в админке — в компактной плотности: `data-sf-density="compact"` на +корне экрана уменьшает флажки, значки и строку выбора на ступень. + +:::example {id="recipes/bulk-actions/density" label="Плотность" preview=sandbox} +::: + +## Тексты + +| Место | Так | Не так | +|:---|:---|:---| +| Строка выбора | «Выбрано 3» · «Снять выбор» | «3 элемента отмечено» | +| Вопрос | «Удалить 3 новости?» | «Вы уверены?» | +| Последствие | «Они пропадут с сайта и из поиска. Вернуть можно 30 дней из корзины.» | «Действие необратимо!» | +| Кнопка | «Удалить 3 новости» / «Отмена» | «Да» / «Нет» | +| После | «Удалено 3 новости» · «Отменить» | «Операция выполнена успешно» | + +## Из чего собрано + +| Часть | Компонент | Как задано | +|:---|:---|:---| +| Флажок строки и «выбрать все» в шапке | [Представление данных](/ru/pro/admin/table/) | выбор встроен; событие `sf-view-table-select` с `ids` | +| Строка «Выбрано N» на месте панели | страница | по `sf-view-table-select`: число, «Снять выбор», действия через 8 | +| Действия выбора — кнопки с рамкой; опасное последним | [Кнопка](/ru/smart/actions/buttons/) | `appearance="outline"` `scheme="on-surface"`; «Удалить» — `status="danger"` | +| У строки до трёх значков, остальное в «⋯» | [Представление данных](/ru/pro/admin/table/) | `quick-actions`, `row-actions-visible="always"` | +| Вопрос: залитая «Удалить», тихая «Отмена», фокус на «Отмене» | [Окно](/ru/smart/overlays/modal/) и [Подтверждение](/ru/smart/actions/confirm/) | `sf-modal size="question" initial-focus="safe"`, внутри `sf-confirm status="danger" destructive appearance="window"` | +| После — «Удалено N» с «Отменить» | [`SF.notify`](/ru/guide/functions/actions/notify/) | `action: {label: 'Отменить'}` | + +## Доступность + +- Таблица — одна остановка Tab: ↑↓ по строкам, пробел отмечает строку, + Shift+F10 или клавиша меню открывают меню строки. +- Флажок строки читается с её названием: «Выбрать „Осенняя распродажа“». +- Число выбранных объявляется: «Выбрано 3». +- Вопрос: фокус на «Отмене», Enter и пробел не удаляют, Esc — отмена; + после ответа фокус возвращается на кнопку действия. + +## Как делать + +- **Действия выбора — с рамкой, не залитые.** Залитая главная кнопка на + экране одна; «Удалить» — с рамкой опасного цвета и последней. +- **Вопрос называет, что удалится.** «Удалить 3 новости?» и «Удалить + 3 новости» на кнопке, а не «Вы уверены?» и «Да». +- **После действия выбор снимается.** Строка «Выбрано N» уходит, панель + возвращается. + +## Копия для ИИ + +```html + + + + +``` + +## Где используется + +- Списки записей в админке Larena: новости, товары, страницы. +- Таблицы SIMAI Pro. +- Письма в почте — архив, прочитано, удалить. + +## Что ещё в пути + +> **Что ещё в пути.** Строку «Выбрано N» представление данных будет +> рисовать само; пока её собирает страница, а свои действия выбора у +> таблицы не задают — они рисуются тремя залитыми кнопками. В отмеченном +> флажке строки сейчас не видна галочка. Одно меню строки для всех списков +> и клавиатура меню строки появятся в следующей версии SIMAI Framework. + +## См. также + +- [Панель над списком](/ru/recipes/list-toolbar/) +- [Удаление](/ru/recipes/delete/) +- [Какое сообщение выбрать](/ru/recipes/which-message/) +- [Представление данных](/ru/pro/admin/table/), [Подтверждение](/ru/smart/actions/confirm/) diff --git a/content/ru/recipes/bulk-actions.page.json b/content/ru/recipes/bulk-actions.page.json new file mode 100644 index 000000000..70582dc6a --- /dev/null +++ b/content/ru/recipes/bulk-actions.page.json @@ -0,0 +1 @@ +{"schema": "docara.page.v1", "navigation": {"order": 190}} diff --git a/content/ru/recipes/checkout.md b/content/ru/recipes/checkout.md new file mode 100644 index 000000000..0188e9208 --- /dev/null +++ b/content/ru/recipes/checkout.md @@ -0,0 +1,150 @@ +--- +title: "Оформление заказа" +description: "Корзина, доставка, оплата и подтверждение по шагам: способы строками с ценой и сроком, день из доступных, телефон с кодом страны и сумма в главной кнопке на телефоне." +--- + +# Оформление заказа + +Покупатель на сайте магазина проверяет корзину, выбирает способ и день +доставки, оставляет телефон и адрес, выбирает оплату и подтверждает заказ. +Ему нужно видеть, сколько шагов осталось, вернуться к пройденному шагу и не +потерять введённое, сравнить способы по цене и сроку в одной строке и +выбрать день только из тех, когда доставка есть. Сумма заказа всегда на +виду: на компьютере — в колонке справа, на телефоне — в главной кнопке. + +## Пример + +Пройдите шаги кнопкой «Далее» или вернитесь к пройденному, нажав на него в +строке шагов. Выберите другой способ доставки — сумма пересчитается. +Сузьте пример до ширины телефона: колонка с суммой уйдёт, сумма встанет в +кнопку «Далее». + +:::example {id="recipes/checkout/overview" label="Чайная лавка" preview=sandbox log="sf-steps-change change" log_console=true log_open=false} +::: + +## Когда брать + +| Если | Так | +|:---|:---| +| Покупатель оформляет заказ сам на сайте магазина | Этот рецепт | +| Способов доставки и оплаты два–шесть, они отличаются ценой и сроком | Строки с ценой и сроком в одной рамке | +| Есть дни, когда доставки нет | Календарь с границами | +| Заказ в один нажим — повтор прошлого | Одна кнопка и подтверждение | +| Заказ оформляет менеджер в админке | [Сохранение и ошибки в форме](/ru/recipes/save-and-errors/) | +| Шаги — ход заказа после оплаты, а не решения покупателя | [Статус заказа](/ru/recipes/order-status/) | + +## Состояния + +:::example {id="recipes/checkout/states" label="Состояния" preview=sandbox} +::: + +## На телефоне + +Строка шагов становится «Шаг 2 из 4»; поля — в одну колонку; колонки с +суммой нет — сумма в главной кнопке: «Далее · 5 070 ₽». Откройте пример во +весь экран и выберите ширину телефона. + +:::example {id="recipes/checkout/phone" label="Телефон" preview=sandbox} +::: + +## Плотность + +Оформление заказа — страница сайта, она в обычной плотности. Компактная +нужна, только когда тот же выбор делает менеджер в админке. + +:::example {id="recipes/checkout/density" label="Плотность" preview=sandbox} +::: + +## Тексты + +- **Способ** — что получит покупатель: «Курьером», «Пункт выдачи», «Почта + России»; пояснение — «Привезём в удобный интервал». +- **Срок** — словами: «2–3 дня», «завтра»; **цена** — «350 ₽», «бесплатно». +- **Ошибка** — что сделать: «Выберите способ оплаты», «Укажите номер + полностью». +- **Главная кнопка** на последнем шаге — «Оформить заказ», а не «Далее». + На телефоне — с суммой: «Далее · 5 070 ₽». + +## Из чего собрано + +| Часть | Компонент | Как задано | +|:---|:---|:---| +| Ход: строка шагов, вернуться к пройденным | [Шаги](/ru/smart/navigation/steps/) | `navigation="visited"`, `current`; на телефоне `layout="count"` | +| Доставка и оплата строками в одной рамке, цена и срок в конце строки | [Выбор карточками](/ru/smart/forms/input-choice/) | `layout="list"`, `items[].price`, `term`, `caption`, `badge` | +| День только из доступных | [Дата](/ru/smart/forms/datepicker/) | `min-date`, `max-date` | +| Телефон с флагом и кодом страны | [Телефон](/ru/smart/forms/country-code/) | `iso2="ru"`, `preferred` | +| Поля одной колонкой | сетка страницы | `max-w-g8` | +| «Назад» в начале, «Далее» в конце | [Кнопка](/ru/smart/actions/buttons/) | «Назад» — `appearance="ghost"` `scheme="on-surface"`; «Далее» — главная | +| Итог заказа справа; на телефоне — в главной кнопке | карточка страницы | колонка `bg-surface-card`; текст кнопки «Далее · <сумма>» | +| Сводка перед заказом | [Описание](/ru/smart/content/list-description/) | `items[].label`, `value` | + +## Доступность + +- Способы — группа переключателей с подписью: стрелки ↑↓ выбирают, Tab + ведёт к следующему полю. +- Шаги — нумерованный список; текущий отмечен как текущий шаг, пройденные + — кнопки, к ним можно вернуться. +- Календарь открывается с клавиатуры; недоступные дни не выбираются и + читаются как недоступные. +- Итог — область «Ваш заказ»; изменение суммы не объявляется каждый раз, + только на подтверждении. На телефоне сумма читается с кнопкой: «Далее, + 5 070 ₽». + +## Как делать + +- **Цена и срок — в строке способа.** Покупатель сравнивает способы, не + открывая их. +- **Недоступное видно и объяснено.** Способ, которым не везут по адресу, + остаётся в списке выключенным, с причиной. +- **Сумма не теряется.** На узком экране её не прячут в свёрнутую панель: + она в главной кнопке. + +## Копия для ИИ + +```html + + + + + + + +``` + +## Где используется + +Магазины на Larena и сайты клиентов с корзиной. + +## Что ещё в пути + +> **Появится в следующей версии.** Праздники в календаре доставки: +> праздник и перенесённый выходной красные, как выходные, рабочая суббота +> обычного цвета. Точка под числом и название дня под календарём +> необязательны: они рисуются, только если у дня есть данные о празднике; +> без данных календарь показывает обычные выходные. Пока недоступные дни +> задают границы `min-date` и `max-date`, а выходные — `weekend`. +> +> **Появится в следующей версии.** Значок календаря встанет в конец поля, +> после кнопки «очистить»: начало поля остаётся за значком смысла, как у +> поиска. Сейчас значок стоит в начале. + +## См. также + +- [Статус заказа или заявки](/ru/recipes/order-status/) +- [Выбор карточками](/ru/smart/forms/input-choice/), [Дата](/ru/smart/forms/datepicker/), [Телефон](/ru/smart/forms/country-code/) +- [Шаги](/ru/smart/navigation/steps/) diff --git a/content/ru/recipes/checkout.page.json b/content/ru/recipes/checkout.page.json new file mode 100644 index 000000000..39514966a --- /dev/null +++ b/content/ru/recipes/checkout.page.json @@ -0,0 +1 @@ +{"schema": "docara.page.v1", "navigation": {"order": 150}} diff --git a/content/ru/recipes/choice-cards.md b/content/ru/recipes/choice-cards.md new file mode 100644 index 000000000..ff67515ae --- /dev/null +++ b/content/ru/recipes/choice-cards.md @@ -0,0 +1,161 @@ +--- +title: "Выбор карточками" +description: "Выбрать один или несколько вариантов, когда у каждого есть цена, срок или пояснение: доставка, оплата, тарифы, модули, шаблоны." +--- + +# Выбор карточками + +Выбрать вариант, когда у каждого есть цена, срок или пояснение: доставку +и оплату в магазине, тариф, шаблон сайта, модули при установке. Цена и +срок стоят рядом с названием, нажимается вся карточка. + +## Пример + +Оформление заказа в магазине насосов. Выберите доставку — итог внизу +пересчитается. Нажмите «Оформить заказ», не выбрав оплату: группа +покажет ошибку, и фокус встанет в неё. + +:::example {id="recipes/choice-cards/overview" label="Доставка и оплата" preview=sandbox log="sf-input-choice-change" log_console=true log_open=false} +::: + +## Когда брать + +| Если | Раскладка | +|:---|:---| +| Два–шесть вариантов, у каждого пояснение, цена или срок | Строки `layout="list"`: одна рамка, строки через линию, кружок выбора в начале — доставка, оплата | +| Сравнить два–четыре предложения | Плитки `layout="tile"`: кружок в правом верхнем углу, цена внизу за линией — тарифы, модули | +| Выбор по виду | С картинкой `layout="picture"`: картинка до краёв, подпись под ней — шаблоны | +| Можно выбрать несколько | `multiple`: в карточках флажки | +| Вариантов больше шести | Первые шесть и «Показать все N» под карточками | +| Варианты без пояснений, коротко | Не карточки: [Радиокнопки](/ru/smart/forms/radio/), [Сегментный переключатель](/ru/smart/actions/segmented/) или [Выпадающий список](/ru/smart/navigation/dropdown/) | + +## Варианты + +### Плитки и картинки + +Тариф выбирают плитками: цена внизу, за линией. Шаблон сайта — по +картинке. + +:::example {id="recipes/choice-cards/variants" label="Тариф и шаблон" preview=sandbox log="sf-input-choice-change" log_console=true log_open=false} +::: + +### Много вариантов + +Модули при установке Larena: вариантов девять, видны первые шесть и +«Показать все 9». Отмеченный модуль из скрытых виден всегда. + +:::example {id="recipes/choice-cards/variants-2" label="Модули" preview=sandbox log="sf-input-choice-change" log_console=true log_open=false} +::: + +## Состояния + +:::example {id="recipes/choice-cards/states" label="Состояния выбора" preview=sandbox} +::: + +## На телефоне + +Откройте примеры в ширине телефона. Строки остаются строками, плитки +встают одна под другой, карточки с картинкой становятся строками: +картинка слева, подпись справа. + +## Плотность + +Магазин — в обычной плотности. Установка Larena и админка — в компактной: +поля карточки и текст на ступень меньше. + +:::example {id="recipes/choice-cards/density" label="Обычная и компактная" preview=sandbox} +::: + +## Тексты + +- Подпись группы называет, что выбирают: «Доставка», «Оплата», «Тариф». +- Название варианта — коротко, пояснение — чем он отличается: «Больше + 2 000 пунктов, хранение 7 дней». +- Цена и срок — отдельно, у края: «150 ₽», «1–2 дня»; бесплатно — + словом «Бесплатно». +- Недоступный вариант объясняет, почему: «Временно недоступна для насосов + тяжелее 20 кг». +- Ошибка говорит, что сделать: «Выберите способ оплаты». +- Кнопка показа называет число: «Показать все 9». + +## Из чего собрано + +| Часть | Компонент | Как задано | +|:---|:---|:---| +| Группа | [Выбор карточками](/ru/smart/forms/input-choice/) | `label` над карточками; `layout` — `list`, `tile`, `picture`; `multiple` — несколько сразу | +| Карточка | [Выбор карточками](/ru/smart/forms/input-choice/) | запись `items`: `value`, `label`, `caption`, `price`, `term`, `badge`, `icon`, `image`, `disabled` | +| Пояснение и ошибка | [Выбор карточками](/ru/smart/forms/input-choice/) | `hint`; `required`, `invalid` и `error-message` | +| Показать все | [Кнопка](/ru/smart/actions/buttons/) | `appearance="ghost"` `scheme="on-surface"` под карточками; страница показывает первые шесть и отмеченные | +| Нет вариантов | [Сообщение](/ru/smart/feedback/alert/) | `status="warning"`: причина и что сделать | +| Загрузка | [Заготовка](/ru/smart/feedback/skeleton/) | в размер строк | + +## Доступность + +Путь с клавиатуры: + +1. Tab входит в группу на выбранную карточку, а если выбора нет — на + первую. Стрелки переходят и выбирают; недоступная пропускается. +2. В `multiple` каждая карточка — своя остановка Tab, пробел отмечает. +3. «Показать все 9» — обычная кнопка; после неё фокус встаёт на первую + из открывшихся карточек. +4. «Оформить заказ» без оплаты: фокус встаёт в группу, текст ошибки + читается как её описание. + +| Что | Что слышит человек с экранным диктором | Откуда | +|:---|:---|:---| +| Группа | «Доставка, группа, Срок считаем от оплаты» | `label`, `hint` | +| Карточка | «Пункт выдачи, Выгодно, 150 ₽, 1–2 дня, выбрано» | `label`, `badge`, `price`, `term` | +| Недоступная | «Почта России, недоступно, Временно недоступна…» | `disabled`, `caption` | + +## Как делать + +:::example {id="recipes/choice-cards/do-dont" label="Как делать" preview=sandbox} +::: + +- **Нажимается вся карточка.** Не только кружок: палец и мышь попадают + с первого раза. +- **Выбранное видно рамкой и лёгкой заливкой.** Одной заливки без + кружка выбора не бывает. +- **Больше шести — не все сразу.** Длинная стена карточек прячет + главное; первые шесть и «Показать все N» держат форму короткой. + +## Копия для ИИ + +```html + + + +``` + +## Где используется + +| Продукт | Экран | +|:---|:---| +| Магазины на Larena и Битрикс | оформление заказа: доставка, оплата | +| Larena, установщик | шаблон сайта, модули | +| Портал simai.io | тариф | + +## Что ещё в пути + +> **Появится в следующей версии.** Своя заготовка загрузки у выбора +> карточками — пока её рисует страница. Картинки шаблонов придут из +> общего набора иллюстраций документации; пока в примере простые плоские +> заглушки. Показ первых шести и «Показать все N» делает страница. + +## См. также + +- [Выбор карточками](/ru/smart/forms/input-choice/) — все настройки +- [Радиокнопки](/ru/smart/forms/radio/) — короткий выбор без пояснений +- [Форма настроек](/ru/recipes/settings-form/) — выбор внутри большой формы diff --git a/content/ru/recipes/choice-cards.page.json b/content/ru/recipes/choice-cards.page.json new file mode 100644 index 000000000..61a1b4b71 --- /dev/null +++ b/content/ru/recipes/choice-cards.page.json @@ -0,0 +1 @@ +{"schema": "docara.page.v1", "navigation": {"order": 90}} diff --git a/content/ru/recipes/copy.page.json b/content/ru/recipes/copy.page.json index 61a1b4b71..2eaacaa97 100644 --- a/content/ru/recipes/copy.page.json +++ b/content/ru/recipes/copy.page.json @@ -1 +1 @@ -{"schema": "docara.page.v1", "navigation": {"order": 90}} +{"schema": "docara.page.v1", "navigation": {"order": 220}} diff --git a/content/ru/recipes/dashboard.page.json b/content/ru/recipes/dashboard.page.json index a4195afd5..3085f11f1 100644 --- a/content/ru/recipes/dashboard.page.json +++ b/content/ru/recipes/dashboard.page.json @@ -1 +1 @@ -{"schema": "docara.page.v1", "navigation": {"order": 70}} +{"schema": "docara.page.v1", "navigation": {"order": 200}} diff --git a/content/ru/recipes/delete.page.json b/content/ru/recipes/delete.page.json index 23d71cd65..78674a124 100644 --- a/content/ru/recipes/delete.page.json +++ b/content/ru/recipes/delete.page.json @@ -1 +1 @@ -{"schema": "docara.page.v1", "navigation": {"order": 40}} +{"schema": "docara.page.v1", "navigation": {"order": 180}} diff --git a/content/ru/recipes/dialog-form.md b/content/ru/recipes/dialog-form.md new file mode 100644 index 000000000..71cff13eb --- /dev/null +++ b/content/ru/recipes/dialog-form.md @@ -0,0 +1,179 @@ +--- +title: "Окно с формой" +description: "Короткая форма в окне: два-три поля, ошибки у полей, сохранение без ухода со страницы и вопрос, если человек закрывает окно с правками." +--- + +# Окно с формой + +Короткая форма в окне: заполнить два-три поля и сохранить, не уходя со +списка. Ошибки видны у самих полей, при сохранении окно ждёт ответа +сервера, а случайный Escape не теряет набранное — окно сначала спросит. + +## Пример + +Нажмите «Новая страница» и сразу «Создать страницу»: поле «Название» +покажет ошибку, и курсор встанет в него. Впишите в «Адрес» пробел — ошибок +станет две, и над полями появится сводка со ссылками. Начните печатать и +нажмите Escape — окно спросит, закрыть ли без сохранения. Включите «Сервер +ответит ошибкой», чтобы увидеть отказ при сохранении. + +:::example {id="recipes/dialog-form/overview" label="Новая страница" preview=sandbox log="sf-modal-open sf-modal-close sf-modal-closed" log_console=true log_open=false} +::: + +## Когда брать + +| Если | Так | +|:---|:---| +| Создать или переименовать запись: одно–пять полей, не уходя со списка | Этот рецепт | +| Полей больше пяти, есть вкладки или разделы | Отдельная страница с формой, как в рецепте [Форма настроек](/ru/recipes/settings-form/), или боковая [Шторка](/ru/smart/overlays/drawer/) | +| Вопрос «да или нет» без полей | Окно вопроса или [Подтверждение](/ru/smart/actions/confirm/) | +| Одно значение в строке списка | Правка прямо в строке [Списка](/ru/smart/content/list/), без окна | + +## Состояния + +Окна ниже стоят в потоке страницы, чтобы видеть все сразу. В продукте это +одно и то же окно поверх страницы. + +:::example {id="recipes/dialog-form/states" label="Состояния окна" preview=sandbox} +::: + +Пять полей — предел окна. Больше — уже страница. + +## На телефоне + +Откройте пример в ширине телефона. Ответы в подвале делят ряд пополам, +главная — первой. Окно с одним полем стоит над страницей; окно с четырьмя +полями занимает весь экран. + +:::example {id="recipes/dialog-form/phone" label="Окна на телефоне" preview=sandbox} +::: + +> **Появится в следующей версии.** Окно само решит, как стоять на +> телефоне: короткое — шторкой снизу во всю ширину, форма больше трёх полей +> — на весь экран, ответы пополам. Пока это задаёт страница: `fullscreen` +> для длинной формы и правило для кнопок подвала, как в примере. + +## Плотность + +В админке окно компактное: на ступень уже, поля и кнопки ниже, кнопки +подвала ближе друг к другу. Плотность задаётся один раз на всём +приложении. + +:::example {id="recipes/dialog-form/density" label="Обычная и компактная" preview=sandbox} +::: + +## Тексты + +- Заголовок окна называет действие и предмет: «Новая страница», + «Переименовать раздел». +- Главная кнопка повторяет действие: «Создать страницу», «Сохранить» — + не «ОК». +- Ошибка под полем говорит, что сделать: «Введите название страницы», + «Только латинские буквы, цифры и дефис». +- Сводка называет число: «Исправьте 2 поля», и ссылки ведут к полям. +- Отказ сервера говорит, что набранное цело: «Сервер не ответил. Набранное + осталось в окне — нажмите «Создать страницу» ещё раз». +- Вопрос при закрытии: «Закрыть без сохранения?», ответы «Не сохранять» и + «Продолжить правку». +- Строку «Есть несохранённые изменения» в окне не пишут: правки и так + защищает вопрос при закрытии. + +## Из чего собрано + +| Часть | Компонент | Как задано | +|:---|:---|:---| +| Окно | [Окно](/ru/smart/overlays/modal/) | `heading` — действие; `initial-focus="first"`; `close-on-overlay="false"` — окно с полями не закрывается по затемнению | +| Сводка ошибок | [Сообщение](/ru/smart/feedback/alert/) | `status="error"` со ссылками на поля; обёртка с `tabindex="-1"` получает фокус; показывается от двух ошибок | +| Поля | [Текстовое поле](/ru/smart/forms/inputs/), [Выпадающий список](/ru/smart/navigation/dropdown/), [Флажок](/ru/smart/forms/checkbox/) | подпись над полем, одна колонка, `required` и `error-message` у обязательного | +| Ответы | [Кнопка](/ru/smart/actions/buttons/) | главная первой в начале: `native-type="submit"` и `form`; «Отмена» последней, `appearance="ghost"` `scheme="on-surface"`; между ними `gap-1/3` | +| Сохранение | [Кнопка](/ru/smart/actions/buttons/) | `loading` у главной, поля `readonly`, «Отмена» выключена, окно не закрывается | +| Закрыть без сохранения? | [Окно](/ru/smart/overlays/modal/) | второе окно `size="question"`: на `sf-modal-close` с правками — `preventDefault()` и вопрос; «Не сохранять» `status="danger"` первой, «Продолжить правку» тихая с фокусом | + +## Доступность + +Путь с клавиатуры: + +1. Tab до «Новая страница», Enter — окно открыто, курсор в «Название», + фокус не выходит из окна. +2. Tab по порядку: поля, «Создать страницу», «Отмена», крестик. +3. Enter в однострочном поле отправляет форму. Одна ошибка — фокус на + поле; две и больше — на сводку, её ссылки ведут к полям. +4. Escape без правок закрывает окно. С правками — открывает вопрос, фокус + на «Продолжить правку». После закрытия фокус возвращается на кнопку, + которая открыла окно. + +| Что | Что слышит человек с экранным диктором | Откуда | +|:---|:---|:---| +| Окно | диалог «Новая страница» | `heading` | +| Крестик | «Закрыть» | окно, на языке страницы | +| Поле с ошибкой | «Название, обязательное, недопустимое значение, Введите название страницы» | `required`, `invalid`, `error-message` | +| Сохранение | «Создать страницу, занято» | `loading` | +| Итог | «Страница «Насосы для дачи» создана» | строка с `role="status"` на странице | + +## Как делать + +:::example {id="recipes/dialog-form/do-dont" label="Как делать" preview=sandbox} +::: + +- **Главная кнопка не выключается.** Нажатая при ошибках, она показывает, + что не так, и ставит курсор в поле. Выключенная кнопка молчит, и человек + не понимает, чего от него ждут. +- **Окно с полями не закрывается по затемнению.** Случайный щелчок мимо + окна не должен терять набранное. +- **Ошибка — у поля.** Сводка над полями появляется только от двух ошибок + и ведёт к ним ссылками. + +## Копия для ИИ + +```html + + +
+ + + + +
+
+ + +
+
+ +

Название и адрес новой страницы пропадут.

+
+ + +
+
+``` + +## Где используется + +| Продукт | Экран | +|:---|:---| +| Larena, админка | новая страница, новый раздел каталога, переименование | +| SIMAI Pro | новая папка, свойства записи | +| Портал simai.io | новый сайт, приглашение в проект | + +## Что ещё в пути + +> **Появится в следующей версии.** Форма из описаний полей — со сводкой +> ошибок и проверкой сама по себе; вопрос «Закрыть без сохранения?» от +> самого окна, без второго окна на странице; шторка снизу и весь экран на +> телефоне по виду окна. Пока форма собирается из полей, а вопрос и +> раскладка на телефоне — правилами страницы, как в примерах выше. + +## См. также + +- [Окно](/ru/smart/overlays/modal/) — все настройки окна +- [Форма настроек](/ru/recipes/settings-form/) — когда полей больше пяти +- [Удаление](/ru/recipes/delete/) — окно опасного вопроса diff --git a/content/ru/recipes/dialog-form.page.json b/content/ru/recipes/dialog-form.page.json new file mode 100644 index 000000000..9524d3961 --- /dev/null +++ b/content/ru/recipes/dialog-form.page.json @@ -0,0 +1 @@ +{"schema": "docara.page.v1", "navigation": {"order": 160}} diff --git a/content/ru/recipes/empty-state.page.json b/content/ru/recipes/empty-state.page.json index 3410c46f5..cc9695435 100644 --- a/content/ru/recipes/empty-state.page.json +++ b/content/ru/recipes/empty-state.page.json @@ -1 +1 @@ -{"schema": "docara.page.v1", "navigation": {"order": 50}} +{"schema": "docara.page.v1", "navigation": {"order": 10}} diff --git a/content/ru/recipes/file-upload-progress.md b/content/ru/recipes/file-upload-progress.md new file mode 100644 index 000000000..e05ea6c2b --- /dev/null +++ b/content/ru/recipes/file-upload-progress.md @@ -0,0 +1,140 @@ +--- +title: "Загрузка файлов с прогрессом" +description: "Как добавить файлы и видеть долю каждого, ошибки с «Повторить» и большую пачку — одной панелью в углу экрана, не мешая работать." +--- + +# Загрузка файлов с прогрессом + +Человек прикладывает к записи документы и фото: к новости, в раздел +«Файлы», в сообщение чата, во вложения письма. Ему нужно видеть каждый +файл и его долю, сразу узнать, какой файл не подошёл и почему, и повторить +упавший. Большую пачку ждать не нужно: если файлов больше десяти или +загрузка займёт больше 30 секунд, строки сворачиваются в одну панель в +углу экрана, и можно работать дальше. + +## Пример + +Выберите, что происходит, или добавьте свои файлы — они «загрузятся» +понарошку. Больше десяти файлов или пачка дольше 30 секунд уходит в угол. + +:::example {id="recipes/file-upload-progress/overview" label="Документы к новости" preview=sandbox log="sf-file-upload-rejected sf-file-upload-retry sf-file-upload-detach sf-progress-run-cancel sf-progress-run-minimize sf-progress-run-retry" log_console=true log_open=false} +::: + +## Когда брать + +| Если | Так | +|:---|:---| +| Файлы прикладывают к записи, письму, сообщению | Этот рецепт | +| Файлов до десяти и загрузка короче 30 секунд | Строки в поле, у каждой своя доля | +| Файлов больше десяти или загрузка дольше 30 секунд | Строки сворачиваются в одну панель в углу экрана | +| Одна картинка записи | Поле одной картинки | +| Импорт с разбором на сервере: таблица, архив сайта | [Долгая операция](/ru/smart/feedback/progress-run/) | +| Загрузка идёт без человека, например синхронизация | Полоса или центр уведомлений | + +## Состояния + +:::example {id="recipes/file-upload-progress/states" label="Состояния" preview=sandbox} +::: + +## На телефоне + +Перетаскивать файлы на телефоне нечем — остаётся «Выберите файлы». Пачка в +углу становится панелью внизу экрана почти во всю ширину. Откройте пример +во весь экран и выберите ширину телефона. + +:::example {id="recipes/file-upload-progress/phone" label="Телефон" preview=sandbox} +::: + +## Плотность + +В админке поле файлов — в компактной плотности: +`data-sf-density="compact"` на корне экрана уменьшает зону, строки и +полосы доли на ступень. + +:::example {id="recipes/file-upload-progress/density" label="Плотность" preview=sandbox} +::: + +## Тексты + +| Случай | Так | Не так | +|:---|:---|:---| +| Не подошёл тип | «смета.zip: такие файлы нельзя — подойдут PDF, DOCX, XLSX, JPG, PNG» | «Неверный тип файла» | +| Слишком большой | «видео.mov: 340 МБ — больше 20 МБ» | «Файл слишком большой» | +| Упал | «Связь прервалась на 62 %» · «Повторить» | «Ошибка загрузки (ERR_NETWORK)» | +| Итог пачки | «Загружено 46 из 48. Два файла не загрузились.» · «Повторить» | «Готово с ошибками» | + +## Из чего собрано + +| Часть | Компонент | Как задано | +|:---|:---|:---| +| Зона с пунктирной рамкой и форматами | [Загрузка файлов](/ru/smart/forms/file-upload/) | `formats`, `accept`, `max-size`, `multiple` | +| Строка файла: значок типа, имя, размер, доля | [Загрузка файлов](/ru/smart/forms/file-upload/) | `items[]`: `state: 'process'`, `progress` | +| Не подошёл — сообщение под полем; упал — строка с причиной и «Повторить» | [Загрузка файлов](/ru/smart/forms/file-upload/) | событие `sf-file-upload-rejected`; `state: 'error'`, `errorMessage`, `retryText` | +| Пачка в углу: «N из M», осталось, отмена, свернуть | [Долгая операция](/ru/smart/feedback/progress-run/) | `look="notice"`, `total`, `value`, `remaining`, `cancelable`, `minimizable`; угол — место страницы | +| Когда уходить в угол | страница | больше 10 файлов или оценка дольше 30 секунд | +| Вложение в сообщении — кольцо доли у имени | [Кольцо прогресса](/ru/smart/feedback/progress-ring/) | `size="1/3"`, `value`, `label` | +| Конец пачки — короткое «Файлы загружены» | [`SF.notify`](/ru/guide/functions/actions/notify/) | `status: 'success'`; итог с ошибками остаётся в панели до крестика | + +## Доступность + +- Зона — кнопка выбора файлов с подписью и форматами; Enter и пробел + открывают выбор. +- В строке имя, размер и доля читаются вместе; доля — полоса прогресса со + значением. +- Ошибка строки — своим текстом; «Повторить» — кнопка с именем файла. +- Панель в углу не забирает фокус; конец объявляется сообщением + «Загружено 48 файлов». +- Путь клавиатуры: зона → строки (удалить, повторить) → панель в углу + (свернуть, отменить). + +## Как делать + +- **Причина — в строке файла.** «баннер.jpg: связь прервалась на 62 %» и + «Повторить» рядом, а не общее «Ошибка загрузки». +- **Большая пачка не держит человека.** Больше десяти файлов или дольше + 30 секунд — одна панель в углу, а не 48 строк в форме. +- **Успех — коротко, ошибки — до крестика.** «Файлы загружены» уходит само, + итог с ошибками ждёт, пока его прочтут. + +## Копия для ИИ + +```html + + + + +``` + +## Где используется + +- Запись и раздел «Файлы» в Larena. +- Сообщение в чате SIMAI Pro — кольцо у вложения. +- Вложения письма в почте. + +## Что ещё в пути + +> **Что ещё в пути.** Новый вид доли — дорожка, толщина и подпись над +> полосой — и доработки строк поля файлов появятся в следующей версии +> SIMAI Framework. Сворачивать строки в угол само поле не будет: это +> решает страница, как в примере. + +## См. также + +- [Загрузка файлов](/ru/smart/forms/file-upload/) — компонент +- [Долгая операция](/ru/smart/feedback/progress-run/) +- [Первый кадр страницы](/ru/recipes/first-paint/) diff --git a/content/ru/recipes/file-upload-progress.page.json b/content/ru/recipes/file-upload-progress.page.json new file mode 100644 index 000000000..12cb21b48 --- /dev/null +++ b/content/ru/recipes/file-upload-progress.page.json @@ -0,0 +1 @@ +{"schema": "docara.page.v1", "navigation": {"order": 20}} diff --git a/content/ru/recipes/first-paint.md b/content/ru/recipes/first-paint.md new file mode 100644 index 000000000..c34412f36 --- /dev/null +++ b/content/ru/recipes/first-paint.md @@ -0,0 +1,147 @@ +--- +title: "Первый кадр страницы" +description: "Как открыть страницу так, чтобы её форма была видна сразу: меню печатает сервер, список и плитки стоят скелетами на месте данных, а кнопка показывает работу сама." +--- + +# Первый кадр страницы + +Страница админки, почты или чата открывается за доли секунды или за +несколько секунд — по сети и по объёму. Человек должен сразу видеть, где +что будет, а не белый экран, и не терять место, на которое уже смотрит. +Меню печатает сервер — оно есть в первом кадре. Список и плитки стоят +скелетами ровно на месте будущих данных. Кнопка, которая обновляет данные, +показывает работу сама. + +## Пример + +Выберите скорость сети: пример повторит загрузку раздела «Новости». +Меню на месте с первого кадра, скелеты списка и плиток заменяются +данными без прыжков. «Обновить» показывает работу на самой кнопке. + +:::example {id="recipes/first-paint/overview" label="Новости" preview=sandbox log="sf-menu-navigate sf-empty-state-action" log_console=true log_open=false} +::: + +## Когда брать + +| Если | Так | +|:---|:---| +| Известна форма будущих данных: строки, плитки, карточки | Скелет на их месте | +| Загрузка иногда дольше 0,3 секунды | Скелет с первого кадра | +| Данные приходят частями | Каждая часть заменяет свой скелет | +| Меню и шапку печатает сервер | Без скелета: они есть в первом кадре | +| Кнопка запустила действие | Работа на кнопке — `loading` | +| Малое место без формы: значок файла, строка «Готовим файл…» | Спиннер с подписью | + +Никогда — спиннер на всю страницу или раздел: форма страницы не видна, +после загрузки всё прыгает, и человек не знает, сколько ждать. + +## Состояния + +:::example {id="recipes/first-paint/states" label="Состояния" preview=sandbox} +::: + +Если загрузка дольше 10 секунд, под скелетом появляется строка о том, что +происходит: «Загружаем 12 400 записей, это займёт около минуты». + +## На телефоне + +Меню уходит в кнопку, список занимает всю ширину; скелет тот же. Откройте +пример во весь экран и выберите ширину телефона. + +:::example {id="recipes/first-paint/phone" label="Телефон" preview=sandbox} +::: + +## Плотность + +В админке список — в компактной плотности: скелет берёт ту же высоту +строк, что и данные, и уменьшается вместе с ними. + +:::example {id="recipes/first-paint/density" label="Плотность" preview=sandbox} +::: + +## Тексты + +- Скелет ничего не пишет: «Загрузка…» не нужна, форма говорит сама. +- Спиннер отдельно — с подписью мелким текстом цвета пояснения: «Готовим + файл…». +- Долго, больше 10 секунд, — строка под скелетом: «Загружаем 12 400 + записей, это займёт около минуты». + +## Из чего собрано + +| Часть | Компонент | Как задано | +|:---|:---|:---| +| Меню | [Меню](/ru/smart/navigation/menu/) | печатает сервер в первом кадре; скелетом не рисуется | +| Скелет списка — сам список в загрузке | [Список](/ru/smart/content/list/) | `loading`; данные — `items`, затем снять `loading` | +| Скелет плитки — рамка плитки и строки текста | [Скелет](/ru/smart/feedback/skeleton/) | `kind="text"`, `size`, `width` в рамке плитки страницы | +| Пульс | [Скелет](/ru/smart/feedback/skeleton/) | `animation="pulse"` (по умолчанию) | +| Кнопка в работе | [Кнопка](/ru/smart/actions/buttons/) | `loading` | +| Спиннер в малом месте | [Спиннер](/ru/smart/feedback/spinner/) | `size="1/2"`, `label` и подпись рядом | +| Пусто и ошибка | [Пустое состояние](/ru/smart/feedback/empty-state/) | `kind="first-use"`, `kind="error"` | + +## Доступность + +- Область, которая грузится, отмечена как занятая; скелет скрыт от + чтения. +- Когда данные пришли, ничего не объявляется, фокус остаётся, где был. +- Кнопка в работе объявляет, что идёт работа; спиннер — область статуса с + подписью. +- При «меньше движения» в системе пульс останавливается. + +## Как делать + +:::example {id="recipes/first-paint/do-dont" label="Как делать" preview=sandbox} +::: + +- **Скелет — ровно место данных.** Сколько строк и какой высоты придёт, + столько и стоит в скелете. +- **Меню не грузят скелетом.** Сервер печатает его сразу; скелет строками + — только для меню, которое приходит отдельным запросом. +- **Работа кнопки — на кнопке.** Не всплывающее «Обновляем…» и не спиннер + рядом. + +## Копия для ИИ + +```html + + +
+ +
+ + +``` + +## Где используется + +- Админка Larena — разделы, списки, обзор. +- Почта и чат SIMAI Pro — список писем и диалогов. + +## Что ещё в пути + +> **Что ещё в пути.** В следующей версии SIMAI Framework список в загрузке +> будет рисовать скелет ровно по форме строк — с местом значка и второй +> строкой, — скелет текста станет по высоте букв, а скелет плитки сможет +> принять свою ширину и высоту. Сейчас список в загрузке чуть ниже, чем +> строки с данными, а скелет плитки собирают строками текста в её рамке, +> как в примере. + +## См. также + +- [Скелет](/ru/smart/feedback/skeleton/), [Спиннер](/ru/smart/feedback/spinner/) +- [Пустой раздел](/ru/recipes/empty-state/) +- [Загрузка файлов с прогрессом](/ru/recipes/file-upload-progress/) diff --git a/content/ru/recipes/first-paint.page.json b/content/ru/recipes/first-paint.page.json new file mode 100644 index 000000000..4e0ddcc5b --- /dev/null +++ b/content/ru/recipes/first-paint.page.json @@ -0,0 +1 @@ +{"schema": "docara.page.v1", "navigation": {"order": 30}} diff --git a/content/ru/recipes/hero-and-promo.md b/content/ru/recipes/hero-and-promo.md new file mode 100644 index 000000000..fddc9662d --- /dev/null +++ b/content/ru/recipes/hero-and-promo.md @@ -0,0 +1,170 @@ +--- +title: "Первый экран сайта и промо" +description: "Первый экран, который говорит, что это за сайт, и ведёт к главному действию; одна промо-плашка внутри страницы; текст на картинке." +--- + +# Первый экран сайта и промо + +Первый экран говорит, что это за сайт, и ведёт к главному действию: +крупный заголовок, одна мысль, две кнопки, спокойный узор. Внутри +страницы — одна промо-плашка с предложением. Это оформление сайта, а не +админки: в админке и формах его не берут. + +## Пример + +Первый экран главной simai.io и промо-плашка под ним. Переключите +«Строгий стиль» — узор и градиент в словах пропадут, останутся заголовок +и кнопки. Крестик скрывает промо-плашку. + +:::example {id="recipes/hero-and-promo/overview" label="Главная simai.io" preview=sandbox log_console=true log_open=false} +::: + +## Когда брать + +| Если | Так | +|:---|:---| +| Главная сайта, лендинг продукта | Первый экран с заголовком ступени `.title-9` | +| Страница входа, регистрации, внутренняя страница сайта | Первый экран ниже, заголовок ступени `.title-7` | +| Одно предложение внутри страницы или админки | Промо-плашка: тонированная поверхность, значок, текст, кнопка, крестик | +| Текст к фотографии | Подпись под картинкой; на самом фото — только мягкое затемнение снизу или плашка | +| Админка, таблицы, формы | Не брать. Вместо промо — [Сообщение](/ru/smart/feedback/alert/) `status="info"` | + +## Варианты + +### Вход и внутренние страницы + +На странице входа и внутренних страницах первый экран ниже и заголовок +на две ступени меньше — `.title-7`. + +:::example {id="recipes/hero-and-promo/variants" label="Вход в Larena" preview=sandbox} +::: + +### Текст на картинке + +По умолчанию подпись стоит под картинкой. На самом фото текст держит +мягкое затемнение снизу; на пёстром фото с длинной подписью — плашка. + +:::example {id="recipes/hero-and-promo/variants-2" label="Подпись и текст на фото" preview=sandbox} +::: + +## Состояния + +:::example {id="recipes/hero-and-promo/states" label="Состояния" preview=sandbox} +::: + +## На телефоне + +Откройте первый пример в ширине телефона. Заголовок `.title-9` сам +берёт телефонную ступень, кнопки встают столбиком во всю ширину. +У промо-плашки кнопка уходит под текст, крестик остаётся в углу. + +## Плотность + +Первый экран живёт на сайтах — в обычной плотности. Промо-плашка бывает +и в компактной админке Larena: кнопка и крестик на ступень меньше, текст +мельче. + +:::example {id="recipes/hero-and-promo/density" label="Обычная и компактная" preview=sandbox} +::: + +## Тексты + +- Надзаголовок — имя продукта или раздела: «SIMAI Framework 5», «Larena». +- Заголовок — одна мысль, что получит человек: «Сайты и админки на одной + основе». Градиент — только на одном–трёх словах. +- Под заголовком — одна фраза подробнее, без перечня всего подряд. +- Кнопки — действие и куда ведёт: «Начать», «Документация». +- Промо-плашка — одно предложение и одна кнопка: «Подключите свой + домен», «Подключить»; у крестика имя «Скрыть предложение». + +## Из чего собрано + +| Часть | Чем | Как задано | +|:---|:---|:---| +| Узор из бледных точек | оформление страницы | шаг линейки `--sf-space-1`, основной цвет прозрачности 24 (тёмная 32), гаснут к центру и под текстом | +| Надзаголовок | текст | мелкий, основной цвет, средний вес | +| Заголовок | `h1` с [утилитой размера текста](/ru/utilities/) | главная и лендинг — `.title-9`; вход и внутренние — `.title-7`; ступень сама меньше на телефоне; `text-wrap: balance` | +| Градиент в словах | оформление страницы | основной → фиолетовый, тон 50, в тёмной теме 80; без градиента в строгом стиле | +| Кнопки | [Кнопка](/ru/smart/actions/buttons/) | главная залитая, вторая `appearance="outline"`; промежуток 8 | +| Промо-плашка | поверхность `primary-container`, [Кнопка](/ru/smart/actions/buttons/), [Кнопка закрытия](/ru/smart/actions/close/) | одна мысль, одна кнопка, крестик скрывает | +| Текст на фото | затемнение шагами шкалы прозрачности | мягкое снизу: чёрный 64 → 48 → 12; плашка: чёрный 64 | + +## Доступность + +Путь с клавиатуры: + +1. Заголовок первого экрана — `h1` страницы, по нему прыгают клавишей + заголовков. Узор помечен `aria-hidden`. +2. Tab: «Начать», «Документация», затем «Подключить» и крестик плашки. +3. Крестик скрывает плашку и ставит фокус на заголовок, а не в пустоту. + +| Что | Что слышит человек с экранным диктором | Откуда | +|:---|:---|:---| +| Заголовок | «Сайты и админки на одной основе, заголовок 1» | `h1`; градиент не меняет текст | +| Плашка | область «Предложение» | `aria-label` у `aside` | +| Крестик | «Скрыть предложение» | `aria-label` | +| Фото | «Горы на закате» | `role="img"` и `aria-label` | + +## Как делать + +:::example {id="recipes/hero-and-promo/do-dont" label="Как делать" preview=sandbox} +::: + +- **Одна промо-плашка на страницу.** Три плашки подряд читаются как + реклама, и человек пропускает все. +- **Подпись — под картинкой.** Текст на фото — только когда без него + нельзя, и всегда на затемнении. +- **В админке — без оформления.** Узоры и градиенты — для сайтов; + админке нужны строгие компоненты. + +## Копия для ИИ + +```html + +
+
+

SIMAI Framework 5

+

Сайты и админки на одной основе

+

Компоненты, темы и рецепты для сайтов Larena, порталов и документации.

+
+ + +
+
+
+ +``` + +## Где используется + +| Продукт | Экран | +|:---|:---| +| simai.io | главная, страницы продуктов | +| Сайты на Larena | главная, лендинги, вход | +| Larena, админка | промо-плашка «Подключите свой домен» | + +## Что ещё в пути + +> **Появится в следующей версии.** Узор из бледных точек готовым классом, +> общий переключатель стиля темы «строгий / выразительный» и готовые +> классы затемнения под текстом на фото. Пока всё это — правила страницы +> на значениях системы, как в примерах. Картинки примеров придут из общего +> набора иллюстраций документации. + +## См. также + +- [Кнопка](/ru/smart/actions/buttons/) — главная и вторая кнопки +- [Сообщение](/ru/smart/feedback/alert/) — вместо промо в админке +- [Карточка](/ru/components/content/card/) — остальные предложения раздела diff --git a/content/ru/recipes/hero-and-promo.page.json b/content/ru/recipes/hero-and-promo.page.json new file mode 100644 index 000000000..68981f008 --- /dev/null +++ b/content/ru/recipes/hero-and-promo.page.json @@ -0,0 +1 @@ +{"schema": "docara.page.v1", "navigation": {"order": 270}} diff --git a/content/ru/recipes/index.md b/content/ru/recipes/index.md index 616df7c50..42f16f69f 100644 --- a/content/ru/recipes/index.md +++ b/content/ru/recipes/index.md @@ -16,19 +16,72 @@ description: "Готовые сборки типовых экранов адми [компонентов](/ru/components/) и [смарт-компонентов](/ru/smart/); здесь — как их ставить вместе. -## Экраны +## Рецепты по задачам + +Рецепты собраны по тому, что человек делает на экране: ждёт, ищет, +меняет, удаляет, узнаёт новое, переходит между разделами. + +### Прогресс и ожидание + +| Рецепт | Когда брать | Из чего собрано | +|:---|:---|:---| +| [Пустой раздел и первое действие](/ru/recipes/empty-state/) | в разделе ещё ничего нет или ничего не нашлось | пустое состояние, кнопка, список | +| [Загрузка файлов с прогрессом](/ru/recipes/file-upload-progress/) | файлы добавляют и ждут, пока они загрузятся | загрузка файлов, полоса и кольцо прогресса, уведомление | +| [Первый кадр страницы](/ru/recipes/first-paint/) | данные приходят не сразу, а форма страницы видна с первого кадра | заготовка, список, меню, спиннер | +| [Статус заказа или заявки](/ru/recipes/order-status/) | показать, на каком этапе заказ и что будет дальше | шаги, хронология | + +### Найти и выбрать | Рецепт | Когда брать | Из чего собрано | |:---|:---|:---| | [Список записей](/ru/recipes/resource-list/) | все записи одного вида: сайты, заказы, пользователи | заголовок страницы, поиск, сегментный переключатель, список, пустое состояние | +| [Фильтры в шторке](/ru/recipes/filter-drawer/) | отбор по трём признакам и больше | шторка, флажки, радиокнопки, теги, список | +| [Панель над списком](/ru/recipes/list-toolbar/) | поиск, фильтр, колонки и сохранённые виды над таблицей | поиск, сегментный переключатель, настройки, представление данных | +| [Низ списка](/ru/recipes/list-bottom/) | сколько всего записей, где я и как перейти дальше | постраничный переход, «Показать ещё», выпадающий список | +| [Выбор карточками](/ru/recipes/choice-cards/) | у каждого варианта есть описание, цена или срок | выбор карточками, радиокнопки, флажки | +| [Список писем и диалогов](/ru/recipes/mail-chat-list/) | входящие и беседы: от кого, о чём, что не прочитано | лента, аватар, заготовка | +| [Период для отчёта](/ru/recipes/report-period/) | цифры отчёта за выбранные дни | выбор даты с быстрыми вариантами, сегментный переключатель | + +### Изменить и сохранить + +| Рецепт | Когда брать | Из чего собрано | +|:---|:---|:---| | [Карточка записи](/ru/recipes/record-card/) | одна запись, которую смотрят и иногда правят | заголовок страницы, контекстное меню, карточка, список сведений, хронология | | [Форма настроек](/ru/recipes/settings-form/) | много настроек, которые сохраняют вместе | карточки, поля, радиокнопки, переключатели, кнопки, уведомление | +| [Сохранение и ошибки в форме](/ru/recipes/save-and-errors/) | ответ на «Сохранить»: занято, ошибки, чужая правка | кнопка, уведомление, поля, вкладки | +| [Оформление заказа](/ru/recipes/checkout/) | корзина, доставка, оплата и подтверждение по шагам | шаги, выбор карточками, дата, телефон, поля | +| [Окно с формой](/ru/recipes/dialog-form/) | короткая форма из двух-трёх полей поверх страницы | окно, поля, флажок, кнопки | +| [Оформление: цвет и тема](/ru/recipes/brand-theme/) | владелец сайта выбирает фирменный цвет и тему | выбор цвета, генератор темы, меню | + +### Удалить и отменить + +| Рецепт | Когда брать | Из чего собрано | +|:---|:---|:---| | [Удаление](/ru/recipes/delete/) | что-то удаляют: своё, общее или навсегда | список, уведомление с «Вернуть», подтверждение, окно | -| [Пустой раздел и первое действие](/ru/recipes/empty-state/) | в разделе ещё ничего нет или ничего не нашлось | пустое состояние, кнопка, список | -| [Фильтры в шторке](/ru/recipes/filter-drawer/) | отбор по трём признакам и больше | шторка, флажки, радиокнопки, теги, список | +| [Выбор строк и общие действия](/ru/recipes/bulk-actions/) | одно действие сразу с несколькими строками | представление данных, флажки, подтверждение, уведомление | + +### Сообщить + +| Рецепт | Когда брать | Из чего собрано | +|:---|:---|:---| | [Обзор с плитками](/ru/recipes/dashboard/) | первый экран: что сломалось и как идут дела | «Требует внимания», плитки показателей, хронология | | [Список уведомлений](/ru/recipes/notifications/) | события, которые ждут человека | кнопка с иконкой, поповер, сегментный переключатель, список по дням | | [Копирование](/ru/recipes/copy/) | ключ, команду, номер или ссылку переносят в другое место | кнопка копирования, блок кода, поле, таблица | +| [Какое сообщение выбрать](/ru/recipes/which-message/) | куда поставить сообщение: полоса, уведомление, окно | полоса уведомлений, уведомление, всплывающее сообщение, подтверждение | +| [Системная полоса](/ru/recipes/system-bar/) | сообщение для всего продукта: плановые работы, оплата | полоса уведомлений, кнопка | + +### Навигация + +| Рецепт | Когда брать | Из чего собрано | +|:---|:---|:---| +| [Каркас админки](/ru/recipes/admin-frame/) | приложение с разделами: столбец меню слева и шапка страницы | меню, заголовок страницы, хлебные крошки, шторка | +| [Шапка сайта](/ru/recipes/site-header/) | логотип, разделы, поиск, язык и тема в одной строке | шапка сайта, меню, поиск, выбор языка, кнопки с иконкой | + +### Оформление + +| Рецепт | Когда брать | Из чего собрано | +|:---|:---|:---| +| [Первый экран сайта и промо](/ru/recipes/hero-and-promo/) | первый экран говорит, что это за сайт, и ведёт к действию | заголовок, текст, кнопки | ## Как выбраны рецепты @@ -55,6 +108,12 @@ description: "Готовые сборки типовых экранов адми - **Когда брать** — и когда взять другой рецепт или компонент. - **Из чего собрано** — части со ссылками на их страницы и настройки, которые у них заданы. +- **Состояния** — загрузка, пусто, ошибка, только чтение: как экран выглядит, + когда всё идёт не по главному пути. +- **На телефоне** — что уходит в меню, что переносится на вторую строку. +- **Плотность** — обычная и компактная рядом. +- **Доступность** — путь с клавиатуры и что слышит человек с экранным + диктором. - **Как делать** — частые ошибки парами: правильный пример в зелёной рамке, неправильный в красной. - **Копия для ИИ** — разметка и правила одним блоком. Скопируйте его в задачу агенту целиком: правила в начале блока важнее примера под ними. diff --git a/content/ru/recipes/list-bottom.md b/content/ru/recipes/list-bottom.md new file mode 100644 index 000000000..f7362fe4b --- /dev/null +++ b/content/ru/recipes/list-bottom.md @@ -0,0 +1,153 @@ +--- +title: "Низ списка" +description: "Что стоит под списком: сколько всего и где я, размер страницы и переход — номерами, полем страницы, «Дальше» или «Показать ещё»." +--- + +# Низ списка + +Под списком человек видит, сколько всего записей и где он сейчас, и +переходит дальше. Как переходить, зависит от списка: в админке — поле +номера страницы, в каталоге — номера-ссылки, в ленте — «Показать ещё». + +## Пример + +Заказы магазина в админке. Перейдите на другую страницу стрелкой или +впишите номер в поле. «По 20» меняет размер страницы и возвращает на +первую. Переключите вид над списком, чтобы сравнить низ каталога и ленты. + +:::example {id="recipes/list-bottom/overview" label="Заказы" preview=sandbox log="sf-pagination-change sf-pagination-load-more sf-button-select change" log_console=true log_open=false} +::: + +## Когда брать + +| Список | Низ | +|:---|:---| +| Таблица или список в админке, число записей известно | Одна строка: «41–60 из 240 · По 20 ▾ · ‹ [3] из 12 ›», вид `field` | +| Каталог, поиск по сайту | Номера-ссылки `numbers`: ссылки `?page=` от сервера работают и без скрипта; до семи мест, на телефоне пять | +| Число страниц неизвестно | «Назад / Далее», вид `arrows`, `count-known="false"` и `has-next` | +| Сервер отдаёт страницы курсором, без последней | «В начало · Дальше», вид `cursor` | +| Лента, письма, комментарии | «Показать ещё», вид `more` — отдельно, не в одной строке со стрелками | +| Карточка записи или статья | Не низ списка, а [Соседний документ](/ru/smart/navigation/pager/): «‹ 3 из 240 ›» или «предыдущая / следующая» | + +## Состояния + +:::example {id="recipes/list-bottom/states" label="Состояния низа" preview=sandbox} +::: + +## На телефоне + +Откройте пример в ширине телефона. Строка админки не помещается в одну +строку и встаёт в две: сверху диапазон «1–20 из 340» и «По 20», снизу +переход по страницам по центру. Номера каталога сокращаются до пяти мест, +«Показать ещё» стоит по центру. + +:::example {id="recipes/list-bottom/phone" label="Низ списка на телефоне" preview=sandbox} +::: + +## Плотность + +В админке низ компактный: кнопки и поле ступени 1/2, кнопки ближе друг к +другу. На сайте — обычная ступень. + +:::example {id="recipes/list-bottom/density" label="Обычная и компактная" preview=sandbox} +::: + +## Тексты + +- Диапазон — простой строкой: «41–60 из 240», без слова «Всего». +- Оценка — с тильдой: «~12 000»; точное число — по кнопке «Показать + число». +- Размер страницы — «По 20», меню «По 10, По 20, По 50, По 100». +- Ошибка подгрузки называет, что не пришло: «Не удалось загрузить ещё 20 + писем», кнопка «Повторить». + +## Из чего собрано + +| Часть | Компонент | Как задано | +|:---|:---|:---| +| Диапазон | строка страницы | «41–60 из 240» тихим цветом, цифры одной ширины | +| Размер страницы | [Кнопка](/ru/smart/actions/buttons/) | `appearance="ghost"` `scheme="on-surface"` с `menu`; выбор — событие `sf-button-select`, страница возвращается на первую | +| Переход | [Пагинация](/ru/smart/navigation/pagination/) | `appearance` по списку, `total`, `page-size`, `current`; `show-page-size="false"` — размер страницы стоит отдельной кнопкой | +| Показать ещё | [Пагинация](/ru/smart/navigation/pagination/) | `appearance="more"`; пока грузится — `show-more-busy`; событие `sf-pagination-load-more` | +| Пусто | [Пустой раздел](/ru/smart/feedback/empty-state/) | `kind="nothing-found"`; низа нет | +| Строка на телефоне | правило страницы | переход — отдельной строкой по центру, `flex-basis: 100%` | + +## Доступность + +Путь с клавиатуры: + +1. После последней строки списка: «По 20» — Enter открывает меню, стрелки + и Enter выбирают; дальше «В начало», «Назад», поле страницы, «Далее», + «В конец». +2. В поле страницы — число и Enter. Неверное число возвращает текущую + страницу. +3. После перехода фокус остаётся на нажатой кнопке; после «Показать ещё» + — переходит на первую новую строку. + +| Что | Что слышит человек с экранным диктором | Откуда | +|:---|:---|:---| +| Переход | навигация «Страницы заказов» | `aria-label` | +| Номер страницы | «Страница 5, текущая» | пагинация | +| Погасшая «Назад» | «Предыдущая страница, недоступно» | пагинация | +| Размер | «По 20, меню» | кнопка с `menu` | + +## Как делать + +:::example {id="recipes/list-bottom/do-dont" label="Как делать" preview=sandbox} +::: + +- **Кнопки на краях гаснут, а не пропадают.** Ряд не меняет ширину, и + палец не промахивается. +- **Пусто — без низа.** Диапазон «0 из 0» и погасшие стрелки ничего не + говорят; пустое состояние говорит, что делать. +- **Номера каталога — ссылками.** Поисковики и люди без скрипта + переходят по `?page=`. + +## Копия для ИИ + +```html + +
+ 41–60 из 240 + +
+
+ +``` + +## Где используется + +| Продукт | Экран | +|:---|:---| +| Larena, админка | заказы, страницы, пользователи — поле страницы или курсор | +| Сайты и магазины на Larena и Битрикс | каталог и поиск — номера-ссылки | +| SIMAI Pro, почта и чат | список писем — «Показать ещё» | + +## Что ещё в пути + +> **Появится в следующей версии.** Низ списка одной строкой — диапазон, +> размер и переход — станет частью самого списка, и собирать его руками +> не придётся. Кнопки «В начало · Назад» и «Далее · В конец» у поля +> страницы получат промежуток, как у остальных кнопок; сейчас они стоят +> вплотную. + +## См. также + +- [Пагинация](/ru/smart/navigation/pagination/) — все виды и настройки +- [Соседний документ](/ru/smart/navigation/pager/) — переход между записями и статьями +- [Список записей](/ru/recipes/resource-list/) — весь экран списка diff --git a/content/ru/recipes/list-bottom.page.json b/content/ru/recipes/list-bottom.page.json new file mode 100644 index 000000000..6eed3712f --- /dev/null +++ b/content/ru/recipes/list-bottom.page.json @@ -0,0 +1 @@ +{"schema": "docara.page.v1", "navigation": {"order": 80}} diff --git a/content/ru/recipes/list-toolbar.md b/content/ru/recipes/list-toolbar.md new file mode 100644 index 000000000..456feb6a1 --- /dev/null +++ b/content/ru/recipes/list-toolbar.md @@ -0,0 +1,145 @@ +--- +title: "Панель над списком" +description: "Поиск, фильтр, колонки, сохранённые виды, переключатель «таблица / список» и «Добавить» с меню — одна панель над длинным списком записей." +--- + +# Панель над списком + +Над длинным списком записей стоит одна панель. По ней человек находит +запись по названию, отбирает по условиям, выбирает колонки, возвращается к +своему сохранённому виду, переключает таблицу и список и создаёт запись. +Частое «Добавить товар» — одним нажатием, редкие «Добавить раздел» и +«Загрузить из файла» — в меню той же кнопки. + +## Пример + +Наберите в поиске «пуэр», откройте фильтр или колонки, выберите +сохранённый вид в кнопке «Все товары». Переключатель над примером +показывает, как панель и таблица выглядят в других состояниях. + +:::example {id="recipes/list-toolbar/overview" label="Товары" preview=sandbox log="sf-button-select sf-settings-change sf-settings-reset sf-view-table-apply" log_console=true log_open=false} +::: + +Таблица — компонент [Представление данных](/ru/pro/admin/table/) набора Pro: +своя панель у неё выключена (`toolbar="false"`), панель над ней собирает +страница. + +## Когда брать + +| Если | Так | +|:---|:---| +| Записей больше, чем помещается на экран, и их ищут | Поиск и фильтр | +| Человек возвращается к своим выборкам | Сохранённые виды — кнопка с меню после фильтра и колонок | +| Создают записи двух-трёх видов, один из них частый | «Добавить …» с меню | +| Записей до двадцати | Хватит поиска; фильтр и колонки лишние | +| Поиск по всему продукту | Поиск в шапке, не над списком | +| Выбраны строки | Вместо панели — строка выбора: [Выбор строк и общие действия](/ru/recipes/bulk-actions/) | + +## Состояния + +:::example {id="recipes/list-toolbar/states" label="Состояния" preview=sandbox} +::: + +## На телефоне + +На телефоне — только список. Поиск занимает всю строку; фильтр, колонки и +«Добавить» — значками, их панели открываются шторкой снизу. Откройте пример +во весь экран и выберите ширину телефона. + +:::example {id="recipes/list-toolbar/phone" label="Телефон" preview=sandbox} +::: + +## Плотность + +Списки в админке — в компактной плотности: `data-sf-density="compact"` на +корне экрана уменьшает поле, кнопки и промежутки панели на ступень. + +:::example {id="recipes/list-toolbar/density" label="Плотность" preview=sandbox} +::: + +## Тексты + +- **Подсказка поиска** — по чему ищет: «Найти по названию или артикулу». +- **Главная кнопка** — что создаёт: «Добавить товар»; в меню — «Добавить + раздел», «Загрузить из файла». +- **Сохранённый вид** — именем человека: «Мои черновики», «Нет на складе». +- **Пустой поиск** — что не нашлось и что сделать: «Ничего не нашлось. + Уберите условие фильтра». + +## Из чего собрано + +| Часть | Компонент | Как задано | +|:---|:---|:---| +| Поиск — залитое поле | [Текстовое поле](/ru/smart/forms/inputs/) | `appearance="filled"` `icon-start="search"` `input-type="search"`, `aria-label` | +| Фильтр: «Применить (N)» и «Сбросить» | [Настройки](/ru/smart/navigation/settings/) | `look="panel"` `apply="button"`; кнопка внутри — вход | +| Колонки: отметка, порядок, закрепление, поиск; применяются сразу | [Настройки](/ru/smart/navigation/settings/) | `look="panel"` `search`, пункт `type: 'fields'` | +| Сохранённые виды — после фильтра и колонок | [Кнопка](/ru/smart/actions/buttons/) | `menu`; выбранный вид — в `text`; «Сохранить как вид…» последним | +| Таблица или список | [Сегментный переключатель](/ru/smart/actions/segmented/) | меняет `layout` таблицы; выбор хранится в виде | +| «Добавить товар» с меню | [Кнопка](/ru/smart/actions/buttons/) | `split`, `menu` — редкие действия | +| Таблица | [Представление данных](/ru/pro/admin/table/) | `toolbar="false"`, `quick-actions`, `row-actions-visible="hover"` | +| Промежутки | страница | кнопки группы через 8 (`gap-1/3`), группы через 16 (`gap-1`) | + +## Доступность + +- Поле поиска с именем «Поиск по товарам»; результат объявляется: «Найдено + 12 товаров». +- «Добавить товар» с меню — две остановки Tab: действие и стрелка меню; + стрелка сообщает, что открывает меню. +- Переключатель вида — группа переключателей, стрелки ← →. +- Панели открываются кнопкой; Esc закрывает и возвращает фокус на кнопку. +- Путь клавиатуры: поиск → фильтр → колонки → виды → вид списка → + «Добавить» → стрелка меню → таблица. + +## Как делать + +- **Одна главная кнопка на панели.** Остальные — с рамкой; редкое создание + — в меню главной. +- **Виды — по имени.** Кнопка показывает имя текущего вида, а не «Виды». +- **Кнопки одной группы — через 8, группы — через 16.** Поиск, настройки + списка и создание — три группы. + +## Копия для ИИ + +```html + +
+
+
+ + + +
+
+ + +
+
+ +``` + +## Где используется + +- Списки записей в админке Larena: товары, новости, страницы. +- Таблицы SIMAI Pro. + +## Что ещё в пути + +> **Что ещё в пути.** Меню действий строки сейчас открывается в компактной +> плотности, даже когда таблица в обычной; в следующей версии SIMAI +> Framework оно будет того же размера, что и таблица. Своя панель +> представления данных пока рисует поиск и настройки по-своему, поэтому в +> рецепте она выключена. + +## См. также + +- [Выбор строк и общие действия](/ru/recipes/bulk-actions/) +- [Список записей](/ru/recipes/resource-list/), [Фильтры в шторке](/ru/recipes/filter-drawer/) +- [Настройки](/ru/smart/navigation/settings/), [Представление данных](/ru/pro/admin/table/) diff --git a/content/ru/recipes/list-toolbar.page.json b/content/ru/recipes/list-toolbar.page.json new file mode 100644 index 000000000..a4195afd5 --- /dev/null +++ b/content/ru/recipes/list-toolbar.page.json @@ -0,0 +1 @@ +{"schema": "docara.page.v1", "navigation": {"order": 70}} diff --git a/content/ru/recipes/mail-chat-list.md b/content/ru/recipes/mail-chat-list.md new file mode 100644 index 000000000..4d271bc7b --- /dev/null +++ b/content/ru/recipes/mail-chat-list.md @@ -0,0 +1,147 @@ +--- +title: "Список писем и диалогов" +description: "Входящие и беседы по дням: от кого, о чём, что не прочитано и что ждёт ответа, «Показать ещё» внизу и первый кадр в размер строк." +--- + +# Список писем и диалогов + +Входящие письма и беседы, разложенные по дням. Человек сразу видит, кто +писал, о чём, что не прочитано и что ждёт ответа. Внизу — «Показать +ещё», а пока список грузится, строки стоят заготовкой своего размера. + +## Пример + +Почта SIMAI. Нажмите на строку — письмо откроется справа, а число +непрочитанных у строки пропадёт. «Показать ещё» внизу подгрузит прошлую +неделю. «⋯» у строки открывает действия: «Прочитано», «В архив», +«Удалить». + +:::example {id="recipes/mail-chat-list/overview" label="Входящие" preview=sandbox log="sf-list-open sf-list-load-more sf-list-apply" log_console=true log_open=false} +::: + +## Когда брать + +| Если | Так | +|:---|:---| +| Письма, беседы, уведомления — по времени и с отправителем | Этот рецепт: [Список](/ru/smart/content/list/) с группами по дням | +| Сообщения внутри одной беседы | [Лента](/ru/smart/content/list-feed/): старые сверху, свои справа | +| Файлы и версии — без людей | [Список](/ru/smart/content/list/) со значками и группами по ключу | +| Письма с колонками — рассылки, отчёты | Таблица; низ — рецепт «Низ списка» | + +## Состояния + +:::example {id="recipes/mail-chat-list/states" label="Состояния списка" preview=sandbox} +::: + +## На телефоне + +Откройте первый пример в ширине телефона. Остаётся только список, +письмо открывается своей страницей. Строки не переносятся: длинная тема +обрезается, число непрочитанных стоит у края. + +## Плотность + +Почта и чат Pro на компьютере — компактные: строки ниже, аватар меньше, +текст мельче. На телефоне — обычная плотность. + +:::example {id="recipes/mail-chat-list/density" label="Обычная и компактная" preview=sandbox} +::: + +## Тексты + +- Первая строка — кто писал: имя человека или название компании. +- Вторая — тема и начало письма: «Договор поставки на декабрь — пришлю + после обеда». +- Дни — словами: «Сегодня», «Вчера», дальше дата. +- Ждёт ответа — короткая метка «Ждёт». +- Пусто — «Во входящих пусто»; ошибка — «Не удалось загрузить письма. + Сервер почты не ответил. Письма на месте». + +## Из чего собрано + +| Часть | Компонент | Как задано | +|:---|:---|:---| +| Список | [Список](/ru/smart/content/list/) | `group-by="day"`, `sticky-headings`, `no-wrap`; `selected` — открытое письмо | +| Аватар | [Аватар](/ru/smart/content/avatar/) | поле строки `avatar`: `{text: "АБ"}` — инициалы на оттенке, `{icon: "smart_toy"}` — бот, `shape: "square"` — компания или рассылка | +| Отправитель и тема | [Список](/ru/smart/content/list/) | `text` — отправитель, `supporting` — тема и начало письма | +| Непрочитанные | [Список](/ru/smart/content/list/) | `count` — число в конце строки; ждёт ответа — `badge` «Ждёт»; закреплённое — `pinned` | +| Действия строки | [Список](/ru/smart/content/list/) | `actions`: «Прочитано», «В архив», «Удалить» (`destructive`) | +| Показать ещё | [Список](/ru/smart/content/list/) | `has-more` и событие `sf-list-load-more` | +| Первый кадр | [Список](/ru/smart/content/list/) | `loading` — строки заготовкой | +| Переписка | [Лента](/ru/smart/content/list-feed/) | сообщения открытой беседы | + +## Доступность + +Путь с клавиатуры: + +1. Список — одна остановка Tab; стрелки вверх и вниз — по строкам, Enter + открывает письмо. +2. Shift+F10 или клавиша меню открывает действия строки; «⋯» — для мыши + и касания. +3. По заголовкам дней «Сегодня», «Вчера» можно прыгать клавишей + заголовков. +4. После «Показать ещё» фокус остаётся на месте, новые строки + объявляются. + +| Что | Что слышит человек с экранным диктором | Откуда | +|:---|:---|:---| +| Строка | «Анна Белова, Договор поставки на декабрь — пришлю после обеда, 3 непрочитанных» | `text`, `supporting`, `count` | +| Открытое письмо | «текущее» | `selected` | +| Подгрузка | «Загружено ещё 4 письма» | список | + +## Как делать + +:::example {id="recipes/mail-chat-list/do-dont" label="Как делать" preview=sandbox} +::: + +- **Непрочитанное — полужирным именем отправителя.** Число в конце — + только у бесед, где новых больше одного; цвет один не говорит. +- **Время — по дням.** Заголовки «Сегодня», «Вчера» заменяют дату в + каждой строке. +- **Первый кадр — строки, а не крутилка.** Заготовка того же размера не + сдвигает список, когда приходят письма. + +## Копия для ИИ + +```html + +
+ +
+ +``` + +## Где используется + +| Продукт | Экран | +|:---|:---| +| Почта SIMAI | входящие, папки | +| SIMAI Pro, чат | список бесед | +| Портал simai.io | уведомления | + +## Что ещё в пути + +> **Появится в следующей версии.** Непрочитанное у строки — полужирное +> имя отправителя, как решено для списков; сейчас строка показывает +> только число непрочитанных. Время письма в конце строки — сейчас время +> идёт только в группы по дням. + +## См. также + +- [Список](/ru/smart/content/list/) — все настройки списка +- [Лента](/ru/smart/content/list-feed/) — сообщения внутри беседы +- [Аватар](/ru/smart/content/avatar/) — инициалы и оттенки diff --git a/content/ru/recipes/mail-chat-list.page.json b/content/ru/recipes/mail-chat-list.page.json new file mode 100644 index 000000000..ab6f40204 --- /dev/null +++ b/content/ru/recipes/mail-chat-list.page.json @@ -0,0 +1 @@ +{"schema": "docara.page.v1", "navigation": {"order": 100}} diff --git a/content/ru/recipes/notifications.page.json b/content/ru/recipes/notifications.page.json index 6eed3712f..efc54d126 100644 --- a/content/ru/recipes/notifications.page.json +++ b/content/ru/recipes/notifications.page.json @@ -1 +1 @@ -{"schema": "docara.page.v1", "navigation": {"order": 80}} +{"schema": "docara.page.v1", "navigation": {"order": 210}} diff --git a/content/ru/recipes/order-status.md b/content/ru/recipes/order-status.md new file mode 100644 index 000000000..7220b19fe --- /dev/null +++ b/content/ru/recipes/order-status.md @@ -0,0 +1,147 @@ +--- +title: "Статус заказа или заявки" +description: "Как показать, где сейчас заказ или заявка: этапы столбцом с датами, задержка и отмена уведомлением сверху, история изменений ниже." +--- + +# Статус заказа или заявки + +Покупатель открывает свой заказ, сотрудник — свою заявку. Им нужно одним +взглядом понять, на каком этапе дело, когда прошли прежние этапы и когда +ждать следующего, почему задержка или отмена, а ниже — кто что изменил. +Этапы здесь не нажимаются: это не решения человека, а ход дела. + +## Пример + +Выберите, что ответил сервер о заказе. При задержке и отмене сверху +появляется уведомление с причиной; у отменённого заказа этап отмены +отмечен ошибкой, а следующие этапы — пунктиром. + +:::example {id="recipes/order-status/overview" label="Заказ № 48 215" preview=sandbox log="sf-list-timeline-navigate sf-list-timeline-expand" log_console=true log_open=false} +::: + +## Когда брать + +| Если | Так | +|:---|:---| +| У дела постоянный порядок этапов (три–шесть), и человек ждёт следующего | Этот рецепт | +| Важны даты: когда прошло и когда ждать | Этот рецепт, дата под каждым этапом | +| Этапы проходит сам человек | [Оформление заказа](/ru/recipes/checkout/) или мастер по шагам | +| Идёт работа сервера с долей | [Долгая операция](/ru/smart/feedback/progress-run/) | +| Этапов нет, есть только события | Одна [лента событий](/ru/smart/content/list-timeline/) | + +## Варианты + +### Отменённый заказ + +Пройденные этапы остаются пройденными. Этап, на котором заказ отменили, +отмечен ошибкой, причина — в подписи под ним. Следующие этапы — пунктиром: +до них дело не дойдёт. Сверху — уведомление с причиной и тем, что будет +дальше. + +:::example {id="recipes/order-status/variants" label="Отменённый заказ" preview=sandbox} +::: + +### Заявка в плотной карточке + +В карточке заявки, где статус — одна из многих частей, этапы рисуют +точками и меньшим размером. + +:::example {id="recipes/order-status/variants-2" label="Заявка на отпуск" preview=sandbox} +::: + +## Состояния + +:::example {id="recipes/order-status/states" label="Состояния" preview=sandbox} +::: + +## На телефоне + +Этапы и история встают друг под другом; этапы остаются столбцом, как на +компьютере. Откройте пример во весь экран и выберите ширину телефона. + +:::example {id="recipes/order-status/phone" label="Телефон" preview=sandbox} +::: + +## Плотность + +Карточка заказа в админке — в компактной плотности: `data-sf-density="compact"` +на корне экрана уменьшает этапы вместе с остальными частями. + +:::example {id="recipes/order-status/density" label="Плотность" preview=sandbox} +::: + +## Тексты + +| Место | Так | Не так | +|:---|:---|:---| +| Этап | «Передан в службу доставки» | «SHIPPED», «Статус 3» | +| Дата пройденного | «12 ноября, 15:40» | «12.11.2026 15:40:07» | +| Ожидаемое | «ожидается 15 ноября» | «ETA 15.11» | +| Задержка | «Доставка задерживается до 17 ноября: склад перевозчика переполнен.» | «Возможны задержки» | +| Отмена | «Заказ отменён 12 ноября» · «Деньги вернутся на карту за 3 дня» | «Заказ аннулирован» | + +## Из чего собрано + +| Часть | Компонент | Как задано | +|:---|:---|:---| +| Этапы столбцом, дата под каждым | [Шаги](/ru/smart/navigation/steps/) | `layout="column"`, `items[].text`; ожидаемая дата — «ожидается …» | +| Пройден, текущий, впереди, ошибка, пропущен | [Шаги](/ru/smart/navigation/steps/) | `current`, `items[].state`: `error`, `skipped` | +| Этапы не нажимаются | [Шаги](/ru/smart/navigation/steps/) | без `navigation` | +| Статус в плотной карточке — точками | [Шаги](/ru/smart/navigation/steps/) | `marker="dot"`, `size="1/2"` | +| История: кто, что, когда; «было → стало»; длинная серия свёрнута | [Лента событий](/ru/smart/content/list-timeline/) | `items[].actor`, `change`, `collapse` | +| Задержка или отмена — над этапами | [Уведомление](/ru/smart/feedback/alert/) | `status="warning"` или `"error"`, причина в `supporting-text` | + +## Доступность + +- Этапы — нумерованный список с именем «Статус заказа»; текущий отмечен + как текущий шаг; у каждого этапа слово состояния: «пройден», «текущий», + «впереди», «ошибка», «пропущен». +- Этапы не нажимаются и не попадают в обход Tab. +- История — список с именем; время читается полной датой. +- Уведомление о задержке или отмене не забирает фокус и читается первым: + оно стоит над этапами. + +## Как делать + +- **Отмену не прячут в подписи.** Сверху — уведомление с причиной и тем, + что будет с деньгами; этап отмены — ошибкой. +- **Будущие этапы отменённого заказа — пунктиром,** а не пустыми: пустой + этап читается как «ещё будет». +- **Этапы — это не кнопки.** Ход дела не нажимают; действия с заказом — + отдельными кнопками карточки. + +## Копия для ИИ + +```html + + + + + +``` + +## Где используется + +- Карточка заказа магазина на Larena — для покупателя и менеджера. +- Заявка на портале — отпуск, пропуск, закупка. + +## См. также + +- [Оформление заказа](/ru/recipes/checkout/) +- [Шаги](/ru/smart/navigation/steps/), [Лента событий](/ru/smart/content/list-timeline/) +- [Какое сообщение выбрать](/ru/recipes/which-message/) diff --git a/content/ru/recipes/order-status.page.json b/content/ru/recipes/order-status.page.json new file mode 100644 index 000000000..23d71cd65 --- /dev/null +++ b/content/ru/recipes/order-status.page.json @@ -0,0 +1 @@ +{"schema": "docara.page.v1", "navigation": {"order": 40}} diff --git a/content/ru/recipes/record-card.page.json b/content/ru/recipes/record-card.page.json index 12cb21b48..4710c8aa8 100644 --- a/content/ru/recipes/record-card.page.json +++ b/content/ru/recipes/record-card.page.json @@ -1 +1 @@ -{"schema": "docara.page.v1", "navigation": {"order": 20}} +{"schema": "docara.page.v1", "navigation": {"order": 120}} diff --git a/content/ru/recipes/report-period.md b/content/ru/recipes/report-period.md new file mode 100644 index 000000000..7ed1f53c2 --- /dev/null +++ b/content/ru/recipes/report-period.md @@ -0,0 +1,173 @@ +--- +title: "Период для отчёта" +description: "Выбрать период отчёта одним полем — быстрым вариантом или двумя датами; на бронировании — два поля, заезд и выезд." +--- + +# Период для отчёта + +Выбрать, за какое время показать отчёт: «7 дней», «Прошлый месяц» или +свои даты. Период — одно поле «с – по» с быстрыми вариантами. Когда даты +— два разных решения человека, как заезд и выезд в гостинице, полей два. + +## Пример + +Отчёт по заказам магазина в админке Larena. Откройте поле «Период» и +выберите быстрый вариант или две даты в календаре — цифры отчёта +пересчитаются. «По дням», «По неделям», «По месяцам» меняют шаг отчёта. + +:::example {id="recipes/report-period/overview" label="Отчёт по заказам" preview=sandbox log="sf-input-date-change change" log_console=true log_open=false} +::: + +## Когда брать + +| Если | Так | +|:---|:---| +| Отчёт, журнал, фильтр списка по датам | Одно поле периода с быстрыми вариантами — этот рецепт | +| Бронирование: заезд и выезд — разные решения гостя | Два поля дат; выезд не раньше заезда; «3 ночи» под полями | +| Одна дата | [Выбор даты](/ru/smart/forms/datepicker/) без `range` | +| Только месяц или год | `context="month"` или `context="year"` | + +Быстрые варианты отчёта: «Сегодня», «Вчера», «7 дней», «30 дней», «Этот +месяц», «Прошлый месяц». По умолчанию — 7 дней. «Эта неделя» в отчёт не +входит: в понедельник она почти пустая. + +## Варианты + +### Заезд и выезд + +Выберите заезд — выезд не даст выбрать день раньше следующего, а под +полями появится число ночей. + +:::example {id="recipes/report-period/variants" label="Бронирование номера" preview=sandbox log="sf-input-date-change" log_console=true log_open=false} +::: + +## Состояния + +:::example {id="recipes/report-period/states" label="Состояния периода" preview=sandbox} +::: + +## На телефоне + +Откройте первый пример в ширине телефона и нажмите на поле. Период +выбирается в шторке снизу: строка дней недели закреплена, месяцы идут +друг под другом, внизу — выбранный период и «Готово». + +> **Появится в следующей версии.** В шторке на телефоне — те же быстрые +> варианты, что на компьютере: «Сегодня, Вчера, 7 дней, 30 дней, Этот +> месяц, Прошлый месяц». Сейчас шторка показывает только ленту месяцев. + +## Плотность + +Отчёты в админке — компактные, сайт бронирования — в обычной плотности. + +:::example {id="recipes/report-period/density" label="Обычная и компактная" preview=sandbox} +::: + +## Тексты + +- Подпись поля — «Период»; у бронирования — «Заезд» и «Выезд». +- Быстрые варианты — коротко: «7 дней», «30 дней», а не «Последние 7 + дней». +- Ошибка говорит предел и куда идти дальше: «Не больше года: отчёт за два + года — в разделе «Сводка»». +- Пусто — что сделать: «Выберите период длиннее или «Прошлый месяц»». +- Под полями бронирования — число ночей словами: «3 ночи». + +## Из чего собрано + +| Часть | Компонент | Как задано | +|:---|:---|:---| +| Период | [Выбор даты](/ru/smart/forms/datepicker/) | `range`; `start-value`, `end-value`; ввод по маске языка; выходные красным | +| Быстрые варианты | [Выбор даты](/ru/smart/forms/datepicker/) | свойство `presets` — записи `{id, label, relative}` с короткими подписями «7 дней», «30 дней»; `preset="last-7-days"` | +| Шаг отчёта | [Сегментный переключатель](/ru/smart/actions/segmented/) | «По дням», «По неделям», «По месяцам»; той же высоты, что поле | +| Предел | [Выбор даты](/ru/smart/forms/datepicker/) | `max-date` — сегодня; `invalid` и `error-message` для слишком длинного периода | +| Цифры отчёта | [Плитка с числом](/ru/smart/content/tile-metric/) | `label`, `value`; объявляются через `aria-live` | +| Заезд и выезд | [Выбор даты](/ru/smart/forms/datepicker/) | два поля; выбор заезда ставит `min-date` выезда | + +## Доступность + +Путь с клавиатуры: + +1. Tab в поле: даты вводятся с клавиатуры по маске языка — «08.11.2026 – + 14.11.2026». Alt+↓ или кнопка календаря открывает окно. +2. В окне: сначала быстрые варианты, затем сетка дней. Стрелки — по + дням, PageUp и PageDown — по месяцам, Enter — начало, второй Enter — + конец. Escape закрывает окно и возвращает фокус в поле. +3. Новые цифры отчёта объявляются сами; ошибка читается как описание + поля. + +| Что | Что слышит человек с экранным диктором | Откуда | +|:---|:---|:---| +| Поле | «Период, с 8 по 14 ноября 2026» | `label`, значение | +| День в календаре | «Суббота, 15 ноября, выходной» | выбор даты | +| Пересчёт | «Заказы: 217» | область `aria-live="polite"` | +| Число ночей | «3 ночи» | строка с `role="status"` | + +## Как делать + +:::example {id="recipes/report-period/do-dont" label="Как делать" preview=sandbox} +::: + +- **Одно поле для периода отчёта.** Два поля — только когда даты + выбирают отдельно, как заезд и выезд. +- **Будущего в отчёте нет.** `max-date` — сегодня: пустые дни после + сегодняшнего только путают. +- **Только чтение — без календаря.** Поле, которое нельзя менять, окно + не открывает. + +## Копия для ИИ + +```html + +
+ + +
+ + +
+
+ +``` + +## Где используется + +| Продукт | Экран | +|:---|:---| +| Larena, админка | отчёты по заказам, журнал действий, фильтр списка по датам | +| Сайты гостиниц на Larena и Битрикс | бронирование: заезд и выезд | +| SIMAI Pro | журнал и выгрузки за период | + +## Что ещё в пути + +> **Появится в следующей версии.** Быстрые варианты в шторке периода на +> телефоне. +> +> **Появится в следующей версии.** Праздники в календаре: праздник и +> перенесённый выходной красные, как выходные, рабочая суббота обычного +> цвета. Точка под числом и название дня необязательны: они рисуются, +> только если у дня есть данные о празднике. Без данных календарь +> показывает обычные выходные — по умолчанию субботу и воскресенье, свои +> задаёт `weekend`. +> +> **Появится в следующей версии.** Значок календаря встанет в конец поля, +> после кнопки «очистить». Сейчас он стоит в начале. + +## См. также + +- [Выбор даты](/ru/smart/forms/datepicker/) — все настройки поля и календаря +- [Сегментный переключатель](/ru/smart/actions/segmented/) — шаг отчёта +- [Обзор](/ru/recipes/dashboard/) — где стоят цифры отчёта diff --git a/content/ru/recipes/report-period.page.json b/content/ru/recipes/report-period.page.json new file mode 100644 index 000000000..35810053f --- /dev/null +++ b/content/ru/recipes/report-period.page.json @@ -0,0 +1 @@ +{"schema": "docara.page.v1", "navigation": {"order": 110}} diff --git a/content/ru/recipes/resource-list.page.json b/content/ru/recipes/resource-list.page.json index cc9695435..3410c46f5 100644 --- a/content/ru/recipes/resource-list.page.json +++ b/content/ru/recipes/resource-list.page.json @@ -1 +1 @@ -{"schema": "docara.page.v1", "navigation": {"order": 10}} +{"schema": "docara.page.v1", "navigation": {"order": 50}} diff --git a/content/ru/recipes/save-and-errors.md b/content/ru/recipes/save-and-errors.md new file mode 100644 index 000000000..35cf0ea1e --- /dev/null +++ b/content/ru/recipes/save-and-errors.md @@ -0,0 +1,182 @@ +--- +title: "Сохранение и ошибки в форме" +description: "Как ответить на «Сохранить»: кнопка занята, пока идёт сохранение, короткое «Сохранено», сводка ошибок над формой с переходом к первой, число ошибок на вкладках и чужая правка." +--- + +# Сохранение и ошибки в форме + +Запись правят долго и в нескольких вкладках. После «Сохранить» человек +должен сразу понять: сохранилось или нет, где первая ошибка и не правил ли +запись кто-то ещё. Пока идёт сохранение, кнопка занята. Успех — короткое +«Сохранено» в углу. Ошибки — сводкой над формой, текстом у каждого поля и +числом на вкладке. Чужая правка — уведомлением с двумя ответами. + +## Пример + +Выберите, что ответит сервер, и нажмите «Сохранить». При трёх ошибках фокус +встанет на сводку, «К первой ошибке» откроет вкладку и поставит курсор в +поле. + +:::example {id="recipes/save-and-errors/overview" label="Новость" preview=sandbox log="sf-alert-action sf-tabs-change sf-notification" log_console=true log_open=false} +::: + +## Когда брать + +| Если | Так | +|:---|:---| +| Запись сохраняется кнопкой «Сохранить», а не на лету | Этот рецепт | +| Полей много, они разложены по вкладкам | Этот рецепт с числом ошибок на вкладках | +| Запись могут править двое одновременно | Этот рецепт с чужой правкой | + +Не берите, когда: + +- настройка применяется сразу (переключатель, вид таблицы) — ответ + «Сохранено» не нужен; +- форма в одно поле (поиск, подписка) — ошибка у поля, без сводки; +- шагов много и порядок важен — мастер по шагам ([Шаги](/ru/smart/navigation/steps/)). + +## Из чего собрано + +| Часть | Компонент | Как задано | +|:---|:---|:---| +| Сводка над формой «Не сохранено: N ошибок» с переходом к первой (от двух ошибок) | [Уведомление](/ru/smart/feedback/alert/) | `status="error"`, `action-text="К первой ошибке"`; фокус на сводку | +| Число ошибок на вкладке | [Вкладки](/ru/smart/navigation/tabs/) | `items[].errors`, переход — `goToError()` | +| Ошибка у поля — красная рамка и текст под полем | [Текстовое поле](/ru/smart/forms/inputs/) | `invalid`, `error-message` | +| «Сохранить» не выключается; пока идёт — занята | [Кнопка](/ru/smart/actions/buttons/) | `loading` | +| «Отмена» — тихая, через 8 | [Кнопка](/ru/smart/actions/buttons/) | `appearance="ghost"` `scheme="on-surface"` | +| «Есть несохранённые изменения» под кнопками | строка страницы | `text-1/2 color-on-surface-variant` | +| Ответ сервера: успех уходит сам, «не сохранено» — до крестика | [`SF.notify`](/ru/guide/functions/actions/notify/) | `status`, `title`, `action`; ошибка — `duration: 0` | +| Чужая правка — уведомление над формой с двумя ответами | [Уведомление](/ru/smart/feedback/alert/) | `status="warning"`, «Показать её версию» — `action-text`, «Сохранить мою» — `secondary-action-text` | + +## Состояния + +:::example {id="recipes/save-and-errors/states" label="Состояния" preview=sandbox} +::: + +Новая запись открывается с пустыми полями; ошибки появляются только после +первого «Сохранить», а не во время ввода. + +## На телефоне + +Одна колонка; вкладки делят строку поровну; кнопки под формой в одну +строку. Откройте пример во весь экран и выберите ширину телефона. + +:::example {id="recipes/save-and-errors/phone" label="Телефон" preview=sandbox} +::: + +## Плотность + +Форма записи в админке — в компактной плотности: `data-sf-density="compact"` +на корне экрана сдвигает поля, вкладки и кнопки на ступень вниз вместе. + +:::example {id="recipes/save-and-errors/density" label="Плотность" preview=sandbox} +::: + +## Тексты + +| Случай | Так | Не так | +|:---|:---|:---| +| Успех | «Сохранено» | «Данные успешно сохранены!» | +| Сводка | «Не сохранено: 3 ошибки» · «К первой ошибке» | «Форма заполнена неверно» | +| Поле | «Только латинские буквы, цифры и дефис.» | «Неверный формат» | +| Чужая правка | «Запись изменила Анна Котова в 14:32» · «Показать её версию» · «Сохранить мою» | «Конфликт версий (409)» | +| Нет связи | «Не сохранено: нет связи. Изменения остались в форме.» · «Повторить» | «Network error» | + +## Доступность + +- После неудачного «Сохранить» фокус уходит на сводку (от двух ошибок) или + в единственное поле с ошибкой. +- Поле с ошибкой отмечено как неверное, текст ошибки связан с полем и + читается вместе с ним. +- Вкладка читается с числом: «Поиск, 2 ошибки». +- Занятая кнопка объявляет, что идёт работа; повторное нажатие ничего не + отправляет. +- Путь клавиатуры: поля вкладки → «Сохранить» → «Отмена»; стрелки ← → — + по вкладкам. + +## Как делать + +- **«Сохранить» не выключают.** Выключенная кнопка не объясняет, что не + так; нажатие с ошибками показывает сводку и ведёт к первой. +- **Ошибки — у полей, а не всплывающим.** Всплывающее — только когда + сохранение не дошло до сервера. +- **Чужую правку не перезаписывают молча.** Два ответа: посмотреть её + версию или сохранить свою. + +## Копия для ИИ + +```html + +
+ +
+
+
+
+ + +
+ +``` + +## Где используется + +- Форма записи Larena — новости, товары, страницы. +- Карточка записи SIMAI Pro. +- Письмо в почте — черновик и отправка. + +## Что ещё в пути + +> **Что ещё в пути.** Форма, которая сама ставит сводку ошибок, переводит +> фокус и пишет «Есть несохранённые изменения», появится в следующей +> версии SIMAI Framework. Тогда рецепт покажет оба способа; пока форму +> собирают из полей, вкладок и уведомления, как в примере. + +## См. также + +- [Какое сообщение выбрать](/ru/recipes/which-message/) +- [Карточка записи](/ru/recipes/record-card/) +- [Вкладки](/ru/smart/navigation/tabs/), [Текстовое поле](/ru/smart/forms/inputs/), [Уведомление](/ru/smart/feedback/alert/) diff --git a/content/ru/recipes/save-and-errors.page.json b/content/ru/recipes/save-and-errors.page.json new file mode 100644 index 000000000..e8f2abbcf --- /dev/null +++ b/content/ru/recipes/save-and-errors.page.json @@ -0,0 +1 @@ +{"schema": "docara.page.v1", "navigation": {"order": 140}} diff --git a/content/ru/recipes/settings-form.page.json b/content/ru/recipes/settings-form.page.json index 4e0ddcc5b..4fd6ac488 100644 --- a/content/ru/recipes/settings-form.page.json +++ b/content/ru/recipes/settings-form.page.json @@ -1 +1 @@ -{"schema": "docara.page.v1", "navigation": {"order": 30}} +{"schema": "docara.page.v1", "navigation": {"order": 130}} diff --git a/content/ru/recipes/site-header.md b/content/ru/recipes/site-header.md new file mode 100644 index 000000000..120142f6f --- /dev/null +++ b/content/ru/recipes/site-header.md @@ -0,0 +1,170 @@ +--- +title: "Шапка сайта" +description: "Логотип, разделы, поиск, язык, тема и корзина в одной строке; на телефоне разделы уходят за кнопку меню." +--- + +# Шапка сайта + +Логотип, разделы и инструменты в одной строке: посетитель видит, где он, +переходит в раздел, ищет, меняет язык и тему. На телефоне разделы уходят +за кнопку меню, а поиск и корзина остаются в строке. + +## Пример + +Шапка магазина насосов. Раздел «Каталог» открывает подразделы стрелкой. +Поиск открывается кнопкой с лупой или сочетанием ⌘K / Ctrl+K — найдите +«насос». Включите «Поиск недоступен», чтобы увидеть ошибку в окне поиска: +сама шапка при этом работает. + +:::example {id="recipes/site-header/overview" label="Магазин «Аквабур»" preview=sandbox log="sf-menu-navigate sf-search-navigate sf-language-change" log_console=true log_open=false} +::: + +## Когда брать + +| Если | Так | +|:---|:---| +| Сайт, магазин, документация, портал | Этот рецепт | +| Приложение с разделами — админка, личный кабинет | Рецепт «Каркас админки»: столбец разделов слева | +| Разделов первого уровня больше семи | `overflow="more"` у меню: не влезающие уходят в «Ещё», раздел с текущей страницей остаётся в строке | +| Сайт на одном языке | Выбор языка не ставить | +| Не магазин | Без корзины: поиск · язык · тема | + +## Состояния + +:::example {id="recipes/site-header/states" label="Состояния шапки" preview=sandbox} +::: + +Ошибка поиска — состояние окна поиска, а не шапки: переключите в первом +примере «Поиск недоступен» и откройте поиск. + +## На телефоне + +Откройте пример в ширине телефона. Разделы и выбор языка уходят за кнопку +меню, поиск, тема и корзина остаются в строке: поиск · тема · корзина · ☰. +На планшете и компьютере язык остаётся в шапке между поиском и темой: +поиск · язык · тема · корзина. Язык — кнопка с меню (`mode="menu"`); в +шапке он стоит в слоте `tools` с классами `hidden sm:inline-flex`, а в +меню — вторым выбором языка в слоте `actions` с классом `sm:hidden`. Сторону кнопки меню выбирает +сайт: по умолчанию она слева; у магазина — справа и последней, после +корзины. Панель выезжает с той же стороны, крестик стоит на месте кнопки +меню. + +:::example {id="recipes/site-header/phone" label="Кнопка меню слева и справа" preview=sandbox} +::: + +## Плотность + +Сайты — в обычной плотности. Узкая шапка каталога или документации +берёт компактную плотность на своём контейнере. + +:::example {id="recipes/site-header/density" label="Обычная и компактная" preview=sandbox} +::: + +## Тексты + +- Названия разделов — существительные, как у самих страниц: «Каталог», + «Доставка», «Контакты». +- Подпись поиска называет, что ищем: «Найти насос, фильтр или статью». +- У кнопок без текста — имя для диктора: «Поиск», «Корзина»; у числа на + корзине — что оно значит: «товара в корзине». +- Ошибка поиска говорит, что шапка работает: «Поиск недоступен, + попробуйте позже». + +## Из чего собрано + +| Часть | Компонент | Как задано | +|:---|:---|:---| +| Шапка | [Шапка сайта](/ru/smart/composite/site-header/) | слоты `brand`, `nav`, `tools`; `menu-placement="inline-end"` у магазина | +| Логотип | ссылка | `slot="brand"`, ведёт на главную | +| Разделы | [Меню](/ru/smart/navigation/menu/) | `orientation="horizontal"` `appearance="navigation"`; подразделы — панелью под стрелкой; текущий — `current` | +| Инструменты | [Кнопка с иконкой](/ru/smart/actions/icon-buttons/), [Язык](/ru/smart/navigation/language/) | в слоте `tools` по порядку: поиск · язык · тема · корзина; кнопка меню — последней; между ними `gap-1/3` | +| Язык на телефоне | [Язык](/ru/smart/navigation/language/) | в слоте `actions`, класс `sm:hidden`: уходит в меню ☰ вместе с разделами; в строке язык с классами `hidden sm:inline-flex` | +| Тема | [Кнопка с иконкой](/ru/smart/actions/icon-buttons/) | `theme-cycle`: одна кнопка, по кругу — противоположная видимой, другая, как в системе | +| Поиск | [Поиск](/ru/smart/composite/search/) | окно `sf-search`, данные через `provider`; ⌘K / Ctrl+K | + +## Доступность + +Путь с клавиатуры: + +1. Tab: логотип, разделы, поиск, язык, тема, корзина (на телефоне язык — в меню ☰). У раздела с + подразделами — ссылка и отдельная кнопка-стрелка. +2. Стрелка раздела открывает панель по Enter или пробелу; Escape + закрывает и возвращает фокус на стрелку. +3. ⌘K / Ctrl+K открывает поиск из любого места; Escape очищает строку, + второй Escape закрывает окно. +4. На телефоне кнопка меню сообщает, открыта ли панель; панель держит + фокус, крестик закрывает её и возвращает фокус на кнопку. + +| Что | Что слышит человек с экранным диктором | Откуда | +|:---|:---|:---| +| Текущий раздел | «Каталог, текущая страница» | `current` у меню | +| Корзина | «Корзина, 2 товара в корзине» | `aria-label` и `badge-label` | +| Тема | «Тема: светлая. Нажмите — тёмная» | `theme-cycle` | +| Язык | «Язык сайта: Русский» | `label` у выбора языка | +| Окно поиска | диалог «Поиск по магазину» | `label` у поиска | + +## Как делать + +:::example {id="recipes/site-header/do-dont" label="Как делать" preview=sandbox} +::: + +- **Одна кнопка темы.** Кнопка-цикл занимает одно место и называет, что + будет по нажатию. +- **Корзина — у края.** Сначала найти, потом настройки страницы, корзина + последней как главное действие магазина; кнопка меню на телефоне — за + ней. +- **Логотип ведёт на главную.** Отдельный пункт «Главная» в разделах не + нужен. + +## Копия для ИИ + +```html + + + Аквабур + + + + + + + +
+
+ +``` + +## Где используется + +| Продукт | Экран | +|:---|:---| +| simai.io и сайты SIMAI | шапка всех страниц | +| Larena, сайты и магазины | шапка темы сайта | +| Docara | шапка документации (кнопка меню слева) | +| ui-effects | шапка каталога эффектов | + +## Что ещё в пути + +> **Появится в следующей версии.** Текущий раздел в строке — тонкая линия +> под подписью вместо плашки; кнопка «Меню» самого меню больше не +> наезжает на соседние инструменты в узкой шапке. Пока текущий раздел +> отмечен плашкой. +> +> **Появится в следующей версии.** Кнопка языка без подписи — только +> значок. Сейчас она показывает «RU ▾»; на телефоне язык поэтому уходит в +> меню ☰, а в шапке остаются поиск, тема и корзина. + +## См. также + +- [Шапка сайта](/ru/smart/composite/site-header/) — все настройки шапки +- [Меню](/ru/smart/navigation/menu/) — строка разделов и подразделы +- [Поиск](/ru/smart/composite/search/) — окно поиска и данные diff --git a/content/ru/recipes/site-header.page.json b/content/ru/recipes/site-header.page.json new file mode 100644 index 000000000..002d32552 --- /dev/null +++ b/content/ru/recipes/site-header.page.json @@ -0,0 +1 @@ +{"schema": "docara.page.v1", "navigation": {"order": 260}} diff --git a/content/ru/recipes/system-bar.md b/content/ru/recipes/system-bar.md new file mode 100644 index 000000000..43b6fcc9d --- /dev/null +++ b/content/ru/recipes/system-bar.md @@ -0,0 +1,173 @@ +--- +title: "Системная полоса" +description: "Как сказать о том, что касается всего продукта и требует действия: лицензия, диск, сайт не отвечает, плановые работы — полосой над шапкой с самым серьёзным сообщением и «Ещё N»." +--- + +# Системная полоса + +Есть состояния, которые важны на любой странице продукта: лицензия +кончается, диск почти заполнен, сайт клиента не отвечает, ночью плановые +работы. О них говорит полоса над шапкой. Она показывает самое серьёзное +сообщение, ведёт к исправлению одной кнопкой, а остальные сообщения +открывает списком «Ещё N». Полоса стоит, пока жива причина. + +## Пример + +Выберите, что прислал сервер: полоса покажет самое серьёзное сообщение и +перекрасится по нему. «Ещё 3» открывает остальные, «Прочитано» убирает +предупреждение. + +:::example {id="recipes/system-bar/overview" label="Панель сервера" preview=sandbox log="sf-alert-bar-navigate sf-alert-bar-acknowledge sf-alert-bar-minimize" log_console=true log_open=false} +::: + +## Когда брать + +| Что случилось | Где сказать | +|:---|:---| +| Касается всего продукта или сервера и требует действия: лицензия, диск, сайт не отвечает | Полоса над шапкой | +| Касается одной страницы или раздела: раздел только для чтения, фильтр скрыл записи | [Уведомление](/ru/smart/feedback/alert/) в начале страницы | +| Ответ на нажатие человека: сохранено, не отправлено | [Всплывающее сообщение](/ru/smart/feedback/toast/) | +| Что было за день, кто что сделал | Центр уведомлений в меню админки | + +Полоса живёт, пока живёт причина: диск заполнен — полоса стоит. Согласие на +cookie в полосу не кладут. Как выбрать между всеми местами для сообщения — +в рецепте [Какое сообщение выбрать](/ru/recipes/which-message/). + +## Варианты + +### Плановые работы + +О плановых работах предупреждают заранее, сведениями. После «Прочитано» +полоса скрывается на сутки, а за час до начала работ возвращается сама и +больше не скрывается. Нажмите «Прочитано», затем переведите часы. + +:::example {id="recipes/system-bar/variants" label="Плановые работы" preview=sandbox log="sf-alert-bar-acknowledge" log_console=true log_open=false} +::: + +## Состояния + +Каждое состояние — та же полоса с другим списком. Пока сервер не прислал +список, полосы нет: она встаёт над шапкой и не сдвигает то, что под ней. + +- **Всё в порядке.** Список пуст — полосы нет, места она не занимает. + Отдельного «всё хорошо» не показывают. +- **Первый кадр.** Сервер печатает список в странице, поэтому полоса есть + сразу. Если список приходит позже, полоса появляется и объявляется + голосом. +- **Не удалось узнать состояние.** Полосу не рисуют: сбой загрузки — не + состояние продукта. Запись — в журнал страницы. + +:::example {id="recipes/system-bar/states" label="Состояния" preview=sandbox} +::: + +## На телефоне + +Кнопки уходят под текст и начинаются от его начала. Под последней кнопкой +столько же места, сколько над значком. Откройте пример во весь экран и +выберите ширину телефона. + +:::example {id="recipes/system-bar/phone" label="Телефон" preview=sandbox} +::: + +## Плотность + +В админке полоса идёт за плотностью экрана: `data-sf-density="compact"` на +корне уменьшает текст, поля и кнопки на ступень вместе с остальными +частями. + +:::example {id="recipes/system-bar/density" label="Плотность" preview=sandbox} +::: + +## Тексты + +| Случай | Так | Не так | +|:---|:---|:---| +| Лицензия | «Лицензия SIMAI Pro заканчивается 30 ноября. После этого обновления перестанут приходить.» · «Продлить» | «Внимание! Лицензия!» | +| Диск | «Диск заполнен на 98 %: сайты перестанут сохранять файлы и базы.» · «Освободить место» | «Ошибка диска» | +| Сайт | «shop.example.ru не отвечает уже 12 минут.» · «Открыть сайт» | «Сайт недоступен (код 502)» | +| Работы | «16 ноября с 02:00 до 03:00 МСК плановые работы: панель будет недоступна.» | «Технические работы!!!» | +| Отметка | «Прочитано» | «Отметить, что видели» | + +Текст говорит, что случилось и чем это грозит; кнопка — что сделать. Без +восклицательных знаков и кодов ошибок. + +## Из чего собрано + +| Часть | Компонент | Как задано | +|:---|:---|:---| +| Полоса над шапкой во всю ширину, сильная заливка | [Системная полоса](/ru/smart/feedback/alert-bar/) | `size="1/2"` в админке, `size="1"` на сайте; `label` — имя области | +| Самое серьёзное сообщение первым | [Системная полоса](/ru/smart/feedback/alert-bar/) | `items[].level`: `error` → `warning` → `info`, новое первым по `time` | +| Кнопка действия и «Прочитано» | [Системная полоса](/ru/smart/feedback/alert-bar/) | `action: {label, href}`, `acknowledge: {label: 'Прочитано'}`; кнопки пониженной высоты | +| «Ещё N» | [Системная полоса](/ru/smart/feedback/alert-bar/) | появляется сама, когда сообщений больше одного | +| Ошибку нельзя скрыть | [Системная полоса](/ru/smart/feedback/alert-bar/) | у `level: 'error'` нет «Прочитано» и крестика, только «Свернуть» | +| Скрыть плановые работы на сутки | страница | по `sf-alert-bar-acknowledge` запомнить срок: сутки, но не позже часа до начала | +| Переключатель в примере | [Сегментный переключатель](/ru/smart/actions/segmented/) | только для показа состояний | + +## Доступность + +- Полоса — область с именем «Важные уведомления» (`label`). При загрузке + страницы она не читается. +- Появившееся позже объявляется: новая ошибка — сразу, остальное — + вежливо. Фокус полоса не забирает. +- Путь клавиатуры: кнопка действия → «Прочитано» → «Ещё N» → «Свернуть». + Enter и пробел нажимают; Esc закрывает список «Ещё N» и возвращает фокус + на кнопку. +- Уровень читается словом («Ошибка», «Предупреждение»), а не только цветом. + +## Как делать + +- **Одна полоса на продукт.** Несколько сообщений — одна полоса с самым + серьёзным и «Ещё N», а не стопка полос. +- **Полоса — не ответ на нажатие.** «Сохранено» и «Не отправлено» — + всплывающим сообщением; полоса только о состоянии продукта. +- **Ошибку не прячут.** Пока диск заполнен, полоса стоит; её можно только + свернуть. + +## Копия для ИИ + +```html + + + +``` + +## Где используется + +- Панель сервера SIMAI Pro — лицензия, диск, сайт не отвечает. +- Админка Larena — лицензия, пробный период, плановые работы. +- Сайты клиентов — обслуживание и отключение, `size="1"`. + +## Что ещё в пути + +> **Так и останется.** Список «Ещё N» раскрывается под полосой, в потоке +> страницы, и сдвигает её вниз — так он и останется. Панель поверх +> страницы — это центр уведомлений, другой инструмент: его берут, когда +> событий много и их читают позже. + +## См. также + +- [Системная полоса](/ru/smart/feedback/alert-bar/) — компонент +- [Какое сообщение выбрать](/ru/recipes/which-message/) +- [Уведомление](/ru/smart/feedback/alert/), [Всплывающее сообщение](/ru/smart/feedback/toast/) diff --git a/content/ru/recipes/system-bar.page.json b/content/ru/recipes/system-bar.page.json new file mode 100644 index 000000000..b6cc5abd8 --- /dev/null +++ b/content/ru/recipes/system-bar.page.json @@ -0,0 +1 @@ +{"schema": "docara.page.v1", "navigation": {"order": 240}} diff --git a/content/ru/recipes/which-message.md b/content/ru/recipes/which-message.md new file mode 100644 index 000000000..57345d2b6 --- /dev/null +++ b/content/ru/recipes/which-message.md @@ -0,0 +1,158 @@ +--- +title: "Какое сообщение выбрать" +description: "Пять мест для сообщения — полоса, уведомление на странице, всплывающее, центр уведомлений и вопрос — и как выбрать одно по тому, что случилось." +--- + +# Какое сообщение выбрать + +Каждое сообщение отвечает на вопрос «что случилось и что мне делать». +Место выбирают по тому, чего касается событие: всего продукта, этой +страницы, только что сделанного действия, истории или решения, которое +нужно принять. Не то место — и человек сообщение не увидит или увидит +слишком громко: ошибка сохранения в полосе над всем продуктом пугает, а +заполненный диск во всплывающем уходит незамеченным. + +## Пример + +Выберите, что случилось: пример покажет нужное место. «Запись сохранена» и +«Нет связи» поднимают всплывающее сообщение — оно появится в углу окна. + +:::example {id="recipes/which-message/overview" label="Что случилось" preview=sandbox log="sf-alert-bar-navigate sf-alert-action sf-confirm-answer sf-list-open sf-notification" log_console=true log_open=false} +::: + +## Когда брать + +| Что случилось | Место | Компонент | Уходит | +|:---|:---|:---|:---| +| Состояние всего продукта, нужно действие: диск, лицензия, сайт не отвечает | Полоса над шапкой | [Системная полоса](/ru/smart/feedback/alert-bar/) | Когда ушла причина; ошибку можно только свернуть | +| Состояние страницы или раздела: только чтение, фильтр скрыл записи, нет доступа к части | Начало страницы или раздела | [Уведомление](/ru/smart/feedback/alert/) | Вместе с причиной | +| Ответ на действие: сохранено, отправлено, не удалось из-за связи | Угол окна, стопкой | [`SF.notify`](/ru/guide/functions/actions/notify/) → [всплывающее](/ru/smart/feedback/toast/) | Успех — сам; ошибка — по крестику | +| Ошибки в полях формы после «Сохранить» | Сводка над формой и текст у поля | [Уведомление](/ru/smart/feedback/alert/), [поле](/ru/smart/forms/inputs/) | Когда ошибки исправлены | +| История: что было, кто что сделал | Меню админки | центр уведомлений Larena | Хранится | +| Нужно решение: удалить, перезаписать, уйти без сохранения | У кнопки или окном | [Подтверждение](/ru/smart/actions/confirm/) | После ответа | + +Не путать: + +- Ответ на нажатие — не полоса: «Сохранено» над всем продуктом пугает. +- Ошибку поля показывают у поля и сводкой над формой, а не всплывающим. + Всплывающее — только если сохранение не дошло до сервера: нет связи, + нет прав. +- Своё обратимое удаляют без вопроса и дают «Вернуть» — рецепт + [Удаление](/ru/recipes/delete/). +- Врезка в тексте статьи — уведомление `info` только с границей и без + кнопок. + +## Из чего собрано + +У всей семьи одни и те же части: + +| Часть | Как у всей семьи | Как задано | +|:---|:---|:---| +| Статус словом и цветом | одни слова у всех | `status`: `neutral`, `info`, `success`, `warning`, `error` | +| Главная кнопка тональная серая, вторая тихая | одна пара кнопок | `action-text`, `secondary-action-text` | +| Кнопки в строке с текстом, на узком — под текстом | одно правило | `actions-layout="auto"` или `"under"` | +| Ссылка в тексте — только «Узнать больше» | одно место | в `supporting-text` | +| Одна высота кнопок | у полосы — пониженная | само | + +## Состояния + +У этого рецепта состояния — сами сообщения в каждом месте. + +:::example {id="recipes/which-message/states" label="Состояния" preview=sandbox} +::: + +## На телефоне + +Кнопки сообщения уходят под текст и начинаются от его начала. Откройте +пример во весь экран и выберите ширину телефона. + +:::example {id="recipes/which-message/phone" label="Телефон" preview=sandbox} +::: + +## Плотность + +В админке сообщения идут за плотностью экрана: `data-sf-density="compact"` +на корне уменьшает текст, отступы и кнопки на ступень. + +:::example {id="recipes/which-message/density" label="Плотность" preview=sandbox} +::: + +## Тексты + +- **Заголовок** — что случилось: «Запись сохранена», «Диск заполнен на + 98 %». +- **Пояснение** — что это значит и что делать: «Сайты перестанут + сохранять файлы». +- **Кнопка** — глагол действия: «Повторить», «Отменить», «Освободить + место». Не «ОК». +- Без восклицательных знаков и кодов ошибок в заголовке. Код, если он + нужен поддержке, — в пояснении. + +## Доступность + +- Всплывающие читает общая область уведомлений страницы: ошибка — сразу, + остальное — вежливо. Таймер стоит, пока на сообщении курсор или фокус. +- Полоса — область «Важные уведомления»; при загрузке страницы не + читается, новое сообщение объявляется. +- Уведомление на странице не забирает фокус; его кнопки — обычные, Tab + доходит до них. +- Сводка ошибок над формой получает фокус после неудачного «Сохранить»; + «К первой ошибке» ставит курсор в первое поле с ошибкой. +- Вопрос: фокус на безопасном ответе, Esc — отмена, Enter не удаляет. + +## Как делать + +- **Одна работа — одно место.** Не дублируйте: «Сохранено» не нужно и + всплывающим, и уведомлением на странице. +- **Ошибки формы — у полей.** Всплывающее «Форма заполнена неверно» + исчезает раньше, чем человек найдёт поле. +- **Полосу не используют для ответов.** Она для состояния всего продукта. + +## Копия для ИИ + +```html + + + + +``` + +## Где используется + +Везде: админка Larena, панель сервера SIMAI Pro, почта, портал, сайты +клиентов. + +## Что ещё в пути + +> **Что ещё в пути.** У уведомления, кнопки которого стоят под текстом, +> отступ под последней кнопкой станет равен отступу над значком — это +> появится в следующей версии SIMAI Framework. Сейчас снизу места чуть +> больше, чем сверху. + +## См. также + +- [Системная полоса](/ru/recipes/system-bar/) +- [Сохранение и ошибки в форме](/ru/recipes/save-and-errors/) +- [Удаление](/ru/recipes/delete/) +- [Уведомления `SF.notify`](/ru/guide/functions/actions/notify/) diff --git a/content/ru/recipes/which-message.page.json b/content/ru/recipes/which-message.page.json new file mode 100644 index 000000000..07baac670 --- /dev/null +++ b/content/ru/recipes/which-message.page.json @@ -0,0 +1 @@ +{"schema": "docara.page.v1", "navigation": {"order": 230}} diff --git a/examples/recipes/admin-frame/density/index.css b/examples/recipes/admin-frame/density/index.css new file mode 100644 index 000000000..aeb1b1327 --- /dev/null +++ b/examples/recipes/admin-frame/density/index.css @@ -0,0 +1,4 @@ +.frame { display: grid; grid-template-columns: 16rem minmax(0, 1fr); min-block-size: 12rem; border: var(--sf-px) solid var(--sf-outline-variant); border-radius: var(--sf-radius--surface); overflow: hidden; } +.frame-side { padding: var(--sf-space-1\/4); background: var(--sf-surface-card); border-inline-end: var(--sf-px) solid var(--sf-outline-variant); min-inline-size: 0; } +.frame-content { padding: var(--sf-space-1); min-inline-size: 0; } +@media (max-width: 37.5rem) { .frame { grid-template-columns: minmax(0, 1fr); } .frame-side { display: none; } } diff --git a/examples/recipes/admin-frame/density/index.html b/examples/recipes/admin-frame/density/index.html new file mode 100644 index 000000000..84835f615 --- /dev/null +++ b/examples/recipes/admin-frame/density/index.html @@ -0,0 +1,10 @@ +
+
+
+
Обычная — личный кабинет на сайте
+
+
+
+
Компактная — админка Larena и Pro
+
+
diff --git a/examples/recipes/admin-frame/density/index.js b/examples/recipes/admin-frame/density/index.js new file mode 100644 index 000000000..c3a81a9ce --- /dev/null +++ b/examples/recipes/admin-frame/density/index.js @@ -0,0 +1,2 @@ +const SHORT = [{id: 'pages', label: 'Страницы', href: '#pages', icon: 'description'}, {id: 'orders', label: 'Заказы', href: '#orders', icon: 'shopping_bag', count: 12}, {id: 'users', label: 'Пользователи', href: '#users', icon: 'group'}]; +customElements.whenDefined('sf-menu').then(() => document.querySelectorAll('sf-menu[data-menu="short"]').forEach((m) => m.setAttribute('items', JSON.stringify(SHORT)))); diff --git a/examples/recipes/admin-frame/do-dont/index.html b/examples/recipes/admin-frame/do-dont/index.html new file mode 100644 index 000000000..c05178e35 --- /dev/null +++ b/examples/recipes/admin-frame/do-dont/index.html @@ -0,0 +1,10 @@ +
+
+
Правильно — в пути только родители
+
+
+
+
Неправильно — страница повторена в пути и в заголовке
+
+
+
diff --git a/examples/recipes/admin-frame/overview/index.css b/examples/recipes/admin-frame/overview/index.css new file mode 100644 index 000000000..34629c6a1 --- /dev/null +++ b/examples/recipes/admin-frame/overview/index.css @@ -0,0 +1,12 @@ +.frame { display: grid; grid-template-columns: 16rem minmax(0, 1fr); min-block-size: 30rem; border: var(--sf-px) solid var(--sf-outline-variant); border-radius: var(--sf-radius--surface); overflow: hidden; } +.frame-side { display: flex; flex-direction: column; gap: var(--sf-space-1\/2); padding: var(--sf-space-1\/4); background: var(--sf-surface-card); border-inline-end: var(--sf-px) solid var(--sf-outline-variant); min-inline-size: 0; } +.frame-brand { display: flex; align-items: center; gap: var(--sf-space-1\/2); padding: var(--sf-space-1\/2) var(--sf-space-1\/2) 0; font-weight: var(--sf-font-weight-medium); } +.frame-main { min-inline-size: 0; } +.frame-bar { display: none; align-items: center; gap: var(--sf-space-1\/3); padding: var(--sf-space-1\/4) var(--sf-space-1\/2); border-block-end: var(--sf-px) solid var(--sf-outline-variant); font-weight: var(--sf-font-weight-medium); } +.frame-content { display: flex; flex-direction: column; gap: var(--sf-space-1); padding: var(--sf-space-1) var(--sf-space-2) var(--sf-space-2); min-inline-size: 0; } +@media (max-width: 60rem) { + .frame { grid-template-columns: minmax(0, 1fr); } + .frame-side { display: none; } + .frame-bar { display: flex; } + .frame-content { padding: var(--sf-space-1); } +} diff --git a/examples/recipes/admin-frame/overview/index.html b/examples/recipes/admin-frame/overview/index.html new file mode 100644 index 000000000..fc5c34ee9 --- /dev/null +++ b/examples/recipes/admin-frame/overview/index.html @@ -0,0 +1,22 @@ +
+ +
+
+ + shop.example.ru +
+
+ + + + + +
+
+
+ +
+
diff --git a/examples/recipes/admin-frame/overview/index.js b/examples/recipes/admin-frame/overview/index.js new file mode 100644 index 000000000..c99a221ae --- /dev/null +++ b/examples/recipes/admin-frame/overview/index.js @@ -0,0 +1,32 @@ +const MENU = [ + {group: true, label: 'Сайт', items: [ + {id: 'pages', label: 'Страницы', href: '#pages', icon: 'description'}, + {id: 'catalog', label: 'Каталог', icon: 'category', children: [ + {id: 'goods', label: 'Товары', href: '#goods'}, + {id: 'filters', label: 'Фильтры для воды', href: '#filters'}, + {id: 'sections', label: 'Разделы', href: '#sections'}]}, + {id: 'orders', label: 'Заказы', href: '#orders', icon: 'shopping_bag', count: 12}, + {id: 'forms', label: 'Формы', href: '#forms', icon: 'list_alt'}]}, + {group: true, label: 'Управление', items: [ + {id: 'users', label: 'Пользователи', href: '#users', icon: 'group'}, + {id: 'look', label: 'Оформление', href: '#look', icon: 'palette'}, + {id: 'domains', label: 'Домены', href: '#domains', icon: 'language'}, + {id: 'backups', label: 'Резервные копии', href: '#backups', icon: 'backup'}]}]; +const PAGES = [ + {id: 'p1', text: 'Главная', supporting: '/ · изменена сегодня', icon: 'home'}, + {id: 'p2', text: 'Насосы для дачи', supporting: '/catalog/nasosy · черновик', icon: 'description'}, + {id: 'p3', text: 'Доставка и оплата', supporting: '/delivery · изменена 12 ноября', icon: 'description'}, + {id: 'p4', text: 'Контакты', supporting: '/contacts · изменена 3 ноября', icon: 'description'}]; +Promise.all(['sf-menu', 'sf-list', 'sf-drawer', 'sf-header-page'].map((t) => customElements.whenDefined(t))).then(() => { + const menus = document.querySelectorAll('sf-menu[data-menu="admin"]'); + const drawer = document.getElementById('frame-drawer'); + menus.forEach((menu) => menu.setAttribute('items', JSON.stringify(MENU))); + document.getElementById('frame-pages').items = PAGES; + document.getElementById('frame-toggle').addEventListener('click', () => drawer.toggle()); + document.addEventListener('sf-menu-navigate', (event) => { + event.preventDefault(); + menus.forEach((menu) => menu.setAttribute('current', event.detail.id)); + if (event.detail.label) document.getElementById('frame-head').setAttribute('heading', event.detail.label); + if (drawer.hasAttribute('open')) drawer.close(); + }); +}); diff --git a/examples/recipes/admin-frame/states/index.css b/examples/recipes/admin-frame/states/index.css new file mode 100644 index 000000000..a58bcb43c --- /dev/null +++ b/examples/recipes/admin-frame/states/index.css @@ -0,0 +1,4 @@ +.frame { display: grid; grid-template-columns: 16rem minmax(0, 1fr); min-block-size: 16rem; border: var(--sf-px) solid var(--sf-outline-variant); border-radius: var(--sf-radius--surface); overflow: hidden; } +.frame-side { padding: var(--sf-space-1\/4); background: var(--sf-surface-card); border-inline-end: var(--sf-px) solid var(--sf-outline-variant); min-inline-size: 0; } +.frame-content { display: flex; flex-direction: column; gap: var(--sf-space-1); padding: var(--sf-space-1); min-inline-size: 0; } +@media (max-width: 37.5rem) { .frame { grid-template-columns: minmax(0, 1fr); } .frame-side { display: none; } } diff --git a/examples/recipes/admin-frame/states/index.html b/examples/recipes/admin-frame/states/index.html new file mode 100644 index 000000000..c05bb89d2 --- /dev/null +++ b/examples/recipes/admin-frame/states/index.html @@ -0,0 +1,38 @@ +
+
+
+
+
+
+
Первый кадр: столбец и шапка держат место, строки — заготовка того же размера
+
+
+
+
+
+ + +
+
+
Пустой раздел: каркас на месте, в содержимом — первое использование
+
+
+
+
+
+ + +
+
+
Ошибка: меню работает, ошибка только в содержимом
+
+
+
+
+
+ +
+
+
Много: поиск над столбцом, длинный путь сворачивает середину в «…»
+
+
diff --git a/examples/recipes/admin-frame/states/index.js b/examples/recipes/admin-frame/states/index.js new file mode 100644 index 000000000..0cc0d8b21 --- /dev/null +++ b/examples/recipes/admin-frame/states/index.js @@ -0,0 +1,6 @@ +const SHORT = [{id: 'pages', label: 'Страницы', href: '#pages', icon: 'description'}, {id: 'orders', label: 'Заказы', href: '#orders', icon: 'shopping_bag', count: 12}, {id: 'users', label: 'Пользователи', href: '#users', icon: 'group'}]; +const ADMIN = [{group: true, label: 'Сайт', items: [{id: 'pages', label: 'Страницы', href: '#pages', icon: 'description'}, {id: 'catalog', label: 'Каталог', icon: 'category', children: [{id: 'goods', label: 'Товары', href: '#goods'}, {id: 'filters', label: 'Фильтры для воды', href: '#filters'}]}, {id: 'orders', label: 'Заказы', href: '#orders', icon: 'shopping_bag', count: 12}]}, {group: true, label: 'Управление', items: [{id: 'users', label: 'Пользователи', href: '#users', icon: 'group'}, {id: 'backups', label: 'Резервные копии', href: '#backups', icon: 'backup'}]}]; +customElements.whenDefined('sf-menu').then(() => { + document.querySelectorAll('sf-menu[data-menu="short"]').forEach((m) => m.setAttribute('items', JSON.stringify(SHORT))); + document.querySelectorAll('sf-menu[data-menu="admin"]').forEach((m) => m.setAttribute('items', JSON.stringify(ADMIN))); +}); diff --git a/examples/recipes/brand-theme/density/index.html b/examples/recipes/brand-theme/density/index.html new file mode 100644 index 000000000..e9eed4682 --- /dev/null +++ b/examples/recipes/brand-theme/density/index.html @@ -0,0 +1,13 @@ +
+
+ + +
Обычная — портал
+
+
+ + +
Компактная — админка Larena
+
+
+ diff --git a/examples/recipes/brand-theme/do-dont/index.html b/examples/recipes/brand-theme/do-dont/index.html new file mode 100644 index 000000000..9e3ae9c66 --- /dev/null +++ b/examples/recipes/brand-theme/do-dont/index.html @@ -0,0 +1,11 @@ +
+
+
Правильно — у готовых цветов есть названия
+
+
+
+
Неправильно — без названий человек слышит и видит только код цвета
+
+
+
+ diff --git a/examples/recipes/brand-theme/overview/index.css b/examples/recipes/brand-theme/overview/index.css new file mode 100644 index 000000000..24940943b --- /dev/null +++ b/examples/recipes/brand-theme/overview/index.css @@ -0,0 +1,7 @@ +.look { display: grid; grid-template-columns: minmax(0, 22rem) minmax(0, 1fr); gap: var(--sf-space-2); align-items: start; } +.sample { border: var(--sf-px) solid var(--sf-outline-variant); border-radius: var(--sf-radius--surface); overflow: hidden; background: var(--sf-surface-page); color: var(--sf-on-surface); font-size: var(--sf-text-size-1\/2); line-height: var(--sf-text-height-1\/2); min-inline-size: 0; } +.sample-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sf-space-1\/2); padding: var(--sf-space-1\/2) var(--sf-space-1); background: var(--sf-brand, var(--sf-primary)); color: var(--sf-on-brand, var(--sf-on-primary)); } +.sample-cover { padding: var(--sf-space-2) var(--sf-space-1); background: var(--sf-primary-container); color: var(--sf-on-primary-container); } +.sample-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr)); gap: var(--sf-space-1\/2); padding: var(--sf-space-1); } +.sample-card { display: flex; flex-direction: column; gap: var(--sf-space-1\/4); padding: var(--sf-space-1\/2); border: var(--sf-px) solid var(--sf-outline-variant); border-radius: var(--sf-radius--ui); background: var(--sf-surface-card); } +@media (max-width: 60rem) { .look { grid-template-columns: minmax(0, 1fr); } } diff --git a/examples/recipes/brand-theme/overview/index.html b/examples/recipes/brand-theme/overview/index.html new file mode 100644 index 000000000..9db1ef720 --- /dev/null +++ b/examples/recipes/brand-theme/overview/index.html @@ -0,0 +1,24 @@ +
+
+ +
+ Тема сайта + +
+ +
+ + +
+

+ +
+
+
АквабурКаталог · Доставка · Контакты
+

Насосы для дома и дачи

Доставим завтра, установим за день

+
+
Аквабур-4012 490 ₽
+
Аквабур-258 990 ₽
+
+
+
diff --git a/examples/recipes/brand-theme/overview/index.js b/examples/recipes/brand-theme/overview/index.js new file mode 100644 index 000000000..ec9b487a6 --- /dev/null +++ b/examples/recipes/brand-theme/overview/index.js @@ -0,0 +1,25 @@ +Promise.all(['sf-input-color', 'sf-segmented', 'sf-button'].map((t) => customElements.whenDefined(t))).then(() => { + const $ = (id) => document.getElementById(id); + const brand = $('brand'), save = $('save'), error = $('save-error'), status = $('look-status'), sample = $('sample'); + let saved = {brand: brand.value, theme: 'system'}, theme = 'system'; + const dirty = () => (brand.value || '') !== (saved.brand || '') || theme !== saved.theme; + const mark = () => { status.textContent = dirty() ? 'Есть несохранённые изменения: на сайте пока прежнее оформление.' : ''; }; + brand.addEventListener('sf-input-color-change', mark); + $('site-theme').addEventListener('change', (event) => { + theme = event.detail.value; + sample.classList.toggle('theme-dark', theme === 'dark'); + sample.classList.toggle('theme-light', theme === 'light'); + mark(); + }); + $('reset').addEventListener('click', () => { brand.value = ''; brand.setAttribute('value', ''); mark(); }); + save.addEventListener('click', () => { + save.setAttribute('loading', ''); error.hidden = true; + setTimeout(() => { + save.removeAttribute('loading'); + if ($('look-fail').checked) { error.hidden = false; docara.example.log('save-failed', {}); return; } + saved = {brand: brand.value, theme}; + status.textContent = 'Оформление сохранено: сайт обновлён.'; + docara.example.log('save', saved); + }, 900); + }); +}); diff --git a/examples/recipes/brand-theme/states/index.css b/examples/recipes/brand-theme/states/index.css new file mode 100644 index 000000000..08f3ed3bc --- /dev/null +++ b/examples/recipes/brand-theme/states/index.css @@ -0,0 +1,3 @@ +.sample { border: var(--sf-px) solid var(--sf-outline-variant); border-radius: var(--sf-radius--surface); overflow: hidden; background: var(--sf-surface-page); color: var(--sf-on-surface); font-size: var(--sf-text-size-1\/2); line-height: var(--sf-text-height-1\/2); } +.sample-head { padding: var(--sf-space-1\/2) var(--sf-space-1); background: var(--sf-brand, var(--sf-primary)); color: var(--sf-on-brand, var(--sf-on-primary)); } +.sample-cover { padding: var(--sf-space-1); background: var(--sf-primary-container); color: var(--sf-on-primary-container); } diff --git a/examples/recipes/brand-theme/states/index.html b/examples/recipes/brand-theme/states/index.html new file mode 100644 index 000000000..8085928d5 --- /dev/null +++ b/examples/recipes/brand-theme/states/index.html @@ -0,0 +1,25 @@ +
+
+ +
Аквабур
Насосы для дома и дачи
+
Цвет не выбран: действует цвет SIMAI
+
+
+ +
Аквабур
Насосы для дома и дачи
+
Светлый цвет: шапка с тёмным текстом, под полем — что важно знать о цвете
+
+
+ +
Аквабур
Насосы для дома и дачи
+
Тёмная тема сайта: тот же цвет, образец в тёмной
+
+
+
+
Загрузка: поле и образец держат место
+
+
+ +
Ошибка сохранения: выбранное на месте, сайт прежний
+
+
diff --git a/examples/recipes/bulk-actions/density/index.html b/examples/recipes/bulk-actions/density/index.html new file mode 100644 index 000000000..b493a2b9e --- /dev/null +++ b/examples/recipes/bulk-actions/density/index.html @@ -0,0 +1,26 @@ +
+
+
+
+ + Осенняя распродажа: скидки до 30 % +
+ + +
+
+ обычная +
+
+
+ + Осенняя распродажа: скидки до 30 % +
+ + +
+
+ компактная +
+
+
diff --git a/examples/recipes/bulk-actions/overview/index.html b/examples/recipes/bulk-actions/overview/index.html new file mode 100644 index 000000000..19f9d0c1c --- /dev/null +++ b/examples/recipes/bulk-actions/overview/index.html @@ -0,0 +1,24 @@ +
+
+
+ +
+ +
+ + + + + +
diff --git a/examples/recipes/bulk-actions/overview/index.js b/examples/recipes/bulk-actions/overview/index.js new file mode 100644 index 000000000..7233ef84c --- /dev/null +++ b/examples/recipes/bulk-actions/overview/index.js @@ -0,0 +1,65 @@ +(async () => { + const NEWS = [ + {id: '1', title: 'Осенняя распродажа: скидки до 30 %', status: 'Опубликовано', author: 'Анна Котова', date: '14 ноября'}, + {id: '2', title: 'Новые улуны из Фуцзяня', status: 'Черновик', author: 'Сергей Иванов', date: '13 ноября'}, + {id: '3', title: 'График работы в праздники', status: 'Опубликовано', author: 'Анна Котова', date: '10 ноября'}, + {id: '4', title: 'Как заваривать пуэр', status: 'Опубликовано', author: 'Ирина Котова', date: '2 ноября'}, + {id: '5', title: 'Мастер-класс 23 ноября', status: 'Запланировано', author: 'Сергей Иванов', date: '1 ноября'}, + ]; + const word = (n) => (n % 10 === 1 && n % 100 !== 11 ? 'новость' : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 'новости' : 'новостей'); + await Promise.all(['sf-view-table', 'sf-button'].map((tag) => customElements.whenDefined(tag))); + const $ = (selector) => document.querySelector(selector); + const table = $('#news'); + let rows = NEWS.slice(); + let selected = []; + + table.columns = [ + {key: 'title', label: 'Название', list: 'title'}, + {key: 'status', label: 'Статус', list: 'fact'}, + {key: 'author', label: 'Автор', list: 'supporting'}, + {key: 'date', label: 'Дата', list: 'supporting'}, + ]; + table.rows = rows; + + // Выбрана хотя бы одна строка — панель над списком сменяется строкой «Выбрано N». + const showSelection = (ids) => { + selected = ids; + $('#selection-bar').hidden = !ids.length; + $('#list-bar').hidden = ids.length > 0; + $('#selected-count').textContent = `Выбрано ${ids.length}`; + }; + const clear = () => { table.clearSelection?.(); showSelection([]); }; + table.addEventListener('sf-view-table-select', (event) => showSelection(event.detail?.ids ?? [])); + $('#clear').addEventListener('click', clear); + + $('#publish').addEventListener('click', () => { + SF.notify({status: 'success', title: `Опубликовано: ${selected.length} ${word(selected.length)}`}); + clear(); + }); + $('#unpublish').addEventListener('click', () => { + const ids = selected.slice(); + SF.notify({status: 'success', title: `Снято с публикации: ${ids.length} ${word(ids.length)}`, action: {label: 'Вернуть', onSelect: () => {}}}); + clear(); + }); + $('#remove').addEventListener('click', async () => { + const ids = selected.slice(); + const question = `Удалить ${ids.length} ${word(ids.length)}?`; + const confirm = $('#delete-question'); + confirm.setAttribute('question', question); + confirm.setAttribute('accept-text', `Удалить ${ids.length} ${word(ids.length)}`); + const modal = $('sf-modal[modal-id="delete-news"]'); + modal.setAttribute('heading', question); + await customElements.whenDefined('sf-modal'); + modal.open(); + confirm.addEventListener('sf-confirm-answer', (event) => { + modal.close(); + if (!event.detail?.accepted) return; + const before = rows; + rows = rows.filter((row) => !ids.includes(row.id)); + table.rows = rows; + clear(); + SF.notify({status: 'neutral', icon: 'delete', title: `Удалено ${ids.length} ${word(ids.length)}`, + action: {label: 'Отменить', onSelect: () => { rows = before; table.rows = rows; }}}); + }, {once: true}); + }); +})(); diff --git a/examples/recipes/bulk-actions/phone/index.html b/examples/recipes/bulk-actions/phone/index.html new file mode 100644 index 000000000..fe787ba0c --- /dev/null +++ b/examples/recipes/bulk-actions/phone/index.html @@ -0,0 +1,10 @@ +
+
+
Выбрано 3
+
+ + +
+
+ +
diff --git a/examples/recipes/bulk-actions/states/index.html b/examples/recipes/bulk-actions/states/index.html new file mode 100644 index 000000000..b041a720c --- /dev/null +++ b/examples/recipes/bulk-actions/states/index.html @@ -0,0 +1,38 @@ +
+
+
+
+
Выбрано 3
+
+ + +
+
+ Выбрано N: строка на месте панели, опасное — последним, с рамкой +
+
+ + Вопрос: что удалится и можно ли вернуть +
+
+ + После удаления: «Отменить» +
+
+ + Часть не удалилась: что и почему +
+
+
+ + Анна Котова — Счёт № 118 за ноябрь +
+ + + +
+
+ Действия у строки письма: до трёх значков и «⋯»; удаление письма — в «⋯», без вопроса +
+
+
diff --git a/examples/recipes/checkout/density/index.html b/examples/recipes/checkout/density/index.html new file mode 100644 index 000000000..5b5dbd3ac --- /dev/null +++ b/examples/recipes/checkout/density/index.html @@ -0,0 +1,12 @@ +
+
+
+ + обычная — сайт магазина +
+
+ + компактная — менеджер в админке +
+
+
diff --git a/examples/recipes/checkout/density/index.js b/examples/recipes/checkout/density/index.js new file mode 100644 index 000000000..903469e34 --- /dev/null +++ b/examples/recipes/checkout/density/index.js @@ -0,0 +1,10 @@ +(async () => { + await customElements.whenDefined('sf-input-choice'); + document.querySelectorAll('[data-demo="density-choice"]').forEach((choice) => { + choice.items = [ + {value: 'card', label: 'Картой онлайн', caption: 'Мир, Visa, Mastercard'}, + {value: 'sbp', label: 'СБП', caption: 'Через приложение банка'}, + {value: 'cash', label: 'При получении', caption: 'Наличными или картой курьеру'}, + ]; + }); +})(); diff --git a/examples/recipes/checkout/overview/index.css b/examples/recipes/checkout/overview/index.css new file mode 100644 index 000000000..88d7abf63 --- /dev/null +++ b/examples/recipes/checkout/overview/index.css @@ -0,0 +1 @@ +#summary { flex: 0 0 var(--sf-f8); } diff --git a/examples/recipes/checkout/overview/index.html b/examples/recipes/checkout/overview/index.html new file mode 100644 index 000000000..5158cd761 --- /dev/null +++ b/examples/recipes/checkout/overview/index.html @@ -0,0 +1,44 @@ +
+
+ +
+
+ +
+

Доставка

+ + + + + +
+ + +
+ + + +
+
+ +
+
+
diff --git a/examples/recipes/checkout/overview/index.js b/examples/recipes/checkout/overview/index.js new file mode 100644 index 000000000..ceb1e9cba --- /dev/null +++ b/examples/recipes/checkout/overview/index.js @@ -0,0 +1,68 @@ +(async () => { + const delivery = [ + {value: 'courier', label: 'Курьером', caption: 'Привезём в удобный интервал', price: '350 ₽', term: '2–3 дня'}, + {value: 'pickup', label: 'Пункт выдачи', caption: 'Больше 2 000 пунктов по стране', price: '150 ₽', term: '1–2 дня', badge: 'Выгодно'}, + {value: 'post', label: 'Почта России', caption: 'До отделения рядом с домом', price: '290 ₽', term: '5–9 дней'}, + ]; + const payment = [ + {value: 'card', label: 'Картой онлайн', caption: 'Мир, Visa, Mastercard'}, + {value: 'sbp', label: 'СБП', caption: 'Через приложение банка'}, + {value: 'cash', label: 'При получении', caption: 'Наличными или картой курьеру'}, + ]; + const GOODS = 4720; + const money = (value) => value.toLocaleString('ru-RU') + ' ₽'; + // Части на скрытых шагах загружаются, когда шаг откроют: ждём только видимые. + await Promise.all(['sf-steps', 'sf-input-choice', 'sf-button'].map((tag) => customElements.whenDefined(tag))); + const $ = (selector) => document.querySelector(selector); + const steps = $('#checkout-steps'); + const next = $('#next'); + const back = $('#back'); + const narrow = matchMedia('(width < 44rem)'); + let current = 1; + let total = GOODS + 350; + + $('#delivery').items = delivery; + $('#payment').setAttribute('items', JSON.stringify(payment)); + + const render = () => { + document.querySelectorAll('[data-step]').forEach((section) => { section.hidden = Number(section.dataset.step) !== current; }); + steps.setAttribute('current', String(current)); + back.hidden = current === 0; + const word = current === 3 ? 'Оформить заказ' : 'Далее'; + // На телефоне колонки «Ваш заказ» нет: сумма встаёт в главную кнопку. + next.setAttribute('text', narrow.matches ? `${word} · ${money(total)}` : word); + $('#summary').hidden = narrow.matches; + if (current === 3) fillConfirm(); + }; + // Сводка на скрытом шаге загружается, когда шаг открыт: данные отдаём после показа. + const fillConfirm = async () => { + await customElements.whenDefined('sf-list-description'); + $('#confirm-list').items = [ + {label: 'Доставка', value: 'Курьером, 18 ноября'}, + {label: 'Адрес', value: 'Москва, Покровка, 12, кв. 4'}, + {label: 'Получатель', value: 'Ирина Котова, +7 900 111-22-33'}, + {label: 'Оплата', value: 'Картой онлайн'}, + ]; + }; + + $('#delivery').addEventListener('change', () => { + const chosen = delivery.find((item) => item.value === $('#delivery').value); + if (!chosen) return; + const price = Number(chosen.price.replace(/\D/g, '')) || 0; + total = GOODS + price; + $('#sum-delivery').textContent = chosen.price; + $('#sum-total').textContent = money(total); + render(); + }); + steps.addEventListener('sf-steps-change', (event) => { + const index = event.detail?.current ?? event.detail?.index; + if (index != null) { current = Number(index); render(); } + }); + next.addEventListener('click', () => { + if (current < 3) { current += 1; render(); return; } + SF.notify({status: 'success', title: 'Заказ № 48 215 оформлен', text: 'Письмо с деталями отправлено на почту.'}); + }); + back.addEventListener('click', () => { if (current > 0) { current -= 1; render(); } }); + narrow.addEventListener('change', render); + render(); +})(); diff --git a/examples/recipes/checkout/phone/index.html b/examples/recipes/checkout/phone/index.html new file mode 100644 index 000000000..eab1bf1c5 --- /dev/null +++ b/examples/recipes/checkout/phone/index.html @@ -0,0 +1,11 @@ +
+ + + +
+ + + +
+
diff --git a/examples/recipes/checkout/phone/index.js b/examples/recipes/checkout/phone/index.js new file mode 100644 index 000000000..84ef774a5 --- /dev/null +++ b/examples/recipes/checkout/phone/index.js @@ -0,0 +1,7 @@ +(async () => { + await customElements.whenDefined('sf-input-choice'); + document.querySelector('#phone-delivery').items = [ + {value: 'courier', label: 'Курьером', caption: 'Привезём в удобный интервал', price: '350 ₽', term: '2–3 дня'}, + {value: 'pickup', label: 'Пункт выдачи', caption: 'Больше 2 000 пунктов', price: '150 ₽', term: '1–2 дня'}, + ]; +})(); diff --git a/examples/recipes/checkout/states/index.html b/examples/recipes/checkout/states/index.html new file mode 100644 index 000000000..00f28afd2 --- /dev/null +++ b/examples/recipes/checkout/states/index.html @@ -0,0 +1,29 @@ +
+
+
+ + Пусто: корзина пуста +
+
+ + Загрузка: считаем доставку, скелет на месте способов +
+
+ + + Не везём по адресу: способ недоступен, причина сверху +
+
+ + Ошибка поля: не выбран способ +
+
+ + Много: шесть способов, всё ещё строками +
+
+ + Оформлено +
+
+
diff --git a/examples/recipes/checkout/states/index.js b/examples/recipes/checkout/states/index.js new file mode 100644 index 000000000..eac0e8dc3 --- /dev/null +++ b/examples/recipes/checkout/states/index.js @@ -0,0 +1,18 @@ +(async () => { + const delivery = [ + {value: 'courier', label: 'Курьером', caption: 'Привезём в удобный интервал', price: '350 ₽', term: '2–3 дня'}, + {value: 'pickup', label: 'Пункт выдачи', caption: 'Больше 2 000 пунктов по стране', price: '150 ₽', term: '1–2 дня', badge: 'Выгодно'}, + {value: 'post', label: 'Почта России', caption: 'До отделения рядом с домом', price: '290 ₽', term: '5–9 дней'}, + ]; + await customElements.whenDefined('sf-input-choice'); + document.querySelector('#state-blocked').items = delivery.map((item) => item.value === 'courier' ? {...item, disabled: true, caption: 'Не возим по этому адресу'} : item); + document.querySelector('#state-invalid').items = [ + {value: 'card', label: 'Картой онлайн', caption: 'Мир, Visa, Mastercard'}, + {value: 'sbp', label: 'СБП', caption: 'Через приложение банка'}, + ]; + document.querySelector('#state-many').items = delivery.concat([ + {value: 'express', label: 'Экспресс', caption: 'Сегодня до 22:00, только Москва', price: '690 ₽', term: 'сегодня'}, + {value: 'locker', label: 'Постамат', caption: 'Выдача по коду', price: '120 ₽', term: '1–2 дня'}, + {value: 'self', label: 'Самовывоз из лавки', caption: 'Москва, Покровка, 12', price: 'бесплатно', term: 'завтра'}, + ]); +})(); diff --git a/examples/recipes/choice-cards/density/index.html b/examples/recipes/choice-cards/density/index.html new file mode 100644 index 000000000..afee0e799 --- /dev/null +++ b/examples/recipes/choice-cards/density/index.html @@ -0,0 +1,10 @@ +
+
+ +
Обычная — магазин
+
+
+ +
Компактная — установка и админка
+
+
diff --git a/examples/recipes/choice-cards/do-dont/index.html b/examples/recipes/choice-cards/do-dont/index.html new file mode 100644 index 000000000..58b3e5adb --- /dev/null +++ b/examples/recipes/choice-cards/do-dont/index.html @@ -0,0 +1,10 @@ +
+
+
Правильно — цена и срок у названия, видно сразу
+
+
+
+
Неправильно — цена спрятана, выбирать приходится вслепую
+
+
+
diff --git a/examples/recipes/choice-cards/overview/index.html b/examples/recipes/choice-cards/overview/index.html new file mode 100644 index 000000000..b7d22b383 --- /dev/null +++ b/examples/recipes/choice-cards/overview/index.html @@ -0,0 +1,8 @@ +
+ + +
+ + Итого 12 640 ₽ +
+
diff --git a/examples/recipes/choice-cards/overview/index.js b/examples/recipes/choice-cards/overview/index.js new file mode 100644 index 000000000..c81e09523 --- /dev/null +++ b/examples/recipes/choice-cards/overview/index.js @@ -0,0 +1,21 @@ +const PRICE = {courier: 350, pickup: 150, self: 0}; +Promise.all(['sf-input-choice', 'sf-button'].map((t) => customElements.whenDefined(t))).then(() => { + const form = document.getElementById('order'); + const payment = document.getElementById('payment'); + const total = document.getElementById('order-total'); + document.getElementById('delivery').addEventListener('sf-input-choice-change', (event) => { + total.textContent = `Итого ${(12490 + (PRICE[event.detail.value] ?? 0)).toLocaleString('ru-RU')} ₽`; + }); + payment.addEventListener('sf-input-choice-change', () => payment.removeAttribute('invalid')); + form.addEventListener('submit', (event) => { + event.preventDefault(); + if (!payment.value) { + payment.setAttribute('error-message', 'Выберите способ оплаты.'); + payment.setAttribute('invalid', ''); + payment.querySelector('input')?.focus(); + docara.example.log('invalid', {field: 'payment'}); + return; + } + docara.example.log('submit', Object.fromEntries(new FormData(form))); + }); +}); diff --git a/examples/recipes/choice-cards/states/index.html b/examples/recipes/choice-cards/states/index.html new file mode 100644 index 000000000..037edaf9f --- /dev/null +++ b/examples/recipes/choice-cards/states/index.html @@ -0,0 +1,18 @@ +
+
+
+
Загрузка: варианты зависят от адреса, заготовка в размер строк
+
+
+ +
Нет вариантов: причина и что сделать
+
+
+ +
Ошибка: обязательная группа не выбрана, текст ошибки заменяет пояснение
+
+
+ +
Недоступный вариант: бледный, причина в пояснении
+
+
diff --git a/examples/recipes/choice-cards/variants-2/index.html b/examples/recipes/choice-cards/variants-2/index.html new file mode 100644 index 000000000..b7df0edf6 --- /dev/null +++ b/examples/recipes/choice-cards/variants-2/index.html @@ -0,0 +1,4 @@ +
+ +
+
diff --git a/examples/recipes/choice-cards/variants-2/index.js b/examples/recipes/choice-cards/variants-2/index.js new file mode 100644 index 000000000..e8f64e917 --- /dev/null +++ b/examples/recipes/choice-cards/variants-2/index.js @@ -0,0 +1,29 @@ +const ALL = [ + {value: 'forms', label: 'Формы', caption: 'Заявки и обратная связь'}, + {value: 'blog', label: 'Статьи', caption: 'Лента и рубрики'}, + {value: 'search', label: 'Поиск', caption: 'По всему сайту'}, + {value: 'seo', label: 'SEO', caption: 'Метатеги и карта сайта'}, + {value: 'crm', label: 'Битрикс24', caption: 'Заявки в CRM'}, + {value: '1c', label: '1С', caption: 'Товары и остатки'}, + {value: 'pay', label: 'Оплата', caption: 'ЮKassa, СБП'}, + {value: 'delivery', label: 'Доставка', caption: 'СДЭК, Почта'}, + {value: 'reviews', label: 'Отзывы', caption: 'С модерацией'}]; +const FIRST = 6; +Promise.all(['sf-input-choice', 'sf-button'].map((t) => customElements.whenDefined(t))).then(() => { + const choice = document.getElementById('modules'); + const more = document.getElementById('modules-all'); + let picked = ['forms', 'search', 'pay']; + const draw = (all) => { + const shown = all ? ALL : ALL.filter((item, i) => i < FIRST || picked.includes(item.value)); + choice.setAttribute('items', JSON.stringify(shown)); + choice.setAttribute('value', picked.join(',')); + more.hidden = all || shown.length === ALL.length; + more.setAttribute('text', `Показать все ${ALL.length}`); + }; + choice.addEventListener('sf-input-choice-change', (event) => { picked = [].concat(event.detail.value ?? []); }); + more.addEventListener('click', () => { + draw(true); + requestAnimationFrame(() => choice.querySelectorAll('input')[FIRST]?.focus()); + }); + draw(false); +}); diff --git a/examples/recipes/choice-cards/variants/index.html b/examples/recipes/choice-cards/variants/index.html new file mode 100644 index 000000000..e6396d87c --- /dev/null +++ b/examples/recipes/choice-cards/variants/index.html @@ -0,0 +1,4 @@ +
+ + +
diff --git a/examples/recipes/choice-cards/variants/index.js b/examples/recipes/choice-cards/variants/index.js new file mode 100644 index 000000000..d0a2be854 --- /dev/null +++ b/examples/recipes/choice-cards/variants/index.js @@ -0,0 +1,8 @@ +// Flat placeholders until the documentation illustration set is in place. +const screen = (bg, fg) => 'data:image/svg+xml,' + encodeURIComponent(``); +customElements.whenDefined('sf-input-choice').then(() => { + document.getElementById('template').setAttribute('items', JSON.stringify([ + {value: 'shop', label: 'Магазин', caption: 'Каталог, корзина, оплата', image: screen('#dbe4f3', '#b7c7e6')}, + {value: 'corp', label: 'Сайт компании', caption: 'Услуги, проекты, контакты', image: screen('#e6efe2', '#c5d8bd')}, + {value: 'docs', label: 'Документация', caption: 'Статьи с поиском и оглавлением', image: screen('#efe7dc', '#dccbb3')}])); +}); diff --git a/examples/recipes/dialog-form/density/index.html b/examples/recipes/dialog-form/density/index.html new file mode 100644 index 000000000..8dee024b9 --- /dev/null +++ b/examples/recipes/dialog-form/density/index.html @@ -0,0 +1,16 @@ +
+
+ +
+
+
+
Обычная — сайты и портал
+
+
+ +
+
+
+
Компактная — админка Larena и Pro
+
+
diff --git a/examples/recipes/dialog-form/do-dont/index.html b/examples/recipes/dialog-form/do-dont/index.html new file mode 100644 index 000000000..4cff834ec --- /dev/null +++ b/examples/recipes/dialog-form/do-dont/index.html @@ -0,0 +1,16 @@ +
+
+
Правильно — главная первой, «Отмена» тихая и последняя
+
+ + +
+
+
+
Неправильно — «ОК» не говорит, что будет, «Отмена» спорит с главной
+
+ + +
+
+
diff --git a/examples/recipes/dialog-form/overview/index.html b/examples/recipes/dialog-form/overview/index.html new file mode 100644 index 000000000..c44a637f3 --- /dev/null +++ b/examples/recipes/dialog-form/overview/index.html @@ -0,0 +1,37 @@ +
+
+ + +
+

+
+ +
+ + + + + + +
+
+ + +
+
+ +

Название и адрес новой страницы пропадут.

+
+ + +
+
diff --git a/examples/recipes/dialog-form/overview/index.js b/examples/recipes/dialog-form/overview/index.js new file mode 100644 index 000000000..49bc203fe --- /dev/null +++ b/examples/recipes/dialog-form/overview/index.js @@ -0,0 +1,48 @@ +const ready = Promise.all(['sf-modal', 'sf-input', 'sf-button'].map((t) => customElements.whenDefined(t))); +ready.then(() => { + const $ = (id) => document.getElementById(id); + const dialog = $('page-dialog'), question = $('page-question'), form = $('page-form'); + const title = $('page-title'), slug = $('page-slug'), save = $('page-save'), cancel = $('page-cancel'); + const summary = $('page-summary'), failure = $('page-error'), result = $('page-result'); + let dirty = false, busy = false; + const value = (el) => String(el.value ?? '').trim(); + const reset = () => { + [title, slug].forEach((el) => { el.removeAttribute('invalid'); el.removeAttribute('readonly'); el.value = ''; }); + summary.hidden = true; failure.hidden = true; dirty = false; dialog.removeAttribute('unsaved'); + }; + $('page-open').addEventListener('click', () => { reset(); dialog.open(); }); + form.addEventListener('input', () => { if (!dirty) { dirty = true; dialog.setAttribute('unsaved', ''); } }); + cancel.addEventListener('click', () => dialog.close({reason: 'close'})); + dialog.addEventListener('sf-modal-close', (event) => { + if (busy) { event.preventDefault(); return; } + if (dirty && event.detail?.reason !== 'api') { event.preventDefault(); setTimeout(() => question.open(), 0); } + }); + $('page-keep').addEventListener('click', () => question.close()); + $('page-drop').addEventListener('click', () => { question.close(); dirty = false; dialog.close({reason: 'api'}); }); + summary.addEventListener('click', (event) => { + const link = event.target.closest('a'); if (!link) return; + event.preventDefault(); + const field = document.querySelector(link.getAttribute('href')); + (field.querySelector('input') || field).focus(); + }); + form.addEventListener('submit', (event) => { + event.preventDefault(); if (busy) return; + failure.hidden = true; + const errors = []; + if (!value(title)) { title.setAttribute('error-message', 'Введите название страницы'); title.setAttribute('invalid', ''); errors.push(title); } else title.removeAttribute('invalid'); + if (value(slug) && !/^[a-z0-9-]+$/.test(value(slug))) { slug.setAttribute('error-message', 'Только латинские буквы, цифры и дефис'); slug.setAttribute('invalid', ''); errors.push(slug); } else slug.removeAttribute('invalid'); + summary.hidden = errors.length < 2; + if (errors.length > 1) { requestAnimationFrame(() => summary.focus()); docara.example.log('invalid', {fields: errors.length}); return; } + if (errors.length === 1) { (errors[0].querySelector('input') || errors[0]).focus(); docara.example.log('invalid', {fields: 1}); return; } + busy = true; save.setAttribute('loading', ''); cancel.setAttribute('disabled', ''); + [title, slug].forEach((el) => el.setAttribute('readonly', '')); + setTimeout(() => { + busy = false; save.removeAttribute('loading'); cancel.removeAttribute('disabled'); + [title, slug].forEach((el) => el.removeAttribute('readonly')); + if ($('page-fail').checked) { failure.hidden = false; docara.example.log('save-failed', {}); return; } + dirty = false; dialog.close({reason: 'api'}); + result.textContent = `Страница «${value(title)}» создана.`; + docara.example.log('submit', Object.fromEntries(new FormData(form))); + }, 1200); + }); +}); diff --git a/examples/recipes/dialog-form/phone/index.css b/examples/recipes/dialog-form/phone/index.css new file mode 100644 index 000000000..871aec770 --- /dev/null +++ b/examples/recipes/dialog-form/phone/index.css @@ -0,0 +1,4 @@ +@media (max-width: 37.5rem) { + .answers { flex-wrap: nowrap; } + .answers > sf-button > button { flex: 1 1 0; min-inline-size: 0; } +} diff --git a/examples/recipes/dialog-form/phone/index.html b/examples/recipes/dialog-form/phone/index.html new file mode 100644 index 000000000..5dc262b8c --- /dev/null +++ b/examples/recipes/dialog-form/phone/index.html @@ -0,0 +1,17 @@ +
+ + +
+ +
+
+
+ +
+ + + + +
+
+
diff --git a/examples/recipes/dialog-form/phone/index.js b/examples/recipes/dialog-form/phone/index.js new file mode 100644 index 000000000..5967e0714 --- /dev/null +++ b/examples/recipes/dialog-form/phone/index.js @@ -0,0 +1,11 @@ +Promise.all(['sf-modal', 'sf-button'].map((t) => customElements.whenDefined(t))).then(() => { + const phone = matchMedia('(max-width: 37.5rem)'); + const create = document.getElementById('create'); + const rename = document.getElementById('rename'); + document.getElementById('rename-open').addEventListener('click', () => rename.open()); + document.getElementById('create-open').addEventListener('click', () => { + create.toggleAttribute('fullscreen', phone.matches); + create.open(); + }); + document.querySelectorAll('[data-sf-action="close"]').forEach((b) => b.addEventListener('click', () => b.closest('sf-modal').close({reason: 'api'}))); +}); diff --git a/examples/recipes/dialog-form/states/index.html b/examples/recipes/dialog-form/states/index.html new file mode 100644 index 000000000..6505aea1e --- /dev/null +++ b/examples/recipes/dialog-form/states/index.html @@ -0,0 +1,66 @@ +
+
+ +
+ + +
+
+
+
Только что открыто: курсор в первом поле, главная кнопка не выключена
+
+
+ +
+ + +
+
+
+
Загрузка содержимого: заготовка в размер полей, кнопка ждёт
+
+
+ +
+
  • Название — введите название страницы
  • Адрес — только латинские буквы, цифры и дефис
+ + +
+
+
+
Ошибки в полях: от двух ошибок — сводка со ссылками над полями
+
+
+ +
+ + +
+
+
+
Сохраняем: главная кнопка с загрузкой своего цвета, поля только для чтения
+
+
+ +
+ + +
+
+
+
Ошибка сервера: окно остаётся, набранное на месте
+
+
+ +
+ + + + + +
+
+
+
Много полей: тело прокручивается, заголовок и подвал на месте
+
+
diff --git a/examples/recipes/file-upload-progress/density/index.html b/examples/recipes/file-upload-progress/density/index.html new file mode 100644 index 000000000..4b6712335 --- /dev/null +++ b/examples/recipes/file-upload-progress/density/index.html @@ -0,0 +1,12 @@ +
+
+
+ + обычная +
+
+ + компактная +
+
+
diff --git a/examples/recipes/file-upload-progress/density/index.js b/examples/recipes/file-upload-progress/density/index.js new file mode 100644 index 000000000..39f50f6a7 --- /dev/null +++ b/examples/recipes/file-upload-progress/density/index.js @@ -0,0 +1,10 @@ +(async () => { + await customElements.whenDefined('sf-file-upload'); + document.querySelectorAll('[data-demo="density-upload"]').forEach((upload) => { + upload.items = [ + {id: 'a', name: 'приказ-о-распродаже.pdf', fileSize: '420 КБ', state: 'process', progress: 30}, + {id: 'b', name: 'баннер-1920x600.jpg', fileSize: '1,8 МБ', state: 'process', progress: 70}, + {id: 'c', name: 'цены-ноябрь.xlsx', fileSize: '96 КБ', state: 'done', progress: 100}, + ]; + }); +})(); diff --git a/examples/recipes/file-upload-progress/overview/index.css b/examples/recipes/file-upload-progress/overview/index.css new file mode 100644 index 000000000..dc277976c --- /dev/null +++ b/examples/recipes/file-upload-progress/overview/index.css @@ -0,0 +1,7 @@ +.upload-corner { + position: fixed; + inset-block-end: var(--sf-space-1); + inset-inline-end: var(--sf-space-1); + inline-size: min(var(--sf-g1), calc(100% - var(--sf-space-2))); + z-index: 2; +} diff --git a/examples/recipes/file-upload-progress/overview/index.html b/examples/recipes/file-upload-progress/overview/index.html new file mode 100644 index 000000000..dd242b1de --- /dev/null +++ b/examples/recipes/file-upload-progress/overview/index.html @@ -0,0 +1,12 @@ +
+
+
+

Документы к новости «Осенняя распродажа»

+ +
+ +
diff --git a/examples/recipes/file-upload-progress/overview/index.js b/examples/recipes/file-upload-progress/overview/index.js new file mode 100644 index 000000000..79457d803 --- /dev/null +++ b/examples/recipes/file-upload-progress/overview/index.js @@ -0,0 +1,85 @@ +(async () => { + // Пачка уходит в угол, если файлов больше 10 или загрузка займёт больше 30 секунд. + const CORNER_FILES = 10; + const CORNER_SECONDS = 30; + const SPEED = 2 * 1024 * 1024; // байт в секунду — оценка по последней загрузке + const toCorner = (files) => files.length > CORNER_FILES || files.reduce((sum, file) => sum + file.size, 0) / SPEED > CORNER_SECONDS; + + const row = (id, name, size, state, progress, error) => ({ + id, name, fileSize: size, state, progress, + ...(error ? {errorMessage: error, retryText: 'Повторить'} : {}), + }); + const sample = () => [ + row('a', 'приказ-о-распродаже.pdf', '420 КБ', 'process', 0), + row('b', 'баннер-1920x600.jpg', '1,8 МБ', 'process', 0), + row('c', 'цены-ноябрь.xlsx', '96 КБ', 'process', 0), + ]; + // Панель в углу скрыта и загрузится, когда её покажут: ждём только видимые части. + await Promise.all(['sf-file-upload', 'sf-segmented'].map((tag) => customElements.whenDefined(tag))); + const upload = document.querySelector('#upload'); + const corner = document.querySelector('#corner'); + const batch = document.querySelector('#batch'); + let timer = 0; + + const stop = () => { clearInterval(timer); timer = 0; }; + const drive = (items, failId) => { + stop(); + upload.items = items; + timer = setInterval(() => { + const next = upload.items.map((item) => { + if (item.state !== 'process') return item; + const progress = Math.min(100, (item.progress || 0) + 12); + if (item.id === failId && progress >= 62) return {...item, state: 'error', progress: 62, errorMessage: 'связь прервалась на 62 %', retryText: 'Повторить'}; + return {...item, progress, state: progress >= 100 ? 'done' : 'process'}; + }); + upload.items = next; + if (next.every((item) => item.state !== 'process')) { + stop(); + if (!next.some((item) => item.state === 'error')) SF.notify({status: 'success', title: 'Файлы загружены', text: `${next.length} файла в «Документах».`}); + } + }, 350); + }; + const sendToCorner = (total) => { + stop(); + upload.items = []; + corner.hidden = false; + let done = 0; + batch.setAttribute('total', String(total)); + batch.setAttribute('value', '0'); + batch.setAttribute('run-state', 'running'); + batch.removeAttribute('retryable'); + timer = setInterval(() => { + done = Math.min(total, done + 3); + batch.setAttribute('value', String(done)); + batch.setAttribute('remaining', String(Math.round((total - done) * 0.8))); + if (done < total) return; + stop(); + batch.setAttribute('run-state', 'partial'); + batch.setAttribute('result-text', `Загружено ${total - 2} из ${total}. Два файла не загрузились.`); + batch.errors = [{text: 'IMG_2291.HEIC: такие файлы нельзя'}, {text: 'IMG_2307.jpg: связь прервалась'}]; + batch.setAttribute('retryable', ''); + }, 400); + }; + const show = (state) => { + stop(); + corner.hidden = true; + if (state === 'empty') upload.items = []; + if (state === 'run') drive(sample(), null); + if (state === 'error') drive(sample(), 'b'); + if (state === 'many') sendToCorner(48); + if (state === 'done') upload.items = sample().map((item) => ({...item, state: 'done', progress: 100})); + }; + + upload.addEventListener('change', (event) => { + const files = [...(event.target.files || [])]; + if (!files.length) return; + if (toCorner(files)) { sendToCorner(files.length); return; } + drive((upload.items || []).concat(files.map((file, index) => row(`u${Date.now()}${index}`, file.name, `${Math.max(1, Math.round(file.size / 1024))} КБ`, 'process', 0))), null); + }); + upload.addEventListener('sf-file-upload-retry', () => { + drive(upload.items.map((item) => item.state === 'error' ? {...item, state: 'process', progress: 62} : item), null); + }); + batch.addEventListener('sf-progress-run-cancel', () => { stop(); corner.hidden = true; }); + document.querySelector('#upload-state').addEventListener('sf-button-group-change', (event) => show(event.detail?.value ?? 'run')); + show('run'); +})(); diff --git a/examples/recipes/file-upload-progress/phone/index.html b/examples/recipes/file-upload-progress/phone/index.html new file mode 100644 index 000000000..0b3275f68 --- /dev/null +++ b/examples/recipes/file-upload-progress/phone/index.html @@ -0,0 +1,4 @@ +
+ + +
diff --git a/examples/recipes/file-upload-progress/phone/index.js b/examples/recipes/file-upload-progress/phone/index.js new file mode 100644 index 000000000..bd52f9f7d --- /dev/null +++ b/examples/recipes/file-upload-progress/phone/index.js @@ -0,0 +1,10 @@ +(async () => { + await Promise.all(['sf-file-upload', 'sf-progress-run'].map((tag) => customElements.whenDefined(tag))); + document.querySelector('#phone-upload').items = [ + {id: 'p1', name: 'IMG_2291.jpg', fileSize: '3,1 МБ', state: 'process', progress: 40}, + {id: 'p2', name: 'IMG_2292.jpg', fileSize: '2,9 МБ', state: 'done', progress: 100}, + ]; + const batch = document.querySelector('#phone-batch'); + batch.setAttribute('total', '48'); + batch.setAttribute('value', '30'); +})(); diff --git a/examples/recipes/file-upload-progress/states/index.html b/examples/recipes/file-upload-progress/states/index.html new file mode 100644 index 000000000..b8d877be1 --- /dev/null +++ b/examples/recipes/file-upload-progress/states/index.html @@ -0,0 +1,35 @@ +
+
+
+ + Пусто: зона и форматы +
+
+ + Доля ещё не известна: полоса бежит без числа +
+
+ + Ошибка: причина своей строкой и «Повторить» +
+
+ + Много: пачка в углу — «N из M», осталось, отмена +
+
+ + Итог с ошибками: до крестика, «Повторить» +
+
+
+ + договор-поставки-2026.pdf · 1,4 из 2,2 МБ +
+ Вложение в сообщении чата: кольцо доли у имени +
+
+ + Нет прав: зона выключена и объясняет почему +
+
+
diff --git a/examples/recipes/file-upload-progress/states/index.js b/examples/recipes/file-upload-progress/states/index.js new file mode 100644 index 000000000..f3c8ed123 --- /dev/null +++ b/examples/recipes/file-upload-progress/states/index.js @@ -0,0 +1,18 @@ +(async () => { + await Promise.all(['sf-file-upload', 'sf-progress-run'].map((tag) => customElements.whenDefined(tag))); + document.querySelector('#state-unknown').items = [{id: 'x', name: 'архив-фото.zip', fileSize: '84 МБ', state: 'process'}]; + document.querySelector('#state-error').items = [ + {id: 'y', name: 'баннер-1920x600.jpg', fileSize: '1,8 МБ', state: 'error', progress: 62, errorMessage: 'связь прервалась на 62 %', retryText: 'Повторить'}, + {id: 'z', name: 'приказ.pdf', fileSize: '420 КБ', state: 'done', progress: 100}, + ]; + const many = document.querySelector('#state-many'); + many.setAttribute('total', '48'); + many.setAttribute('value', '18'); + many.setAttribute('remaining', '24'); + const partial = document.querySelector('#state-partial'); + partial.setAttribute('total', '48'); + partial.setAttribute('value', '48'); + partial.setAttribute('run-state', 'partial'); + partial.setAttribute('result-text', 'Загружено 46 из 48. Два файла не загрузились.'); + partial.errors = [{text: 'IMG_2291.HEIC: такие файлы нельзя'}, {text: 'IMG_2307.jpg: связь прервалась'}]; +})(); diff --git a/examples/recipes/first-paint/density/index.html b/examples/recipes/first-paint/density/index.html new file mode 100644 index 000000000..64ca2bf94 --- /dev/null +++ b/examples/recipes/first-paint/density/index.html @@ -0,0 +1,12 @@ +
+
+
+ + обычная +
+
+ + компактная +
+
+
diff --git a/examples/recipes/first-paint/do-dont/index.html b/examples/recipes/first-paint/do-dont/index.html new file mode 100644 index 000000000..54c5092a5 --- /dev/null +++ b/examples/recipes/first-paint/do-dont/index.html @@ -0,0 +1,12 @@ +
+
+
+
Правильно — скелет на месте строк, форма раздела видна сразу
+
+
+
+
Неправильно — спиннер на весь раздел: формы нет, потом всё прыгает
+
+
+
+
diff --git a/examples/recipes/first-paint/overview/index.css b/examples/recipes/first-paint/overview/index.css new file mode 100644 index 000000000..8cf4c48ef --- /dev/null +++ b/examples/recipes/first-paint/overview/index.css @@ -0,0 +1,10 @@ +.shell-menu { flex: 0 0 var(--sf-f6); } +.news-tile { + display: flex; + flex-direction: column; + gap: var(--sf-space-1\/4); + padding: var(--sf-space-1); + border: var(--sf-px) solid var(--sf-outline-variant); + border-radius: var(--sf-radius--surface); + background: var(--sf-surface-card); +} diff --git a/examples/recipes/first-paint/overview/index.html b/examples/recipes/first-paint/overview/index.html new file mode 100644 index 000000000..e0751046a --- /dev/null +++ b/examples/recipes/first-paint/overview/index.html @@ -0,0 +1,22 @@ +
+
+
+
+ +
+
+

Новости

+
+ + +
+
+
+
+
+
+
+
diff --git a/examples/recipes/first-paint/overview/index.js b/examples/recipes/first-paint/overview/index.js new file mode 100644 index 000000000..051cd2b9c --- /dev/null +++ b/examples/recipes/first-paint/overview/index.js @@ -0,0 +1,77 @@ +(async () => { + const MENU = [ + {id: 'dash', label: 'Обзор', icon: 'dashboard', href: '#dash'}, + {id: 'news', label: 'Новости', icon: 'newspaper', href: '#news', current: true}, + {id: 'pages', label: 'Страницы', icon: 'description', href: '#pages'}, + {id: 'shop', label: 'Магазин', icon: 'storefront', href: '#shop'}, + {id: 'files', label: 'Файлы', icon: 'folder', href: '#files'}, + {id: 'users', label: 'Пользователи', icon: 'group', href: '#users'}, + ]; + const ROWS = [ + {id: '1', icon: 'newspaper', text: 'Осенняя распродажа: скидки до 30 %', supporting: 'Опубликовано · 14 ноября · Анна Котова'}, + {id: '2', icon: 'newspaper', text: 'Новые улуны из Фуцзяня', supporting: 'Черновик · 13 ноября · Сергей Иванов'}, + {id: '3', icon: 'newspaper', text: 'График работы в праздники', supporting: 'Опубликовано · 10 ноября · Анна Котова'}, + {id: '4', icon: 'newspaper', text: 'Как заваривать пуэр', supporting: 'Опубликовано · 2 ноября · Ирина Котова'}, + ]; + const TILES = [['24', 'опубликовано'], ['3', 'черновика'], ['1 240', 'просмотров за неделю']]; + await Promise.all(['sf-menu', 'sf-list', 'sf-button', 'sf-segmented'].map((tag) => customElements.whenDefined(tag))); + const $ = (selector) => document.querySelector(selector); + const menu = $('#admin-menu'); + const tiles = $('#tiles'); + const place = $('#list-place'); + const list = $('#news'); + const refresh = $('#refresh'); + let timer = 0; + + // Меню печатает сервер: оно в первом кадре и скелетом не рисуется. + menu.items = MENU; + menu.addEventListener('sf-menu-navigate', (event) => event.preventDefault()); + + const skeletonTiles = () => { + tiles.setAttribute('aria-busy', 'true'); + tiles.innerHTML = TILES.map(() => '').join(''); + }; + const realTiles = () => { + tiles.removeAttribute('aria-busy'); + tiles.innerHTML = TILES.map(([value, label]) => `
${value}${label}
`).join(''); + }; + const firstFrame = () => { + place.querySelector('sf-empty-state')?.remove(); + list.hidden = false; + list.items = []; + list.setAttribute('loading', ''); + skeletonTiles(); + }; + const empty = (kind, heading, text) => { + list.hidden = true; + const state = document.createElement('sf-empty-state'); + state.setAttribute('kind', kind); + state.setAttribute('size', '1/2'); + state.setAttribute('heading', heading); + state.setAttribute('text', text); + place.append(state); + }; + const load = (ms, then) => { + clearTimeout(timer); + firstFrame(); + refresh.setAttribute('loading', ''); + timer = setTimeout(() => { + refresh.removeAttribute('loading'); + list.removeAttribute('loading'); + list.items = ROWS; + realTiles(); + then?.(); + }, ms); + }; + const show = (speed) => { + clearTimeout(timer); + if (speed === 'first') { firstFrame(); return; } + if (speed === 'fast') load(300); + if (speed === 'slow') load(3000); + if (speed === 'error') load(1200, () => { tiles.replaceChildren(); empty('error', 'Не удалось загрузить новости', 'Сервер не ответил за 30 секунд.'); }); + if (speed === 'empty') load(600, () => { tiles.replaceChildren(); empty('first-use', 'Новостей пока нет', 'Первая новость появится на сайте сразу после публикации.'); }); + }; + refresh.addEventListener('click', () => load(1500)); + $('#speed').addEventListener('sf-button-group-change', (event) => show(event.detail?.value ?? 'fast')); + show('fast'); +})(); diff --git a/examples/recipes/first-paint/phone/index.html b/examples/recipes/first-paint/phone/index.html new file mode 100644 index 000000000..d9a4ad6c4 --- /dev/null +++ b/examples/recipes/first-paint/phone/index.html @@ -0,0 +1,7 @@ +
+ + +
diff --git a/examples/recipes/first-paint/states/index.html b/examples/recipes/first-paint/states/index.html new file mode 100644 index 000000000..acea4763b --- /dev/null +++ b/examples/recipes/first-paint/states/index.html @@ -0,0 +1,34 @@ +
+
+
+ + Первый кадр: список сам в загрузке +
+
+ + Пусто +
+
+ + Ошибка +
+
+ + Много: «Показать ещё», скелет строк на месте следующей порции +
+
+
+ + +
+ Кнопка в работе: дуга в цвет кнопки +
+
+
+ + Готовим файл… +
+ Малое место без формы: спиннер с подписью +
+
+
diff --git a/examples/recipes/first-paint/states/index.js b/examples/recipes/first-paint/states/index.js new file mode 100644 index 000000000..7529da034 --- /dev/null +++ b/examples/recipes/first-paint/states/index.js @@ -0,0 +1,7 @@ +(async () => { + await customElements.whenDefined('sf-list'); + document.querySelector('#state-more').items = [ + {id: '1', icon: 'newspaper', text: 'Осенняя распродажа: скидки до 30 %', supporting: 'Опубликовано · 14 ноября'}, + {id: '2', icon: 'newspaper', text: 'Новые улуны из Фуцзяня', supporting: 'Черновик · 13 ноября'}, + ]; +})(); diff --git a/examples/recipes/hero-and-promo/density/index.css b/examples/recipes/hero-and-promo/density/index.css new file mode 100644 index 000000000..fa84b6e5b --- /dev/null +++ b/examples/recipes/hero-and-promo/density/index.css @@ -0,0 +1 @@ +.promo { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: var(--sf-space-1); padding: var(--sf-space-1); border-radius: var(--sf-radius--surface); background: var(--sf-primary-container); color: var(--sf-on-primary-container); } diff --git a/examples/recipes/hero-and-promo/density/index.html b/examples/recipes/hero-and-promo/density/index.html new file mode 100644 index 000000000..9be671f77 --- /dev/null +++ b/examples/recipes/hero-and-promo/density/index.html @@ -0,0 +1,10 @@ +
+
+ +
Обычная — сайт
+
+
+ +
Компактная — админка
+
+
diff --git a/examples/recipes/hero-and-promo/do-dont/index.html b/examples/recipes/hero-and-promo/do-dont/index.html new file mode 100644 index 000000000..1b60cbecd --- /dev/null +++ b/examples/recipes/hero-and-promo/do-dont/index.html @@ -0,0 +1,10 @@ +
+
+
Правильно — одна главная кнопка, вторая с рамкой
+
+
+
+
Неправильно — три залитые кнопки спорят, какая главная
+
+
+
diff --git a/examples/recipes/hero-and-promo/overview/index.css b/examples/recipes/hero-and-promo/overview/index.css new file mode 100644 index 000000000..ed6dc3d86 --- /dev/null +++ b/examples/recipes/hero-and-promo/overview/index.css @@ -0,0 +1,19 @@ +.hero { position: relative; overflow: hidden; padding: var(--sf-space-5) var(--sf-space-3); border: var(--sf-px) solid var(--sf-outline-variant); border-radius: var(--sf-radius--surface); background: var(--sf-surface-page); } +.hero-dots { display: none; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle, light-dark(var(--sf-blue-50--alfa-24), var(--sf-blue-50--alfa-32)) calc(var(--sf-px) * 1.5), transparent calc(var(--sf-px) * 2)) 0 0 / var(--sf-space-1) var(--sf-space-1); mask: radial-gradient(ellipse 70% 80% at 50% 50%, transparent 30%, #000 90%); } +.hero.is-expressive .hero-dots { display: block; } +.hero-in { position: relative; display: flex; flex-direction: column; align-items: center; gap: var(--sf-space-1); max-inline-size: 44rem; margin: 0 auto; text-align: center; } +.hero-eyebrow { margin: 0; color: var(--sf-primary); font-size: var(--sf-text-size-1\/2); line-height: var(--sf-text-height-1\/2); font-weight: var(--sf-font-weight-medium); } +.hero-title { margin: 0; font-weight: var(--sf-font-weight-medium); text-wrap: balance; } +.hero.is-expressive .hero-accent { background: linear-gradient(90deg, light-dark(var(--sf-blue-50), var(--sf-blue-80)), light-dark(var(--sf-violet-50), var(--sf-violet-80))); background-clip: text; -webkit-background-clip: text; color: transparent; box-decoration-break: clone; } +.hero-lead { margin: 0; color: var(--sf-on-surface-variant); font-size: var(--sf-text-size-2); line-height: var(--sf-text-height-2); text-wrap: pretty; } +.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sf-space-1\/3); margin-block-start: var(--sf-space-1); } +.promo { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: var(--sf-space-1); padding: var(--sf-space-1) var(--sf-space-1) var(--sf-space-1) var(--sf-space-2); border-radius: var(--sf-radius--surface); background: var(--sf-primary-container); color: var(--sf-on-primary-container); } +.promo-icon { color: var(--sf-on-primary-container); } +@media (max-width: 37.5rem) { + .hero { padding: var(--sf-space-3) var(--sf-space-1); } + .hero-actions { flex-direction: column; align-self: stretch; } + .hero-actions > sf-button > * { inline-size: 100%; } + .promo { grid-template-columns: auto minmax(0, 1fr) auto; padding-inline-start: var(--sf-space-1); } + .promo-action { grid-column: 2 / -1; grid-row: 2; } + .promo-close { grid-column: 3; grid-row: 1; } +} diff --git a/examples/recipes/hero-and-promo/overview/index.html b/examples/recipes/hero-and-promo/overview/index.html new file mode 100644 index 000000000..b1e3670bf --- /dev/null +++ b/examples/recipes/hero-and-promo/overview/index.html @@ -0,0 +1,21 @@ + +
+
+ +
+

SIMAI Framework 5

+

Сайты и админки на одной основе

+

Компоненты, темы и рецепты для сайтов Larena, порталов и документации — один набор, одна линейка размеров.

+
+ + +
+
+
+ +
diff --git a/examples/recipes/hero-and-promo/overview/index.js b/examples/recipes/hero-and-promo/overview/index.js new file mode 100644 index 000000000..b3089ff5f --- /dev/null +++ b/examples/recipes/hero-and-promo/overview/index.js @@ -0,0 +1,12 @@ +Promise.all(['sf-button', 'sf-button-close'].map((t) => customElements.whenDefined(t))).then(() => { + const hero = document.getElementById('hero'); + document.getElementById('hero-strict').addEventListener('change', (event) => { + hero.classList.toggle('is-expressive', !event.target.checked); + }); + document.querySelector('.promo-close').addEventListener('click', (event) => { + event.currentTarget.closest('.promo').hidden = true; + hero.querySelector('h1').setAttribute('tabindex', '-1'); + hero.querySelector('h1').focus(); + docara.example.log('promo-hidden', {}); + }); +}); diff --git a/examples/recipes/hero-and-promo/states/index.css b/examples/recipes/hero-and-promo/states/index.css new file mode 100644 index 000000000..e7f10c2e7 --- /dev/null +++ b/examples/recipes/hero-and-promo/states/index.css @@ -0,0 +1,2 @@ +.photo { aspect-ratio: 16 / 9; border-radius: var(--sf-radius--surface); background: var(--sf-surface-container); } +.promo { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--sf-space-1); padding: var(--sf-space-1); border-radius: var(--sf-radius--surface); background: var(--sf-primary-container); color: var(--sf-on-primary-container); } diff --git a/examples/recipes/hero-and-promo/states/index.html b/examples/recipes/hero-and-promo/states/index.html new file mode 100644 index 000000000..728319b07 --- /dev/null +++ b/examples/recipes/hero-and-promo/states/index.html @@ -0,0 +1,18 @@ +
+
+ +
Картинка грузится: место держит пропорцию 16:9, подпись уже на месте
+
+
+ +
Картинка не загрузилась: заливка и значок, подпись остаётся
+
+
+ +
Много предложений: одна плашка на страницу, остальное — карточки раздела
+
+
diff --git a/examples/recipes/hero-and-promo/variants-2/index.css b/examples/recipes/hero-and-promo/variants-2/index.css new file mode 100644 index 000000000..5e62e3d43 --- /dev/null +++ b/examples/recipes/hero-and-promo/variants-2/index.css @@ -0,0 +1,6 @@ +.photo-fig { position: relative; display: flex; flex-direction: column; gap: var(--sf-space-1\/3); margin: 0; min-inline-size: 0; } +.photo { aspect-ratio: 16 / 9; border-radius: var(--sf-radius--surface); background: var(--sf-surface-container) center / cover no-repeat; } +.photo-over { position: absolute; inset: auto 0 0 0; display: flex; flex-direction: column; padding: var(--sf-space-3) var(--sf-space-1) var(--sf-space-1); color: var(--sf-white); border-radius: 0 0 var(--sf-radius--surface) var(--sf-radius--surface); } +.photo-over span { font-size: var(--sf-text-size-1\/2); line-height: var(--sf-text-height-1\/2); } +.is-soft .photo-over { padding-block-start: var(--sf-space-5); background: linear-gradient(to top, var(--sf-black--alfa-64), var(--sf-black--alfa-48) 40%, var(--sf-black--alfa-12) 80%, transparent); } +.is-plate .photo-over { padding: var(--sf-space-1\/2) var(--sf-space-1); background: var(--sf-black--alfa-64); } diff --git a/examples/recipes/hero-and-promo/variants-2/index.html b/examples/recipes/hero-and-promo/variants-2/index.html new file mode 100644 index 000000000..eff6d8001 --- /dev/null +++ b/examples/recipes/hero-and-promo/variants-2/index.html @@ -0,0 +1,14 @@ +
+
+ +
Алтай, осень · фото Ольги Седовой
+
+
+ +
Алтай, осеньМаршрут на три дня, 42 км
+
+
+ +
Алтай, осеньМаршрут на три дня, 42 км, ночёвки в палатках у озёр
+
+
diff --git a/examples/recipes/hero-and-promo/variants-2/index.js b/examples/recipes/hero-and-promo/variants-2/index.js new file mode 100644 index 000000000..91389185a --- /dev/null +++ b/examples/recipes/hero-and-promo/variants-2/index.js @@ -0,0 +1,3 @@ +// Flat placeholder until the documentation illustration set is in place. +const hills = 'data:image/svg+xml,' + encodeURIComponent(''); +document.querySelectorAll('.photo').forEach((el) => { el.style.backgroundImage = `url("${hills}")`; }); diff --git a/examples/recipes/hero-and-promo/variants/index.css b/examples/recipes/hero-and-promo/variants/index.css new file mode 100644 index 000000000..273dabeec --- /dev/null +++ b/examples/recipes/hero-and-promo/variants/index.css @@ -0,0 +1,5 @@ +.hero { position: relative; overflow: hidden; padding: var(--sf-space-3) var(--sf-space-1); border: var(--sf-px) solid var(--sf-outline-variant); border-radius: var(--sf-radius--surface); background: var(--sf-surface-page); } +.hero-in { display: flex; flex-direction: column; align-items: center; gap: var(--sf-space-1\/2); max-inline-size: 44rem; margin: 0 auto; text-align: center; } +.hero-eyebrow { margin: 0; color: var(--sf-primary); font-size: var(--sf-text-size-1\/2); line-height: var(--sf-text-height-1\/2); font-weight: var(--sf-font-weight-medium); } +.hero-title { margin: 0; font-weight: var(--sf-font-weight-medium); text-wrap: balance; } +.hero-lead { margin: 0; color: var(--sf-on-surface-variant); } diff --git a/examples/recipes/hero-and-promo/variants/index.html b/examples/recipes/hero-and-promo/variants/index.html new file mode 100644 index 000000000..a92cd7089 --- /dev/null +++ b/examples/recipes/hero-and-promo/variants/index.html @@ -0,0 +1,7 @@ +
+
+

Larena

+

Вход в админку сайта

+

Магазин «Аквабур» · shop.example.ru

+
+
diff --git a/examples/recipes/list-bottom/density/index.css b/examples/recipes/list-bottom/density/index.css new file mode 100644 index 000000000..ce88ab11d --- /dev/null +++ b/examples/recipes/list-bottom/density/index.css @@ -0,0 +1,3 @@ +.list-foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sf-space-1\/3); padding-block-start: var(--sf-space-1\/2); border-block-start: var(--sf-px) solid var(--sf-outline-variant); } +.list-range { color: var(--sf-on-surface-variant); font-size: var(--sf-text-size-1\/2); line-height: var(--sf-text-height-1\/2); font-variant-numeric: tabular-nums; white-space: nowrap; } +.list-nav { margin-inline-start: auto; } diff --git a/examples/recipes/list-bottom/density/index.html b/examples/recipes/list-bottom/density/index.html new file mode 100644 index 000000000..a2003cb56 --- /dev/null +++ b/examples/recipes/list-bottom/density/index.html @@ -0,0 +1,10 @@ +
+
+
41–60 из 1 240
+
Обычная — каталог магазина
+
+
+
41–60 из 240
+
Компактная — админка
+
+
diff --git a/examples/recipes/list-bottom/do-dont/index.html b/examples/recipes/list-bottom/do-dont/index.html new file mode 100644 index 000000000..eaa1d7dc3 --- /dev/null +++ b/examples/recipes/list-bottom/do-dont/index.html @@ -0,0 +1,10 @@ +
+
+
Правильно — «Показать ещё» отдельно, по центру
+
+
+
+
Неправильно — «Показать ещё» и номера в одной строке спорят друг с другом
+
+
+
diff --git a/examples/recipes/list-bottom/overview/index.css b/examples/recipes/list-bottom/overview/index.css new file mode 100644 index 000000000..e34d13e9e --- /dev/null +++ b/examples/recipes/list-bottom/overview/index.css @@ -0,0 +1,9 @@ +.list-foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sf-space-1\/3); padding-block-start: var(--sf-space-1\/2); border-block-start: var(--sf-px) solid var(--sf-outline-variant); } +.list-range { color: var(--sf-on-surface-variant); font-size: var(--sf-text-size-1\/2); line-height: var(--sf-text-height-1\/2); font-variant-numeric: tabular-nums; white-space: nowrap; } +.list-nav { margin-inline-start: auto; } +.list-foot.is-center { justify-content: center; } +.list-foot.is-center .list-nav { margin-inline-start: 0; } +@media (max-width: 37.5rem) { + .list-foot .list-size > button { margin-inline-start: auto; } + .list-foot .list-nav { flex-basis: 100%; display: flex; justify-content: center; margin-inline-start: 0; } +} diff --git a/examples/recipes/list-bottom/overview/index.html b/examples/recipes/list-bottom/overview/index.html new file mode 100644 index 000000000..afad9f434 --- /dev/null +++ b/examples/recipes/list-bottom/overview/index.html @@ -0,0 +1,9 @@ + +
+ +
+ 1–20 из 340 + +
+
+
diff --git a/examples/recipes/list-bottom/overview/index.js b/examples/recipes/list-bottom/overview/index.js new file mode 100644 index 000000000..91e4b17d4 --- /dev/null +++ b/examples/recipes/list-bottom/overview/index.js @@ -0,0 +1,43 @@ +const NAMES = ['Иванов А.', 'ООО «Ромашка»', 'Петрова Е.', 'Сидоров К.', 'ИП Белов', 'Кузнецова М.']; +const rows = (from, n) => Array.from({length: n}, (_, i) => { + const k = from + i; + return {id: 'o' + k, text: `Заказ № ${10230 + k} · ${NAMES[k % NAMES.length]}`, supporting: `${(1200 + (k * 37) % 9000).toLocaleString('ru-RU')} ₽ · ${k % 3 ? 'оплачен' : 'ждёт оплаты'}`, icon: 'receipt_long'}; +}); +Promise.all(['sf-list', 'sf-pagination', 'sf-button', 'sf-segmented'].map((t) => customElements.whenDefined(t))).then(() => { + const $ = (id) => document.getElementById(id); + const list = $('orders'), pages = $('orders-pages'), range = $('orders-range'), size = $('orders-size'), foot = $('orders-foot'), scope = $('bottom-scope'); + const total = 340; + let kind = 'field', per = 20, page = 1, shown = 20; + const draw = () => { + if (kind === 'more') { list.items = rows(0, 5); return; } + const from = (page - 1) * per; + list.items = rows(from, 5); + range.textContent = `${from + 1}–${Math.min(from + per, total)} из ${total}`; + }; + $('bottom-kind').addEventListener('change', (event) => { + kind = event.detail.value; page = 1; shown = 20; + const admin = kind === 'field'; + scope.toggleAttribute('data-sf-density', admin); + if (admin) scope.setAttribute('data-sf-density', 'compact'); + pages.setAttribute('appearance', kind); + pages.setAttribute('size', admin ? '1/2' : '1'); + pages.setAttribute('current', '1'); + pages.setAttribute('total', kind === 'numbers' ? '1240' : String(total)); + size.hidden = !admin; range.hidden = !admin; + foot.classList.toggle('is-center', !admin); + draw(); + }); + pages.addEventListener('sf-pagination-change', (event) => { page = event.detail.current; pages.setAttribute('current', String(page)); draw(); }); + pages.addEventListener('sf-pagination-load-more', () => { + pages.setAttribute('show-more-busy', ''); + setTimeout(() => { pages.removeAttribute('show-more-busy'); shown = Math.min(total, shown + per); pages.setAttribute('current', String(Math.ceil(shown / per))); }, 700); + }); + size.addEventListener('sf-button-select', (event) => { + const id = event.detail?.id; if (!id) return; + per = Number(id); page = 1; + size.setAttribute('text', 'По ' + id); + pages.setAttribute('page-size', id); pages.setAttribute('current', '1'); + draw(); + }); + draw(); +}); diff --git a/examples/recipes/list-bottom/phone/index.css b/examples/recipes/list-bottom/phone/index.css new file mode 100644 index 000000000..e34d13e9e --- /dev/null +++ b/examples/recipes/list-bottom/phone/index.css @@ -0,0 +1,9 @@ +.list-foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sf-space-1\/3); padding-block-start: var(--sf-space-1\/2); border-block-start: var(--sf-px) solid var(--sf-outline-variant); } +.list-range { color: var(--sf-on-surface-variant); font-size: var(--sf-text-size-1\/2); line-height: var(--sf-text-height-1\/2); font-variant-numeric: tabular-nums; white-space: nowrap; } +.list-nav { margin-inline-start: auto; } +.list-foot.is-center { justify-content: center; } +.list-foot.is-center .list-nav { margin-inline-start: 0; } +@media (max-width: 37.5rem) { + .list-foot .list-size > button { margin-inline-start: auto; } + .list-foot .list-nav { flex-basis: 100%; display: flex; justify-content: center; margin-inline-start: 0; } +} diff --git a/examples/recipes/list-bottom/phone/index.html b/examples/recipes/list-bottom/phone/index.html new file mode 100644 index 000000000..3ec103771 --- /dev/null +++ b/examples/recipes/list-bottom/phone/index.html @@ -0,0 +1,18 @@ +
+
+
+ 1–20 из 340 + +
+
+
Админка: диапазон и размер сверху, переход снизу
+
+
+
+
Каталог: номера-ссылки
+
+
+
+
Лента: «Показать ещё»
+
+
diff --git a/examples/recipes/list-bottom/states/index.css b/examples/recipes/list-bottom/states/index.css new file mode 100644 index 000000000..933df38f7 --- /dev/null +++ b/examples/recipes/list-bottom/states/index.css @@ -0,0 +1,4 @@ +.list-foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sf-space-1\/3); padding-block-start: var(--sf-space-1\/2); border-block-start: var(--sf-px) solid var(--sf-outline-variant); } +.list-range { color: var(--sf-on-surface-variant); font-size: var(--sf-text-size-1\/2); line-height: var(--sf-text-height-1\/2); font-variant-numeric: tabular-nums; white-space: nowrap; } +.list-nav { margin-inline-start: auto; } +.list-foot.is-center { justify-content: center; } diff --git a/examples/recipes/list-bottom/states/index.html b/examples/recipes/list-bottom/states/index.html new file mode 100644 index 000000000..37260bc7c --- /dev/null +++ b/examples/recipes/list-bottom/states/index.html @@ -0,0 +1,28 @@ +
+
+ +
Пусто: низа нет, только пустое состояние
+
+
+
1–7 из 7
+
Одна страница: только диапазон, переход не нужен
+
+
+ +
+
Загрузка: «Показать ещё» ждёт ответа, строки — заготовка
+
+
+ +
Ошибка подгрузки: загруженное остаётся, «Повторить» на месте кнопки
+
+
+ + +
Первая и последняя страница: кнопки на краях гаснут, ряд той же ширины
+
+
+
41–60 из ~12 000
+
Очень много: число — оценка «~12 000», точное — по просьбе
+
+
diff --git a/examples/recipes/list-toolbar/density/index.html b/examples/recipes/list-toolbar/density/index.html new file mode 100644 index 000000000..6e0563d3c --- /dev/null +++ b/examples/recipes/list-toolbar/density/index.html @@ -0,0 +1,18 @@ +
+
+
+
+
+
+
+ обычная +
+
+
+
+
+
+ компактная +
+
+
diff --git a/examples/recipes/list-toolbar/overview/index.html b/examples/recipes/list-toolbar/overview/index.html new file mode 100644 index 000000000..d31de3863 --- /dev/null +++ b/examples/recipes/list-toolbar/overview/index.html @@ -0,0 +1,25 @@ +
+
+
+
+ +
+
+ + + + + + + +
+
+ + +
+
+ +
diff --git a/examples/recipes/list-toolbar/overview/index.js b/examples/recipes/list-toolbar/overview/index.js new file mode 100644 index 000000000..aed543ef8 --- /dev/null +++ b/examples/recipes/list-toolbar/overview/index.js @@ -0,0 +1,89 @@ +(async () => { + const ROWS = [ + {id: '1', title: 'Пуэр «Старое дерево», 100 г', sku: 'PU-0107', status: 'В продаже', stock: '34 шт.', price: '890 ₽'}, + {id: '2', title: 'Улун «Молочный», 50 г', sku: 'OL-0050', status: 'В продаже', stock: '8 шт.', price: '540 ₽'}, + {id: '3', title: 'Чайник глиняный, 250 мл', sku: 'TP-0250', status: 'Нет на складе', stock: '0', price: '2 400 ₽'}, + {id: '4', title: 'Габа «Алишань», 50 г', sku: 'GB-0012', status: 'Черновик', stock: '—', price: '1 150 ₽'}, + {id: '5', title: 'Белый «Шоу Мэй», 100 г', sku: 'WH-0100', status: 'В продаже', stock: '61 шт.', price: '720 ₽'}, + ]; + const COLUMNS = [ + {key: 'title', label: 'Название', list: 'title'}, + {key: 'sku', label: 'Артикул', list: 'supporting'}, + {key: 'status', label: 'Статус', list: 'fact'}, + {key: 'stock', label: 'Остаток', list: 'fact'}, + {key: 'price', label: 'Цена', list: 'fact'}, + ]; + const VIEWS = {all: 'Все товары', drafts: 'Мои черновики', out: 'Нет на складе'}; + await Promise.all(['sf-segmented', 'sf-button', 'sf-settings', 'sf-input', 'sf-view-table'].map((tag) => customElements.whenDefined(tag))); + const $ = (selector) => document.querySelector(selector); + const table = $('#goods'); + const views = $('#views'); + let query = ''; + let view = 'all'; + + const rows = () => ROWS.filter((row) => (!query || (row.title + row.sku).toLowerCase().includes(query)) + && (view !== 'drafts' || row.status === 'Черновик') && (view !== 'out' || row.status === 'Нет на складе')); + const show = () => { + const found = rows(); + table.setAttribute('empty-text', 'Ничего не нашлось'); + table.setAttribute('empty-description', 'Уберите условие фильтра или измените запрос.'); + table.rows = found; + }; + table.columns = COLUMNS; + show(); + + // Сохранённые виды — кнопка с меню сразу после фильтра и колонок; «Сохранить как вид» — последним. + views.menu = [ + {id: 'all', text: VIEWS.all}, + {id: 'drafts', text: VIEWS.drafts}, + {id: 'out', text: VIEWS.out}, + {kind: 'separator'}, + {id: 'save', text: 'Сохранить как вид…', icon: 'bookmark_add'}, + ]; + views.addEventListener('sf-button-select', (event) => { + const id = event.detail?.id; + if (!VIEWS[id]) return; + view = id; + views.setAttribute('text', VIEWS[id]); + show(); + }); + $('#filter').items = [ + {type: 'group', text: 'Статус', items: [ + {id: 'st-sale', type: 'switch', text: 'В продаже', value: true}, + {id: 'st-out', type: 'switch', text: 'Нет на складе', value: false}, + {id: 'st-draft', type: 'switch', text: 'Черновик', value: false}, + ]}, + {type: 'group', text: 'Цена', items: [{id: 'price', type: 'range', text: 'До', value: 3000, min: 0, max: 5000, step: 100, unit: '₽'}]}, + ]; + $('#columns').items = [ + {type: 'group', text: 'Колонки', items: [{id: 'columns', type: 'fields', text: 'Колонки', sortable: true, pinnable: true, options: [ + {id: 'title', text: 'Название', checked: true, pinned: true}, + {id: 'sku', text: 'Артикул', checked: true}, + {id: 'status', text: 'Статус', checked: true}, + {id: 'stock', text: 'Остаток', checked: true}, + {id: 'price', text: 'Цена', checked: true}, + {id: 'brand', text: 'Производитель'}, + {id: 'changed', text: 'Изменено'}, + ]}]}, + ]; + $('#search').addEventListener('input', () => { + query = String($('#search').value ?? '').trim().toLowerCase(); + show(); + }); + $('#layout').addEventListener('sf-button-group-change', (event) => table.setAttribute('layout', event.detail?.value ?? 'table')); + $('#table-state').addEventListener('sf-button-group-change', (event) => { + const state = event.detail?.value; + table.setAttribute('data-state', 'auto'); + $('#filter-button').setAttribute('text', state === 'filtered' ? 'Фильтр · 2' : 'Фильтр'); + if (state === 'ready') show(); + if (state === 'filtered') table.rows = ROWS.filter((row) => row.status === 'В продаже'); + if (state === 'nothing') { + table.rows = []; + table.setAttribute('empty-text', 'Ничего не нашлось'); + table.setAttribute('empty-description', 'Уберите условие фильтра или измените запрос.'); + table.setAttribute('data-state', 'empty'); + } + if (state === 'loading') table.setAttribute('data-state', 'loading'); + if (state === 'error') { table.setAttribute('error-text', 'Не удалось загрузить товары'); table.setAttribute('data-state', 'error'); } + }); +})(); diff --git a/examples/recipes/list-toolbar/phone/index.html b/examples/recipes/list-toolbar/phone/index.html new file mode 100644 index 000000000..b70a28e63 --- /dev/null +++ b/examples/recipes/list-toolbar/phone/index.html @@ -0,0 +1,10 @@ +
+ +
+ + + + + +
+
diff --git a/examples/recipes/list-toolbar/states/index.html b/examples/recipes/list-toolbar/states/index.html new file mode 100644 index 000000000..b78ce359e --- /dev/null +++ b/examples/recipes/list-toolbar/states/index.html @@ -0,0 +1,23 @@ +
+
+
+ + Записей ещё нет: панель без фильтра и колонок — искать нечего +
+
+ + Ничего не нашлось: что не нашлось и что сделать +
+
+
+ + +
+ Фильтр включён: число условий в подписи кнопки +
+
+
+ Много видов: больше семи — в меню появляется поиск, «Все товары» всегда первым +
+
+
diff --git a/examples/recipes/list-toolbar/states/index.js b/examples/recipes/list-toolbar/states/index.js new file mode 100644 index 000000000..83aa133b2 --- /dev/null +++ b/examples/recipes/list-toolbar/states/index.js @@ -0,0 +1,6 @@ +(async () => { + await customElements.whenDefined('sf-button'); + document.querySelector('#many-views').menu = [ + 'Все товары', 'Мои черновики', 'Нет на складе', 'Скидки ноября', 'Новинки', 'Дороже 2 000 ₽', 'Без фото', 'Без описания', 'Чайники и посуда', + ].map((text, index) => ({id: 'v' + index, text})); +})(); diff --git a/examples/recipes/mail-chat-list/density/index.css b/examples/recipes/mail-chat-list/density/index.css new file mode 100644 index 000000000..89c623f45 --- /dev/null +++ b/examples/recipes/mail-chat-list/density/index.css @@ -0,0 +1 @@ +.box { padding: var(--sf-space-1\/4); border: var(--sf-px) solid var(--sf-outline-variant); border-radius: var(--sf-radius--surface); } diff --git a/examples/recipes/mail-chat-list/density/index.html b/examples/recipes/mail-chat-list/density/index.html new file mode 100644 index 000000000..54e5c0cfe --- /dev/null +++ b/examples/recipes/mail-chat-list/density/index.html @@ -0,0 +1,10 @@ +
+
+
+
Обычная — телефон
+
+
+
+
Компактная — почта и чат на компьютере
+
+
diff --git a/examples/recipes/mail-chat-list/density/index.js b/examples/recipes/mail-chat-list/density/index.js new file mode 100644 index 000000000..2f7f31ea4 --- /dev/null +++ b/examples/recipes/mail-chat-list/density/index.js @@ -0,0 +1,6 @@ +const at = (daysAgo, h, m) => { const d = new Date(); d.setDate(d.getDate() - daysAgo); d.setHours(h, m, 0, 0); return d.toISOString(); }; +const FEW = [ + {id: 'm2', text: 'Анна Белова', supporting: 'Договор поставки на декабрь', avatar: {text: 'АБ'}, count: 3, date: at(0, 11, 20)}, + {id: 'm3', text: 'Ассистент Pro', supporting: 'Нужен ответ по заявке № 4417', avatar: {icon: 'smart_toy'}, badge: {text: 'Ждёт', tone: 'warning'}, date: at(0, 9, 5)}, + {id: 'm4', text: 'Пётр Гаврилов', supporting: 'Годовой отчёт', avatar: {text: 'ПГ'}, count: 1, date: at(1, 18, 40)}]; +customElements.whenDefined('sf-list').then(() => document.querySelectorAll('sf-list[data-list="few"]').forEach((list) => { list.items = FEW; })); diff --git a/examples/recipes/mail-chat-list/do-dont/index.html b/examples/recipes/mail-chat-list/do-dont/index.html new file mode 100644 index 000000000..a8a9f6725 --- /dev/null +++ b/examples/recipes/mail-chat-list/do-dont/index.html @@ -0,0 +1,10 @@ +
+
+
Правильно — без фото инициалы на оттенке, у каждого свой
+
+
+
+
Неправильно — одинаковые серые человечки: не различить, кто писал
+
+
+
diff --git a/examples/recipes/mail-chat-list/overview/index.css b/examples/recipes/mail-chat-list/overview/index.css new file mode 100644 index 000000000..ecb39f4a5 --- /dev/null +++ b/examples/recipes/mail-chat-list/overview/index.css @@ -0,0 +1,8 @@ +.mail { display: grid; grid-template-columns: minmax(0, 24rem) minmax(0, 1fr); min-block-size: 28rem; border: var(--sf-px) solid var(--sf-outline-variant); border-radius: var(--sf-radius--surface); overflow: hidden; } +.mail-list { padding: var(--sf-space-1\/4); border-inline-end: var(--sf-px) solid var(--sf-outline-variant); max-block-size: 34rem; overflow: auto; min-inline-size: 0; } +.mail-read { display: flex; flex-direction: column; gap: var(--sf-space-1); padding: var(--sf-space-1) var(--sf-space-2); min-inline-size: 0; } +@media (max-width: 60rem) { + .mail { grid-template-columns: minmax(0, 1fr); } + .mail-list { border: 0; } + .mail-read { display: none; } +} diff --git a/examples/recipes/mail-chat-list/overview/index.html b/examples/recipes/mail-chat-list/overview/index.html new file mode 100644 index 000000000..323f606ef --- /dev/null +++ b/examples/recipes/mail-chat-list/overview/index.html @@ -0,0 +1,7 @@ +
+
+
+

Договор поставки на декабрь — пришлю после обеда

+ +
+
diff --git a/examples/recipes/mail-chat-list/overview/index.js b/examples/recipes/mail-chat-list/overview/index.js new file mode 100644 index 000000000..dd72c286b --- /dev/null +++ b/examples/recipes/mail-chat-list/overview/index.js @@ -0,0 +1,37 @@ +const at = (daysAgo, h, m) => { const d = new Date(); d.setDate(d.getDate() - daysAgo); d.setHours(h, m, 0, 0); return d.toISOString(); }; +const MAIL = [ + {id: 'm1', text: 'Новости SIMAI', supporting: 'Вышла новая версия SIMAI Framework', avatar: {icon: 'campaign', shape: 'square'}, pinned: true, date: at(0, 8, 0)}, + {id: 'm2', text: 'Анна Белова', supporting: 'Договор поставки на декабрь — пришлю после обеда', avatar: {text: 'АБ'}, count: 3, date: at(0, 11, 20)}, + {id: 'm3', text: 'Ассистент Pro', supporting: 'Нужен ответ по заявке № 4417', avatar: {icon: 'smart_toy'}, badge: {text: 'Ждёт', tone: 'warning'}, date: at(0, 9, 5)}, + {id: 'm4', text: 'Пётр Гаврилов', supporting: 'Годовой отчёт: последняя версия таблицы', avatar: {text: 'ПГ'}, count: 1, date: at(1, 18, 40)}, + {id: 'm5', text: 'ООО «Аквабур»', supporting: 'Счёт № 1182 за ноябрь', avatar: {text: 'АБ', shape: 'square'}, date: at(1, 10, 15)}, + {id: 'm6', text: 'Мария Кузнецова', supporting: 'Фото с объекта, 12 файлов', avatar: {text: 'МК'}, date: at(3, 16, 2)}]; +const OLDER = [ + {id: 'o1', text: 'Служба доставки', supporting: 'Заказ № 10231 доставлен', avatar: {icon: 'local_shipping', shape: 'square'}, date: at(7, 12, 0)}, + {id: 'o2', text: 'Ирина Седова', supporting: 'Встреча перенесена на четверг', avatar: {text: 'ИС'}, date: at(8, 9, 30)}, + {id: 'o3', text: 'Larena', supporting: 'Резервная копия готова', avatar: {icon: 'backup', shape: 'square'}, date: at(8, 3, 0)}, + {id: 'o4', text: 'Олег Миронов', supporting: 'Смета на монтаж', avatar: {text: 'ОМ'}, date: at(9, 14, 45)}]; +const ACTIONS = [{id: 'read', text: 'Прочитано', icon: 'drafts'}, {id: 'archive', text: 'В архив', icon: 'archive'}, {id: 'delete', text: 'Удалить', icon: 'delete', destructive: true}]; +const THREAD = [ + {id: 'f1', author: 'anna', 'author-name': 'Анна Белова', text: 'Добрый день! Договор поставки на декабрь почти готов.'}, + {id: 'f2', author: 'me', own: true, text: 'Спасибо. Объём тот же — 40 насосов?'}, + {id: 'f3', author: 'anna', 'author-name': 'Анна Белова', text: 'Да, и 12 фильтров сверху. Пришлю после обеда.'}]; +Promise.all(['sf-list', 'sf-list-feed'].map((t) => customElements.whenDefined(t))).then(() => { + const inbox = document.getElementById('inbox'); + let rows = MAIL.slice(), more = true; + const draw = () => { inbox.items = rows; inbox.actions = ACTIONS; inbox.toggleAttribute('has-more', more); }; + draw(); + document.getElementById('mail-thread').items = THREAD; + inbox.addEventListener('sf-list-open', (event) => { + const id = event.detail.id; + inbox.setAttribute('selected', id); + rows = rows.map((row) => { if (row.id !== id) return row; const {count, ...rest} = row; return rest; }); + draw(); + document.getElementById('mail-subject').textContent = rows.find((row) => row.id === id)?.supporting ?? ''; + }); + inbox.addEventListener('sf-list-load-more', () => { + if (!more) return; + more = false; + setTimeout(() => { rows = rows.concat(OLDER); draw(); }, 600); + }); +}); diff --git a/examples/recipes/mail-chat-list/states/index.css b/examples/recipes/mail-chat-list/states/index.css new file mode 100644 index 000000000..f6c25869a --- /dev/null +++ b/examples/recipes/mail-chat-list/states/index.css @@ -0,0 +1 @@ +.box { padding: var(--sf-space-1\/4); border: var(--sf-px) solid var(--sf-outline-variant); border-radius: var(--sf-radius--surface); max-block-size: 24rem; overflow: auto; } diff --git a/examples/recipes/mail-chat-list/states/index.html b/examples/recipes/mail-chat-list/states/index.html new file mode 100644 index 000000000..dd23a071b --- /dev/null +++ b/examples/recipes/mail-chat-list/states/index.html @@ -0,0 +1,18 @@ +
+
+
+
Первый кадр: строки — заготовка в размер данных
+
+
+
+
Пусто: одна строка о том, что писем нет
+
+
+
+
Ошибка: причина и что с письмами
+
+
+
+
Много: закреплённое сверху, «Ждёт», «Показать ещё»
+
+
diff --git a/examples/recipes/mail-chat-list/states/index.js b/examples/recipes/mail-chat-list/states/index.js new file mode 100644 index 000000000..c9a680ce3 --- /dev/null +++ b/examples/recipes/mail-chat-list/states/index.js @@ -0,0 +1,11 @@ +const at = (daysAgo, h, m) => { const d = new Date(); d.setDate(d.getDate() - daysAgo); d.setHours(h, m, 0, 0); return d.toISOString(); }; +const MANY = [ + {id: 'm1', text: 'Новости SIMAI', supporting: 'Вышла новая версия SIMAI Framework', avatar: {icon: 'campaign', shape: 'square'}, pinned: true, date: at(0, 8, 0)}, + {id: 'm2', text: 'Анна Белова', supporting: 'Договор поставки на декабрь', avatar: {text: 'АБ'}, count: 3, date: at(0, 11, 20)}, + {id: 'm3', text: 'Ассистент Pro', supporting: 'Нужен ответ по заявке № 4417', avatar: {icon: 'smart_toy'}, badge: {text: 'Ждёт', tone: 'warning'}, date: at(0, 9, 5)}, + {id: 'm4', text: 'Пётр Гаврилов', supporting: 'Годовой отчёт', avatar: {text: 'ПГ'}, count: 1, date: at(1, 18, 40)}, + {id: 'o2', text: 'Ирина Седова', supporting: 'Встреча перенесена на четверг', avatar: {text: 'ИС'}, date: at(8, 9, 30)}]; +customElements.whenDefined('sf-list').then(() => { + document.getElementById('empty-list').items = []; + document.getElementById('many-list').items = MANY; +}); diff --git a/examples/recipes/order-status/density/index.html b/examples/recipes/order-status/density/index.html new file mode 100644 index 000000000..00028b171 --- /dev/null +++ b/examples/recipes/order-status/density/index.html @@ -0,0 +1,12 @@ +
+
+
+ + обычная +
+
+ + компактная +
+
+
diff --git a/examples/recipes/order-status/density/index.js b/examples/recipes/order-status/density/index.js new file mode 100644 index 000000000..c4c951ecc --- /dev/null +++ b/examples/recipes/order-status/density/index.js @@ -0,0 +1,11 @@ +(async () => { + await customElements.whenDefined('sf-steps'); + document.querySelectorAll('[data-demo="density-steps"]').forEach((steps) => { + steps.items = [ + {label: 'Заказ принят', text: '12 ноября, 10:14'}, + {label: 'Собран на складе', text: '12 ноября, 15:40'}, + {label: 'Передан в службу доставки', text: 'ожидается 15 ноября'}, + {label: 'Получен'}, + ]; + }); +})(); diff --git a/examples/recipes/order-status/overview/index.html b/examples/recipes/order-status/overview/index.html new file mode 100644 index 000000000..d11c85777 --- /dev/null +++ b/examples/recipes/order-status/overview/index.html @@ -0,0 +1,21 @@ +
+
+
+

Заказ № 48 215

+

от 12 ноября · 5 070 ₽ · курьером

+
+
+
+
+
+

Где заказ

+ +
+
+

История

+ +
+
+
+
diff --git a/examples/recipes/order-status/overview/index.js b/examples/recipes/order-status/overview/index.js new file mode 100644 index 000000000..93951ad90 --- /dev/null +++ b/examples/recipes/order-status/overview/index.js @@ -0,0 +1,39 @@ +(async () => { + const L = ['Заказ принят', 'Собран на складе', 'Передан в службу доставки', 'Получен']; + const states = { + packed: {current: 1, items: [{label: L[0], text: '12 ноября, 10:14'}, {label: L[1], text: 'сегодня до 18:00'}, {label: L[2], text: 'ожидается 15 ноября'}, {label: L[3]}]}, + shipping: {current: 2, items: [{label: L[0], text: '12 ноября, 10:14'}, {label: L[1], text: '12 ноября, 15:40'}, {label: L[2], text: '13 ноября, 09:05 · ожидается 15 ноября'}, {label: L[3]}]}, + late: {current: 2, notice: ['warning', 'Доставка задерживается до 17 ноября', 'Склад перевозчика переполнен. Курьер позвонит накануне.'], + items: [{label: L[0], text: '12 ноября, 10:14'}, {label: L[1], text: '12 ноября, 15:40'}, {label: L[2], text: 'ожидается 17 ноября', state: 'error'}, {label: L[3]}]}, + cancelled: {current: 1, notice: ['error', 'Заказ отменён 12 ноября', 'Товара «Чайник глиняный» не оказалось на складе. Деньги вернутся на карту за 3 дня.'], + items: [{label: L[0], text: '12 ноября, 10:14'}, {label: L[1], text: 'отменён: нет товара', state: 'error'}, {label: L[2], state: 'skipped'}, {label: L[3], state: 'skipped'}]}, + done: {current: 4, items: [{label: L[0], text: '12 ноября, 10:14'}, {label: L[1], text: '12 ноября, 15:40'}, {label: L[2], text: '13 ноября, 09:05'}, {label: L[3], text: '15 ноября, 14:20'}]}, + }; + const anna = {name: 'Анна Котова', hue: 'teal'}; + const robot = {name: 'Робот', system: true}; + const history = [ + {id: 'h1', icon: 'local_shipping', actor: robot, time: '2026-11-13T09:05:00+03:00', title: 'передал заказ в СДЭК', text: 'Трек 1 234 567 890'}, + {id: 'h2', icon: 'chat_bubble', kind: 'comment', actor: anna, time: '2026-11-12T16:02:00+03:00', title: 'оставила комментарий', text: 'Клиент просит доставку после 18:00.'}, + {id: 'h3', icon: 'swap_horiz', actor: anna, time: '2026-11-12T15:40:00+03:00', title: 'изменила статус', change: {label: 'Статус', before: 'Принят', after: 'Собран'}}, + {id: 'h4', icon: 'edit', actor: anna, time: '2026-11-12T12:10:00+03:00', title: 'изменила адрес', change: {label: 'Адрес', before: 'Покровка, 10', after: 'Покровка, 12, кв. 4'}}, + {id: 'h5', icon: 'shopping_cart', actor: robot, time: '2026-11-12T10:14:00+03:00', title: 'принял заказ', text: '5 070 ₽, оплата картой'}, + ]; + await Promise.all(['sf-steps', 'sf-list-timeline', 'sf-segmented'].map((tag) => customElements.whenDefined(tag))); + const steps = document.querySelector('#order-steps'); + const notice = document.querySelector('#order-notice'); + const show = (name) => { + const state = states[name]; + steps.items = state.items; + steps.setAttribute('current', String(state.current)); + notice.replaceChildren(); + if (!state.notice) return; + const alert = document.createElement('sf-alert'); + alert.setAttribute('status', state.notice[0]); + alert.setAttribute('heading', state.notice[1]); + alert.setAttribute('supporting-text', state.notice[2]); + notice.append(alert); + }; + document.querySelector('#order-history').items = history; + document.querySelector('#order-state').addEventListener('sf-button-group-change', (event) => show(event.detail?.value ?? 'shipping')); + show('shipping'); +})(); diff --git a/examples/recipes/order-status/phone/index.html b/examples/recipes/order-status/phone/index.html new file mode 100644 index 000000000..bd35d0a98 --- /dev/null +++ b/examples/recipes/order-status/phone/index.html @@ -0,0 +1,4 @@ +
+ + +
diff --git a/examples/recipes/order-status/phone/index.js b/examples/recipes/order-status/phone/index.js new file mode 100644 index 000000000..36682c881 --- /dev/null +++ b/examples/recipes/order-status/phone/index.js @@ -0,0 +1,14 @@ +(async () => { + await Promise.all(['sf-steps', 'sf-list-timeline'].map((tag) => customElements.whenDefined(tag))); + document.querySelector('#phone-steps').items = [ + {label: 'Заказ принят', text: '12 ноября, 10:14'}, + {label: 'Собран на складе', text: '12 ноября, 15:40'}, + {label: 'Передан в службу доставки', text: 'ожидается 15 ноября'}, + {label: 'Получен'}, + ]; + const anna = {name: 'Анна Котова', hue: 'teal'}; + document.querySelector('#phone-history').items = [ + {id: 'h1', icon: 'local_shipping', actor: {name: 'Робот', system: true}, time: '2026-11-13T09:05:00+03:00', title: 'передал заказ в СДЭК', text: 'Трек 1 234 567 890'}, + {id: 'h2', icon: 'swap_horiz', actor: anna, time: '2026-11-12T15:40:00+03:00', title: 'изменила статус', change: {label: 'Статус', before: 'Принят', after: 'Собран'}}, + ]; +})(); diff --git a/examples/recipes/order-status/states/index.html b/examples/recipes/order-status/states/index.html new file mode 100644 index 000000000..e13468f87 --- /dev/null +++ b/examples/recipes/order-status/states/index.html @@ -0,0 +1,25 @@ +
+
+
+ + + Загрузка: скелет на месте этапов и истории +
+
+ + Ошибка загрузки +
+
+ + Пусто: истории ещё нет +
+
+ + Много: серия правок свёрнута, дальше — по запросу +
+
+ + Нет доступа +
+
+
diff --git a/examples/recipes/order-status/states/index.js b/examples/recipes/order-status/states/index.js new file mode 100644 index 000000000..bad9c504a --- /dev/null +++ b/examples/recipes/order-status/states/index.js @@ -0,0 +1,9 @@ +(async () => { + await customElements.whenDefined('sf-list-timeline'); + document.querySelector('#history-empty').items = []; + const sergey = {name: 'Сергей Иванов', hue: 'indigo'}; + document.querySelector('#history-many').items = [1, 2, 3, 4, 5, 6].map((i) => ({ + id: 'e' + i, icon: 'edit', actor: sergey, time: `2026-11-12T11:0${i}:00+03:00`, title: 'изменил вес', + change: {label: 'Вес', before: `${4 + i / 10} кг`.replace('.', ','), after: `${4.1 + i / 10} кг`.replace('.', ',')}, + })); +})(); diff --git a/examples/recipes/order-status/variants-2/index.html b/examples/recipes/order-status/variants-2/index.html new file mode 100644 index 000000000..ce5d11529 --- /dev/null +++ b/examples/recipes/order-status/variants-2/index.html @@ -0,0 +1,3 @@ +
+ +
diff --git a/examples/recipes/order-status/variants-2/index.js b/examples/recipes/order-status/variants-2/index.js new file mode 100644 index 000000000..2426f6a5a --- /dev/null +++ b/examples/recipes/order-status/variants-2/index.js @@ -0,0 +1,9 @@ +(async () => { + await customElements.whenDefined('sf-steps'); + document.querySelector('#request-steps').items = [ + {label: 'Подана', text: '10 ноября'}, + {label: 'Согласована руководителем', text: '11 ноября'}, + {label: 'Кадры', text: 'на рассмотрении'}, + {label: 'Решение'}, + ]; +})(); diff --git a/examples/recipes/order-status/variants/index.html b/examples/recipes/order-status/variants/index.html new file mode 100644 index 000000000..7af6e4b55 --- /dev/null +++ b/examples/recipes/order-status/variants/index.html @@ -0,0 +1,4 @@ +
+ + +
diff --git a/examples/recipes/order-status/variants/index.js b/examples/recipes/order-status/variants/index.js new file mode 100644 index 000000000..c65678cb7 --- /dev/null +++ b/examples/recipes/order-status/variants/index.js @@ -0,0 +1,9 @@ +(async () => { + await customElements.whenDefined('sf-steps'); + document.querySelector('#cancelled-steps').items = [ + {label: 'Заказ принят', text: '12 ноября, 10:14'}, + {label: 'Собран на складе', text: 'отменён: нет товара', state: 'error'}, + {label: 'Передан в службу доставки', state: 'skipped'}, + {label: 'Получен', state: 'skipped'}, + ]; +})(); diff --git a/examples/recipes/report-period/density/index.css b/examples/recipes/report-period/density/index.css new file mode 100644 index 000000000..8320fec49 --- /dev/null +++ b/examples/recipes/report-period/density/index.css @@ -0,0 +1,3 @@ +.booking { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: var(--sf-space-1); align-items: end; } +.period-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--sf-space-1); } +.period-bar > sf-input-date { flex: 0 1 20rem; min-inline-size: 0; } diff --git a/examples/recipes/report-period/density/index.html b/examples/recipes/report-period/density/index.html new file mode 100644 index 000000000..f7e9d9748 --- /dev/null +++ b/examples/recipes/report-period/density/index.html @@ -0,0 +1,10 @@ +
+
+
+
Обычная — сайт бронирования
+
+
+
+
Компактная — отчёт в админке
+
+
diff --git a/examples/recipes/report-period/do-dont/index.html b/examples/recipes/report-period/do-dont/index.html new file mode 100644 index 000000000..1d8ec0567 --- /dev/null +++ b/examples/recipes/report-period/do-dont/index.html @@ -0,0 +1,10 @@ +
+
+
Правильно — период одним полем «с – по»
+
+
+
+
Неправильно — два поля отчёта: конец легко поставить раньше начала
+
+
+
diff --git a/examples/recipes/report-period/overview/index.css b/examples/recipes/report-period/overview/index.css new file mode 100644 index 000000000..f855f1163 --- /dev/null +++ b/examples/recipes/report-period/overview/index.css @@ -0,0 +1,3 @@ +.period-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--sf-space-1); } +.period-bar > sf-input-date { flex: 0 1 20rem; min-inline-size: 0; } +.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); gap: var(--sf-space-1); } diff --git a/examples/recipes/report-period/overview/index.html b/examples/recipes/report-period/overview/index.html new file mode 100644 index 000000000..a97403d73 --- /dev/null +++ b/examples/recipes/report-period/overview/index.html @@ -0,0 +1,7 @@ +
+
+ + +
+
+
diff --git a/examples/recipes/report-period/overview/index.js b/examples/recipes/report-period/overview/index.js new file mode 100644 index 000000000..9cc0e6d96 --- /dev/null +++ b/examples/recipes/report-period/overview/index.js @@ -0,0 +1,29 @@ +const tile = (label, value, unit = '') => ``; +const PRESETS = [ + {id: 'today', label: 'Сегодня', relative: 'today'}, + {id: 'yesterday', label: 'Вчера', relative: 'yesterday'}, + {id: 'last-7-days', label: '7 дней', relative: 'last-7-days'}, + {id: 'last-30-days', label: '30 дней', relative: 'last-30-days'}, + {id: 'this-month', label: 'Этот месяц', relative: 'this-month'}, + {id: 'last-month', label: 'Прошлый месяц', relative: 'last-month'}]; +Promise.all(['sf-input-date', 'sf-segmented'].map((t) => customElements.whenDefined(t))).then(() => { + const period = document.getElementById('period'); + period.presets = PRESETS; + const report = document.getElementById('report'); + const draw = (days) => { + const orders = days * 31; + report.innerHTML = tile('Заказы', orders) + tile('Выручка', orders * 4380, '₽') + tile('Средний чек', 4380, '₽'); + }; + period.addEventListener('sf-input-date-change', (event) => { + const {start, end} = event.detail ?? {}; + const days = start && end ? Math.max(1, Math.round((new Date(end) - new Date(start)) / 864e5) + 1) : 7; + period.removeAttribute('invalid'); + if (days > 366) { + period.setAttribute('error-message', 'Не больше года: отчёт за два года — в разделе «Сводка».'); + period.setAttribute('invalid', ''); + return; + } + draw(days); + }); + draw(7); +}); diff --git a/examples/recipes/report-period/states/index.css b/examples/recipes/report-period/states/index.css new file mode 100644 index 000000000..eea9af183 --- /dev/null +++ b/examples/recipes/report-period/states/index.css @@ -0,0 +1 @@ +.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); gap: var(--sf-space-1); } diff --git a/examples/recipes/report-period/states/index.html b/examples/recipes/report-period/states/index.html new file mode 100644 index 000000000..ff55b82f5 --- /dev/null +++ b/examples/recipes/report-period/states/index.html @@ -0,0 +1,25 @@ +
+
+ +
Период не выбран: поле показывает формат дат языка
+
+
+ +
Ошибка: период длиннее года
+
+
+ +
Только чтение: период задан отчётом, календарь не открывается
+
+
+
+
+
+
+
Пересчёт: цифры отчёта — заготовка их размера
+
+
+ +
Пусто: за период ничего нет — что сделать
+
+
diff --git a/examples/recipes/report-period/variants/index.css b/examples/recipes/report-period/variants/index.css new file mode 100644 index 000000000..a5eef9544 --- /dev/null +++ b/examples/recipes/report-period/variants/index.css @@ -0,0 +1 @@ +.booking { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: var(--sf-space-1); align-items: end; } diff --git a/examples/recipes/report-period/variants/index.html b/examples/recipes/report-period/variants/index.html new file mode 100644 index 000000000..e6bfe4b94 --- /dev/null +++ b/examples/recipes/report-period/variants/index.html @@ -0,0 +1,5 @@ +
+ + +
+

3 ночи

diff --git a/examples/recipes/report-period/variants/index.js b/examples/recipes/report-period/variants/index.js new file mode 100644 index 000000000..58f774d38 --- /dev/null +++ b/examples/recipes/report-period/variants/index.js @@ -0,0 +1,19 @@ +const word = (n) => n % 10 === 1 && n % 100 !== 11 ? 'ночь' : (n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 'ночи' : 'ночей'); +customElements.whenDefined('sf-input-date').then(() => { + const checkIn = document.getElementById('check-in'); + const checkOut = document.getElementById('check-out'); + const nights = document.getElementById('nights'); + const count = () => { + const a = checkIn.value, b = checkOut.value; + if (!a || !b) { nights.textContent = ''; return; } + const n = Math.round((new Date(b) - new Date(a)) / 864e5); + nights.textContent = n > 0 ? `${n} ${word(n)}` : 'Выезд должен быть позже заезда'; + }; + checkIn.addEventListener('sf-input-date-change', () => { + if (!checkIn.value) return; + const next = new Date(checkIn.value); next.setDate(next.getDate() + 1); + checkOut.setAttribute('min-date', next.toISOString().slice(0, 10)); + count(); + }); + checkOut.addEventListener('sf-input-date-change', count); +}); diff --git a/examples/recipes/save-and-errors/density/index.html b/examples/recipes/save-and-errors/density/index.html new file mode 100644 index 000000000..d9dafdbbd --- /dev/null +++ b/examples/recipes/save-and-errors/density/index.html @@ -0,0 +1,14 @@ +
+
+
+ +
+ обычная +
+
+ +
+ компактная +
+
+
diff --git a/examples/recipes/save-and-errors/overview/index.html b/examples/recipes/save-and-errors/overview/index.html new file mode 100644 index 000000000..113540e4e --- /dev/null +++ b/examples/recipes/save-and-errors/overview/index.html @@ -0,0 +1,31 @@ +
+
+
+
+

Осенняя распродажа

+ Новости · черновик · изменено сегодня в 14:05 +
+
+ +
+ + +
+
+ + +
+
+ +
+
+
+
+ + +
+ +
+
+
diff --git a/examples/recipes/save-and-errors/overview/index.js b/examples/recipes/save-and-errors/overview/index.js new file mode 100644 index 000000000..68f8743b1 --- /dev/null +++ b/examples/recipes/save-and-errors/overview/index.js @@ -0,0 +1,73 @@ +(async () => { + await Promise.all(['sf-tabs', 'sf-input', 'sf-button', 'sf-segmented'].map((tag) => customElements.whenDefined(tag))); + const $ = (selector) => document.querySelector(selector); + const tabs = $('#record-tabs'); + const save = $('#save'); + const dirty = $('#dirty'); + const fields = ['#f-title', '#f-slug', '#f-seo-title', '#f-seo-desc', '#f-group']; + const tabItems = [{id: 'main', label: 'Основное'}, {id: 'seo', label: 'Поиск'}, {id: 'access', label: 'Доступ'}]; + let answer = 'ok'; + + const clear = () => { + $('#summary').replaceChildren(); + fields.forEach((id) => { $(id).removeAttribute('invalid'); $(id).removeAttribute('error-message'); }); + tabs.items = tabItems.map((item) => ({...item})); + }; + const fieldError = (id, message) => { $(id).setAttribute('invalid', ''); $(id).setAttribute('error-message', message); }; + const summary = (status, heading, text, actions) => { + const alert = document.createElement('sf-alert'); + alert.setAttribute('status', status); + alert.setAttribute('heading', heading); + alert.setAttribute('supporting-text', text); + alert.setAttribute('action-text', actions[0][0]); + alert.setAttribute('action', actions[0][1]); + if (actions[1]) { alert.setAttribute('secondary-action-text', actions[1][0]); alert.setAttribute('secondary-action', actions[1][1]); } + alert.addEventListener('sf-alert-action', (event) => { + const action = event.detail?.action; + if (action === 'first') tabs.goToError(); + if (action === 'mine') { clear(); send('ok'); } + if (action === 'theirs') clear(); + }); + $('#summary').replaceChildren(alert); + // Хозяин уведомления не рисует рамку сам: фокус ставят на его рамку .sf-alert. + const focusBox = () => { + const box = alert.querySelector('.sf-alert'); + if (!box) return requestAnimationFrame(focusBox); + box.tabIndex = -1; + box.focus(); + }; + focusBox(); + }; + + function send(mode = answer) { + save.setAttribute('loading', ''); + setTimeout(() => { + save.removeAttribute('loading'); + clear(); + if (mode === 'errors') { + fieldError('#f-slug', 'Только латинские буквы, цифры и дефис.'); + fieldError('#f-seo-title', '84 знака — сократите до 70.'); + fieldError('#f-seo-desc', 'Заполните описание для поиска.'); + tabs.items = [{id: 'main', label: 'Основное', errors: 1}, {id: 'seo', label: 'Поиск', errors: 2}, {id: 'access', label: 'Доступ'}]; + summary('error', 'Не сохранено: 3 ошибки', 'Ошибки на вкладках «Основное» и «Поиск».', [['К первой ошибке', 'first']]); + return; + } + if (mode === 'conflict') { + summary('warning', 'Запись изменила Анна Котова в 14:32', 'Ваши правки не сохранены и остались в форме.', [['Показать её версию', 'theirs'], ['Сохранить мою', 'mine']]); + return; + } + if (mode === 'offline') { + dirty.hidden = false; + SF.notify({status: 'error', title: 'Не сохранено: нет связи', text: 'Изменения остались в форме.', duration: 0, action: {label: 'Повторить', onSelect: () => send()}}); + return; + } + dirty.hidden = true; + SF.notify({status: 'success', title: 'Сохранено', action: {label: 'Отменить', onSelect: () => {}}}); + }, 1200); + } + + save.addEventListener('click', () => send()); + $('#cancel').addEventListener('click', () => { clear(); dirty.hidden = true; }); + tabs.addEventListener('input', () => { dirty.hidden = false; }); + $('#answer').addEventListener('sf-button-group-change', (event) => { answer = event.detail?.value ?? answer; clear(); }); +})(); diff --git a/examples/recipes/save-and-errors/phone/index.html b/examples/recipes/save-and-errors/phone/index.html new file mode 100644 index 000000000..c1a364134 --- /dev/null +++ b/examples/recipes/save-and-errors/phone/index.html @@ -0,0 +1,11 @@ +
+ + +
+ +
+
+
+
+
+
diff --git a/examples/recipes/save-and-errors/states/index.html b/examples/recipes/save-and-errors/states/index.html new file mode 100644 index 000000000..702a03d0a --- /dev/null +++ b/examples/recipes/save-and-errors/states/index.html @@ -0,0 +1,36 @@ +
+
+
+ + Запись открывается: скелет на месте полей +
+
+
+ Сохраняется: кнопка занята, второй раз не нажать +
+
+ + Одна ошибка: без сводки, фокус сразу в поле +
+
+ + Много ошибок: сводка и переход к первой +
+
+ + Чужая правка: две кнопки +
+
+ + Нет связи: всплывающее до крестика, правки в форме +
+
+ + Нет прав: уведомление, поля только для чтения +
+
+ + Сохранено: уходит само через 5 секунд +
+
+
diff --git a/examples/recipes/site-header/density/index.css b/examples/recipes/site-header/density/index.css new file mode 100644 index 000000000..6fb16ecb9 --- /dev/null +++ b/examples/recipes/site-header/density/index.css @@ -0,0 +1 @@ +.brand { display: inline-flex; align-items: center; gap: var(--sf-space-1\/2); font-weight: var(--sf-font-weight-medium); color: var(--sf-on-surface); text-decoration: none; white-space: nowrap; } diff --git a/examples/recipes/site-header/density/index.html b/examples/recipes/site-header/density/index.html new file mode 100644 index 000000000..fbd973156 --- /dev/null +++ b/examples/recipes/site-header/density/index.html @@ -0,0 +1,22 @@ +
+
+ +
Обычная — сайт и магазин
+
+
+ +
Компактная — узкая шапка каталога или документации
+
+
diff --git a/examples/recipes/site-header/density/index.js b/examples/recipes/site-header/density/index.js new file mode 100644 index 000000000..eaa8d1169 --- /dev/null +++ b/examples/recipes/site-header/density/index.js @@ -0,0 +1,2 @@ +const SHOP = [{id: 'catalog', label: 'Каталог', href: '#catalog'}, {id: 'delivery', label: 'Доставка', href: '#delivery'}, {id: 'service', label: 'Сервис', href: '#service'}, {id: 'about', label: 'О компании', href: '#about'}, {id: 'contacts', label: 'Контакты', href: '#contacts'}]; +customElements.whenDefined('sf-menu').then(() => document.querySelectorAll('sf-menu[data-menu="shop"]').forEach((m) => m.setAttribute('items', JSON.stringify(SHOP)))); diff --git a/examples/recipes/site-header/do-dont/index.html b/examples/recipes/site-header/do-dont/index.html new file mode 100644 index 000000000..7b271a75c --- /dev/null +++ b/examples/recipes/site-header/do-dont/index.html @@ -0,0 +1,18 @@ +
+
+
Правильно — тема одной кнопкой по кругу
+
+ + + + +
+
+
+
Неправильно — три кнопки темы занимают пол-шапки
+
+ + +
+
+
diff --git a/examples/recipes/site-header/overview/index.css b/examples/recipes/site-header/overview/index.css new file mode 100644 index 000000000..6fb16ecb9 --- /dev/null +++ b/examples/recipes/site-header/overview/index.css @@ -0,0 +1 @@ +.brand { display: inline-flex; align-items: center; gap: var(--sf-space-1\/2); font-weight: var(--sf-font-weight-medium); color: var(--sf-on-surface); text-decoration: none; white-space: nowrap; } diff --git a/examples/recipes/site-header/overview/index.html b/examples/recipes/site-header/overview/index.html new file mode 100644 index 000000000..d063a792c --- /dev/null +++ b/examples/recipes/site-header/overview/index.html @@ -0,0 +1,16 @@ + +
+ + Аквабур + + + + + + + +
+
+

Каталог · 1 240 товаров

+
+ diff --git a/examples/recipes/site-header/overview/index.js b/examples/recipes/site-header/overview/index.js new file mode 100644 index 000000000..2ddd84e7c --- /dev/null +++ b/examples/recipes/site-header/overview/index.js @@ -0,0 +1,28 @@ +const SHOP = [ + {id: 'catalog', label: 'Каталог', href: '#catalog', children: [ + {id: 'pumps', label: 'Насосы', href: '#pumps'}, + {id: 'filters', label: 'Фильтры для воды', href: '#filters'}, + {id: 'heaters', label: 'Водонагреватели', href: '#heaters'}]}, + {id: 'delivery', label: 'Доставка', href: '#delivery'}, + {id: 'service', label: 'Сервис', href: '#service'}, + {id: 'about', label: 'О компании', href: '#about'}, + {id: 'contacts', label: 'Контакты', href: '#contacts'}]; +const FOUND = [ + {id: 'g1', group: 'goods', title: 'Насос погружной Аквабур-40', path: 'Каталог › Насосы', href: '#g1', icon: 'water_pump'}, + {id: 'g2', group: 'goods', title: 'Насос поверхностный Аквабур-25', path: 'Каталог › Насосы', href: '#g2', icon: 'water_pump'}, + {id: 'a1', group: 'pages', title: 'Как выбрать насос для скважины', path: 'Статьи', href: '#a1', icon: 'article'}]; +Promise.all(['sf-menu', 'sf-header-site', 'sf-search'].map((t) => customElements.whenDefined(t))).then(() => { + const menu = document.getElementById('shop-menu'); + const search = document.getElementById('shop-search'); + menu.setAttribute('items', JSON.stringify(SHOP)); + menu.addEventListener('sf-menu-navigate', (event) => { event.preventDefault(); menu.setAttribute('current', event.detail.id); }); + search.provider = (query) => new Promise((resolve, reject) => setTimeout(() => { + if (document.getElementById('search-fail').checked) { reject(new Error('Поиск недоступен')); return; } + const q = String(query || '').toLowerCase(); + resolve({groups: [{id: 'goods', label: 'Товары'}, {id: 'pages', label: 'Статьи'}], + items: q ? FOUND.filter((i) => (i.title + i.path).toLowerCase().includes(q)) : [], + popular: ['насос для скважины', 'фильтр под мойку']}); + }, 250)); + search.addEventListener('sf-search-navigate', (event) => event.preventDefault()); + document.getElementById('search-open').addEventListener('click', () => search.open()); +}); diff --git a/examples/recipes/site-header/phone/index.css b/examples/recipes/site-header/phone/index.css new file mode 100644 index 000000000..6fb16ecb9 --- /dev/null +++ b/examples/recipes/site-header/phone/index.css @@ -0,0 +1 @@ +.brand { display: inline-flex; align-items: center; gap: var(--sf-space-1\/2); font-weight: var(--sf-font-weight-medium); color: var(--sf-on-surface); text-decoration: none; white-space: nowrap; } diff --git a/examples/recipes/site-header/phone/index.html b/examples/recipes/site-header/phone/index.html new file mode 100644 index 000000000..4a83cf5c6 --- /dev/null +++ b/examples/recipes/site-header/phone/index.html @@ -0,0 +1,33 @@ +
+
+
+ + SIMAI + + + + + + +
+
+
+
Сайт: кнопка меню слева, как по умолчанию
+
+
+
+ + Аквабур + + + + + + + +
+
+
+
Магазин: кнопка меню справа, последней после корзины
+
+
diff --git a/examples/recipes/site-header/phone/index.js b/examples/recipes/site-header/phone/index.js new file mode 100644 index 000000000..96b762ccd --- /dev/null +++ b/examples/recipes/site-header/phone/index.js @@ -0,0 +1,6 @@ +const SITE = [{id: 'products', label: 'Продукты', href: '#p'}, {id: 'docs', label: 'Документация', href: '#d'}, {id: 'effects', label: 'Эффекты', href: '#e'}, {id: 'blog', label: 'Блог', href: '#b'}]; +const SHOP = [{id: 'catalog', label: 'Каталог', href: '#catalog'}, {id: 'delivery', label: 'Доставка', href: '#delivery'}, {id: 'service', label: 'Сервис', href: '#service'}, {id: 'contacts', label: 'Контакты', href: '#contacts'}]; +customElements.whenDefined('sf-menu').then(() => { + document.querySelectorAll('sf-menu[data-menu="site"]').forEach((m) => m.setAttribute('items', JSON.stringify(SITE))); + document.querySelectorAll('sf-menu[data-menu="shop"]').forEach((m) => m.setAttribute('items', JSON.stringify(SHOP))); +}); diff --git a/examples/recipes/site-header/states/index.css b/examples/recipes/site-header/states/index.css new file mode 100644 index 000000000..c50d08c17 --- /dev/null +++ b/examples/recipes/site-header/states/index.css @@ -0,0 +1,2 @@ +.brand { display: inline-flex; align-items: center; gap: var(--sf-space-1\/2); font-weight: var(--sf-font-weight-medium); color: var(--sf-on-surface); text-decoration: none; white-space: nowrap; } +.first-frame { display: flex; align-items: center; gap: var(--sf-space-1); block-size: var(--sf-ui-1--control-height); padding: var(--sf-space-1\/2) var(--sf-space-2); box-sizing: content-box; } diff --git a/examples/recipes/site-header/states/index.html b/examples/recipes/site-header/states/index.html new file mode 100644 index 000000000..df4c35e48 --- /dev/null +++ b/examples/recipes/site-header/states/index.html @@ -0,0 +1,36 @@ +
+
+
+ +
+
Первый кадр: строка держит высоту шапки, логотип сразу текстом
+
+
+
+ + Аквабур + + + + + +
+
Без разделов: страница входа или лендинг — логотип и настройки
+
+
+
+ + Аквабур + + + + + + + +
+
+
+
Много разделов: не влезающие уходят в «Ещё» в конце строки
+
+
diff --git a/examples/recipes/site-header/states/index.js b/examples/recipes/site-header/states/index.js new file mode 100644 index 000000000..5edf4bab8 --- /dev/null +++ b/examples/recipes/site-header/states/index.js @@ -0,0 +1,3 @@ +const MANY = ['Каталог', 'Доставка', 'Сервис', 'О компании', 'Контакты', 'Статьи', 'Акции', 'Оптовикам', 'Вакансии', 'Гарантия'] + .map((label, i) => ({id: i ? 'm' + i : 'catalog', label, href: '#m' + i})); +customElements.whenDefined('sf-menu').then(() => document.getElementById('many-menu').setAttribute('items', JSON.stringify(MANY))); diff --git a/examples/recipes/system-bar/density/index.html b/examples/recipes/system-bar/density/index.html new file mode 100644 index 000000000..d2983cadc --- /dev/null +++ b/examples/recipes/system-bar/density/index.html @@ -0,0 +1,12 @@ +
+
+
+ + обычная +
+
+ + компактная +
+
+
diff --git a/examples/recipes/system-bar/density/index.js b/examples/recipes/system-bar/density/index.js new file mode 100644 index 000000000..12c65e31e --- /dev/null +++ b/examples/recipes/system-bar/density/index.js @@ -0,0 +1,10 @@ +(async () => { + await customElements.whenDefined('sf-alert-bar'); + document.querySelectorAll('[data-demo="density-bar"]').forEach((bar) => { + bar.items = [ + {id: 'licence', level: 'warning', text: 'Лицензия SIMAI Pro заканчивается 30 ноября.', action: {label: 'Продлить', href: '#licence'}, acknowledge: {label: 'Прочитано'}}, + {id: 'trial', level: 'info', text: 'Пробный период: осталось 9 дней.', acknowledge: {label: 'Прочитано'}}, + ]; + bar.addEventListener('sf-alert-bar-navigate', (event) => event.preventDefault()); + }); +})(); diff --git a/examples/recipes/system-bar/overview/index.html b/examples/recipes/system-bar/overview/index.html new file mode 100644 index 000000000..b915c81d6 --- /dev/null +++ b/examples/recipes/system-bar/overview/index.html @@ -0,0 +1,15 @@ +
+
+
+ +
+ Панель сервера + +
+
+

Сайты

+

12 сайтов · 3 на PHP 8.3 · последняя копия сегодня в 03:10

+
+
+
diff --git a/examples/recipes/system-bar/overview/index.js b/examples/recipes/system-bar/overview/index.js new file mode 100644 index 000000000..d0754b06b --- /dev/null +++ b/examples/recipes/system-bar/overview/index.js @@ -0,0 +1,27 @@ +(async () => { + const messages = { + disk: {id: 'disk', level: 'error', text: 'Диск заполнен на 98 %: сайты перестанут сохранять файлы и базы.', source: 'Сервер', time: '2026-11-14T08:58:00+03:00', action: {label: 'Освободить место', href: '#disk'}}, + down: {id: 'down', level: 'error', text: 'shop.example.ru не отвечает уже 12 минут.', source: 'Сайт shop.example.ru', time: '2026-11-14T08:48:00+03:00', action: {label: 'Открыть сайт', href: '#site'}}, + licence: {id: 'licence', level: 'warning', text: 'Лицензия SIMAI Pro заканчивается 30 ноября. После этого обновления перестанут приходить.', source: 'Лицензия', time: '2026-11-14T07:00:00+03:00', action: {label: 'Продлить', href: '#licence'}, acknowledge: {label: 'Прочитано'}}, + trial: {id: 'trial', level: 'info', text: 'Пробный период: осталось 9 дней.', source: 'Тариф', time: '2026-11-14T06:00:00+03:00', action: {label: 'Выбрать тариф', href: '#tariff'}, acknowledge: {label: 'Прочитано'}}, + }; + const sets = { + one: [messages.licence], + many: [messages.licence, messages.disk, messages.down, messages.trial], + error: [messages.disk], + none: [], + }; + await Promise.all(['sf-alert-bar', 'sf-segmented'].map((tag) => customElements.whenDefined(tag))); + const bar = document.querySelector('#bar-main'); + const seen = new Set(); + let current = 'many'; + const show = () => { bar.items = sets[current].filter((item) => !seen.has(item.id)); }; + bar.addEventListener('sf-alert-bar-navigate', (event) => event.preventDefault()); + bar.addEventListener('sf-alert-bar-acknowledge', (event) => { seen.add(event.detail?.id); show(); }); + document.querySelector('#bar-state').addEventListener('sf-button-group-change', (event) => { + current = event.detail?.value ?? current; + seen.clear(); + show(); + }); + show(); +})(); diff --git a/examples/recipes/system-bar/phone/index.html b/examples/recipes/system-bar/phone/index.html new file mode 100644 index 000000000..b9c12acf6 --- /dev/null +++ b/examples/recipes/system-bar/phone/index.html @@ -0,0 +1,4 @@ +
+ + +
diff --git a/examples/recipes/system-bar/phone/index.js b/examples/recipes/system-bar/phone/index.js new file mode 100644 index 000000000..1a6caf99c --- /dev/null +++ b/examples/recipes/system-bar/phone/index.js @@ -0,0 +1,11 @@ +(async () => { + await customElements.whenDefined('sf-alert-bar'); + const admin = document.querySelector('#phone-admin'); + const site = document.querySelector('#phone-site'); + admin.items = [ + {id: 'disk', level: 'error', text: 'Диск заполнен на 98 %: сайты перестанут сохранять файлы и базы.', source: 'Сервер', action: {label: 'Освободить место', href: '#disk'}}, + {id: 'licence', level: 'warning', text: 'Лицензия SIMAI Pro заканчивается 30 ноября.', action: {label: 'Продлить', href: '#licence'}, acknowledge: {label: 'Прочитано'}}, + ]; + site.items = [{id: 'site', level: 'info', text: 'С 02:00 до 03:00 МСК сайт обновляется: заказы примем после 03:00.'}]; + [admin, site].forEach((bar) => bar.addEventListener('sf-alert-bar-navigate', (event) => event.preventDefault())); +})(); diff --git a/examples/recipes/system-bar/states/index.html b/examples/recipes/system-bar/states/index.html new file mode 100644 index 000000000..c163f4b3f --- /dev/null +++ b/examples/recipes/system-bar/states/index.html @@ -0,0 +1,20 @@ +
+
+
+ + Ошибка: закрыть нельзя, только свернуть +
+
+ + Предупреждение: действие и «Прочитано» +
+
+ + Много: видно самое серьёзное, остальное — в «Ещё 2» +
+
+ + Сайт клиента: size="1", текст по колонке страницы +
+
+
diff --git a/examples/recipes/system-bar/states/index.js b/examples/recipes/system-bar/states/index.js new file mode 100644 index 000000000..b85dcf177 --- /dev/null +++ b/examples/recipes/system-bar/states/index.js @@ -0,0 +1,16 @@ +(async () => { + const disk = {id: 'disk', level: 'error', text: 'Диск заполнен на 98 %: сайты перестанут сохранять файлы и базы.', source: 'Сервер', action: {label: 'Освободить место', href: '#disk'}}; + const licence = {id: 'licence', level: 'warning', text: 'Лицензия SIMAI Pro заканчивается 30 ноября.', source: 'Лицензия', action: {label: 'Продлить', href: '#licence'}, acknowledge: {label: 'Прочитано'}}; + const trial = {id: 'trial', level: 'info', text: 'Пробный период: осталось 9 дней.', source: 'Тариф', acknowledge: {label: 'Прочитано'}}; + const site = {id: 'site', level: 'info', text: 'С 02:00 до 03:00 МСК сайт обновляется: заказы примем после 03:00.'}; + await customElements.whenDefined('sf-alert-bar'); + const put = (id, items) => { + const bar = document.querySelector(id); + bar.items = items; + bar.addEventListener('sf-alert-bar-navigate', (event) => event.preventDefault()); + }; + put('#st-error', [disk]); + put('#st-warning', [licence]); + put('#st-many', [disk, licence, trial]); + put('#st-site', [site]); +})(); diff --git a/examples/recipes/system-bar/variants/index.html b/examples/recipes/system-bar/variants/index.html new file mode 100644 index 000000000..aefd50ac5 --- /dev/null +++ b/examples/recipes/system-bar/variants/index.html @@ -0,0 +1,11 @@ +
+
+
+ +
+

Сайты

+

+
+
+
diff --git a/examples/recipes/system-bar/variants/index.js b/examples/recipes/system-bar/variants/index.js new file mode 100644 index 000000000..f839fb490 --- /dev/null +++ b/examples/recipes/system-bar/variants/index.js @@ -0,0 +1,31 @@ +(async () => { + // Работы начинаются 16 ноября в 02:00 МСК. «Прочитано» скрывает полосу на сутки, + // но не дольше, чем до часа перед началом; с этого часа полоса стоит без «Прочитано». + const HOUR = 3600000; + const start = Date.parse('2026-11-16T02:00:00+03:00'); + const first = Date.parse('2026-11-14T10:00:00+03:00'); + const work = {id: 'work', level: 'info', source: 'SIMAI', time: '2026-11-13T12:00:00+03:00', + text: '16 ноября с 02:00 до 03:00 МСК плановые работы: панель будет недоступна.'}; + await Promise.all(['sf-alert-bar', 'sf-segmented'].map((tag) => customElements.whenDefined(tag))); + const bar = document.querySelector('#work-bar'); + const note = document.querySelector('#work-note'); + let now = first; + let hiddenUntil = 0; + const render = () => { + const soon = now >= start - HOUR; + const visible = soon || now >= hiddenUntil; + bar.items = visible ? [soon ? work : {...work, acknowledge: {label: 'Прочитано'}}] : []; + note.textContent = visible + ? (soon ? 'До начала работ меньше часа: полоса стоит до их конца.' : 'Полоса видна на всех страницах панели.') + : 'Полоса скрыта до ' + new Date(hiddenUntil).toLocaleString('ru-RU', {day: 'numeric', month: 'long', hour: '2-digit', minute: '2-digit', timeZone: 'Europe/Moscow'}) + '.'; + }; + bar.addEventListener('sf-alert-bar-acknowledge', () => { + hiddenUntil = Math.min(now + 24 * HOUR, start - HOUR); + render(); + }); + document.querySelector('#work-clock').addEventListener('sf-button-group-change', (event) => { + now = first + Number(event.detail?.value ?? 0) * HOUR; + render(); + }); + render(); +})(); diff --git a/examples/recipes/which-message/density/index.html b/examples/recipes/which-message/density/index.html new file mode 100644 index 000000000..24cee72a1 --- /dev/null +++ b/examples/recipes/which-message/density/index.html @@ -0,0 +1,12 @@ +
+
+
+ + обычная +
+
+ + компактная +
+
+
diff --git a/examples/recipes/which-message/overview/index.html b/examples/recipes/which-message/overview/index.html new file mode 100644 index 000000000..dadcecd1e --- /dev/null +++ b/examples/recipes/which-message/overview/index.html @@ -0,0 +1,41 @@ +
+
+ + + + + + +
+ +
+ +

Уведомление — состояние этой страницы или раздела. Стоит в начале страницы.

+
+ + + + +
diff --git a/examples/recipes/which-message/overview/index.js b/examples/recipes/which-message/overview/index.js new file mode 100644 index 000000000..68a5d27bb --- /dev/null +++ b/examples/recipes/which-message/overview/index.js @@ -0,0 +1,43 @@ +(async () => { + // Скрытые части загружаются, когда их покажут: данные им отдаём после показа. + await customElements.whenDefined('sf-button'); + const fill = { + bar: async () => { + await customElements.whenDefined('sf-alert-bar'); + const bar = document.querySelector('#msg-bar'); + bar.items = [{id: 'disk', level: 'error', text: 'Диск заполнен на 98 %: сайты перестанут сохранять файлы и базы.', source: 'Сервер', action: {label: 'Освободить место', href: '#disk'}}]; + }, + centre: async () => { + await customElements.whenDefined('sf-list'); + document.querySelector('#msg-centre').items = [ + {id: 'n1', icon: 'cloud_done', text: 'Резервная копия shop.example.ru готова', supporting: 'Сервер · 03:10'}, + {id: 'n2', icon: 'person_add', text: 'Анна Котова добавлена в редакторы', supporting: 'Пользователи · 10:42'}, + {id: 'n3', icon: 'warning', text: 'Сертификат demo.example.ru истекает через 6 дней', supporting: 'Сайты · 11:05'}, + {id: 'n4', icon: 'shopping_cart', text: 'Новый заказ № 48 215 на 12 400 ₽', supporting: 'Магазин · 12:30'}, + ]; + }, + }; + // sf-button переносит data-атрибуты на свою кнопку: место читаем с неё. + const what = document.querySelector('#what'); + const choose = (place) => { + what.querySelectorAll('sf-button').forEach((host) => host.toggleAttribute('pressed', host.querySelector('button')?.dataset.place === place)); + document.querySelectorAll('[data-for]').forEach((part) => { part.hidden = part.dataset.for !== place; }); + fill[place]?.(); + }; + what.addEventListener('click', (event) => { + const place = event.target.closest('button[data-place]')?.dataset.place; + if (place) choose(place); + }); + + document.querySelector('#msg-bar').addEventListener('sf-alert-bar-navigate', (event) => event.preventDefault()); + + document.querySelector('#msg-save').addEventListener('click', () => { + SF.notify({status: 'success', title: 'Запись сохранена', text: '«Осенняя распродажа» опубликована на сайте.', action: {label: 'Отменить', onSelect: () => {}}}); + }); + document.querySelector('#msg-offline').addEventListener('click', () => { + SF.notify({status: 'error', title: 'Не сохранено: нет связи', text: 'Изменения остались в форме.', duration: 0, action: {label: 'Повторить', onSelect: () => {}}}); + }); + document.querySelector('[data-for="form"] sf-alert').addEventListener('sf-alert-action', () => { + document.querySelector('#msg-slug input')?.focus(); + }); +})(); diff --git a/examples/recipes/which-message/phone/index.html b/examples/recipes/which-message/phone/index.html new file mode 100644 index 000000000..ba210bd90 --- /dev/null +++ b/examples/recipes/which-message/phone/index.html @@ -0,0 +1,5 @@ +
+ + + +
diff --git a/examples/recipes/which-message/phone/index.js b/examples/recipes/which-message/phone/index.js new file mode 100644 index 000000000..c38979410 --- /dev/null +++ b/examples/recipes/which-message/phone/index.js @@ -0,0 +1,6 @@ +(async () => { + await customElements.whenDefined('sf-alert-bar'); + const bar = document.querySelector('#phone-bar'); + bar.items = [{id: 'disk', level: 'error', text: 'Диск заполнен на 98 %: сайты перестанут сохранять файлы и базы.', source: 'Сервер', action: {label: 'Освободить место', href: '#disk'}}]; + bar.addEventListener('sf-alert-bar-navigate', (event) => event.preventDefault()); +})(); diff --git a/examples/recipes/which-message/states/index.html b/examples/recipes/which-message/states/index.html new file mode 100644 index 000000000..0847f2067 --- /dev/null +++ b/examples/recipes/which-message/states/index.html @@ -0,0 +1,28 @@ +
+
+
+ + Пусто: нет причины — нет сообщения; в центре — пустое состояние +
+
+
+ Ожидание: работает кнопка, а не всплывающее «Сохраняем…» +
+
+ + Ошибка страницы: уведомление с «Повторить» +
+
+ + Ошибка ответа на действие: до крестика +
+
+ + Успех: уходит сам через 5 секунд +
+
+
+ Много: видно четыре, повтор не множится, а считается +
+
+
diff --git a/examples/recipes/which-message/states/index.js b/examples/recipes/which-message/states/index.js new file mode 100644 index 000000000..200c6eb21 --- /dev/null +++ b/examples/recipes/which-message/states/index.js @@ -0,0 +1,4 @@ +document.querySelector('#many').addEventListener('click', () => { + ['Письмо отправлено', 'Письмо отправлено', 'Контакт добавлен', 'Файл загружен', 'Шаблон сохранён'] + .forEach((title, index) => setTimeout(() => SF.notify({status: 'success', title}), index * 150)); +}); diff --git a/examples/smart-components/contents/compact/index.css b/examples/smart-components/contents/sheet/index.css similarity index 100% rename from examples/smart-components/contents/compact/index.css rename to examples/smart-components/contents/sheet/index.css diff --git a/examples/smart-components/contents/compact/index.html b/examples/smart-components/contents/sheet/index.html similarity index 100% rename from examples/smart-components/contents/compact/index.html rename to examples/smart-components/contents/sheet/index.html diff --git a/examples/smart-components/menu/compact/index.html b/examples/smart-components/menu/rail/index.html similarity index 100% rename from examples/smart-components/menu/compact/index.html rename to examples/smart-components/menu/rail/index.html From a5a127fcbf97367d19f50d56663b0104bcc4b2b8 Mon Sep 17 00:00:00 2001 From: Rim Zabarov Date: Sun, 15 Nov 2026 14:51:31 +0300 Subject: [PATCH 03/75] Contents and menu pages: sheet and rail, compact is density only (C134) sf-contents layout="compact" is layout="sheet" and sf-menu appearance="compact" is appearance="rail" in the pair (smart.contents 1.7.1, smart.menu 1.9.0); the old values are aliases until 2027-01-01 and stay only in the names guide. The two pages, their examples and the example folders follow; the language page already shows labels="code". Co-Authored-By: Claude Opus 5.5 --- content/ru/smart/navigation/contents.md | 10 +++++----- content/ru/smart/navigation/menu.md | 12 ++++++------ .../smart-components/contents/sheet/index.html | 18 +++++++++--------- examples/smart-components/menu/rail/index.html | 2 +- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/content/ru/smart/navigation/contents.md b/content/ru/smart/navigation/contents.md index 3f7eeeb62..0ebeba04d 100644 --- a/content/ru/smart/navigation/contents.md +++ b/content/ru/smart/navigation/contents.md @@ -5,7 +5,7 @@ description: "Оглавление одной страницы: разделы # Оглавление -:badge[sf-contents]{variant=tonal scheme=primary size=1/2} :badge[1.7.1]{variant=outline scheme=on-surface size=1/2} +:badge[sf-contents]{variant=outline scheme=on-surface size=1/2} :badge[1.7.1]{variant=outline scheme=on-surface size=1/2} Оглавление показывает разделы одной страницы ссылками и отмечает текущий, пока читатель прокручивает текст. Есть четыре вида — для документации, справки, @@ -49,10 +49,10 @@ CSS-селектором. Оглавление рядом со статьёй с | `layout` | Что это | Где | |:---|:---|:---| | `column` | заголовок и список на линии, у текущего раздела — полоса; прилипает | документация и справка на широком экране | -| `compact` | одна кнопка с текущим разделом и линией прочитанного под ней; открывает список | телефон, узкая колонка | +| `sheet` | одна кнопка с текущим разделом и линией прочитанного под ней; открывает список | телефон, узкая колонка | | `rail` | короткий штрих на каждый раздел у края, у текущего — длиннее; названия видны при наведении и фокусе | статьи и лендинги, где оглавление не должно отвлекать | | `bar` | прилипшая строка якорей-вкладок, текущая подчёркнута | длинные формы и страницы настроек | -| `auto` | `column` от ступени `collapse` и шире, `compact` — уже | страница документации на любой ширине | +| `auto` | `column` от ступени `collapse` и шире, `sheet` — уже | страница документации на любой ширине | Колонку показывает [Пример](#пример) в начале страницы. @@ -60,11 +60,11 @@ CSS-селектором. Оглавление рядом со статьёй с `layout` • по умолчанию `auto` • [справочник](#атрибуты) -`layout="compact"` — одна кнопка: название текущего раздела и под ней линия +`layout="sheet"` — одна кнопка: название текущего раздела и под ней линия прочитанного. Нажатие открывает весь список; выбор раздела, `Escape` или нажатие снаружи его закрывают. -:::example {id="smart-components/contents/compact" label="Кнопка"} +:::example {id="smart-components/contents/sheet" label="Кнопка"} ::: ### Штрихи у края diff --git a/content/ru/smart/navigation/menu.md b/content/ru/smart/navigation/menu.md index b85c9fa64..739cf0900 100644 --- a/content/ru/smart/navigation/menu.md +++ b/content/ru/smart/navigation/menu.md @@ -5,7 +5,7 @@ description: "Навигация по сайту из данных или спи # Меню -:badge[sf-menu]{variant=tonal scheme=primary size=1/2} :badge[1.9.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-menu]{variant=outline scheme=on-surface size=1/2} :badge[1.9.0]{variant=outline scheme=on-surface size=1/2} Меню ведёт по сайту, разделу или кабинету: вложенные разделы, текущая страница, ветки, которые открываются и закрываются; пункты задают данными или @@ -133,12 +133,12 @@ disabled, open, children}`: в свойстве — массивом, в атр :::example {id="smart-components/menu/documentation-tree" label="Дерево документации"} ::: -### Компактная полоса +### Полоса значков -`appearance="compact"` — полоса значков первого уровня: слова остаются в +`appearance="rail"` — полоса значков первого уровня: слова остаются в имени ссылки, ветки не открываются. -:::example {id="smart-components/menu/compact" label="Полоса значков"} +:::example {id="smart-components/menu/rail" label="Полоса значков"} ::: ### Навигация в шапке @@ -188,7 +188,7 @@ disabled, open, children}`: в свойстве — массивом, в атр открывается сама. В разметке группу задаёт `data-group` на `
  • `, а `data-collapsible` делает её сворачиваемой. -В строке (`orientation="horizontal"`) и в компактной полосе групп нет: их +В строке (`orientation="horizontal"`) и в полосе значков групп нет: их пункты стоят на месте группы, без заголовка. :::example {id="smart-components/menu/groups" label="Две группы" preview=sandbox log_console=true log_open=false} @@ -266,7 +266,7 @@ menu.addEventListener('sf-menu-navigate', (event) => { ветками из кода. Открыть, закрыть и переключить ветку можно и объектом: `open({id})`. Они отвечают `{outcome: 'applied'}`, если что-то изменилось, и `{outcome: 'refused', reason}`, если нет: `unknown` — такой ветки нет, -`compact` — вид compact ветки не открывает, `disabled` — пункт недоступен, +`compact` — полоса значков (`rail`) ветки не открывает, `disabled` — пункт недоступен, `already` — ветка уже в этом состоянии, `fixed` — группу без `collapsible` свернуть нельзя. diff --git a/examples/smart-components/contents/sheet/index.html b/examples/smart-components/contents/sheet/index.html index ca6b40c0c..3c6e69710 100644 --- a/examples/smart-components/contents/sheet/index.html +++ b/examples/smart-components/contents/sheet/index.html @@ -1,25 +1,25 @@
    - -
    -

    Введение

    + +
    +

    Введение

    Компонент берёт данные из манифеста, рисует начальный вид без кода и оживает, когда код загрузится.

    Страница задаёт только настройки и содержимое; всё остальное компонент делает сам.

    -

    Подключение

    +

    Подключение

    Компонент берёт данные из манифеста, рисует начальный вид без кода и оживает, когда код загрузится.

    Страница задаёт только настройки и содержимое; всё остальное компонент делает сам.

    -

    Через CDN

    +

    Через CDN

    Компонент берёт данные из манифеста, рисует начальный вид без кода и оживает, когда код загрузится.

    Страница задаёт только настройки и содержимое; всё остальное компонент делает сам.

    -

    Через npm

    +

    Через npm

    Компонент берёт данные из манифеста, рисует начальный вид без кода и оживает, когда код загрузится.

    Страница задаёт только настройки и содержимое; всё остальное компонент делает сам.

    -

    Настройки

    +

    Настройки

    Компонент берёт данные из манифеста, рисует начальный вид без кода и оживает, когда код загрузится.

    Страница задаёт только настройки и содержимое; всё остальное компонент делает сам.

    -

    События

    +

    События

    Компонент берёт данные из манифеста, рисует начальный вид без кода и оживает, когда код загрузится.

    Страница задаёт только настройки и содержимое; всё остальное компонент делает сам.

    -

    Доступность

    +

    Доступность

    Компонент берёт данные из манифеста, рисует начальный вид без кода и оживает, когда код загрузится.

    Страница задаёт только настройки и содержимое; всё остальное компонент делает сам.

    diff --git a/examples/smart-components/menu/rail/index.html b/examples/smart-components/menu/rail/index.html index f525df11f..2324057a6 100644 --- a/examples/smart-components/menu/rail/index.html +++ b/examples/smart-components/menu/rail/index.html @@ -1,4 +1,4 @@ - Date: Sun, 15 Nov 2026 14:51:31 +0300 Subject: [PATCH 04/75] =?UTF-8?q?Country=20code:=20the=20=C2=AB=D0=A7?= =?UTF-8?q?=D0=B0=D1=81=D1=82=D0=BE=20=D0=B2=D1=8B=D0=B1=D0=B8=D1=80=D0=B0?= =?UTF-8?q?=D1=8E=D1=82=C2=BB=20group=20appears=20only=20with=20preferred?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since sf-input-country 1.6.0 (pair ui-994f9db407fa) the group is drawn only when the page names preferred: without it the list is alphabetical and the page language adds no group. The page gets a section and an example with preferred="RU,KZ,BY" open; the checkout recipe already sets preferred. Co-Authored-By: Claude Opus 5.5 --- content/ru/smart/forms/country-code.md | 16 +++++++++++++++- .../country-code/preferred/index.html | 1 + 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 examples/smart-components/country-code/preferred/index.html diff --git a/content/ru/smart/forms/country-code.md b/content/ru/smart/forms/country-code.md index 7e852e8bf..b1da8ea32 100644 --- a/content/ru/smart/forms/country-code.md +++ b/content/ru/smart/forms/country-code.md @@ -5,7 +5,7 @@ description: "Принимает телефон с выбором страны: # Код страны -:badge[sf-input-country]{variant=tonal scheme=primary size=1/2} :badge[1.6.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-input-country]{variant=outline scheme=on-surface size=1/2} :badge[1.6.0]{variant=outline scheme=on-surface size=1/2} Код страны — телефонное поле с кнопкой выбора страны: флаг и код страны стоят перед номером, а маска подстраивается под выбранную страну. Для телефона без @@ -72,6 +72,20 @@ description: "Принимает телефон с выбором страны: :::example {id="smart-components/country-code/masks" label="Маска"} ::: +### Часто выбирают + +`preferred` • [справочник](#атрибуты) + +`preferred` ставит вверху списка группу «Часто выбирают»: страны кодами +ISO через запятую, например `RU,KZ,BY`. Первыми в группе идут до двух +последних выборов человека, всего в ней не больше шести строк. Без +`preferred` группы нет: список стран идёт по алфавиту, и язык страницы +группу не добавляет. Пустое значение `preferred=""` показывает в группе +только последние выборы. + +:::example {id="smart-components/country-code/preferred" label="Группа «Часто выбирают»" preview=sandbox} +::: + ### Свой список стран `iso2`, `label`, `max-items` • [справочник](#атрибуты) diff --git a/examples/smart-components/country-code/preferred/index.html b/examples/smart-components/country-code/preferred/index.html new file mode 100644 index 000000000..63f057d65 --- /dev/null +++ b/examples/smart-components/country-code/preferred/index.html @@ -0,0 +1 @@ + From cbf8e3edb89fe19368b162ae4b0699c3a46f502f Mon Sep 17 00:00:00 2001 From: Rim Zabarov Date: Sun, 15 Nov 2026 14:51:43 +0300 Subject: [PATCH 05/75] Reference pages: the tag beside the title is an outline badge (C140) C140 (2): a mark beside a title is outline. The line under the H1 of every Smart and class component page drew the tag tonal primary and the version outline; both are now {variant=outline scheme=on-surface size=1/2}. The two generators write it, the reference audit expects it, the reference page standard names it, and the 155 generated pages are rewritten (build-smart-reference and build-reference-sections --check pass with no change). Co-Authored-By: Claude Opus 5.5 --- content/ru/components/actions/button-group.md | 2 +- content/ru/components/actions/buttons.md | 2 +- content/ru/components/actions/clipboard.md | 2 +- content/ru/components/actions/close.md | 2 +- content/ru/components/actions/download-file.md | 2 +- content/ru/components/actions/fab.md | 2 +- content/ru/components/actions/icon-buttons.md | 2 +- content/ru/components/content/accordion.md | 2 +- content/ru/components/content/avatars.md | 2 +- content/ru/components/content/card.md | 2 +- content/ru/components/content/content-divider.md | 2 +- content/ru/components/content/doc.md | 2 +- content/ru/components/content/emoji.md | 2 +- content/ru/components/content/featured-icon.md | 2 +- content/ru/components/content/figure.md | 2 +- content/ru/components/content/file-preview.md | 2 +- content/ru/components/content/flag.md | 2 +- content/ru/components/content/highlight.md | 2 +- content/ru/components/content/icons.md | 2 +- content/ru/components/content/kbd.md | 2 +- content/ru/components/content/procedure.md | 2 +- content/ru/components/content/reference-link.md | 2 +- content/ru/components/content/tags.md | 2 +- content/ru/components/feedback/alerts.md | 2 +- content/ru/components/feedback/badges.md | 2 +- content/ru/components/feedback/dot.md | 2 +- content/ru/components/feedback/placeholder.md | 2 +- content/ru/components/feedback/progress-bar.md | 2 +- content/ru/components/feedback/progress-scale.md | 2 +- content/ru/components/feedback/skeleton.md | 2 +- content/ru/components/feedback/spinner.md | 2 +- content/ru/components/feedback/toast.md | 2 +- content/ru/components/forms/checkbox.md | 2 +- content/ru/components/forms/country-code.md | 2 +- content/ru/components/forms/datepicker.md | 2 +- content/ru/components/forms/file-upload.md | 2 +- content/ru/components/forms/inputs.md | 2 +- content/ru/components/forms/quantity.md | 2 +- content/ru/components/forms/radio.md | 2 +- content/ru/components/forms/range-slider.md | 2 +- content/ru/components/forms/switch.md | 2 +- content/ru/components/forms/textarea.md | 2 +- content/ru/components/forms/verification.md | 2 +- content/ru/components/internal/admin-menu.md | 2 +- content/ru/components/navigation/breadcrumbs.md | 2 +- content/ru/components/navigation/context-menu.md | 2 +- content/ru/components/navigation/dropdown.md | 2 +- content/ru/components/navigation/link.md | 2 +- content/ru/components/navigation/menu.md | 2 +- content/ru/components/navigation/pagination.md | 2 +- content/ru/components/navigation/step.md | 2 +- content/ru/components/navigation/tab.md | 2 +- content/ru/components/navigation/tabs.md | 2 +- content/ru/components/navigation/tree-item.md | 2 +- content/ru/components/navigation/tree.md | 2 +- content/ru/components/overlays-media/carousel.md | 2 +- content/ru/components/overlays-media/modal.md | 2 +- content/ru/components/overlays-media/slider.md | 2 +- content/ru/components/overlays-media/tooltip.md | 2 +- content/ru/components/tools/hide-show.md | 2 +- content/ru/components/tools/outline.md | 2 +- content/ru/components/tools/scrollbar.md | 2 +- content/ru/components/tools/theme.md | 2 +- content/ru/pro/admin/admin-menu.md | 2 +- content/ru/pro/admin/change-confirm.md | 2 +- content/ru/pro/admin/property-view.md | 2 +- content/ru/pro/admin/table.md | 2 +- content/ru/pro/chat/chat-composer.md | 2 +- content/ru/pro/chat/chat-interlocutor.md | 2 +- content/ru/pro/chat/chat-message.md | 2 +- content/ru/pro/chat/chat-window.md | 2 +- content/ru/pro/chat/message-log.md | 2 +- content/ru/pro/chat/thread-list.md | 2 +- content/ru/pro/editor/content-editor.md | 2 +- content/ru/pro/editor/editor.md | 2 +- content/ru/pro/mail/mail-canvas.md | 2 +- content/ru/pro/mail/mail-inspector.md | 2 +- content/ru/pro/mail/mail-letters.md | 2 +- content/ru/pro/mail/mail-library.md | 2 +- content/ru/pro/mail/mail-structure.md | 2 +- content/ru/smart/actions/buttons.md | 2 +- content/ru/smart/actions/close.md | 2 +- content/ru/smart/actions/confirm.md | 2 +- content/ru/smart/actions/copy-button.md | 2 +- content/ru/smart/actions/download-file.md | 2 +- content/ru/smart/actions/icon-buttons.md | 2 +- content/ru/smart/actions/segmented.md | 2 +- content/ru/smart/composite/page-header.md | 2 +- content/ru/smart/composite/profile-picker.md | 2 +- content/ru/smart/composite/search.md | 2 +- content/ru/smart/composite/site-header.md | 2 +- content/ru/smart/content/accordion.md | 2 +- content/ru/smart/content/avatar.md | 2 +- content/ru/smart/content/avatars.md | 2 +- content/ru/smart/content/file-preview.md | 2 +- content/ru/smart/content/gallery.md | 2 +- content/ru/smart/content/icons.md | 2 +- content/ru/smart/content/include.md | 2 +- content/ru/smart/content/list-description.md | 2 +- content/ru/smart/content/list-feed.md | 2 +- content/ru/smart/content/list-item.md | 2 +- content/ru/smart/content/list-timeline.md | 2 +- content/ru/smart/content/list.md | 2 +- content/ru/smart/content/reference-link.md | 2 +- content/ru/smart/content/slider.md | 2 +- content/ru/smart/content/tags.md | 2 +- content/ru/smart/content/tile-metric.md | 2 +- content/ru/smart/editor/composition-overlay.md | 2 +- content/ru/smart/editor/inline-editor.md | 2 +- content/ru/smart/editor/sortable.md | 2 +- content/ru/smart/feedback/alert-bar.md | 2 +- content/ru/smart/feedback/alert.md | 2 +- content/ru/smart/feedback/badges.md | 2 +- content/ru/smart/feedback/empty-state.md | 2 +- content/ru/smart/feedback/help-mark.md | 2 +- content/ru/smart/feedback/list-attention.md | 2 +- content/ru/smart/feedback/progress-bar.md | 2 +- content/ru/smart/feedback/progress-ring.md | 2 +- content/ru/smart/feedback/progress-run.md | 2 +- content/ru/smart/feedback/progress-scale.md | 2 +- content/ru/smart/feedback/skeleton.md | 2 +- content/ru/smart/feedback/spinner.md | 2 +- content/ru/smart/feedback/toast.md | 2 +- content/ru/smart/feedback/tooltip.md | 2 +- content/ru/smart/forms/checkbox.md | 2 +- content/ru/smart/forms/code-input.md | 2 +- content/ru/smart/forms/color.md | 2 +- content/ru/smart/forms/datepicker.md | 2 +- content/ru/smart/forms/file-upload.md | 2 +- content/ru/smart/forms/image-field.md | 2 +- content/ru/smart/forms/input-choice.md | 2 +- content/ru/smart/forms/inputs.md | 2 +- content/ru/smart/forms/lookup.md | 2 +- content/ru/smart/forms/quantity.md | 2 +- content/ru/smart/forms/radio.md | 2 +- content/ru/smart/forms/range-slider.md | 2 +- content/ru/smart/forms/rich-text.md | 2 +- content/ru/smart/forms/switch.md | 2 +- content/ru/smart/forms/textarea.md | 2 +- content/ru/smart/forms/theme-generator.md | 2 +- content/ru/smart/navigation/breadcrumbs.md | 2 +- content/ru/smart/navigation/context-menu.md | 2 +- content/ru/smart/navigation/dropdown.md | 2 +- content/ru/smart/navigation/language.md | 2 +- content/ru/smart/navigation/pager.md | 2 +- content/ru/smart/navigation/pagination.md | 2 +- content/ru/smart/navigation/settings.md | 2 +- content/ru/smart/navigation/steps.md | 2 +- content/ru/smart/navigation/tabs.md | 2 +- content/ru/smart/navigation/tree-item.md | 2 +- content/ru/smart/navigation/tree.md | 2 +- content/ru/smart/overlays/drawer.md | 2 +- content/ru/smart/overlays/modal.md | 2 +- content/ru/smart/overlays/popover.md | 2 +- content/ru/smart/overlays/resizer.md | 2 +- docs/developer/reference-page-standard.md | 4 +++- scripts/audit-reference-pages.mjs | 2 +- scripts/build-reference-sections.mjs | 2 +- scripts/build-smart-reference.mjs | 2 +- 159 files changed, 161 insertions(+), 159 deletions(-) diff --git a/content/ru/components/actions/button-group.md b/content/ru/components/actions/button-group.md index fc8ada1c5..8ca512c22 100644 --- a/content/ru/components/actions/button-group.md +++ b/content/ru/components/actions/button-group.md @@ -6,7 +6,7 @@ profile: reference # Группа кнопок -:badge[sf-button-group]{variant=tonal scheme=primary size=1/2} :badge[1.3.1]{variant=outline scheme=on-surface size=1/2} +:badge[sf-button-group]{variant=outline scheme=on-surface size=1/2} :badge[1.3.1]{variant=outline scheme=on-surface size=1/2} Группа объединяет несколько связанных кнопок в один компактный элемент: соседние границы сливаются, внешние углы сохраняют радиус кнопок. Берите её для близких diff --git a/content/ru/components/actions/buttons.md b/content/ru/components/actions/buttons.md index b34c017d7..662de9d59 100644 --- a/content/ru/components/actions/buttons.md +++ b/content/ru/components/actions/buttons.md @@ -6,7 +6,7 @@ profile: reference # Кнопки -:badge[sf-button]{variant=tonal scheme=primary size=1/2} :badge[1.12.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-button]{variant=outline scheme=on-surface size=1/2} :badge[1.12.0]{variant=outline scheme=on-surface size=1/2} Кнопка запускает действие на текущей странице: сохраняет изменения, отправляет форму или подтверждает выбор. Для перехода на другую страницу берите ссылку, для diff --git a/content/ru/components/actions/clipboard.md b/content/ru/components/actions/clipboard.md index a40e34ba5..58879959d 100644 --- a/content/ru/components/actions/clipboard.md +++ b/content/ru/components/actions/clipboard.md @@ -6,7 +6,7 @@ profile: reference # Копирование -:badge[sf-clipboard]{variant=tonal scheme=primary size=1/2} :badge[1.1.1]{variant=outline scheme=on-surface size=1/2} +:badge[sf-clipboard]{variant=outline scheme=on-surface size=1/2} :badge[1.1.1]{variant=outline scheme=on-surface size=1/2} Любая кнопка может положить в буфер обмена готовое значение или текст другого элемента: команду, ключ, код заказа. Ставьте её рядом с текстом, который diff --git a/content/ru/components/actions/close.md b/content/ru/components/actions/close.md index 357bed8ec..eabbdb807 100644 --- a/content/ru/components/actions/close.md +++ b/content/ru/components/actions/close.md @@ -6,7 +6,7 @@ profile: reference # Кнопка закрытия -:badge[sf-close]{variant=tonal scheme=primary size=1/2} :badge[1.2.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-close]{variant=outline scheme=on-surface size=1/2} :badge[1.2.0]{variant=outline scheme=on-surface size=1/2} Кнопка закрытия закрывает окно, панель, уведомление или убирает тег. Здесь — её классы для своей разметки; обычно берут смарт-компонент diff --git a/content/ru/components/actions/download-file.md b/content/ru/components/actions/download-file.md index e337c6a70..9495edf46 100644 --- a/content/ru/components/actions/download-file.md +++ b/content/ru/components/actions/download-file.md @@ -6,7 +6,7 @@ profile: reference # Скачивание файла -:badge[sf-download-file]{variant=tonal scheme=primary size=1/2} :badge[1.4.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-download-file]{variant=outline scheme=on-surface size=1/2} :badge[1.4.0]{variant=outline scheme=on-surface size=1/2} Компонент оформляет ссылку на файл как отдельное действие: иконка скачивания, название и размер в одной строке. Берите его для вложений, diff --git a/content/ru/components/actions/fab.md b/content/ru/components/actions/fab.md index cac6ee569..4ffa1dbb0 100644 --- a/content/ru/components/actions/fab.md +++ b/content/ru/components/actions/fab.md @@ -6,7 +6,7 @@ profile: reference # Плавающая кнопка -:badge[sf-fab]{variant=tonal scheme=primary size=1/2} :badge[1.1.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-fab]{variant=outline scheme=on-surface size=1/2} :badge[1.1.0]{variant=outline scheme=on-surface size=1/2} Плавающая кнопка (FAB) — круглая кнопка с иконкой для одного главного и частого действия экрана: создать запись, написать сообщение. Для обычного diff --git a/content/ru/components/actions/icon-buttons.md b/content/ru/components/actions/icon-buttons.md index e118b6056..93d0adaea 100644 --- a/content/ru/components/actions/icon-buttons.md +++ b/content/ru/components/actions/icon-buttons.md @@ -6,7 +6,7 @@ profile: reference # Кнопки с иконкой -:badge[sf-icon-button]{variant=tonal scheme=primary size=1/2} :badge[1.8.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-icon-button]{variant=outline scheme=on-surface size=1/2} :badge[1.8.0]{variant=outline scheme=on-surface size=1/2} Кнопка с иконкой запускает действие без видимой подписи: редактировать, удалить, открыть настройки. Берите её, когда иконка общепринята и места мало; diff --git a/content/ru/components/content/accordion.md b/content/ru/components/content/accordion.md index 05e544035..fb6827beb 100644 --- a/content/ru/components/content/accordion.md +++ b/content/ru/components/content/accordion.md @@ -6,7 +6,7 @@ profile: reference # Аккордеон -:badge[sf-accordion]{variant=tonal scheme=primary size=1/2} :badge[1.0.5]{variant=outline scheme=on-surface size=1/2} +:badge[sf-accordion]{variant=outline scheme=on-surface size=1/2} :badge[1.0.5]{variant=outline scheme=on-surface size=1/2} Аккордеон раскрывает и скрывает разделы содержимого под их заголовками. Берите его, чтобы сократить длинную страницу с независимыми разделами — diff --git a/content/ru/components/content/avatars.md b/content/ru/components/content/avatars.md index 52a9a733c..c3522f6db 100644 --- a/content/ru/components/content/avatars.md +++ b/content/ru/components/content/avatars.md @@ -6,7 +6,7 @@ profile: reference # Аватары -:badge[sf-avatar]{variant=tonal scheme=primary size=1/2} :badge[1.8.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-avatar]{variant=outline scheme=on-surface size=1/2} :badge[1.8.0]{variant=outline scheme=on-surface size=1/2} Аватар помогает быстро узнать человека, организацию или системный объект по фотографии, инициалам или значку. Он представляет идентичность, а не diff --git a/content/ru/components/content/card.md b/content/ru/components/content/card.md index 2739903b4..9536e1d92 100644 --- a/content/ru/components/content/card.md +++ b/content/ru/components/content/card.md @@ -6,7 +6,7 @@ profile: reference # Карточка -:badge[sf-card]{variant=tonal scheme=primary size=1/2} :badge[1.6.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-card]{variant=outline scheme=on-surface size=1/2} :badge[1.6.0]{variant=outline scheme=on-surface size=1/2} Карточка собирает несколько блоков содержимого — заголовок, абзац, список, действие — в одну отдельную область с тонкой границей и скруглёнными углами. diff --git a/content/ru/components/content/content-divider.md b/content/ru/components/content/content-divider.md index 7f81f43d7..c8c03cb81 100644 --- a/content/ru/components/content/content-divider.md +++ b/content/ru/components/content/content-divider.md @@ -6,7 +6,7 @@ profile: reference # Разделитель -:badge[sf-divider]{variant=tonal scheme=primary size=1/2} :badge[1.0.2]{variant=outline scheme=on-surface size=1/2} +:badge[sf-divider]{variant=outline scheme=on-surface size=1/2} :badge[1.0.2]{variant=outline scheme=on-surface size=1/2} Разделитель отделяет соседние части содержимого или действий линией. Для простой границы между разделами достаточно `
    `; компонент нужен, когда diff --git a/content/ru/components/content/doc.md b/content/ru/components/content/doc.md index aacb15dcd..76bd1431d 100644 --- a/content/ru/components/content/doc.md +++ b/content/ru/components/content/doc.md @@ -6,7 +6,7 @@ profile: reference # Документ -:badge[sf-doc]{variant=tonal scheme=primary size=1/2} :badge[1.0.2]{variant=outline scheme=on-surface size=1/2} +:badge[sf-doc]{variant=outline scheme=on-surface size=1/2} :badge[1.0.2]{variant=outline scheme=on-surface size=1/2} Компонент оформляет служебные поверхности технической документации: область примера, исходный код под ней, вводный абзац и фоны для показа diff --git a/content/ru/components/content/emoji.md b/content/ru/components/content/emoji.md index 73ba26c13..30938e006 100644 --- a/content/ru/components/content/emoji.md +++ b/content/ru/components/content/emoji.md @@ -6,7 +6,7 @@ profile: reference # Эмодзи -:badge[sf-emoji]{variant=tonal scheme=primary size=1/2} :badge[1.0.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-emoji]{variant=outline scheme=on-surface size=1/2} :badge[1.0.0]{variant=outline scheme=on-surface size=1/2} Цветной эмодзи того же размера, что и текст вокруг: символ стоит в строке ровно и не раздвигает строки. Берите его для эмоциональных акцентов в тексте; статус и действия diff --git a/content/ru/components/content/featured-icon.md b/content/ru/components/content/featured-icon.md index 0678110fb..db578f3c9 100644 --- a/content/ru/components/content/featured-icon.md +++ b/content/ru/components/content/featured-icon.md @@ -6,7 +6,7 @@ profile: reference # Акцентная иконка -:badge[sf-featured-icon]{variant=tonal scheme=primary size=1/2} :badge[1.1.4]{variant=outline scheme=on-surface size=1/2} +:badge[sf-featured-icon]{variant=outline scheme=on-surface size=1/2} :badge[1.1.4]{variant=outline scheme=on-surface size=1/2} Акцентная иконка ставит [иконку](/ru/components/content/icons/) на цветную подложку и выделяет тему карточки, раздела, статуса или пустого состояния. diff --git a/content/ru/components/content/figure.md b/content/ru/components/content/figure.md index a5a6ca44e..957309a8c 100644 --- a/content/ru/components/content/figure.md +++ b/content/ru/components/content/figure.md @@ -6,7 +6,7 @@ profile: reference # Рисунок -:badge[sf-figure]{variant=tonal scheme=primary size=1/2} :badge[1.2.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-figure]{variant=outline scheme=on-surface size=1/2} :badge[1.2.0]{variant=outline scheme=on-surface size=1/2} Рисунок показывает картинку, видео или иллюстрацию в заданной пропорции и подпись под ней. Берите его, когда изображению нужна подпись или ровная рамка diff --git a/content/ru/components/content/file-preview.md b/content/ru/components/content/file-preview.md index 4417be9d8..efc8c925b 100644 --- a/content/ru/components/content/file-preview.md +++ b/content/ru/components/content/file-preview.md @@ -6,7 +6,7 @@ profile: reference # Предпросмотр файла -:badge[sf-file-preview]{variant=tonal scheme=primary size=1/2} :badge[1.1.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-file-preview]{variant=outline scheme=on-surface size=1/2} :badge[1.1.0]{variant=outline scheme=on-surface size=1/2} Предпросмотр показывает выбранный или прикреплённый файл одной строкой: иконку типа или миниатюру, имя, размер и действия с файлом. Берите его для diff --git a/content/ru/components/content/flag.md b/content/ru/components/content/flag.md index 96485dc2c..be15f5621 100644 --- a/content/ru/components/content/flag.md +++ b/content/ru/components/content/flag.md @@ -6,7 +6,7 @@ profile: reference # Флаг -:badge[sf-flag]{variant=tonal scheme=primary size=1/2} :badge[1.1.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-flag]{variant=outline scheme=on-surface size=1/2} :badge[1.1.0]{variant=outline scheme=on-surface size=1/2} Флаг показывает страну картинкой: в телефонном поле, списке стран, рядом с ценой или адресом. Берите его вместо флага-эмодзи: эмодзи рисует системный diff --git a/content/ru/components/content/highlight.md b/content/ru/components/content/highlight.md index 1d61cca05..226bd3ca0 100644 --- a/content/ru/components/content/highlight.md +++ b/content/ru/components/content/highlight.md @@ -6,7 +6,7 @@ profile: reference # Подсветка кода -:badge[sf-highlight]{variant=tonal scheme=primary size=1/2} :badge[1.3.1]{variant=outline scheme=on-surface size=1/2} +:badge[sf-highlight]{variant=outline scheme=on-surface size=1/2} :badge[1.3.1]{variant=outline scheme=on-surface size=1/2} Подсветка кода раскрашивает синтаксис в блоках `pre code` и оформляет их поверхностью с панелью: название языка и кнопка копирования. Берите её для diff --git a/content/ru/components/content/icons.md b/content/ru/components/content/icons.md index b1f6f8cab..dbdbc1fa1 100644 --- a/content/ru/components/content/icons.md +++ b/content/ru/components/content/icons.md @@ -6,7 +6,7 @@ profile: reference # Иконки -:badge[sf-icon]{variant=tonal scheme=primary size=1/2} :badge[1.2.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-icon]{variant=outline scheme=on-surface size=1/2} :badge[1.2.0]{variant=outline scheme=on-surface size=1/2} Иконка выводит символ шрифта Material Symbols по его имени и согласует размер, начертание и форму со шкалами Framework. Берите её, чтобы подкрепить diff --git a/content/ru/components/content/kbd.md b/content/ru/components/content/kbd.md index 1794e45f0..6462c0b75 100644 --- a/content/ru/components/content/kbd.md +++ b/content/ru/components/content/kbd.md @@ -6,7 +6,7 @@ profile: reference # Клавиши -:badge[sf-kbd]{variant=tonal scheme=primary size=1/2} :badge[1.3.3]{variant=outline scheme=on-surface size=1/2} +:badge[sf-kbd]{variant=outline scheme=on-surface size=1/2} :badge[1.3.3]{variant=outline scheme=on-surface size=1/2} Показывает, какую клавишу или сочетание нажать, так, что это читается как надпись на клавише: «нажмите `Ctrl` + `S`». Берите его в инструкциях, подсказках и справке по diff --git a/content/ru/components/content/procedure.md b/content/ru/components/content/procedure.md index fd3d5ed61..11503f763 100644 --- a/content/ru/components/content/procedure.md +++ b/content/ru/components/content/procedure.md @@ -6,7 +6,7 @@ profile: reference # Шаги инструкции -:badge[sf-procedure]{variant=tonal scheme=primary size=1/2} :badge[1.1.1]{variant=outline scheme=on-surface size=1/2} +:badge[sf-procedure]{variant=outline scheme=on-surface size=1/2} :badge[1.1.1]{variant=outline scheme=on-surface size=1/2} Шаги инструкции показывают нумерованную последовательность действий, которую читают сверху вниз: установку, настройку, перенос. В каждом шаге может быть diff --git a/content/ru/components/content/reference-link.md b/content/ru/components/content/reference-link.md index 9b302eafc..481dd6758 100644 --- a/content/ru/components/content/reference-link.md +++ b/content/ru/components/content/reference-link.md @@ -6,7 +6,7 @@ profile: reference # Справочная ссылка -:badge[sf-reference-link]{variant=tonal scheme=primary size=1/2} :badge[1.1.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-reference-link]{variant=outline scheme=on-surface size=1/2} :badge[1.1.0]{variant=outline scheme=on-surface size=1/2} Справочная ссылка показывает переход вместе с коротким пояснением: путём, источником, идентификатором записи. Вся карточка — область нажатия. Для diff --git a/content/ru/components/content/tags.md b/content/ru/components/content/tags.md index 593f55c15..135d88a98 100644 --- a/content/ru/components/content/tags.md +++ b/content/ru/components/content/tags.md @@ -6,7 +6,7 @@ profile: reference # Теги -:badge[sf-tag]{variant=tonal scheme=primary size=1/2} :badge[1.6.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-tag]{variant=outline scheme=on-surface size=1/2} :badge[1.6.0]{variant=outline scheme=on-surface size=1/2} Тег компактно показывает категорию, выбранное значение, фильтр или статус. Сам по себе тег — надпись, а не действие: кнопкой становится только тег, который diff --git a/content/ru/components/feedback/alerts.md b/content/ru/components/feedback/alerts.md index b58cfc84e..7abe7f662 100644 --- a/content/ru/components/feedback/alerts.md +++ b/content/ru/components/feedback/alerts.md @@ -6,7 +6,7 @@ profile: reference # Уведомления -:badge[sf-alert]{variant=tonal scheme=primary size=1/2} :badge[1.3.1]{variant=outline scheme=on-surface size=1/2} +:badge[sf-alert]{variant=outline scheme=on-surface size=1/2} :badge[1.3.1]{variant=outline scheme=on-surface size=1/2} Уведомление сообщает о состоянии этой страницы или её раздела: подсказку, предупреждение, ошибку или подтверждение результата. Оно стоит в потоке diff --git a/content/ru/components/feedback/badges.md b/content/ru/components/feedback/badges.md index e1d326f58..999a6f0dc 100644 --- a/content/ru/components/feedback/badges.md +++ b/content/ru/components/feedback/badges.md @@ -6,7 +6,7 @@ profile: reference # Бейджи -:badge[sf-badge]{variant=tonal scheme=primary size=1/2} :badge[1.8.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-badge]{variant=outline scheme=on-surface size=1/2} :badge[1.8.0]{variant=outline scheme=on-surface size=1/2} Бейдж показывает короткий статус, категорию или счётчик рядом с объектом. Он дополняет основное содержимое и не заменяет кнопку, фильтр или diff --git a/content/ru/components/feedback/dot.md b/content/ru/components/feedback/dot.md index d3ad11e08..2d9757814 100644 --- a/content/ru/components/feedback/dot.md +++ b/content/ru/components/feedback/dot.md @@ -6,7 +6,7 @@ profile: reference # Точка состояния -:badge[sf-dot]{variant=tonal scheme=primary size=1/2} :badge[1.1.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-dot]{variant=outline scheme=on-surface size=1/2} :badge[1.1.0]{variant=outline scheme=on-surface size=1/2} Точка состояния цветом показывает, доступен ли человек или сервис, идёт ли работа и чем она закончилась. Она подходит для строк списка и других мест, где diff --git a/content/ru/components/feedback/placeholder.md b/content/ru/components/feedback/placeholder.md index 2c8f24fdb..956a0ce79 100644 --- a/content/ru/components/feedback/placeholder.md +++ b/content/ru/components/feedback/placeholder.md @@ -6,7 +6,7 @@ profile: reference # Заполнитель -:badge[sf-placeholder]{variant=tonal scheme=primary size=1/2} :badge[1.0.2]{variant=outline scheme=on-surface size=1/2} +:badge[sf-placeholder]{variant=outline scheme=on-surface size=1/2} :badge[1.0.2]{variant=outline scheme=on-surface size=1/2} Заполнитель объясняет пустое состояние: данных нет, поиск ничего не нашёл или раздел не заполнен. Для ожидания данных берите diff --git a/content/ru/components/feedback/progress-bar.md b/content/ru/components/feedback/progress-bar.md index ff1c2dcf5..ac17e7395 100644 --- a/content/ru/components/feedback/progress-bar.md +++ b/content/ru/components/feedback/progress-bar.md @@ -6,7 +6,7 @@ profile: reference # Прогресс -:badge[sf-progress-bar]{variant=tonal scheme=primary size=1/2} :badge[1.3.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-progress-bar]{variant=outline scheme=on-surface size=1/2} :badge[1.3.0]{variant=outline scheme=on-surface size=1/2} Индикатор прогресса показывает ход операции, когда долю выполненного можно выразить от 0 до 100 процентов. Для операции без известного процента берите diff --git a/content/ru/components/feedback/progress-scale.md b/content/ru/components/feedback/progress-scale.md index 690c4a90c..7a887893a 100644 --- a/content/ru/components/feedback/progress-scale.md +++ b/content/ru/components/feedback/progress-scale.md @@ -6,7 +6,7 @@ profile: reference # Шкала прогресса -:badge[sf-progress-scale]{variant=tonal scheme=primary size=1/2} :badge[1.2.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-progress-scale]{variant=outline scheme=on-surface size=1/2} :badge[1.2.0]{variant=outline scheme=on-surface size=1/2} Шкала делит ход операции на десять участков, по одному на каждые десять процентов. Она наглядна там, где обычная полоса выглядит слишком абстрактно: diff --git a/content/ru/components/feedback/skeleton.md b/content/ru/components/feedback/skeleton.md index 8ba874deb..c9f6d39f4 100644 --- a/content/ru/components/feedback/skeleton.md +++ b/content/ru/components/feedback/skeleton.md @@ -6,7 +6,7 @@ profile: reference # Скелетон -:badge[sf-skeleton]{variant=tonal scheme=primary size=1/2} :badge[1.3.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-skeleton]{variant=outline scheme=on-surface size=1/2} :badge[1.3.0]{variant=outline scheme=on-surface size=1/2} Скелетон заранее занимает место загружаемого содержимого и повторяет его форму: строки текста, аватар, изображение. При замене интерфейс не смещается. diff --git a/content/ru/components/feedback/spinner.md b/content/ru/components/feedback/spinner.md index ff5fc719b..e2c7b96a9 100644 --- a/content/ru/components/feedback/spinner.md +++ b/content/ru/components/feedback/spinner.md @@ -6,7 +6,7 @@ profile: reference # Спиннер -:badge[sf-loader]{variant=tonal scheme=primary size=1/2} :badge[1.3.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-loader]{variant=outline scheme=on-surface size=1/2} :badge[1.3.0]{variant=outline scheme=on-surface size=1/2} Спиннер показывает, что операция выполняется, когда процент завершения неизвестен. Если процент известен, берите diff --git a/content/ru/components/feedback/toast.md b/content/ru/components/feedback/toast.md index 180e712b2..1881d4611 100644 --- a/content/ru/components/feedback/toast.md +++ b/content/ru/components/feedback/toast.md @@ -6,7 +6,7 @@ profile: reference # Всплывающие сообщения -:badge[sf-toast]{variant=tonal scheme=primary size=1/2} :badge[1.4.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-toast]{variant=outline scheme=on-surface size=1/2} :badge[1.4.0]{variant=outline scheme=on-surface size=1/2} Всплывающее сообщение коротко сообщает результат действия поверх интерфейса и не блокирует дальнейшую работу. Для постоянного текста внутри страницы diff --git a/content/ru/components/forms/checkbox.md b/content/ru/components/forms/checkbox.md index fdfb9ff2c..913b38784 100644 --- a/content/ru/components/forms/checkbox.md +++ b/content/ru/components/forms/checkbox.md @@ -6,7 +6,7 @@ profile: reference # Флажок -:badge[sf-checkbox]{variant=tonal scheme=primary size=1/2} :badge[1.3.1]{variant=outline scheme=on-surface size=1/2} +:badge[sf-checkbox]{variant=outline scheme=on-surface size=1/2} :badge[1.3.1]{variant=outline scheme=on-surface size=1/2} Флажок включает независимый параметр или выбирает несколько значений из списка. Для одного выбора из взаимоисключающих вариантов берите diff --git a/content/ru/components/forms/country-code.md b/content/ru/components/forms/country-code.md index 98b58104f..a8af80f46 100644 --- a/content/ru/components/forms/country-code.md +++ b/content/ru/components/forms/country-code.md @@ -6,7 +6,7 @@ profile: reference # Код страны -:badge[sf-country-code]{variant=tonal scheme=primary size=1/2} :badge[1.6.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-country-code]{variant=outline scheme=on-surface size=1/2} :badge[1.6.0]{variant=outline scheme=on-surface size=1/2} Поле кода страны принимает номер телефона вместе с международным кодом: флаг показывает страну, список позволяет её сменить, маска форматирует номер по diff --git a/content/ru/components/forms/datepicker.md b/content/ru/components/forms/datepicker.md index 9fbc3b530..c315cc932 100644 --- a/content/ru/components/forms/datepicker.md +++ b/content/ru/components/forms/datepicker.md @@ -6,7 +6,7 @@ profile: reference # Календарь -:badge[sf-datepicker]{variant=tonal scheme=primary size=1/2} :badge[1.5.1]{variant=outline scheme=on-surface size=1/2} +:badge[sf-datepicker]{variant=outline scheme=on-surface size=1/2} :badge[1.5.1]{variant=outline scheme=on-surface size=1/2} Календарь показывает дни месяца, выбранную дату или период. Поведения у классов нет: перелистывание, выбор даты и diff --git a/content/ru/components/forms/file-upload.md b/content/ru/components/forms/file-upload.md index 170d4155f..cbf512913 100644 --- a/content/ru/components/forms/file-upload.md +++ b/content/ru/components/forms/file-upload.md @@ -6,7 +6,7 @@ profile: reference # Загрузка файлов -:badge[sf-file-upload]{variant=tonal scheme=primary size=1/2} :badge[1.2.1]{variant=outline scheme=on-surface size=1/2} +:badge[sf-file-upload]{variant=outline scheme=on-surface size=1/2} :badge[1.2.1]{variant=outline scheme=on-surface size=1/2} Загрузка файлов принимает один или несколько файлов через системное окно или перетаскиванием и показывает список выбранных файлов с ходом передачи. Сами diff --git a/content/ru/components/forms/inputs.md b/content/ru/components/forms/inputs.md index d0ed65bca..e8428293a 100644 --- a/content/ru/components/forms/inputs.md +++ b/content/ru/components/forms/inputs.md @@ -6,7 +6,7 @@ profile: reference # Текстовые поля -:badge[sf-input]{variant=tonal scheme=primary size=1/2} :badge[1.6.1]{variant=outline scheme=on-surface size=1/2} +:badge[sf-input]{variant=outline scheme=on-surface size=1/2} :badge[1.6.1]{variant=outline scheme=on-surface size=1/2} Текстовое поле принимает короткое значение в одну строку: имя, адрес почты, пароль или поисковый запрос. Для текста с переносами строк берите diff --git a/content/ru/components/forms/quantity.md b/content/ru/components/forms/quantity.md index 4e717c25c..d56247796 100644 --- a/content/ru/components/forms/quantity.md +++ b/content/ru/components/forms/quantity.md @@ -6,7 +6,7 @@ profile: reference # Количество -:badge[sf-quantity]{variant=tonal scheme=primary size=1/2} :badge[1.3.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-quantity]{variant=outline scheme=on-surface size=1/2} :badge[1.3.0]{variant=outline scheme=on-surface size=1/2} Поле количества принимает число с клавиатуры или меняет его кнопками «минус» и «плюс» на заданный шаг. Подходит для количества товаров, мест, участников и diff --git a/content/ru/components/forms/radio.md b/content/ru/components/forms/radio.md index 3ba298460..902bf3e09 100644 --- a/content/ru/components/forms/radio.md +++ b/content/ru/components/forms/radio.md @@ -6,7 +6,7 @@ profile: reference # Радиокнопки -:badge[sf-radio-button]{variant=tonal scheme=primary size=1/2} :badge[1.3.1]{variant=outline scheme=on-surface size=1/2} +:badge[sf-radio-button]{variant=outline scheme=on-surface size=1/2} :badge[1.3.1]{variant=outline scheme=on-surface size=1/2} Радиокнопки выбирают ровно один вариант из группы, когда все варианты нужно показать сразу. Для независимых параметров берите diff --git a/content/ru/components/forms/range-slider.md b/content/ru/components/forms/range-slider.md index cb4374d75..107771a71 100644 --- a/content/ru/components/forms/range-slider.md +++ b/content/ru/components/forms/range-slider.md @@ -6,7 +6,7 @@ profile: reference # Слайдер диапазона -:badge[sf-range-slider]{variant=tonal scheme=primary size=1/2} :badge[1.4.1]{variant=outline scheme=on-surface size=1/2} +:badge[sf-range-slider]{variant=outline scheme=on-surface size=1/2} :badge[1.4.1]{variant=outline scheme=on-surface size=1/2} Слайдер диапазона выбирает одно значение или две границы перетаскиванием ручки по шкале. Подходит для приблизительной настройки цены, громкости или diff --git a/content/ru/components/forms/switch.md b/content/ru/components/forms/switch.md index 6ff9a65f1..a28837982 100644 --- a/content/ru/components/forms/switch.md +++ b/content/ru/components/forms/switch.md @@ -6,7 +6,7 @@ profile: reference # Переключатель -:badge[sf-switch]{variant=tonal scheme=primary size=1/2} :badge[1.3.1]{variant=outline scheme=on-surface size=1/2} +:badge[sf-switch]{variant=outline scheme=on-surface size=1/2} :badge[1.3.1]{variant=outline scheme=on-surface size=1/2} Переключатель включает или выключает настройку сразу после нажатия. Если значение уходит вместе с формой после подтверждения, берите diff --git a/content/ru/components/forms/textarea.md b/content/ru/components/forms/textarea.md index e9003f2ea..7590baa93 100644 --- a/content/ru/components/forms/textarea.md +++ b/content/ru/components/forms/textarea.md @@ -6,7 +6,7 @@ profile: reference # Многострочное поле -:badge[sf-textarea]{variant=tonal scheme=primary size=1/2} :badge[1.4.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-textarea]{variant=outline scheme=on-surface size=1/2} :badge[1.4.0]{variant=outline scheme=on-surface size=1/2} Многострочное поле принимает комментарий, описание или другой свободный текст с переносами строк. Для короткого значения в одну строку берите diff --git a/content/ru/components/forms/verification.md b/content/ru/components/forms/verification.md index d75c0bed1..8a9b0b765 100644 --- a/content/ru/components/forms/verification.md +++ b/content/ru/components/forms/verification.md @@ -6,7 +6,7 @@ profile: reference # Код подтверждения -:badge[sf-verification]{variant=tonal scheme=primary size=1/2} :badge[1.4.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-verification]{variant=outline scheme=on-surface size=1/2} :badge[1.4.0]{variant=outline scheme=on-surface size=1/2} Код подтверждения принимает одноразовый код из сообщения или приложения и показывает его по отдельным ячейкам. Под ячейками лежит одно нативное поле, diff --git a/content/ru/components/internal/admin-menu.md b/content/ru/components/internal/admin-menu.md index 1c1c833ff..e34f01a6d 100644 --- a/content/ru/components/internal/admin-menu.md +++ b/content/ru/components/internal/admin-menu.md @@ -6,7 +6,7 @@ profile: reference # Основа Admin Menu -:badge[sf-admin-menu]{variant=tonal scheme=primary size=1/2} :badge[1.2.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-admin-menu]{variant=outline scheme=on-surface size=1/2} :badge[1.2.0]{variant=outline scheme=on-surface size=1/2} Боковая навигация административного приложения: человек видит разделы с иконками, открывает вложенные панели, ищет пункт по названию, сворачивает diff --git a/content/ru/components/navigation/breadcrumbs.md b/content/ru/components/navigation/breadcrumbs.md index 19daf0118..6e5a6be6e 100644 --- a/content/ru/components/navigation/breadcrumbs.md +++ b/content/ru/components/navigation/breadcrumbs.md @@ -6,7 +6,7 @@ profile: reference # Хлебные крошки -:badge[sf-breadcrumbs]{variant=tonal scheme=primary size=1/2} :badge[1.1.4]{variant=outline scheme=on-surface size=1/2} +:badge[sf-breadcrumbs]{variant=outline scheme=on-surface size=1/2} :badge[1.1.4]{variant=outline scheme=on-surface size=1/2} Хлебные крошки показывают путь от главной страницы до текущей и дают перейти на любой родительский уровень. Это вторичная навигация: она дополняет diff --git a/content/ru/components/navigation/context-menu.md b/content/ru/components/navigation/context-menu.md index e95d2fc09..b422de87a 100644 --- a/content/ru/components/navigation/context-menu.md +++ b/content/ru/components/navigation/context-menu.md @@ -6,7 +6,7 @@ profile: reference # Контекстное меню -:badge[sf-context-menu]{variant=tonal scheme=primary size=1/2} :badge[1.11.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-context-menu]{variant=outline scheme=on-surface size=1/2} :badge[1.11.0]{variant=outline scheme=on-surface size=1/2} Контекстное меню — приподнятая панель с коротким списком действий над выбранным объектом: строкой таблицы, файлом, карточкой. Ширина панели diff --git a/content/ru/components/navigation/dropdown.md b/content/ru/components/navigation/dropdown.md index 4eb8eae35..263c8c7b6 100644 --- a/content/ru/components/navigation/dropdown.md +++ b/content/ru/components/navigation/dropdown.md @@ -6,7 +6,7 @@ profile: reference # Выпадающий список -:badge[sf-dropdown]{variant=tonal scheme=primary size=1/2} :badge[1.9.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-dropdown]{variant=outline scheme=on-surface size=1/2} :badge[1.9.0]{variant=outline scheme=on-surface size=1/2} Выпадающий список экономит место и даёт выбрать одно или несколько значений из набора вариантов; видимая подпись пункта отделена от его машинного diff --git a/content/ru/components/navigation/link.md b/content/ru/components/navigation/link.md index 5c5abf680..8736363ac 100644 --- a/content/ru/components/navigation/link.md +++ b/content/ru/components/navigation/link.md @@ -6,7 +6,7 @@ profile: reference # Ссылка -:badge[sf-link]{variant=tonal scheme=primary size=1/2} :badge[1.0.1]{variant=outline scheme=on-surface size=1/2} +:badge[sf-link]{variant=outline scheme=on-surface size=1/2} :badge[1.0.1]{variant=outline scheme=on-surface size=1/2} Ссылка ведёт на другую страницу, раздел страницы или файл. Для действия на текущей странице — сохранить, отправить, открыть окно — берите diff --git a/content/ru/components/navigation/menu.md b/content/ru/components/navigation/menu.md index 2be9e2b93..d9b4998d3 100644 --- a/content/ru/components/navigation/menu.md +++ b/content/ru/components/navigation/menu.md @@ -6,7 +6,7 @@ profile: reference # Меню -:badge[sf-menu]{variant=tonal scheme=primary size=1/2} :badge[1.8.1]{variant=outline scheme=on-surface size=1/2} +:badge[sf-menu]{variant=outline scheme=on-surface size=1/2} :badge[1.8.1]{variant=outline scheme=on-surface size=1/2} Меню ведёт по разделам сайта, раздела или личного кабинета и раскрывает группы вложенных разделов. Один компонент показывается вертикально в боковой diff --git a/content/ru/components/navigation/pagination.md b/content/ru/components/navigation/pagination.md index 5c03b4a86..14f3b7cde 100644 --- a/content/ru/components/navigation/pagination.md +++ b/content/ru/components/navigation/pagination.md @@ -6,7 +6,7 @@ profile: reference # Пагинация -:badge[sf-pagination]{variant=tonal scheme=primary size=1/2} :badge[1.4.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-pagination]{variant=outline scheme=on-surface size=1/2} :badge[1.4.0]{variant=outline scheme=on-surface size=1/2} Пагинация делит длинный список результатов на страницы, показывает текущую и даёт перейти к соседней или конкретной странице. Ставьте её сразу после diff --git a/content/ru/components/navigation/step.md b/content/ru/components/navigation/step.md index 0ac69013d..a0c8f2878 100644 --- a/content/ru/components/navigation/step.md +++ b/content/ru/components/navigation/step.md @@ -6,7 +6,7 @@ profile: reference # Шаги -:badge[sf-steps]{variant=tonal scheme=primary size=1/2} :badge[1.3.1]{variant=outline scheme=on-surface size=1/2} +:badge[sf-steps]{variant=outline scheme=on-surface size=1/2} :badge[1.3.1]{variant=outline scheme=on-surface size=1/2} Шаги показывают, где человек находится в процессе, который проходит сам, — оформлении заказа, публикации, настройке, — и отмечают пройденные, текущий и diff --git a/content/ru/components/navigation/tab.md b/content/ru/components/navigation/tab.md index 7216f207e..62e3c7b4f 100644 --- a/content/ru/components/navigation/tab.md +++ b/content/ru/components/navigation/tab.md @@ -6,7 +6,7 @@ profile: reference # Вкладка (совместимость) -:badge[sf-tab]{variant=tonal scheme=primary size=1/2} :badge[1.0.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-tab]{variant=outline scheme=on-surface size=1/2} :badge[1.0.0]{variant=outline scheme=on-surface size=1/2} `sf-tab` переключает секции содержимого по списку пунктов `ul`, у каждого из которых два представления — обычное и активное. Компонент нужен для diff --git a/content/ru/components/navigation/tabs.md b/content/ru/components/navigation/tabs.md index 99e72d44e..39572ada4 100644 --- a/content/ru/components/navigation/tabs.md +++ b/content/ru/components/navigation/tabs.md @@ -6,7 +6,7 @@ profile: reference # Вкладки -:badge[sf-tabs]{variant=tonal scheme=primary size=1/2} :badge[1.2.2]{variant=outline scheme=on-surface size=1/2} +:badge[sf-tabs]{variant=outline scheme=on-surface size=1/2} :badge[1.2.2]{variant=outline scheme=on-surface size=1/2} Вкладки показывают один из нескольких связанных разделов на месте, без перехода на другую страницу. Пункты короткие и относятся к одному объекту; diff --git a/content/ru/components/navigation/tree-item.md b/content/ru/components/navigation/tree-item.md index 7d0c1eb4d..d5c09a0b4 100644 --- a/content/ru/components/navigation/tree-item.md +++ b/content/ru/components/navigation/tree-item.md @@ -6,7 +6,7 @@ profile: reference # Элемент дерева -:badge[sf-tree-item]{variant=tonal scheme=primary size=1/2} :badge[1.1.1]{variant=outline scheme=on-surface size=1/2} +:badge[sf-tree-item]{variant=outline scheme=on-surface size=1/2} :badge[1.1.1]{variant=outline scheme=on-surface size=1/2} Элемент дерева — один узел [дерева](/ru/components/navigation/tree/): строка с переключателем ветви, иконкой и подписью и, у ветви, группа дочерних diff --git a/content/ru/components/navigation/tree.md b/content/ru/components/navigation/tree.md index ac250e186..180e927c3 100644 --- a/content/ru/components/navigation/tree.md +++ b/content/ru/components/navigation/tree.md @@ -6,7 +6,7 @@ profile: reference # Дерево -:badge[sf-tree]{variant=tonal scheme=primary size=1/2} :badge[1.3.3]{variant=outline scheme=on-surface size=1/2} +:badge[sf-tree]{variant=outline scheme=on-surface size=1/2} :badge[1.3.3]{variant=outline scheme=on-surface size=1/2} Дерево показывает вложенную иерархию — папки, разделы, категории — и даёт раскрывать и сворачивать ветви. Для навигации по страницам сайта с diff --git a/content/ru/components/overlays-media/carousel.md b/content/ru/components/overlays-media/carousel.md index 49b55b0c4..57c119ae5 100644 --- a/content/ru/components/overlays-media/carousel.md +++ b/content/ru/components/overlays-media/carousel.md @@ -6,7 +6,7 @@ profile: reference # Карусель -:badge[sf-carousel]{variant=tonal scheme=primary size=1/2} :badge[1.3.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-carousel]{variant=outline scheme=on-surface size=1/2} :badge[1.3.0]{variant=outline scheme=on-surface size=1/2} `sf-carousel` — прежнее имя [слайдера контента](/ru/components/overlays-media/slider/). Во Framework теперь один слайдер: `sf-slider`. Карусель работает до diff --git a/content/ru/components/overlays-media/modal.md b/content/ru/components/overlays-media/modal.md index ca93c0c6c..c27e7d77b 100644 --- a/content/ru/components/overlays-media/modal.md +++ b/content/ru/components/overlays-media/modal.md @@ -6,7 +6,7 @@ profile: reference # Модальное окно -:badge[sf-modal]{variant=tonal scheme=primary size=1/2} :badge[1.3.3]{variant=outline scheme=on-surface size=1/2} +:badge[sf-modal]{variant=outline scheme=on-surface size=1/2} :badge[1.3.3]{variant=outline scheme=on-surface size=1/2} Модальное окно переводит пользователя к одной важной задаче поверх страницы: подтвердить действие, заполнить короткую форму. Страница за окном недоступна, diff --git a/content/ru/components/overlays-media/slider.md b/content/ru/components/overlays-media/slider.md index 89ee331f5..0cb2eb0cb 100644 --- a/content/ru/components/overlays-media/slider.md +++ b/content/ru/components/overlays-media/slider.md @@ -6,7 +6,7 @@ profile: reference # Слайдер контента -:badge[sf-slider]{variant=tonal scheme=primary size=1/2} :badge[1.2.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-slider]{variant=outline scheme=on-surface size=1/2} :badge[1.2.0]{variant=outline scheme=on-surface size=1/2} Слайдер контента показывает изображения, карточки или другие равноправные слайды по одному и листает их стрелками и точками. diff --git a/content/ru/components/overlays-media/tooltip.md b/content/ru/components/overlays-media/tooltip.md index ac8835c7c..93c95dda1 100644 --- a/content/ru/components/overlays-media/tooltip.md +++ b/content/ru/components/overlays-media/tooltip.md @@ -6,7 +6,7 @@ profile: reference # Подсказка -:badge[sf-tooltip]{variant=tonal scheme=primary size=1/2} :badge[1.3.1]{variant=outline scheme=on-surface size=1/2} +:badge[sf-tooltip]{variant=outline scheme=on-surface size=1/2} :badge[1.3.1]{variant=outline scheme=on-surface size=1/2} Подсказка показывает короткое пояснение к элементу при наведении указателя или фокусе с клавиатуры. Не переносите в неё сведения, без которых нельзя diff --git a/content/ru/components/tools/hide-show.md b/content/ru/components/tools/hide-show.md index 4e6d30f70..27e813376 100644 --- a/content/ru/components/tools/hide-show.md +++ b/content/ru/components/tools/hide-show.md @@ -6,7 +6,7 @@ profile: reference # Показ и скрытие -:badge[sf-hide-show]{variant=tonal scheme=primary size=1/2} :badge[1.0.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-hide-show]{variant=outline scheme=on-surface size=1/2} :badge[1.0.0]{variant=outline scheme=on-surface size=1/2} Компонент показывает и скрывает связанное содержимое по кнопкам и отражает состояние для экранного диктора. Для простого раскрываемого блока сначала diff --git a/content/ru/components/tools/outline.md b/content/ru/components/tools/outline.md index 1a7285380..d3e712a60 100644 --- a/content/ru/components/tools/outline.md +++ b/content/ru/components/tools/outline.md @@ -6,7 +6,7 @@ profile: reference # Оглавление -:badge[sf-outline]{variant=tonal scheme=primary size=1/2} :badge[1.1.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-outline]{variant=outline scheme=on-surface size=1/2} :badge[1.1.0]{variant=outline scheme=on-surface size=1/2} Оглавление показывает разделы длинной страницы списком якорных ссылок и отмечает текущий раздел. Для навигации между страницами берите меню или diff --git a/content/ru/components/tools/scrollbar.md b/content/ru/components/tools/scrollbar.md index c07c5231a..651b8478c 100644 --- a/content/ru/components/tools/scrollbar.md +++ b/content/ru/components/tools/scrollbar.md @@ -6,7 +6,7 @@ profile: reference # Полоса прокрутки -:badge[sf-scrollbar]{variant=tonal scheme=primary size=1/2} :badge[1.2.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-scrollbar]{variant=outline scheme=on-surface size=1/2} :badge[1.2.0]{variant=outline scheme=on-surface size=1/2} Компонент оформляет прокрутку области ограниченной высоты или ширины: прячет системную полосу и рисует поверх содержимого тонкую полосу, которую можно diff --git a/content/ru/components/tools/theme.md b/content/ru/components/tools/theme.md index 448abd7b4..c4cd3cf00 100644 --- a/content/ru/components/tools/theme.md +++ b/content/ru/components/tools/theme.md @@ -6,7 +6,7 @@ profile: reference # Тема -:badge[sf-theme-button]{variant=tonal scheme=primary size=1/2} :badge[1.2.1]{variant=outline scheme=on-surface size=1/2} +:badge[sf-theme-button]{variant=outline scheme=on-surface size=1/2} :badge[1.2.1]{variant=outline scheme=on-surface size=1/2} Тема задаёт светлое или тёмное оформление всего интерфейса. Без сохранённого выбора Framework следует системной настройке пользователя; кнопка темы diff --git a/content/ru/pro/admin/admin-menu.md b/content/ru/pro/admin/admin-menu.md index 0b48094d5..02e0a15f2 100644 --- a/content/ru/pro/admin/admin-menu.md +++ b/content/ru/pro/admin/admin-menu.md @@ -5,7 +5,7 @@ description: "Даёт административному приложению # Меню администратора -:badge[sf-admin-menu]{variant=tonal scheme=primary size=1/2} :badge[1.9.1]{variant=outline scheme=on-surface size=1/2} +:badge[sf-admin-menu]{variant=outline scheme=on-surface size=1/2} :badge[1.9.1]{variant=outline scheme=on-surface size=1/2} `` — боковая навигация административного приложения: вложенные разделы, поиск, компактный режим и настройка порядка и видимости пунктов. diff --git a/content/ru/pro/admin/change-confirm.md b/content/ru/pro/admin/change-confirm.md index 2f9018331..7d6e4edf6 100644 --- a/content/ru/pro/admin/change-confirm.md +++ b/content/ru/pro/admin/change-confirm.md @@ -5,7 +5,7 @@ description: "Подготовленное изменение ждёт отве # Подтверждение изменения -:badge[sf-confirm-change]{variant=tonal scheme=primary size=1/2} :badge[1.7.4]{variant=outline scheme=on-surface size=1/2} +:badge[sf-confirm-change]{variant=outline scheme=on-surface size=1/2} :badge[1.7.4]{variant=outline scheme=on-surface size=1/2} `` — карточка подготовленного изменения, которое ждёт «да» или «нет» человека: каждое значение как было и как станет, два diff --git a/content/ru/pro/admin/property-view.md b/content/ru/pro/admin/property-view.md index bee702ce2..9c28f7a77 100644 --- a/content/ru/pro/admin/property-view.md +++ b/content/ru/pro/admin/property-view.md @@ -5,7 +5,7 @@ description: "Показывает и правит поля одного объ # Представление свойств -:badge[sf-view-properties]{variant=tonal scheme=primary size=1/2} :badge[1.13.3]{variant=outline scheme=on-surface size=1/2} +:badge[sf-view-properties]{variant=outline scheme=on-surface size=1/2} :badge[1.13.3]{variant=outline scheme=on-surface size=1/2} `` — карточка одного объекта: поля сгруппированы в области, области — в разделы, а каждое поле рисуется отрисовщиком своего типа. Берите diff --git a/content/ru/pro/admin/table.md b/content/ru/pro/admin/table.md index 2db4416e1..9d2fc28c4 100644 --- a/content/ru/pro/admin/table.md +++ b/content/ru/pro/admin/table.md @@ -5,7 +5,7 @@ description: "Показывает серверную коллекцию таб # Представление данных -:badge[sf-view]{variant=tonal scheme=primary size=1/2} :badge[1.11.0]{variant=outline scheme=on-surface size=1/2} :badge[sf-view-table]{variant=tonal scheme=primary size=1/2} :badge[1.17.1]{variant=outline scheme=on-surface size=1/2} +:badge[sf-view]{variant=outline scheme=on-surface size=1/2} :badge[1.11.0]{variant=outline scheme=on-surface size=1/2} :badge[sf-view-table]{variant=outline scheme=on-surface size=1/2} :badge[1.17.1]{variant=outline scheme=on-surface size=1/2} `` показывает серверную коллекцию записей: поиск, фильтры, таблицу, выбор строк, действия, настройки колонок и пагинацию. Данные, права и diff --git a/content/ru/pro/chat/chat-composer.md b/content/ru/pro/chat/chat-composer.md index e21fa9160..381f2bc4e 100644 --- a/content/ru/pro/chat/chat-composer.md +++ b/content/ru/pro/chat/chat-composer.md @@ -5,7 +5,7 @@ description: "Поле вопроса и файлов чата: Enter отпра # Поле чата -:badge[sf-chat-composer]{variant=tonal scheme=primary size=1/2} :badge[1.2.3]{variant=outline scheme=on-surface size=1/2} +:badge[sf-chat-composer]{variant=outline scheme=on-surface size=1/2} :badge[1.2.3]{variant=outline scheme=on-surface size=1/2} `` — поле вопроса и файлов чата: текст растёт до восьми строк, Enter отправляет, Shift+Enter переносит строку. Файлы поле только diff --git a/content/ru/pro/chat/chat-interlocutor.md b/content/ru/pro/chat/chat-interlocutor.md index 07cf73483..3e11249ca 100644 --- a/content/ru/pro/chat/chat-interlocutor.md +++ b/content/ru/pro/chat/chat-interlocutor.md @@ -5,7 +5,7 @@ description: "Кнопка с именем текущего собеседник # Выбор собеседника -:badge[sf-chat-interlocutor]{variant=tonal scheme=primary size=1/2} :badge[1.0.8]{variant=outline scheme=on-surface size=1/2} +:badge[sf-chat-interlocutor]{variant=outline scheme=on-surface size=1/2} :badge[1.0.8]{variant=outline scheme=on-surface size=1/2} `` показывает, с кем разговор, и даёт выбрать другого собеседника. Список собеседников — серверный: элемент только показывает его и diff --git a/content/ru/pro/chat/chat-message.md b/content/ru/pro/chat/chat-message.md index aed8a04ff..65ae86025 100644 --- a/content/ru/pro/chat/chat-message.md +++ b/content/ru/pro/chat/chat-message.md @@ -5,7 +5,7 @@ description: "Одно сообщение чата: ответ помощник # Сообщение чата -:badge[sf-chat-message]{variant=tonal scheme=primary size=1/2} :badge[1.7.7]{variant=outline scheme=on-surface size=1/2} +:badge[sf-chat-message]{variant=outline scheme=on-surface size=1/2} :badge[1.7.7]{variant=outline scheme=on-surface size=1/2} `` рисует одно сообщение чата: ответ помощника с разметкой, источниками, отметкой проверки и оценкой, вопрос человека с файлами, а по diff --git a/content/ru/pro/chat/chat-window.md b/content/ru/pro/chat/chat-window.md index ceb97b4e9..31b4e7af4 100644 --- a/content/ru/pro/chat/chat-window.md +++ b/content/ru/pro/chat/chat-window.md @@ -5,7 +5,7 @@ description: "Окно чата целиком на порте хоста: сп # Окно чата -:badge[sf-chat-window]{variant=tonal scheme=primary size=1/2} :badge[1.14.3]{variant=outline scheme=on-surface size=1/2} +:badge[sf-chat-window]{variant=outline scheme=on-surface size=1/2} :badge[1.14.3]{variant=outline scheme=on-surface size=1/2} `` — окно чата целиком: список разговоров, открытый разговор, поле ввода, выбор собеседника и «Мои файлы». Окно собрано из частей — diff --git a/content/ru/pro/chat/message-log.md b/content/ru/pro/chat/message-log.md index 5e43411b1..38418c6d7 100644 --- a/content/ru/pro/chat/message-log.md +++ b/content/ru/pro/chat/message-log.md @@ -5,7 +5,7 @@ description: "Прежнее имя ленты SIMAI Framework sf-list-feed в # Лента сообщений -:badge[sf-message-log]{variant=tonal scheme=primary size=1/2} :badge[2.0.2]{variant=outline scheme=on-surface size=1/2} +:badge[sf-message-log]{variant=outline scheme=on-surface size=1/2} :badge[2.0.2]{variant=outline scheme=on-surface size=1/2} `` — устаревшее имя [Ленты](/ru/smart/content/list-feed/) (`sf-list-feed`) SIMAI Framework, которое работает до 2027-01-01. Поведение diff --git a/content/ru/pro/chat/thread-list.md b/content/ru/pro/chat/thread-list.md index 6f5a9165e..d1a5cb5cc 100644 --- a/content/ru/pro/chat/thread-list.md +++ b/content/ru/pro/chat/thread-list.md @@ -5,7 +5,7 @@ description: "Разговоры человека, новые сверху: гр # Список разговоров -:badge[sf-chat-threads]{variant=tonal scheme=primary size=1/2} :badge[2.0.3]{variant=outline scheme=on-surface size=1/2} +:badge[sf-chat-threads]{variant=outline scheme=on-surface size=1/2} :badge[2.0.3]{variant=outline scheme=on-surface size=1/2} `` — разговоры человека, новые сверху: с ассистентом или между людьми. Он группирует их по дню последнего изменения, отмечает diff --git a/content/ru/pro/editor/content-editor.md b/content/ru/pro/editor/content-editor.md index 4e5e085cf..07b82dcdf 100644 --- a/content/ru/pro/editor/content-editor.md +++ b/content/ru/pro/editor/content-editor.md @@ -5,7 +5,7 @@ description: "Страница набирается одним потоком: # Редактор содержимого -:badge[sf-editor-content]{variant=tonal scheme=primary size=1/2} :badge[1.4.8]{variant=outline scheme=on-surface size=1/2} +:badge[sf-editor-content]{variant=outline scheme=on-surface size=1/2} :badge[1.4.8]{variant=outline scheme=on-surface size=1/2} `` — режим «Содержимое» редактора страниц SIMAI: страница набирается одним потоком, как в обычном текстовом редакторе. Элемент ничего не diff --git a/content/ru/pro/editor/editor.md b/content/ru/pro/editor/editor.md index 53c4f12b1..6e2d19168 100644 --- a/content/ru/pro/editor/editor.md +++ b/content/ru/pro/editor/editor.md @@ -5,7 +5,7 @@ description: "Единый редактор блоков страницы: ра # Редактор страниц -:badge[sf-editor]{variant=tonal scheme=primary size=1/2} :badge[1.2.3]{variant=outline scheme=on-surface size=1/2} +:badge[sf-editor]{variant=outline scheme=on-surface size=1/2} :badge[1.2.3]{variant=outline scheme=on-surface size=1/2} `` — единый редактор блоков страницы SIMAI: раскладка и текст — один документ и один редактор. Режимов нет, есть глубина: щелчок по тексту — diff --git a/content/ru/pro/mail/mail-canvas.md b/content/ru/pro/mail/mail-canvas.md index 9fe5e04d2..6eb162433 100644 --- a/content/ru/pro/mail/mail-canvas.md +++ b/content/ru/pro/mail/mail-canvas.md @@ -5,7 +5,7 @@ description: "Готовое письмо в рамке, которая ниче # Холст письма -:badge[sf-mail-canvas]{variant=tonal scheme=primary size=1/2} :badge[1.1.5]{variant=outline scheme=on-surface size=1/2} +:badge[sf-mail-canvas]{variant=outline scheme=on-surface size=1/2} :badge[1.1.5]{variant=outline scheme=on-surface size=1/2} `` — холст редактора писем: готовое письмо в рамке, которая ничего не запускает, переключатель ширины над ним, две заметки о письме («устарел» и diff --git a/content/ru/pro/mail/mail-inspector.md b/content/ru/pro/mail/mail-inspector.md index 9f12f8c1a..46e2ce5ed 100644 --- a/content/ru/pro/mail/mail-inspector.md +++ b/content/ru/pro/mail/mail-inspector.md @@ -5,7 +5,7 @@ description: "Заголовок с действиями, путь, вкладк # Панель свойств письма -:badge[sf-mail-inspector]{variant=tonal scheme=primary size=1/2} :badge[1.0.7]{variant=outline scheme=on-surface size=1/2} +:badge[sf-mail-inspector]{variant=outline scheme=on-surface size=1/2} :badge[1.0.7]{variant=outline scheme=on-surface size=1/2} `` — правая панель редактора писем: заголовок с действиями, путь, вкладки, разделы и все виды полей редактора. Это форма, нарисованная из diff --git a/content/ru/pro/mail/mail-letters.md b/content/ru/pro/mail/mail-letters.md index 322989abd..229ce7de8 100644 --- a/content/ru/pro/mail/mail-letters.md +++ b/content/ru/pro/mail/mail-letters.md @@ -5,7 +5,7 @@ description: "Письма человека в редакторе: поиск п # Список писем -:badge[sf-mail-letters]{variant=tonal scheme=primary size=1/2} :badge[1.0.8]{variant=outline scheme=on-surface size=1/2} +:badge[sf-mail-letters]{variant=outline scheme=on-surface size=1/2} :badge[1.0.8]{variant=outline scheme=on-surface size=1/2} `` — письма человека в редакторе писем: поиск по названию, порядок и то, что предлагает строка, — «Открыть» и под ⋯ копия, переименование diff --git a/content/ru/pro/mail/mail-library.md b/content/ru/pro/mail/mail-library.md index 7fb130101..4edbf7622 100644 --- a/content/ru/pro/mail/mail-library.md +++ b/content/ru/pro/mail/mail-library.md @@ -5,7 +5,7 @@ description: "Блоки, которые можно добавить в пись # Библиотека блоков письма -:badge[sf-mail-library]{variant=tonal scheme=primary size=1/2} :badge[1.0.5]{variant=outline scheme=on-surface size=1/2} +:badge[sf-mail-library]{variant=outline scheme=on-surface size=1/2} :badge[1.0.5]{variant=outline scheme=on-surface size=1/2} `` — блоки, которые можно добавить в письмо, по группам назначения, с чипами категорий, поиском по названию и описанию и вариантами шапки diff --git a/content/ru/pro/mail/mail-structure.md b/content/ru/pro/mail/mail-structure.md index 02786ee9e..8485e012e 100644 --- a/content/ru/pro/mail/mail-structure.md +++ b/content/ru/pro/mail/mail-structure.md @@ -5,7 +5,7 @@ description: "Параметры письма, строки блоков в по # Структура письма -:badge[sf-mail-structure]{variant=tonal scheme=primary size=1/2} :badge[1.0.6]{variant=outline scheme=on-surface size=1/2} +:badge[sf-mail-structure]{variant=outline scheme=on-surface size=1/2} :badge[1.0.6]{variant=outline scheme=on-surface size=1/2} `` — структура письма в редакторе писем: параметры письма, по строке на блок в порядке письма и способ добавить блок. Элемент не хранит письмо diff --git a/content/ru/smart/actions/buttons.md b/content/ru/smart/actions/buttons.md index 81a787794..19dd63a5d 100644 --- a/content/ru/smart/actions/buttons.md +++ b/content/ru/smart/actions/buttons.md @@ -5,7 +5,7 @@ description: "Запускает действие кнопкой с подпис # Кнопки -:badge[sf-button]{variant=tonal scheme=primary size=1/2} :badge[1.15.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-button]{variant=outline scheme=on-surface size=1/2} :badge[1.15.0]{variant=outline scheme=on-surface size=1/2} Кнопка запускает действие: сохранить, отправить, открыть окно. Вид, цвет, размер, иконки и индикатор загрузки задаются атрибутами. Берите её там, где diff --git a/content/ru/smart/actions/close.md b/content/ru/smart/actions/close.md index 4c032ef32..3413270ee 100644 --- a/content/ru/smart/actions/close.md +++ b/content/ru/smart/actions/close.md @@ -5,7 +5,7 @@ description: "Крестик, который закрывает окно, пан # Кнопка закрытия -:badge[sf-button-close]{variant=tonal scheme=primary size=1/2} :badge[1.4.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-button-close]{variant=outline scheme=on-surface size=1/2} :badge[1.4.0]{variant=outline scheme=on-surface size=1/2} Кнопка закрытия — крестик, который закрывает окно, панель или сообщение. Готовую кнопку даёт [кнопка с иконкой](/ru/smart/actions/icon-buttons/#иконка) diff --git a/content/ru/smart/actions/confirm.md b/content/ru/smart/actions/confirm.md index e239d1471..6ba23745d 100644 --- a/content/ru/smart/actions/confirm.md +++ b/content/ru/smart/actions/confirm.md @@ -5,7 +5,7 @@ description: "Вопрос человеку прямо на месте: что # Подтверждение -:badge[sf-confirm]{variant=tonal scheme=primary size=1/2} :badge[1.3.4]{variant=outline scheme=on-surface size=1/2} +:badge[sf-confirm]{variant=outline scheme=on-surface size=1/2} :badge[1.3.4]{variant=outline scheme=on-surface size=1/2} Подтверждение спрашивает человека прямо там, где он работает: удалить файл в его строке, убрать участника, вернуть вид раздела. Оно показывает, что diff --git a/content/ru/smart/actions/copy-button.md b/content/ru/smart/actions/copy-button.md index 0527d7153..b29703d40 100644 --- a/content/ru/smart/actions/copy-button.md +++ b/content/ru/smart/actions/copy-button.md @@ -5,7 +5,7 @@ description: "Копирует значение или текст элемент # Кнопка копирования -:badge[sf-button-copy]{variant=tonal scheme=primary size=1/2} :badge[1.5.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-button-copy]{variant=outline scheme=on-surface size=1/2} :badge[1.5.0]{variant=outline scheme=on-surface size=1/2} Кнопка копирования кладёт в буфер обмена значение — ключ, команду, ссылку — и показывает, что всё получилось: значок на миг становится галочкой, а diff --git a/content/ru/smart/actions/download-file.md b/content/ru/smart/actions/download-file.md index 53b2484eb..52b204036 100644 --- a/content/ru/smart/actions/download-file.md +++ b/content/ru/smart/actions/download-file.md @@ -5,7 +5,7 @@ description: "Показывает файл для скачивания с им # Скачивание файла -:badge[sf-file-download]{variant=tonal scheme=primary size=1/2} :badge[1.5.1]{variant=outline scheme=on-surface size=1/2} +:badge[sf-file-download]{variant=outline scheme=on-surface size=1/2} :badge[1.5.1]{variant=outline scheme=on-surface size=1/2} Скачивание файла показывает файл, который можно скачать: знак скачивания, имя, тип и размер. С адресом это обычная ссылка на файл, без адреса — кнопка, по которой diff --git a/content/ru/smart/actions/icon-buttons.md b/content/ru/smart/actions/icon-buttons.md index 90ef0885a..a6d55af54 100644 --- a/content/ru/smart/actions/icon-buttons.md +++ b/content/ru/smart/actions/icon-buttons.md @@ -5,7 +5,7 @@ description: "Запускает действие компактной кноп # Кнопки с иконкой -:badge[sf-button-icon]{variant=tonal scheme=primary size=1/2} :badge[1.10.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-button-icon]{variant=outline scheme=on-surface size=1/2} :badge[1.10.0]{variant=outline scheme=on-surface size=1/2} Кнопка с иконкой запускает действие одной иконкой вместо подписи: изменить, поделиться, закрыть, открыть меню. Берите её в панелях инструментов и строках diff --git a/content/ru/smart/actions/segmented.md b/content/ru/smart/actions/segmented.md index 31d288a85..6507b57da 100644 --- a/content/ru/smart/actions/segmented.md +++ b/content/ru/smart/actions/segmented.md @@ -5,7 +5,7 @@ description: "Выбирает ровно одно значение из нес # Сегментный переключатель -:badge[sf-segmented]{variant=tonal scheme=primary size=1/2} :badge[1.6.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-segmented]{variant=outline scheme=on-surface size=1/2} :badge[1.6.0]{variant=outline scheme=on-surface size=1/2} Сегментный переключатель даёт выбрать ровно одно значение из нескольких и сразу его применяет: период отчёта, вид списка, фильтр, тему оформления. У diff --git a/content/ru/smart/composite/page-header.md b/content/ru/smart/composite/page-header.md index 5dbe18957..ed6a679da 100644 --- a/content/ru/smart/composite/page-header.md +++ b/content/ru/smart/composite/page-header.md @@ -5,7 +5,7 @@ description: "Показывает в начале страницы админи # Шапка страницы -:badge[sf-header-page]{variant=tonal scheme=primary size=1/2} :badge[1.3.2]{variant=outline scheme=on-surface size=1/2} +:badge[sf-header-page]{variant=outline scheme=on-surface size=1/2} :badge[1.3.2]{variant=outline scheme=on-surface size=1/2} Шапка страницы показывает в одной строке путь к странице, заголовок, число записей, звезду избранного и главные действия. Ставьте её в начало каждой diff --git a/content/ru/smart/composite/profile-picker.md b/content/ru/smart/composite/profile-picker.md index 8dfd56c7e..6a460aeb1 100644 --- a/content/ru/smart/composite/profile-picker.md +++ b/content/ru/smart/composite/profile-picker.md @@ -5,7 +5,7 @@ description: "Выбирает, создаёт, переименовывает, # Выбор профиля -:badge[sf-profile-picker]{variant=tonal scheme=primary size=1/2} :badge[1.4.6]{variant=outline scheme=on-surface size=1/2} +:badge[sf-profile-picker]{variant=outline scheme=on-surface size=1/2} :badge[1.4.6]{variant=outline scheme=on-surface size=1/2} Выбор профиля даёт одно место для работы с профилями: профилями меню, видами записи и всем, у чего есть профили. В свёрнутом виде это кнопка, похожая на diff --git a/content/ru/smart/composite/search.md b/content/ru/smart/composite/search.md index b85986e4d..51b28485f 100644 --- a/content/ru/smart/composite/search.md +++ b/content/ru/smart/composite/search.md @@ -5,7 +5,7 @@ description: "Окно поиска по сайту: крупное поле, ф # Поиск по сайту -:badge[sf-search]{variant=tonal scheme=primary size=1/2} :badge[1.7.5]{variant=outline scheme=on-surface size=1/2} +:badge[sf-search]{variant=outline scheme=on-surface size=1/2} :badge[1.7.5]{variant=outline scheme=on-surface size=1/2} Поиск по сайту открывается кнопкой в шапке или клавишами `Command/Control+K` и `/`: крупное скруглённое поле и карточка результатов под ним, над лёгким diff --git a/content/ru/smart/composite/site-header.md b/content/ru/smart/composite/site-header.md index 7049d2913..ac8309d49 100644 --- a/content/ru/smart/composite/site-header.md +++ b/content/ru/smart/composite/site-header.md @@ -5,7 +5,7 @@ description: "Верхняя полоса сайта: бренд, разделы # Шапка сайта -:badge[sf-header-site]{variant=tonal scheme=primary size=1/2} :badge[1.9.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-header-site]{variant=outline scheme=on-surface size=1/2} :badge[1.9.0]{variant=outline scheme=on-surface size=1/2} Шапка сайта — верхняя полоса с брендом, разделами, ссылками и инструментами в одну строку по ширине контейнера. На узком экране разделы и ссылки уходят в diff --git a/content/ru/smart/content/accordion.md b/content/ru/smart/content/accordion.md index bfb7cba51..fde7c2e18 100644 --- a/content/ru/smart/content/accordion.md +++ b/content/ru/smart/content/accordion.md @@ -5,7 +5,7 @@ description: "Раскрывающиеся секции из данных или # Аккордеон -:badge[sf-accordion]{variant=tonal scheme=primary size=1/2} :badge[1.1.12]{variant=outline scheme=on-surface size=1/2} +:badge[sf-accordion]{variant=outline scheme=on-surface size=1/2} :badge[1.1.12]{variant=outline scheme=on-surface size=1/2} Аккордеон делит одно содержание на секции, которые открываются и закрываются по нажатию на шапку: группы полей записи, разделы настроек, вопросы и ответы. diff --git a/content/ru/smart/content/avatar.md b/content/ru/smart/content/avatar.md index d25f79821..3a366c90f 100644 --- a/content/ru/smart/content/avatar.md +++ b/content/ru/smart/content/avatar.md @@ -5,7 +5,7 @@ description: "Показывает человека или организаци # Аватар -:badge[sf-avatar]{variant=tonal scheme=primary size=1/2} :badge[1.6.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-avatar]{variant=outline scheme=on-surface size=1/2} :badge[1.6.0]{variant=outline scheme=on-surface size=1/2} Аватар показывает одного человека или одну организацию: фотографию, инициалы или значок-заполнитель, при необходимости — состояние в сети или отметку diff --git a/content/ru/smart/content/avatars.md b/content/ru/smart/content/avatars.md index 5b6dd8eee..d142967c3 100644 --- a/content/ru/smart/content/avatars.md +++ b/content/ru/smart/content/avatars.md @@ -5,7 +5,7 @@ description: "Выводит готовые сочетания аватаров: # Аватары -:badge[sf-avatar-group]{variant=tonal scheme=primary size=1/2} :badge[1.3.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-avatar-group]{variant=outline scheme=on-surface size=1/2} :badge[1.3.0]{variant=outline scheme=on-surface size=1/2} Аватары — готовые сочетания: человек с источником, группа с остатком, аватар с двумя строками подписи, аватар профиля. Для одного аватара, аватара с подписью diff --git a/content/ru/smart/content/file-preview.md b/content/ru/smart/content/file-preview.md index e1216cefd..e853a1106 100644 --- a/content/ru/smart/content/file-preview.md +++ b/content/ru/smart/content/file-preview.md @@ -5,7 +5,7 @@ description: "Показывает выбранный или прикреплё # Предпросмотр файла -:badge[sf-file-preview]{variant=tonal scheme=primary size=1/2} :badge[1.3.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-file-preview]{variant=outline scheme=on-surface size=1/2} :badge[1.3.0]{variant=outline scheme=on-surface size=1/2} Предпросмотр файла показывает один уже выбранный или прикреплённый файл: значок или миниатюру, имя, размер и две кнопки — скачать и удалить. Выбирают и diff --git a/content/ru/smart/content/gallery.md b/content/ru/smart/content/gallery.md index 0b57f3d4d..51a36afc3 100644 --- a/content/ru/smart/content/gallery.md +++ b/content/ru/smart/content/gallery.md @@ -5,7 +5,7 @@ description: "Показывает набор материалов слайде # Галерея -:badge[sf-gallery]{variant=tonal scheme=primary size=1/2} :badge[1.2.3]{variant=outline scheme=on-surface size=1/2} +:badge[sf-gallery]{variant=outline scheme=on-surface size=1/2} :badge[1.2.3]{variant=outline scheme=on-surface size=1/2} Галерея показывает упорядоченный набор материалов — изображения, карточки, макеты — слайдером на странице и в окне на весь экран, и оба вида держат одно diff --git a/content/ru/smart/content/icons.md b/content/ru/smart/content/icons.md index e93244743..6d778cfa0 100644 --- a/content/ru/smart/content/icons.md +++ b/content/ru/smart/content/icons.md @@ -5,7 +5,7 @@ description: "Выводит символ Material Symbols, для которо # Иконки -:badge[sf-icon]{variant=tonal scheme=primary size=1/2} :badge[1.2.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-icon]{variant=outline scheme=on-surface size=1/2} :badge[1.2.0]{variant=outline scheme=on-surface size=1/2} Иконка выводит один символ Material Symbols по имени, а загружается только нужная часть шрифта. Размер, семейство, заливка и толщина задаются атрибутами diff --git a/content/ru/smart/content/include.md b/content/ru/smart/content/include.md index 807052052..35b808b82 100644 --- a/content/ru/smart/content/include.md +++ b/content/ru/smart/content/include.md @@ -5,7 +5,7 @@ description: "Загружает часть страницы с адреса с # Часть страницы по адресу -:badge[sf-include]{variant=tonal scheme=primary size=1/2} :badge[1.0.5]{variant=outline scheme=on-surface size=1/2} +:badge[sf-include]{variant=outline scheme=on-surface size=1/2} :badge[1.0.5]{variant=outline scheme=on-surface size=1/2} Часть страницы по адресу подгружает то, что сервер сайта отдаёт отдельно: блок новостей, список, собранный на сервере, нижнюю часть страницы, которую стоит diff --git a/content/ru/smart/content/list-description.md b/content/ru/smart/content/list-description.md index 27444863f..a00077773 100644 --- a/content/ru/smart/content/list-description.md +++ b/content/ru/smart/content/list-description.md @@ -5,7 +5,7 @@ description: "Факты парами «подпись — значение»: # Список сведений -:badge[sf-list-description]{variant=tonal scheme=primary size=1/2} :badge[1.1.4]{variant=outline scheme=on-surface size=1/2} +:badge[sf-list-description]{variant=outline scheme=on-surface size=1/2} :badge[1.1.4]{variant=outline scheme=on-surface size=1/2} Показывает факты парами «подпись — значение»: сводку сайта, сведения о сервере, шапку записи, параметры задания, данные лицензии. Значение может diff --git a/content/ru/smart/content/list-feed.md b/content/ru/smart/content/list-feed.md index 8d8576b19..5c91c9eb5 100644 --- a/content/ru/smart/content/list-feed.md +++ b/content/ru/smart/content/list-feed.md @@ -5,7 +5,7 @@ description: "Прокручиваемая колонка записей, кот # Лента -:badge[sf-list-feed]{variant=tonal scheme=primary size=1/2} :badge[1.1.2]{variant=outline scheme=on-surface size=1/2} +:badge[sf-list-feed]{variant=outline scheme=on-surface size=1/2} :badge[1.1.2]{variant=outline scheme=on-surface size=1/2} Лента — прокручиваемая колонка записей, которую читают от новой записи внизу: переписка, комментарии к задаче, история действий, журнал, ход выполнения diff --git a/content/ru/smart/content/list-item.md b/content/ru/smart/content/list-item.md index c3fbdaa8f..68f86ab7e 100644 --- a/content/ru/smart/content/list-item.md +++ b/content/ru/smart/content/list-item.md @@ -5,7 +5,7 @@ description: "Вариант выпадающего списка и общая # Строка списка -:badge[sf-list-item]{variant=tonal scheme=primary size=1/2} :badge[1.5.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-list-item]{variant=outline scheme=on-surface size=1/2} :badge[1.5.0]{variant=outline scheme=on-surface size=1/2} Строка списка задаёт один вариант [выпадающего списка](/ru/smart/navigation/dropdown/): значение, подпись и вид строки — diff --git a/content/ru/smart/content/list-timeline.md b/content/ru/smart/content/list-timeline.md index cef460ab0..0e371eb7c 100644 --- a/content/ru/smart/content/list-timeline.md +++ b/content/ru/smart/content/list-timeline.md @@ -5,7 +5,7 @@ description: "Короткая история событий на вертика # Хронология -:badge[sf-list-timeline]{variant=tonal scheme=primary size=1/2} :badge[1.3.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-list-timeline]{variant=outline scheme=on-surface size=1/2} :badge[1.3.0]{variant=outline scheme=on-surface size=1/2} Короткая история, которую читают сверху: последние действия на сервере, журнал аудита, история записи, страница уведомлений, история заданий. diff --git a/content/ru/smart/content/list.md b/content/ru/smart/content/list.md index f3dbab39a..94068dd46 100644 --- a/content/ru/smart/content/list.md +++ b/content/ru/smart/content/list.md @@ -5,7 +5,7 @@ description: "Список, с которым работают: строки и # Список -:badge[sf-list]{variant=tonal scheme=primary size=1/2} :badge[1.9.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-list]{variant=outline scheme=on-surface size=1/2} :badge[1.9.0]{variant=outline scheme=on-surface size=1/2} Список — для того, с чем что-то делают: беседы, письма, шаблоны, файлы, участники, версии. Строки строятся из данных — название и тихая вторая строка; diff --git a/content/ru/smart/content/reference-link.md b/content/ru/smart/content/reference-link.md index fa47634b9..4e9e37818 100644 --- a/content/ru/smart/content/reference-link.md +++ b/content/ru/smart/content/reference-link.md @@ -5,7 +5,7 @@ description: "Ведёт на реальный адрес и показывае # Справочная ссылка -:badge[sf-reference-link]{variant=tonal scheme=primary size=1/2} :badge[1.1.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-reference-link]{variant=outline scheme=on-surface size=1/2} :badge[1.1.0]{variant=outline scheme=on-surface size=1/2} Справочная ссылка ведёт на реальный адрес и показывает рядом короткую справку: путь, источник, номер документа. Берите её, когда читателю важно видеть, куда diff --git a/content/ru/smart/content/slider.md b/content/ru/smart/content/slider.md index 33cb4c2da..58132c37b 100644 --- a/content/ru/smart/content/slider.md +++ b/content/ru/smart/content/slider.md @@ -5,7 +5,7 @@ description: "Показывает последовательность слай # Слайдер контента -:badge[sf-slider]{variant=tonal scheme=primary size=1/2} :badge[1.3.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-slider]{variant=outline scheme=on-surface size=1/2} :badge[1.3.0]{variant=outline scheme=on-surface size=1/2} Слайдер контента показывает слайды по одному: их листают стрелками, точками, миниатюрами или жестом. Берите его для материалов, которые смотрят по очереди; diff --git a/content/ru/smart/content/tags.md b/content/ru/smart/content/tags.md index 884167b79..c73da5337 100644 --- a/content/ru/smart/content/tags.md +++ b/content/ru/smart/content/tags.md @@ -5,7 +5,7 @@ description: "Показывает короткую метку — катего # Теги -:badge[sf-tag]{variant=tonal scheme=primary size=1/2} :badge[1.7.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-tag]{variant=outline scheme=on-surface size=1/2} :badge[1.7.0]{variant=outline scheme=on-surface size=1/2} Тег показывает одну короткую метку: категорию, выбранное значение, фильтр или статус. Он может быть статичным, переключаться нажатием и предлагать отдельную diff --git a/content/ru/smart/content/tile-metric.md b/content/ru/smart/content/tile-metric.md index 3087c0f3c..5e818557a 100644 --- a/content/ru/smart/content/tile-metric.md +++ b/content/ru/smart/content/tile-metric.md @@ -5,7 +5,7 @@ description: "Одно важное число на панели: подпись # Плитка показателя -:badge[sf-tile-metric]{variant=tonal scheme=primary size=1/2} :badge[1.3.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-tile-metric]{variant=outline scheme=on-surface size=1/2} :badge[1.3.0]{variant=outline scheme=on-surface size=1/2} Плитка показателя показывает одно число, которое важно на панели администратора или на сводной странице: нагрузку сервера, занятое место из diff --git a/content/ru/smart/editor/composition-overlay.md b/content/ru/smart/editor/composition-overlay.md index 6879f5e51..ba3724e19 100644 --- a/content/ru/smart/editor/composition-overlay.md +++ b/content/ru/smart/editor/composition-overlay.md @@ -5,7 +5,7 @@ description: "Рисует поверх отрисованной страниц # Оверлей редактора -:badge[sf-editor-overlay]{variant=tonal scheme=primary size=1/2} :badge[1.7.6]{variant=outline scheme=on-surface size=1/2} +:badge[sf-editor-overlay]{variant=outline scheme=on-surface size=1/2} :badge[1.7.6]{variant=outline scheme=on-surface size=1/2} Оверлей редактора даёт править страницу на месте, а не в отдельной форме: поверх страницы, собранной из Composition Document, он показывает рамку при diff --git a/content/ru/smart/editor/inline-editor.md b/content/ru/smart/editor/inline-editor.md index e55c22d33..7372a391b 100644 --- a/content/ru/smart/editor/inline-editor.md +++ b/content/ru/smart/editor/inline-editor.md @@ -5,7 +5,7 @@ description: "Даёт править текст заголовков и абз # Inline-редактор -:badge[sf-editor-inline]{variant=tonal scheme=primary size=1/2} :badge[1.7.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-editor-inline]{variant=outline scheme=on-surface size=1/2} :badge[1.7.0]{variant=outline scheme=on-surface size=1/2} Inline-редактор даёт править текст заголовков и абзацев (`content.heading` и `content.paragraph`) прямо на странице. Доступно то, что есть в модели diff --git a/content/ru/smart/editor/sortable.md b/content/ru/smart/editor/sortable.md index 2513ed4d5..99989ff44 100644 --- a/content/ru/smart/editor/sortable.md +++ b/content/ru/smart/editor/sortable.md @@ -5,7 +5,7 @@ description: "Даёт переставлять элементы, перенос # Перетаскивание -:badge[sf-sortable]{variant=tonal scheme=primary size=1/2} :badge[1.2.3]{variant=outline scheme=on-surface size=1/2} +:badge[sf-sortable]{variant=outline scheme=on-surface size=1/2} :badge[1.2.3]{variant=outline scheme=on-surface size=1/2} Перетаскивание даёт переставлять элементы списка, переносить их в другие списки той же группы и копировать из библиотеки — мышью, пером, касанием и diff --git a/content/ru/smart/feedback/alert-bar.md b/content/ru/smart/feedback/alert-bar.md index 8ba24a34c..26eac4a93 100644 --- a/content/ru/smart/feedback/alert-bar.md +++ b/content/ru/smart/feedback/alert-bar.md @@ -5,7 +5,7 @@ description: "Полоса во всю ширину над шапкой стра # Плашка уведомлений -:badge[sf-alert-bar]{variant=tonal scheme=primary size=1/2} :badge[1.6.1]{variant=outline scheme=on-surface size=1/2} +:badge[sf-alert-bar]{variant=outline scheme=on-surface size=1/2} :badge[1.6.1]{variant=outline scheme=on-surface size=1/2} Плашка уведомлений — полоса во всю ширину над шапкой страницы или административного интерфейса для состояний, которые требуют действия сейчас: diff --git a/content/ru/smart/feedback/alert.md b/content/ru/smart/feedback/alert.md index b29692202..35f2aabd8 100644 --- a/content/ru/smart/feedback/alert.md +++ b/content/ru/smart/feedback/alert.md @@ -5,7 +5,7 @@ description: "Показывает постоянное сообщение в п # Уведомление -:badge[sf-alert]{variant=tonal scheme=primary size=1/2} :badge[1.4.1]{variant=outline scheme=on-surface size=1/2} +:badge[sf-alert]{variant=outline scheme=on-surface size=1/2} :badge[1.4.1]{variant=outline scheme=on-surface size=1/2} Уведомление показывает сообщение, которое остаётся на странице, пока его не закроют: предупреждение перед действием, ошибку формы, итог проверки. Для diff --git a/content/ru/smart/feedback/badges.md b/content/ru/smart/feedback/badges.md index 8d7e38d76..aeee69dd1 100644 --- a/content/ru/smart/feedback/badges.md +++ b/content/ru/smart/feedback/badges.md @@ -5,7 +5,7 @@ description: "Показывает короткую неинтерактивну # Бейджи -:badge[sf-badge]{variant=tonal scheme=primary size=1/2} :badge[1.6.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-badge]{variant=outline scheme=on-surface size=1/2} :badge[1.6.0]{variant=outline scheme=on-surface size=1/2} Бейдж показывает короткую пометку рядом с объектом: статус записи, категорию, версию, число новых событий. Пометку не нажимают. Для метки, которую выбирают diff --git a/content/ru/smart/feedback/empty-state.md b/content/ru/smart/feedback/empty-state.md index 089a9f99f..f8e891478 100644 --- a/content/ru/smart/feedback/empty-state.md +++ b/content/ru/smart/feedback/empty-state.md @@ -5,7 +5,7 @@ description: "Показывает, почему в списке, панели # Пустое состояние -:badge[sf-empty-state]{variant=tonal scheme=primary size=1/2} :badge[1.4.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-empty-state]{variant=outline scheme=on-surface size=1/2} :badge[1.4.0]{variant=outline scheme=on-surface size=1/2} Пустое состояние объясняет, почему в списке, панели или на странице нечего показать. Одна причина — один вид: значок, заголовок, пояснение и, если нужно, diff --git a/content/ru/smart/feedback/help-mark.md b/content/ru/smart/feedback/help-mark.md index d22f986c7..55d53f78b 100644 --- a/content/ru/smart/feedback/help-mark.md +++ b/content/ru/smart/feedback/help-mark.md @@ -5,7 +5,7 @@ description: "Знак «?» рядом с подписью: по нажатию # Подсказка «?» -:badge[sf-help-mark]{variant=tonal scheme=primary size=1/2} :badge[1.4.1]{variant=outline scheme=on-surface size=1/2} +:badge[sf-help-mark]{variant=outline scheme=on-surface size=1/2} :badge[1.4.1]{variant=outline scheme=on-surface size=1/2} Подсказка «?» стоит рядом с подписью и открывает короткое пояснение: что значит поле или настройка. Подпись, которая появляется при наведении на кнопку-иконку, собирайте на diff --git a/content/ru/smart/feedback/list-attention.md b/content/ru/smart/feedback/list-attention.md index 23cc27913..b661d2839 100644 --- a/content/ru/smart/feedback/list-attention.md +++ b/content/ru/smart/feedback/list-attention.md @@ -5,7 +5,7 @@ description: "Список проблем, которым нужен челов # Требует внимания -:badge[sf-list-attention]{variant=tonal scheme=primary size=1/2} :badge[1.3.2]{variant=outline scheme=on-surface size=1/2} +:badge[sf-list-attention]{variant=outline scheme=on-surface size=1/2} :badge[1.3.2]{variant=outline scheme=on-surface size=1/2} Список проблем, которые ждут человека, на обзорном экране: здоровье сервера, проверки сайта, ошибки импорта и переноса, готовность к обновлению, diff --git a/content/ru/smart/feedback/progress-bar.md b/content/ru/smart/feedback/progress-bar.md index 8eac9775a..7785ea610 100644 --- a/content/ru/smart/feedback/progress-bar.md +++ b/content/ru/smart/feedback/progress-bar.md @@ -5,7 +5,7 @@ description: "Показывает известный ход процесса с # Прогресс -:badge[sf-progress-bar]{variant=tonal scheme=primary size=1/2} :badge[1.4.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-progress-bar]{variant=outline scheme=on-surface size=1/2} :badge[1.4.0]{variant=outline scheme=on-surface size=1/2} Прогресс показывает ход процесса, у которого известна доля выполненного: загрузка файла, импорт, проверка. Когда доля неизвестна, берите diff --git a/content/ru/smart/feedback/progress-ring.md b/content/ru/smart/feedback/progress-ring.md index fe06c0a8e..76cdc736b 100644 --- a/content/ru/smart/feedback/progress-ring.md +++ b/content/ru/smart/feedback/progress-ring.md @@ -5,7 +5,7 @@ description: "Показывает долю выполненного кольц # Кольцо прогресса -:badge[sf-progress-ring]{variant=tonal scheme=primary size=1/2} :badge[1.3.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-progress-ring]{variant=outline scheme=on-surface size=1/2} :badge[1.3.0]{variant=outline scheme=on-surface size=1/2} Кольцо прогресса показывает значение от 0 до 100 кольцом размером с элемент управления: в панели инструментов, в боковой полосе, вокруг аватара. Для diff --git a/content/ru/smart/feedback/progress-run.md b/content/ru/smart/feedback/progress-run.md index f439a8d0e..9c9168970 100644 --- a/content/ru/smart/feedback/progress-run.md +++ b/content/ru/smart/feedback/progress-run.md @@ -5,7 +5,7 @@ description: "Долгое задание глазами человека: ша # Ход выполнения -:badge[sf-progress-run]{variant=tonal scheme=primary size=1/2} :badge[1.4.2]{variant=outline scheme=on-surface size=1/2} +:badge[sf-progress-run]{variant=outline scheme=on-surface size=1/2} :badge[1.4.2]{variant=outline scheme=on-surface size=1/2} Показывает долгое задание так, как его видит человек: создание сайта, обновление, резервную копию и восстановление, импорт, публикацию, установку diff --git a/content/ru/smart/feedback/progress-scale.md b/content/ru/smart/feedback/progress-scale.md index 95720277f..dc620b85c 100644 --- a/content/ru/smart/feedback/progress-scale.md +++ b/content/ru/smart/feedback/progress-scale.md @@ -5,7 +5,7 @@ description: "Показывает известный ход процесса ш # Шкала прогресса -:badge[sf-progress-scale]{variant=tonal scheme=primary size=1/2} :badge[1.2.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-progress-scale]{variant=outline scheme=on-surface size=1/2} :badge[1.2.0]{variant=outline scheme=on-surface size=1/2} Шкала прогресса показывает известную долю выполненного десятью делениями. Берите её, когда точность до процента не нужна и ход удобнее читать крупными diff --git a/content/ru/smart/feedback/skeleton.md b/content/ru/smart/feedback/skeleton.md index 637520415..cde0a95cf 100644 --- a/content/ru/smart/feedback/skeleton.md +++ b/content/ru/smart/feedback/skeleton.md @@ -5,7 +5,7 @@ description: "Занимает место будущего содержимог # Скелетон -:badge[sf-skeleton]{variant=tonal scheme=primary size=1/2} :badge[1.3.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-skeleton]{variant=outline scheme=on-surface size=1/2} :badge[1.3.0]{variant=outline scheme=on-surface size=1/2} Скелетон занимает место содержимого, которое ещё загружается, серыми фигурами: строками текста, аватаром, изображением, карточкой. Страница не прыгает, когда diff --git a/content/ru/smart/feedback/spinner.md b/content/ru/smart/feedback/spinner.md index 74103853a..f462f255d 100644 --- a/content/ru/smart/feedback/spinner.md +++ b/content/ru/smart/feedback/spinner.md @@ -5,7 +5,7 @@ description: "Показывает ожидание, длительность к # Спиннер -:badge[sf-spinner]{variant=tonal scheme=primary size=1/2} :badge[1.4.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-spinner]{variant=outline scheme=on-surface size=1/2} :badge[1.4.0]{variant=outline scheme=on-surface size=1/2} Спиннер показывает, что работа идёт, но сколько ещё ждать — неизвестно: запрос к серверу, подготовка отчёта. Если доля выполненного известна, берите diff --git a/content/ru/smart/feedback/toast.md b/content/ru/smart/feedback/toast.md index 8f8dbf018..6b2d5dabd 100644 --- a/content/ru/smart/feedback/toast.md +++ b/content/ru/smart/feedback/toast.md @@ -5,7 +5,7 @@ description: "Кратко сообщает результат действия # Всплывающие сообщения -:badge[sf-toast]{variant=tonal scheme=primary size=1/2} :badge[1.4.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-toast]{variant=outline scheme=on-surface size=1/2} :badge[1.4.0]{variant=outline scheme=on-surface size=1/2} Всплывающее сообщение коротко сообщает результат действия: статус, заголовок, пояснение, необязательное действие и кнопку закрытия. Для постоянного текста diff --git a/content/ru/smart/feedback/tooltip.md b/content/ru/smart/feedback/tooltip.md index 27ac7d08b..24ff1697c 100644 --- a/content/ru/smart/feedback/tooltip.md +++ b/content/ru/smart/feedback/tooltip.md @@ -5,7 +5,7 @@ description: "Рисует поверхность короткой подска # Подсказка -:badge[sf-tooltip]{variant=tonal scheme=primary size=1/2} :badge[1.2.1]{variant=outline scheme=on-surface size=1/2} +:badge[sf-tooltip]{variant=outline scheme=on-surface size=1/2} :badge[1.2.1]{variant=outline scheme=on-surface size=1/2} Подсказка показывает короткий текст рядом с элементом: значение ручки слайдера, пояснение к числу, сочетание клавиш. Сама она не следит, на что diff --git a/content/ru/smart/forms/checkbox.md b/content/ru/smart/forms/checkbox.md index 4467af3d5..1668f3d15 100644 --- a/content/ru/smart/forms/checkbox.md +++ b/content/ru/smart/forms/checkbox.md @@ -5,7 +5,7 @@ description: "Даёт отметить один или несколько не # Флажок -:badge[sf-checkbox]{variant=tonal scheme=primary size=1/2} :badge[1.3.1]{variant=outline scheme=on-surface size=1/2} +:badge[sf-checkbox]{variant=outline scheme=on-surface size=1/2} :badge[1.3.1]{variant=outline scheme=on-surface size=1/2} Флажок даёт независимый выбор: каждый вариант отмечают или снимают отдельно от остальных. Для одного варианта из нескольких берите diff --git a/content/ru/smart/forms/code-input.md b/content/ru/smart/forms/code-input.md index cd11870bb..fcefb0d4a 100644 --- a/content/ru/smart/forms/code-input.md +++ b/content/ru/smart/forms/code-input.md @@ -5,7 +5,7 @@ description: "Принимает одноразовый код из сообще # Код подтверждения -:badge[sf-input-code]{variant=tonal scheme=primary size=1/2} :badge[1.4.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-input-code]{variant=outline scheme=on-surface size=1/2} :badge[1.4.0]{variant=outline scheme=on-surface size=1/2} Код подтверждения — поле для одноразового кода из сообщения, приложения-генератора или письма: код показан по ячейкам, а с формой уходит diff --git a/content/ru/smart/forms/color.md b/content/ru/smart/forms/color.md index 87d5f6b65..cffac5485 100644 --- a/content/ru/smart/forms/color.md +++ b/content/ru/smart/forms/color.md @@ -5,7 +5,7 @@ description: "Выбирает цвет системной палитрой ил # Цвет -:badge[sf-input-color]{variant=tonal scheme=primary size=1/2} :badge[1.8.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-input-color]{variant=outline scheme=on-surface size=1/2} :badge[1.8.0]{variant=outline scheme=on-surface size=1/2} Поле цвета даёт выбрать цвет: образец открывает системную палитру, рядом стоят цвета, которые у продукта уже есть, а кнопка возврата снимает выбор, и снова diff --git a/content/ru/smart/forms/datepicker.md b/content/ru/smart/forms/datepicker.md index 57e2bf9b9..f1916e5d1 100644 --- a/content/ru/smart/forms/datepicker.md +++ b/content/ru/smart/forms/datepicker.md @@ -5,7 +5,7 @@ description: "Выбирает дату, дату со временем, вре # Календарь -:badge[sf-input-date]{variant=tonal scheme=primary size=1/2} :badge[1.7.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-input-date]{variant=outline scheme=on-surface size=1/2} :badge[1.7.0]{variant=outline scheme=on-surface size=1/2} Календарь даёт выбрать одну дату или период с переходом по месяцам и годам, а также дату со временем или одно время суток. Берите его, когда дату удобнее diff --git a/content/ru/smart/forms/file-upload.md b/content/ru/smart/forms/file-upload.md index 09c8592cf..b6bc3ef63 100644 --- a/content/ru/smart/forms/file-upload.md +++ b/content/ru/smart/forms/file-upload.md @@ -5,7 +5,7 @@ description: "Даёт выбрать или перетащить файлы и # Загрузка файлов -:badge[sf-file-upload]{variant=tonal scheme=primary size=1/2} :badge[1.2.2]{variant=outline scheme=on-surface size=1/2} +:badge[sf-file-upload]{variant=outline scheme=on-surface size=1/2} :badge[1.2.2]{variant=outline scheme=on-surface size=1/2} Загрузка файлов даёт выбрать файлы в системном окне или перетащить их и показывает список выбранных файлов с прогрессом и состоянием передачи. Сами diff --git a/content/ru/smart/forms/image-field.md b/content/ru/smart/forms/image-field.md index 2172e48b8..8d14d87eb 100644 --- a/content/ru/smart/forms/image-field.md +++ b/content/ru/smart/forms/image-field.md @@ -5,7 +5,7 @@ description: "Даёт выбрать одно изображение: мини # Поле изображения -:badge[sf-input-image]{variant=tonal scheme=primary size=1/2} :badge[1.5.1]{variant=outline scheme=on-surface size=1/2} +:badge[sf-input-image]{variant=outline scheme=on-surface size=1/2} :badge[1.5.1]{variant=outline scheme=on-surface size=1/2} Поле изображения принимает одно изображение в форме: логотип, обложку, картинку в блоке. Оно показывает миниатюру с именем и размером файла, кнопки diff --git a/content/ru/smart/forms/input-choice.md b/content/ru/smart/forms/input-choice.md index 9c7bbf19e..b48706746 100644 --- a/content/ru/smart/forms/input-choice.md +++ b/content/ru/smart/forms/input-choice.md @@ -5,7 +5,7 @@ description: "Поле формы, где один вариант или нес # Выбор карточками -:badge[sf-input-choice]{variant=tonal scheme=primary size=1/2} :badge[1.2.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-input-choice]{variant=outline scheme=on-surface size=1/2} :badge[1.2.0]{variant=outline scheme=on-surface size=1/2} Поле формы, в котором человек выбирает один вариант или несколько из карточек: у каждой название, пояснение, а если нужно — цена со сроком, diff --git a/content/ru/smart/forms/inputs.md b/content/ru/smart/forms/inputs.md index 5144dafb7..34f0343d2 100644 --- a/content/ru/smart/forms/inputs.md +++ b/content/ru/smart/forms/inputs.md @@ -5,7 +5,7 @@ description: "Принимает одну строку — имя, почту, # Текстовое поле -:badge[sf-input]{variant=tonal scheme=primary size=1/2} :badge[1.9.1]{variant=outline scheme=on-surface size=1/2} +:badge[sf-input]{variant=outline scheme=on-surface size=1/2} :badge[1.9.1]{variant=outline scheme=on-surface size=1/2} Текстовое поле принимает одну строку — имя, почту, пароль, телефон, адрес сайта или поисковый запрос — вместе с подписью, подсказкой и сообщением об diff --git a/content/ru/smart/forms/lookup.md b/content/ru/smart/forms/lookup.md index 8d3b2509a..40edf5d93 100644 --- a/content/ru/smart/forms/lookup.md +++ b/content/ru/smart/forms/lookup.md @@ -5,7 +5,7 @@ description: "Даёт найти и выбрать людей или объек # Выбор из поиска -:badge[sf-input-lookup]{variant=tonal scheme=primary size=1/2} :badge[1.11.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-input-lookup]{variant=outline scheme=on-surface size=1/2} :badge[1.11.0]{variant=outline scheme=on-surface size=1/2} Выбор из поиска даёт выбрать людей или объекты по имени: человек набирает имя, видит строки с аватаром, именем и подписью и выбирает одно значение или diff --git a/content/ru/smart/forms/quantity.md b/content/ru/smart/forms/quantity.md index d9a8a1fd6..79dd1befb 100644 --- a/content/ru/smart/forms/quantity.md +++ b/content/ru/smart/forms/quantity.md @@ -5,7 +5,7 @@ description: "Даёт набрать число или поменять его # Количество -:badge[sf-input-quantity]{variant=tonal scheme=primary size=1/2} :badge[1.6.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-input-quantity]{variant=outline scheme=on-surface size=1/2} :badge[1.6.0]{variant=outline scheme=on-surface size=1/2} Количество — поле для небольшого числа, которое удобно менять по шагу: товаров в корзине, гостей, записей на странице. Число можно набрать или diff --git a/content/ru/smart/forms/radio.md b/content/ru/smart/forms/radio.md index 7dad8f308..bf1275666 100644 --- a/content/ru/smart/forms/radio.md +++ b/content/ru/smart/forms/radio.md @@ -5,7 +5,7 @@ description: "Даёт выбрать ровно один вариант из в # Радиокнопки -:badge[sf-radio]{variant=tonal scheme=primary size=1/2} :badge[1.3.1]{variant=outline scheme=on-surface size=1/2} +:badge[sf-radio]{variant=outline scheme=on-surface size=1/2} :badge[1.3.1]{variant=outline scheme=on-surface size=1/2} Радиокнопки дают выбрать один вариант из группы взаимоисключающих, где все варианты видны сразу. Для независимых вариантов берите diff --git a/content/ru/smart/forms/range-slider.md b/content/ru/smart/forms/range-slider.md index ba3aeae10..82c5bcb1f 100644 --- a/content/ru/smart/forms/range-slider.md +++ b/content/ru/smart/forms/range-slider.md @@ -5,7 +5,7 @@ description: "Выбирает одно значение или две гран # Слайдер диапазона -:badge[sf-slider-range]{variant=tonal scheme=primary size=1/2} :badge[1.4.1]{variant=outline scheme=on-surface size=1/2} +:badge[sf-slider-range]{variant=outline scheme=on-surface size=1/2} :badge[1.4.1]{variant=outline scheme=on-surface size=1/2} Слайдер диапазона — шкала с одной или двумя ручками для приблизительной настройки: цены, громкости, расстояния. Когда важно точное число, добавьте diff --git a/content/ru/smart/forms/rich-text.md b/content/ru/smart/forms/rich-text.md index 0ff8c79fb..6e7a80e9e 100644 --- a/content/ru/smart/forms/rich-text.md +++ b/content/ru/smart/forms/rich-text.md @@ -5,7 +5,7 @@ description: "Даёт написать текст с заголовками, с # Форматированный текст -:badge[sf-input-rich]{variant=tonal scheme=primary size=1/2} :badge[1.4.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-input-rich]{variant=outline scheme=on-surface size=1/2} :badge[1.4.0]{variant=outline scheme=on-surface size=1/2} Форматированный текст — поле формы для текста с оформлением: абзацы, заголовки второго–четвёртого уровня, полужирный, курсив, ссылки, списки и цитаты, с diff --git a/content/ru/smart/forms/switch.md b/content/ru/smart/forms/switch.md index 90659045b..055a66d8a 100644 --- a/content/ru/smart/forms/switch.md +++ b/content/ru/smart/forms/switch.md @@ -5,7 +5,7 @@ description: "Включает или выключает настройку ср # Переключатель -:badge[sf-switch]{variant=tonal scheme=primary size=1/2} :badge[1.5.3]{variant=outline scheme=on-surface size=1/2} +:badge[sf-switch]{variant=outline scheme=on-surface size=1/2} :badge[1.5.3]{variant=outline scheme=on-surface size=1/2} Переключатель включает или выключает настройку сразу после нажатия. Подпись называет состояние или возможность — «Уведомления», «Компактный режим», — а не diff --git a/content/ru/smart/forms/textarea.md b/content/ru/smart/forms/textarea.md index 359068397..da94a1a33 100644 --- a/content/ru/smart/forms/textarea.md +++ b/content/ru/smart/forms/textarea.md @@ -5,7 +5,7 @@ description: "Принимает текст в несколько строк — # Многострочное поле -:badge[sf-input-textarea]{variant=tonal scheme=primary size=1/2} :badge[1.9.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-input-textarea]{variant=outline scheme=on-surface size=1/2} :badge[1.9.0]{variant=outline scheme=on-surface size=1/2} Многострочное поле принимает свободный текст в несколько строк: комментарий, описание задачи, отзыв, сообщение. Подпись, подсказка и сообщение об ошибке diff --git a/content/ru/smart/forms/theme-generator.md b/content/ru/smart/forms/theme-generator.md index 7ceb92e61..f135fd6b1 100644 --- a/content/ru/smart/forms/theme-generator.md +++ b/content/ru/smart/forms/theme-generator.md @@ -5,7 +5,7 @@ description: "Строит тему SIMAI Framework из одного цвета # Генератор темы -:badge[sf-theme-generator]{variant=tonal scheme=primary size=1/2} :badge[1.2.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-theme-generator]{variant=outline scheme=on-surface size=1/2} :badge[1.2.0]{variant=outline scheme=on-surface size=1/2} Генератор темы строит тему из одного цвета: человек выбирает основной цвет и сразу видит восемь тональных палитр SIMAI Framework — основную, вторичную, diff --git a/content/ru/smart/navigation/breadcrumbs.md b/content/ru/smart/navigation/breadcrumbs.md index 7862dced4..46591155e 100644 --- a/content/ru/smart/navigation/breadcrumbs.md +++ b/content/ru/smart/navigation/breadcrumbs.md @@ -5,7 +5,7 @@ description: "Показывает путь от корня сайта до те # Хлебные крошки -:badge[sf-breadcrumbs]{variant=tonal scheme=primary size=1/2} :badge[1.2.4]{variant=outline scheme=on-surface size=1/2} +:badge[sf-breadcrumbs]{variant=outline scheme=on-surface size=1/2} :badge[1.2.4]{variant=outline scheme=on-surface size=1/2} Хлебные крошки показывают, где в иерархии сайта находится страница: ссылки на разделы выше и название текущей страницы в конце; длинный путь сворачивается diff --git a/content/ru/smart/navigation/context-menu.md b/content/ru/smart/navigation/context-menu.md index ab8039a57..7bf4ce102 100644 --- a/content/ru/smart/navigation/context-menu.md +++ b/content/ru/smart/navigation/context-menu.md @@ -5,7 +5,7 @@ description: "Показывает короткий список действи # Контекстное меню -:badge[sf-menu-context]{variant=tonal scheme=primary size=1/2} :badge[1.19.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-menu-context]{variant=outline scheme=on-surface size=1/2} :badge[1.19.0]{variant=outline scheme=on-surface size=1/2} Контекстное меню — панель с коротким списком действий над объектом: страницей, строкой таблицы, файлом, профилем; пунктами можно управлять с клавиатуры. diff --git a/content/ru/smart/navigation/dropdown.md b/content/ru/smart/navigation/dropdown.md index 6b4e56700..7eb210591 100644 --- a/content/ru/smart/navigation/dropdown.md +++ b/content/ru/smart/navigation/dropdown.md @@ -5,7 +5,7 @@ description: "Выбирает одно или несколько значени # Выпадающий список -:badge[sf-dropdown]{variant=tonal scheme=primary size=1/2} :badge[1.11.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-dropdown]{variant=outline scheme=on-surface size=1/2} :badge[1.11.0]{variant=outline scheme=on-surface size=1/2} Выпадающий список даёт выбрать одно или несколько значений из раскрывающегося списка с поиском. Берите его, когда вариантов больше, чем удобно показать diff --git a/content/ru/smart/navigation/language.md b/content/ru/smart/navigation/language.md index 88f5f00dd..99a1d2f5e 100644 --- a/content/ru/smart/navigation/language.md +++ b/content/ru/smart/navigation/language.md @@ -5,7 +5,7 @@ description: "Переключает язык сайта: сегментами # Выбор языка -:badge[sf-language]{variant=tonal scheme=primary size=1/2} :badge[1.4.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-language]{variant=outline scheme=on-surface size=1/2} :badge[1.4.0]{variant=outline scheme=on-surface size=1/2} Выбор языка переключает язык сайта. Вид следует за числом языков: при двух-трёх все языки видны сразу и выбираются одним нажатием, при четырёх и diff --git a/content/ru/smart/navigation/pager.md b/content/ru/smart/navigation/pager.md index 294216aae..d9fb7b498 100644 --- a/content/ru/smart/navigation/pager.md +++ b/content/ru/smart/navigation/pager.md @@ -5,7 +5,7 @@ description: "Ведёт на соседнюю страницу или шаг п # Листалка страниц -:badge[sf-pager]{variant=tonal scheme=primary size=1/2} :badge[1.3.2]{variant=outline scheme=on-surface size=1/2} +:badge[sf-pager]{variant=outline scheme=on-surface size=1/2} :badge[1.3.2]{variant=outline scheme=on-surface size=1/2} Листалка страниц ведёт на соседнюю страницу или шаг по смыслу: предыдущая и следующая страница документации, записи блога или товара, шаги мастера, уроки diff --git a/content/ru/smart/navigation/pagination.md b/content/ru/smart/navigation/pagination.md index 91fbc5d2f..2777efcf7 100644 --- a/content/ru/smart/navigation/pagination.md +++ b/content/ru/smart/navigation/pagination.md @@ -5,7 +5,7 @@ description: "Переключает страницы длинного спис # Пагинация -:badge[sf-pagination]{variant=tonal scheme=primary size=1/2} :badge[1.5.1]{variant=outline scheme=on-surface size=1/2} +:badge[sf-pagination]{variant=outline scheme=on-surface size=1/2} :badge[1.5.1]{variant=outline scheme=on-surface size=1/2} Пагинация — подвал длинного списка или таблицы: сколько всего записей, на какой странице читатель, как перейти на другую и сколько записей показывать. diff --git a/content/ru/smart/navigation/settings.md b/content/ru/smart/navigation/settings.md index f2727b43c..fb720b3c3 100644 --- a/content/ru/smart/navigation/settings.md +++ b/content/ru/smart/navigation/settings.md @@ -5,7 +5,7 @@ description: "Компактная панель настроек: переклю # Настройки -:badge[sf-settings]{variant=tonal scheme=primary size=1/2} :badge[1.2.1]{variant=outline scheme=on-surface size=1/2} +:badge[sf-settings]{variant=outline scheme=on-surface size=1/2} :badge[1.2.1]{variant=outline scheme=on-surface size=1/2} Настройки — компактная панель с несколькими настройками, которые человек меняет на месте: тема и размер текста у читалки, плотность таблицы, звук в diff --git a/content/ru/smart/navigation/steps.md b/content/ru/smart/navigation/steps.md index ceef5001f..7645790ed 100644 --- a/content/ru/smart/navigation/steps.md +++ b/content/ru/smart/navigation/steps.md @@ -5,7 +5,7 @@ description: "Показывает этапы последовательного # Шаги -:badge[sf-steps]{variant=tonal scheme=primary size=1/2} :badge[1.4.1]{variant=outline scheme=on-surface size=1/2} +:badge[sf-steps]{variant=outline scheme=on-surface size=1/2} :badge[1.4.1]{variant=outline scheme=on-surface size=1/2} Шаги показывают этапы процесса, который проходят по порядку: оформление заказа, публикация, мастер настройки. Пройденные этапы отмечены галочкой, diff --git a/content/ru/smart/navigation/tabs.md b/content/ru/smart/navigation/tabs.md index 90d4f1b35..4bed0b41f 100644 --- a/content/ru/smart/navigation/tabs.md +++ b/content/ru/smart/navigation/tabs.md @@ -6,7 +6,7 @@ profile: reference # Вкладки -:badge[sf-tabs]{variant=tonal scheme=primary size=1/2} :badge[1.3.1]{variant=outline scheme=on-surface size=1/2} +:badge[sf-tabs]{variant=outline scheme=on-surface size=1/2} :badge[1.3.1]{variant=outline scheme=on-surface size=1/2} Вкладки показывают несколько панелей одного уровня на одном месте: человек переключает их и смотрит по очереди. Вкладки задают строкой, разметкой внутри diff --git a/content/ru/smart/navigation/tree-item.md b/content/ru/smart/navigation/tree-item.md index 76815131b..34cd00be0 100644 --- a/content/ru/smart/navigation/tree-item.md +++ b/content/ru/smart/navigation/tree-item.md @@ -5,7 +5,7 @@ description: "Задаёт один пункт дерева: подпись, с # Элемент дерева -:badge[sf-tree-item]{variant=tonal scheme=primary size=1/2} :badge[1.3.1]{variant=outline scheme=on-surface size=1/2} +:badge[sf-tree-item]{variant=outline scheme=on-surface size=1/2} :badge[1.3.1]{variant=outline scheme=on-surface size=1/2} Элемент дерева — один пункт [дерева](/ru/smart/navigation/tree/): папка с вложенными пунктами, файл или ссылка на раздел. Пункты ставят внутрь дерева: diff --git a/content/ru/smart/navigation/tree.md b/content/ru/smart/navigation/tree.md index d7e52c5a3..bc144baa4 100644 --- a/content/ru/smart/navigation/tree.md +++ b/content/ru/smart/navigation/tree.md @@ -5,7 +5,7 @@ description: "Показывает иерархию папок или разде # Дерево -:badge[sf-tree]{variant=tonal scheme=primary size=1/2} :badge[2.3.1]{variant=outline scheme=on-surface size=1/2} +:badge[sf-tree]{variant=outline scheme=on-surface size=1/2} :badge[2.3.1]{variant=outline scheme=on-surface size=1/2} Дерево показывает вложенный список: папки и файлы, разделы сайта, категории каталога. Ветви раскрываются и сворачиваются, пункты выбираются мышью и diff --git a/content/ru/smart/overlays/drawer.md b/content/ru/smart/overlays/drawer.md index 2ba2d9732..f002254cf 100644 --- a/content/ru/smart/overlays/drawer.md +++ b/content/ru/smart/overlays/drawer.md @@ -6,7 +6,7 @@ profile: reference # Боковая панель -:badge[sf-drawer]{variant=tonal scheme=primary size=1/2} :badge[1.10.5]{variant=outline scheme=on-surface size=1/2} +:badge[sf-drawer]{variant=outline scheme=on-surface size=1/2} :badge[1.10.5]{variant=outline scheme=on-surface size=1/2} Боковая панель открывается рядом со страницей и оставляет её доступной: подсказка у формы, библиотека блоков и свойства в редакторе страниц. diff --git a/content/ru/smart/overlays/modal.md b/content/ru/smart/overlays/modal.md index 8777d3b38..0eab85e56 100644 --- a/content/ru/smart/overlays/modal.md +++ b/content/ru/smart/overlays/modal.md @@ -6,7 +6,7 @@ profile: reference # Модальное окно -:badge[sf-modal]{variant=tonal scheme=primary size=1/2} :badge[1.7.2]{variant=outline scheme=on-surface size=1/2} +:badge[sf-modal]{variant=outline scheme=on-surface size=1/2} :badge[1.7.2]{variant=outline scheme=on-surface size=1/2} Модальное окно показывает одну ограниченную задачу поверх страницы: подтверждение, короткую форму, подробности. Пока оно открыто, страница за ним diff --git a/content/ru/smart/overlays/popover.md b/content/ru/smart/overlays/popover.md index 6e4bd88f4..07f65f7b3 100644 --- a/content/ru/smart/overlays/popover.md +++ b/content/ru/smart/overlays/popover.md @@ -5,7 +5,7 @@ description: "Открывает небольшую панель у кнопки # Всплывающая панель -:badge[sf-popover]{variant=tonal scheme=primary size=1/2} :badge[1.6.0]{variant=outline scheme=on-surface size=1/2} +:badge[sf-popover]{variant=outline scheme=on-surface size=1/2} :badge[1.6.0]{variant=outline scheme=on-surface size=1/2} Всплывающая панель открывается рядом с кнопкой: фильтр, настройки поля, список того, что можно добавить. Она закрывается по `Escape` и нажатию снаружи и diff --git a/content/ru/smart/overlays/resizer.md b/content/ru/smart/overlays/resizer.md index 58f4b3d57..64a6e53b7 100644 --- a/content/ru/smart/overlays/resizer.md +++ b/content/ru/smart/overlays/resizer.md @@ -5,7 +5,7 @@ description: "Ручка на краю панели: ширину меняют # Изменение ширины -:badge[sf-resizer]{variant=tonal scheme=primary size=1/2} :badge[1.1.5]{variant=outline scheme=on-surface size=1/2} +:badge[sf-resizer]{variant=outline scheme=on-surface size=1/2} :badge[1.1.5]{variant=outline scheme=on-surface size=1/2} Изменение ширины — ручка на краю панели: ширину тянут мышью, пером или касанием, меняют стрелками с клавиатуры и возвращают двойным щелчком. Подходит diff --git a/docs/developer/reference-page-standard.md b/docs/developer/reference-page-standard.md index 2dff7c142..581419104 100644 --- a/docs/developer/reference-page-standard.md +++ b/docs/developer/reference-page-standard.md @@ -24,7 +24,9 @@ here. carry the facts badges repeated. The one exception is generated: on a Smart page `scripts/build-smart-reference.mjs` writes one line under the H1 with the tag and the version of every component the page documents - (owner remark R007, 2026-11-07). A class component page gets the same + (owner remark R007, 2026-11-07); both badges are outline on-surface + (`{variant=outline scheme=on-surface size=1/2}`, owner decision C140: + a mark beside a title is outline). A class component page gets the same line from `scripts/build-reference-sections.mjs`: its `sf-` block and the version of the component's passport (dispatcher call on D01, 2026-11-10). The audit fails either page without it diff --git a/scripts/audit-reference-pages.mjs b/scripts/audit-reference-pages.mjs index 3b76a4194..1efdcaced 100644 --- a/scripts/audit-reference-pages.mjs +++ b/scripts/audit-reference-pages.mjs @@ -91,7 +91,7 @@ for (const [page, entry] of Object.entries(settings.pages)) { if (!/^description:\s*\S/mu.test(front)) add('description_missing'); const smart = entry.kind === 'smart'; // The generated version line: tag and version badges, nothing else. - const versionLine = /^(# .+\n)\n(:badge\[sf-[a-z0-9-]+\]\{variant=tonal scheme=primary size=1\/2\} :badge\[\d+\.\d+\.\d+\]\{variant=outline scheme=on-surface size=1\/2\}( |$))+\n/mu; + const versionLine = /^(# .+\n)\n(:badge\[sf-[a-z0-9-]+\]\{variant=outline scheme=on-surface size=1\/2\} :badge\[\d+\.\d+\.\d+\]\{variant=outline scheme=on-surface size=1\/2\}( |$))+\n/mu; // A class page carries the same line from its passport (D01, 2026-11-10). const versioned = smart || (entry.kind === 'component' && (entry.badge ?? (entry.blocks ?? [entry.block])[0] ?? '').startsWith('sf-')); if (versioned && !versionLine.test(text)) add('version_badges_missing'); diff --git a/scripts/build-reference-sections.mjs b/scripts/build-reference-sections.mjs index 19279a0e7..4d9642fb0 100644 --- a/scripts/build-reference-sections.mjs +++ b/scripts/build-reference-sections.mjs @@ -660,7 +660,7 @@ const withBadges = (text, block, version) => { const title = text.match(/^# .+\n/mu); if (!title || !version || !block?.startsWith('sf-')) return text; const at = title.index + title[0].length; - const line = `:badge[${block}]{variant=tonal scheme=primary size=1/2} :badge[${version}]{variant=outline scheme=on-surface size=1/2}`; + const line = `:badge[${block}]{variant=outline scheme=on-surface size=1/2} :badge[${version}]{variant=outline scheme=on-surface size=1/2}`; return `${text.slice(0, at)}\n${line}\n${text.slice(at).replace(BADGE_LINE, '\n')}`; }; diff --git a/scripts/build-smart-reference.mjs b/scripts/build-smart-reference.mjs index 91b8ffbe7..dd0196d74 100644 --- a/scripts/build-smart-reference.mjs +++ b/scripts/build-smart-reference.mjs @@ -862,7 +862,7 @@ const withBadges = (text, entries) => { const title = text.match(/^# .+\n/mu); if (!title) return text; const at = title.index + title[0].length; - const badges = entries.map(([, {manifest}]) => `:badge[${manifest.custom_element}]{variant=tonal scheme=primary size=1/2}` + const badges = entries.map(([, {manifest}]) => `:badge[${manifest.custom_element}]{variant=outline scheme=on-surface size=1/2}` + ` :badge[${manifest.version}]{variant=outline scheme=on-surface size=1/2}`).join(' '); return `${text.slice(0, at)}\n${badges}\n${text.slice(at).replace(BADGE_LINE, '\n')}`; }; From 6aec9e9d500614a0abe9f29b3231ef34beca5da2 Mon Sep 17 00:00:00 2001 From: Rim Zabarov Date: Sun, 15 Nov 2026 16:21:28 +0300 Subject: [PATCH 06/75] =?UTF-8?q?Palettes=20page:=20the=20static=20palette?= =?UTF-8?q?=20table=20shows=20all=20sixteen=20tones=20(98=20=E2=80=A6=205)?= =?UTF-8?q?,=20like=20the=20theme=20palettes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The release defines every --sf-- of the 16 tones; the example drew only ten (95 … 10), so 98, 85, 35, 25, 15 and 5 looked missing. Co-Authored-By: Claude Opus 5.5 --- content/ru/guide/colour/palettes.md | 36 ++++++++++++++--------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/content/ru/guide/colour/palettes.md b/content/ru/guide/colour/palettes.md index fabadd67e..f595b6805 100644 --- a/content/ru/guide/colour/palettes.md +++ b/content/ru/guide/colour/palettes.md @@ -123,29 +123,29 @@ Framework не использует, не проходит контракт `alp :::example {label="Оттенки"} ```html
    - 95908070605040302010 - red - orange - amber - yellow - lime - green - teal - cyan - sky - blue - indigo - violet - purple - pink - brown - gray + 9895908580706050403530252015105 + red + orange + amber + yellow + lime + green + teal + cyan + sky + blue + indigo + violet + purple + pink + brown + gray
    ``` ```css .sf-doc-palette-grid { display: grid; - grid-template-columns: minmax(3.5rem, auto) repeat(10, minmax(0, 1fr)); + grid-template-columns: minmax(3.5rem, auto) repeat(16, minmax(0, 1fr)); gap: var(--sf-space-1\/4); align-items: center; } From c4e515436de9e34d7d5c95feedf594eb4e23b7e5 Mon Sep 17 00:00:00 2001 From: Rim Zabarov Date: Sun, 15 Nov 2026 17:12:24 +0300 Subject: [PATCH 07/75] Pager and pagination pages: pager describes cards, row and the record counter across list pages (C97 (7)); pagination teaches the five looks with an example each, disabled ends, links and the admin footer parts Co-Authored-By: Claude Opus 5.5 --- content/ru/smart/navigation/pager.md | 166 +++++-------- content/ru/smart/navigation/pagination.md | 227 ++++++++++-------- .../smart-components/pager/counter/index.html | 4 +- .../smart-components/pager/counter/index.js | 34 ++- .../pager/course-finished/index.html | 1 - .../pager/course-finished/index.js | 11 - .../smart-components/pager/course/index.html | 1 - .../smart-components/pager/course/index.js | 11 - .../pager/steps-last/index.html | 1 - .../pager/steps-last/index.js | 11 - .../smart-components/pager/steps/index.html | 4 - .../smart-components/pager/steps/index.js | 15 -- .../pager/validation/index.html | 8 +- .../pager/validation/index.js | 13 +- .../pagination/arrows/index.html | 1 + .../pagination/composition/index.html | 14 -- .../pagination/cursor/index.html | 1 + .../pagination/ends/index.html | 14 ++ .../pagination/field/index.html | 1 + .../pagination/more/index.html | 1 + .../smart-components/pagination/more/index.js | 7 + .../pagination/numbers/index.html | 1 + .../pagination/overview/index.html | 4 +- .../pagination/overview/index.js | 3 - .../pagination/show-more-busy/index.html | 5 +- .../pagination/sizes/index.html | 4 +- .../pagination/unknown-count/index.html | 2 +- 27 files changed, 265 insertions(+), 300 deletions(-) delete mode 100644 examples/smart-components/pager/course-finished/index.html delete mode 100644 examples/smart-components/pager/course-finished/index.js delete mode 100644 examples/smart-components/pager/course/index.html delete mode 100644 examples/smart-components/pager/course/index.js delete mode 100644 examples/smart-components/pager/steps-last/index.html delete mode 100644 examples/smart-components/pager/steps-last/index.js delete mode 100644 examples/smart-components/pager/steps/index.html delete mode 100644 examples/smart-components/pager/steps/index.js create mode 100644 examples/smart-components/pagination/arrows/index.html delete mode 100644 examples/smart-components/pagination/composition/index.html create mode 100644 examples/smart-components/pagination/cursor/index.html create mode 100644 examples/smart-components/pagination/ends/index.html create mode 100644 examples/smart-components/pagination/field/index.html create mode 100644 examples/smart-components/pagination/more/index.html create mode 100644 examples/smart-components/pagination/more/index.js create mode 100644 examples/smart-components/pagination/numbers/index.html diff --git a/content/ru/smart/navigation/pager.md b/content/ru/smart/navigation/pager.md index d9fb7b498..53c72cf71 100644 --- a/content/ru/smart/navigation/pager.md +++ b/content/ru/smart/navigation/pager.md @@ -7,11 +7,12 @@ description: "Ведёт на соседнюю страницу или шаг п :badge[sf-pager]{variant=outline scheme=on-surface size=1/2} :badge[1.3.2]{variant=outline scheme=on-surface size=1/2} -Листалка страниц ведёт на соседнюю страницу или шаг по смыслу: предыдущая и -следующая страница документации, записи блога или товара, шаги мастера, уроки -курса, следующая запись в карточке администрирования. Список по номерам (1, 2, -3 …) листает [Пагинация](/ru/smart/navigation/pagination/), а разделы внутри -одной страницы — [Оглавление](/ru/smart/navigation/contents/). +Листалка страниц ведёт на соседнюю страницу по смыслу: предыдущая и +следующая страница документации, запись блога или товар, следующая запись в +карточке администрирования. Список по номерам (1, 2, +3 …) листает [Пагинация](/ru/smart/navigation/pagination/), этапы процесса — +[Шаги](/ru/smart/navigation/steps/), а разделы внутри одной страницы — +[Оглавление](/ru/smart/navigation/contents/). ## Пример @@ -25,35 +26,33 @@ description: "Ведёт на соседнюю страницу или шаг п - **две стороны** — `prev-href`, `prev-title`, `next-href`, `next-title` (виды `cards` и `row`). Сервер печатает их обычными ссылками, которые работают и без скрипта; -- **список и место в нём** — `items`, список `{id, title, href?, meta?}`, и - `current` — место в списке, начиная с 0 (виды `steps`, `course` и - `counter`; `cards` и `row` тоже берут стороны из списка, если атрибуты - сторон не заданы). +- **список и место в нём** — `items`, список `{id, title, href?}`, и + `current` — место в списке, начиная с 0 (вид `counter`; `cards` и `row` + тоже берут стороны из списка, если атрибуты сторон не заданы). ```html - + ``` Атрибут списка не держит: `items` передают свойством или JSON-островком -внутри элемента, как во втором теге. `meta` — заметка урока, например -«6 минут». +внутри элемента, как во втором теге. Листалка рисует ссылки и кнопки, строку места, обслуживает клавиатуру и спрашивает разрешения перед каждым переходом. Страница отвечает за сами -страницы: годен ли шаг, загрузку следующей записи, хранение пройденных уроков. +записи: загрузку следующей страницы списка и открытие записи. ## Варианты -`appearance` выбирает вид. Подписи «Назад», «Далее», «Готово» и строки места -берутся из языка страницы. +`appearance` выбирает вид. Подписи «Назад», «Далее» и строка места берутся +из языка страницы. ### Карточки @@ -70,44 +69,39 @@ description: "Ведёт на соседнюю страницу или шаг п `appearance` • по умолчанию `cards` • [справочник](#атрибуты) -`appearance="row"` — одна строка с двумя названиями по краям, каждое -обрезается многоточием: под записью блога, новостью или товаром. Направление -экранный диктор слышит, а на экране его нет. +`appearance="row"` — одна строка с двумя названиями по краям, каждое до двух +строк: под записью блога, новостью или товаром. На телефоне названия стоят +друг под другом. Направление экранный диктор слышит, а на экране его нет. :::example {id="smart-components/pager/row" label="Строка"} ::: -### Шаги - -`appearance`, `complete` • [справочник](#атрибуты) - -`appearance="steps"` — мастер: «Назад», строка «Шаг 2 из 4 · название» над -сегментной дорожкой и главная кнопка «Далее». На последнем шаге она -называется «Готово» и завершает проход (`complete`). - -:::example {id="smart-components/pager/steps" label="Шаги"} -::: - -### Курс - -`appearance` • по умолчанию `cards` • [справочник](#атрибуты) - -`appearance="course"` — точки уроков (пройденные, текущий, впереди) со -строкой «Урок 3 из 5» и карточка следующего урока с заметкой (`meta`) и -главной кнопкой «Начать». На последнем уроке карточка предлагает «Готово». - -:::example {id="smart-components/pager/course" label="Курс"} -::: - ### Счётчик -`appearance`, `keys` • [справочник](#атрибуты) - -`appearance="counter"` — «‹ 3 из 12 ›» с двумя кнопками-иконками, чтобы -просматривать записи по одной. С `keys` листают и стрелки `←` и `→` на -странице. - -:::example {id="smart-components/pager/counter" label="Счётчик"} +`appearance`, `total`, `has-next`, `list-href`, `keys` • [справочник](#атрибуты) + +`appearance="counter"` — «‹ 3 из 240 ›» в карточке записи: человек открыл +заявку из списка и листает соседние заявки по одной, не возвращаясь к +списку. + +- **Весь список, а не одна его страница.** `total` — сколько записей во всём + списке, `current` — место открытой записи в нём. В `items` лежат только + загруженные записи. Когда человек доходит до края загруженной страницы, + листалка всё равно спрашивает переход: в `sf-pager-navigate` приходит + `index` следующей записи, а `id` пустой — страница загружает следующую + страницу списка и дописывает её в `items`. +- **Число неизвестно.** Без `total` строка места — «3 из многих», а «Далее» + доступно, пока `has-next` говорит, что следующая запись есть. +- **Клавиши.** С `keys` листают стрелки `←` и `→` на странице, а также `[` + и `]`, если фокус не в поле ввода. +- **К списку.** `list-href` — адрес списка, из которого открыта запись, со + своим отбором и страницей. Перед стрелками появляется тихая ссылка-значок + «К списку». + +В примере в списке 240 заявок, загружена первая страница из 20. Дойдите до +заявки № 1060 — пример загрузит вторую страницу. + +:::example {id="smart-components/pager/counter" label="Счётчик" log="sf-pager-navigate sf-pager-change" log_open=false} ::: ### Размер @@ -120,57 +114,35 @@ description: "Ведёт на соседнюю страницу или шаг п :::example {id="smart-components/pager/sizes" label="Две ступени размера"} ::: -## Состояния - -### Последний шаг - -`complete` • [справочник](#атрибуты) - -На последнем шаге главная кнопка называется «Готово». Нажатие на неё -завершает проход: `complete` включается, и листалка сообщает об этом -событием. - -:::example {id="smart-components/pager/steps-last" label="Последний шаг"} -::: - -### Курс пройден - -`complete` • [справочник](#атрибуты) - -`complete` в виде `course` показывает «Курс пройден» и кнопку «Сначала». - -:::example {id="smart-components/pager/course-finished" label="Курс пройден"} -::: - ## Поведение ### Карточки или пагинация -Листалка ведёт по смыслу: к соседней странице, следующему шагу, следующему -уроку. Если читатель листает один длинный список по номерам и выбирает размер -страницы, берите [Пагинацию](/ru/smart/navigation/pagination/). +Листалка ведёт по смыслу: к соседней странице или следующей записи. Если +читатель листает один длинный список по номерам и выбирает размер страницы, +берите [Пагинацию](/ru/smart/navigation/pagination/); этапы процесса — +[Шаги](/ru/smart/navigation/steps/). Счётчики и точки картинок — у +[Галереи](/ru/smart/content/gallery/) и [Карусели](/ru/smart/content/slider/). ### Разрешение на переход Перед каждым переходом, который делает человек, — ссылки тоже — листалка отправляет отменяемый запрос `sf-pager-navigate` с -`{direction, index, id, href}`. `direction` — `prev`, `next`, `finish`, -`restart` или `go-to`; `index` — место цели в `items` (для `finish` — текущее), -`null` для стороны из `prev-href` или `next-href`. `preventDefault()` -оставляет текущую страницу или шаг — например, пока шаг не заполнен, — или -позволяет перейти самой странице. +`{direction, index, id, href}`. `direction` — `prev`, `next` или `go-to`; +`index` — место цели в списке, `null` для стороны из `prev-href` или +`next-href`. `preventDefault()` оставляет текущую запись — например, пока в +ней есть несохранённые правки, — или позволяет перейти самой странице. :::example {id="smart-components/pager/validation" label="Разрешение"} ::: ```js pager.addEventListener('sf-pager-navigate', (event) => { - if (event.detail.direction === 'next' && !form.checkValidity()) event.preventDefault(); + if (form.dataset.dirty === 'true') event.preventDefault(); }); ``` -Пункт с `href` в видах `steps`, `course` и `counter` открывается, когда запрос -разрешён. +Пункт с `href` в виде `counter` открывается, когда запрос разрешён. ### Событие после перехода @@ -182,55 +154,47 @@ pager.addEventListener('sf-pager-navigate', (event) => { ### Действия `prev()`, `next()` и `goTo({index})` переходят так же, как нажатие, после -того же отменяемого запроса, но без события `sf-pager-change`. `next()` на -последнем шаге или уроке завершает проход. Каждое отвечает `applied` или +того же отменяемого запроса, но без события `sf-pager-change`. Каждое отвечает `applied` или `refused` — на первом или последнем пункте, на текущем и при отменённом запросе. ### Подписи `label` — имя ориентира навигации, по умолчанию «Соседние страницы». -`prev-label`, `next-label` и `done-label` заменяют слова «Назад», «Далее» и -«Готово». +`prev-label` и `next-label` заменяют слова «Назад» и «Далее». ### Внешний вид Листалка берёт только роли темы: ссылки — `--sf-primary`, заметки — `--sf-on-surface-variant`, карточки — на `--sf-surface-card` с краем -`--sf-outline-variant` (`--sf-primary-outline` при наведении), дорожка — -`--sf-surface-container`, заливка — `--sf-primary`, как у -[Прогресса](/ru/smart/feedback/progress-bar/). +`--sf-outline-variant` (`--sf-primary-outline` при наведении). | Переменная | По умолчанию | Что меняет | |:---|:---|:---| | `--sf-pager-gap` | `var(--sf-ui-1--text-space-x)` | расстояние между частями | -| `--sf-pager-card-background-color` | `var(--sf-surface-card)` | заливку карточек и карточки урока | +| `--sf-pager-card-background-color` | `var(--sf-surface-card)` | заливку карточек | | `--sf-pager-card-border-color` | `var(--sf-outline-variant)` | их край | | `--sf-pager-card-radius` | `var(--sf-radius--ui)` | их скругление | | `--sf-pager-link-color` | `var(--sf-primary)` | названия в карточках и строке | -| `--sf-pager-meta-color` | `var(--sf-on-surface-variant)` | слова направления, заметки и строки места | -| `--sf-pager-track-color` | `var(--sf-surface-container)` | дорожку шагов и точки впереди | -| `--sf-pager-fill-color` | `var(--sf-primary)` | пройденные сегменты и точки | +| `--sf-pager-meta-color` | `var(--sf-on-surface-variant)` | слова направления и строку места | ### Первая отрисовка Карточки и строка — ссылки из строковых настроек, поэтому их снимок — та же разметка, что печатает сервер: она работает и держит свою коробку до кода. -Шаги, курс и счётчик получают коробку из настроек; любой текст, длина -которого зависит от данных, занимает одну строку с многоточием. +Счётчик получает коробку из настроек; строка места занимает одну строку с +многоточием. ## Доступность - Элемент рисует `