@fluentic/style 0.1.0-beta.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/CHANGELOG.md +32 -0
- package/LICENSE +21 -0
- package/README.md +409 -0
- package/atomic/atRule/counterStyle.ts +35 -0
- package/atomic/atRule/fontFace.ts +37 -0
- package/atomic/atRule/fontPaletteValues.ts +36 -0
- package/atomic/atRule/fontSrc.ts +13 -0
- package/atomic/atRule/keyframes.ts +43 -0
- package/atomic/atRule/positionTry.ts +73 -0
- package/atomic/atRule/property.ts +39 -0
- package/atomic/atRule/utils.ts +81 -0
- package/atomic/className.ts +93 -0
- package/atomic/debug/className/className.ts +33 -0
- package/atomic/debug/className/index.ts +1 -0
- package/atomic/debug/property/data.ts +59 -0
- package/atomic/debug/property/index.ts +1 -0
- package/atomic/debug/property/property.ts +59 -0
- package/atomic/debug/selector.ts +88 -0
- package/atomic/debug/value.ts +53 -0
- package/atomic/element.ts +29 -0
- package/atomic/layer/README.md +116 -0
- package/atomic/layer/index.ts +3 -0
- package/atomic/layer/layer.ts +95 -0
- package/atomic/layer/types.ts +37 -0
- package/atomic/layer/utils.ts +51 -0
- package/atomic/property/index.ts +2 -0
- package/atomic/property/presets.ts +34 -0
- package/atomic/property/property.ts +13 -0
- package/atomic/property/type_maps.ts +389 -0
- package/atomic/property/types.ts +7 -0
- package/atomic/rule.ts +116 -0
- package/atomic/theme.ts +48 -0
- package/atomic/token.ts +53 -0
- package/atomic/utils/css.ts +49 -0
- package/atomic/utils/debug.ts +37 -0
- package/atomic/utils/format.ts +192 -0
- package/atomic/utils/selector.ts +14 -0
- package/atomic/utils/types.ts +11 -0
- package/atomic/value/index.ts +2 -0
- package/atomic/value/unitless.ts +47 -0
- package/atomic/value/value.ts +17 -0
- package/atomic/var.ts +19 -0
- package/builder/data/check_selector.noop.ts +8 -0
- package/builder/data/check_selector.ts +30 -0
- package/builder/data/const.ts +25 -0
- package/builder/data/create.ts +96 -0
- package/builder/data/data.ts +63 -0
- package/builder/data/debug.ts +113 -0
- package/builder/data/index.ts +9 -0
- package/builder/data/is.ts +68 -0
- package/builder/data/merge/index.ts +2 -0
- package/builder/data/merge/scope.ts +300 -0
- package/builder/data/merge/style.ts +284 -0
- package/builder/data/merge/utils.ts +35 -0
- package/builder/data/selector.ts +11 -0
- package/builder/data/state.ts +134 -0
- package/builder/extract/index.ts +6 -0
- package/builder/extract/scope.ts +30 -0
- package/builder/extract/slot.ts +36 -0
- package/builder/extract/style.ts +89 -0
- package/builder/extract/theme.ts +16 -0
- package/builder/extract/token.ts +41 -0
- package/builder/extract/utils.ts +95 -0
- package/builder/extract/withTokens.ts +64 -0
- package/builder/index.ts +2 -0
- package/builder/style_builder.ts +234 -0
- package/builder/style_data.ts +81 -0
- package/builder/style_fns.ts +611 -0
- package/builder/types/alias.ts +83 -0
- package/builder/types/fns.ts +185 -0
- package/builder/types/index.ts +1 -0
- package/builder/types/types.ts +51 -0
- package/builder/utils.ts +19 -0
- package/compiler/compiler/cache.ts +155 -0
- package/compiler/compiler/compiler.ts +173 -0
- package/compiler/compiler/index.ts +3 -0
- package/compiler/compiler/types.ts +62 -0
- package/compiler/extract/collector.ts +25 -0
- package/compiler/extract/extract.ts +51 -0
- package/compiler/extract/index.ts +3 -0
- package/compiler/extract/types.ts +35 -0
- package/compiler/index.ts +2 -0
- package/compiler/transform/debug/index.ts +2 -0
- package/compiler/transform/debug/plugin.ts +1347 -0
- package/compiler/transform/debug/transform.ts +47 -0
- package/compiler/transform/debug/utils/debug_data.ts +187 -0
- package/compiler/transform/debug/utils/source_url.ts +29 -0
- package/compiler/transform/evaluator/evaluator.ts +1138 -0
- package/compiler/transform/evaluator/index.ts +3 -0
- package/compiler/transform/evaluator/tracer.ts +607 -0
- package/compiler/transform/evaluator/types.ts +22 -0
- package/compiler/transform/extract/chain/chain.ts +2343 -0
- package/compiler/transform/extract/chain/extract_chain.ts +89 -0
- package/compiler/transform/extract/chain/index.ts +3 -0
- package/compiler/transform/extract/chain/types.ts +37 -0
- package/compiler/transform/extract/index.ts +2 -0
- package/compiler/transform/extract/plugin.ts +665 -0
- package/compiler/transform/extract/transform.ts +45 -0
- package/compiler/transform/extract/utils/imports.ts +132 -0
- package/compiler/transform/extract/utils/replacement.ts +349 -0
- package/compiler/transform/extract/utils/slot.ts +186 -0
- package/compiler/transform/extract/utils/state.ts +48 -0
- package/compiler/transform/extract/utils/theme.ts +86 -0
- package/compiler/transform/extract/utils/token.ts +1 -0
- package/compiler/transform/index.ts +5 -0
- package/compiler/transform/syntax/index.ts +5 -0
- package/compiler/transform/syntax/isStaticStyleValue.ts +44 -0
- package/compiler/transform/syntax/isStyleChainCall.ts +16 -0
- package/compiler/transform/syntax/static_ids.ts +282 -0
- package/compiler/transform/syntax/types.ts +7 -0
- package/compiler/transform/syntax/utils.ts +31 -0
- package/compiler/transform/utils/babel.ts +100 -0
- package/compiler/transform/utils/import.ts +47 -0
- package/compiler/transform/utils/path.ts +13 -0
- package/compiler/transform/utils/selector.ts +252 -0
- package/compiler/utils/constants.ts +69 -0
- package/compiler/utils/file_resolver.ts +72 -0
- package/compiler/utils/import_source.ts +200 -0
- package/compiler/utils/imports.ts +24 -0
- package/compiler/utils/path.ts +40 -0
- package/compiler/utils/sourcemap.ts +61 -0
- package/config/build.ts +32 -0
- package/config/config/css.ts +32 -0
- package/config/config/css_extra.ts +22 -0
- package/config/config/debug.ts +26 -0
- package/config/config/dev.ts +145 -0
- package/config/config/runtime.ts +29 -0
- package/config/configure.ts +28 -0
- package/config/constants.ts +1 -0
- package/config/index.ts +2 -0
- package/config/types.ts +56 -0
- package/config/utils.ts +5 -0
- package/css/counterStyle.ts +20 -0
- package/css/fontFace.ts +25 -0
- package/css/fontPaletteValues.ts +20 -0
- package/css/index.ts +8 -0
- package/css/keyframes.ts +20 -0
- package/css/positionTry.ts +20 -0
- package/css/property.ts +32 -0
- package/css/utils.ts +56 -0
- package/dev/config.ts +16 -0
- package/dev/fns.ts +48 -0
- package/dev/index.ts +2 -0
- package/dev/trace.ts +413 -0
- package/dev/utils.ts +528 -0
- package/dist/assert-h_Zkqc4E.js +105 -0
- package/dist/assert-h_Zkqc4E.js.map +1 -0
- package/dist/className-C1Ht5Wvv.js +144 -0
- package/dist/className-C1Ht5Wvv.js.map +1 -0
- package/dist/className-DC2Cq8p3.js +251 -0
- package/dist/className-DC2Cq8p3.js.map +1 -0
- package/dist/compiler/index.mjs +2 -0
- package/dist/compiler-DweanHoB.mjs +6847 -0
- package/dist/compiler-DweanHoB.mjs.map +1 -0
- package/dist/config/index.js +3 -0
- package/dist/config-BryWDfQX.js +25 -0
- package/dist/config-BryWDfQX.js.map +1 -0
- package/dist/config-DKHXWhe1.js +1 -0
- package/dist/config-Di2VYYKV.js +6 -0
- package/dist/config-Di2VYYKV.js.map +1 -0
- package/dist/config-DloHOG6I.js +13 -0
- package/dist/config-DloHOG6I.js.map +1 -0
- package/dist/css-BowBszUt.js +243 -0
- package/dist/css-BowBszUt.js.map +1 -0
- package/dist/css-ByOrugEX.js +805 -0
- package/dist/css-ByOrugEX.js.map +1 -0
- package/dist/css-DcazYor9.js +235 -0
- package/dist/css-DcazYor9.js.map +1 -0
- package/dist/css.js +2 -0
- package/dist/css_extra-DlOnsnR1.js +8 -0
- package/dist/css_extra-DlOnsnR1.js.map +1 -0
- package/dist/css_extra-oIi3UEPK.js +8 -0
- package/dist/css_extra-oIi3UEPK.js.map +1 -0
- package/dist/data-_te7t0M4.js +473 -0
- package/dist/data-_te7t0M4.js.map +1 -0
- package/dist/debug-BAw63qX6.js +15 -0
- package/dist/debug-BAw63qX6.js.map +1 -0
- package/dist/debug-DGki_v7g.js +15 -0
- package/dist/debug-DGki_v7g.js.map +1 -0
- package/dist/debug-n2aZQBSa.js +172 -0
- package/dist/debug-n2aZQBSa.js.map +1 -0
- package/dist/dev/rsc.js +183 -0
- package/dist/dev/rsc.js.map +1 -0
- package/dist/dev-CcphAa3R.js +376 -0
- package/dist/dev-CcphAa3R.js.map +1 -0
- package/dist/dev-DfBbuLeE.js +71 -0
- package/dist/dev-DfBbuLeE.js.map +1 -0
- package/dist/dev.js +2 -0
- package/dist/elementMarker-Bu7gDAkE.js +800 -0
- package/dist/elementMarker-Bu7gDAkE.js.map +1 -0
- package/dist/entry/dev/css.js +3 -0
- package/dist/entry/dev/jsx-dev-runtime.js +3 -0
- package/dist/entry/dev/jsx-runtime.js +3 -0
- package/dist/entry/dev.js +10 -0
- package/dist/entry/prod/css.js +3 -0
- package/dist/entry/prod/extract.js +3 -0
- package/dist/entry/prod/jsx-dev-runtime.js +3 -0
- package/dist/entry/prod/jsx-runtime.js +3 -0
- package/dist/entry/prod/runtime.js +5 -0
- package/dist/entry/prod.js +1230 -0
- package/dist/entry/prod.js.map +1 -0
- package/dist/entry/rsc-dev/css.js +3 -0
- package/dist/entry/rsc-dev/dev.js +544 -0
- package/dist/entry/rsc-dev/dev.js.map +1 -0
- package/dist/entry/rsc-dev/jsx-dev-runtime.js +12 -0
- package/dist/entry/rsc-dev/jsx-dev-runtime.js.map +1 -0
- package/dist/entry/rsc-dev/jsx-runtime.js +3 -0
- package/dist/entry/rsc-dev.js +1429 -0
- package/dist/entry/rsc-dev.js.map +1 -0
- package/dist/entry/rsc-prod/css.js +3 -0
- package/dist/entry/rsc-prod/jsx-dev-runtime.js +3 -0
- package/dist/entry/rsc-prod/jsx-runtime.js +3 -0
- package/dist/entry/rsc-prod/runtime.js +5 -0
- package/dist/entry/rsc-prod.js +10 -0
- package/dist/extract-CzWJeQi8.js +121 -0
- package/dist/extract-CzWJeQi8.js.map +1 -0
- package/dist/extract-DEwSDJ9Z.js +2 -0
- package/dist/format-3nKBE_5t.js +144 -0
- package/dist/format-3nKBE_5t.js.map +1 -0
- package/dist/getClassName-BlvXHYuf.js +260 -0
- package/dist/getClassName-BlvXHYuf.js.map +1 -0
- package/dist/global-CvfmFLsK.js +11 -0
- package/dist/global-CvfmFLsK.js.map +1 -0
- package/dist/index.js +9 -0
- package/dist/jsx/jsx-dev-runtime.js +12 -0
- package/dist/jsx/jsx-dev-runtime.js.map +1 -0
- package/dist/jsx/jsx-dev-runtime.server.js +11 -0
- package/dist/jsx/jsx-dev-runtime.server.js.map +1 -0
- package/dist/jsx/jsx-runtime.js +13 -0
- package/dist/jsx/jsx-runtime.js.map +1 -0
- package/dist/jsx/jsx-runtime.server.js +12 -0
- package/dist/jsx/jsx-runtime.server.js.map +1 -0
- package/dist/jsx-CwTeyUxr.js +39 -0
- package/dist/jsx-CwTeyUxr.js.map +1 -0
- package/dist/jsx-D2BksHSv.js +38 -0
- package/dist/jsx-D2BksHSv.js.map +1 -0
- package/dist/jsx_dev_runtime-B6xs4by8.js +12 -0
- package/dist/jsx_dev_runtime-B6xs4by8.js.map +1 -0
- package/dist/jsx_runtime-04xfnsi7.js +13 -0
- package/dist/jsx_runtime-04xfnsi7.js.map +1 -0
- package/dist/jsx_runtime-iHLDwpcW.js +12 -0
- package/dist/jsx_runtime-iHLDwpcW.js.map +1 -0
- package/dist/layer-D1SaH07m.js +94 -0
- package/dist/layer-D1SaH07m.js.map +1 -0
- package/dist/loader-DS61nRqr.mjs +81 -0
- package/dist/loader-DS61nRqr.mjs.map +1 -0
- package/dist/misc-B9kqEb2N.mjs +360 -0
- package/dist/misc-B9kqEb2N.mjs.map +1 -0
- package/dist/plugin/farm/index.mjs +176 -0
- package/dist/plugin/farm/index.mjs.map +1 -0
- package/dist/plugin/nextjs/index.mjs +282 -0
- package/dist/plugin/nextjs/index.mjs.map +1 -0
- package/dist/plugin/nextjs/loader.mjs +162 -0
- package/dist/plugin/nextjs/loader.mjs.map +1 -0
- package/dist/plugin/parcel/index.cjs +9 -0
- package/dist/plugin/parcel/index.mjs +5 -0
- package/dist/plugin/parcel/optimizer.cjs +28 -0
- package/dist/plugin/parcel/optimizer.cjs.map +1 -0
- package/dist/plugin/parcel/optimizer.mjs +29 -0
- package/dist/plugin/parcel/optimizer.mjs.map +1 -0
- package/dist/plugin/parcel/resolver.cjs +17 -0
- package/dist/plugin/parcel/resolver.cjs.map +1 -0
- package/dist/plugin/parcel/resolver.mjs +18 -0
- package/dist/plugin/parcel/resolver.mjs.map +1 -0
- package/dist/plugin/parcel/runtime.cjs +17 -0
- package/dist/plugin/parcel/runtime.cjs.map +1 -0
- package/dist/plugin/parcel/runtime.mjs +17 -0
- package/dist/plugin/parcel/runtime.mjs.map +1 -0
- package/dist/plugin/parcel/transformer.cjs +41 -0
- package/dist/plugin/parcel/transformer.cjs.map +1 -0
- package/dist/plugin/parcel/transformer.mjs +41 -0
- package/dist/plugin/parcel/transformer.mjs.map +1 -0
- package/dist/plugin/rspack/index.mjs +11 -0
- package/dist/plugin/rspack/index.mjs.map +1 -0
- package/dist/plugin/vite/index.mjs +176 -0
- package/dist/plugin/vite/index.mjs.map +1 -0
- package/dist/plugin/webpack/index.mjs +2 -0
- package/dist/plugin/webpack/loader.mjs +19 -0
- package/dist/plugin/webpack/loader.mjs.map +1 -0
- package/dist/presets-Bye3ea2x.js +139 -0
- package/dist/presets-Bye3ea2x.js.map +1 -0
- package/dist/property-CnLFt5kx.js +406 -0
- package/dist/property-CnLFt5kx.js.map +1 -0
- package/dist/registry-CyIj8LYK.mjs +22 -0
- package/dist/registry-CyIj8LYK.mjs.map +1 -0
- package/dist/rules-9HSO1pxL.js +767 -0
- package/dist/rules-9HSO1pxL.js.map +1 -0
- package/dist/runtime-CYqNCiaM.js +53 -0
- package/dist/runtime-CYqNCiaM.js.map +1 -0
- package/dist/selector/index.js +3 -0
- package/dist/server.js +63 -0
- package/dist/server.js.map +1 -0
- package/dist/shared-BAL9peIw.cjs +7646 -0
- package/dist/shared-BAL9peIw.cjs.map +1 -0
- package/dist/shared-CCpq1zqA.mjs +132 -0
- package/dist/shared-CCpq1zqA.mjs.map +1 -0
- package/dist/sidecar-4u6GnlQG.mjs +236 -0
- package/dist/sidecar-4u6GnlQG.mjs.map +1 -0
- package/dist/style-4rFUy-zW.js +752 -0
- package/dist/style-4rFUy-zW.js.map +1 -0
- package/dist/style-B1UUqjj5.js +743 -0
- package/dist/style-B1UUqjj5.js.map +1 -0
- package/dist/style-Cw3NtvR0.js +5 -0
- package/dist/style-DNqQ6H-7.js +1255 -0
- package/dist/style-DNqQ6H-7.js.map +1 -0
- package/dist/styleStore-Dea_WVbr.js +2000 -0
- package/dist/styleStore-Dea_WVbr.js.map +1 -0
- package/dist/styleStore-DyNXBcUK.js +54 -0
- package/dist/styleStore-DyNXBcUK.js.map +1 -0
- package/dist/token-CKXUECuU.js +76 -0
- package/dist/token-CKXUECuU.js.map +1 -0
- package/dist/token-u_tM-mtg.js +204 -0
- package/dist/token-u_tM-mtg.js.map +1 -0
- package/dist/trace-Bu_qOqRy.js +245 -0
- package/dist/trace-Bu_qOqRy.js.map +1 -0
- package/dist/trace-CU0rvNYr.js +244 -0
- package/dist/trace-CU0rvNYr.js.map +1 -0
- package/dist/utils-BbehLOby.js +2415 -0
- package/dist/utils-BbehLOby.js.map +1 -0
- package/dist/utils-C7xfDxtM.mjs +97 -0
- package/dist/utils-C7xfDxtM.mjs.map +1 -0
- package/dist/utils-CWNHx4EC.js +170 -0
- package/dist/utils-CWNHx4EC.js.map +1 -0
- package/dist/utils-CdI6vZsP.js +37 -0
- package/dist/utils-CdI6vZsP.js.map +1 -0
- package/dist/utils-D7FAOyg6.js +129 -0
- package/dist/utils-D7FAOyg6.js.map +1 -0
- package/dist/utils-DMFgOOtA.mjs +49 -0
- package/dist/utils-DMFgOOtA.mjs.map +1 -0
- package/dist/utils.js +26 -0
- package/dist/utils.js.map +1 -0
- package/dist/value-BR4e2MKt.js +910 -0
- package/dist/value-BR4e2MKt.js.map +1 -0
- package/dist/value-E8rEv2Oe.js +136 -0
- package/dist/value-E8rEv2Oe.js.map +1 -0
- package/dist/valueRef-lshFk1Cs.js +16 -0
- package/dist/valueRef-lshFk1Cs.js.map +1 -0
- package/dist/webpack-CxS2FDYU.mjs +107 -0
- package/dist/webpack-CxS2FDYU.mjs.map +1 -0
- package/dist/withTokens-LRidu3Vc.js +95 -0
- package/dist/withTokens-LRidu3Vc.js.map +1 -0
- package/entry/dev/config.ts +2 -0
- package/entry/dev/css.ts +3 -0
- package/entry/dev/index.ts +3 -0
- package/entry/dev/jsx_dev_runtime.ts +3 -0
- package/entry/dev/jsx_runtime.ts +3 -0
- package/entry/prod/config.ts +2 -0
- package/entry/prod/css.ts +3 -0
- package/entry/prod/extract.ts +1 -0
- package/entry/prod/index.ts +3 -0
- package/entry/prod/jsx_dev_runtime.ts +3 -0
- package/entry/prod/jsx_runtime.ts +3 -0
- package/entry/prod/runtime.ts +14 -0
- package/entry/rsc_dev/config.ts +6 -0
- package/entry/rsc_dev/css.ts +3 -0
- package/entry/rsc_dev/dev.ts +5 -0
- package/entry/rsc_dev/index.ts +3 -0
- package/entry/rsc_dev/jsx_dev_runtime.ts +3 -0
- package/entry/rsc_dev/jsx_runtime.ts +3 -0
- package/entry/rsc_dev/server.ts +11 -0
- package/entry/rsc_prod/config.ts +6 -0
- package/entry/rsc_prod/css.ts +3 -0
- package/entry/rsc_prod/index.ts +3 -0
- package/entry/rsc_prod/jsx_dev_runtime.ts +3 -0
- package/entry/rsc_prod/jsx_runtime.ts +3 -0
- package/entry/rsc_prod/runtime.ts +12 -0
- package/entry/rsc_prod/server.ts +13 -0
- package/entry/shared/config.ts +5 -0
- package/entry/shared/dev.ts +19 -0
- package/entry/shared/prod.ts +4 -0
- package/index.ts +36 -0
- package/jsx/extracted/jsx_dev_runtime.ts +11 -0
- package/jsx/extracted/jsx_runtime.ts +12 -0
- package/jsx/rsc/jsx_dev_runtime.ts +11 -0
- package/jsx/rsc/jsx_runtime.ts +12 -0
- package/jsx/rsc_extracted/jsx_dev_runtime.ts +2 -0
- package/jsx/rsc_extracted/jsx_runtime.ts +2 -0
- package/jsx/runtime/jsx_dev_runtime.ts +11 -0
- package/jsx/runtime/jsx_runtime.ts +12 -0
- package/jsx/types.ts +8 -0
- package/jsx/utils.ts +59 -0
- package/package.json +298 -0
- package/plugin/bundler/farm/index.ts +1 -0
- package/plugin/bundler/farm/plugin.ts +320 -0
- package/plugin/bundler/parcel/config.json +19 -0
- package/plugin/bundler/parcel/index.ts +1 -0
- package/plugin/bundler/parcel/optimizer.ts +36 -0
- package/plugin/bundler/parcel/plugin.ts +4 -0
- package/plugin/bundler/parcel/resolver.ts +36 -0
- package/plugin/bundler/parcel/runtime.ts +23 -0
- package/plugin/bundler/parcel/shared.ts +234 -0
- package/plugin/bundler/parcel/transformer.ts +67 -0
- package/plugin/bundler/rspack/index.ts +1 -0
- package/plugin/bundler/rspack/plugin.ts +14 -0
- package/plugin/bundler/vite/index.ts +1 -0
- package/plugin/bundler/vite/plugin.ts +133 -0
- package/plugin/bundler/vite/state.ts +153 -0
- package/plugin/bundler/webpack/index.ts +1 -0
- package/plugin/bundler/webpack/loader.ts +19 -0
- package/plugin/bundler/webpack/plugin.ts +240 -0
- package/plugin/bundler/webpack/shared/index.ts +2 -0
- package/plugin/bundler/webpack/shared/loader.ts +155 -0
- package/plugin/bundler/webpack/shared/registry.ts +16 -0
- package/plugin/bundler/webpack/utils.ts +96 -0
- package/plugin/nextjs/constants.ts +7 -0
- package/plugin/nextjs/html.ts +62 -0
- package/plugin/nextjs/index.ts +2 -0
- package/plugin/nextjs/loader.ts +222 -0
- package/plugin/nextjs/plugin.ts +532 -0
- package/plugin/nextjs/types.ts +33 -0
- package/plugin/nextjs/utils.ts +210 -0
- package/plugin/utils/cache/css_cache.ts +146 -0
- package/plugin/utils/cache/file.ts +40 -0
- package/plugin/utils/cache/index.ts +2 -0
- package/plugin/utils/compiler.ts +94 -0
- package/plugin/utils/constants.ts +7 -0
- package/plugin/utils/cssMarker.ts +14 -0
- package/plugin/utils/cssOutput.ts +65 -0
- package/plugin/utils/filter.ts +98 -0
- package/plugin/utils/imports.ts +5 -0
- package/plugin/utils/index.ts +10 -0
- package/plugin/utils/injection.ts +28 -0
- package/plugin/utils/misc.ts +5 -0
- package/plugin/utils/runtimeEntry.ts +57 -0
- package/plugin/utils/sidecar/index.ts +1 -0
- package/plugin/utils/sidecar/server.ts +143 -0
- package/plugin/utils/sidecar/sidecar.ts +167 -0
- package/plugin/utils/sidecar/utils.ts +109 -0
- package/plugin/utils/sourcemap.ts +52 -0
- package/plugin/utils/virtual.ts +81 -0
- package/runtime/core/cache/combine.ts +102 -0
- package/runtime/core/cache/index.ts +5 -0
- package/runtime/core/cache/item.ts +231 -0
- package/runtime/core/cache/pool.ts +310 -0
- package/runtime/core/cache/prop.ts +283 -0
- package/runtime/core/cache/propCache.ts +62 -0
- package/runtime/core/cache/resolvedItem.ts +31 -0
- package/runtime/core/cache/result.ts +115 -0
- package/runtime/core/cache/stateItem.ts +208 -0
- package/runtime/core/cache/tokenValues.ts +150 -0
- package/runtime/core/cache/utils/tree.ts +57 -0
- package/runtime/core/cache/utils/walk.ts +24 -0
- package/runtime/core/className.ts +101 -0
- package/runtime/core/combinedStyle.ts +101 -0
- package/runtime/core/createTransformElement.ts +39 -0
- package/runtime/core/elementMarker.ts +189 -0
- package/runtime/core/elementMarkerData.ts +27 -0
- package/runtime/core/getClassName.ts +47 -0
- package/runtime/core/getSheetRules.ts +7 -0
- package/runtime/core/getToken.ts +14 -0
- package/runtime/core/index.ts +5 -0
- package/runtime/core/jsx.ts +4 -0
- package/runtime/core/resolveClassNameRuntime.ts +33 -0
- package/runtime/env.ts +7 -0
- package/runtime/extract/getClassName.ts +476 -0
- package/runtime/extract/index.ts +4 -0
- package/runtime/extract/jsx.ts +55 -0
- package/runtime/index.ts +12 -0
- package/runtime/rsc/constants.ts +6 -0
- package/runtime/rsc/dev.ts +38 -0
- package/runtime/rsc/getClassName.ts +98 -0
- package/runtime/rsc/index.ts +3 -0
- package/runtime/rsc/jsx.ts +4 -0
- package/runtime/rsc/observer.ts +238 -0
- package/runtime/rsc/styleStore.ts +82 -0
- package/runtime/sheet/element.ts +13 -0
- package/runtime/sheet/global-noop.ts +13 -0
- package/runtime/sheet/global-prod.ts +13 -0
- package/runtime/sheet/global.ts +13 -0
- package/runtime/sheet/index.ts +3 -0
- package/runtime/sheet/insert.ts +37 -0
- package/runtime/sheet/rule.ts +77 -0
- package/runtime/sheet/rules.ts +131 -0
- package/runtime/sheet/theme.ts +34 -0
- package/runtime/style/index.ts +3 -0
- package/runtime/style/scope.ts +65 -0
- package/runtime/style/style.ts +34 -0
- package/runtime/style/token.ts +1 -0
- package/runtime/types.ts +42 -0
- package/selector/assert.ts +131 -0
- package/selector/index.ts +5 -0
- package/selector/presets/default.ts +27 -0
- package/selector/presets/index.ts +3 -0
- package/selector/presets/minimal.ts +37 -0
- package/selector/presets/selectors.ts +85 -0
- package/selector/selector.ts +68 -0
- package/selector/types.ts +24 -0
- package/selector/validate.ts +91 -0
- package/sheet/dev/dev_layer.ts +151 -0
- package/sheet/dev/dev_sort.ts +249 -0
- package/sheet/dev/index.ts +129 -0
- package/sheet/dev/utils.ts +130 -0
- package/sheet/index.ts +4 -0
- package/sheet/prod.ts +109 -0
- package/sheet/sheet.ts +10 -0
- package/sheet/sourcemap.ts +70 -0
- package/sheet/types.ts +31 -0
- package/sheet/utils/dom.ts +71 -0
- package/sheet/utils/index.ts +4 -0
- package/sheet/utils/layer.ts +14 -0
- package/sheet/utils/noop.ts +11 -0
- package/sheet/utils/rule.ts +3 -0
- package/sheet/utils/sourcemap.ts +221 -0
- package/style/index.ts +9 -0
- package/style/keyframes.ts +40 -0
- package/style/style.ts +112 -0
- package/style/theme.ts +36 -0
- package/style/token.ts +101 -0
- package/style/tokens.ts +64 -0
- package/style/transform.ts +9 -0
- package/style/types.ts +32 -0
- package/style/utils/expose.ts +43 -0
- package/style/utils/index.ts +1 -0
- package/style/value.ts +103 -0
- package/style/valueRef.ts +25 -0
- package/utils/global.ts +44 -0
- package/utils/hash.ts +22 -0
- package/utils/id.ts +20 -0
- package/utils/object.ts +87 -0
- package/utils/trace.ts +211 -0
- package/utils/type.ts +22 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# @fluentic/style
|
|
2
|
+
|
|
3
|
+
## 0.1.0-beta.0
|
|
4
|
+
|
|
5
|
+
### First Public Beta
|
|
6
|
+
|
|
7
|
+
Fluentic Style is now available as a public beta.
|
|
8
|
+
|
|
9
|
+
This release introduces the main React styling workflow for building component
|
|
10
|
+
systems: typed style objects, a JSX `css` prop, reusable component slots,
|
|
11
|
+
scoped themes and variants, design tokens, runtime atomic CSS injection, and
|
|
12
|
+
optional static CSS extraction for production builds.
|
|
13
|
+
|
|
14
|
+
Included in this beta:
|
|
15
|
+
|
|
16
|
+
- typed style objects with `style(...)`
|
|
17
|
+
- component styling targets with `style.slot(...)`
|
|
18
|
+
- scoped theme, variant, state, and media styles with `style.scope(...)`
|
|
19
|
+
- component-level style resolution with `combineStyle(...)`
|
|
20
|
+
- design tokens with `createToken(...)`
|
|
21
|
+
- theme overrides with `createTheme(...)`
|
|
22
|
+
- JSX `css` prop support for DOM and SVG elements
|
|
23
|
+
- runtime atomic CSS injection for development and dynamic styles
|
|
24
|
+
- optional build-time CSS extraction for static styles
|
|
25
|
+
- integrations for Vite, Webpack, Rspack, Farm, Parcel, and Next.js
|
|
26
|
+
- React Server Component-aware runtime entries
|
|
27
|
+
- development utilities for readable class names, source tracing, and style
|
|
28
|
+
debugging
|
|
29
|
+
|
|
30
|
+
The core authoring model is ready for early users. During beta, package exports,
|
|
31
|
+
bundler plugin behavior, and advanced compiler features may still be refined
|
|
32
|
+
based on real project feedback.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Fluentic
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,409 @@
|
|
|
1
|
+
# Fluentic Style
|
|
2
|
+
|
|
3
|
+
Component style composition for React.
|
|
4
|
+
|
|
5
|
+
React styling has a lot of good answers already: CSS files, utility classes,
|
|
6
|
+
CSS-in-JS, compiled CSS, design tokens, and component libraries. Fluentic
|
|
7
|
+
explores a specific question inside that space: what if styles composed around
|
|
8
|
+
React components the same way props and state do?
|
|
9
|
+
|
|
10
|
+
With Fluentic, you start simple with type-safe `style(...)` and the JSX `css`
|
|
11
|
+
prop. When a component needs variants, themes, nested parts, or consumer
|
|
12
|
+
overrides, add slots, scopes, tokens, and `combineStyle(...)` so those styles
|
|
13
|
+
stay organized around the component.
|
|
14
|
+
|
|
15
|
+
For production builds, styles are extracted into static atomic CSS output.
|
|
16
|
+
Dynamic values from props and state still work as usual.
|
|
17
|
+
|
|
18
|
+
[Docs](https://fluenticstack.com/style) |
|
|
19
|
+
[Quick start](https://fluenticstack.com/style/docs/getting-started/quick-start/) |
|
|
20
|
+
[Playground](https://fluenticstack.com/style/playground/) |
|
|
21
|
+
[npm](https://www.npmjs.com/package/@fluentic/style)
|
|
22
|
+
|
|
23
|
+
## Install
|
|
24
|
+
|
|
25
|
+
For the beta release:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npm install @fluentic/style@beta
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Or with pnpm:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
pnpm add @fluentic/style@beta
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Use Fluentic in a React app. Add a bundler plugin later when you want production
|
|
38
|
+
extraction.
|
|
39
|
+
|
|
40
|
+
## Configure Runtime JSX
|
|
41
|
+
|
|
42
|
+
Enable the runtime JSX import source so DOM and SVG elements accept the `css`
|
|
43
|
+
prop. This path works without a Fluentic bundler plugin.
|
|
44
|
+
|
|
45
|
+
```jsonc
|
|
46
|
+
/* tsconfig.json */
|
|
47
|
+
{
|
|
48
|
+
"compilerOptions": {
|
|
49
|
+
"jsx": "react-jsx",
|
|
50
|
+
"jsxImportSource": "@fluentic/style/jsx",
|
|
51
|
+
},
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Why Another Style Library?
|
|
56
|
+
|
|
57
|
+
Component libraries need more than a way to attach styles to elements. They
|
|
58
|
+
need:
|
|
59
|
+
|
|
60
|
+
- base styles owned by the component;
|
|
61
|
+
- state styles for hover, focus, active, disabled, media, and container queries;
|
|
62
|
+
- styleable component parts for themes and composition;
|
|
63
|
+
- variant and theme styles that compose without relying on global CSS class names or selectors;
|
|
64
|
+
- predictable CSS ordering;
|
|
65
|
+
- dynamic values from props and state;
|
|
66
|
+
- static atomic CSS output for production builds.
|
|
67
|
+
|
|
68
|
+
Fluentic maps those needs to a small set of concepts:
|
|
69
|
+
|
|
70
|
+
| Concept | What it solves |
|
|
71
|
+
| ------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------- |
|
|
72
|
+
| [`style(...)`](https://fluenticstack.com/style/docs/reference/style/) | Type-safe style rules with fluent chains for states, selectors, media queries, and variants. |
|
|
73
|
+
| [`style.slot(...)`](https://fluenticstack.com/style/docs/reference/style-slot/) | Names the styleable parts of a component. |
|
|
74
|
+
| [`style.scope(...)`](https://fluenticstack.com/style/docs/reference/style-scope/) | Provides styles to those parts from variants, themes, states, or overrides. |
|
|
75
|
+
| [`combineStyle(...)`](https://fluenticstack.com/style/docs/reference/combine-style/) | Combines base styles with provided, external, and conditional styles. |
|
|
76
|
+
| [Bundler plugins](https://fluenticstack.com/style/docs/integrations/overview/) | Extract styles into static atomic CSS output for production builds. |
|
|
77
|
+
|
|
78
|
+
## Start Simple
|
|
79
|
+
|
|
80
|
+
Use `style(...)` directly when simple component styling is enough.
|
|
81
|
+
|
|
82
|
+
```tsx
|
|
83
|
+
/* Card.tsx */
|
|
84
|
+
import { style } from '@fluentic/style';
|
|
85
|
+
|
|
86
|
+
const card = style({
|
|
87
|
+
padding: 16,
|
|
88
|
+
borderRadius: 8,
|
|
89
|
+
backgroundColor: '#ffffff',
|
|
90
|
+
boxShadow: '0 1px 3px rgb(15 23 42 / 0.12)',
|
|
91
|
+
}).hover({
|
|
92
|
+
boxShadow: '0 12px 30px rgb(15 23 42 / 0.16)',
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
export function Card() {
|
|
96
|
+
return <section css={card}>Ready to style.</section>;
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
That is the smallest version of Fluentic Style: type-safe styles, selectors, and
|
|
101
|
+
a `css` prop.
|
|
102
|
+
|
|
103
|
+
## Scale Into Components
|
|
104
|
+
|
|
105
|
+
When a component becomes reusable, give its styles component structure.
|
|
106
|
+
|
|
107
|
+
```tsx
|
|
108
|
+
/* tokens.ts */
|
|
109
|
+
import { createValues } from '@fluentic/style';
|
|
110
|
+
|
|
111
|
+
// App-facing values stay readable while still being themeable.
|
|
112
|
+
export const color = createValues(['#2563eb', '#ffffff', '#dc2626']);
|
|
113
|
+
export const space = createValues([8, 12, 16]);
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
<!-- dprint-ignore-start -->
|
|
117
|
+
|
|
118
|
+
```tsx
|
|
119
|
+
/* BaseButton.tsx */
|
|
120
|
+
import { style, combineStyle, bindScope, type StyleProp, type StyleTheme } from '@fluentic/style';
|
|
121
|
+
import { color, space } from './tokens';
|
|
122
|
+
|
|
123
|
+
export const baseButtonStyles = {
|
|
124
|
+
// Slots are the component's public styling targets.
|
|
125
|
+
root: style.slot({
|
|
126
|
+
display: 'inline-flex',
|
|
127
|
+
alignItems: 'center',
|
|
128
|
+
border: 0,
|
|
129
|
+
borderRadius: 8,
|
|
130
|
+
cursor: 'pointer',
|
|
131
|
+
gap: space(8),
|
|
132
|
+
padding: space(12),
|
|
133
|
+
backgroundColor: color('#2563eb'),
|
|
134
|
+
color: color('#ffffff'),
|
|
135
|
+
}).hover({
|
|
136
|
+
opacity: 0.9,
|
|
137
|
+
}).focusVisible({
|
|
138
|
+
outline: '2px solid currentColor',
|
|
139
|
+
outlineOffset: 2,
|
|
140
|
+
}),
|
|
141
|
+
|
|
142
|
+
icon: style.slot({
|
|
143
|
+
display: 'inline-flex',
|
|
144
|
+
width: space(16),
|
|
145
|
+
height: space(16),
|
|
146
|
+
}),
|
|
147
|
+
|
|
148
|
+
label: style.slot({
|
|
149
|
+
fontWeight: 650,
|
|
150
|
+
lineHeight: 1,
|
|
151
|
+
}),
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
export type BaseButtonProps = {
|
|
155
|
+
children: React.ReactNode;
|
|
156
|
+
css?: StyleProp;
|
|
157
|
+
icon?: React.ReactNode;
|
|
158
|
+
theme?: StyleTheme;
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
export function BaseButton(props: BaseButtonProps) {
|
|
162
|
+
// Attach theme slot overrides to the root slot and keep the inner JSX private.
|
|
163
|
+
const css = combineStyle(
|
|
164
|
+
baseButtonStyles,
|
|
165
|
+
bindScope(baseButtonStyles.root, props.theme),
|
|
166
|
+
);
|
|
167
|
+
|
|
168
|
+
return (
|
|
169
|
+
<button css={[css.root, props.css]}>
|
|
170
|
+
{props.icon ? <span css={css.icon}>{props.icon}</span> : null}
|
|
171
|
+
<span css={css.label}>{props.children}</span>
|
|
172
|
+
</button>
|
|
173
|
+
);
|
|
174
|
+
}
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
<!-- dprint-ignore-end -->
|
|
178
|
+
|
|
179
|
+
```tsx
|
|
180
|
+
/* Button.tsx */
|
|
181
|
+
import { style } from '@fluentic/style';
|
|
182
|
+
import { BaseButton, type BaseButtonProps, baseButtonStyles } from './BaseButton';
|
|
183
|
+
import { color, space } from './tokens';
|
|
184
|
+
|
|
185
|
+
// Scopes target slots, so variants do not depend on internal DOM markup.
|
|
186
|
+
const dangerButton = style.scope([
|
|
187
|
+
baseButtonStyles.root({
|
|
188
|
+
backgroundColor: color('#dc2626'),
|
|
189
|
+
}),
|
|
190
|
+
baseButtonStyles.icon({
|
|
191
|
+
color: color('#ffffff'),
|
|
192
|
+
}),
|
|
193
|
+
baseButtonStyles.label({
|
|
194
|
+
color: color('#ffffff'),
|
|
195
|
+
fontWeight: 700,
|
|
196
|
+
}),
|
|
197
|
+
]);
|
|
198
|
+
|
|
199
|
+
export const compactButton = style.scope([
|
|
200
|
+
baseButtonStyles.root({
|
|
201
|
+
gap: space(8),
|
|
202
|
+
padding: space(8),
|
|
203
|
+
}),
|
|
204
|
+
baseButtonStyles.label({
|
|
205
|
+
fontSize: 13,
|
|
206
|
+
}),
|
|
207
|
+
]);
|
|
208
|
+
|
|
209
|
+
type ButtonProps = BaseButtonProps & {
|
|
210
|
+
compact?: boolean;
|
|
211
|
+
danger?: boolean;
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
export function Button({ compact, danger, theme, ...props }: ButtonProps) {
|
|
215
|
+
return (
|
|
216
|
+
<BaseButton
|
|
217
|
+
{...props}
|
|
218
|
+
theme={[
|
|
219
|
+
danger && dangerButton,
|
|
220
|
+
compact && compactButton,
|
|
221
|
+
theme,
|
|
222
|
+
]}
|
|
223
|
+
/>
|
|
224
|
+
);
|
|
225
|
+
}
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
```tsx
|
|
229
|
+
/* App.tsx */
|
|
230
|
+
import { createTheme, style } from '@fluentic/style';
|
|
231
|
+
import { Button } from './Button';
|
|
232
|
+
import { color } from './tokens';
|
|
233
|
+
|
|
234
|
+
const styles = {
|
|
235
|
+
root: style({
|
|
236
|
+
display: 'grid',
|
|
237
|
+
gap: 12,
|
|
238
|
+
justifyItems: 'start',
|
|
239
|
+
}),
|
|
240
|
+
};
|
|
241
|
+
|
|
242
|
+
// A theme maps the literal values components use to values for an app subtree.
|
|
243
|
+
const purpleTheme = createTheme([
|
|
244
|
+
color('#2563eb', '#7c3aed'),
|
|
245
|
+
]);
|
|
246
|
+
|
|
247
|
+
export function App() {
|
|
248
|
+
return (
|
|
249
|
+
<main css={[styles.root, purpleTheme]}>
|
|
250
|
+
<Button>Save changes</Button>
|
|
251
|
+
<Button compact>Compact action</Button>
|
|
252
|
+
<Button danger>Delete draft</Button>
|
|
253
|
+
</main>
|
|
254
|
+
);
|
|
255
|
+
}
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
`createValues(...)` is the app-facing path here: styles still show values like
|
|
259
|
+
`color('#2563eb')` and `space(8)`, but those values can be themed. Use named
|
|
260
|
+
tokens when the names themselves are part of a reusable component or design
|
|
261
|
+
system contract.
|
|
262
|
+
|
|
263
|
+
The important shift: consumers style the `Button` through component themes,
|
|
264
|
+
app-wide themes, and the `css` prop. They do not need to know whether the
|
|
265
|
+
component renders a `button`, `span`, SVG icon, or changes its internal markup
|
|
266
|
+
later.
|
|
267
|
+
|
|
268
|
+
## Debug Styles
|
|
269
|
+
|
|
270
|
+
Because Fluentic organizes styles around components, debugging stays connected
|
|
271
|
+
to the component too. In development, Fluentic keeps the authored context
|
|
272
|
+
visible: readable class names, source traces back to `style(...)`, JSX element
|
|
273
|
+
markers for the host element that received `css`, and priority modes that make
|
|
274
|
+
cascade order inspectable.
|
|
275
|
+
|
|
276
|
+
```ts
|
|
277
|
+
import { enableStyleDevUtils } from '@fluentic/style/dev';
|
|
278
|
+
|
|
279
|
+
enableStyleDevUtils();
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
The browser console helper appears as `StyleDevUtils`. Use it to print the
|
|
283
|
+
active config, switch sourcemap modes, toggle element markers, and inspect
|
|
284
|
+
priority with layers or sorted output.
|
|
285
|
+
|
|
286
|
+
## Add Production Extraction
|
|
287
|
+
|
|
288
|
+
Fluentic Style works without a compiler. In runtime mode, the JSX `css` prop
|
|
289
|
+
resolves class names and inserts atomic CSS rules as needed.
|
|
290
|
+
|
|
291
|
+
For production builds, add a bundler plugin. Styles are extracted into static
|
|
292
|
+
atomic CSS output. Dynamic values from props, state, or user input still work as
|
|
293
|
+
usual.
|
|
294
|
+
|
|
295
|
+
After adding a Fluentic bundler plugin, change the JSX import source from
|
|
296
|
+
`@fluentic/style/jsx` to `@fluentic/style/plugin/jsx`.
|
|
297
|
+
|
|
298
|
+
```jsonc
|
|
299
|
+
/* tsconfig.json */
|
|
300
|
+
{
|
|
301
|
+
"compilerOptions": {
|
|
302
|
+
"jsx": "react-jsx",
|
|
303
|
+
"jsxImportSource": "@fluentic/style/plugin/jsx",
|
|
304
|
+
},
|
|
305
|
+
}
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
```ts
|
|
309
|
+
/* vite.config.ts */
|
|
310
|
+
import { plugin as stylePlugin } from '@fluentic/style/plugin/vite';
|
|
311
|
+
import react from '@vitejs/plugin-react';
|
|
312
|
+
import { defineConfig } from 'vite';
|
|
313
|
+
|
|
314
|
+
export default defineConfig({
|
|
315
|
+
plugins: [
|
|
316
|
+
stylePlugin(),
|
|
317
|
+
react({
|
|
318
|
+
jsxImportSource: '@fluentic/style/plugin/jsx',
|
|
319
|
+
}),
|
|
320
|
+
],
|
|
321
|
+
});
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
`stylePlugin(...)` accepts options for include/exclude rules, hoisting,
|
|
325
|
+
development sourcemaps, and extracted CSS output. See
|
|
326
|
+
[Plugin Options](https://fluenticstack.com/style/docs/reference/plugin-options/).
|
|
327
|
+
|
|
328
|
+
For Next.js and other bundlers, see the
|
|
329
|
+
[integration docs](https://fluenticstack.com/style/docs/integrations/overview/).
|
|
330
|
+
|
|
331
|
+
## Benchmarks
|
|
332
|
+
|
|
333
|
+
Benchmarks live in the repository's `benchmark/` folder and run against
|
|
334
|
+
production builds. Current benchmark snapshots:
|
|
335
|
+
|
|
336
|
+
React app, 1500-row dashboard:
|
|
337
|
+
|
|
338
|
+
| Case | Mount | Style Update |
|
|
339
|
+
| -------------------------- | ---------- | ------------ |
|
|
340
|
+
| Fluentic direct DOM | `40.05 ms` | `17.79 ms` |
|
|
341
|
+
| Fluentic scoped DOM | `41.43 ms` | `19.57 ms` |
|
|
342
|
+
| Fluentic direct components | `41.63 ms` | `17.91 ms` |
|
|
343
|
+
| Fluentic scoped components | `41.95 ms` | `19.54 ms` |
|
|
344
|
+
| StyleX DOM | `41.28 ms` | `17.73 ms` |
|
|
345
|
+
| Goober DOM | `40.13 ms` | `17.75 ms` |
|
|
346
|
+
| Emotion DOM | `52.63 ms` | `20.54 ms` |
|
|
347
|
+
| vanilla-extract DOM | `39.85 ms` | `17.65 ms` |
|
|
348
|
+
| CSS Modules DOM | `40.35 ms` | `17.75 ms` |
|
|
349
|
+
|
|
350
|
+
SSR render-only, 500 rows:
|
|
351
|
+
|
|
352
|
+
| Case | Dashboard Mean | Composition Mean |
|
|
353
|
+
| --------------- | -------------- | ---------------- |
|
|
354
|
+
| Plain React | `6.571 ms` | `8.348 ms` |
|
|
355
|
+
| Fluentic direct | `6.601 ms` | `7.286 ms` |
|
|
356
|
+
| Fluentic scoped | `6.857 ms` | `7.489 ms` |
|
|
357
|
+
| Fluentic token | `7.667 ms` | `8.253 ms` |
|
|
358
|
+
| StyleX | `6.826 ms` | `8.059 ms` |
|
|
359
|
+
|
|
360
|
+
Compiler transform, 100 files per corpus:
|
|
361
|
+
|
|
362
|
+
| Corpus | Fluentic Warm | StyleX Babel |
|
|
363
|
+
| ------------- | ------------- | ------------ |
|
|
364
|
+
| direct-styles | `376.43 ms` | `249.03 ms` |
|
|
365
|
+
| theme-slots | `642.25 ms` | `372.86 ms` |
|
|
366
|
+
| stylex-styles | `392.01 ms` | `416.69 ms` |
|
|
367
|
+
| mixed-app | `421.67 ms` | `270.71 ms` |
|
|
368
|
+
|
|
369
|
+
Read the [benchmark guide](./benchmark/README.md) for commands, report files,
|
|
370
|
+
and the public suite list.
|
|
371
|
+
|
|
372
|
+
## Package Exports
|
|
373
|
+
|
|
374
|
+
| Import | Purpose |
|
|
375
|
+
| -------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
|
|
376
|
+
| `@fluentic/style` | Runtime API, style builders, hooks, tokens, themes, and types. |
|
|
377
|
+
| `@fluentic/style/css` | CSS helper APIs for keyframes, font faces, and at-rules. |
|
|
378
|
+
| `@fluentic/style/selector` | Selector constructors, validators, presets, and priority helpers. |
|
|
379
|
+
| `@fluentic/style/config` | Runtime configuration helpers. |
|
|
380
|
+
| `@fluentic/style/compiler` | Node-only compiler entry used by build integrations and compiler benchmarks. |
|
|
381
|
+
| `@fluentic/style/dev` | Development utilities. |
|
|
382
|
+
| `@fluentic/style/dev/rsc` | React Server Component dev client boundary. |
|
|
383
|
+
| `@fluentic/style/jsx` | [JSX import source without a bundler plugin](https://fluenticstack.com/style/docs/integrations/runtime-only-mode/). |
|
|
384
|
+
| `@fluentic/style/plugin/jsx` | [JSX import source after adding a bundler plugin](https://fluenticstack.com/style/docs/integrations/jsx-runtime-setup/). |
|
|
385
|
+
| `@fluentic/style/plugin/nextjs` | [Next.js App Router integration](https://fluenticstack.com/style/docs/integrations/nextjs/). |
|
|
386
|
+
| `@fluentic/style/plugin/vite` | [Vite plugin](https://fluenticstack.com/style/docs/integrations/vite/). |
|
|
387
|
+
| `@fluentic/style/plugin/webpack` | [Webpack plugin](https://fluenticstack.com/style/docs/integrations/webpack/). |
|
|
388
|
+
| `@fluentic/style/plugin/rspack` | [Rspack plugin](https://fluenticstack.com/style/docs/integrations/rspack/). |
|
|
389
|
+
| `@fluentic/style/plugin/farm` | [Farm plugin](https://fluenticstack.com/style/docs/integrations/farm/). |
|
|
390
|
+
| `@fluentic/style/plugin/parcel` | [Parcel plugin](https://fluenticstack.com/style/docs/integrations/parcel/). |
|
|
391
|
+
|
|
392
|
+
## Repository Guide
|
|
393
|
+
|
|
394
|
+
Internal project structure, local development commands, example apps, benchmark
|
|
395
|
+
commands, and docs deployment notes live in the [repository guide](./DEVELOPMENT.md).
|
|
396
|
+
|
|
397
|
+
## Issues And Fixes
|
|
398
|
+
|
|
399
|
+
Fluentic Style is open to issues, bug reports, reproduction cases, and focused
|
|
400
|
+
fix suggestions. A broad pull-request workflow is not open yet; please start
|
|
401
|
+
with an issue that includes your package version, bundler/framework, a minimal
|
|
402
|
+
reproduction, and the expected vs actual behavior.
|
|
403
|
+
|
|
404
|
+
## Status
|
|
405
|
+
|
|
406
|
+
Fluentic Style is in beta. The core model is ready for early users: direct
|
|
407
|
+
styles, component slots, scoped variants, themes, tokens, dynamic values,
|
|
408
|
+
debugging, and static extraction. Package exports, bundler plugin behavior, and
|
|
409
|
+
advanced compiler features may still be refined from real project feedback.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { NamedAtRuleFormat, TokenNameFormat } from '../../config/types';
|
|
2
|
+
import type { StyleTokenData } from '../../style/token';
|
|
3
|
+
import type { CSS } from '../utils/types';
|
|
4
|
+
import { buildNamedAtRuleCss, createAtRuleNameFormatter } from './utils';
|
|
5
|
+
|
|
6
|
+
export type CounterStyleObject = CSS.AtRule.CounterStyle;
|
|
7
|
+
|
|
8
|
+
export const COUNTER_STYLE_AT_RULE = 'counter-style';
|
|
9
|
+
|
|
10
|
+
export const formatCounterStyleName = createAtRuleNameFormatter(
|
|
11
|
+
'counter-style[-(name)]-$hash',
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
export function buildCounterStyleCss(
|
|
15
|
+
format: NamedAtRuleFormat | null,
|
|
16
|
+
name: string | null,
|
|
17
|
+
id: string,
|
|
18
|
+
descriptors: CounterStyleObject,
|
|
19
|
+
tokens: StyleTokenData[],
|
|
20
|
+
tokenLookup: Set<string>,
|
|
21
|
+
tokenNameFormat: TokenNameFormat | null,
|
|
22
|
+
) {
|
|
23
|
+
name = formatCounterStyleName(format, id, { name });
|
|
24
|
+
|
|
25
|
+
const css = buildNamedAtRuleCss(
|
|
26
|
+
COUNTER_STYLE_AT_RULE,
|
|
27
|
+
name,
|
|
28
|
+
descriptors,
|
|
29
|
+
tokens,
|
|
30
|
+
tokenLookup,
|
|
31
|
+
tokenNameFormat,
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
return { name, css };
|
|
35
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { NamedAtRuleFormat, TokenNameFormat } from '../../config/types';
|
|
2
|
+
import type { StyleTokenData } from '../../style/token';
|
|
3
|
+
import type { CSS } from '../utils/types';
|
|
4
|
+
import { buildAtRuleDeclarationCss, createAtRuleNameFormatter } from './utils';
|
|
5
|
+
|
|
6
|
+
export type FontFaceObject = CSS.AtRule.FontFace;
|
|
7
|
+
|
|
8
|
+
export const FONT_FACE_AT_RULE = 'font-face';
|
|
9
|
+
|
|
10
|
+
export const formatFontFaceName = createAtRuleNameFormatter(
|
|
11
|
+
'font[-(name)]-$hash',
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
export function buildFontFaceCss(
|
|
15
|
+
format: NamedAtRuleFormat | null,
|
|
16
|
+
name: string | null,
|
|
17
|
+
id: string,
|
|
18
|
+
descriptors: FontFaceObject,
|
|
19
|
+
tokens: StyleTokenData[],
|
|
20
|
+
tokenLookup: Set<string>,
|
|
21
|
+
tokenNameFormat: TokenNameFormat | null,
|
|
22
|
+
) {
|
|
23
|
+
name = formatFontFaceName(format, id, { name });
|
|
24
|
+
|
|
25
|
+
let css = buildAtRuleDeclarationCss(
|
|
26
|
+
descriptors,
|
|
27
|
+
tokens,
|
|
28
|
+
tokenLookup,
|
|
29
|
+
tokenNameFormat,
|
|
30
|
+
true,
|
|
31
|
+
(property) => property !== 'fontFamily',
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
css = `@${FONT_FACE_AT_RULE} { font-family: ${name}; ${css} }`;
|
|
35
|
+
|
|
36
|
+
return { name, css };
|
|
37
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { NamedAtRuleFormat, TokenNameFormat } from '../../config/types';
|
|
2
|
+
import type { StyleTokenData } from '../../style/token';
|
|
3
|
+
import type { CSS } from '../utils/types';
|
|
4
|
+
import { buildNamedAtRuleCss, createAtRuleNameFormatter } from './utils';
|
|
5
|
+
|
|
6
|
+
export type FontPaletteValuesObject = CSS.AtRule.FontPaletteValues;
|
|
7
|
+
|
|
8
|
+
export const FONT_PALETTE_VALUES_AT_RULE = 'font-palette-values';
|
|
9
|
+
|
|
10
|
+
export const formatFontPaletteValuesName = createAtRuleNameFormatter(
|
|
11
|
+
'font-palettle[-(name)]-$hash',
|
|
12
|
+
'--',
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
export function buildFontPaletteValuesCss(
|
|
16
|
+
format: NamedAtRuleFormat | null,
|
|
17
|
+
name: string | null,
|
|
18
|
+
id: string,
|
|
19
|
+
descriptors: FontPaletteValuesObject,
|
|
20
|
+
tokens: StyleTokenData[],
|
|
21
|
+
tokenLookup: Set<string>,
|
|
22
|
+
tokenNameFormat: TokenNameFormat | null,
|
|
23
|
+
) {
|
|
24
|
+
name = formatFontPaletteValuesName(format, id, { name });
|
|
25
|
+
|
|
26
|
+
const css = buildNamedAtRuleCss(
|
|
27
|
+
FONT_PALETTE_VALUES_AT_RULE,
|
|
28
|
+
name,
|
|
29
|
+
descriptors,
|
|
30
|
+
tokens,
|
|
31
|
+
tokenLookup,
|
|
32
|
+
tokenNameFormat,
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
return { name, css };
|
|
36
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export function fontSrc(url: string, format?: string) {
|
|
2
|
+
if (typeof url !== 'string') {
|
|
3
|
+
throw new Error('fontSrc url must be a static string');
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
const src = `url("${escapeFontSrcPart(url)}")`;
|
|
7
|
+
|
|
8
|
+
return format ? `${src} format("${escapeFontSrcPart(format)}")` : src;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function escapeFontSrcPart(value: string) {
|
|
12
|
+
return value.replace(/\\/g, '\\\\').replace(/"/g, '\\"');
|
|
13
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { NamedAtRuleFormat, TokenNameFormat } from '../../config/types';
|
|
2
|
+
import type { StyleTokenData } from '../../style/token';
|
|
3
|
+
import type { AtRuleStyleObject, CSSProperties } from '../../style/types';
|
|
4
|
+
import { buildAtRuleDeclarationCss, createAtRuleNameFormatter } from './utils';
|
|
5
|
+
|
|
6
|
+
export type KeyframeSelector = 'from' | 'to' | `${number}%` | (string & {});
|
|
7
|
+
|
|
8
|
+
export type KeyframesObject<Style = CSSProperties> = {
|
|
9
|
+
[Selector in KeyframeSelector]?: AtRuleStyleObject<Style>;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const KEYFRAMES_AT_RULE = 'keyframes';
|
|
13
|
+
|
|
14
|
+
export const formatKeyFramesName = createAtRuleNameFormatter(
|
|
15
|
+
'keyframes[-(name)]-$hash',
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
export function buildKeyframesCss(
|
|
19
|
+
format: NamedAtRuleFormat | null,
|
|
20
|
+
name: string | null,
|
|
21
|
+
id: string,
|
|
22
|
+
frames: KeyframesObject,
|
|
23
|
+
tokens: StyleTokenData[],
|
|
24
|
+
tokenLookup: Set<string>,
|
|
25
|
+
tokenNameFormat: TokenNameFormat | null,
|
|
26
|
+
) {
|
|
27
|
+
name = formatKeyFramesName(format, id, { name });
|
|
28
|
+
|
|
29
|
+
let css = `@${KEYFRAMES_AT_RULE} ${name} {`;
|
|
30
|
+
|
|
31
|
+
for (const selector in frames) {
|
|
32
|
+
const frame = frames[selector];
|
|
33
|
+
if (!frame) continue;
|
|
34
|
+
|
|
35
|
+
css += selector + '{';
|
|
36
|
+
css += buildAtRuleDeclarationCss(frame, tokens, tokenLookup, tokenNameFormat, false);
|
|
37
|
+
css += '}';
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
css += '}';
|
|
41
|
+
|
|
42
|
+
return { name, css };
|
|
43
|
+
}
|