@vitus-labs/rocketstyle 0.55.0 → 0.57.0-alpha.2
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/lib/analysis/vitus-labs-rocketstyle.js.html +1 -1
- package/lib/analysis/vitus-labs-rocketstyle.module.js.html +1 -1
- package/lib/index.d.ts +49 -35
- package/lib/types/cache/LocalThemeManager.d.ts +12 -0
- package/lib/types/cache/index.d.ts +2 -0
- package/lib/types/constants/{reservedKeys.d.ts → index.d.ts} +1 -0
- package/lib/types/context/context.d.ts +17 -0
- package/lib/types/context/createLocalProvider.d.ts +6 -0
- package/lib/types/context/localContext.d.ts +13 -0
- package/lib/types/hoc/index.d.ts +2 -0
- package/lib/types/{internal → hoc}/rocketstyleAttrsHoc.d.ts +1 -1
- package/lib/types/hooks/index.d.ts +2 -2
- package/lib/types/hooks/usePseudoState.d.ts +1 -2
- package/lib/types/hooks/useRef.d.ts +7 -0
- package/lib/types/hooks/useTheme.d.ts +12 -9
- package/lib/types/index.d.ts +2 -2
- package/lib/types/init.d.ts +4 -4
- package/lib/types/isRocketComponent.d.ts +1 -2
- package/lib/types/rocketstyle.d.ts +3 -3
- package/lib/types/types/attrs.d.ts +2 -2
- package/lib/types/types/configuration.d.ts +5 -5
- package/lib/types/types/dimensions.d.ts +2 -2
- package/lib/types/types/pseudo.d.ts +7 -9
- package/lib/types/types/rocketComponent.d.ts +5 -0
- package/lib/types/types/rocketstyle.d.ts +21 -12
- package/lib/types/types/theme.d.ts +6 -3
- package/lib/types/types/utils.d.ts +7 -3
- package/lib/types/utils/attrs.d.ts +7 -3
- package/lib/types/utils/chaining.d.ts +9 -0
- package/lib/types/utils/collection.d.ts +0 -4
- package/lib/types/utils/compose.d.ts +3 -0
- package/lib/types/utils/dimensions.d.ts +5 -5
- package/lib/types/utils/statics.d.ts +13 -0
- package/lib/types/utils/styles.d.ts +2 -2
- package/lib/types/utils/theme.d.ts +16 -14
- package/lib/vitus-labs-rocketstyle.js +380 -324
- package/lib/vitus-labs-rocketstyle.js.map +1 -1
- package/lib/vitus-labs-rocketstyle.module.js +383 -327
- package/lib/vitus-labs-rocketstyle.module.js.map +1 -1
- package/package.json +12 -10
- package/lib/types/hooks/useThemeOptions.d.ts +0 -11
- package/lib/types/internal/createProvider.d.ts +0 -3
- package/lib/types/internal/index.d.ts +0 -4
- package/lib/types/internal/localContext.d.ts +0 -5
- package/lib/types/types/styleComponent.d.ts +0 -5
|
@@ -6424,7 +6424,7 @@ var drawChart = (function (exports) {
|
|
|
6424
6424
|
</script>
|
|
6425
6425
|
<script>
|
|
6426
6426
|
/*<!--*/
|
|
6427
|
-
const data = {"version":2,"tree":{"name":"root","children":[{"name":"vitus-labs-rocketstyle.js","children":[{"name":"src","children":[{"name":"
|
|
6427
|
+
const data = {"version":2,"tree":{"name":"root","children":[{"name":"vitus-labs-rocketstyle.js","children":[{"name":"src","children":[{"name":"constants","children":[{"uid":"ffbf-1","name":"index.ts"},{"uid":"ffbf-37","name":"defaultDimensions.ts"}]},{"name":"context","children":[{"uid":"ffbf-3","name":"localContext.tsx"},{"uid":"ffbf-13","name":"createLocalProvider.tsx"}]},{"name":"hooks","children":[{"uid":"ffbf-5","name":"usePseudoState.tsx"},{"uid":"ffbf-7","name":"useRef.ts"},{"uid":"ffbf-11","name":"useTheme.tsx"}]},{"uid":"ffbf-9","name":"context.tsx"},{"name":"cache/LocalThemeManager.ts","uid":"ffbf-15"},{"name":"utils","children":[{"uid":"ffbf-17","name":"attrs.ts"},{"uid":"ffbf-21","name":"statics.ts"},{"uid":"ffbf-23","name":"collection.ts"},{"uid":"ffbf-25","name":"dimensions.ts"},{"uid":"ffbf-27","name":"theme.ts"},{"uid":"ffbf-29","name":"chaining.ts"},{"uid":"ffbf-31","name":"compose.ts"},{"uid":"ffbf-33","name":"styles.ts"}]},{"name":"hoc/rocketstyleAttrsHoc.tsx","uid":"ffbf-19"},{"uid":"ffbf-35","name":"rocketstyle.tsx"},{"uid":"ffbf-39","name":"init.ts"},{"uid":"ffbf-41","name":"isRocketComponent.tsx"},{"uid":"ffbf-43","name":"index.ts"}]}]}],"isRoot":true},"nodeParts":{"ffbf-1":{"renderedLength":566,"gzipLength":296,"brotliLength":0,"mainUid":"ffbf-0"},"ffbf-3":{"renderedLength":300,"gzipLength":182,"brotliLength":0,"mainUid":"ffbf-2"},"ffbf-5":{"renderedLength":1875,"gzipLength":446,"brotliLength":0,"mainUid":"ffbf-4"},"ffbf-7":{"renderedLength":271,"gzipLength":150,"brotliLength":0,"mainUid":"ffbf-6"},"ffbf-9":{"renderedLength":464,"gzipLength":261,"brotliLength":0,"mainUid":"ffbf-8"},"ffbf-11":{"renderedLength":346,"gzipLength":213,"brotliLength":0,"mainUid":"ffbf-10"},"ffbf-13":{"renderedLength":824,"gzipLength":379,"brotliLength":0,"mainUid":"ffbf-12"},"ffbf-15":{"renderedLength":235,"gzipLength":120,"brotliLength":0,"mainUid":"ffbf-14"},"ffbf-17":{"renderedLength":2552,"gzipLength":893,"brotliLength":0,"mainUid":"ffbf-16"},"ffbf-19":{"renderedLength":1013,"gzipLength":440,"brotliLength":0,"mainUid":"ffbf-18"},"ffbf-21":{"renderedLength":459,"gzipLength":270,"brotliLength":0,"mainUid":"ffbf-20"},"ffbf-23":{"renderedLength":756,"gzipLength":316,"brotliLength":0,"mainUid":"ffbf-22"},"ffbf-25":{"renderedLength":1509,"gzipLength":542,"brotliLength":0,"mainUid":"ffbf-24"},"ffbf-27":{"renderedLength":2289,"gzipLength":752,"brotliLength":0,"mainUid":"ffbf-26"},"ffbf-29":{"renderedLength":564,"gzipLength":253,"brotliLength":0,"mainUid":"ffbf-28"},"ffbf-31":{"renderedLength":135,"gzipLength":129,"brotliLength":0,"mainUid":"ffbf-30"},"ffbf-33":{"renderedLength":187,"gzipLength":157,"brotliLength":0,"mainUid":"ffbf-32"},"ffbf-35":{"renderedLength":12209,"gzipLength":2736,"brotliLength":0,"mainUid":"ffbf-34"},"ffbf-37":{"renderedLength":178,"gzipLength":128,"brotliLength":0,"mainUid":"ffbf-36"},"ffbf-39":{"renderedLength":1553,"gzipLength":562,"brotliLength":0,"mainUid":"ffbf-38"},"ffbf-41":{"renderedLength":267,"gzipLength":184,"brotliLength":0,"mainUid":"ffbf-40"},"ffbf-43":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"mainUid":"ffbf-42"}},"nodeMetas":{"ffbf-0":{"id":"/src/constants/index.ts","moduleParts":{"vitus-labs-rocketstyle.js":"ffbf-1"},"imported":[],"importedBy":[{"uid":"ffbf-38"},{"uid":"ffbf-34"},{"uid":"ffbf-20"},{"uid":"ffbf-10"}]},"ffbf-2":{"id":"/src/context/localContext.tsx","moduleParts":{"vitus-labs-rocketstyle.js":"ffbf-3"},"imported":[{"uid":"ffbf-45"}],"importedBy":[{"uid":"ffbf-34"},{"uid":"ffbf-12"}]},"ffbf-4":{"id":"/src/hooks/usePseudoState.tsx","moduleParts":{"vitus-labs-rocketstyle.js":"ffbf-5"},"imported":[{"uid":"ffbf-45"}],"importedBy":[{"uid":"ffbf-48"}]},"ffbf-6":{"id":"/src/hooks/useRef.ts","moduleParts":{"vitus-labs-rocketstyle.js":"ffbf-7"},"imported":[{"uid":"ffbf-45"}],"importedBy":[{"uid":"ffbf-48"}]},"ffbf-8":{"id":"/src/context.tsx","moduleParts":{"vitus-labs-rocketstyle.js":"ffbf-9"},"imported":[{"uid":"ffbf-45"},{"uid":"ffbf-44"}],"importedBy":[{"uid":"ffbf-42"},{"uid":"ffbf-10"}]},"ffbf-10":{"id":"/src/hooks/useTheme.tsx","moduleParts":{"vitus-labs-rocketstyle.js":"ffbf-11"},"imported":[{"uid":"ffbf-45"},{"uid":"ffbf-8"},{"uid":"ffbf-0"}],"importedBy":[{"uid":"ffbf-48"}]},"ffbf-12":{"id":"/src/context/createLocalProvider.tsx","moduleParts":{"vitus-labs-rocketstyle.js":"ffbf-13"},"imported":[{"uid":"ffbf-45"},{"uid":"ffbf-48"},{"uid":"ffbf-2"}],"importedBy":[{"uid":"ffbf-34"}]},"ffbf-14":{"id":"/src/cache/LocalThemeManager.ts","moduleParts":{"vitus-labs-rocketstyle.js":"ffbf-15"},"imported":[],"importedBy":[{"uid":"ffbf-47"}]},"ffbf-16":{"id":"/src/utils/attrs.ts","moduleParts":{"vitus-labs-rocketstyle.js":"ffbf-17"},"imported":[{"uid":"ffbf-44"}],"importedBy":[{"uid":"ffbf-34"},{"uid":"ffbf-18"}]},"ffbf-18":{"id":"/src/hoc/rocketstyleAttrsHoc.tsx","moduleParts":{"vitus-labs-rocketstyle.js":"ffbf-19"},"imported":[{"uid":"ffbf-45"},{"uid":"ffbf-44"},{"uid":"ffbf-16"},{"uid":"ffbf-48"}],"importedBy":[{"uid":"ffbf-49"}]},"ffbf-20":{"id":"/src/utils/statics.ts","moduleParts":{"vitus-labs-rocketstyle.js":"ffbf-21"},"imported":[{"uid":"ffbf-44"},{"uid":"ffbf-0"}],"importedBy":[{"uid":"ffbf-34"}]},"ffbf-22":{"id":"/src/utils/collection.ts","moduleParts":{"vitus-labs-rocketstyle.js":"ffbf-23"},"imported":[],"importedBy":[{"uid":"ffbf-26"}]},"ffbf-24":{"id":"/src/utils/dimensions.ts","moduleParts":{"vitus-labs-rocketstyle.js":"ffbf-25"},"imported":[{"uid":"ffbf-44"}],"importedBy":[{"uid":"ffbf-38"},{"uid":"ffbf-34"},{"uid":"ffbf-26"}]},"ffbf-26":{"id":"/src/utils/theme.ts","moduleParts":{"vitus-labs-rocketstyle.js":"ffbf-27"},"imported":[{"uid":"ffbf-44"},{"uid":"ffbf-22"},{"uid":"ffbf-24"}],"importedBy":[{"uid":"ffbf-34"}]},"ffbf-28":{"id":"/src/utils/chaining.ts","moduleParts":{"vitus-labs-rocketstyle.js":"ffbf-29"},"imported":[],"importedBy":[{"uid":"ffbf-34"}]},"ffbf-30":{"id":"/src/utils/compose.ts","moduleParts":{"vitus-labs-rocketstyle.js":"ffbf-31"},"imported":[],"importedBy":[{"uid":"ffbf-34"}]},"ffbf-32":{"id":"/src/utils/styles.ts","moduleParts":{"vitus-labs-rocketstyle.js":"ffbf-33"},"imported":[{"uid":"ffbf-44"}],"importedBy":[{"uid":"ffbf-34"}]},"ffbf-34":{"id":"/src/rocketstyle.tsx","moduleParts":{"vitus-labs-rocketstyle.js":"ffbf-35"},"imported":[{"uid":"ffbf-45"},{"uid":"ffbf-46"},{"uid":"ffbf-44"},{"uid":"ffbf-0"},{"uid":"ffbf-2"},{"uid":"ffbf-12"},{"uid":"ffbf-47"},{"uid":"ffbf-48"},{"uid":"ffbf-49"},{"uid":"ffbf-20"},{"uid":"ffbf-26"},{"uid":"ffbf-28"},{"uid":"ffbf-30"},{"uid":"ffbf-32"},{"uid":"ffbf-24"},{"uid":"ffbf-16"}],"importedBy":[{"uid":"ffbf-38"}]},"ffbf-36":{"id":"/src/constants/defaultDimensions.ts","moduleParts":{"vitus-labs-rocketstyle.js":"ffbf-37"},"imported":[],"importedBy":[{"uid":"ffbf-38"}]},"ffbf-38":{"id":"/src/init.ts","moduleParts":{"vitus-labs-rocketstyle.js":"ffbf-39"},"imported":[{"uid":"ffbf-44"},{"uid":"ffbf-34"},{"uid":"ffbf-24"},{"uid":"ffbf-0"},{"uid":"ffbf-36"}],"importedBy":[{"uid":"ffbf-42"}]},"ffbf-40":{"id":"/src/isRocketComponent.tsx","moduleParts":{"vitus-labs-rocketstyle.js":"ffbf-41"},"imported":[],"importedBy":[{"uid":"ffbf-42"}]},"ffbf-42":{"id":"/src/index.ts","moduleParts":{"vitus-labs-rocketstyle.js":"ffbf-43"},"imported":[{"uid":"ffbf-38"},{"uid":"ffbf-8"},{"uid":"ffbf-40"}],"importedBy":[],"isEntry":true},"ffbf-44":{"id":"@vitus-labs/core","moduleParts":{},"imported":[],"importedBy":[{"uid":"ffbf-38"},{"uid":"ffbf-8"},{"uid":"ffbf-34"},{"uid":"ffbf-24"},{"uid":"ffbf-20"},{"uid":"ffbf-26"},{"uid":"ffbf-32"},{"uid":"ffbf-16"},{"uid":"ffbf-18"}],"isExternal":true},"ffbf-45":{"id":"react","moduleParts":{},"imported":[],"importedBy":[{"uid":"ffbf-8"},{"uid":"ffbf-34"},{"uid":"ffbf-2"},{"uid":"ffbf-12"},{"uid":"ffbf-4"},{"uid":"ffbf-6"},{"uid":"ffbf-10"},{"uid":"ffbf-18"}],"isExternal":true},"ffbf-46":{"id":"hoist-non-react-statics","moduleParts":{},"imported":[],"importedBy":[{"uid":"ffbf-34"}],"isExternal":true},"ffbf-47":{"id":"/src/cache/index.ts","moduleParts":{},"imported":[{"uid":"ffbf-14"}],"importedBy":[{"uid":"ffbf-34"}]},"ffbf-48":{"id":"/src/hooks/index.ts","moduleParts":{},"imported":[{"uid":"ffbf-4"},{"uid":"ffbf-6"},{"uid":"ffbf-10"}],"importedBy":[{"uid":"ffbf-34"},{"uid":"ffbf-12"},{"uid":"ffbf-18"}]},"ffbf-49":{"id":"/src/hoc/index.ts","moduleParts":{},"imported":[{"uid":"ffbf-18"}],"importedBy":[{"uid":"ffbf-34"}]}},"env":{"rollup":"2.72.0"},"options":{"gzip":true,"brotli":false,"sourcemap":false}};
|
|
6428
6428
|
|
|
6429
6429
|
const run = () => {
|
|
6430
6430
|
const width = window.innerWidth;
|
|
@@ -6424,7 +6424,7 @@ var drawChart = (function (exports) {
|
|
|
6424
6424
|
</script>
|
|
6425
6425
|
<script>
|
|
6426
6426
|
/*<!--*/
|
|
6427
|
-
const data = {"version":2,"tree":{"name":"root","children":[{"name":"vitus-labs-rocketstyle.module.js","children":[{"name":"src","children":[{"name":"
|
|
6427
|
+
const data = {"version":2,"tree":{"name":"root","children":[{"name":"vitus-labs-rocketstyle.module.js","children":[{"name":"src","children":[{"name":"constants","children":[{"uid":"ffbf-51","name":"index.ts"},{"uid":"ffbf-87","name":"defaultDimensions.ts"}]},{"name":"context","children":[{"uid":"ffbf-53","name":"localContext.tsx"},{"uid":"ffbf-63","name":"createLocalProvider.tsx"}]},{"name":"hooks","children":[{"uid":"ffbf-55","name":"usePseudoState.tsx"},{"uid":"ffbf-57","name":"useRef.ts"},{"uid":"ffbf-61","name":"useTheme.tsx"}]},{"uid":"ffbf-59","name":"context.tsx"},{"name":"cache/LocalThemeManager.ts","uid":"ffbf-65"},{"name":"utils","children":[{"uid":"ffbf-67","name":"attrs.ts"},{"uid":"ffbf-71","name":"statics.ts"},{"uid":"ffbf-73","name":"collection.ts"},{"uid":"ffbf-75","name":"dimensions.ts"},{"uid":"ffbf-77","name":"theme.ts"},{"uid":"ffbf-79","name":"chaining.ts"},{"uid":"ffbf-81","name":"compose.ts"},{"uid":"ffbf-83","name":"styles.ts"}]},{"name":"hoc/rocketstyleAttrsHoc.tsx","uid":"ffbf-69"},{"uid":"ffbf-85","name":"rocketstyle.tsx"},{"uid":"ffbf-89","name":"init.ts"},{"uid":"ffbf-91","name":"isRocketComponent.tsx"},{"uid":"ffbf-93","name":"index.ts"}]}]}],"isRoot":true},"nodeParts":{"ffbf-51":{"renderedLength":566,"gzipLength":296,"brotliLength":0,"mainUid":"ffbf-50"},"ffbf-53":{"renderedLength":288,"gzipLength":177,"brotliLength":0,"mainUid":"ffbf-52"},"ffbf-55":{"renderedLength":1821,"gzipLength":441,"brotliLength":0,"mainUid":"ffbf-54"},"ffbf-57":{"renderedLength":253,"gzipLength":146,"brotliLength":0,"mainUid":"ffbf-56"},"ffbf-59":{"renderedLength":432,"gzipLength":247,"brotliLength":0,"mainUid":"ffbf-58"},"ffbf-61":{"renderedLength":337,"gzipLength":210,"brotliLength":0,"mainUid":"ffbf-60"},"ffbf-63":{"renderedLength":772,"gzipLength":360,"brotliLength":0,"mainUid":"ffbf-62"},"ffbf-65":{"renderedLength":235,"gzipLength":120,"brotliLength":0,"mainUid":"ffbf-64"},"ffbf-67":{"renderedLength":2547,"gzipLength":889,"brotliLength":0,"mainUid":"ffbf-66"},"ffbf-69":{"renderedLength":974,"gzipLength":418,"brotliLength":0,"mainUid":"ffbf-68"},"ffbf-71":{"renderedLength":454,"gzipLength":266,"brotliLength":0,"mainUid":"ffbf-70"},"ffbf-73":{"renderedLength":756,"gzipLength":316,"brotliLength":0,"mainUid":"ffbf-72"},"ffbf-75":{"renderedLength":1494,"gzipLength":535,"brotliLength":0,"mainUid":"ffbf-74"},"ffbf-77":{"renderedLength":2259,"gzipLength":746,"brotliLength":0,"mainUid":"ffbf-76"},"ffbf-79":{"renderedLength":564,"gzipLength":253,"brotliLength":0,"mainUid":"ffbf-78"},"ffbf-81":{"renderedLength":135,"gzipLength":129,"brotliLength":0,"mainUid":"ffbf-80"},"ffbf-83":{"renderedLength":182,"gzipLength":154,"brotliLength":0,"mainUid":"ffbf-82"},"ffbf-85":{"renderedLength":12084,"gzipLength":2697,"brotliLength":0,"mainUid":"ffbf-84"},"ffbf-87":{"renderedLength":178,"gzipLength":128,"brotliLength":0,"mainUid":"ffbf-86"},"ffbf-89":{"renderedLength":1543,"gzipLength":559,"brotliLength":0,"mainUid":"ffbf-88"},"ffbf-91":{"renderedLength":267,"gzipLength":184,"brotliLength":0,"mainUid":"ffbf-90"},"ffbf-93":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"mainUid":"ffbf-92"}},"nodeMetas":{"ffbf-50":{"id":"/src/constants/index.ts","moduleParts":{"vitus-labs-rocketstyle.module.js":"ffbf-51"},"imported":[],"importedBy":[{"uid":"ffbf-88"},{"uid":"ffbf-84"},{"uid":"ffbf-70"},{"uid":"ffbf-60"}]},"ffbf-52":{"id":"/src/context/localContext.tsx","moduleParts":{"vitus-labs-rocketstyle.module.js":"ffbf-53"},"imported":[{"uid":"ffbf-95"}],"importedBy":[{"uid":"ffbf-84"},{"uid":"ffbf-62"}]},"ffbf-54":{"id":"/src/hooks/usePseudoState.tsx","moduleParts":{"vitus-labs-rocketstyle.module.js":"ffbf-55"},"imported":[{"uid":"ffbf-95"}],"importedBy":[{"uid":"ffbf-98"}]},"ffbf-56":{"id":"/src/hooks/useRef.ts","moduleParts":{"vitus-labs-rocketstyle.module.js":"ffbf-57"},"imported":[{"uid":"ffbf-95"}],"importedBy":[{"uid":"ffbf-98"}]},"ffbf-58":{"id":"/src/context.tsx","moduleParts":{"vitus-labs-rocketstyle.module.js":"ffbf-59"},"imported":[{"uid":"ffbf-95"},{"uid":"ffbf-94"}],"importedBy":[{"uid":"ffbf-92"},{"uid":"ffbf-60"}]},"ffbf-60":{"id":"/src/hooks/useTheme.tsx","moduleParts":{"vitus-labs-rocketstyle.module.js":"ffbf-61"},"imported":[{"uid":"ffbf-95"},{"uid":"ffbf-58"},{"uid":"ffbf-50"}],"importedBy":[{"uid":"ffbf-98"}]},"ffbf-62":{"id":"/src/context/createLocalProvider.tsx","moduleParts":{"vitus-labs-rocketstyle.module.js":"ffbf-63"},"imported":[{"uid":"ffbf-95"},{"uid":"ffbf-98"},{"uid":"ffbf-52"}],"importedBy":[{"uid":"ffbf-84"}]},"ffbf-64":{"id":"/src/cache/LocalThemeManager.ts","moduleParts":{"vitus-labs-rocketstyle.module.js":"ffbf-65"},"imported":[],"importedBy":[{"uid":"ffbf-97"}]},"ffbf-66":{"id":"/src/utils/attrs.ts","moduleParts":{"vitus-labs-rocketstyle.module.js":"ffbf-67"},"imported":[{"uid":"ffbf-94"}],"importedBy":[{"uid":"ffbf-84"},{"uid":"ffbf-68"}]},"ffbf-68":{"id":"/src/hoc/rocketstyleAttrsHoc.tsx","moduleParts":{"vitus-labs-rocketstyle.module.js":"ffbf-69"},"imported":[{"uid":"ffbf-95"},{"uid":"ffbf-94"},{"uid":"ffbf-66"},{"uid":"ffbf-98"}],"importedBy":[{"uid":"ffbf-99"}]},"ffbf-70":{"id":"/src/utils/statics.ts","moduleParts":{"vitus-labs-rocketstyle.module.js":"ffbf-71"},"imported":[{"uid":"ffbf-94"},{"uid":"ffbf-50"}],"importedBy":[{"uid":"ffbf-84"}]},"ffbf-72":{"id":"/src/utils/collection.ts","moduleParts":{"vitus-labs-rocketstyle.module.js":"ffbf-73"},"imported":[],"importedBy":[{"uid":"ffbf-76"}]},"ffbf-74":{"id":"/src/utils/dimensions.ts","moduleParts":{"vitus-labs-rocketstyle.module.js":"ffbf-75"},"imported":[{"uid":"ffbf-94"}],"importedBy":[{"uid":"ffbf-88"},{"uid":"ffbf-84"},{"uid":"ffbf-76"}]},"ffbf-76":{"id":"/src/utils/theme.ts","moduleParts":{"vitus-labs-rocketstyle.module.js":"ffbf-77"},"imported":[{"uid":"ffbf-94"},{"uid":"ffbf-72"},{"uid":"ffbf-74"}],"importedBy":[{"uid":"ffbf-84"}]},"ffbf-78":{"id":"/src/utils/chaining.ts","moduleParts":{"vitus-labs-rocketstyle.module.js":"ffbf-79"},"imported":[],"importedBy":[{"uid":"ffbf-84"}]},"ffbf-80":{"id":"/src/utils/compose.ts","moduleParts":{"vitus-labs-rocketstyle.module.js":"ffbf-81"},"imported":[],"importedBy":[{"uid":"ffbf-84"}]},"ffbf-82":{"id":"/src/utils/styles.ts","moduleParts":{"vitus-labs-rocketstyle.module.js":"ffbf-83"},"imported":[{"uid":"ffbf-94"}],"importedBy":[{"uid":"ffbf-84"}]},"ffbf-84":{"id":"/src/rocketstyle.tsx","moduleParts":{"vitus-labs-rocketstyle.module.js":"ffbf-85"},"imported":[{"uid":"ffbf-95"},{"uid":"ffbf-96"},{"uid":"ffbf-94"},{"uid":"ffbf-50"},{"uid":"ffbf-52"},{"uid":"ffbf-62"},{"uid":"ffbf-97"},{"uid":"ffbf-98"},{"uid":"ffbf-99"},{"uid":"ffbf-70"},{"uid":"ffbf-76"},{"uid":"ffbf-78"},{"uid":"ffbf-80"},{"uid":"ffbf-82"},{"uid":"ffbf-74"},{"uid":"ffbf-66"}],"importedBy":[{"uid":"ffbf-88"}]},"ffbf-86":{"id":"/src/constants/defaultDimensions.ts","moduleParts":{"vitus-labs-rocketstyle.module.js":"ffbf-87"},"imported":[],"importedBy":[{"uid":"ffbf-88"}]},"ffbf-88":{"id":"/src/init.ts","moduleParts":{"vitus-labs-rocketstyle.module.js":"ffbf-89"},"imported":[{"uid":"ffbf-94"},{"uid":"ffbf-84"},{"uid":"ffbf-74"},{"uid":"ffbf-50"},{"uid":"ffbf-86"}],"importedBy":[{"uid":"ffbf-92"}]},"ffbf-90":{"id":"/src/isRocketComponent.tsx","moduleParts":{"vitus-labs-rocketstyle.module.js":"ffbf-91"},"imported":[],"importedBy":[{"uid":"ffbf-92"}]},"ffbf-92":{"id":"/src/index.ts","moduleParts":{"vitus-labs-rocketstyle.module.js":"ffbf-93"},"imported":[{"uid":"ffbf-88"},{"uid":"ffbf-58"},{"uid":"ffbf-90"}],"importedBy":[],"isEntry":true},"ffbf-94":{"id":"@vitus-labs/core","moduleParts":{},"imported":[],"importedBy":[{"uid":"ffbf-88"},{"uid":"ffbf-58"},{"uid":"ffbf-84"},{"uid":"ffbf-74"},{"uid":"ffbf-70"},{"uid":"ffbf-76"},{"uid":"ffbf-82"},{"uid":"ffbf-66"},{"uid":"ffbf-68"}],"isExternal":true},"ffbf-95":{"id":"react","moduleParts":{},"imported":[],"importedBy":[{"uid":"ffbf-58"},{"uid":"ffbf-84"},{"uid":"ffbf-52"},{"uid":"ffbf-62"},{"uid":"ffbf-54"},{"uid":"ffbf-56"},{"uid":"ffbf-60"},{"uid":"ffbf-68"}],"isExternal":true},"ffbf-96":{"id":"hoist-non-react-statics","moduleParts":{},"imported":[],"importedBy":[{"uid":"ffbf-84"}],"isExternal":true},"ffbf-97":{"id":"/src/cache/index.ts","moduleParts":{},"imported":[{"uid":"ffbf-64"}],"importedBy":[{"uid":"ffbf-84"}]},"ffbf-98":{"id":"/src/hooks/index.ts","moduleParts":{},"imported":[{"uid":"ffbf-54"},{"uid":"ffbf-56"},{"uid":"ffbf-60"}],"importedBy":[{"uid":"ffbf-84"},{"uid":"ffbf-62"},{"uid":"ffbf-68"}]},"ffbf-99":{"id":"/src/hoc/index.ts","moduleParts":{},"imported":[{"uid":"ffbf-68"}],"importedBy":[{"uid":"ffbf-84"}]}},"env":{"rollup":"2.72.0"},"options":{"gzip":true,"brotli":false,"sourcemap":false}};
|
|
6428
6428
|
|
|
6429
6429
|
const run = () => {
|
|
6430
6430
|
const width = window.innerWidth;
|
package/lib/index.d.ts
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import { ComponentType, ForwardRefExoticComponent,
|
|
2
|
-
import { config,
|
|
1
|
+
import { ComponentType, ForwardRefExoticComponent, MouseEventHandler, FocusEventHandler, ForwardedRef, ReactElement, ReactNode, FC } from 'react';
|
|
2
|
+
import { config, render } from '@vitus-labs/core';
|
|
3
3
|
export { context } from '@vitus-labs/core';
|
|
4
4
|
|
|
5
5
|
declare type TObj = Record<string, unknown>;
|
|
6
6
|
declare type TFn = (...args: any) => any;
|
|
7
7
|
declare type CallBackParam = TObj | TFn;
|
|
8
|
-
declare type ElementType<T extends TObj | unknown = any> = ComponentType<T>
|
|
8
|
+
declare type ElementType<T extends TObj | unknown = any> = (ComponentType<T> & {
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
}) | (ForwardRefExoticComponent<T> & {
|
|
11
|
+
[key: string]: any;
|
|
12
|
+
});
|
|
9
13
|
declare type ValueOf<T> = T[keyof T];
|
|
10
14
|
declare type ArrayOfValues<T> = Array<T[keyof T]>;
|
|
11
15
|
declare type ArrayOfKeys<T> = Array<keyof T>;
|
|
@@ -55,8 +59,11 @@ interface ThemeDefault {
|
|
|
55
59
|
}
|
|
56
60
|
declare type Theme$1<T> = T extends unknown ? ThemeDefault : ThemeDefault & T;
|
|
57
61
|
declare type ThemeModeKeys = keyof typeof THEME_MODES;
|
|
58
|
-
|
|
59
|
-
|
|
62
|
+
interface ThemeModeCallback {
|
|
63
|
+
<A = any, B = any>(light: A, dark: B): (mode: 'light' | 'dark') => A | B;
|
|
64
|
+
isMode: true;
|
|
65
|
+
}
|
|
66
|
+
declare type ThemeCb<CSS, T> = (theme: T, mode: ThemeModeCallback, css: Css) => Partial<CSS>;
|
|
60
67
|
|
|
61
68
|
declare type ExtractNullableDimensionKeys<T> = {
|
|
62
69
|
[P in keyof T as T[P] extends false ? never : P]: T[P];
|
|
@@ -73,7 +80,7 @@ declare type Dimensions = Record<string, DimensionValue>;
|
|
|
73
80
|
declare type MultiKeys<T extends Dimensions = Dimensions> = Partial<Record<ExtractDimensionKey<T[keyof T]>, true>>;
|
|
74
81
|
declare type DimensionResult<CT> = Record<string, boolean | null | Partial<CT>>;
|
|
75
82
|
declare type DimensionObj<CT> = DimensionResult<CT>;
|
|
76
|
-
declare type DimensionCb<T, CT> = (theme: T, mode:
|
|
83
|
+
declare type DimensionCb<T, CT> = (theme: T, mode: ThemeModeCallback, css: Css) => DimensionResult<CT>;
|
|
77
84
|
declare type DimensionCallbackParam<T, CT> = DimensionObj<CT> | DimensionCb<T, CT>;
|
|
78
85
|
declare type TDKP = Record<ExtractDimensionKey<Dimensions[keyof Dimensions]>, Record<string, boolean | never | Record<string, boolean>> | unknown>;
|
|
79
86
|
declare type DimensionProps<K extends DimensionValue, D extends Dimensions, P extends CallBackParam, DKP extends TDKP> = {
|
|
@@ -89,15 +96,13 @@ declare type DimensionBooleanAttrs<DKP extends TDKP> = Partial<Record<ValueOf<Di
|
|
|
89
96
|
declare type ExtractDimensionProps<D extends Dimensions, DKP extends TDKP, UB extends boolean> = UB extends true ? Partial<ExtractNullableDimensionKeys<DimensionObjAttrs<D, DKP> & DimensionBooleanAttrs<DKP>>> : Partial<ExtractNullableDimensionKeys<DimensionObjAttrs<D, DKP>>>;
|
|
90
97
|
declare type ExtractDimensions<D extends Dimensions, DKP extends TDKP> = ExtractNullableDimensionKeys<DimensionObjAttrs<D, DKP>>;
|
|
91
98
|
|
|
92
|
-
declare type MouseAction = (event?: MouseEvent) => void;
|
|
93
|
-
declare type FocusAction = (event?: FocusEvent) => void;
|
|
94
99
|
declare type PseudoActions = {
|
|
95
|
-
onMouseEnter:
|
|
96
|
-
onMouseLeave:
|
|
97
|
-
onMouseDown:
|
|
98
|
-
onMouseUp:
|
|
99
|
-
onFocus:
|
|
100
|
-
onBlur:
|
|
100
|
+
onMouseEnter: MouseEventHandler;
|
|
101
|
+
onMouseLeave: MouseEventHandler;
|
|
102
|
+
onMouseDown: MouseEventHandler;
|
|
103
|
+
onMouseUp: MouseEventHandler;
|
|
104
|
+
onFocus: FocusEventHandler;
|
|
105
|
+
onBlur: FocusEventHandler;
|
|
101
106
|
};
|
|
102
107
|
declare type PseudoState = {
|
|
103
108
|
active: boolean;
|
|
@@ -140,9 +145,9 @@ declare type InitConfiguration<C, D> = {
|
|
|
140
145
|
dimensionValues: ArrayOfValues<D>;
|
|
141
146
|
multiKeys: MultiKeys;
|
|
142
147
|
};
|
|
143
|
-
declare type Configuration<C = ElementType, D extends Dimensions = Dimensions> = InitConfiguration<C, D> & {
|
|
148
|
+
declare type Configuration<C = ElementType | unknown, D extends Dimensions = Dimensions> = InitConfiguration<C, D> & {
|
|
144
149
|
provider?: boolean;
|
|
145
|
-
consumer?: ConsumerCb
|
|
150
|
+
consumer?: ConsumerCb<D>;
|
|
146
151
|
DEBUG?: boolean;
|
|
147
152
|
inversed?: boolean;
|
|
148
153
|
passProps?: Array<string>;
|
|
@@ -150,23 +155,32 @@ declare type Configuration<C = ElementType, D extends Dimensions = Dimensions> =
|
|
|
150
155
|
attrs: Array<OptionFunc>;
|
|
151
156
|
theme: Array<OptionFunc>;
|
|
152
157
|
styles: StylesCbArray;
|
|
153
|
-
compose: Record<string, TFn>;
|
|
158
|
+
compose: Record<string, TFn | null | undefined | false>;
|
|
154
159
|
statics: Record<string, any>;
|
|
155
|
-
} & Record<
|
|
160
|
+
} & Record<string, any>;
|
|
156
161
|
declare type DefaultProps = Partial<PseudoProps>;
|
|
157
162
|
|
|
158
163
|
declare type AttrsCb<A, T> = (props: Partial<A>, theme: T, helpers: {
|
|
159
164
|
mode?: ThemeModeKeys;
|
|
160
165
|
isDark?: boolean;
|
|
161
166
|
isLight?: boolean;
|
|
162
|
-
createElement: typeof
|
|
167
|
+
createElement: typeof render;
|
|
163
168
|
}) => Partial<A>;
|
|
164
169
|
|
|
165
170
|
declare type GenericHoc = (component: ElementType) => ElementType;
|
|
166
171
|
declare type ComposeParam = Record<string, GenericHoc | null | undefined | false>;
|
|
167
172
|
|
|
168
|
-
|
|
169
|
-
|
|
173
|
+
interface ExoticComponent<P = {}> {
|
|
174
|
+
(props: P & {
|
|
175
|
+
$rocketstyleRef?: ForwardedRef<unknown>;
|
|
176
|
+
}): ReactElement<P & {
|
|
177
|
+
$rocketstyleRef?: ForwardedRef<unknown>;
|
|
178
|
+
'data-rocketstyle': string;
|
|
179
|
+
}> | null;
|
|
180
|
+
readonly $$typeof: symbol;
|
|
181
|
+
}
|
|
182
|
+
declare type RocketStyleComponent<OA extends TObj = {}, EA extends TObj = {}, T extends TObj = {}, CSS extends TObj = {}, S extends TObj = {}, HOC extends TObj = {}, D extends Dimensions = Dimensions, UB extends boolean = boolean, DKP extends TDKP = TDKP> = IRocketStyleComponent<OA, EA, T, CSS, S, HOC, D, UB, DKP> & {
|
|
183
|
+
[I in keyof D]: <K extends DimensionValue = D[I], P extends DimensionCallbackParam<Theme$1<T>, Styles<CSS>> = DimensionCallbackParam<Theme$1<T>, Styles<CSS>>>(param: P) => P extends DimensionCallbackParam<Theme$1<T>, Styles<CSS>> ? RocketStyleComponent<OA, EA, T, CSS, S, HOC, D, UB, DimensionProps<K, D, P, DKP>> : RocketStyleComponent<OA, EA, T, CSS, S, HOC, D, UB, DKP>;
|
|
170
184
|
};
|
|
171
185
|
/**
|
|
172
186
|
* @param OA Origin component props params.
|
|
@@ -179,7 +193,7 @@ declare type RocketComponent<OA extends TObj = {}, EA extends TObj = {}, T exten
|
|
|
179
193
|
* @param DKP Dimensions key props.
|
|
180
194
|
* @param DFP Calculated final component props
|
|
181
195
|
*/
|
|
182
|
-
interface
|
|
196
|
+
interface IRocketStyleComponent<OA extends TObj = {}, EA extends TObj = {}, T extends TObj = {}, CSS extends TObj = {}, S extends TObj = {}, HOC extends TObj = {}, D extends Dimensions = Dimensions, UB extends boolean = boolean, DKP extends TDKP = TDKP, DFP = MergeTypes<[OA, EA, DefaultProps, ExtractDimensionProps<D, DKP, UB>]>> extends ExoticComponent<DFP> {
|
|
183
197
|
/**
|
|
184
198
|
* A chaining method to define default component theme
|
|
185
199
|
* @param param _object_
|
|
@@ -242,7 +256,7 @@ interface IRocketComponent<OA extends TObj = {}, EA extends TObj = {}, T extends
|
|
|
242
256
|
* })
|
|
243
257
|
* ```
|
|
244
258
|
*/
|
|
245
|
-
config: <NC extends ElementType | unknown = unknown>({ name, component: NC, provider, consumer, DEBUG, inversed, passProps, }: ConfigAttrs<NC, D, DKP, UB>) => NC extends ElementType ?
|
|
259
|
+
config: <NC extends ElementType | unknown = unknown>({ name, component: NC, provider, consumer, DEBUG, inversed, passProps, }: ConfigAttrs<NC, D, DKP, UB>) => NC extends ElementType ? RocketStyleComponent<ExtractProps<NC>, EA, T, CSS, S, HOC, D, UB, DKP> : RocketStyleComponent<OA, EA, T, CSS, S, HOC, D, UB, DKP>;
|
|
246
260
|
/**
|
|
247
261
|
* A chaining method to define default component props
|
|
248
262
|
* @param param Can be either _object_ or a _callback_
|
|
@@ -267,7 +281,7 @@ interface IRocketComponent<OA extends TObj = {}, EA extends TObj = {}, T extends
|
|
|
267
281
|
* }))
|
|
268
282
|
* ```
|
|
269
283
|
*/
|
|
270
|
-
attrs: <P extends TObj | unknown = unknown>(param: P extends TObj ? Partial<MergeTypes<[DFP, P]>> | AttrsCb<MergeTypes<[DFP, P]>, Theme$1<T>> : Partial<DFP> | AttrsCb<DFP, Theme$1<T>>) => P extends TObj ?
|
|
284
|
+
attrs: <P extends TObj | unknown = unknown>(param: P extends TObj ? Partial<MergeTypes<[DFP, P]>> | AttrsCb<MergeTypes<[DFP, P]>, Theme$1<T>> : Partial<DFP> | AttrsCb<DFP, Theme$1<T>>) => P extends TObj ? RocketStyleComponent<OA, MergeTypes<[EA, P]>, T, CSS, S, HOC, D, UB, DKP> : RocketStyleComponent<OA, EA, T, CSS, S, HOC, D, UB, DKP>;
|
|
271
285
|
/**
|
|
272
286
|
* A chaining method to define default component theme
|
|
273
287
|
* @param param Can be either _object_ or a _callback_
|
|
@@ -299,7 +313,7 @@ interface IRocketComponent<OA extends TObj = {}, EA extends TObj = {}, T extends
|
|
|
299
313
|
* }))
|
|
300
314
|
* ```
|
|
301
315
|
*/
|
|
302
|
-
theme: <P extends TObj | unknown = unknown>(param: P extends TObj ? Partial<MergeTypes<[Styles<CSS>, P]>> | ThemeCb<MergeTypes<[Styles<CSS>, P]>, Theme$1<T>> : Partial<Styles<CSS>> | ThemeCb<Styles<CSS>, Theme$1<T>>) => P extends TObj ?
|
|
316
|
+
theme: <P extends TObj | unknown = unknown>(param: P extends TObj ? Partial<MergeTypes<[Styles<CSS>, P]>> | ThemeCb<MergeTypes<[Styles<CSS>, P]>, Theme$1<T>> : Partial<Styles<CSS>> | ThemeCb<Styles<CSS>, Theme$1<T>>) => P extends TObj ? RocketStyleComponent<OA, EA, T, MergeTypes<[CSS, P]>, S, HOC, D, UB, DKP> : RocketStyleComponent<OA, EA, T, CSS, S, HOC, D, UB, DKP>;
|
|
303
317
|
/**
|
|
304
318
|
* A chaining method to define default rendered styles
|
|
305
319
|
* @param param Callback of styled-components `css` function
|
|
@@ -312,7 +326,7 @@ interface IRocketComponent<OA extends TObj = {}, EA extends TObj = {}, T extends
|
|
|
312
326
|
* const newElement = base.styles(css => css``)
|
|
313
327
|
* ```
|
|
314
328
|
*/
|
|
315
|
-
styles: (param: StylesCb) =>
|
|
329
|
+
styles: (param: StylesCb) => RocketStyleComponent<OA, EA, T, CSS, S, HOC, D, UB, DKP>;
|
|
316
330
|
/**
|
|
317
331
|
* A chaining method to define high-order components to wrap
|
|
318
332
|
* the defined component
|
|
@@ -344,7 +358,7 @@ interface IRocketComponent<OA extends TObj = {}, EA extends TObj = {}, T extends
|
|
|
344
358
|
* const newElement = base.compose({ hocName: undefined })
|
|
345
359
|
* ```
|
|
346
360
|
*/
|
|
347
|
-
compose: <P extends ComposeParam>(param: P) => P extends TObj ?
|
|
361
|
+
compose: <P extends ComposeParam>(param: P) => P extends TObj ? RocketStyleComponent<OA, EA, T, CSS, S, MergeTypes<[HOC, P]>, D, UB, DKP> : RocketStyleComponent<OA, EA, T, CSS, S, HOC, D, UB, DKP>;
|
|
348
362
|
/**
|
|
349
363
|
* A chaining method to define statics on the rocketstyle component.
|
|
350
364
|
* All statics are accessible via `is` static key on the component.
|
|
@@ -379,7 +393,7 @@ interface IRocketComponent<OA extends TObj = {}, EA extends TObj = {}, T extends
|
|
|
379
393
|
* const newElement = base.statics({ isNewStatic: undefined })
|
|
380
394
|
* ```
|
|
381
395
|
*/
|
|
382
|
-
statics: <P extends TObj>(param: P) => P extends TObj ?
|
|
396
|
+
statics: <P extends TObj>(param: P) => P extends TObj ? RocketStyleComponent<OA, EA, T, CSS, MergeTypes<[S, P]>, HOC, D, UB, DKP> : RocketStyleComponent<OA, EA, T, CSS, S, HOC, D, UB, DKP>;
|
|
383
397
|
/**
|
|
384
398
|
* An access to all defined statics on the component.
|
|
385
399
|
*
|
|
@@ -469,7 +483,7 @@ interface IRocketComponent<OA extends TObj = {}, EA extends TObj = {}, T extends
|
|
|
469
483
|
/**
|
|
470
484
|
* Static Rocketstyle component identificator
|
|
471
485
|
*/
|
|
472
|
-
|
|
486
|
+
IS_ROCKETSTYLE: true;
|
|
473
487
|
/**
|
|
474
488
|
* Component displayName defined in `.config()` chaining
|
|
475
489
|
* method
|
|
@@ -481,18 +495,18 @@ interface IRocketComponent<OA extends TObj = {}, EA extends TObj = {}, T extends
|
|
|
481
495
|
* })
|
|
482
496
|
* ```
|
|
483
497
|
*/
|
|
484
|
-
|
|
498
|
+
displayName: string;
|
|
485
499
|
}
|
|
486
500
|
|
|
487
|
-
declare type
|
|
501
|
+
declare type RocketComponent<C extends ElementType = ElementType, T extends TObj = {}, CSS extends TObj = {}, D extends Dimensions = DefaultDimensions, UB extends boolean = boolean> = (props: Configuration<C, D>) => RocketStyleComponent<ExtractProps<C>, {}, T, CSS, {}, {}, D, UB, {}>;
|
|
488
502
|
|
|
489
|
-
declare type Rocketstyle = <
|
|
503
|
+
declare type Rocketstyle = <D extends Dimensions = DefaultDimensions, UB extends boolean = true>({ dimensions, useBooleans, }?: {
|
|
490
504
|
dimensions?: D;
|
|
491
505
|
useBooleans?: UB;
|
|
492
506
|
}) => <C extends ElementType>({ name, component, }: {
|
|
493
507
|
name: string;
|
|
494
508
|
component: C;
|
|
495
|
-
}) => ReturnType<
|
|
509
|
+
}) => ReturnType<RocketComponent<C, {}, {}, D, UB>>;
|
|
496
510
|
declare const rocketstyle: Rocketstyle;
|
|
497
511
|
|
|
498
512
|
declare type Theme = {
|
|
@@ -509,7 +523,7 @@ declare type TProvider = {
|
|
|
509
523
|
};
|
|
510
524
|
declare const Provider: FC<TProvider>;
|
|
511
525
|
|
|
512
|
-
declare type IsRocketComponent = <T>(component: T) =>
|
|
526
|
+
declare type IsRocketComponent = <T>(component: T) => boolean;
|
|
513
527
|
declare const isRocketComponent: IsRocketComponent;
|
|
514
528
|
|
|
515
|
-
export { AttrsCb, ComposeParam, ConfigAttrs, ConsumerCb, ConsumerCtxCBValue, ConsumerCtxCb, DefaultProps, DimensionCallbackParam, DimensionProps, DimensionValue, Dimensions, ElementType, ExtractDimensionProps, ExtractDimensions, ExtractProps, GenericHoc,
|
|
529
|
+
export { AttrsCb, ComposeParam, ConfigAttrs, ConsumerCb, ConsumerCtxCBValue, ConsumerCtxCb, DefaultProps, DimensionCallbackParam, DimensionProps, DimensionValue, Dimensions, ElementType, ExtractDimensionProps, ExtractDimensions, ExtractProps, GenericHoc, IRocketStyleComponent, IsRocketComponent, MergeTypes, Provider, RocketComponentType, RocketProviderState, RocketStyleComponent, Rocketstyle, StylesCb, StylesDefault, TDKP, TObj, TProvider, ThemeCb, ThemeDefault, ThemeModeKeys, rocketstyle as default, isRocketComponent };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export default class ThemeManager {
|
|
2
|
+
baseTheme: WeakMap<object, any>;
|
|
3
|
+
dimensionsThemes: WeakMap<object, any>;
|
|
4
|
+
modeBaseTheme: {
|
|
5
|
+
light: WeakMap<object, any>;
|
|
6
|
+
dark: WeakMap<object, any>;
|
|
7
|
+
};
|
|
8
|
+
modeDimensionTheme: {
|
|
9
|
+
light: WeakMap<object, any>;
|
|
10
|
+
dark: WeakMap<object, any>;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ReactNode, FC, ComponentType } from 'react';
|
|
2
|
+
import { context } from '@vitus-labs/core';
|
|
3
|
+
declare type Theme = {
|
|
4
|
+
rootSize: number;
|
|
5
|
+
breakpoints?: Record<string, number>;
|
|
6
|
+
__VITUS_LABS__?: never;
|
|
7
|
+
} & Record<string, unknown>;
|
|
8
|
+
export declare type TProvider = {
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
theme?: Theme;
|
|
11
|
+
mode?: 'light' | 'dark';
|
|
12
|
+
inversed?: boolean;
|
|
13
|
+
provider?: ComponentType<any>;
|
|
14
|
+
};
|
|
15
|
+
declare const Provider: FC<TProvider>;
|
|
16
|
+
export { context };
|
|
17
|
+
export default Provider;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ComponentType, ForwardRefExoticComponent } from 'react';
|
|
2
|
+
import type { PseudoProps } from "../types/pseudo";
|
|
3
|
+
declare type Props = PseudoProps & Record<string, any>;
|
|
4
|
+
declare type HOC = (WrappedComponent: ComponentType<Props>) => ForwardRefExoticComponent<Props>;
|
|
5
|
+
declare const RocketStyleProviderComponent: HOC;
|
|
6
|
+
export default RocketStyleProviderComponent;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { PseudoState } from "../types/pseudo";
|
|
2
|
+
declare type LocalContext = Partial<{
|
|
3
|
+
pseudo: PseudoState;
|
|
4
|
+
} & Record<string, string>>;
|
|
5
|
+
declare const context: import("react").Context<Partial<{
|
|
6
|
+
pseudo: PseudoState;
|
|
7
|
+
} & Record<string, string>>>;
|
|
8
|
+
declare type UseLocalContext = (context: any) => LocalContext;
|
|
9
|
+
export declare const useLocalContext: UseLocalContext;
|
|
10
|
+
export declare const LocalProvider: import("react").Provider<Partial<{
|
|
11
|
+
pseudo: PseudoState;
|
|
12
|
+
} & Record<string, string>>>;
|
|
13
|
+
export default context;
|
|
@@ -3,6 +3,6 @@ import type { OptionFunc } from "../types/configuration";
|
|
|
3
3
|
export declare type RocketStyleHOC = ({ inversed, attrs, }: {
|
|
4
4
|
inversed?: boolean;
|
|
5
5
|
attrs?: Array<OptionFunc>;
|
|
6
|
-
}) => (WrappedComponent: ComponentType) => ForwardRefExoticComponent<any>;
|
|
6
|
+
}) => (WrappedComponent: ComponentType<any>) => ForwardRefExoticComponent<any>;
|
|
7
7
|
declare const rocketStyleHOC: RocketStyleHOC;
|
|
8
8
|
export default rocketStyleHOC;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import usePseudoState from './usePseudoState';
|
|
2
|
+
import useRef from './useRef';
|
|
2
3
|
import useTheme from './useTheme';
|
|
3
|
-
|
|
4
|
-
export { usePseudoState, useTheme, useThemeOptions };
|
|
4
|
+
export { usePseudoState, useRef, useTheme };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { PseudoActions, PseudoState } from "../types/pseudo";
|
|
2
|
-
declare type State = Omit<PseudoState, 'active'>;
|
|
3
2
|
declare type UsePseudoState = ({ onMouseEnter, onMouseLeave, onMouseDown, onMouseUp, onFocus, onBlur, }: Partial<PseudoActions>) => {
|
|
4
|
-
state:
|
|
3
|
+
state: Omit<PseudoState, 'active'>;
|
|
5
4
|
events: PseudoActions;
|
|
6
5
|
};
|
|
7
6
|
declare const usePseudoState: UsePseudoState;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ForwardedRef } from 'react';
|
|
2
|
+
declare type UseRocketstyleRef = (props: {
|
|
3
|
+
$rocketstyleRef?: ForwardedRef<unknown>;
|
|
4
|
+
ref?: ForwardedRef<unknown>;
|
|
5
|
+
}) => ForwardedRef<unknown>;
|
|
6
|
+
declare const useRocketstyleRef: UseRocketstyleRef;
|
|
7
|
+
export default useRocketstyleRef;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
declare
|
|
9
|
-
|
|
1
|
+
import { ThemeModeKeys } from "../types/theme";
|
|
2
|
+
declare type Context = {
|
|
3
|
+
theme: Record<string, unknown>;
|
|
4
|
+
mode: ThemeModeKeys;
|
|
5
|
+
isDark: boolean;
|
|
6
|
+
isLight: boolean;
|
|
7
|
+
};
|
|
8
|
+
declare type UseThemeAttrs = ({ inversed }: {
|
|
9
|
+
inversed?: boolean;
|
|
10
|
+
}) => Context;
|
|
11
|
+
declare const useThemeAttrs: UseThemeAttrs;
|
|
12
|
+
export default useThemeAttrs;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ import type { AttrsCb } from "./types/attrs";
|
|
|
9
9
|
import type { ThemeCb, ThemeModeKeys, ThemeDefault } from "./types/theme";
|
|
10
10
|
import type { GenericHoc, ComposeParam } from "./types/hoc";
|
|
11
11
|
import type { DefaultProps } from "./types/configuration";
|
|
12
|
-
import type {
|
|
13
|
-
export type { StylesDefault, ThemeDefault,
|
|
12
|
+
import type { RocketStyleComponent, IRocketStyleComponent } from "./types/rocketstyle";
|
|
13
|
+
export type { StylesDefault, ThemeDefault, RocketStyleComponent, IRocketStyleComponent, Rocketstyle, TProvider, RocketComponentType, RocketProviderState, ConsumerCtxCBValue, ConsumerCtxCb, ConsumerCb, TObj, ElementType, MergeTypes, ExtractProps, Dimensions, DimensionValue, DimensionCallbackParam, ExtractDimensionProps, TDKP, DimensionProps, ExtractDimensions, StylesCb, ConfigAttrs, AttrsCb, ThemeCb, ThemeModeKeys, GenericHoc, ComposeParam, DefaultProps, IsRocketComponent, };
|
|
14
14
|
export { context, Provider, isRocketComponent };
|
|
15
15
|
export default rocketstyle;
|
package/lib/types/init.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type { ElementType
|
|
1
|
+
import type { ElementType } from "./types/utils";
|
|
2
2
|
import type { Dimensions, DefaultDimensions } from "./types/dimensions";
|
|
3
|
-
import type {
|
|
4
|
-
export declare type Rocketstyle = <
|
|
3
|
+
import type { RocketComponent } from "./types/rocketComponent";
|
|
4
|
+
export declare type Rocketstyle = <D extends Dimensions = DefaultDimensions, UB extends boolean = true>({ dimensions, useBooleans, }?: {
|
|
5
5
|
dimensions?: D;
|
|
6
6
|
useBooleans?: UB;
|
|
7
7
|
}) => <C extends ElementType>({ name, component, }: {
|
|
8
8
|
name: string;
|
|
9
9
|
component: C;
|
|
10
|
-
}) => ReturnType<
|
|
10
|
+
}) => ReturnType<RocketComponent<C, {}, {}, D, UB>>;
|
|
11
11
|
declare const rocketstyle: Rocketstyle;
|
|
12
12
|
export default rocketstyle;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export declare type IsRocketComponent = <T>(component: T) => T extends RocketComponentType ? true : false;
|
|
1
|
+
export declare type IsRocketComponent = <T>(component: T) => boolean;
|
|
3
2
|
declare const isRocketComponent: IsRocketComponent;
|
|
4
3
|
export default isRocketComponent;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
declare const
|
|
3
|
-
export default
|
|
1
|
+
import type { RocketComponent } from "./types/rocketComponent";
|
|
2
|
+
declare const rocketComponent: RocketComponent;
|
|
3
|
+
export default rocketComponent;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { render } from '@vitus-labs/core';
|
|
2
2
|
import { ThemeModeKeys } from './theme';
|
|
3
3
|
export declare type AttrsCb<A, T> = (props: Partial<A>, theme: T, helpers: {
|
|
4
4
|
mode?: ThemeModeKeys;
|
|
5
5
|
isDark?: boolean;
|
|
6
6
|
isLight?: boolean;
|
|
7
|
-
createElement: typeof
|
|
7
|
+
createElement: typeof render;
|
|
8
8
|
}) => Partial<A>;
|