@iskra-ui/core 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENCE.md +79 -0
- package/dist/.tsbuildinfo +1 -0
- package/dist/disclosure.d.ts +13 -0
- package/dist/disclosure.d.ts.map +1 -0
- package/dist/disclosure.js +17 -0
- package/dist/disclosure.js.map +1 -0
- package/dist/focusTrap.d.ts +16 -0
- package/dist/focusTrap.d.ts.map +1 -0
- package/dist/focusTrap.js +46 -0
- package/dist/focusTrap.js.map +1 -0
- package/dist/id.d.ts +9 -0
- package/dist/id.d.ts.map +1 -0
- package/dist/id.js +15 -0
- package/dist/id.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/keyboard.d.ts +17 -0
- package/dist/keyboard.d.ts.map +1 -0
- package/dist/keyboard.js +18 -0
- package/dist/keyboard.js.map +1 -0
- package/dist/tabs.d.ts +21 -0
- package/dist/tabs.d.ts.map +1 -0
- package/dist/tabs.js +40 -0
- package/dist/tabs.js.map +1 -0
- package/package.json +32 -0
package/LICENCE.md
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Лицензии
|
|
2
|
+
|
|
3
|
+
Документ фиксирует правовой статус кода дизайн-системы **Искра.DCI** и сторонних компонентов, которые **поставляются потребителям** вместе с npm-пакетами `@iskra-ui/*`.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Пакеты `@iskra-ui/*`
|
|
8
|
+
|
|
9
|
+
| Пакет | Статус |
|
|
10
|
+
| --------------------- | ---------------------------------------------- |
|
|
11
|
+
| `@iskra-ui/tokens` | Проприетарное ПО |
|
|
12
|
+
| `@iskra-ui/styles` | Проприетарное ПО + сторонние шрифты (см. ниже) |
|
|
13
|
+
| `@iskra-ui/icons` | Проприетарное ПО |
|
|
14
|
+
| `@iskra-ui/core` | Проприетарное ПО |
|
|
15
|
+
| `@iskra-ui/react` | Проприетарное ПО |
|
|
16
|
+
| `@iskra-ui/vue` | Проприетарное ПО |
|
|
17
|
+
| `@iskra-ui/dci-react` | Проприетарное ПО |
|
|
18
|
+
|
|
19
|
+
Исходный код, дизайн-токены, компоненты, документация и торговые обозначения **Искра.DCI** / **ИСКРА.DCI** принадлежат правообладателю платформы. Все права защищены.
|
|
20
|
+
|
|
21
|
+
Пакеты публикуются в публичном npm-реестре (`publishConfig.access: public`). Использование, копирование, распространение и модификация **вне условий, согласованных с правообладателем**, запрещены.
|
|
22
|
+
|
|
23
|
+
Приватные пакеты монорепозитория (`@iskra-ui/eslint-config`, `@iskra-ui/tsconfig`, `@iskra-ui/docs-react`) распространяются только внутри репозитория и не публикуются в npm.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Сторонние компоненты в составе поставки
|
|
28
|
+
|
|
29
|
+
### Шрифты (`@iskra-ui/styles`)
|
|
30
|
+
|
|
31
|
+
В бандл `@iskra-ui/styles` встроены variable-шрифты (self-hosted, без CDN):
|
|
32
|
+
|
|
33
|
+
| Шрифт | Файл | Лицензия |
|
|
34
|
+
| ---------------------------------------------------- | ---------------------------------- | --------------------------------------------------------- |
|
|
35
|
+
| [Inter](https://rsms.me/inter/) | `Inter-VariableFont_opsz_wght.ttf` | [SIL Open Font License 1.1](https://openfontlicense.org/) |
|
|
36
|
+
| [JetBrains Mono](https://www.jetbrains.com/lp/mono/) | `JetBrainsMono_wght_.ttf` | [SIL Open Font License 1.1](https://openfontlicense.org/) |
|
|
37
|
+
|
|
38
|
+
Шрифты копируются в `packages/styles/dist/fonts/` при сборке пакета. При распространении производных продуктов необходимо сохранять уведомления OFL для этих файлов.
|
|
39
|
+
|
|
40
|
+
**Краткое условие OFL 1.1:** шрифты можно использовать, изучать, модифицировать и распространять при условии, что производные шрифты не продаются отдельно и что уведомление об авторских правах и лицензии OFL сохраняется в составе дистрибутива.
|
|
41
|
+
|
|
42
|
+
### Иконки (`@iskra-ui/icons`)
|
|
43
|
+
|
|
44
|
+
Набор `@iskra-ui/icons` — **оригинальная SVG-разметка** Искра.DCI (16×16, stroke 1.5px), нарисованная под геометрию outline-иконок, принятую в бренде.
|
|
45
|
+
|
|
46
|
+
Геометрия согласована со стилем:
|
|
47
|
+
|
|
48
|
+
| Источник | Лицензия | Примечание |
|
|
49
|
+
| --------------------------------------------- | -------- | ---------------------------------------------------------------------- |
|
|
50
|
+
| [Feather Icons](https://feathericons.com/) | MIT | Референс по stroke и сетке; глифы в репозитории не копируются дословно |
|
|
51
|
+
| [Heroicons](https://heroicons.com/) (outline) | MIT | Допустимый заменитель при отсутствии глифа в наборе |
|
|
52
|
+
|
|
53
|
+
MIT-лицензии Feather Icons и Heroicons **не распространяются** на код `@iskra-ui/icons`, но указаны как происхождение визуального языка. При публикации открытых форков или выноса иконок в отдельный OSS-пакет — сверьтесь с юридической службой правообладателя.
|
|
54
|
+
|
|
55
|
+
### Инструменты разработки (не входят в npm-поставку)
|
|
56
|
+
|
|
57
|
+
Зависимости dev/build (React, Vue, Vite, Storybook, ESLint, Turbo, Changesets и др.) подчиняются лицензиям соответствующих проектов. Они **не включаются** в publishable-артефакты `@iskra-ui/*` и в этом документе не перечисляются.
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Торговые марки
|
|
62
|
+
|
|
63
|
+
**Искра**, **Искра.DCI**, **ИСКРА.DCI**, логотип-искра и маскот **Бит** — элементы бренда платформы. Их использование вне продуктов правообладателя регулируется отдельно от лицензии на исходный код.
|
|
64
|
+
|
|
65
|
+
Названия **React**, **Vue**, **pnpm**, **Storybook** и других сторонних проектов принадлежат их владельцам.
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Вопросы по лицензированию
|
|
70
|
+
|
|
71
|
+
По условиям использования пакетов `@iskra-ui/*`, white-label брендингу и включению компонентов в сторонние продукты обращайтесь к правообладателю платформы Искра.DCI.
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## См. также
|
|
76
|
+
|
|
77
|
+
- [README.md](README.md) — обзор монорепозитория
|
|
78
|
+
- [docs/PACKAGES.md](docs/PACKAGES.md) — состав поставки пакетов
|
|
79
|
+
- [CONTRIBUTING.md](CONTRIBUTING.md) — разработка и релизы
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"fileNames":["../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2021.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.dom.iterable.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2017.date.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2021.string.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.array.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.object.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.string.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.decorators.legacy.d.ts","../src/disclosure.ts","../src/focusTrap.ts","../src/id.ts","../src/keyboard.ts","../src/tabs.ts","../src/index.ts"],"fileIdsList":[[60,61,62,63,64],[63]],"fileInfos":[{"version":"bcd24271a113971ba9eb71ff8cb01bc6b0f872a85c23fdbe5d93065b375933cd","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f88bedbeb09c6f5a6645cb24c7c55f1aa22d19ae96c8e6959cbd8b85a707bc6","impliedFormat":1},{"version":"7fe93b39b810eadd916be8db880dd7f0f7012a5cc6ffb62de8f62a2117fa6f1f","impliedFormat":1},{"version":"bb0074cc08b84a2374af33d8bf044b80851ccc9e719a5e202eacf40db2c31600","impliedFormat":1},{"version":"1a7daebe4f45fb03d9ec53d60008fbf9ac45a697fdc89e4ce218bc94b94f94d6","impliedFormat":1},{"version":"f94b133a3cb14a288803be545ac2683e0d0ff6661bcd37e31aaaec54fc382aed","impliedFormat":1},{"version":"f59d0650799f8782fd74cf73c19223730c6d1b9198671b1c5b3a38e1188b5953","impliedFormat":1},{"version":"8a15b4607d9a499e2dbeed9ec0d3c0d7372c850b2d5f1fb259e8f6d41d468a84","impliedFormat":1},{"version":"26e0fe14baee4e127f4365d1ae0b276f400562e45e19e35fd2d4c296684715e6","impliedFormat":1},{"version":"d6b1eba8496bdd0eed6fc8a685768fe01b2da4a0388b5fe7df558290bffcf32f","affectsGlobalScope":true,"impliedFormat":1},{"version":"7f57fc4404ff020bc45b9c620aff2b40f700b95fe31164024c453a5e3c163c54","impliedFormat":1},{"version":"eadcffda2aa84802c73938e589b9e58248d74c59cb7fcbca6474e3435ac15504","affectsGlobalScope":true,"impliedFormat":1},{"version":"105ba8ff7ba746404fe1a2e189d1d3d2e0eb29a08c18dded791af02f29fb4711","affectsGlobalScope":true,"impliedFormat":1},{"version":"00343ca5b2e3d48fa5df1db6e32ea2a59afab09590274a6cccb1dbae82e60c7c","affectsGlobalScope":true,"impliedFormat":1},{"version":"ebd9f816d4002697cb2864bea1f0b70a103124e18a8cd9645eeccc09bdf80ab4","affectsGlobalScope":true,"impliedFormat":1},{"version":"2c1afac30a01772cd2a9a298a7ce7706b5892e447bb46bdbeef720f7b5da77ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"7b0225f483e4fa685625ebe43dd584bb7973bbd84e66a6ba7bbe175ee1048b4f","affectsGlobalScope":true,"impliedFormat":1},{"version":"c0a4b8ac6ce74679c1da2b3795296f5896e31c38e888469a8e0f99dc3305de60","affectsGlobalScope":true,"impliedFormat":1},{"version":"3084a7b5f569088e0146533a00830e206565de65cae2239509168b11434cd84f","affectsGlobalScope":true,"impliedFormat":1},{"version":"c5079c53f0f141a0698faa903e76cb41cd664e3efb01cc17a5c46ec2eb0bef42","affectsGlobalScope":true,"impliedFormat":1},{"version":"32cafbc484dea6b0ab62cf8473182bbcb23020d70845b406f80b7526f38ae862","affectsGlobalScope":true,"impliedFormat":1},{"version":"fca4cdcb6d6c5ef18a869003d02c9f0fd95df8cfaf6eb431cd3376bc034cad36","affectsGlobalScope":true,"impliedFormat":1},{"version":"b93ec88115de9a9dc1b602291b85baf825c85666bf25985cc5f698073892b467","affectsGlobalScope":true,"impliedFormat":1},{"version":"f5c06dcc3fe849fcb297c247865a161f995cc29de7aa823afdd75aaaddc1419b","affectsGlobalScope":true,"impliedFormat":1},{"version":"b77e16112127a4b169ef0b8c3a4d730edf459c5f25fe52d5e436a6919206c4d7","affectsGlobalScope":true,"impliedFormat":1},{"version":"fbffd9337146eff822c7c00acbb78b01ea7ea23987f6c961eba689349e744f8c","affectsGlobalScope":true,"impliedFormat":1},{"version":"a995c0e49b721312f74fdfb89e4ba29bd9824c770bbb4021d74d2bf560e4c6bd","affectsGlobalScope":true,"impliedFormat":1},{"version":"c7b3542146734342e440a84b213384bfa188835537ddbda50d30766f0593aff9","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce6180fa19b1cccd07ee7f7dbb9a367ac19c0ed160573e4686425060b6df7f57","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f02e2476bccb9dbe21280d6090f0df17d2f66b74711489415a8aa4df73c9675","affectsGlobalScope":true,"impliedFormat":1},{"version":"45e3ab34c1c013c8ab2dc1ba4c80c780744b13b5676800ae2e3be27ae862c40c","affectsGlobalScope":true,"impliedFormat":1},{"version":"805c86f6cca8d7702a62a844856dbaa2a3fd2abef0536e65d48732441dde5b5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"e42e397f1a5a77994f0185fd1466520691456c772d06bf843e5084ceb879a0ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"f4c2b41f90c95b1c532ecc874bd3c111865793b23aebcc1c3cbbabcd5d76ffb0","affectsGlobalScope":true,"impliedFormat":1},{"version":"ab26191cfad5b66afa11b8bf935ef1cd88fabfcb28d30b2dfa6fad877d050332","affectsGlobalScope":true,"impliedFormat":1},{"version":"2088bc26531e38fb05eedac2951480db5309f6be3fa4a08d2221abb0f5b4200d","affectsGlobalScope":true,"impliedFormat":1},{"version":"cb9d366c425fea79716a8fb3af0d78e6b22ebbab3bd64d25063b42dc9f531c1e","affectsGlobalScope":true,"impliedFormat":1},{"version":"500934a8089c26d57ebdb688fc9757389bb6207a3c8f0674d68efa900d2abb34","affectsGlobalScope":true,"impliedFormat":1},{"version":"689da16f46e647cef0d64b0def88910e818a5877ca5379ede156ca3afb780ac3","affectsGlobalScope":true,"impliedFormat":1},{"version":"bc21cc8b6fee4f4c2440d08035b7ea3c06b3511314c8bab6bef7a92de58a2593","affectsGlobalScope":true,"impliedFormat":1},{"version":"7ca53d13d2957003abb47922a71866ba7cb2068f8d154877c596d63c359fed25","affectsGlobalScope":true,"impliedFormat":1},{"version":"54725f8c4df3d900cb4dac84b64689ce29548da0b4e9b7c2de61d41c79293611","affectsGlobalScope":true,"impliedFormat":1},{"version":"e5594bc3076ac29e6c1ebda77939bc4c8833de72f654b6e376862c0473199323","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f3eb332c2d73e729f3364fcc0c2b375e72a121e8157d25a82d67a138c83a95c","affectsGlobalScope":true,"impliedFormat":1},{"version":"6f4427f9642ce8d500970e4e69d1397f64072ab73b97e476b4002a646ac743b1","affectsGlobalScope":true,"impliedFormat":1},{"version":"48915f327cd1dea4d7bd358d9dc7732f58f9e1626a29cc0c05c8c692419d9bb7","affectsGlobalScope":true,"impliedFormat":1},{"version":"b7bf9377723203b5a6a4b920164df22d56a43f593269ba6ae1fdc97774b68855","affectsGlobalScope":true,"impliedFormat":1},{"version":"db9709688f82c9e5f65a119c64d835f906efe5f559d08b11642d56eb85b79357","affectsGlobalScope":true,"impliedFormat":1},{"version":"4b25b8c874acd1a4cf8444c3617e037d444d19080ac9f634b405583fd10ce1f7","affectsGlobalScope":true,"impliedFormat":1},{"version":"37be57d7c90cf1f8112ee2636a068d8fd181289f82b744160ec56a7dc158a9f5","affectsGlobalScope":true,"impliedFormat":1},{"version":"a917a49ac94cd26b754ab84e113369a75d1a47a710661d7cd25e961cc797065f","affectsGlobalScope":true,"impliedFormat":1},{"version":"6d3261badeb7843d157ef3e6f5d1427d0eeb0af0cf9df84a62cfd29fd47ac86e","affectsGlobalScope":true,"impliedFormat":1},{"version":"195daca651dde22f2167ac0d0a05e215308119a3100f5e6268e8317d05a92526","affectsGlobalScope":true,"impliedFormat":1},{"version":"8b11e4285cd2bb164a4dc09248bdec69e9842517db4ca47c1ba913011e44ff2f","affectsGlobalScope":true,"impliedFormat":1},{"version":"0508571a52475e245b02bc50fa1394065a0a3d05277fbf5120c3784b85651799","affectsGlobalScope":true,"impliedFormat":1},{"version":"8f9af488f510c3015af3cc8c267a9e9d96c4dd38a1fdff0e11dc5a544711415b","affectsGlobalScope":true,"impliedFormat":1},{"version":"fc611fea8d30ea72c6bbfb599c9b4d393ce22e2f5bfef2172534781e7d138104","affectsGlobalScope":true,"impliedFormat":1},{"version":"1ce14b81c5cc821994aa8ec1d42b220dd41b27fcc06373bce3958af7421b77d4","affectsGlobalScope":true,"impliedFormat":1},{"version":"b3a048b3e9302ef9a34ef4ebb9aecfb28b66abb3bce577206a79fee559c230da","affectsGlobalScope":true,"impliedFormat":1},{"version":"e7a166dd666e0a49c81a93cc760150959e0f9be21ed399ed58cd63f19d43073f","signature":"4bff62a2276a6941b74661fd4df6e97c87c37f05a6032e7cb95b5a6e3211fbe6"},{"version":"d00ac3b8a8a8412963b53f7f8dfce652540b91d791b348e813a7c354d2052869","signature":"098e7697c0d00511e603e929924a84fb8589cd481a8f59102c4fb945428ac3b6"},{"version":"adbe6e23f00e09f9d5e4f6ee78a8cc7609401e218e0f9af98b222c91ee3e26bc","signature":"07acfe71afd91e94d3a58a30a7df9f90ff541c7a1626bacd1d6ccfb5fc97f6e2"},{"version":"e9017484e513ed9af7c2e218231bce365275a9f26a931390990775d82b6f77f8","signature":"76deb9dd6c0719dbf6d49508e8ccffd153fdb8e6eafc0bb637600bab4af02cef"},{"version":"22eaceae421fa8e5b012975dec65cbb0b938598513134f855d98b6b4217c8f5c","signature":"17aab127db6601a814660d16947938580f7dc7de431972818c66654eaf1c2a2c"},{"version":"d60d230488e95a2ff9c8af8bdcd25786182b6ba2769a054815ac4ac21a1b5a0d","signature":"16485e1a09579df9823b686d45eb98f9fb0c54289ea9d6d263de3486906464a9"}],"root":[[60,65]],"options":{"composite":true,"declaration":true,"declarationMap":true,"esModuleInterop":true,"jsx":4,"module":99,"noUncheckedIndexedAccess":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","rootDir":"../src","skipLibCheck":true,"sourceMap":true,"strict":true,"target":9,"tsBuildInfoFile":"./.tsbuildinfo","useDefineForClassFields":true,"verbatimModuleSyntax":true},"referencedMap":[[65,1],[64,2]],"latestChangedDtsFile":"./index.d.ts","version":"6.0.3"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Headless open/close model shared by Disclosure, Dialog, Popover, Tooltip.
|
|
3
|
+
* Pure reducer — frameworks own the storage of `open`.
|
|
4
|
+
*/
|
|
5
|
+
export type DisclosureEvent = 'open' | 'close' | 'toggle';
|
|
6
|
+
export declare function disclosureReducer(open: boolean, event: DisclosureEvent): boolean;
|
|
7
|
+
export interface TriggerAria {
|
|
8
|
+
'aria-expanded': boolean;
|
|
9
|
+
'aria-controls': string;
|
|
10
|
+
}
|
|
11
|
+
/** ARIA props for a disclosure trigger button. */
|
|
12
|
+
export declare function getTriggerAria(open: boolean, contentId: string): TriggerAria;
|
|
13
|
+
//# sourceMappingURL=disclosure.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"disclosure.d.ts","sourceRoot":"","sources":["../src/disclosure.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;AAE1D,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,eAAe,GAAG,OAAO,CAWhF;AAED,MAAM,WAAW,WAAW;IAC1B,eAAe,EAAE,OAAO,CAAC;IACzB,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,kDAAkD;AAClD,wBAAgB,cAAc,CAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,WAAW,CAE5E"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export function disclosureReducer(open, event) {
|
|
2
|
+
switch (event) {
|
|
3
|
+
case 'open':
|
|
4
|
+
return true;
|
|
5
|
+
case 'close':
|
|
6
|
+
return false;
|
|
7
|
+
case 'toggle':
|
|
8
|
+
return !open;
|
|
9
|
+
default:
|
|
10
|
+
return open;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
/** ARIA props for a disclosure trigger button. */
|
|
14
|
+
export function getTriggerAria(open, contentId) {
|
|
15
|
+
return { 'aria-expanded': open, 'aria-controls': contentId };
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=disclosure.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"disclosure.js","sourceRoot":"","sources":["../src/disclosure.ts"],"names":[],"mappings":"AAMA,MAAM,UAAU,iBAAiB,CAAC,IAAa,EAAE,KAAsB;IACrE,QAAQ,KAAK,EAAE,CAAC;QACd,KAAK,MAAM;YACT,OAAO,IAAI,CAAC;QACd,KAAK,OAAO;YACV,OAAO,KAAK,CAAC;QACf,KAAK,QAAQ;YACX,OAAO,CAAC,IAAI,CAAC;QACf;YACE,OAAO,IAAI,CAAC;IAChB,CAAC;AACH,CAAC;AAOD,kDAAkD;AAClD,MAAM,UAAU,cAAc,CAAC,IAAa,EAAE,SAAiB;IAC7D,OAAO,EAAE,eAAe,EAAE,IAAI,EAAE,eAAe,EAAE,SAAS,EAAE,CAAC;AAC/D,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const FOCUSABLE_SELECTOR = "a[href],button:not([disabled]),textarea:not([disabled]),input:not([disabled]),select:not([disabled]),[tabindex]:not([tabindex=\"-1\"])";
|
|
2
|
+
/** All tabbable descendants of `root`, in DOM order. */
|
|
3
|
+
export declare function getFocusable(root: HTMLElement): HTMLElement[];
|
|
4
|
+
export interface FocusTrap {
|
|
5
|
+
/** Focus the first focusable element (or the container) and start trapping. */
|
|
6
|
+
activate(): void;
|
|
7
|
+
/** Stop trapping and restore focus to the previously focused element. */
|
|
8
|
+
deactivate(): void;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Framework-agnostic focus trap for dialog-like surfaces. Keeps Tab/Shift+Tab
|
|
12
|
+
* focus cycling inside `root` and restores focus on deactivate. React and Vue
|
|
13
|
+
* wrap this in their respective lifecycles.
|
|
14
|
+
*/
|
|
15
|
+
export declare function createFocusTrap(root: HTMLElement): FocusTrap;
|
|
16
|
+
//# sourceMappingURL=focusTrap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"focusTrap.d.ts","sourceRoot":"","sources":["../src/focusTrap.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,2IACyG,CAAC;AAEzI,wDAAwD;AACxD,wBAAgB,YAAY,CAAC,IAAI,EAAE,WAAW,GAAG,WAAW,EAAE,CAE7D;AAED,MAAM,WAAW,SAAS;IACxB,+EAA+E;IAC/E,QAAQ,IAAI,IAAI,CAAC;IACjB,yEAAyE;IACzE,UAAU,IAAI,IAAI,CAAC;CACpB;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,WAAW,GAAG,SAAS,CAkC5D"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export const FOCUSABLE_SELECTOR = 'a[href],button:not([disabled]),textarea:not([disabled]),input:not([disabled]),select:not([disabled]),[tabindex]:not([tabindex="-1"])';
|
|
2
|
+
/** All tabbable descendants of `root`, in DOM order. */
|
|
3
|
+
export function getFocusable(root) {
|
|
4
|
+
return Array.from(root.querySelectorAll(FOCUSABLE_SELECTOR));
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Framework-agnostic focus trap for dialog-like surfaces. Keeps Tab/Shift+Tab
|
|
8
|
+
* focus cycling inside `root` and restores focus on deactivate. React and Vue
|
|
9
|
+
* wrap this in their respective lifecycles.
|
|
10
|
+
*/
|
|
11
|
+
export function createFocusTrap(root) {
|
|
12
|
+
let previouslyFocused = null;
|
|
13
|
+
const onKeyDown = (e) => {
|
|
14
|
+
if (e.key !== 'Tab')
|
|
15
|
+
return;
|
|
16
|
+
const items = getFocusable(root);
|
|
17
|
+
if (items.length === 0) {
|
|
18
|
+
e.preventDefault();
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
const first = items[0];
|
|
22
|
+
const last = items[items.length - 1];
|
|
23
|
+
const active = root.getRootNode().activeElement;
|
|
24
|
+
if (e.shiftKey && active === first) {
|
|
25
|
+
e.preventDefault();
|
|
26
|
+
last.focus();
|
|
27
|
+
}
|
|
28
|
+
else if (!e.shiftKey && active === last) {
|
|
29
|
+
e.preventDefault();
|
|
30
|
+
first.focus();
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
return {
|
|
34
|
+
activate() {
|
|
35
|
+
previouslyFocused = document.activeElement;
|
|
36
|
+
const [first] = getFocusable(root);
|
|
37
|
+
(first ?? root).focus();
|
|
38
|
+
root.addEventListener('keydown', onKeyDown);
|
|
39
|
+
},
|
|
40
|
+
deactivate() {
|
|
41
|
+
root.removeEventListener('keydown', onKeyDown);
|
|
42
|
+
previouslyFocused?.focus?.();
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=focusTrap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"focusTrap.js","sourceRoot":"","sources":["../src/focusTrap.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,kBAAkB,GAC7B,sIAAsI,CAAC;AAEzI,wDAAwD;AACxD,MAAM,UAAU,YAAY,CAAC,IAAiB;IAC5C,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAc,kBAAkB,CAAC,CAAC,CAAC;AAC5E,CAAC;AASD;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,IAAiB;IAC/C,IAAI,iBAAiB,GAAuB,IAAI,CAAC;IAEjD,MAAM,SAAS,GAAG,CAAC,CAAgB,EAAQ,EAAE;QAC3C,IAAI,CAAC,CAAC,GAAG,KAAK,KAAK;YAAE,OAAO;QAC5B,MAAM,KAAK,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;QACjC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACvB,CAAC,CAAC,cAAc,EAAE,CAAC;YACnB,OAAO;QACT,CAAC;QACD,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAE,CAAC;QACxB,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAE,CAAC;QACtC,MAAM,MAAM,GAAI,IAAI,CAAC,WAAW,EAA4B,CAAC,aAAa,CAAC;QAC3E,IAAI,CAAC,CAAC,QAAQ,IAAI,MAAM,KAAK,KAAK,EAAE,CAAC;YACnC,CAAC,CAAC,cAAc,EAAE,CAAC;YACnB,IAAI,CAAC,KAAK,EAAE,CAAC;QACf,CAAC;aAAM,IAAI,CAAC,CAAC,CAAC,QAAQ,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;YAC1C,CAAC,CAAC,cAAc,EAAE,CAAC;YACnB,KAAK,CAAC,KAAK,EAAE,CAAC;QAChB,CAAC;IACH,CAAC,CAAC;IAEF,OAAO;QACL,QAAQ;YACN,iBAAiB,GAAG,QAAQ,CAAC,aAAmC,CAAC;YACjE,MAAM,CAAC,KAAK,CAAC,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;YACnC,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,KAAK,EAAE,CAAC;YACxB,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;QAC9C,CAAC;QACD,UAAU;YACR,IAAI,CAAC,mBAAmB,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;YAC/C,iBAAiB,EAAE,KAAK,EAAE,EAAE,CAAC;QAC/B,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/dist/id.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deterministic-per-runtime id generator for wiring `aria-*` relationships in
|
|
3
|
+
* environments without `useId` (e.g. Vue, plain DOM). Prefer a framework's
|
|
4
|
+
* native id hook when available.
|
|
5
|
+
*/
|
|
6
|
+
export declare function createId(prefix?: string): string;
|
|
7
|
+
/** Reset the counter — test-only helper for deterministic snapshots. */
|
|
8
|
+
export declare function resetIdCounter(): void;
|
|
9
|
+
//# sourceMappingURL=id.d.ts.map
|
package/dist/id.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"id.d.ts","sourceRoot":"","sources":["../src/id.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,MAAM,SAAO,GAAG,MAAM,CAG9C;AAED,wEAAwE;AACxE,wBAAgB,cAAc,IAAI,IAAI,CAErC"}
|
package/dist/id.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
let counter = 0;
|
|
2
|
+
/**
|
|
3
|
+
* Deterministic-per-runtime id generator for wiring `aria-*` relationships in
|
|
4
|
+
* environments without `useId` (e.g. Vue, plain DOM). Prefer a framework's
|
|
5
|
+
* native id hook when available.
|
|
6
|
+
*/
|
|
7
|
+
export function createId(prefix = 'ik') {
|
|
8
|
+
counter += 1;
|
|
9
|
+
return `${prefix}-${counter}`;
|
|
10
|
+
}
|
|
11
|
+
/** Reset the counter — test-only helper for deterministic snapshots. */
|
|
12
|
+
export function resetIdCounter() {
|
|
13
|
+
counter = 0;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=id.js.map
|
package/dist/id.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"id.js","sourceRoot":"","sources":["../src/id.ts"],"names":[],"mappings":"AAAA,IAAI,OAAO,GAAG,CAAC,CAAC;AAEhB;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAAC,MAAM,GAAG,IAAI;IACpC,OAAO,IAAI,CAAC,CAAC;IACb,OAAO,GAAG,MAAM,IAAI,OAAO,EAAE,CAAC;AAChC,CAAC;AAED,wEAAwE;AACxE,MAAM,UAAU,cAAc;IAC5B,OAAO,GAAG,CAAC,CAAC;AACd,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { createId, resetIdCounter } from './id.js';
|
|
2
|
+
export { Keys, isActivationKey, type Key } from './keyboard.js';
|
|
3
|
+
export { createTabsIds, firstEnabledValue, getNextTabValue, type Orientation, type TabsItemLike, type TabsIds, } from './tabs.js';
|
|
4
|
+
export { disclosureReducer, getTriggerAria, type DisclosureEvent, type TriggerAria, } from './disclosure.js';
|
|
5
|
+
export { FOCUSABLE_SELECTOR, getFocusable, createFocusTrap, type FocusTrap } from './focusTrap.js';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,KAAK,GAAG,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,OAAO,GACb,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,KAAK,eAAe,EACpB,KAAK,WAAW,GACjB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,eAAe,EAAE,KAAK,SAAS,EAAE,MAAM,gBAAgB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { createId, resetIdCounter } from './id.js';
|
|
2
|
+
export { Keys, isActivationKey } from './keyboard.js';
|
|
3
|
+
export { createTabsIds, firstEnabledValue, getNextTabValue, } from './tabs.js';
|
|
4
|
+
export { disclosureReducer, getTriggerAria, } from './disclosure.js';
|
|
5
|
+
export { FOCUSABLE_SELECTOR, getFocusable, createFocusTrap } from './focusTrap.js';
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,eAAe,EAAY,MAAM,eAAe,CAAC;AAChE,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,eAAe,GAIhB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,iBAAiB,EACjB,cAAc,GAGf,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,eAAe,EAAkB,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** Canonical `KeyboardEvent.key` values used across the design system. */
|
|
2
|
+
export declare const Keys: {
|
|
3
|
+
readonly Enter: "Enter";
|
|
4
|
+
readonly Space: " ";
|
|
5
|
+
readonly Escape: "Escape";
|
|
6
|
+
readonly Tab: "Tab";
|
|
7
|
+
readonly ArrowUp: "ArrowUp";
|
|
8
|
+
readonly ArrowDown: "ArrowDown";
|
|
9
|
+
readonly ArrowLeft: "ArrowLeft";
|
|
10
|
+
readonly ArrowRight: "ArrowRight";
|
|
11
|
+
readonly Home: "Home";
|
|
12
|
+
readonly End: "End";
|
|
13
|
+
};
|
|
14
|
+
export type Key = (typeof Keys)[keyof typeof Keys];
|
|
15
|
+
/** True for keys that should activate a button/option (Enter or Space). */
|
|
16
|
+
export declare function isActivationKey(key: string): boolean;
|
|
17
|
+
//# sourceMappingURL=keyboard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keyboard.d.ts","sourceRoot":"","sources":["../src/keyboard.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,eAAO,MAAM,IAAI;;;;;;;;;;;CAWP,CAAC;AAEX,MAAM,MAAM,GAAG,GAAG,CAAC,OAAO,IAAI,CAAC,CAAC,MAAM,OAAO,IAAI,CAAC,CAAC;AAEnD,2EAA2E;AAC3E,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAEpD"}
|
package/dist/keyboard.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** Canonical `KeyboardEvent.key` values used across the design system. */
|
|
2
|
+
export const Keys = {
|
|
3
|
+
Enter: 'Enter',
|
|
4
|
+
Space: ' ',
|
|
5
|
+
Escape: 'Escape',
|
|
6
|
+
Tab: 'Tab',
|
|
7
|
+
ArrowUp: 'ArrowUp',
|
|
8
|
+
ArrowDown: 'ArrowDown',
|
|
9
|
+
ArrowLeft: 'ArrowLeft',
|
|
10
|
+
ArrowRight: 'ArrowRight',
|
|
11
|
+
Home: 'Home',
|
|
12
|
+
End: 'End',
|
|
13
|
+
};
|
|
14
|
+
/** True for keys that should activate a button/option (Enter or Space). */
|
|
15
|
+
export function isActivationKey(key) {
|
|
16
|
+
return key === Keys.Enter || key === Keys.Space;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=keyboard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keyboard.js","sourceRoot":"","sources":["../src/keyboard.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,MAAM,CAAC,MAAM,IAAI,GAAG;IAClB,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,GAAG;IACV,MAAM,EAAE,QAAQ;IAChB,GAAG,EAAE,KAAK;IACV,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,WAAW;IACtB,SAAS,EAAE,WAAW;IACtB,UAAU,EAAE,YAAY;IACxB,IAAI,EAAE,MAAM;IACZ,GAAG,EAAE,KAAK;CACF,CAAC;AAIX,2EAA2E;AAC3E,MAAM,UAAU,eAAe,CAAC,GAAW;IACzC,OAAO,GAAG,KAAK,IAAI,CAAC,KAAK,IAAI,GAAG,KAAK,IAAI,CAAC,KAAK,CAAC;AAClD,CAAC"}
|
package/dist/tabs.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export type Orientation = 'horizontal' | 'vertical';
|
|
2
|
+
export interface TabsItemLike {
|
|
3
|
+
value: string;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface TabsIds {
|
|
7
|
+
tab: (value: string) => string;
|
|
8
|
+
panel: (value: string) => string;
|
|
9
|
+
}
|
|
10
|
+
/** Build stable tab/panel id helpers from a base id (for `aria-controls`/`aria-labelledby`). */
|
|
11
|
+
export declare function createTabsIds(baseId: string): TabsIds;
|
|
12
|
+
/** First non-disabled value — the sensible default selection. */
|
|
13
|
+
export declare function firstEnabledValue(items: TabsItemLike[]): string | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* Pure roving-tabindex resolver for the Tabs pattern. Given the currently
|
|
16
|
+
* focused value and a key, returns the value that should receive focus next,
|
|
17
|
+
* or `undefined` if the key is not a navigation key. Disabled tabs are skipped
|
|
18
|
+
* and navigation wraps around.
|
|
19
|
+
*/
|
|
20
|
+
export declare function getNextTabValue(items: TabsItemLike[], currentValue: string, key: string, orientation?: Orientation): string | undefined;
|
|
21
|
+
//# sourceMappingURL=tabs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../src/tabs.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,WAAW,GAAG,YAAY,GAAG,UAAU,CAAC;AAEpD,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,OAAO;IACtB,GAAG,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IAC/B,KAAK,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;CAClC;AAED,gGAAgG;AAChG,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAKrD;AAED,iEAAiE;AACjE,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,MAAM,GAAG,SAAS,CAE3E;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,YAAY,EAAE,EACrB,YAAY,EAAE,MAAM,EACpB,GAAG,EAAE,MAAM,EACX,WAAW,GAAE,WAA0B,GACtC,MAAM,GAAG,SAAS,CAqBpB"}
|
package/dist/tabs.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Keys } from './keyboard.js';
|
|
2
|
+
/** Build stable tab/panel id helpers from a base id (for `aria-controls`/`aria-labelledby`). */
|
|
3
|
+
export function createTabsIds(baseId) {
|
|
4
|
+
return {
|
|
5
|
+
tab: (value) => `${baseId}-tab-${value}`,
|
|
6
|
+
panel: (value) => `${baseId}-panel-${value}`,
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
/** First non-disabled value — the sensible default selection. */
|
|
10
|
+
export function firstEnabledValue(items) {
|
|
11
|
+
return items.find((i) => !i.disabled)?.value;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Pure roving-tabindex resolver for the Tabs pattern. Given the currently
|
|
15
|
+
* focused value and a key, returns the value that should receive focus next,
|
|
16
|
+
* or `undefined` if the key is not a navigation key. Disabled tabs are skipped
|
|
17
|
+
* and navigation wraps around.
|
|
18
|
+
*/
|
|
19
|
+
export function getNextTabValue(items, currentValue, key, orientation = 'horizontal') {
|
|
20
|
+
const enabled = items.filter((i) => !i.disabled);
|
|
21
|
+
if (enabled.length === 0)
|
|
22
|
+
return undefined;
|
|
23
|
+
const nextKey = orientation === 'horizontal' ? Keys.ArrowRight : Keys.ArrowDown;
|
|
24
|
+
const prevKey = orientation === 'horizontal' ? Keys.ArrowLeft : Keys.ArrowUp;
|
|
25
|
+
const pos = enabled.findIndex((i) => i.value === currentValue);
|
|
26
|
+
const safePos = pos === -1 ? 0 : pos;
|
|
27
|
+
switch (key) {
|
|
28
|
+
case nextKey:
|
|
29
|
+
return enabled[(safePos + 1) % enabled.length].value;
|
|
30
|
+
case prevKey:
|
|
31
|
+
return enabled[(safePos - 1 + enabled.length) % enabled.length].value;
|
|
32
|
+
case Keys.Home:
|
|
33
|
+
return enabled[0].value;
|
|
34
|
+
case Keys.End:
|
|
35
|
+
return enabled[enabled.length - 1].value;
|
|
36
|
+
default:
|
|
37
|
+
return undefined;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=tabs.js.map
|
package/dist/tabs.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabs.js","sourceRoot":"","sources":["../src/tabs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAcrC,gGAAgG;AAChG,MAAM,UAAU,aAAa,CAAC,MAAc;IAC1C,OAAO;QACL,GAAG,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,MAAM,QAAQ,KAAK,EAAE;QACxC,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,MAAM,UAAU,KAAK,EAAE;KAC7C,CAAC;AACJ,CAAC;AAED,iEAAiE;AACjE,MAAM,UAAU,iBAAiB,CAAC,KAAqB;IACrD,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC;AAC/C,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAC7B,KAAqB,EACrB,YAAoB,EACpB,GAAW,EACX,cAA2B,YAAY;IAEvC,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;IACjD,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC;IAE3C,MAAM,OAAO,GAAG,WAAW,KAAK,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC;IAChF,MAAM,OAAO,GAAG,WAAW,KAAK,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC;IAC7E,MAAM,GAAG,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,YAAY,CAAC,CAAC;IAC/D,MAAM,OAAO,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;IAErC,QAAQ,GAAG,EAAE,CAAC;QACZ,KAAK,OAAO;YACV,OAAO,OAAO,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,CAAE,CAAC,KAAK,CAAC;QACxD,KAAK,OAAO;YACV,OAAO,OAAO,CAAC,CAAC,OAAO,GAAG,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,MAAM,CAAE,CAAC,KAAK,CAAC;QACzE,KAAK,IAAI,CAAC,IAAI;YACZ,OAAO,OAAO,CAAC,CAAC,CAAE,CAAC,KAAK,CAAC;QAC3B,KAAK,IAAI,CAAC,GAAG;YACX,OAAO,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAE,CAAC,KAAK,CAAC;QAC5C;YACE,OAAO,SAAS,CAAC;IACrB,CAAC;AACH,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@iskra-ui/core",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Искра.DCI headless core — framework-agnostic state machines, ARIA prop getters and keyboard helpers shared by the React and Vue packages.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"files": [
|
|
10
|
+
"dist"
|
|
11
|
+
],
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"import": "./dist/index.js"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"typescript": "^6.0.0",
|
|
20
|
+
"vitest": "^4.1.0",
|
|
21
|
+
"@iskra-ui/tsconfig": "0.1.0"
|
|
22
|
+
},
|
|
23
|
+
"publishConfig": {
|
|
24
|
+
"access": "public",
|
|
25
|
+
"provenance": true
|
|
26
|
+
},
|
|
27
|
+
"scripts": {
|
|
28
|
+
"build": "tsc -b tsconfig.json",
|
|
29
|
+
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
30
|
+
"test": "vitest run"
|
|
31
|
+
}
|
|
32
|
+
}
|