@choco-vanille/theme 0.0.0-stage → 0.1.0-dev.1
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/LICENSE +21 -0
- package/README.md +216 -2
- package/dist/index.cjs +1 -0
- package/dist/index.d.cts +2743 -0
- package/dist/index.d.ts +2743 -0
- package/dist/index.js +18 -0
- package/dist/styles.css +2 -0
- package/dist/theme/constants/index.cjs +2 -0
- package/dist/theme/constants/index.cjs.map +1 -0
- package/dist/theme/constants/index.js +9 -0
- package/dist/theme/constants/index.js.map +1 -0
- package/dist/theme/flavors/contrast/constants/index.cjs +2 -0
- package/dist/theme/flavors/contrast/constants/index.cjs.map +1 -0
- package/dist/theme/flavors/contrast/constants/index.js +58 -0
- package/dist/theme/flavors/contrast/constants/index.js.map +1 -0
- package/dist/theme/flavors/contrast/contrastFlavor.const.cjs +2 -0
- package/dist/theme/flavors/contrast/contrastFlavor.const.cjs.map +1 -0
- package/dist/theme/flavors/contrast/contrastFlavor.const.js +149 -0
- package/dist/theme/flavors/contrast/contrastFlavor.const.js.map +1 -0
- package/dist/theme/flavors/contrast/utils/createContrastIntents.utils.cjs +2 -0
- package/dist/theme/flavors/contrast/utils/createContrastIntents.utils.cjs.map +1 -0
- package/dist/theme/flavors/contrast/utils/createContrastIntents.utils.js +20 -0
- package/dist/theme/flavors/contrast/utils/createContrastIntents.utils.js.map +1 -0
- package/dist/theme/flavors/default/constants/index.cjs +2 -0
- package/dist/theme/flavors/default/constants/index.cjs.map +1 -0
- package/dist/theme/flavors/default/constants/index.js +58 -0
- package/dist/theme/flavors/default/constants/index.js.map +1 -0
- package/dist/theme/flavors/default/defaultDarkTheme.const.cjs +2 -0
- package/dist/theme/flavors/default/defaultDarkTheme.const.cjs.map +1 -0
- package/dist/theme/flavors/default/defaultDarkTheme.const.js +93 -0
- package/dist/theme/flavors/default/defaultDarkTheme.const.js.map +1 -0
- package/dist/theme/flavors/default/defaultFlavor.const.cjs +2 -0
- package/dist/theme/flavors/default/defaultFlavor.const.cjs.map +1 -0
- package/dist/theme/flavors/default/defaultFlavor.const.js +12 -0
- package/dist/theme/flavors/default/defaultFlavor.const.js.map +1 -0
- package/dist/theme/flavors/default/defaultLightTheme.const.cjs +2 -0
- package/dist/theme/flavors/default/defaultLightTheme.const.cjs.map +1 -0
- package/dist/theme/flavors/default/defaultLightTheme.const.js +93 -0
- package/dist/theme/flavors/default/defaultLightTheme.const.js.map +1 -0
- package/dist/theme/flavors/neutral/neutralFlavor.const.cjs +2 -0
- package/dist/theme/flavors/neutral/neutralFlavor.const.cjs.map +1 -0
- package/dist/theme/flavors/neutral/neutralFlavor.const.js +32 -0
- package/dist/theme/flavors/neutral/neutralFlavor.const.js.map +1 -0
- package/dist/theme/hooks/viewport/use-breakpoint/useBreakpoint.hook.cjs +2 -0
- package/dist/theme/hooks/viewport/use-breakpoint/useBreakpoint.hook.cjs.map +1 -0
- package/dist/theme/hooks/viewport/use-breakpoint/useBreakpoint.hook.js +11 -0
- package/dist/theme/hooks/viewport/use-breakpoint/useBreakpoint.hook.js.map +1 -0
- package/dist/theme/hooks/viewport/use-breakpoint/utils/mediaQueryStore.utils.cjs +2 -0
- package/dist/theme/hooks/viewport/use-breakpoint/utils/mediaQueryStore.utils.cjs.map +1 -0
- package/dist/theme/hooks/viewport/use-breakpoint/utils/mediaQueryStore.utils.js +20 -0
- package/dist/theme/hooks/viewport/use-breakpoint/utils/mediaQueryStore.utils.js.map +1 -0
- package/dist/theme/styles/themes.css.cjs +1 -0
- package/dist/theme/styles/themes.css.js +1 -0
- package/dist/theme/styles/vars.css.cjs +2 -0
- package/dist/theme/styles/vars.css.cjs.map +1 -0
- package/dist/theme/styles/vars.css.js +366 -0
- package/dist/theme/styles/vars.css.js.map +1 -0
- package/dist/theme/theme-provider/ThemeProvider.cjs +2 -0
- package/dist/theme/theme-provider/ThemeProvider.cjs.map +1 -0
- package/dist/theme/theme-provider/ThemeProvider.css.cjs +2 -0
- package/dist/theme/theme-provider/ThemeProvider.css.cjs.map +1 -0
- package/dist/theme/theme-provider/ThemeProvider.css.js +6 -0
- package/dist/theme/theme-provider/ThemeProvider.css.js.map +1 -0
- package/dist/theme/theme-provider/ThemeProvider.js +45 -0
- package/dist/theme/theme-provider/ThemeProvider.js.map +1 -0
- package/dist/theme/theme-provider/constants/index.cjs +2 -0
- package/dist/theme/theme-provider/constants/index.cjs.map +1 -0
- package/dist/theme/theme-provider/constants/index.js +13 -0
- package/dist/theme/theme-provider/constants/index.js.map +1 -0
- package/dist/theme/theme-provider/contexts/FlavorRegistryContext.cjs +2 -0
- package/dist/theme/theme-provider/contexts/FlavorRegistryContext.cjs.map +1 -0
- package/dist/theme/theme-provider/contexts/FlavorRegistryContext.js +6 -0
- package/dist/theme/theme-provider/contexts/FlavorRegistryContext.js.map +1 -0
- package/dist/theme/theme-provider/contexts/ThemeContext.cjs +2 -0
- package/dist/theme/theme-provider/contexts/ThemeContext.cjs.map +1 -0
- package/dist/theme/theme-provider/contexts/ThemeContext.js +6 -0
- package/dist/theme/theme-provider/contexts/ThemeContext.js.map +1 -0
- package/dist/theme/theme-provider/contexts/ThemeSetterContext.cjs +2 -0
- package/dist/theme/theme-provider/contexts/ThemeSetterContext.cjs.map +1 -0
- package/dist/theme/theme-provider/contexts/ThemeSetterContext.js +6 -0
- package/dist/theme/theme-provider/contexts/ThemeSetterContext.js.map +1 -0
- package/dist/theme/theme-provider/hooks/use-controllable-selection/useControllableSelection.hook.cjs +2 -0
- package/dist/theme/theme-provider/hooks/use-controllable-selection/useControllableSelection.hook.cjs.map +1 -0
- package/dist/theme/theme-provider/hooks/use-controllable-selection/useControllableSelection.hook.js +41 -0
- package/dist/theme/theme-provider/hooks/use-controllable-selection/useControllableSelection.hook.js.map +1 -0
- package/dist/theme/theme-provider/hooks/use-document-scope/useDocumentScope.hook.cjs +2 -0
- package/dist/theme/theme-provider/hooks/use-document-scope/useDocumentScope.hook.cjs.map +1 -0
- package/dist/theme/theme-provider/hooks/use-document-scope/useDocumentScope.hook.js +30 -0
- package/dist/theme/theme-provider/hooks/use-document-scope/useDocumentScope.hook.js.map +1 -0
- package/dist/theme/theme-provider/hooks/use-flavor-registry/useFlavorRegistry.hook.cjs +2 -0
- package/dist/theme/theme-provider/hooks/use-flavor-registry/useFlavorRegistry.hook.cjs.map +1 -0
- package/dist/theme/theme-provider/hooks/use-flavor-registry/useFlavorRegistry.hook.js +30 -0
- package/dist/theme/theme-provider/hooks/use-flavor-registry/useFlavorRegistry.hook.js.map +1 -0
- package/dist/theme/theme-provider/hooks/use-flavor-registry/utils/areFlavorListsEqual.utils.cjs +2 -0
- package/dist/theme/theme-provider/hooks/use-flavor-registry/utils/areFlavorListsEqual.utils.cjs.map +1 -0
- package/dist/theme/theme-provider/hooks/use-flavor-registry/utils/areFlavorListsEqual.utils.js +5 -0
- package/dist/theme/theme-provider/hooks/use-flavor-registry/utils/areFlavorListsEqual.utils.js.map +1 -0
- package/dist/theme/theme-provider/hooks/use-theme-provider/useThemeProvider.hook.cjs +2 -0
- package/dist/theme/theme-provider/hooks/use-theme-provider/useThemeProvider.hook.cjs.map +1 -0
- package/dist/theme/theme-provider/hooks/use-theme-provider/useThemeProvider.hook.js +80 -0
- package/dist/theme/theme-provider/hooks/use-theme-provider/useThemeProvider.hook.js.map +1 -0
- package/dist/theme/theme-provider/hooks/use-token-styles/useTokenStyles.hook.cjs +2 -0
- package/dist/theme/theme-provider/hooks/use-token-styles/useTokenStyles.hook.cjs.map +1 -0
- package/dist/theme/theme-provider/hooks/use-token-styles/useTokenStyles.hook.js +11 -0
- package/dist/theme/theme-provider/hooks/use-token-styles/useTokenStyles.hook.js.map +1 -0
- package/dist/theme/theme-provider/hooks/use-token-styles/utils/areTokenStylesEqual.utils.cjs +2 -0
- package/dist/theme/theme-provider/hooks/use-token-styles/utils/areTokenStylesEqual.utils.cjs.map +1 -0
- package/dist/theme/theme-provider/hooks/use-token-styles/utils/areTokenStylesEqual.utils.js +8 -0
- package/dist/theme/theme-provider/hooks/use-token-styles/utils/areTokenStylesEqual.utils.js.map +1 -0
- package/dist/theme/theme-provider/hooks/useResolvedTheme.hook.cjs +2 -0
- package/dist/theme/theme-provider/hooks/useResolvedTheme.hook.cjs.map +1 -0
- package/dist/theme/theme-provider/hooks/useResolvedTheme.hook.js +13 -0
- package/dist/theme/theme-provider/hooks/useResolvedTheme.hook.js.map +1 -0
- package/dist/theme/theme-provider/hooks/useSetTheme.hook.cjs +2 -0
- package/dist/theme/theme-provider/hooks/useSetTheme.hook.cjs.map +1 -0
- package/dist/theme/theme-provider/hooks/useSetTheme.hook.js +11 -0
- package/dist/theme/theme-provider/hooks/useSetTheme.hook.js.map +1 -0
- package/dist/theme/theme-provider/hooks/useTheme.hook.cjs +2 -0
- package/dist/theme/theme-provider/hooks/useTheme.hook.cjs.map +1 -0
- package/dist/theme/theme-provider/hooks/useTheme.hook.js +11 -0
- package/dist/theme/theme-provider/hooks/useTheme.hook.js.map +1 -0
- package/dist/theme/theme-provider/utils/createFlavorValidator.utils.cjs +2 -0
- package/dist/theme/theme-provider/utils/createFlavorValidator.utils.cjs.map +1 -0
- package/dist/theme/theme-provider/utils/createFlavorValidator.utils.js +11 -0
- package/dist/theme/theme-provider/utils/createFlavorValidator.utils.js.map +1 -0
- package/dist/theme/theme-provider/utils/get-flavor-stylesheet/getFlavorStylesheet.utils.cjs +2 -0
- package/dist/theme/theme-provider/utils/get-flavor-stylesheet/getFlavorStylesheet.utils.cjs.map +1 -0
- package/dist/theme/theme-provider/utils/get-flavor-stylesheet/getFlavorStylesheet.utils.js +15 -0
- package/dist/theme/theme-provider/utils/get-flavor-stylesheet/getFlavorStylesheet.utils.js.map +1 -0
- package/dist/theme/theme-provider/utils/get-flavor-stylesheet/utils/hashString.utils.cjs +2 -0
- package/dist/theme/theme-provider/utils/get-flavor-stylesheet/utils/hashString.utils.cjs.map +1 -0
- package/dist/theme/theme-provider/utils/get-flavor-stylesheet/utils/hashString.utils.js +9 -0
- package/dist/theme/theme-provider/utils/get-flavor-stylesheet/utils/hashString.utils.js.map +1 -0
- package/dist/theme/theme-provider/utils/getReferencedFlavors.utils.cjs +2 -0
- package/dist/theme/theme-provider/utils/getReferencedFlavors.utils.cjs.map +1 -0
- package/dist/theme/theme-provider/utils/getReferencedFlavors.utils.js +6 -0
- package/dist/theme/theme-provider/utils/getReferencedFlavors.utils.js.map +1 -0
- package/dist/theme/theme-provider/utils/getServerSystemTheme.utils.cjs +2 -0
- package/dist/theme/theme-provider/utils/getServerSystemTheme.utils.cjs.map +1 -0
- package/dist/theme/theme-provider/utils/getServerSystemTheme.utils.js +5 -0
- package/dist/theme/theme-provider/utils/getServerSystemTheme.utils.js.map +1 -0
- package/dist/theme/theme-provider/utils/getSystemTheme.utils.cjs +2 -0
- package/dist/theme/theme-provider/utils/getSystemTheme.utils.cjs.map +1 -0
- package/dist/theme/theme-provider/utils/getSystemTheme.utils.js +6 -0
- package/dist/theme/theme-provider/utils/getSystemTheme.utils.js.map +1 -0
- package/dist/theme/theme-provider/utils/register-document-scope/registerDocumentScope.utils.cjs +2 -0
- package/dist/theme/theme-provider/utils/register-document-scope/registerDocumentScope.utils.cjs.map +1 -0
- package/dist/theme/theme-provider/utils/register-document-scope/registerDocumentScope.utils.js +33 -0
- package/dist/theme/theme-provider/utils/register-document-scope/registerDocumentScope.utils.js.map +1 -0
- package/dist/theme/theme-provider/utils/register-document-scope/utils/applyDocumentScope.utils.cjs +2 -0
- package/dist/theme/theme-provider/utils/register-document-scope/utils/applyDocumentScope.utils.cjs.map +1 -0
- package/dist/theme/theme-provider/utils/register-document-scope/utils/applyDocumentScope.utils.js +16 -0
- package/dist/theme/theme-provider/utils/register-document-scope/utils/applyDocumentScope.utils.js.map +1 -0
- package/dist/theme/theme-provider/utils/register-document-scope/utils/syncAttribute.utils.cjs +2 -0
- package/dist/theme/theme-provider/utils/register-document-scope/utils/syncAttribute.utils.cjs.map +1 -0
- package/dist/theme/theme-provider/utils/register-document-scope/utils/syncAttribute.utils.js +7 -0
- package/dist/theme/theme-provider/utils/register-document-scope/utils/syncAttribute.utils.js.map +1 -0
- package/dist/theme/theme-provider/utils/register-document-scope/utils/syncProperty.utils.cjs +2 -0
- package/dist/theme/theme-provider/utils/register-document-scope/utils/syncProperty.utils.cjs.map +1 -0
- package/dist/theme/theme-provider/utils/register-document-scope/utils/syncProperty.utils.js +7 -0
- package/dist/theme/theme-provider/utils/register-document-scope/utils/syncProperty.utils.js.map +1 -0
- package/dist/theme/theme-provider/utils/subscribeToNothing.utils.cjs +2 -0
- package/dist/theme/theme-provider/utils/subscribeToNothing.utils.cjs.map +1 -0
- package/dist/theme/theme-provider/utils/subscribeToNothing.utils.js +5 -0
- package/dist/theme/theme-provider/utils/subscribeToNothing.utils.js.map +1 -0
- package/dist/theme/theme-provider/utils/subscribeToSystemTheme.utils.cjs +2 -0
- package/dist/theme/theme-provider/utils/subscribeToSystemTheme.utils.cjs.map +1 -0
- package/dist/theme/theme-provider/utils/subscribeToSystemTheme.utils.js +10 -0
- package/dist/theme/theme-provider/utils/subscribeToSystemTheme.utils.js.map +1 -0
- package/dist/theme/tokens/primitives/breakpoints.const.cjs +2 -0
- package/dist/theme/tokens/primitives/breakpoints.const.cjs.map +1 -0
- package/dist/theme/tokens/primitives/breakpoints.const.js +19 -0
- package/dist/theme/tokens/primitives/breakpoints.const.js.map +1 -0
- package/dist/theme/tokens/primitives/palette.const.cjs +2 -0
- package/dist/theme/tokens/primitives/palette.const.cjs.map +1 -0
- package/dist/theme/tokens/primitives/palette.const.js +602 -0
- package/dist/theme/tokens/primitives/palette.const.js.map +1 -0
- package/dist/theme/tokens/primitives/scales.const.cjs +2 -0
- package/dist/theme/tokens/primitives/scales.const.cjs.map +1 -0
- package/dist/theme/tokens/primitives/scales.const.js +125 -0
- package/dist/theme/tokens/primitives/scales.const.js.map +1 -0
- package/dist/theme/tokens/shared/sharedThemeTokens.const.cjs +2 -0
- package/dist/theme/tokens/shared/sharedThemeTokens.const.cjs.map +1 -0
- package/dist/theme/tokens/shared/sharedThemeTokens.const.js +21 -0
- package/dist/theme/tokens/shared/sharedThemeTokens.const.js.map +1 -0
- package/dist/theme/utils/colors/create-accent/constants/index.cjs +2 -0
- package/dist/theme/utils/colors/create-accent/constants/index.cjs.map +1 -0
- package/dist/theme/utils/colors/create-accent/constants/index.js +9 -0
- package/dist/theme/utils/colors/create-accent/constants/index.js.map +1 -0
- package/dist/theme/utils/colors/create-accent/createAccent.utils.cjs +2 -0
- package/dist/theme/utils/colors/create-accent/createAccent.utils.cjs.map +1 -0
- package/dist/theme/utils/colors/create-accent/createAccent.utils.js +23 -0
- package/dist/theme/utils/colors/create-accent/createAccent.utils.js.map +1 -0
- package/dist/theme/utils/colors/mixColors.utils.cjs +2 -0
- package/dist/theme/utils/colors/mixColors.utils.cjs.map +1 -0
- package/dist/theme/utils/colors/mixColors.utils.js +12 -0
- package/dist/theme/utils/colors/mixColors.utils.js.map +1 -0
- package/dist/theme/utils/flavors/collect-flavor-styles/collectFlavorStyles.utils.cjs +2 -0
- package/dist/theme/utils/flavors/collect-flavor-styles/collectFlavorStyles.utils.cjs.map +1 -0
- package/dist/theme/utils/flavors/collect-flavor-styles/collectFlavorStyles.utils.js +24 -0
- package/dist/theme/utils/flavors/collect-flavor-styles/collectFlavorStyles.utils.js.map +1 -0
- package/dist/theme/utils/flavors/constants/index.cjs +2 -0
- package/dist/theme/utils/flavors/constants/index.cjs.map +1 -0
- package/dist/theme/utils/flavors/constants/index.js +6 -0
- package/dist/theme/utils/flavors/constants/index.js.map +1 -0
- package/dist/theme/utils/flavors/createFlavor.utils.cjs +2 -0
- package/dist/theme/utils/flavors/createFlavor.utils.cjs.map +1 -0
- package/dist/theme/utils/flavors/createFlavor.utils.js +20 -0
- package/dist/theme/utils/flavors/createFlavor.utils.js.map +1 -0
- package/dist/theme/utils/flavors/get-flavor-css/getFlavorCss.utils.cjs +3 -0
- package/dist/theme/utils/flavors/get-flavor-css/getFlavorCss.utils.cjs.map +1 -0
- package/dist/theme/utils/flavors/get-flavor-css/getFlavorCss.utils.js +19 -0
- package/dist/theme/utils/flavors/get-flavor-css/getFlavorCss.utils.js.map +1 -0
- package/dist/theme/utils/flavors/get-flavor-css/utils/get-flavor-selectors/getFlavorSelectors.utils.cjs +2 -0
- package/dist/theme/utils/flavors/get-flavor-css/utils/get-flavor-selectors/getFlavorSelectors.utils.cjs.map +1 -0
- package/dist/theme/utils/flavors/get-flavor-css/utils/get-flavor-selectors/getFlavorSelectors.utils.js +13 -0
- package/dist/theme/utils/flavors/get-flavor-css/utils/get-flavor-selectors/getFlavorSelectors.utils.js.map +1 -0
- package/dist/theme/utils/flavors/get-flavor-css/utils/serializeDeclarations.utils.cjs +2 -0
- package/dist/theme/utils/flavors/get-flavor-css/utils/serializeDeclarations.utils.cjs.map +1 -0
- package/dist/theme/utils/flavors/get-flavor-css/utils/serializeDeclarations.utils.js +5 -0
- package/dist/theme/utils/flavors/get-flavor-css/utils/serializeDeclarations.utils.js.map +1 -0
- package/dist/theme/utils/flavors/getFlavorReferenceName.utils.cjs +2 -0
- package/dist/theme/utils/flavors/getFlavorReferenceName.utils.cjs.map +1 -0
- package/dist/theme/utils/flavors/getFlavorReferenceName.utils.js +6 -0
- package/dist/theme/utils/flavors/getFlavorReferenceName.utils.js.map +1 -0
- package/dist/theme/utils/guards/isRecord.utils.cjs +2 -0
- package/dist/theme/utils/guards/isRecord.utils.cjs.map +1 -0
- package/dist/theme/utils/guards/isRecord.utils.js +5 -0
- package/dist/theme/utils/guards/isRecord.utils.js.map +1 -0
- package/dist/theme/utils/server-rendering/get-theme-root-props/getThemeRootProps.utils.cjs +2 -0
- package/dist/theme/utils/server-rendering/get-theme-root-props/getThemeRootProps.utils.cjs.map +1 -0
- package/dist/theme/utils/server-rendering/get-theme-root-props/getThemeRootProps.utils.js +14 -0
- package/dist/theme/utils/server-rendering/get-theme-root-props/getThemeRootProps.utils.js.map +1 -0
- package/dist/theme/utils/tokens/assertCompleteTheme.utils.cjs +2 -0
- package/dist/theme/utils/tokens/assertCompleteTheme.utils.cjs.map +1 -0
- package/dist/theme/utils/tokens/assertCompleteTheme.utils.js +9 -0
- package/dist/theme/utils/tokens/assertCompleteTheme.utils.js.map +1 -0
- package/dist/theme/utils/tokens/collect-token-styles/collectTokenStyles.utils.cjs +2 -0
- package/dist/theme/utils/tokens/collect-token-styles/collectTokenStyles.utils.cjs.map +1 -0
- package/dist/theme/utils/tokens/collect-token-styles/collectTokenStyles.utils.js +25 -0
- package/dist/theme/utils/tokens/collect-token-styles/collectTokenStyles.utils.js.map +1 -0
- package/dist/theme/utils/tokens/create-theme-tokens/createThemeTokens.utils.cjs +2 -0
- package/dist/theme/utils/tokens/create-theme-tokens/createThemeTokens.utils.cjs.map +1 -0
- package/dist/theme/utils/tokens/create-theme-tokens/createThemeTokens.utils.js +12 -0
- package/dist/theme/utils/tokens/create-theme-tokens/createThemeTokens.utils.js.map +1 -0
- package/dist/theme/utils/tokens/create-theme-tokens/utils/mergeTokens.utils.cjs +2 -0
- package/dist/theme/utils/tokens/create-theme-tokens/utils/mergeTokens.utils.cjs.map +1 -0
- package/dist/theme/utils/tokens/create-theme-tokens/utils/mergeTokens.utils.js +9 -0
- package/dist/theme/utils/tokens/create-theme-tokens/utils/mergeTokens.utils.js.map +1 -0
- package/dist/theme/utils/tokens/getSharedTokenStyles.utils.cjs +2 -0
- package/dist/theme/utils/tokens/getSharedTokenStyles.utils.cjs.map +1 -0
- package/dist/theme/utils/tokens/getSharedTokenStyles.utils.js +12 -0
- package/dist/theme/utils/tokens/getSharedTokenStyles.utils.js.map +1 -0
- package/dist/theme/utils/tokens/getThemeTokenStyles.utils.cjs +2 -0
- package/dist/theme/utils/tokens/getThemeTokenStyles.utils.cjs.map +1 -0
- package/dist/theme/utils/tokens/getThemeTokenStyles.utils.js +12 -0
- package/dist/theme/utils/tokens/getThemeTokenStyles.utils.js.map +1 -0
- package/dist/theme/utils/validation/assertFlavorName.utils.cjs +2 -0
- package/dist/theme/utils/validation/assertFlavorName.utils.cjs.map +1 -0
- package/dist/theme/utils/validation/assertFlavorName.utils.js +10 -0
- package/dist/theme/utils/validation/assertFlavorName.utils.js.map +1 -0
- package/dist/theme/utils/validation/assertThemeName.utils.cjs +2 -0
- package/dist/theme/utils/validation/assertThemeName.utils.cjs.map +1 -0
- package/dist/theme/utils/validation/assertThemeName.utils.js +9 -0
- package/dist/theme/utils/validation/assertThemeName.utils.js.map +1 -0
- package/package.json +83 -3
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
// src/theme/tokens/primitives/scales.const.ts
|
|
2
|
+
var e = {
|
|
3
|
+
0: "0",
|
|
4
|
+
1: "1px",
|
|
5
|
+
2: "0.125rem",
|
|
6
|
+
4: "0.25rem",
|
|
7
|
+
6: "0.375rem",
|
|
8
|
+
8: "0.5rem",
|
|
9
|
+
10: "0.625rem",
|
|
10
|
+
12: "0.75rem",
|
|
11
|
+
14: "0.875rem",
|
|
12
|
+
16: "1rem",
|
|
13
|
+
18: "1.125rem",
|
|
14
|
+
20: "1.25rem",
|
|
15
|
+
24: "1.5rem",
|
|
16
|
+
28: "1.75rem",
|
|
17
|
+
32: "2rem",
|
|
18
|
+
36: "2.25rem",
|
|
19
|
+
40: "2.5rem",
|
|
20
|
+
44: "2.75rem",
|
|
21
|
+
48: "3rem",
|
|
22
|
+
56: "3.5rem",
|
|
23
|
+
64: "4rem",
|
|
24
|
+
80: "5rem",
|
|
25
|
+
96: "6rem",
|
|
26
|
+
112: "7rem",
|
|
27
|
+
128: "8rem"
|
|
28
|
+
}, t = {
|
|
29
|
+
none: "0",
|
|
30
|
+
xs: "0.125rem",
|
|
31
|
+
sm: "0.25rem",
|
|
32
|
+
md: "0.375rem",
|
|
33
|
+
lg: "0.5rem",
|
|
34
|
+
xl: "0.75rem",
|
|
35
|
+
"2xl": "1rem",
|
|
36
|
+
"3xl": "1.5rem",
|
|
37
|
+
full: "9999px"
|
|
38
|
+
}, n = {
|
|
39
|
+
sans: "ui-sans-serif, system-ui, -apple-system, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif",
|
|
40
|
+
serif: "ui-serif, Georgia, Cambria, \"Times New Roman\", Times, serif",
|
|
41
|
+
mono: "ui-monospace, SFMono-Regular, \"SF Mono\", Menlo, Consolas, \"Liberation Mono\", monospace"
|
|
42
|
+
}, r = {
|
|
43
|
+
10: "0.625rem",
|
|
44
|
+
12: "0.75rem",
|
|
45
|
+
14: "0.875rem",
|
|
46
|
+
16: "1rem",
|
|
47
|
+
18: "1.125rem",
|
|
48
|
+
20: "1.25rem",
|
|
49
|
+
24: "1.5rem",
|
|
50
|
+
28: "1.75rem",
|
|
51
|
+
32: "2rem",
|
|
52
|
+
36: "2.25rem",
|
|
53
|
+
40: "2.5rem",
|
|
54
|
+
48: "3rem",
|
|
55
|
+
60: "3.75rem",
|
|
56
|
+
72: "4.5rem"
|
|
57
|
+
}, i = {
|
|
58
|
+
regular: "400",
|
|
59
|
+
medium: "500",
|
|
60
|
+
semibold: "600",
|
|
61
|
+
bold: "700"
|
|
62
|
+
}, a = {
|
|
63
|
+
none: "1",
|
|
64
|
+
tight: "1.2",
|
|
65
|
+
snug: "1.35",
|
|
66
|
+
normal: "1.5",
|
|
67
|
+
relaxed: "1.65"
|
|
68
|
+
}, o = {
|
|
69
|
+
tighter: "-0.02em",
|
|
70
|
+
tight: "-0.01em",
|
|
71
|
+
normal: "0",
|
|
72
|
+
wide: "0.02em",
|
|
73
|
+
wider: "0.05em",
|
|
74
|
+
widest: "0.08em"
|
|
75
|
+
}, s = {
|
|
76
|
+
hidden: "0",
|
|
77
|
+
disabled: "0.48",
|
|
78
|
+
muted: "0.72",
|
|
79
|
+
visible: "1"
|
|
80
|
+
}, c = {
|
|
81
|
+
width: "2px",
|
|
82
|
+
offset: "2px"
|
|
83
|
+
}, l = {
|
|
84
|
+
hide: "-1",
|
|
85
|
+
base: "0",
|
|
86
|
+
docked: "10",
|
|
87
|
+
sticky: "100",
|
|
88
|
+
banner: "200",
|
|
89
|
+
overlay: "1100",
|
|
90
|
+
modal: "1200",
|
|
91
|
+
dropdown: "1250",
|
|
92
|
+
popover: "1300",
|
|
93
|
+
toast: "1350",
|
|
94
|
+
tooltip: "1400"
|
|
95
|
+
}, u = {
|
|
96
|
+
none: "none",
|
|
97
|
+
low: "0 1px 2px 0 rgb(0 0 0 / 0.05)",
|
|
98
|
+
raised: "0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)",
|
|
99
|
+
floating: "0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",
|
|
100
|
+
overlay: "0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",
|
|
101
|
+
modal: "0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)"
|
|
102
|
+
}, d = {
|
|
103
|
+
none: "none",
|
|
104
|
+
low: "drop-shadow(0 1px 2px rgb(0 0 0 / 0.05))",
|
|
105
|
+
raised: "drop-shadow(0 1px 3px rgb(0 0 0 / 0.1)) drop-shadow(0 1px 2px rgb(0 0 0 / 0.1))",
|
|
106
|
+
floating: "drop-shadow(0 4px 6px rgb(0 0 0 / 0.1)) drop-shadow(0 2px 4px rgb(0 0 0 / 0.1))",
|
|
107
|
+
overlay: "drop-shadow(0 10px 15px rgb(0 0 0 / 0.1)) drop-shadow(0 4px 6px rgb(0 0 0 / 0.1))",
|
|
108
|
+
modal: "drop-shadow(0 20px 25px rgb(0 0 0 / 0.1)) drop-shadow(0 8px 10px rgb(0 0 0 / 0.1))"
|
|
109
|
+
}, f = {
|
|
110
|
+
instant: "0ms",
|
|
111
|
+
fast: "120ms",
|
|
112
|
+
normal: "180ms",
|
|
113
|
+
slow: "240ms",
|
|
114
|
+
slower: "320ms"
|
|
115
|
+
}, p = {
|
|
116
|
+
linear: "linear",
|
|
117
|
+
standard: "cubic-bezier(0.2, 0, 0, 1)",
|
|
118
|
+
in: "cubic-bezier(0.4, 0, 1, 1)",
|
|
119
|
+
out: "cubic-bezier(0, 0, 0.2, 1)",
|
|
120
|
+
inOut: "cubic-bezier(0.4, 0, 0.2, 1)",
|
|
121
|
+
overshoot: "cubic-bezier(0.2, 0, 0, 1.2)"
|
|
122
|
+
};
|
|
123
|
+
export { d as dropShadows, f as durations, p as easings, c as focusRingSizes, n as fontFamilies, r as fontSizes, i as fontWeights, o as letterSpacings, a as lineHeights, s as opacities, t as radii, u as shadows, e as spaces, l as zIndices };
|
|
124
|
+
|
|
125
|
+
//# sourceMappingURL=scales.const.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scales.const.js","names":["spaces","radii","fontFamilies","fontSizes","fontWeights","lineHeights","letterSpacings","opacities","focusRingSizes","zIndices","shadows","dropShadows","durations","easings"],"sources":["../../../../src/theme/tokens/primitives/scales.const.ts"],"sourcesContent":["/**\n * Spacing scale, keyed by pixel reference at a 16px root. Each key names its\n * value, so spaces cannot be overridden anywhere: every token API refuses\n * them, since an override would make the name wrong.\n */\nexport const spaces = {\n 0: '0',\n 1: '1px',\n 2: '0.125rem',\n 4: '0.25rem',\n 6: '0.375rem',\n 8: '0.5rem',\n 10: '0.625rem',\n 12: '0.75rem',\n 14: '0.875rem',\n 16: '1rem',\n 18: '1.125rem',\n 20: '1.25rem',\n 24: '1.5rem',\n 28: '1.75rem',\n 32: '2rem',\n 36: '2.25rem',\n 40: '2.5rem',\n 44: '2.75rem',\n 48: '3rem',\n 56: '3.5rem',\n 64: '4rem',\n 80: '5rem',\n 96: '6rem',\n 112: '7rem',\n 128: '8rem',\n} as const;\n\n/**\n * Corner radius scale, ranked from `none` to `3xl`, plus `full` for pills and\n * circles. Ranks do not name their value, so the `tokens` prop can override\n * them.\n */\nexport const radii = {\n none: '0',\n xs: '0.125rem',\n sm: '0.25rem',\n md: '0.375rem',\n lg: '0.5rem',\n xl: '0.75rem',\n '2xl': '1rem',\n '3xl': '1.5rem',\n full: '9999px',\n} as const;\n\nexport const fontFamilies = {\n sans: 'ui-sans-serif, system-ui, -apple-system, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif',\n serif: 'ui-serif, Georgia, Cambria, \"Times New Roman\", Times, serif',\n mono: 'ui-monospace, SFMono-Regular, \"SF Mono\", Menlo, Consolas, \"Liberation Mono\", monospace',\n} as const;\n\nexport const fontSizes = {\n 10: '0.625rem',\n 12: '0.75rem',\n 14: '0.875rem',\n 16: '1rem',\n 18: '1.125rem',\n 20: '1.25rem',\n 24: '1.5rem',\n 28: '1.75rem',\n 32: '2rem',\n 36: '2.25rem',\n 40: '2.5rem',\n 48: '3rem',\n 60: '3.75rem',\n 72: '4.5rem',\n} as const;\n\nexport const fontWeights = {\n regular: '400',\n medium: '500',\n semibold: '600',\n bold: '700',\n} as const;\n\nexport const lineHeights = {\n none: '1',\n tight: '1.2',\n snug: '1.35',\n normal: '1.5',\n relaxed: '1.65',\n} as const;\n\nexport const letterSpacings = {\n tighter: '-0.02em',\n tight: '-0.01em',\n normal: '0',\n wide: '0.02em',\n wider: '0.05em',\n widest: '0.08em',\n} as const;\n\nexport const opacities = {\n hidden: '0',\n disabled: '0.48',\n muted: '0.72',\n visible: '1',\n} as const;\n\n/** Geometry of the keyboard focus indicator. */\nexport const focusRingSizes = {\n width: '2px',\n offset: '2px',\n} as const;\n\nexport const zIndices = {\n hide: '-1',\n base: '0',\n docked: '10',\n sticky: '100',\n banner: '200',\n overlay: '1100',\n modal: '1200',\n dropdown: '1250',\n popover: '1300',\n toast: '1350',\n tooltip: '1400',\n} as const;\n\n/**\n * Box shadows ranked by elevation, from flush with the page to modal dialogs,\n * each named after the role of the layer it lifts. Shared by every mode: in\n * dark mode, elevation mostly relies on surfaces and borders.\n */\nexport const shadows = {\n none: 'none',\n low: '0 1px 2px 0 rgb(0 0 0 / 0.05)',\n raised: '0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)',\n floating:\n '0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)',\n overlay:\n '0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)',\n modal: '0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)',\n} as const;\n\n/**\n * `filter` drop shadows matching the `shadows` levels, which follow the\n * painted shape (arrows, transparent images) instead of the border box.\n */\nexport const dropShadows = {\n none: 'none',\n low: 'drop-shadow(0 1px 2px rgb(0 0 0 / 0.05))',\n raised: 'drop-shadow(0 1px 3px rgb(0 0 0 / 0.1)) drop-shadow(0 1px 2px rgb(0 0 0 / 0.1))',\n floating:\n 'drop-shadow(0 4px 6px rgb(0 0 0 / 0.1)) drop-shadow(0 2px 4px rgb(0 0 0 / 0.1))',\n overlay:\n 'drop-shadow(0 10px 15px rgb(0 0 0 / 0.1)) drop-shadow(0 4px 6px rgb(0 0 0 / 0.1))',\n modal: 'drop-shadow(0 20px 25px rgb(0 0 0 / 0.1)) drop-shadow(0 8px 10px rgb(0 0 0 / 0.1))',\n} as const;\n\nexport const durations = {\n instant: '0ms',\n fast: '120ms',\n normal: '180ms',\n slow: '240ms',\n slower: '320ms',\n} as const;\n\nexport const easings = {\n linear: 'linear',\n standard: 'cubic-bezier(0.2, 0, 0, 1)',\n in: 'cubic-bezier(0.4, 0, 1, 1)',\n out: 'cubic-bezier(0, 0, 0.2, 1)',\n inOut: 'cubic-bezier(0.4, 0, 0.2, 1)',\n overshoot: 'cubic-bezier(0.2, 0, 0, 1.2)',\n} as const;\n"],"mappings":";AAKA,IAAaA,IAAS;CAClB,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,KAAK;CACL,KAAK;AACT,GAOaC,IAAQ;CACjB,MAAM;CACN,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,OAAO;CACP,OAAO;CACP,MAAM;AACV,GAEaC,IAAe;CACxB,MAAM;CACN,OAAO;CACP,MAAM;AACV,GAEaC,IAAY;CACrB,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;AACR,GAEaC,IAAc;CACvB,SAAS;CACT,QAAQ;CACR,UAAU;CACV,MAAM;AACV,GAEaC,IAAc;CACvB,MAAM;CACN,OAAO;CACP,MAAM;CACN,QAAQ;CACR,SAAS;AACb,GAEaC,IAAiB;CAC1B,SAAS;CACT,OAAO;CACP,QAAQ;CACR,MAAM;CACN,OAAO;CACP,QAAQ;AACZ,GAEaC,IAAY;CACrB,QAAQ;CACR,UAAU;CACV,OAAO;CACP,SAAS;AACb,GAGaC,IAAiB;CAC1B,OAAO;CACP,QAAQ;AACZ,GAEaC,IAAW;CACpB,MAAM;CACN,MAAM;CACN,QAAQ;CACR,QAAQ;CACR,QAAQ;CACR,SAAS;CACT,OAAO;CACP,UAAU;CACV,SAAS;CACT,OAAO;CACP,SAAS;AACb,GAOaC,IAAU;CACnB,MAAM;CACN,KAAK;CACL,QAAQ;CACR,UACI;CACJ,SACI;CACJ,OAAO;AACX,GAMaC,IAAc;CACvB,MAAM;CACN,KAAK;CACL,QAAQ;CACR,UACI;CACJ,SACI;CACJ,OAAO;AACX,GAEaC,IAAY;CACrB,SAAS;CACT,MAAM;CACN,QAAQ;CACR,MAAM;CACN,QAAQ;AACZ,GAEaC,IAAU;CACnB,QAAQ;CACR,UAAU;CACV,IAAI;CACJ,KAAK;CACL,OAAO;CACP,WAAW;AACf"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e=require("../primitives/scales.const.cjs");var t={space:e.spaces,radius:e.radii,fontFamily:e.fontFamilies,fontSize:e.fontSizes,fontWeight:e.fontWeights,lineHeight:e.lineHeights,letterSpacing:e.letterSpacings,opacity:e.opacities,focusRing:e.focusRingSizes,shadow:e.shadows,dropShadow:e.dropShadows,zIndex:e.zIndices,duration:e.durations,easing:e.easings};exports.sharedThemeTokens=t;
|
|
2
|
+
//# sourceMappingURL=sharedThemeTokens.const.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sharedThemeTokens.const.cjs","names":["spaces","radii","fontFamilies","fontSizes","fontWeights","lineHeights","letterSpacings","opacities","focusRingSizes","shadows","dropShadows","zIndices","durations","easings","require_scales_const","sharedThemeTokens"],"sources":["../../../../src/theme/tokens/shared/sharedThemeTokens.const.ts"],"sourcesContent":["import {\n dropShadows,\n durations,\n easings,\n focusRingSizes,\n fontFamilies,\n fontSizes,\n fontWeights,\n letterSpacings,\n lineHeights,\n opacities,\n radii,\n shadows,\n spaces,\n zIndices,\n} from '@theme/tokens/primitives/scales.const';\n\n/** Mode-independent scales shared by every flavor and mode. */\nexport const sharedThemeTokens = {\n space: spaces,\n radius: radii,\n fontFamily: fontFamilies,\n fontSize: fontSizes,\n fontWeight: fontWeights,\n lineHeight: lineHeights,\n letterSpacing: letterSpacings,\n opacity: opacities,\n focusRing: focusRingSizes,\n shadow: shadows,\n dropShadow: dropShadows,\n zIndex: zIndices,\n duration: durations,\n easing: easings,\n};\n"],"mappings":"A,kDAkBA,IAAae,EAAoB,CAC7B,MAAOf,EAAAA,OACP,OAAQC,EAAAA,MACR,WAAYC,EAAAA,aACZ,SAAUC,EAAAA,UACV,WAAYC,EAAAA,YACZ,WAAYC,EAAAA,YACZ,cAAeC,EAAAA,eACf,QAASC,EAAAA,UACT,UAAWC,EAAAA,eACX,OAAQC,EAAAA,QACR,WAAYC,EAAAA,YACZ,OAAQC,EAAAA,SACR,SAAUC,EAAAA,UACV,OAAQC,EAAAA,OACZ,E"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { dropShadows as e, durations as t, easings as n, focusRingSizes as r, fontFamilies as i, fontSizes as a, fontWeights as o, letterSpacings as s, lineHeights as c, opacities as l, radii as u, shadows as d, spaces as f, zIndices as p } from "../primitives/scales.const.js";
|
|
2
|
+
// src/theme/tokens/shared/sharedThemeTokens.const.ts
|
|
3
|
+
var m = {
|
|
4
|
+
space: f,
|
|
5
|
+
radius: u,
|
|
6
|
+
fontFamily: i,
|
|
7
|
+
fontSize: a,
|
|
8
|
+
fontWeight: o,
|
|
9
|
+
lineHeight: c,
|
|
10
|
+
letterSpacing: s,
|
|
11
|
+
opacity: l,
|
|
12
|
+
focusRing: r,
|
|
13
|
+
shadow: d,
|
|
14
|
+
dropShadow: e,
|
|
15
|
+
zIndex: p,
|
|
16
|
+
duration: t,
|
|
17
|
+
easing: n
|
|
18
|
+
};
|
|
19
|
+
export { m as sharedThemeTokens };
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=sharedThemeTokens.const.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sharedThemeTokens.const.js","names":["sharedThemeTokens","spaces","radii","fontFamilies","fontSizes","fontWeights","lineHeights","letterSpacings","opacities","focusRingSizes","shadows","dropShadows","zIndices","durations","easings"],"sources":["../../../../src/theme/tokens/shared/sharedThemeTokens.const.ts"],"sourcesContent":["import {\n dropShadows,\n durations,\n easings,\n focusRingSizes,\n fontFamilies,\n fontSizes,\n fontWeights,\n letterSpacings,\n lineHeights,\n opacities,\n radii,\n shadows,\n spaces,\n zIndices,\n} from '@theme/tokens/primitives/scales.const';\n\n/** Mode-independent scales shared by every flavor and mode. */\nexport const sharedThemeTokens = {\n space: spaces,\n radius: radii,\n fontFamily: fontFamilies,\n fontSize: fontSizes,\n fontWeight: fontWeights,\n lineHeight: lineHeights,\n letterSpacing: letterSpacings,\n opacity: opacities,\n focusRing: focusRingSizes,\n shadow: shadows,\n dropShadow: dropShadows,\n zIndex: zIndices,\n duration: durations,\n easing: easings,\n};\n"],"mappings":";;AAkBA,IAAaA,IAAoB;CAC7B,OAAOC;CACP,QAAQC;CACR,YAAYC;CACZ,UAAUC;CACV,YAAYC;CACZ,YAAYC;CACZ,eAAeC;CACf,SAASC;CACT,WAAWC;CACX,QAAQC;CACR,YAAYC;CACZ,QAAQC;CACR,UAAUC;CACV,QAAQC;AACZ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["palette","require_palette_const","accentForegrounds"],"sources":["../../../../../../src/theme/utils/colors/create-accent/constants/index.ts"],"sourcesContent":["import { palette } from '@theme/tokens';\nimport type { AccentTone } from '@theme/utils/colors/create-accent/types';\n\n/** Text and icons on solid fills: white on deep hues, ink on bright hues. */\nexport const accentForegrounds: Readonly<Record<AccentTone, string>> = {\n deep: palette.white,\n bright: palette.gray[950],\n};\n"],"mappings":"A,mEAIA,IAAaE,EAA0D,CACnE,KAAMF,EAAAA,QAAQ,MACd,OAAQA,EAAAA,QAAQ,KAAK,IACzB,E"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { palette as e } from "../../../../tokens/primitives/palette.const.js";
|
|
2
|
+
// src/theme/utils/colors/create-accent/constants/index.ts
|
|
3
|
+
var t = {
|
|
4
|
+
deep: e.white,
|
|
5
|
+
bright: e.gray[950]
|
|
6
|
+
};
|
|
7
|
+
export { t as accentForegrounds };
|
|
8
|
+
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["accentForegrounds","palette"],"sources":["../../../../../../src/theme/utils/colors/create-accent/constants/index.ts"],"sourcesContent":["import { palette } from '@theme/tokens';\nimport type { AccentTone } from '@theme/utils/colors/create-accent/types';\n\n/** Text and icons on solid fills: white on deep hues, ink on bright hues. */\nexport const accentForegrounds: Readonly<Record<AccentTone, string>> = {\n deep: palette.white,\n bright: palette.gray[950],\n};\n"],"mappings":";;AAIA,IAAaA,IAA0D;CACnE,MAAMC,EAAQ;CACd,QAAQA,EAAQ,KAAK;AACzB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e=require("./constants/index.cjs"),t=require("../mixColors.utils.cjs");var n=(n,r,{steps:i,tints:a,surface:o},s={})=>{let c=i[r],l=e=>t.mixColors(n[500],o,e);return{main:n[c.main],hover:n[c.hover],pressed:n[c.pressed],foreground:e.accentForegrounds[r],subtle:l(a.subtle),subtleHover:l(a.subtleHover),subtlePressed:l(a.subtlePressed),subtleForeground:n[c.subtleForeground],text:n[c.text],border:n[c.border],subtleBorder:l(a.subtleBorder),...s}};exports.createAccent=n;
|
|
2
|
+
//# sourceMappingURL=createAccent.utils.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createAccent.utils.cjs","names":["mixColors","accentForegrounds","require_index","require_mixColors_utils","createAccent","step","steps","tone","tint","ramp","surface","weight","tints","overrides"],"sources":["../../../../../src/theme/utils/colors/create-accent/createAccent.utils.ts"],"sourcesContent":["import type { PaletteRamp, ThemeColorAccent } from '@theme/types';\nimport { accentForegrounds } from '@theme/utils/colors/create-accent/constants';\nimport type {\n AccentScheme,\n AccentTone,\n} from '@theme/utils/colors/create-accent/types';\nimport { mixColors } from '@theme/utils/colors/mixColors.utils';\n\n/**\n * Builds an intent from a palette ramp: solid fills, text and borders pick\n * steps of the ramp, subtle fills tint the reference tone over the surface of\n * the color mode.\n *\n * @param ramp Palette ramp of the intent.\n * @param tone Lightness class of the hue, selecting the foreground and steps.\n * @param scheme Rules of the color mode.\n * @param scheme.steps Steps picked from the ramp, per tone.\n * @param scheme.tints Weights of the reference tone over the surface.\n * @param scheme.surface Surface the subtle fills are tinted over.\n * @param overrides Colors replacing the derived ones, for outlier hues.\n * @returns The intent colors.\n */\nexport const createAccent = (\n ramp: PaletteRamp,\n tone: AccentTone,\n { steps, tints, surface }: AccentScheme,\n overrides: Partial<ThemeColorAccent> = {},\n): ThemeColorAccent => {\n const step = steps[tone];\n\n /**\n * Tints the reference tone of the ramp over the surface of the mode.\n *\n * @param weight Weight of the reference tone, from 0 to 1.\n * @returns The opaque tinted color, `#rrggbb`.\n */\n const tint = (weight: number): string =>\n mixColors(ramp[500], surface, weight);\n\n return {\n main: ramp[step.main],\n hover: ramp[step.hover],\n pressed: ramp[step.pressed],\n foreground: accentForegrounds[tone],\n subtle: tint(tints.subtle),\n subtleHover: tint(tints.subtleHover),\n subtlePressed: tint(tints.subtlePressed),\n subtleForeground: ramp[step.subtleForeground],\n text: ramp[step.text],\n border: ramp[step.border],\n subtleBorder: tint(tints.subtleBorder),\n ...overrides,\n };\n};\n"],"mappings":"A,6EAsBA,IAAaI,GACT,EACA,EACA,CAAE,QAAO,QAAO,WAChB,EAAuC,CAAC,IACrB,CACnB,IAAMC,EAAOC,EAAMC,GAQbC,EAAQ,GACVR,EAAAA,UAAUS,EAAK,KAAMC,EAASC,CAAM,EAExC,MAAO,CACH,KAAMF,EAAKJ,EAAK,MAChB,MAAOI,EAAKJ,EAAK,OACjB,QAASI,EAAKJ,EAAK,SACnB,WAAYJ,EAAAA,kBAAkBM,GAC9B,OAAQC,EAAKI,EAAM,MAAM,EACzB,YAAaJ,EAAKI,EAAM,WAAW,EACnC,cAAeJ,EAAKI,EAAM,aAAa,EACvC,iBAAkBH,EAAKJ,EAAK,kBAC5B,KAAMI,EAAKJ,EAAK,MAChB,OAAQI,EAAKJ,EAAK,QAClB,aAAcG,EAAKI,EAAM,YAAY,EACrC,GAAGC,CACP,CACJ,E"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { accentForegrounds as e } from "./constants/index.js";
|
|
2
|
+
import { mixColors as t } from "../mixColors.utils.js";
|
|
3
|
+
// src/theme/utils/colors/create-accent/createAccent.utils.ts
|
|
4
|
+
var n = (n, r, { steps: i, tints: a, surface: o }, s = {}) => {
|
|
5
|
+
let c = i[r], l = (e) => t(n[500], o, e);
|
|
6
|
+
return {
|
|
7
|
+
main: n[c.main],
|
|
8
|
+
hover: n[c.hover],
|
|
9
|
+
pressed: n[c.pressed],
|
|
10
|
+
foreground: e[r],
|
|
11
|
+
subtle: l(a.subtle),
|
|
12
|
+
subtleHover: l(a.subtleHover),
|
|
13
|
+
subtlePressed: l(a.subtlePressed),
|
|
14
|
+
subtleForeground: n[c.subtleForeground],
|
|
15
|
+
text: n[c.text],
|
|
16
|
+
border: n[c.border],
|
|
17
|
+
subtleBorder: l(a.subtleBorder),
|
|
18
|
+
...s
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export { n as createAccent };
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=createAccent.utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createAccent.utils.js","names":["createAccent","step","steps","tone","tint","mixColors","ramp","surface","weight","accentForegrounds","tints","overrides"],"sources":["../../../../../src/theme/utils/colors/create-accent/createAccent.utils.ts"],"sourcesContent":["import type { PaletteRamp, ThemeColorAccent } from '@theme/types';\nimport { accentForegrounds } from '@theme/utils/colors/create-accent/constants';\nimport type {\n AccentScheme,\n AccentTone,\n} from '@theme/utils/colors/create-accent/types';\nimport { mixColors } from '@theme/utils/colors/mixColors.utils';\n\n/**\n * Builds an intent from a palette ramp: solid fills, text and borders pick\n * steps of the ramp, subtle fills tint the reference tone over the surface of\n * the color mode.\n *\n * @param ramp Palette ramp of the intent.\n * @param tone Lightness class of the hue, selecting the foreground and steps.\n * @param scheme Rules of the color mode.\n * @param scheme.steps Steps picked from the ramp, per tone.\n * @param scheme.tints Weights of the reference tone over the surface.\n * @param scheme.surface Surface the subtle fills are tinted over.\n * @param overrides Colors replacing the derived ones, for outlier hues.\n * @returns The intent colors.\n */\nexport const createAccent = (\n ramp: PaletteRamp,\n tone: AccentTone,\n { steps, tints, surface }: AccentScheme,\n overrides: Partial<ThemeColorAccent> = {},\n): ThemeColorAccent => {\n const step = steps[tone];\n\n /**\n * Tints the reference tone of the ramp over the surface of the mode.\n *\n * @param weight Weight of the reference tone, from 0 to 1.\n * @returns The opaque tinted color, `#rrggbb`.\n */\n const tint = (weight: number): string =>\n mixColors(ramp[500], surface, weight);\n\n return {\n main: ramp[step.main],\n hover: ramp[step.hover],\n pressed: ramp[step.pressed],\n foreground: accentForegrounds[tone],\n subtle: tint(tints.subtle),\n subtleHover: tint(tints.subtleHover),\n subtlePressed: tint(tints.subtlePressed),\n subtleForeground: ramp[step.subtleForeground],\n text: ramp[step.text],\n border: ramp[step.border],\n subtleBorder: tint(tints.subtleBorder),\n ...overrides,\n };\n};\n"],"mappings":";;;AAsBA,IAAaA,KACT,GACA,GACA,EAAE,UAAO,UAAO,cAChB,IAAuC,CAAC,MACrB;CACnB,IAAMC,IAAOC,EAAMC,IAQbC,KAAQ,MACVC,EAAUC,EAAK,MAAMC,GAASC,CAAM;CAExC,OAAO;EACH,MAAMF,EAAKL,EAAK;EAChB,OAAOK,EAAKL,EAAK;EACjB,SAASK,EAAKL,EAAK;EACnB,YAAYQ,EAAkBN;EAC9B,QAAQC,EAAKM,EAAM,MAAM;EACzB,aAAaN,EAAKM,EAAM,WAAW;EACnC,eAAeN,EAAKM,EAAM,aAAa;EACvC,kBAAkBJ,EAAKL,EAAK;EAC5B,MAAMK,EAAKL,EAAK;EAChB,QAAQK,EAAKL,EAAK;EAClB,cAAcG,EAAKM,EAAM,YAAY;EACrC,GAAGC;CACP;AACJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mixColors.utils.cjs","names":["mixColors","top","color","offset","bottom","base","weight"],"sources":["../../../../src/theme/utils/colors/mixColors.utils.ts"],"sourcesContent":["/**\n * Paints a color over another at the given weight, exactly like a translucent\n * layer composited by the browser, and returns the opaque result.\n *\n * @param color Hexadecimal color painted on top, `#rrggbb`.\n * @param base Hexadecimal color underneath, `#rrggbb`.\n * @param weight Opacity of `color`, from 0 to 1.\n * @returns The composited color, `#rrggbb`.\n */\nexport const mixColors = (\n color: string,\n base: string,\n weight: number,\n): string =>\n `#${[1, 3, 5]\n .map((offset) => {\n const top = Number.parseInt(color.slice(offset, offset + 2), 16);\n const bottom = Number.parseInt(base.slice(offset, offset + 2), 16);\n return Math.round(top * weight + bottom * (1 - weight))\n .toString(16)\n .padStart(2, '0');\n })\n .join('')}`;\n"],"mappings":"AASA,IAAaA,GACT,EACA,EACA,IAEA,IAAI,CAAC,EAAG,EAAG,CAAC,CAAC,CACR,IAAK,GAAW,CACb,IAAMC,EAAM,OAAO,SAASC,EAAM,MAAMC,EAAQA,EAAS,CAAC,EAAG,EAAE,EACzDC,EAAS,OAAO,SAASC,EAAK,MAAMF,EAAQA,EAAS,CAAC,EAAG,EAAE,EACjE,OAAO,KAAK,MAAMF,EAAMK,EAASF,GAAU,EAAIE,EAAO,CAAC,CAClD,SAAS,EAAE,CAAC,CACZ,SAAS,EAAG,GAAG,CACxB,CAAC,CAAC,CACD,KAAK,EAAE,I"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// src/theme/utils/colors/mixColors.utils.ts
|
|
2
|
+
var e = (e, t, n) => `#${[
|
|
3
|
+
1,
|
|
4
|
+
3,
|
|
5
|
+
5
|
|
6
|
+
].map((r) => {
|
|
7
|
+
let i = Number.parseInt(e.slice(r, r + 2), 16), a = Number.parseInt(t.slice(r, r + 2), 16);
|
|
8
|
+
return Math.round(i * n + a * (1 - n)).toString(16).padStart(2, "0");
|
|
9
|
+
}).join("")}`;
|
|
10
|
+
export { e as mixColors };
|
|
11
|
+
|
|
12
|
+
//# sourceMappingURL=mixColors.utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mixColors.utils.js","names":["mixColors","top","color","offset","bottom","base","weight"],"sources":["../../../../src/theme/utils/colors/mixColors.utils.ts"],"sourcesContent":["/**\n * Paints a color over another at the given weight, exactly like a translucent\n * layer composited by the browser, and returns the opaque result.\n *\n * @param color Hexadecimal color painted on top, `#rrggbb`.\n * @param base Hexadecimal color underneath, `#rrggbb`.\n * @param weight Opacity of `color`, from 0 to 1.\n * @returns The composited color, `#rrggbb`.\n */\nexport const mixColors = (\n color: string,\n base: string,\n weight: number,\n): string =>\n `#${[1, 3, 5]\n .map((offset) => {\n const top = Number.parseInt(color.slice(offset, offset + 2), 16);\n const bottom = Number.parseInt(base.slice(offset, offset + 2), 16);\n return Math.round(top * weight + bottom * (1 - weight))\n .toString(16)\n .padStart(2, '0');\n })\n .join('')}`;\n"],"mappings":";AASA,IAAaA,KACT,GACA,GACA,MAEA,IAAI;CAAC;CAAG;CAAG;AAAC,CAAC,CACR,KAAK,MAAW;CACb,IAAMC,IAAM,OAAO,SAASC,EAAM,MAAMC,GAAQA,IAAS,CAAC,GAAG,EAAE,GACzDC,IAAS,OAAO,SAASC,EAAK,MAAMF,GAAQA,IAAS,CAAC,GAAG,EAAE;CACjE,OAAO,KAAK,MAAMF,IAAMK,IAASF,KAAU,IAAIE,EAAO,CAAC,CAClD,SAAS,EAAE,CAAC,CACZ,SAAS,GAAG,GAAG;AACxB,CAAC,CAAC,CACD,KAAK,EAAE"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e=require("../constants/index.cjs"),t=require("../../guards/isRecord.utils.cjs"),n=require("../../tokens/collect-token-styles/collectTokenStyles.utils.cjs"),r=require("../../validation/assertFlavorName.utils.cjs");var i=i=>{if(!t.isRecord(i))throw TypeError(`A flavor must be an object.`);let a=r.assertFlavorName(i.name,`flavor.name`),o=r=>{let o=i[r];if(!t.isRecord(o))throw TypeError(`Flavor "${a}" must define a ${r} theme.`);let s={};n.collectTokenStyles(e.flavorContract,{color:o.color},s,{isComplete:!0});for(let[t,n]of Object.entries(s))if(e.unsafeCssValuePattern.test(n))throw TypeError(`Flavor "${a}" sets ${t} to ${JSON.stringify(n)}, which contains a brace, semicolon, "<", "!", quote, backslash or comment delimiter.`);return s};return{name:a,light:o(`light`),dark:o(`dark`)}};exports.collectFlavorStyles=i;
|
|
2
|
+
//# sourceMappingURL=collectFlavorStyles.utils.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collectFlavorStyles.utils.cjs","names":["isRecord","assertFlavorName","flavorContract","unsafeCssValuePattern","require_index","require_isRecord_utils","require_collectTokenStyles_utils","require_assertFlavorName_utils","collectFlavorStyles","flavor","name","collectMode","theme","mode","styles","property","value"],"sources":["../../../../../src/theme/utils/flavors/collect-flavor-styles/collectFlavorStyles.utils.ts"],"sourcesContent":["import type { TokenStyles } from '@theme/types';\nimport type { FlavorStyles } from '@theme/utils/flavors/collect-flavor-styles/types';\nimport {\n flavorContract,\n unsafeCssValuePattern,\n} from '@theme/utils/flavors/constants';\nimport { isRecord } from '@theme/utils/guards/isRecord.utils';\nimport { collectTokenStyles } from '@theme/utils/tokens/collect-token-styles/collectTokenStyles.utils';\nimport { assertFlavorName } from '@theme/utils/validation/assertFlavorName.utils';\n\n/**\n * Validates a flavor and collects the custom properties of its colors, per\n * mode. Other token groups of its themes are ignored.\n *\n * @param flavor Candidate flavor.\n * @returns The name and the custom properties of each mode.\n * @throws {TypeError} When the name is invalid, a mode is missing, or a\n * color is missing, unknown, empty or unsafe in a stylesheet.\n */\nexport const collectFlavorStyles = (flavor: unknown): FlavorStyles => {\n if (!isRecord(flavor)) {\n throw new TypeError('A flavor must be an object.');\n }\n\n const name = assertFlavorName(flavor.name, 'flavor.name');\n\n /**\n * Collects the custom properties of one mode of the flavor and rejects\n * the values that could escape their declaration in a stylesheet.\n *\n * @param mode Mode to collect.\n * @returns The custom properties of the mode.\n * @throws {TypeError} When the mode or one of its tokens is invalid.\n */\n const collectMode = (mode: 'light' | 'dark'): TokenStyles => {\n const theme = flavor[mode];\n\n if (!isRecord(theme)) {\n throw new TypeError(\n `Flavor \"${name}\" must define a ${mode} theme.`,\n );\n }\n\n const styles: Record<string, string> = {};\n\n collectTokenStyles(flavorContract, { color: theme.color }, styles, {\n isComplete: true,\n });\n\n for (const [property, value] of Object.entries(styles)) {\n if (unsafeCssValuePattern.test(value)) {\n throw new TypeError(\n `Flavor \"${name}\" sets ${property} to ${JSON.stringify(value)}, which contains a brace, semicolon, \"<\", \"!\", quote, backslash or comment delimiter.`,\n );\n }\n }\n\n return styles;\n };\n\n return { name, light: collectMode('light'), dark: collectMode('dark') };\n};\n"],"mappings":"A,4NAmBA,IAAaQ,EAAuB,GAAkC,CAClE,GAAI,CAACR,EAAAA,SAASS,CAAM,EAChB,MAAU,UAAU,6BAA6B,EAGrD,IAAMC,EAAOT,EAAAA,iBAAiBQ,EAAO,KAAM,aAAa,EAUlDE,EAAe,GAAwC,CACzD,IAAMC,EAAQH,EAAOI,GAErB,GAAI,CAACb,EAAAA,SAASY,CAAK,EACf,MAAU,UACN,WAAWF,EAAK,kBAAkBG,EAAK,QAC3C,EAGJ,IAAMC,EAAiC,CAAC,EAExCR,EAAA,mBAAmBJ,EAAAA,eAAgB,CAAE,MAAOU,EAAM,KAAM,EAAGE,EAAQ,CAC/D,WAAY,EAChB,CAAC,EAED,IAAK,GAAM,CAACC,EAAUC,KAAU,OAAO,QAAQF,CAAM,EACjD,GAAIX,EAAAA,sBAAsB,KAAKa,CAAK,EAChC,MAAU,UACN,WAAWN,EAAK,SAASK,EAAS,MAAM,KAAK,UAAUC,CAAK,EAAE,sFAClE,EAIR,OAAOF,CACX,EAEA,MAAO,CAAE,OAAM,MAAOH,EAAY,OAAO,EAAG,KAAMA,EAAY,MAAM,CAAE,CAC1E,E"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { flavorContract as e, unsafeCssValuePattern as t } from "../constants/index.js";
|
|
2
|
+
import { isRecord as n } from "../../guards/isRecord.utils.js";
|
|
3
|
+
import { collectTokenStyles as r } from "../../tokens/collect-token-styles/collectTokenStyles.utils.js";
|
|
4
|
+
import { assertFlavorName as i } from "../../validation/assertFlavorName.utils.js";
|
|
5
|
+
// src/theme/utils/flavors/collect-flavor-styles/collectFlavorStyles.utils.ts
|
|
6
|
+
var a = (a) => {
|
|
7
|
+
if (!n(a)) throw TypeError("A flavor must be an object.");
|
|
8
|
+
let o = i(a.name, "flavor.name"), s = (i) => {
|
|
9
|
+
let s = a[i];
|
|
10
|
+
if (!n(s)) throw TypeError(`Flavor "${o}" must define a ${i} theme.`);
|
|
11
|
+
let c = {};
|
|
12
|
+
r(e, { color: s.color }, c, { isComplete: !0 });
|
|
13
|
+
for (let [e, n] of Object.entries(c)) if (t.test(n)) throw TypeError(`Flavor "${o}" sets ${e} to ${JSON.stringify(n)}, which contains a brace, semicolon, "<", "!", quote, backslash or comment delimiter.`);
|
|
14
|
+
return c;
|
|
15
|
+
};
|
|
16
|
+
return {
|
|
17
|
+
name: o,
|
|
18
|
+
light: s("light"),
|
|
19
|
+
dark: s("dark")
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export { a as collectFlavorStyles };
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=collectFlavorStyles.utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collectFlavorStyles.utils.js","names":["collectFlavorStyles","isRecord","flavor","name","assertFlavorName","collectMode","theme","mode","styles","flavorContract","property","value","unsafeCssValuePattern"],"sources":["../../../../../src/theme/utils/flavors/collect-flavor-styles/collectFlavorStyles.utils.ts"],"sourcesContent":["import type { TokenStyles } from '@theme/types';\nimport type { FlavorStyles } from '@theme/utils/flavors/collect-flavor-styles/types';\nimport {\n flavorContract,\n unsafeCssValuePattern,\n} from '@theme/utils/flavors/constants';\nimport { isRecord } from '@theme/utils/guards/isRecord.utils';\nimport { collectTokenStyles } from '@theme/utils/tokens/collect-token-styles/collectTokenStyles.utils';\nimport { assertFlavorName } from '@theme/utils/validation/assertFlavorName.utils';\n\n/**\n * Validates a flavor and collects the custom properties of its colors, per\n * mode. Other token groups of its themes are ignored.\n *\n * @param flavor Candidate flavor.\n * @returns The name and the custom properties of each mode.\n * @throws {TypeError} When the name is invalid, a mode is missing, or a\n * color is missing, unknown, empty or unsafe in a stylesheet.\n */\nexport const collectFlavorStyles = (flavor: unknown): FlavorStyles => {\n if (!isRecord(flavor)) {\n throw new TypeError('A flavor must be an object.');\n }\n\n const name = assertFlavorName(flavor.name, 'flavor.name');\n\n /**\n * Collects the custom properties of one mode of the flavor and rejects\n * the values that could escape their declaration in a stylesheet.\n *\n * @param mode Mode to collect.\n * @returns The custom properties of the mode.\n * @throws {TypeError} When the mode or one of its tokens is invalid.\n */\n const collectMode = (mode: 'light' | 'dark'): TokenStyles => {\n const theme = flavor[mode];\n\n if (!isRecord(theme)) {\n throw new TypeError(\n `Flavor \"${name}\" must define a ${mode} theme.`,\n );\n }\n\n const styles: Record<string, string> = {};\n\n collectTokenStyles(flavorContract, { color: theme.color }, styles, {\n isComplete: true,\n });\n\n for (const [property, value] of Object.entries(styles)) {\n if (unsafeCssValuePattern.test(value)) {\n throw new TypeError(\n `Flavor \"${name}\" sets ${property} to ${JSON.stringify(value)}, which contains a brace, semicolon, \"<\", \"!\", quote, backslash or comment delimiter.`,\n );\n }\n }\n\n return styles;\n };\n\n return { name, light: collectMode('light'), dark: collectMode('dark') };\n};\n"],"mappings":";;;;;AAmBA,IAAaA,KAAuB,MAAkC;CAClE,IAAI,CAACC,EAASC,CAAM,GAChB,MAAU,UAAU,6BAA6B;CAGrD,IAAMC,IAAOC,EAAiBF,EAAO,MAAM,aAAa,GAUlDG,KAAe,MAAwC;EACzD,IAAMC,IAAQJ,EAAOK;EAErB,IAAI,CAACN,EAASK,CAAK,GACf,MAAU,UACN,WAAWH,EAAK,kBAAkBI,EAAK,QAC3C;EAGJ,IAAMC,IAAiC,CAAC;EAExC,EAAmBC,GAAgB,EAAE,OAAOH,EAAM,MAAM,GAAGE,GAAQ,EAC/D,YAAY,GAChB,CAAC;EAED,KAAK,IAAM,CAACE,GAAUC,MAAU,OAAO,QAAQH,CAAM,GACjD,IAAII,EAAsB,KAAKD,CAAK,GAChC,MAAU,UACN,WAAWR,EAAK,SAASO,EAAS,MAAM,KAAK,UAAUC,CAAK,EAAE,sFAClE;EAIR,OAAOH;CACX;CAEA,OAAO;EAAE;EAAM,OAAOH,EAAY,OAAO;EAAG,MAAMA,EAAY,MAAM;CAAE;AAC1E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["vars","flavorContract","unsafeCssValuePattern"],"sources":["../../../../../src/theme/utils/flavors/constants/index.ts"],"sourcesContent":["import { vars } from '@theme/styles/vars.css';\n\n/** Contract of the tokens a flavor sets: colors. */\nexport const flavorContract = {\n color: vars.color,\n};\n\n/**\n * Sequences that would let a token value escape its declaration in a\n * generated stylesheet: declaration and block delimiters, `<` which could\n * close the `<style>` element, quotes which would open a string swallowing\n * the following declarations, backslashes which escape the next character,\n * and comment delimiters. `!` is refused too: `!important` would invert the\n * cascade, letting the flavor override unlayered CSS and inline styles.\n * A lone `/`, as in `rgb(0 0 0 / 0.5)`, stays valid. Flavors only carry\n * colors, which never need these characters.\n */\nexport const unsafeCssValuePattern = /[{};<\"'\\\\!]|\\/\\*|\\*\\//;\n"],"mappings":"AAGA,IAAaC,EAAiB,CAC1B,M,sCAAOD,CAAAA,CAAAA,KAAK,KAChB,EAYaE,EAAwB,wB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["flavorContract","vars","unsafeCssValuePattern"],"sources":["../../../../../src/theme/utils/flavors/constants/index.ts"],"sourcesContent":["import { vars } from '@theme/styles/vars.css';\n\n/** Contract of the tokens a flavor sets: colors. */\nexport const flavorContract = {\n color: vars.color,\n};\n\n/**\n * Sequences that would let a token value escape its declaration in a\n * generated stylesheet: declaration and block delimiters, `<` which could\n * close the `<style>` element, quotes which would open a string swallowing\n * the following declarations, backslashes which escape the next character,\n * and comment delimiters. `!` is refused too: `!important` would invert the\n * cascade, letting the flavor override unlayered CSS and inline styles.\n * A lone `/`, as in `rgb(0 0 0 / 0.5)`, stays valid. Flavors only carry\n * colors, which never need these characters.\n */\nexport const unsafeCssValuePattern = /[{};<\"'\\\\!]|\\/\\*|\\*\\//;\n"],"mappings":";;AAGA,IAAaA,IAAiB,EAC1B,OAAOC,EAAK,MAChB,GAYaC,IAAwB"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e=require("../../flavors/default/defaultFlavor.const.cjs"),t=require("./collect-flavor-styles/collectFlavorStyles.utils.cjs"),n=require("./constants/index.cjs"),r=require("../tokens/collect-token-styles/collectTokenStyles.utils.cjs"),i=require("../tokens/create-theme-tokens/createThemeTokens.utils.cjs"),a=require("../validation/assertFlavorName.utils.cjs");var o=({name:o,extends:s=e.defaultFlavor,light:c,dark:l})=>{let u=a.assertFlavorName(o,`name`);t.collectFlavorStyles(s),r.collectTokenStyles(n.flavorContract,c,{},{path:`light`}),r.collectTokenStyles(n.flavorContract,l,{},{path:`dark`});let d={name:u,light:i.createThemeTokens(s.light,c),dark:i.createThemeTokens(s.dark,l)};return t.collectFlavorStyles(d),d};exports.createFlavor=o;
|
|
2
|
+
//# sourceMappingURL=createFlavor.utils.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createFlavor.utils.cjs","names":["defaultFlavor","assertFlavorName","flavorContract","createThemeTokens","require_defaultFlavor_const","require_collectFlavorStyles_utils","require_index","require_collectTokenStyles_utils","require_createThemeTokens_utils","require_assertFlavorName_utils","createFlavor","base","validName","name","light","dark","flavor"],"sources":["../../../../src/theme/utils/flavors/createFlavor.utils.ts"],"sourcesContent":["import { defaultFlavor } from '@theme/flavors/default/defaultFlavor.const';\nimport type { Flavor, FlavorOptions } from '@theme/types';\nimport { collectFlavorStyles } from '@theme/utils/flavors/collect-flavor-styles/collectFlavorStyles.utils';\nimport { flavorContract } from '@theme/utils/flavors/constants';\nimport { collectTokenStyles } from '@theme/utils/tokens/collect-token-styles/collectTokenStyles.utils';\nimport { createThemeTokens } from '@theme/utils/tokens/create-theme-tokens/createThemeTokens.utils';\nimport { assertFlavorName } from '@theme/utils/validation/assertFlavorName.utils';\n\n/**\n * Creates a flavor from a base flavor and the colors it replaces in each\n * mode. Naming it `default` replaces the built-in flavor\n * once registered on a provider.\n *\n * @param options Flavor options.\n * @param options.name Flavor name.\n * @param options.extends Base flavor, `defaultFlavor` when absent; it is not\n * mutated.\n * @param options.light Light mode overrides.\n * @param options.dark Dark mode overrides.\n * @returns A flavor with complete light and dark themes.\n * @throws {TypeError} When the name is invalid, an override is not a color\n * token, or a value is empty or unsafe in a stylesheet.\n */\nexport const createFlavor = ({\n name,\n extends: base = defaultFlavor,\n light,\n dark,\n}: FlavorOptions): Flavor => {\n const validName = assertFlavorName(name, 'name');\n\n collectFlavorStyles(base);\n\n // Only colors vary per flavor: other groups are rejected.\n collectTokenStyles(flavorContract, light, {}, { path: 'light' });\n collectTokenStyles(flavorContract, dark, {}, { path: 'dark' });\n\n const flavor: Flavor = {\n name: validName,\n light: createThemeTokens(base.light, light),\n dark: createThemeTokens(base.dark, dark),\n };\n\n collectFlavorStyles(flavor);\n\n return flavor;\n};\n"],"mappings":"A,6WAuBA,IAAaU,GAAgB,CACzB,OACA,QAASC,EAAOX,EAAAA,cAChB,QACA,UACyB,CACzB,IAAMY,EAAYX,EAAAA,iBAAiBY,EAAM,MAAM,EAE/CR,EAAA,oBAAoBM,CAAI,EAGxBJ,EAAA,mBAAmBL,EAAAA,eAAgBY,EAAO,CAAC,EAAG,CAAE,KAAM,OAAQ,CAAC,EAC/DP,EAAA,mBAAmBL,EAAAA,eAAgBa,EAAM,CAAC,EAAG,CAAE,KAAM,MAAO,CAAC,EAE7D,IAAMC,EAAiB,CACnB,KAAMJ,EACN,MAAOT,EAAAA,kBAAkBQ,EAAK,MAAOG,CAAK,EAC1C,KAAMX,EAAAA,kBAAkBQ,EAAK,KAAMI,CAAI,CAC3C,EAIA,OAFAV,EAAA,oBAAoBW,CAAM,EAEnBA,CACX,E"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { defaultFlavor as e } from "../../flavors/default/defaultFlavor.const.js";
|
|
2
|
+
import { collectFlavorStyles as t } from "./collect-flavor-styles/collectFlavorStyles.utils.js";
|
|
3
|
+
import { flavorContract as n } from "./constants/index.js";
|
|
4
|
+
import { collectTokenStyles as r } from "../tokens/collect-token-styles/collectTokenStyles.utils.js";
|
|
5
|
+
import { createThemeTokens as i } from "../tokens/create-theme-tokens/createThemeTokens.utils.js";
|
|
6
|
+
import { assertFlavorName as a } from "../validation/assertFlavorName.utils.js";
|
|
7
|
+
// src/theme/utils/flavors/createFlavor.utils.ts
|
|
8
|
+
var o = ({ name: o, extends: s = e, light: c, dark: l }) => {
|
|
9
|
+
let u = a(o, "name");
|
|
10
|
+
t(s), r(n, c, {}, { path: "light" }), r(n, l, {}, { path: "dark" });
|
|
11
|
+
let d = {
|
|
12
|
+
name: u,
|
|
13
|
+
light: i(s.light, c),
|
|
14
|
+
dark: i(s.dark, l)
|
|
15
|
+
};
|
|
16
|
+
return t(d), d;
|
|
17
|
+
};
|
|
18
|
+
export { o as createFlavor };
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=createFlavor.utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createFlavor.utils.js","names":["createFlavor","base","defaultFlavor","validName","assertFlavorName","name","collectFlavorStyles","collectTokenStyles","flavorContract","light","dark","flavor","createThemeTokens"],"sources":["../../../../src/theme/utils/flavors/createFlavor.utils.ts"],"sourcesContent":["import { defaultFlavor } from '@theme/flavors/default/defaultFlavor.const';\nimport type { Flavor, FlavorOptions } from '@theme/types';\nimport { collectFlavorStyles } from '@theme/utils/flavors/collect-flavor-styles/collectFlavorStyles.utils';\nimport { flavorContract } from '@theme/utils/flavors/constants';\nimport { collectTokenStyles } from '@theme/utils/tokens/collect-token-styles/collectTokenStyles.utils';\nimport { createThemeTokens } from '@theme/utils/tokens/create-theme-tokens/createThemeTokens.utils';\nimport { assertFlavorName } from '@theme/utils/validation/assertFlavorName.utils';\n\n/**\n * Creates a flavor from a base flavor and the colors it replaces in each\n * mode. Naming it `default` replaces the built-in flavor\n * once registered on a provider.\n *\n * @param options Flavor options.\n * @param options.name Flavor name.\n * @param options.extends Base flavor, `defaultFlavor` when absent; it is not\n * mutated.\n * @param options.light Light mode overrides.\n * @param options.dark Dark mode overrides.\n * @returns A flavor with complete light and dark themes.\n * @throws {TypeError} When the name is invalid, an override is not a color\n * token, or a value is empty or unsafe in a stylesheet.\n */\nexport const createFlavor = ({\n name,\n extends: base = defaultFlavor,\n light,\n dark,\n}: FlavorOptions): Flavor => {\n const validName = assertFlavorName(name, 'name');\n\n collectFlavorStyles(base);\n\n // Only colors vary per flavor: other groups are rejected.\n collectTokenStyles(flavorContract, light, {}, { path: 'light' });\n collectTokenStyles(flavorContract, dark, {}, { path: 'dark' });\n\n const flavor: Flavor = {\n name: validName,\n light: createThemeTokens(base.light, light),\n dark: createThemeTokens(base.dark, dark),\n };\n\n collectFlavorStyles(flavor);\n\n return flavor;\n};\n"],"mappings":";;;;;;;AAuBA,IAAaA,KAAgB,EACzB,SACA,SAASC,IAAOC,GAChB,UACA,cACyB;CACzB,IAAMC,IAAYC,EAAiBC,GAAM,MAAM;CAM/C,AAJAC,EAAoBL,CAAI,GAGxBM,EAAmBC,GAAgBC,GAAO,CAAC,GAAG,EAAE,MAAM,QAAQ,CAAC,GAC/DF,EAAmBC,GAAgBE,GAAM,CAAC,GAAG,EAAE,MAAM,OAAO,CAAC;CAE7D,IAAMC,IAAiB;EACnB,MAAMR;EACN,OAAOS,EAAkBX,EAAK,OAAOQ,CAAK;EAC1C,MAAMG,EAAkBX,EAAK,MAAMS,CAAI;CAC3C;CAIA,OAFAJ,EAAoBK,CAAM,GAEnBA;AACX"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
const e=require("../../../constants/index.cjs"),t=require("../collect-flavor-styles/collectFlavorStyles.utils.cjs"),n=require("./utils/get-flavor-selectors/getFlavorSelectors.utils.cjs"),r=require("./utils/serializeDeclarations.utils.cjs");var i=i=>{let{name:a,light:o,dark:s}=t.collectFlavorStyles(i),c=n.getFlavorSelectors(a),l=r.serializeDeclarations(s);return[`@layer ${e.themeBaseLayer}, ${e.themeFlavorLayer};`,`@layer ${e.themeFlavorLayer}{`,`${c.light}{${r.serializeDeclarations(o)}}`,`${c.dark}{${l}}`,`@media ${e.systemThemeQuery}{${c.systemDark}{${l}}}`,`}`].join(`
|
|
2
|
+
`)};exports.getFlavorCss=i;
|
|
3
|
+
//# sourceMappingURL=getFlavorCss.utils.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getFlavorCss.utils.cjs","names":["collectFlavorStyles","getFlavorSelectors","serializeDeclarations","themeBaseLayer","themeFlavorLayer","systemThemeQuery","require_index","require_collectFlavorStyles_utils","require_getFlavorSelectors_utils","require_serializeDeclarations_utils","getFlavorCss","flavor","selectors","name","darkDeclarations","dark","light"],"sources":["../../../../../src/theme/utils/flavors/get-flavor-css/getFlavorCss.utils.ts"],"sourcesContent":["import {\n systemThemeQuery,\n themeBaseLayer,\n themeFlavorLayer,\n} from '@theme/constants';\nimport type { Flavor } from '@theme/types';\nimport { collectFlavorStyles } from '@theme/utils/flavors/collect-flavor-styles/collectFlavorStyles.utils';\nimport { getFlavorSelectors } from '@theme/utils/flavors/get-flavor-css/utils/get-flavor-selectors/getFlavorSelectors.utils';\nimport { serializeDeclarations } from '@theme/utils/flavors/get-flavor-css/utils/serializeDeclarations.utils';\n\n/**\n * Generates the stylesheet of a flavor: its colors in light, dark and system\n * modes, in the flavor layer that wins over the built-in modes. Providers\n * render it for every registered flavor; it can also be written to a static\n * file, e.g. under a strict Content Security Policy.\n *\n * @param flavor Flavor to serialize.\n * @returns The CSS of the flavor.\n * @throws {TypeError} When the flavor is malformed.\n */\nexport const getFlavorCss = (flavor: Flavor): string => {\n const { name, light, dark } = collectFlavorStyles(flavor);\n const selectors = getFlavorSelectors(name);\n const darkDeclarations = serializeDeclarations(dark);\n // The layer statement fixes the order of the sub-layers even when this\n // stylesheet loads before the theme stylesheet.\n return [\n `@layer ${themeBaseLayer}, ${themeFlavorLayer};`,\n `@layer ${themeFlavorLayer}{`,\n `${selectors.light}{${serializeDeclarations(light)}}`,\n `${selectors.dark}{${darkDeclarations}}`,\n `@media ${systemThemeQuery}{${selectors.systemDark}{${darkDeclarations}}}`,\n '}',\n ].join('\\n');\n};\n"],"mappings":"A,gPAoBA,IAAaU,EAAgB,GAA2B,CACpD,GAAM,CAAE,OAAM,QAAO,QAASV,EAAAA,oBAAoBW,CAAM,EAClDC,EAAYX,EAAAA,mBAAmBY,CAAI,EACnCC,EAAmBZ,EAAAA,sBAAsBa,CAAI,EAGnD,MAAO,CACH,UAAUZ,EAAAA,eAAe,IAAIC,EAAAA,iBAAiB,GAC9C,UAAUA,EAAAA,iBAAiB,GAC3B,GAAGQ,EAAU,MAAM,GAAGV,EAAAA,sBAAsBc,CAAK,EAAE,GACnD,GAAGJ,EAAU,KAAK,GAAGE,EAAiB,GACtC,UAAUT,EAAAA,iBAAiB,GAAGO,EAAU,WAAW,GAAGE,EAAiB,IACvE,GACJ,CAAC,CAAC,KAAK;CAAI,CACf,E"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { systemThemeQuery as e, themeBaseLayer as t, themeFlavorLayer as n } from "../../../constants/index.js";
|
|
2
|
+
import { collectFlavorStyles as r } from "../collect-flavor-styles/collectFlavorStyles.utils.js";
|
|
3
|
+
import { getFlavorSelectors as i } from "./utils/get-flavor-selectors/getFlavorSelectors.utils.js";
|
|
4
|
+
import { serializeDeclarations as a } from "./utils/serializeDeclarations.utils.js";
|
|
5
|
+
// src/theme/utils/flavors/get-flavor-css/getFlavorCss.utils.ts
|
|
6
|
+
var o = (o) => {
|
|
7
|
+
let { name: s, light: c, dark: l } = r(o), u = i(s), d = a(l);
|
|
8
|
+
return [
|
|
9
|
+
`@layer ${t}, ${n};`,
|
|
10
|
+
`@layer ${n}{`,
|
|
11
|
+
`${u.light}{${a(c)}}`,
|
|
12
|
+
`${u.dark}{${d}}`,
|
|
13
|
+
`@media ${e}{${u.systemDark}{${d}}}`,
|
|
14
|
+
"}"
|
|
15
|
+
].join("\n");
|
|
16
|
+
};
|
|
17
|
+
export { o as getFlavorCss };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=getFlavorCss.utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getFlavorCss.utils.js","names":["getFlavorCss","collectFlavorStyles","flavor","selectors","getFlavorSelectors","name","darkDeclarations","serializeDeclarations","dark","themeBaseLayer","themeFlavorLayer","light","systemThemeQuery"],"sources":["../../../../../src/theme/utils/flavors/get-flavor-css/getFlavorCss.utils.ts"],"sourcesContent":["import {\n systemThemeQuery,\n themeBaseLayer,\n themeFlavorLayer,\n} from '@theme/constants';\nimport type { Flavor } from '@theme/types';\nimport { collectFlavorStyles } from '@theme/utils/flavors/collect-flavor-styles/collectFlavorStyles.utils';\nimport { getFlavorSelectors } from '@theme/utils/flavors/get-flavor-css/utils/get-flavor-selectors/getFlavorSelectors.utils';\nimport { serializeDeclarations } from '@theme/utils/flavors/get-flavor-css/utils/serializeDeclarations.utils';\n\n/**\n * Generates the stylesheet of a flavor: its colors in light, dark and system\n * modes, in the flavor layer that wins over the built-in modes. Providers\n * render it for every registered flavor; it can also be written to a static\n * file, e.g. under a strict Content Security Policy.\n *\n * @param flavor Flavor to serialize.\n * @returns The CSS of the flavor.\n * @throws {TypeError} When the flavor is malformed.\n */\nexport const getFlavorCss = (flavor: Flavor): string => {\n const { name, light, dark } = collectFlavorStyles(flavor);\n const selectors = getFlavorSelectors(name);\n const darkDeclarations = serializeDeclarations(dark);\n // The layer statement fixes the order of the sub-layers even when this\n // stylesheet loads before the theme stylesheet.\n return [\n `@layer ${themeBaseLayer}, ${themeFlavorLayer};`,\n `@layer ${themeFlavorLayer}{`,\n `${selectors.light}{${serializeDeclarations(light)}}`,\n `${selectors.dark}{${darkDeclarations}}`,\n `@media ${systemThemeQuery}{${selectors.systemDark}{${darkDeclarations}}}`,\n '}',\n ].join('\\n');\n};\n"],"mappings":";;;;;AAoBA,IAAaA,KAAgB,MAA2B;CACpD,IAAM,EAAE,SAAM,UAAO,YAASC,EAAoBC,CAAM,GAClDC,IAAYC,EAAmBC,CAAI,GACnCC,IAAmBC,EAAsBC,CAAI;CAGnD,OAAO;EACH,UAAUC,EAAe,IAAIC,EAAiB;EAC9C,UAAUA,EAAiB;EAC3B,GAAGP,EAAU,MAAM,GAAGI,EAAsBI,CAAK,EAAE;EACnD,GAAGR,EAAU,KAAK,GAAGG,EAAiB;EACtC,UAAUM,EAAiB,GAAGT,EAAU,WAAW,GAAGG,EAAiB;EACvE;CACJ,CAAC,CAAC,KAAK,IAAI;AACf"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e=require("../../../../../constants/index.cjs");var t=t=>{let n=`[${e.flavorAttribute}="${t}"]`,r=`:not([${e.themeAttribute}])`,i=`${n}[${e.themeAttribute}="system"], ${n}.${e.themeSystemClass}${r}`;return{light:`${n}:root, ${n}[${e.themeAttribute}="light"], ${n}.${e.themeLightClass}${r}, ${i}`,dark:`${n}[${e.themeAttribute}="dark"], ${n}.${e.themeDarkClass}${r}`,systemDark:`${n}:root${r}:not(.${e.themeLightClass}):not(.${e.themeDarkClass}):not(.${e.themeSystemClass}), ${i}`}};exports.getFlavorSelectors=t;
|
|
2
|
+
//# sourceMappingURL=getFlavorSelectors.utils.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getFlavorSelectors.utils.cjs","names":["flavorAttribute","themeAttribute","themeSystemClass","themeLightClass","themeDarkClass","require_index","getFlavorSelectors","flavor","name","withoutMode","system"],"sources":["../../../../../../../src/theme/utils/flavors/get-flavor-css/utils/get-flavor-selectors/getFlavorSelectors.utils.ts"],"sourcesContent":["import {\n flavorAttribute,\n themeAttribute,\n themeDarkClass,\n themeLightClass,\n themeSystemClass,\n} from '@theme/constants';\nimport type { FlavorSelectors } from '@theme/utils/flavors/get-flavor-css/utils/get-flavor-selectors/types';\n\n/**\n * Builds the selectors of a flavor: each built-in mode selector, restricted\n * to the elements carrying the flavor. The flavor and the mode must be set\n * on the same element, as every provider does.\n *\n * @param name Valid flavor name.\n * @returns The light, dark and system-dark selectors.\n */\nexport const getFlavorSelectors = (name: string): FlavorSelectors => {\n const flavor = `[${flavorAttribute}=\"${name}\"]`;\n const withoutMode = `:not([${themeAttribute}])`;\n const system = `${flavor}[${themeAttribute}=\"system\"], ${flavor}.${themeSystemClass}${withoutMode}`;\n return {\n light: `${flavor}:root, ${flavor}[${themeAttribute}=\"light\"], ${flavor}.${themeLightClass}${withoutMode}, ${system}`,\n dark: `${flavor}[${themeAttribute}=\"dark\"], ${flavor}.${themeDarkClass}${withoutMode}`,\n systemDark: `${flavor}:root${withoutMode}:not(.${themeLightClass}):not(.${themeDarkClass}):not(.${themeSystemClass}), ${system}`,\n };\n};\n"],"mappings":"A,sDAiBA,IAAaM,EAAsB,GAAkC,CACjE,IAAMC,EAAS,IAAIP,EAAAA,gBAAgB,IAAIQ,EAAK,IACtCC,EAAc,SAASR,EAAAA,eAAe,IACtCS,EAAS,GAAGH,EAAO,GAAGN,EAAAA,eAAe,cAAcM,EAAO,GAAGL,EAAAA,mBAAmBO,IACtF,MAAO,CACH,MAAO,GAAGF,EAAO,SAASA,EAAO,GAAGN,EAAAA,eAAe,aAAaM,EAAO,GAAGJ,EAAAA,kBAAkBM,EAAY,IAAIC,IAC5G,KAAM,GAAGH,EAAO,GAAGN,EAAAA,eAAe,YAAYM,EAAO,GAAGH,EAAAA,iBAAiBK,IACzE,WAAY,GAAGF,EAAO,OAAOE,EAAY,QAAQN,EAAAA,gBAAgB,SAASC,EAAAA,eAAe,SAASF,EAAAA,iBAAiB,KAAKQ,GAC5H,CACJ,E"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { flavorAttribute as e, themeAttribute as t, themeDarkClass as n, themeLightClass as r, themeSystemClass as i } from "../../../../../constants/index.js";
|
|
2
|
+
// src/theme/utils/flavors/get-flavor-css/utils/get-flavor-selectors/getFlavorSelectors.utils.ts
|
|
3
|
+
var a = (a) => {
|
|
4
|
+
let o = `[${e}="${a}"]`, s = `:not([${t}])`, c = `${o}[${t}="system"], ${o}.${i}${s}`;
|
|
5
|
+
return {
|
|
6
|
+
light: `${o}:root, ${o}[${t}="light"], ${o}.${r}${s}, ${c}`,
|
|
7
|
+
dark: `${o}[${t}="dark"], ${o}.${n}${s}`,
|
|
8
|
+
systemDark: `${o}:root${s}:not(.${r}):not(.${n}):not(.${i}), ${c}`
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export { a as getFlavorSelectors };
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=getFlavorSelectors.utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getFlavorSelectors.utils.js","names":["getFlavorSelectors","flavor","flavorAttribute","name","withoutMode","themeAttribute","system","themeSystemClass","themeLightClass","themeDarkClass"],"sources":["../../../../../../../src/theme/utils/flavors/get-flavor-css/utils/get-flavor-selectors/getFlavorSelectors.utils.ts"],"sourcesContent":["import {\n flavorAttribute,\n themeAttribute,\n themeDarkClass,\n themeLightClass,\n themeSystemClass,\n} from '@theme/constants';\nimport type { FlavorSelectors } from '@theme/utils/flavors/get-flavor-css/utils/get-flavor-selectors/types';\n\n/**\n * Builds the selectors of a flavor: each built-in mode selector, restricted\n * to the elements carrying the flavor. The flavor and the mode must be set\n * on the same element, as every provider does.\n *\n * @param name Valid flavor name.\n * @returns The light, dark and system-dark selectors.\n */\nexport const getFlavorSelectors = (name: string): FlavorSelectors => {\n const flavor = `[${flavorAttribute}=\"${name}\"]`;\n const withoutMode = `:not([${themeAttribute}])`;\n const system = `${flavor}[${themeAttribute}=\"system\"], ${flavor}.${themeSystemClass}${withoutMode}`;\n return {\n light: `${flavor}:root, ${flavor}[${themeAttribute}=\"light\"], ${flavor}.${themeLightClass}${withoutMode}, ${system}`,\n dark: `${flavor}[${themeAttribute}=\"dark\"], ${flavor}.${themeDarkClass}${withoutMode}`,\n systemDark: `${flavor}:root${withoutMode}:not(.${themeLightClass}):not(.${themeDarkClass}):not(.${themeSystemClass}), ${system}`,\n };\n};\n"],"mappings":";;AAiBA,IAAaA,KAAsB,MAAkC;CACjE,IAAMC,IAAS,IAAIC,EAAgB,IAAIC,EAAK,KACtCC,IAAc,SAASC,EAAe,KACtCC,IAAS,GAAGL,EAAO,GAAGI,EAAe,cAAcJ,EAAO,GAAGM,IAAmBH;CACtF,OAAO;EACH,OAAO,GAAGH,EAAO,SAASA,EAAO,GAAGI,EAAe,aAAaJ,EAAO,GAAGO,IAAkBJ,EAAY,IAAIE;EAC5G,MAAM,GAAGL,EAAO,GAAGI,EAAe,YAAYJ,EAAO,GAAGQ,IAAiBL;EACzE,YAAY,GAAGH,EAAO,OAAOG,EAAY,QAAQI,EAAgB,SAASC,EAAe,SAASF,EAAiB,KAAKD;CAC5H;AACJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serializeDeclarations.utils.cjs","names":["serializeDeclarations","styles","property","value"],"sources":["../../../../../../src/theme/utils/flavors/get-flavor-css/utils/serializeDeclarations.utils.ts"],"sourcesContent":["import type { TokenStyles } from '@theme/types';\n\n/**\n * Serializes custom properties as the body of a CSS rule.\n *\n * @param styles Custom properties and their values.\n * @returns The declarations, e.g. `--a:red;--b:blue`.\n */\nexport const serializeDeclarations = (styles: TokenStyles): string =>\n Object.entries(styles)\n .map(([property, value]) => `${property}:${value}`)\n .join(';');\n"],"mappings":"AAQA,IAAaA,EAAyB,GAClC,OAAO,QAAQC,CAAM,CAAC,CACjB,KAAK,CAACC,EAAUC,KAAW,GAAGD,EAAS,GAAGC,GAAO,CAAC,CAClD,KAAK,GAAG,E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serializeDeclarations.utils.js","names":["serializeDeclarations","styles","property","value"],"sources":["../../../../../../src/theme/utils/flavors/get-flavor-css/utils/serializeDeclarations.utils.ts"],"sourcesContent":["import type { TokenStyles } from '@theme/types';\n\n/**\n * Serializes custom properties as the body of a CSS rule.\n *\n * @param styles Custom properties and their values.\n * @returns The declarations, e.g. `--a:red;--b:blue`.\n */\nexport const serializeDeclarations = (styles: TokenStyles): string =>\n Object.entries(styles)\n .map(([property, value]) => `${property}:${value}`)\n .join(';');\n"],"mappings":";AAQA,IAAaA,KAAyB,MAClC,OAAO,QAAQC,CAAM,CAAC,CACjB,KAAK,CAACC,GAAUC,OAAW,GAAGD,EAAS,GAAGC,GAAO,CAAC,CAClD,KAAK,GAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getFlavorReferenceName.utils.cjs","names":["isRecord","require_isRecord_utils","getFlavorReferenceName","reference"],"sources":["../../../../src/theme/utils/flavors/getFlavorReferenceName.utils.ts"],"sourcesContent":["import type { FlavorName, FlavorReference } from '@theme/types';\nimport { isRecord } from '@theme/utils/guards/isRecord.utils';\n\n/**\n * Reads the name of a flavor given by name or as an object.\n *\n * @param reference Flavor name or object; `undefined` when absent.\n * @returns The flavor name, unvalidated; `undefined` when absent.\n */\nexport const getFlavorReferenceName = (\n reference: FlavorReference | undefined,\n): FlavorName | undefined => (isRecord(reference) ? reference.name : reference);\n"],"mappings":"A,gDASA,IAAaE,EACT,GAC0BF,EAAAA,SAASG,CAAS,EAAIA,EAAU,KAAOA,E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getFlavorReferenceName.utils.js","names":["getFlavorReferenceName","isRecord","reference"],"sources":["../../../../src/theme/utils/flavors/getFlavorReferenceName.utils.ts"],"sourcesContent":["import type { FlavorName, FlavorReference } from '@theme/types';\nimport { isRecord } from '@theme/utils/guards/isRecord.utils';\n\n/**\n * Reads the name of a flavor given by name or as an object.\n *\n * @param reference Flavor name or object; `undefined` when absent.\n * @returns The flavor name, unvalidated; `undefined` when absent.\n */\nexport const getFlavorReferenceName = (\n reference: FlavorReference | undefined,\n): FlavorName | undefined => (isRecord(reference) ? reference.name : reference);\n"],"mappings":";;AASA,IAAaA,KACT,MAC0BC,EAASC,CAAS,IAAIA,EAAU,OAAOA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isRecord.utils.cjs","names":["isRecord","value"],"sources":["../../../../src/theme/utils/guards/isRecord.utils.ts"],"sourcesContent":["/**\n * Narrows a value to a plain object, excluding `null` and arrays.\n *\n * @param value Value to test.\n * @returns Whether the value is a non-array object.\n */\nexport const isRecord = (value: unknown): value is Record<string, unknown> =>\n typeof value === 'object' && value !== null && !Array.isArray(value);\n"],"mappings":"AAMA,IAAaA,EAAY,GACrB,OAAOC,GAAU,YAAYA,GAAkB,CAAC,MAAM,QAAQA,CAAK,E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isRecord.utils.js","names":["isRecord","value"],"sources":["../../../../src/theme/utils/guards/isRecord.utils.ts"],"sourcesContent":["/**\n * Narrows a value to a plain object, excluding `null` and arrays.\n *\n * @param value Value to test.\n * @returns Whether the value is a non-array object.\n */\nexport const isRecord = (value: unknown): value is Record<string, unknown> =>\n typeof value === 'object' && value !== null && !Array.isArray(value);\n"],"mappings":";AAMA,IAAaA,KAAY,MACrB,OAAOC,KAAU,cAAYA,KAAkB,CAAC,MAAM,QAAQA,CAAK"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const e=require("../../../constants/index.cjs"),t=require("../../flavors/getFlavorReferenceName.utils.cjs"),n=require("../../tokens/getSharedTokenStyles.utils.cjs"),r=require("../../validation/assertFlavorName.utils.cjs"),i=require("../../validation/assertThemeName.utils.cjs");var a=({theme:a=e.defaultThemeName,flavor:o=e.defaultFlavorName,tokens:s}={})=>({[e.themeAttribute]:i.assertThemeName(a,`theme`),[e.flavorAttribute]:r.assertFlavorName(t.getFlavorReferenceName(o),`flavor`),style:n.getSharedTokenStyles(s)});exports.getThemeRootProps=a;
|
|
2
|
+
//# sourceMappingURL=getThemeRootProps.utils.cjs.map
|
package/dist/theme/utils/server-rendering/get-theme-root-props/getThemeRootProps.utils.cjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getThemeRootProps.utils.cjs","names":["defaultThemeName","defaultFlavorName","themeAttribute","assertThemeName","flavorAttribute","assertFlavorName","getFlavorReferenceName","getSharedTokenStyles","require_index","require_getFlavorReferenceName_utils","require_getSharedTokenStyles_utils","require_assertFlavorName_utils","require_assertThemeName_utils","getThemeRootProps","theme","flavor","tokens"],"sources":["../../../../../src/theme/utils/server-rendering/get-theme-root-props/getThemeRootProps.utils.ts"],"sourcesContent":["import {\n defaultFlavorName,\n defaultThemeName,\n flavorAttribute,\n themeAttribute,\n} from '@theme/constants';\nimport { getFlavorReferenceName } from '@theme/utils/flavors/getFlavorReferenceName.utils';\nimport type {\n ThemeRootOptions,\n ThemeRootProps,\n} from '@theme/utils/server-rendering/get-theme-root-props/types';\nimport { getSharedTokenStyles } from '@theme/utils/tokens/getSharedTokenStyles.utils';\nimport { assertFlavorName } from '@theme/utils/validation/assertFlavorName.utils';\nimport { assertThemeName } from '@theme/utils/validation/assertThemeName.utils';\n\n/**\n * Props to spread on the server-rendered `<html>` so the document is themed\n * before hydration (no flash). Pass the same values as the root provider,\n * which also renders the stylesheets of its flavors.\n *\n * @param options Root provider values.\n * @param options.theme Theme of the root provider, `system` by default.\n * @param options.flavor Flavor of the root provider, name or object,\n * `default` by default.\n * @param options.tokens Mode-independent token overrides of the root\n * provider; colors are set through the flavor, and spaces cannot be\n * overridden.\n * @returns The theme and flavor attributes and the custom properties of the\n * overrides.\n * @throws {TypeError} When the theme or flavor name is invalid, or a token is\n * a color or space, unknown or malformed.\n */\nexport const getThemeRootProps = ({\n theme = defaultThemeName,\n flavor = defaultFlavorName,\n tokens,\n}: ThemeRootOptions = {}): ThemeRootProps => ({\n [themeAttribute]: assertThemeName(theme, 'theme'),\n [flavorAttribute]: assertFlavorName(\n getFlavorReferenceName(flavor),\n 'flavor',\n ),\n style: getSharedTokenStyles(tokens),\n});\n"],"mappings":"A,sRAgCA,IAAaa,GAAqB,CAC9B,QAAQb,EAAAA,iBACR,SAASC,EAAAA,kBACT,UACkB,CAAC,KAAuB,EACzCC,EAAAA,gBAAiBC,EAAAA,gBAAgBW,EAAO,OAAO,GAC/CV,EAAAA,iBAAkBC,EAAAA,iBACfC,EAAAA,uBAAuBS,CAAM,EAC7B,QACJ,EACA,MAAOR,EAAAA,qBAAqBS,CAAM,CACtC,G"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { defaultFlavorName as e, defaultThemeName as t, flavorAttribute as n, themeAttribute as r } from "../../../constants/index.js";
|
|
2
|
+
import { getFlavorReferenceName as i } from "../../flavors/getFlavorReferenceName.utils.js";
|
|
3
|
+
import { getSharedTokenStyles as a } from "../../tokens/getSharedTokenStyles.utils.js";
|
|
4
|
+
import { assertFlavorName as o } from "../../validation/assertFlavorName.utils.js";
|
|
5
|
+
import { assertThemeName as s } from "../../validation/assertThemeName.utils.js";
|
|
6
|
+
// src/theme/utils/server-rendering/get-theme-root-props/getThemeRootProps.utils.ts
|
|
7
|
+
var c = ({ theme: c = t, flavor: l = e, tokens: u } = {}) => ({
|
|
8
|
+
[r]: s(c, "theme"),
|
|
9
|
+
[n]: o(i(l), "flavor"),
|
|
10
|
+
style: a(u)
|
|
11
|
+
});
|
|
12
|
+
export { c as getThemeRootProps };
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=getThemeRootProps.utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getThemeRootProps.utils.js","names":["getThemeRootProps","defaultThemeName","defaultFlavorName","themeAttribute","assertThemeName","theme","flavorAttribute","assertFlavorName","getFlavorReferenceName","flavor","getSharedTokenStyles","tokens"],"sources":["../../../../../src/theme/utils/server-rendering/get-theme-root-props/getThemeRootProps.utils.ts"],"sourcesContent":["import {\n defaultFlavorName,\n defaultThemeName,\n flavorAttribute,\n themeAttribute,\n} from '@theme/constants';\nimport { getFlavorReferenceName } from '@theme/utils/flavors/getFlavorReferenceName.utils';\nimport type {\n ThemeRootOptions,\n ThemeRootProps,\n} from '@theme/utils/server-rendering/get-theme-root-props/types';\nimport { getSharedTokenStyles } from '@theme/utils/tokens/getSharedTokenStyles.utils';\nimport { assertFlavorName } from '@theme/utils/validation/assertFlavorName.utils';\nimport { assertThemeName } from '@theme/utils/validation/assertThemeName.utils';\n\n/**\n * Props to spread on the server-rendered `<html>` so the document is themed\n * before hydration (no flash). Pass the same values as the root provider,\n * which also renders the stylesheets of its flavors.\n *\n * @param options Root provider values.\n * @param options.theme Theme of the root provider, `system` by default.\n * @param options.flavor Flavor of the root provider, name or object,\n * `default` by default.\n * @param options.tokens Mode-independent token overrides of the root\n * provider; colors are set through the flavor, and spaces cannot be\n * overridden.\n * @returns The theme and flavor attributes and the custom properties of the\n * overrides.\n * @throws {TypeError} When the theme or flavor name is invalid, or a token is\n * a color or space, unknown or malformed.\n */\nexport const getThemeRootProps = ({\n theme = defaultThemeName,\n flavor = defaultFlavorName,\n tokens,\n}: ThemeRootOptions = {}): ThemeRootProps => ({\n [themeAttribute]: assertThemeName(theme, 'theme'),\n [flavorAttribute]: assertFlavorName(\n getFlavorReferenceName(flavor),\n 'flavor',\n ),\n style: getSharedTokenStyles(tokens),\n});\n"],"mappings":";;;;;;AAgCA,IAAaA,KAAqB,EAC9B,WAAQC,GACR,YAASC,GACT,cACkB,CAAC,OAAuB;EACzCC,IAAiBC,EAAgBC,GAAO,OAAO;EAC/CC,IAAkBC,EACfC,EAAuBC,CAAM,GAC7B,QACJ;CACA,OAAOC,EAAqBC,CAAM;AACtC"}
|