@bamboocss/generator 1.57.6 → 1.58.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/dist/index.cjs CHANGED
@@ -70,7 +70,7 @@ function generateConditions(ctx) {
70
70
  function generateCssFn(ctx) {
71
71
  return {
72
72
  dts: outdent.outdent`
73
- ${ctx.file.importType("SystemStyleObject, ViewTransitionFn", "../types/index")}
73
+ ${ctx.file.importType("KeyframesFn, SystemStyleObject, ViewTransitionFn", "../types/index")}
74
74
 
75
75
  type Styles = SystemStyleObject | undefined | null | false
76
76
 
@@ -116,6 +116,22 @@ function generateCssFn(ctx) {
116
116
  */
117
117
  export declare const viewTransition: ViewTransitionFn;
118
118
 
119
+ /**
120
+ * Write a \`@keyframes\` block from these stops and get back its name, to animate with.
121
+ *
122
+ * The name is a hash of the stops as written, so the same stops anywhere in the project are
123
+ * one block. The call is replaced by the name at build time, which is why the stops have to
124
+ * be known then.
125
+ *
126
+ * @example
127
+ * const fadeIn = keyframes({ from: { opacity: 0 }, to: { opacity: 1 } })
128
+ *
129
+ * css({ animation: \`\${fadeIn} 0.2s ease-out\` })
130
+ *
131
+ * @see https://bamboocss.com/docs/concepts/keyframes
132
+ */
133
+ export declare const keyframes: KeyframesFn;
134
+
119
135
  `,
120
136
  js: outdent.outdent`
121
137
  ${ctx.file.import("cloneStyles, uncompiledStyle", "../helpers")}
@@ -133,6 +149,8 @@ function generateCssFn(ctx) {
133
149
 
134
150
  export const viewTransition = (_options) => uncompiledStyle('viewTransition')
135
151
 
152
+ export const keyframes = (_stops) => uncompiledStyle('keyframes')
153
+
136
154
  `
137
155
  };
138
156
  }
@@ -629,7 +647,7 @@ function generateRecipes(ctx, filters) {
629
647
  if (recipes.isEmpty()) return;
630
648
  return ctx.recipes.filterDetails(filters).map((recipe) => {
631
649
  const { baseName, config, upperName, variantKeyMap, dashName } = recipe;
632
- const { description, defaultVariants, compoundVariants, deprecated } = config;
650
+ const { description, defaultVariants, deprecated } = config;
633
651
  const getDefaultValueJsDoc = (key) => {
634
652
  if (!hasOwn(defaultVariants, key)) return;
635
653
  let defaultValue = defaultVariants[key];
@@ -651,7 +669,6 @@ function generateRecipes(ctx, filters) {
651
669
  })
652
670
  `,
653
671
  dts: outdent.outdent`
654
- ${ctx.file.importType("ConditionalValue", "../types/index")}
655
672
  ${ctx.file.importType("DistributiveOmit, Pretty", "../types/system-types")}
656
673
 
657
674
  interface ${upperName}Variant {
@@ -665,7 +682,7 @@ function generateRecipes(ctx, filters) {
665
682
  ${_bamboocss_core.Recipes.isSlotRecipeConfig(config) ? `type ${upperName}Slot = ${(0, _bamboocss_shared.unionType)(config.slots)}` : ""}
666
683
 
667
684
  export type ${upperName}VariantProps = {
668
- [key in keyof ${upperName}Variant]?: ${compoundVariants?.length ? `${upperName}Variant[key]` : `ConditionalValue<${upperName}Variant[key]>`} | undefined
685
+ [key in keyof ${upperName}Variant]?: ${upperName}Variant[key] | undefined
669
686
  }
670
687
 
671
688
  export interface ${upperName}Recipe {
@@ -1562,7 +1579,7 @@ var content$2 = "import type { Pseudos } from './csstype'\n\ntype AriaAttributes
1562
1579
  var content$1 = "interface ConditionOptions {\n /**\n * The conditions to generate for the rule.\n * @example ['hover', 'focus']\n */\n conditions?: string[]\n /**\n * Whether to generate responsive styles for the rule.\n */\n responsive?: boolean\n}\n\nexport interface CssRule extends ConditionOptions {\n /**\n * The css properties to generate utilities for.\n * @example ['margin', 'padding']\n */\n properties: {\n [property: string]: Array<string | number>\n }\n}\n\ninterface RecipeRuleVariants {\n [variant: string]: boolean | string[]\n}\n\nexport type RecipeRuleObject = RecipeRuleVariants & ConditionOptions\nexport type RecipeRule = '*' | RecipeRuleObject\n\nexport type PatternRule = '*' | CssRule\n\nexport interface StaticCssOptions {\n /**\n * The css utility classes to generate.\n */\n css?: CssRule[]\n /**\n * The css recipes to generate.\n */\n recipes?:\n | '*'\n | {\n [recipe: string]: RecipeRule[]\n }\n /**\n * The css patterns to generate.\n */\n patterns?: {\n [pattern: string]: PatternRule[]\n }\n /**\n * The CSS themes to generate\n */\n themes?: string[]\n}\n";
1563
1580
  //#endregion
1564
1581
  //#region src/artifacts/generated/system-types.d.ts.json
1565
- var content = "import type { ConditionalValue, Nested } from './conditions'\nimport type { AtRule, Globals, Properties } from './csstype'\nimport type { SystemProperties, CssVarProperties } from './style-props'\n\ntype String = string & {}\ntype Number = number & {}\n\nexport type Pretty<T> = { [K in keyof T]: T[K] } & {}\n\nexport type DistributiveOmit<T, K extends keyof any> = T extends unknown ? Omit<T, K> : never\n\nexport type DistributiveUnion<T, U> = {\n [K in keyof T]: K extends keyof U ? U[K] | T[K] : T[K]\n} & DistributiveOmit<U, keyof T>\n\nexport type Assign<T, U> = {\n [K in keyof T]: K extends keyof U ? U[K] : T[K]\n} & U\n\n/* -----------------------------------------------------------------------------\n * Native css properties\n * -----------------------------------------------------------------------------*/\n\ntype CornerShapeValue = 'round' | 'square' | 'bevel' | 'scoop' | 'notch' | 'squircle' | `superellipse(${number})`\n\nexport interface ModernCssProperties {\n /**\n * Controls whether the entire element should be draggable instead of its contents.\n */\n WebkitUserDrag?: Globals | 'auto' | 'element' | 'none' | undefined\n\n /**\n * Specifies whether an element can be used to drag the entire app window (Electron).\n */\n WebkitAppRegion?: Globals | 'drag' | 'no-drag' | undefined\n\n /**\n * Sets the horizontal spacing between table borders.\n */\n WebkitBorderHorizontalSpacing?: Globals | String | Number | undefined\n\n /**\n * Sets the vertical spacing between table borders.\n */\n WebkitBorderVerticalSpacing?: Globals | String | Number | undefined\n\n /**\n * Controls the display of text content for security purposes (e.g., password fields).\n */\n WebkitTextSecurity?: Globals | 'none' | 'circle' | 'disc' | 'square' | undefined\n\n /**\n * Specifies the shape of a box's corners within the area defined by the border-radius property.\n * @experimental\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/corner-shape\n */\n cornerShape?:\n | Globals\n | CornerShapeValue\n | `${CornerShapeValue} ${CornerShapeValue}`\n | `${CornerShapeValue} ${CornerShapeValue} ${CornerShapeValue}`\n | `${CornerShapeValue} ${CornerShapeValue} ${CornerShapeValue} ${CornerShapeValue}`\n | String\n | undefined\n}\n\nexport type CssProperty = keyof Properties\n\nexport interface CssProperties extends Properties<String | Number>, CssVarProperties, ModernCssProperties {}\n\nexport interface CssKeyframes {\n [name: string]: {\n [time: string]: CssProperties\n }\n}\n\n/* -----------------------------------------------------------------------------\n * Conditional css properties\n * -----------------------------------------------------------------------------*/\n\ninterface GenericProperties {\n [key: string]: ConditionalValue<String | Number | boolean>\n}\n\n/* -----------------------------------------------------------------------------\n * Native css props\n * -----------------------------------------------------------------------------*/\n\nexport type NestedCssProperties = Nested<CssProperties>\n\nexport type SystemStyleObject = Omit<Nested<SystemProperties & CssVarProperties>, 'base'>\n\n/**\n * The four `::view-transition-*` pseudo-elements a `viewTransition()` bag can style.\n *\n * `imagePair` is camelCase here and emitted as `::view-transition-image-pair`, matching\n * how every other property in a style object is authored.\n */\nexport interface ViewTransitionStyleObject {\n group?: SystemStyleObject | undefined\n imagePair?: SystemStyleObject | undefined\n old?: SystemStyleObject | undefined\n new?: SystemStyleObject | undefined\n}\n\nexport type ViewTransitionFn = (options: ViewTransitionStyleObject) => string\n\nexport interface GlobalStyleObject {\n [selector: string]: SystemStyleObject\n}\nexport interface ExtendableGlobalStyleObject {\n [selector: string]: SystemStyleObject | undefined\n extend?: GlobalStyleObject | undefined\n}\n\n/* -----------------------------------------------------------------------------\n * Composition (text styles, layer styles)\n * -----------------------------------------------------------------------------*/\n\ntype FilterStyleObject<P extends string> = {\n [K in P]?: (K extends keyof SystemStyleObject ? SystemStyleObject[K] : unknown) | undefined\n}\n\nexport type CompositionStyleObject<Property extends string> = Nested<FilterStyleObject<Property> & CssVarProperties>\n\n/* -----------------------------------------------------------------------------\n * Font face\n * -----------------------------------------------------------------------------*/\n\nexport type GlobalFontfaceRule = Omit<AtRule.FontFaceFallback, 'src'> & Required<Pick<AtRule.FontFaceFallback, 'src'>>\n\nexport type FontfaceRule = Omit<GlobalFontfaceRule, 'fontFamily'>\n\nexport interface GlobalFontface {\n [name: string]: FontfaceRule | FontfaceRule[]\n}\n\nexport interface ExtendableGlobalFontface {\n [name: string]: FontfaceRule | FontfaceRule[] | GlobalFontface | undefined\n extend?: GlobalFontface | undefined\n}\n\n/* -----------------------------------------------------------------------------\n * Jsx style props\n * -----------------------------------------------------------------------------*/\ninterface WithCss {\n css?: SystemStyleObject | SystemStyleObject[] | undefined\n}\n\nexport type JsxStyleProps = SystemStyleObject & WithCss\n\nexport interface PatchedHTMLProps {\n htmlWidth?: string | number | undefined\n htmlHeight?: string | number | undefined\n htmlTranslate?: 'yes' | 'no' | undefined\n htmlContent?: string | undefined\n}\n\nexport type OmittedHTMLProps = 'color' | 'translate' | 'transition' | 'width' | 'height' | 'content'\n\ntype WithHTMLProps<T> = DistributiveOmit<T, OmittedHTMLProps> & PatchedHTMLProps\n\nexport type JsxHTMLProps<T extends Record<string, any>, P extends Record<string, any> = {}> = Assign<\n WithHTMLProps<T>,\n P\n>\n";
1582
+ var content = "import type { ConditionalValue, Nested } from './conditions'\nimport type { AtRule, Globals, Properties } from './csstype'\nimport type { SystemProperties, CssVarProperties } from './style-props'\n\ntype String = string & {}\ntype Number = number & {}\n\nexport type Pretty<T> = { [K in keyof T]: T[K] } & {}\n\nexport type DistributiveOmit<T, K extends keyof any> = T extends unknown ? Omit<T, K> : never\n\nexport type DistributiveUnion<T, U> = {\n [K in keyof T]: K extends keyof U ? U[K] | T[K] : T[K]\n} & DistributiveOmit<U, keyof T>\n\nexport type Assign<T, U> = {\n [K in keyof T]: K extends keyof U ? U[K] : T[K]\n} & U\n\n/* -----------------------------------------------------------------------------\n * Native css properties\n * -----------------------------------------------------------------------------*/\n\ntype CornerShapeValue = 'round' | 'square' | 'bevel' | 'scoop' | 'notch' | 'squircle' | `superellipse(${number})`\n\nexport interface ModernCssProperties {\n /**\n * Controls whether the entire element should be draggable instead of its contents.\n */\n WebkitUserDrag?: Globals | 'auto' | 'element' | 'none' | undefined\n\n /**\n * Specifies whether an element can be used to drag the entire app window (Electron).\n */\n WebkitAppRegion?: Globals | 'drag' | 'no-drag' | undefined\n\n /**\n * Sets the horizontal spacing between table borders.\n */\n WebkitBorderHorizontalSpacing?: Globals | String | Number | undefined\n\n /**\n * Sets the vertical spacing between table borders.\n */\n WebkitBorderVerticalSpacing?: Globals | String | Number | undefined\n\n /**\n * Controls the display of text content for security purposes (e.g., password fields).\n */\n WebkitTextSecurity?: Globals | 'none' | 'circle' | 'disc' | 'square' | undefined\n\n /**\n * Specifies the shape of a box's corners within the area defined by the border-radius property.\n * @experimental\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/corner-shape\n */\n cornerShape?:\n | Globals\n | CornerShapeValue\n | `${CornerShapeValue} ${CornerShapeValue}`\n | `${CornerShapeValue} ${CornerShapeValue} ${CornerShapeValue}`\n | `${CornerShapeValue} ${CornerShapeValue} ${CornerShapeValue} ${CornerShapeValue}`\n | String\n | undefined\n}\n\nexport type CssProperty = keyof Properties\n\nexport interface CssProperties extends Properties<String | Number>, CssVarProperties, ModernCssProperties {}\n\nexport interface CssKeyframes {\n [name: string]: {\n [time: string]: CssProperties\n }\n}\n\n/* -----------------------------------------------------------------------------\n * Conditional css properties\n * -----------------------------------------------------------------------------*/\n\ninterface GenericProperties {\n [key: string]: ConditionalValue<String | Number | boolean>\n}\n\n/* -----------------------------------------------------------------------------\n * Native css props\n * -----------------------------------------------------------------------------*/\n\nexport type NestedCssProperties = Nested<CssProperties>\n\nexport type SystemStyleObject = Omit<Nested<SystemProperties & CssVarProperties>, 'base'>\n\n/**\n * A style object with these properties alone, in every condition and selector too: what a component\n * takes when it lets its caller style part of it. `SystemStyleObjectWith<'width' | 'margin'>` takes\n * those two; a shorthand, `mt`, is a property of its own and listed as one. It is a\n * `SystemStyleObject`, so it goes into `css()` as one.\n */\nexport type SystemStyleObjectWith<K extends keyof SystemProperties> = Omit<Nested<Pick<SystemProperties, K>>, 'base'>\n\n/** A style object with every property but these, in every condition and selector too. @see SystemStyleObjectWith */\nexport type SystemStyleObjectWithout<K extends keyof SystemProperties> = Omit<Nested<Omit<SystemProperties, K>>, 'base'>\n\n/**\n * The four `::view-transition-*` pseudo-elements a `viewTransition()` bag can style.\n *\n * `imagePair` is camelCase here and emitted as `::view-transition-image-pair`, matching\n * how every other property in a style object is authored.\n */\nexport interface ViewTransitionStyleObject {\n group?: SystemStyleObject | undefined\n imagePair?: SystemStyleObject | undefined\n old?: SystemStyleObject | undefined\n new?: SystemStyleObject | undefined\n}\n\nexport type ViewTransitionFn = (options: ViewTransitionStyleObject) => string\n\n/**\n * The stops of one `@keyframes` block: `from`, `to` or a percentage, each the declarations at that\n * point, as a theme keyframe takes them.\n */\nexport interface KeyframeStops {\n [stop: string]: CssProperties\n}\n\nexport type KeyframesFn = (stops: KeyframeStops) => string\n\nexport interface GlobalStyleObject {\n [selector: string]: SystemStyleObject\n}\nexport interface ExtendableGlobalStyleObject {\n [selector: string]: SystemStyleObject | undefined\n extend?: GlobalStyleObject | undefined\n}\n\n/* -----------------------------------------------------------------------------\n * Composition (text styles, layer styles)\n * -----------------------------------------------------------------------------*/\n\ntype FilterStyleObject<P extends string> = {\n [K in P]?: (K extends keyof SystemStyleObject ? SystemStyleObject[K] : unknown) | undefined\n}\n\nexport type CompositionStyleObject<Property extends string> = Nested<FilterStyleObject<Property> & CssVarProperties>\n\n/* -----------------------------------------------------------------------------\n * Font face\n * -----------------------------------------------------------------------------*/\n\nexport type GlobalFontfaceRule = Omit<AtRule.FontFaceFallback, 'src'> & Required<Pick<AtRule.FontFaceFallback, 'src'>>\n\nexport type FontfaceRule = Omit<GlobalFontfaceRule, 'fontFamily'>\n\nexport interface GlobalFontface {\n [name: string]: FontfaceRule | FontfaceRule[]\n}\n\nexport interface ExtendableGlobalFontface {\n [name: string]: FontfaceRule | FontfaceRule[] | GlobalFontface | undefined\n extend?: GlobalFontface | undefined\n}\n\n/* -----------------------------------------------------------------------------\n * Jsx style props\n * -----------------------------------------------------------------------------*/\ninterface WithCss {\n css?: SystemStyleObject | SystemStyleObject[] | undefined\n}\n\nexport type JsxStyleProps = SystemStyleObject & WithCss\n\nexport interface PatchedHTMLProps {\n htmlWidth?: string | number | undefined\n htmlHeight?: string | number | undefined\n htmlTranslate?: 'yes' | 'no' | undefined\n htmlContent?: string | undefined\n}\n\nexport type OmittedHTMLProps = 'color' | 'translate' | 'transition' | 'width' | 'height' | 'content'\n\ntype WithHTMLProps<T> = DistributiveOmit<T, OmittedHTMLProps> & PatchedHTMLProps\n\nexport type JsxHTMLProps<T extends Record<string, any>, P extends Record<string, any> = {}> = Assign<\n WithHTMLProps<T>,\n P\n>\n";
1566
1583
  //#endregion
1567
1584
  //#region src/artifacts/types/generated.ts
1568
1585
  function getGeneratedTypes(ctx) {
@@ -2729,7 +2746,7 @@ function setupPatterns(ctx, filters) {
2729
2746
  function setupCssIndex(ctx) {
2730
2747
  const index = {
2731
2748
  js: outdent.default`
2732
- ${ctx.file.reExport("css, fallback, viewTransition", "./css")}
2749
+ ${ctx.file.reExport("css, fallback, keyframes, viewTransition", "./css")}
2733
2750
  ${ctx.file.reExport("cx", "./cx")}
2734
2751
  ${ctx.file.reExport("cva", "./cva")}
2735
2752
  ${ctx.file.reExport("sva", "./sva")}
@@ -2745,7 +2762,7 @@ function setupCssIndex(ctx) {
2745
2762
  ${ctx.file.reExport("cvaMap, splitProps", "./cx")}
2746
2763
  `,
2747
2764
  dts: outdent.default`
2748
- ${ctx.file.reExportDts("css, fallback, viewTransition", "./css")}
2765
+ ${ctx.file.reExportDts("css, fallback, keyframes, viewTransition", "./css")}
2749
2766
  ${ctx.file.reExportDts("cx", "./cx")}
2750
2767
  ${ctx.file.reExportDts("cva", "./cva")}
2751
2768
  ${ctx.file.exportType("RecipeVariant, RecipeVariantProps", "./cva")}
package/dist/index.mjs CHANGED
@@ -44,7 +44,7 @@ function generateConditions(ctx) {
44
44
  function generateCssFn(ctx) {
45
45
  return {
46
46
  dts: outdent`
47
- ${ctx.file.importType("SystemStyleObject, ViewTransitionFn", "../types/index")}
47
+ ${ctx.file.importType("KeyframesFn, SystemStyleObject, ViewTransitionFn", "../types/index")}
48
48
 
49
49
  type Styles = SystemStyleObject | undefined | null | false
50
50
 
@@ -90,6 +90,22 @@ function generateCssFn(ctx) {
90
90
  */
91
91
  export declare const viewTransition: ViewTransitionFn;
92
92
 
93
+ /**
94
+ * Write a \`@keyframes\` block from these stops and get back its name, to animate with.
95
+ *
96
+ * The name is a hash of the stops as written, so the same stops anywhere in the project are
97
+ * one block. The call is replaced by the name at build time, which is why the stops have to
98
+ * be known then.
99
+ *
100
+ * @example
101
+ * const fadeIn = keyframes({ from: { opacity: 0 }, to: { opacity: 1 } })
102
+ *
103
+ * css({ animation: \`\${fadeIn} 0.2s ease-out\` })
104
+ *
105
+ * @see https://bamboocss.com/docs/concepts/keyframes
106
+ */
107
+ export declare const keyframes: KeyframesFn;
108
+
93
109
  `,
94
110
  js: outdent`
95
111
  ${ctx.file.import("cloneStyles, uncompiledStyle", "../helpers")}
@@ -107,6 +123,8 @@ function generateCssFn(ctx) {
107
123
 
108
124
  export const viewTransition = (_options) => uncompiledStyle('viewTransition')
109
125
 
126
+ export const keyframes = (_stops) => uncompiledStyle('keyframes')
127
+
110
128
  `
111
129
  };
112
130
  }
@@ -603,7 +621,7 @@ function generateRecipes(ctx, filters) {
603
621
  if (recipes.isEmpty()) return;
604
622
  return ctx.recipes.filterDetails(filters).map((recipe) => {
605
623
  const { baseName, config, upperName, variantKeyMap, dashName } = recipe;
606
- const { description, defaultVariants, compoundVariants, deprecated } = config;
624
+ const { description, defaultVariants, deprecated } = config;
607
625
  const getDefaultValueJsDoc = (key) => {
608
626
  if (!hasOwn(defaultVariants, key)) return;
609
627
  let defaultValue = defaultVariants[key];
@@ -625,7 +643,6 @@ function generateRecipes(ctx, filters) {
625
643
  })
626
644
  `,
627
645
  dts: outdent`
628
- ${ctx.file.importType("ConditionalValue", "../types/index")}
629
646
  ${ctx.file.importType("DistributiveOmit, Pretty", "../types/system-types")}
630
647
 
631
648
  interface ${upperName}Variant {
@@ -639,7 +656,7 @@ function generateRecipes(ctx, filters) {
639
656
  ${Recipes.isSlotRecipeConfig(config) ? `type ${upperName}Slot = ${unionType(config.slots)}` : ""}
640
657
 
641
658
  export type ${upperName}VariantProps = {
642
- [key in keyof ${upperName}Variant]?: ${compoundVariants?.length ? `${upperName}Variant[key]` : `ConditionalValue<${upperName}Variant[key]>`} | undefined
659
+ [key in keyof ${upperName}Variant]?: ${upperName}Variant[key] | undefined
643
660
  }
644
661
 
645
662
  export interface ${upperName}Recipe {
@@ -1536,7 +1553,7 @@ var content$2 = "import type { Pseudos } from './csstype'\n\ntype AriaAttributes
1536
1553
  var content$1 = "interface ConditionOptions {\n /**\n * The conditions to generate for the rule.\n * @example ['hover', 'focus']\n */\n conditions?: string[]\n /**\n * Whether to generate responsive styles for the rule.\n */\n responsive?: boolean\n}\n\nexport interface CssRule extends ConditionOptions {\n /**\n * The css properties to generate utilities for.\n * @example ['margin', 'padding']\n */\n properties: {\n [property: string]: Array<string | number>\n }\n}\n\ninterface RecipeRuleVariants {\n [variant: string]: boolean | string[]\n}\n\nexport type RecipeRuleObject = RecipeRuleVariants & ConditionOptions\nexport type RecipeRule = '*' | RecipeRuleObject\n\nexport type PatternRule = '*' | CssRule\n\nexport interface StaticCssOptions {\n /**\n * The css utility classes to generate.\n */\n css?: CssRule[]\n /**\n * The css recipes to generate.\n */\n recipes?:\n | '*'\n | {\n [recipe: string]: RecipeRule[]\n }\n /**\n * The css patterns to generate.\n */\n patterns?: {\n [pattern: string]: PatternRule[]\n }\n /**\n * The CSS themes to generate\n */\n themes?: string[]\n}\n";
1537
1554
  //#endregion
1538
1555
  //#region src/artifacts/generated/system-types.d.ts.json
1539
- var content = "import type { ConditionalValue, Nested } from './conditions'\nimport type { AtRule, Globals, Properties } from './csstype'\nimport type { SystemProperties, CssVarProperties } from './style-props'\n\ntype String = string & {}\ntype Number = number & {}\n\nexport type Pretty<T> = { [K in keyof T]: T[K] } & {}\n\nexport type DistributiveOmit<T, K extends keyof any> = T extends unknown ? Omit<T, K> : never\n\nexport type DistributiveUnion<T, U> = {\n [K in keyof T]: K extends keyof U ? U[K] | T[K] : T[K]\n} & DistributiveOmit<U, keyof T>\n\nexport type Assign<T, U> = {\n [K in keyof T]: K extends keyof U ? U[K] : T[K]\n} & U\n\n/* -----------------------------------------------------------------------------\n * Native css properties\n * -----------------------------------------------------------------------------*/\n\ntype CornerShapeValue = 'round' | 'square' | 'bevel' | 'scoop' | 'notch' | 'squircle' | `superellipse(${number})`\n\nexport interface ModernCssProperties {\n /**\n * Controls whether the entire element should be draggable instead of its contents.\n */\n WebkitUserDrag?: Globals | 'auto' | 'element' | 'none' | undefined\n\n /**\n * Specifies whether an element can be used to drag the entire app window (Electron).\n */\n WebkitAppRegion?: Globals | 'drag' | 'no-drag' | undefined\n\n /**\n * Sets the horizontal spacing between table borders.\n */\n WebkitBorderHorizontalSpacing?: Globals | String | Number | undefined\n\n /**\n * Sets the vertical spacing between table borders.\n */\n WebkitBorderVerticalSpacing?: Globals | String | Number | undefined\n\n /**\n * Controls the display of text content for security purposes (e.g., password fields).\n */\n WebkitTextSecurity?: Globals | 'none' | 'circle' | 'disc' | 'square' | undefined\n\n /**\n * Specifies the shape of a box's corners within the area defined by the border-radius property.\n * @experimental\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/corner-shape\n */\n cornerShape?:\n | Globals\n | CornerShapeValue\n | `${CornerShapeValue} ${CornerShapeValue}`\n | `${CornerShapeValue} ${CornerShapeValue} ${CornerShapeValue}`\n | `${CornerShapeValue} ${CornerShapeValue} ${CornerShapeValue} ${CornerShapeValue}`\n | String\n | undefined\n}\n\nexport type CssProperty = keyof Properties\n\nexport interface CssProperties extends Properties<String | Number>, CssVarProperties, ModernCssProperties {}\n\nexport interface CssKeyframes {\n [name: string]: {\n [time: string]: CssProperties\n }\n}\n\n/* -----------------------------------------------------------------------------\n * Conditional css properties\n * -----------------------------------------------------------------------------*/\n\ninterface GenericProperties {\n [key: string]: ConditionalValue<String | Number | boolean>\n}\n\n/* -----------------------------------------------------------------------------\n * Native css props\n * -----------------------------------------------------------------------------*/\n\nexport type NestedCssProperties = Nested<CssProperties>\n\nexport type SystemStyleObject = Omit<Nested<SystemProperties & CssVarProperties>, 'base'>\n\n/**\n * The four `::view-transition-*` pseudo-elements a `viewTransition()` bag can style.\n *\n * `imagePair` is camelCase here and emitted as `::view-transition-image-pair`, matching\n * how every other property in a style object is authored.\n */\nexport interface ViewTransitionStyleObject {\n group?: SystemStyleObject | undefined\n imagePair?: SystemStyleObject | undefined\n old?: SystemStyleObject | undefined\n new?: SystemStyleObject | undefined\n}\n\nexport type ViewTransitionFn = (options: ViewTransitionStyleObject) => string\n\nexport interface GlobalStyleObject {\n [selector: string]: SystemStyleObject\n}\nexport interface ExtendableGlobalStyleObject {\n [selector: string]: SystemStyleObject | undefined\n extend?: GlobalStyleObject | undefined\n}\n\n/* -----------------------------------------------------------------------------\n * Composition (text styles, layer styles)\n * -----------------------------------------------------------------------------*/\n\ntype FilterStyleObject<P extends string> = {\n [K in P]?: (K extends keyof SystemStyleObject ? SystemStyleObject[K] : unknown) | undefined\n}\n\nexport type CompositionStyleObject<Property extends string> = Nested<FilterStyleObject<Property> & CssVarProperties>\n\n/* -----------------------------------------------------------------------------\n * Font face\n * -----------------------------------------------------------------------------*/\n\nexport type GlobalFontfaceRule = Omit<AtRule.FontFaceFallback, 'src'> & Required<Pick<AtRule.FontFaceFallback, 'src'>>\n\nexport type FontfaceRule = Omit<GlobalFontfaceRule, 'fontFamily'>\n\nexport interface GlobalFontface {\n [name: string]: FontfaceRule | FontfaceRule[]\n}\n\nexport interface ExtendableGlobalFontface {\n [name: string]: FontfaceRule | FontfaceRule[] | GlobalFontface | undefined\n extend?: GlobalFontface | undefined\n}\n\n/* -----------------------------------------------------------------------------\n * Jsx style props\n * -----------------------------------------------------------------------------*/\ninterface WithCss {\n css?: SystemStyleObject | SystemStyleObject[] | undefined\n}\n\nexport type JsxStyleProps = SystemStyleObject & WithCss\n\nexport interface PatchedHTMLProps {\n htmlWidth?: string | number | undefined\n htmlHeight?: string | number | undefined\n htmlTranslate?: 'yes' | 'no' | undefined\n htmlContent?: string | undefined\n}\n\nexport type OmittedHTMLProps = 'color' | 'translate' | 'transition' | 'width' | 'height' | 'content'\n\ntype WithHTMLProps<T> = DistributiveOmit<T, OmittedHTMLProps> & PatchedHTMLProps\n\nexport type JsxHTMLProps<T extends Record<string, any>, P extends Record<string, any> = {}> = Assign<\n WithHTMLProps<T>,\n P\n>\n";
1556
+ var content = "import type { ConditionalValue, Nested } from './conditions'\nimport type { AtRule, Globals, Properties } from './csstype'\nimport type { SystemProperties, CssVarProperties } from './style-props'\n\ntype String = string & {}\ntype Number = number & {}\n\nexport type Pretty<T> = { [K in keyof T]: T[K] } & {}\n\nexport type DistributiveOmit<T, K extends keyof any> = T extends unknown ? Omit<T, K> : never\n\nexport type DistributiveUnion<T, U> = {\n [K in keyof T]: K extends keyof U ? U[K] | T[K] : T[K]\n} & DistributiveOmit<U, keyof T>\n\nexport type Assign<T, U> = {\n [K in keyof T]: K extends keyof U ? U[K] : T[K]\n} & U\n\n/* -----------------------------------------------------------------------------\n * Native css properties\n * -----------------------------------------------------------------------------*/\n\ntype CornerShapeValue = 'round' | 'square' | 'bevel' | 'scoop' | 'notch' | 'squircle' | `superellipse(${number})`\n\nexport interface ModernCssProperties {\n /**\n * Controls whether the entire element should be draggable instead of its contents.\n */\n WebkitUserDrag?: Globals | 'auto' | 'element' | 'none' | undefined\n\n /**\n * Specifies whether an element can be used to drag the entire app window (Electron).\n */\n WebkitAppRegion?: Globals | 'drag' | 'no-drag' | undefined\n\n /**\n * Sets the horizontal spacing between table borders.\n */\n WebkitBorderHorizontalSpacing?: Globals | String | Number | undefined\n\n /**\n * Sets the vertical spacing between table borders.\n */\n WebkitBorderVerticalSpacing?: Globals | String | Number | undefined\n\n /**\n * Controls the display of text content for security purposes (e.g., password fields).\n */\n WebkitTextSecurity?: Globals | 'none' | 'circle' | 'disc' | 'square' | undefined\n\n /**\n * Specifies the shape of a box's corners within the area defined by the border-radius property.\n * @experimental\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/corner-shape\n */\n cornerShape?:\n | Globals\n | CornerShapeValue\n | `${CornerShapeValue} ${CornerShapeValue}`\n | `${CornerShapeValue} ${CornerShapeValue} ${CornerShapeValue}`\n | `${CornerShapeValue} ${CornerShapeValue} ${CornerShapeValue} ${CornerShapeValue}`\n | String\n | undefined\n}\n\nexport type CssProperty = keyof Properties\n\nexport interface CssProperties extends Properties<String | Number>, CssVarProperties, ModernCssProperties {}\n\nexport interface CssKeyframes {\n [name: string]: {\n [time: string]: CssProperties\n }\n}\n\n/* -----------------------------------------------------------------------------\n * Conditional css properties\n * -----------------------------------------------------------------------------*/\n\ninterface GenericProperties {\n [key: string]: ConditionalValue<String | Number | boolean>\n}\n\n/* -----------------------------------------------------------------------------\n * Native css props\n * -----------------------------------------------------------------------------*/\n\nexport type NestedCssProperties = Nested<CssProperties>\n\nexport type SystemStyleObject = Omit<Nested<SystemProperties & CssVarProperties>, 'base'>\n\n/**\n * A style object with these properties alone, in every condition and selector too: what a component\n * takes when it lets its caller style part of it. `SystemStyleObjectWith<'width' | 'margin'>` takes\n * those two; a shorthand, `mt`, is a property of its own and listed as one. It is a\n * `SystemStyleObject`, so it goes into `css()` as one.\n */\nexport type SystemStyleObjectWith<K extends keyof SystemProperties> = Omit<Nested<Pick<SystemProperties, K>>, 'base'>\n\n/** A style object with every property but these, in every condition and selector too. @see SystemStyleObjectWith */\nexport type SystemStyleObjectWithout<K extends keyof SystemProperties> = Omit<Nested<Omit<SystemProperties, K>>, 'base'>\n\n/**\n * The four `::view-transition-*` pseudo-elements a `viewTransition()` bag can style.\n *\n * `imagePair` is camelCase here and emitted as `::view-transition-image-pair`, matching\n * how every other property in a style object is authored.\n */\nexport interface ViewTransitionStyleObject {\n group?: SystemStyleObject | undefined\n imagePair?: SystemStyleObject | undefined\n old?: SystemStyleObject | undefined\n new?: SystemStyleObject | undefined\n}\n\nexport type ViewTransitionFn = (options: ViewTransitionStyleObject) => string\n\n/**\n * The stops of one `@keyframes` block: `from`, `to` or a percentage, each the declarations at that\n * point, as a theme keyframe takes them.\n */\nexport interface KeyframeStops {\n [stop: string]: CssProperties\n}\n\nexport type KeyframesFn = (stops: KeyframeStops) => string\n\nexport interface GlobalStyleObject {\n [selector: string]: SystemStyleObject\n}\nexport interface ExtendableGlobalStyleObject {\n [selector: string]: SystemStyleObject | undefined\n extend?: GlobalStyleObject | undefined\n}\n\n/* -----------------------------------------------------------------------------\n * Composition (text styles, layer styles)\n * -----------------------------------------------------------------------------*/\n\ntype FilterStyleObject<P extends string> = {\n [K in P]?: (K extends keyof SystemStyleObject ? SystemStyleObject[K] : unknown) | undefined\n}\n\nexport type CompositionStyleObject<Property extends string> = Nested<FilterStyleObject<Property> & CssVarProperties>\n\n/* -----------------------------------------------------------------------------\n * Font face\n * -----------------------------------------------------------------------------*/\n\nexport type GlobalFontfaceRule = Omit<AtRule.FontFaceFallback, 'src'> & Required<Pick<AtRule.FontFaceFallback, 'src'>>\n\nexport type FontfaceRule = Omit<GlobalFontfaceRule, 'fontFamily'>\n\nexport interface GlobalFontface {\n [name: string]: FontfaceRule | FontfaceRule[]\n}\n\nexport interface ExtendableGlobalFontface {\n [name: string]: FontfaceRule | FontfaceRule[] | GlobalFontface | undefined\n extend?: GlobalFontface | undefined\n}\n\n/* -----------------------------------------------------------------------------\n * Jsx style props\n * -----------------------------------------------------------------------------*/\ninterface WithCss {\n css?: SystemStyleObject | SystemStyleObject[] | undefined\n}\n\nexport type JsxStyleProps = SystemStyleObject & WithCss\n\nexport interface PatchedHTMLProps {\n htmlWidth?: string | number | undefined\n htmlHeight?: string | number | undefined\n htmlTranslate?: 'yes' | 'no' | undefined\n htmlContent?: string | undefined\n}\n\nexport type OmittedHTMLProps = 'color' | 'translate' | 'transition' | 'width' | 'height' | 'content'\n\ntype WithHTMLProps<T> = DistributiveOmit<T, OmittedHTMLProps> & PatchedHTMLProps\n\nexport type JsxHTMLProps<T extends Record<string, any>, P extends Record<string, any> = {}> = Assign<\n WithHTMLProps<T>,\n P\n>\n";
1540
1557
  //#endregion
1541
1558
  //#region src/artifacts/types/generated.ts
1542
1559
  function getGeneratedTypes(ctx) {
@@ -2703,7 +2720,7 @@ function setupPatterns(ctx, filters) {
2703
2720
  function setupCssIndex(ctx) {
2704
2721
  const index = {
2705
2722
  js: outdent$1`
2706
- ${ctx.file.reExport("css, fallback, viewTransition", "./css")}
2723
+ ${ctx.file.reExport("css, fallback, keyframes, viewTransition", "./css")}
2707
2724
  ${ctx.file.reExport("cx", "./cx")}
2708
2725
  ${ctx.file.reExport("cva", "./cva")}
2709
2726
  ${ctx.file.reExport("sva", "./sva")}
@@ -2719,7 +2736,7 @@ function setupCssIndex(ctx) {
2719
2736
  ${ctx.file.reExport("cvaMap, splitProps", "./cx")}
2720
2737
  `,
2721
2738
  dts: outdent$1`
2722
- ${ctx.file.reExportDts("css, fallback, viewTransition", "./css")}
2739
+ ${ctx.file.reExportDts("css, fallback, keyframes, viewTransition", "./css")}
2723
2740
  ${ctx.file.reExportDts("cx", "./cx")}
2724
2741
  ${ctx.file.reExportDts("cva", "./cva")}
2725
2742
  ${ctx.file.exportType("RecipeVariant, RecipeVariantProps", "./cva")}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bamboocss/generator",
3
- "version": "1.57.6",
3
+ "version": "1.58.0",
4
4
  "description": "The css generator for css bamboo",
5
5
  "homepage": "https://bamboocss.com",
6
6
  "license": "MIT",
@@ -38,12 +38,12 @@
38
38
  "pluralize": "8.0.0",
39
39
  "postcss": "8.5.26",
40
40
  "ts-pattern": "5.9.0",
41
- "@bamboocss/is-valid-prop": "^1.57.6",
42
- "@bamboocss/logger": "1.57.6",
43
- "@bamboocss/shared": "1.57.6",
44
- "@bamboocss/core": "1.57.6",
45
- "@bamboocss/token-dictionary": "1.57.6",
46
- "@bamboocss/types": "1.57.6"
41
+ "@bamboocss/core": "1.58.0",
42
+ "@bamboocss/is-valid-prop": "^1.58.0",
43
+ "@bamboocss/logger": "1.58.0",
44
+ "@bamboocss/shared": "1.58.0",
45
+ "@bamboocss/token-dictionary": "1.58.0",
46
+ "@bamboocss/types": "1.58.0"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@types/pluralize": "0.0.33"