@pandacss/generator 0.0.0-dev-20230212083454 → 0.0.0-dev-20230212115356

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.js CHANGED
@@ -127,7 +127,7 @@ var getMessages = (ctx) => ({
127
127
  var import_lil_fp4 = require("lil-fp");
128
128
 
129
129
  // src/artifacts/index.ts
130
- var import_outdent28 = __toESM(require("outdent"));
130
+ var import_outdent29 = __toESM(require("outdent"));
131
131
 
132
132
  // src/artifacts/css/keyframe-css.ts
133
133
  var import_core = require("@pandacss/core");
@@ -1426,16 +1426,87 @@ function generateVueJsxFactory(ctx) {
1426
1426
  };
1427
1427
  }
1428
1428
 
1429
- // src/artifacts/vue-jsx/types.ts
1429
+ // src/artifacts/vue-jsx/layout-grid.ts
1430
1430
  var import_outdent23 = require("outdent");
1431
+ function generateVueLayoutGrid() {
1432
+ return {
1433
+ dts: import_outdent23.outdent`
1434
+ import type { FunctionalComponent } from 'vue'
1435
+
1436
+ export type LayoutGridProps = {
1437
+ count?: number
1438
+ gutter?: string
1439
+ maxWidth?: string
1440
+ margin?: string
1441
+ outline?: boolean
1442
+ }
1443
+
1444
+ export declare const LayoutGrid: FunctionalComponent<LayoutGridProps>
1445
+ `,
1446
+ js: import_outdent23.outdent`
1447
+ import { h, computed } from 'vue'
1448
+
1449
+ export const LayoutGrid = defineComponent({
1450
+ name: 'LayoutGrid',
1451
+ props: {
1452
+ count: {
1453
+ type: Number,
1454
+ default: 12,
1455
+ },
1456
+ margin: String,
1457
+ gutter: {
1458
+ type: String,
1459
+ default: '24px',
1460
+ },
1461
+ maxWidth: String,
1462
+ outline: Boolean,
1463
+ },
1464
+ setup(props) {
1465
+ const hasMaxWidthRef = computed(() => props.maxWidth != null)
1466
+ const variantRef = computed(() => (props.outline ? 'outline' : 'default'))
1467
+ return () => {
1468
+ const { count, margin, gutter, maxWidth } = props
1469
+ const hasMaxWidth = hasMaxWidthRef.value
1470
+ const variant = variantRef.value
1471
+
1472
+ return h(
1473
+ 'div',
1474
+ {
1475
+ class: 'panda-layout-grid',
1476
+ style: {
1477
+ '--gutter': gutter,
1478
+ '--count': count,
1479
+ '--max-width': hasMaxWidth ? maxWidth : 'initial',
1480
+ '--margin-x': hasMaxWidth ? 'auto' : undefined,
1481
+ '--padding-x': !hasMaxWidth ? margin : undefined,
1482
+ },
1483
+ },
1484
+ Array.from({ length: count }, (_, i) => {
1485
+ return h('span', {
1486
+ 'data-variant': variant,
1487
+ key: i,
1488
+ class: 'panda-layout-grid__item',
1489
+ })
1490
+ }),
1491
+ )
1492
+ }
1493
+ },
1494
+ })
1495
+
1496
+ `
1497
+ };
1498
+ }
1499
+
1500
+ // src/artifacts/vue-jsx/types.ts
1501
+ var import_outdent24 = require("outdent");
1431
1502
  function generateVueJsxTypes(ctx) {
1432
1503
  const { factoryName, componentName, upperName, typeName } = ctx.jsx;
1433
1504
  return {
1434
- jsxFactory: import_outdent23.outdent`
1505
+ jsxFactory: import_outdent24.outdent`
1435
1506
  import { ${upperName} } from '../types/jsx'
1436
1507
  export declare const ${factoryName}: ${upperName}
1437
1508
  `,
1438
- jsxType: import_outdent23.outdent`
1509
+ jsxType: import_outdent24.outdent`
1439
1510
  import type { Component, FunctionalComponent } from 'vue'
1440
1511
  import type { JsxStyleProps, Assign } from '.'
1441
1512
  import type { RecipeDefinition, RecipeRuntimeFn, RecipeSelection, RecipeVariantRecord } from './recipe'
@@ -1629,7 +1700,7 @@ var layoutGridMap = {
1629
1700
  react: generateReactLayoutGrid,
1630
1701
  preact: generatePreactLayoutGrid,
1631
1702
  solid: generateSolidLayoutGrid,
1632
- vue: () => ({ js: "", dts: "" })
1703
+ vue: generateVueLayoutGrid
1633
1704
  };
1634
1705
  function generateLayoutGrid(ctx) {
1635
1706
  if (!ctx.jsx.framework)
@@ -1714,9 +1785,9 @@ function getGeneratedTypes() {
1714
1785
  }
1715
1786
 
1716
1787
  // src/artifacts/types/main.ts
1717
- var import_outdent24 = require("outdent");
1788
+ var import_outdent25 = require("outdent");
1718
1789
  var generateTypesEntry = () => ({
1719
- global: import_outdent24.outdent`
1790
+ global: import_outdent25.outdent`
1720
1791
  import { RecipeVariantRecord, RecipeConfig } from './recipe'
1721
1792
  import { GlobalStyleObject } from './system-types'
1722
1793
  import { CompositionStyles } from './composition'
@@ -1728,7 +1799,7 @@ var generateTypesEntry = () => ({
1728
1799
  export function defineLayerStyles(definition: CompositionStyles['layerStyles']): CompositionStyles['layerStyles']
1729
1800
  }
1730
1801
  `,
1731
- index: import_outdent24.outdent`
1802
+ index: import_outdent25.outdent`
1732
1803
  import './global'
1733
1804
  export { ConditionalValue } from './conditions'
1734
1805
  export { GlobalStyleObject, JsxStyleProps, SystemStyleObject } from './system-types'
@@ -1738,7 +1809,7 @@ var generateTypesEntry = () => ({
1738
1809
  });
1739
1810
 
1740
1811
  // src/artifacts/types/prop-types.ts
1741
- var import_outdent25 = require("outdent");
1812
+ var import_outdent26 = require("outdent");
1742
1813
  function generatePropTypes(ctx) {
1743
1814
  const {
1744
1815
  config: { strictTokens },
@@ -1746,7 +1817,7 @@ function generatePropTypes(ctx) {
1746
1817
  } = ctx;
1747
1818
  const strictText = `${strictTokens ? "" : " | NativeValue<T>"}`;
1748
1819
  const result = [
1749
- import_outdent25.outdent`
1820
+ import_outdent26.outdent`
1750
1821
  import type { ConditionalValue } from './conditions';
1751
1822
  import type { Properties as CSSProperties } from './csstype'
1752
1823
  import type { Tokens } from './token'
@@ -1769,7 +1840,7 @@ function generatePropTypes(ctx) {
1769
1840
  result.push(` ${key}: Shorthand<${JSON.stringify(value)}>;`);
1770
1841
  });
1771
1842
  result.push("}");
1772
- return import_outdent25.outdent`
1843
+ return import_outdent26.outdent`
1773
1844
  ${result.join("\n")}
1774
1845
 
1775
1846
  export type PropertyValue<T extends string> = T extends keyof PropertyTypes
@@ -1782,10 +1853,10 @@ function generatePropTypes(ctx) {
1782
1853
 
1783
1854
  // src/artifacts/types/style-props.ts
1784
1855
  var import_is_valid_prop = require("@pandacss/is-valid-prop");
1785
- var import_outdent26 = __toESM(require("outdent"));
1856
+ var import_outdent27 = __toESM(require("outdent"));
1786
1857
  function generateStyleProps(ctx) {
1787
1858
  const props = new Set(import_is_valid_prop.allCssProperties.concat(ctx.utility.keys()));
1788
- return import_outdent26.default`
1859
+ return import_outdent27.default`
1789
1860
  import { PropertyValue } from './prop-type'
1790
1861
  import { Token } from './token'
1791
1862
 
@@ -1801,7 +1872,7 @@ function generateStyleProps(ctx) {
1801
1872
 
1802
1873
  // src/artifacts/types/token-types.ts
1803
1874
  var import_shared3 = require("@pandacss/shared");
1804
- var import_outdent27 = require("outdent");
1875
+ var import_outdent28 = require("outdent");
1805
1876
  var import_pluralize = __toESM(require("pluralize"));
1806
1877
  function generateTokenTypes(ctx) {
1807
1878
  const { tokens } = ctx;
@@ -1820,7 +1891,7 @@ function generateTokenTypes(ctx) {
1820
1891
  }
1821
1892
  result.add("} & { [token: string]: never }");
1822
1893
  set.add(Array.from(result).join("\n"));
1823
- return import_outdent27.outdent.string(Array.from(set).join("\n\n"));
1894
+ return import_outdent28.outdent.string(Array.from(set).join("\n\n"));
1824
1895
  }
1825
1896
 
1826
1897
  // src/artifacts/css/global-css.ts
@@ -1992,8 +2063,8 @@ function setupPatterns(ctx) {
1992
2063
  if (!files)
1993
2064
  return;
1994
2065
  const index = {
1995
- js: import_outdent28.default.string(files.map((file) => ctx.file.export(`./${file.name}`)).join("\n")),
1996
- dts: import_outdent28.default.string(files.map((file) => `export * from './${file.name}'`).join("\n"))
2066
+ js: import_outdent29.default.string(files.map((file) => ctx.file.export(`./${file.name}`)).join("\n")),
2067
+ dts: import_outdent29.default.string(files.map((file) => `export * from './${file.name}'`).join("\n"))
1997
2068
  };
1998
2069
  return {
1999
2070
  dir: ctx.paths.pattern,
@@ -2014,15 +2085,15 @@ function setupJsx(ctx) {
2014
2085
  const patterns = generateJsxPatterns(ctx);
2015
2086
  const layoutGrid2 = generateLayoutGrid(ctx);
2016
2087
  const index = {
2017
- js: import_outdent28.default`
2088
+ js: import_outdent29.default`
2018
2089
  ${ctx.file.export("./factory")}
2019
2090
  ${ctx.file.export("./layout-grid")}
2020
- ${import_outdent28.default.string(patterns.map((file) => ctx.file.export(`./${file.name}`)).join("\n"))}
2091
+ ${import_outdent29.default.string(patterns.map((file) => ctx.file.export(`./${file.name}`)).join("\n"))}
2021
2092
  `,
2022
- dts: import_outdent28.default`
2093
+ dts: import_outdent29.default`
2023
2094
  export * from './factory'
2024
2095
  export * from './layout-grid'
2025
- ${import_outdent28.default.string(patterns.map((file) => `export * from './${file.name}'`).join("\n"))}
2096
+ ${import_outdent29.default.string(patterns.map((file) => `export * from './${file.name}'`).join("\n"))}
2026
2097
  export type { ${ctx.jsx.typeName} } from '../types/jsx'
2027
2098
  `
2028
2099
  };
@@ -2043,12 +2114,12 @@ function setupJsx(ctx) {
2043
2114
  }
2044
2115
  function setupCssIndex(ctx) {
2045
2116
  const index = {
2046
- js: import_outdent28.default`
2117
+ js: import_outdent29.default`
2047
2118
  ${ctx.file.export("./css")}
2048
2119
  ${ctx.file.export("./cx")}
2049
2120
  ${ctx.file.export("./cva")}
2050
2121
  `,
2051
- dts: import_outdent28.default`
2122
+ dts: import_outdent29.default`
2052
2123
  export * from './css'
2053
2124
  export * from './cx'
2054
2125
  export * from './cva'
package/dist/index.mjs CHANGED
@@ -96,7 +96,7 @@ var getMessages = (ctx) => ({
96
96
  import { Obj as Obj4, pipe as pipe5 } from "lil-fp";
97
97
 
98
98
  // src/artifacts/index.ts
99
- import outdent28 from "outdent";
99
+ import outdent29 from "outdent";
100
100
 
101
101
  // src/artifacts/css/keyframe-css.ts
102
102
  import { toCss } from "@pandacss/core";
@@ -1395,16 +1395,87 @@ function generateVueJsxFactory(ctx) {
1395
1395
  };
1396
1396
  }
1397
1397
 
1398
- // src/artifacts/vue-jsx/types.ts
1398
+ // src/artifacts/vue-jsx/layout-grid.ts
1399
1399
  import { outdent as outdent23 } from "outdent";
1400
+ function generateVueLayoutGrid() {
1401
+ return {
1402
+ dts: outdent23`
1403
+ import type { FunctionalComponent } from 'vue'
1404
+
1405
+ export type LayoutGridProps = {
1406
+ count?: number
1407
+ gutter?: string
1408
+ maxWidth?: string
1409
+ margin?: string
1410
+ outline?: boolean
1411
+ }
1412
+
1413
+ export declare const LayoutGrid: FunctionalComponent<LayoutGridProps>
1414
+ `,
1415
+ js: outdent23`
1416
+ import { h, computed } from 'vue'
1417
+
1418
+ export const LayoutGrid = defineComponent({
1419
+ name: 'LayoutGrid',
1420
+ props: {
1421
+ count: {
1422
+ type: Number,
1423
+ default: 12,
1424
+ },
1425
+ margin: String,
1426
+ gutter: {
1427
+ type: String,
1428
+ default: '24px',
1429
+ },
1430
+ maxWidth: String,
1431
+ outline: Boolean,
1432
+ },
1433
+ setup(props) {
1434
+ const hasMaxWidthRef = computed(() => props.maxWidth != null)
1435
+ const variantRef = computed(() => (props.outline ? 'outline' : 'default'))
1436
+ return () => {
1437
+ const { count, margin, gutter, maxWidth } = props
1438
+ const hasMaxWidth = hasMaxWidthRef.value
1439
+ const variant = variantRef.value
1440
+
1441
+ return h(
1442
+ 'div',
1443
+ {
1444
+ class: 'panda-layout-grid',
1445
+ style: {
1446
+ '--gutter': gutter,
1447
+ '--count': count,
1448
+ '--max-width': hasMaxWidth ? maxWidth : 'initial',
1449
+ '--margin-x': hasMaxWidth ? 'auto' : undefined,
1450
+ '--padding-x': !hasMaxWidth ? margin : undefined,
1451
+ },
1452
+ },
1453
+ Array.from({ length: count }, (_, i) => {
1454
+ return h('span', {
1455
+ 'data-variant': variant,
1456
+ key: i,
1457
+ class: 'panda-layout-grid__item',
1458
+ })
1459
+ }),
1460
+ )
1461
+ }
1462
+ },
1463
+ })
1464
+
1465
+ `
1466
+ };
1467
+ }
1468
+
1469
+ // src/artifacts/vue-jsx/types.ts
1470
+ import { outdent as outdent24 } from "outdent";
1400
1471
  function generateVueJsxTypes(ctx) {
1401
1472
  const { factoryName, componentName, upperName, typeName } = ctx.jsx;
1402
1473
  return {
1403
- jsxFactory: outdent23`
1474
+ jsxFactory: outdent24`
1404
1475
  import { ${upperName} } from '../types/jsx'
1405
1476
  export declare const ${factoryName}: ${upperName}
1406
1477
  `,
1407
- jsxType: outdent23`
1478
+ jsxType: outdent24`
1408
1479
  import type { Component, FunctionalComponent } from 'vue'
1409
1480
  import type { JsxStyleProps, Assign } from '.'
1410
1481
  import type { RecipeDefinition, RecipeRuntimeFn, RecipeSelection, RecipeVariantRecord } from './recipe'
@@ -1598,7 +1669,7 @@ var layoutGridMap = {
1598
1669
  react: generateReactLayoutGrid,
1599
1670
  preact: generatePreactLayoutGrid,
1600
1671
  solid: generateSolidLayoutGrid,
1601
- vue: () => ({ js: "", dts: "" })
1672
+ vue: generateVueLayoutGrid
1602
1673
  };
1603
1674
  function generateLayoutGrid(ctx) {
1604
1675
  if (!ctx.jsx.framework)
@@ -1683,9 +1754,9 @@ function getGeneratedTypes() {
1683
1754
  }
1684
1755
 
1685
1756
  // src/artifacts/types/main.ts
1686
- import { outdent as outdent24 } from "outdent";
1757
+ import { outdent as outdent25 } from "outdent";
1687
1758
  var generateTypesEntry = () => ({
1688
- global: outdent24`
1759
+ global: outdent25`
1689
1760
  import { RecipeVariantRecord, RecipeConfig } from './recipe'
1690
1761
  import { GlobalStyleObject } from './system-types'
1691
1762
  import { CompositionStyles } from './composition'
@@ -1697,7 +1768,7 @@ var generateTypesEntry = () => ({
1697
1768
  export function defineLayerStyles(definition: CompositionStyles['layerStyles']): CompositionStyles['layerStyles']
1698
1769
  }
1699
1770
  `,
1700
- index: outdent24`
1771
+ index: outdent25`
1701
1772
  import './global'
1702
1773
  export { ConditionalValue } from './conditions'
1703
1774
  export { GlobalStyleObject, JsxStyleProps, SystemStyleObject } from './system-types'
@@ -1707,7 +1778,7 @@ var generateTypesEntry = () => ({
1707
1778
  });
1708
1779
 
1709
1780
  // src/artifacts/types/prop-types.ts
1710
- import { outdent as outdent25 } from "outdent";
1781
+ import { outdent as outdent26 } from "outdent";
1711
1782
  function generatePropTypes(ctx) {
1712
1783
  const {
1713
1784
  config: { strictTokens },
@@ -1715,7 +1786,7 @@ function generatePropTypes(ctx) {
1715
1786
  } = ctx;
1716
1787
  const strictText = `${strictTokens ? "" : " | NativeValue<T>"}`;
1717
1788
  const result = [
1718
- outdent25`
1789
+ outdent26`
1719
1790
  import type { ConditionalValue } from './conditions';
1720
1791
  import type { Properties as CSSProperties } from './csstype'
1721
1792
  import type { Tokens } from './token'
@@ -1738,7 +1809,7 @@ function generatePropTypes(ctx) {
1738
1809
  result.push(` ${key}: Shorthand<${JSON.stringify(value)}>;`);
1739
1810
  });
1740
1811
  result.push("}");
1741
- return outdent25`
1812
+ return outdent26`
1742
1813
  ${result.join("\n")}
1743
1814
 
1744
1815
  export type PropertyValue<T extends string> = T extends keyof PropertyTypes
@@ -1751,10 +1822,10 @@ function generatePropTypes(ctx) {
1751
1822
 
1752
1823
  // src/artifacts/types/style-props.ts
1753
1824
  import { allCssProperties } from "@pandacss/is-valid-prop";
1754
- import outdent26 from "outdent";
1825
+ import outdent27 from "outdent";
1755
1826
  function generateStyleProps(ctx) {
1756
1827
  const props = new Set(allCssProperties.concat(ctx.utility.keys()));
1757
- return outdent26`
1828
+ return outdent27`
1758
1829
  import { PropertyValue } from './prop-type'
1759
1830
  import { Token } from './token'
1760
1831
 
@@ -1770,7 +1841,7 @@ function generateStyleProps(ctx) {
1770
1841
 
1771
1842
  // src/artifacts/types/token-types.ts
1772
1843
  import { capitalize as capitalize2, unionType as unionType3 } from "@pandacss/shared";
1773
- import { outdent as outdent27 } from "outdent";
1844
+ import { outdent as outdent28 } from "outdent";
1774
1845
  import pluralize from "pluralize";
1775
1846
  function generateTokenTypes(ctx) {
1776
1847
  const { tokens } = ctx;
@@ -1789,7 +1860,7 @@ function generateTokenTypes(ctx) {
1789
1860
  }
1790
1861
  result.add("} & { [token: string]: never }");
1791
1862
  set.add(Array.from(result).join("\n"));
1792
- return outdent27.string(Array.from(set).join("\n\n"));
1863
+ return outdent28.string(Array.from(set).join("\n\n"));
1793
1864
  }
1794
1865
 
1795
1866
  // src/artifacts/css/global-css.ts
@@ -1961,8 +2032,8 @@ function setupPatterns(ctx) {
1961
2032
  if (!files)
1962
2033
  return;
1963
2034
  const index = {
1964
- js: outdent28.string(files.map((file) => ctx.file.export(`./${file.name}`)).join("\n")),
1965
- dts: outdent28.string(files.map((file) => `export * from './${file.name}'`).join("\n"))
2035
+ js: outdent29.string(files.map((file) => ctx.file.export(`./${file.name}`)).join("\n")),
2036
+ dts: outdent29.string(files.map((file) => `export * from './${file.name}'`).join("\n"))
1966
2037
  };
1967
2038
  return {
1968
2039
  dir: ctx.paths.pattern,
@@ -1983,15 +2054,15 @@ function setupJsx(ctx) {
1983
2054
  const patterns = generateJsxPatterns(ctx);
1984
2055
  const layoutGrid2 = generateLayoutGrid(ctx);
1985
2056
  const index = {
1986
- js: outdent28`
2057
+ js: outdent29`
1987
2058
  ${ctx.file.export("./factory")}
1988
2059
  ${ctx.file.export("./layout-grid")}
1989
- ${outdent28.string(patterns.map((file) => ctx.file.export(`./${file.name}`)).join("\n"))}
2060
+ ${outdent29.string(patterns.map((file) => ctx.file.export(`./${file.name}`)).join("\n"))}
1990
2061
  `,
1991
- dts: outdent28`
2062
+ dts: outdent29`
1992
2063
  export * from './factory'
1993
2064
  export * from './layout-grid'
1994
- ${outdent28.string(patterns.map((file) => `export * from './${file.name}'`).join("\n"))}
2065
+ ${outdent29.string(patterns.map((file) => `export * from './${file.name}'`).join("\n"))}
1995
2066
  export type { ${ctx.jsx.typeName} } from '../types/jsx'
1996
2067
  `
1997
2068
  };
@@ -2012,12 +2083,12 @@ function setupJsx(ctx) {
2012
2083
  }
2013
2084
  function setupCssIndex(ctx) {
2014
2085
  const index = {
2015
- js: outdent28`
2086
+ js: outdent29`
2016
2087
  ${ctx.file.export("./css")}
2017
2088
  ${ctx.file.export("./cx")}
2018
2089
  ${ctx.file.export("./cva")}
2019
2090
  `,
2020
- dts: outdent28`
2091
+ dts: outdent29`
2021
2092
  export * from './css'
2022
2093
  export * from './cx'
2023
2094
  export * from './cva'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pandacss/generator",
3
- "version": "0.0.0-dev-20230212083454",
3
+ "version": "0.0.0-dev-20230212115356",
4
4
  "description": "The css generator for css panda",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -20,16 +20,16 @@
20
20
  "pluralize": "8.0.0",
21
21
  "postcss": "8.4.21",
22
22
  "ts-pattern": "4.1.4",
23
- "@pandacss/core": "0.0.0-dev-20230212083454",
24
- "@pandacss/logger": "0.0.0-dev-20230212083454",
25
- "@pandacss/is-valid-prop": "0.0.0-dev-20230212083454",
26
- "@pandacss/shared": "0.0.0-dev-20230212083454",
27
- "@pandacss/types": "0.0.0-dev-20230212083454",
28
- "@pandacss/token-dictionary": "0.0.0-dev-20230212083454"
23
+ "@pandacss/core": "0.0.0-dev-20230212115356",
24
+ "@pandacss/logger": "0.0.0-dev-20230212115356",
25
+ "@pandacss/is-valid-prop": "0.0.0-dev-20230212115356",
26
+ "@pandacss/shared": "0.0.0-dev-20230212115356",
27
+ "@pandacss/types": "0.0.0-dev-20230212115356",
28
+ "@pandacss/token-dictionary": "0.0.0-dev-20230212115356"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@types/pluralize": "0.0.29",
32
- "@pandacss/fixture": "0.0.0-dev-20230212083454"
32
+ "@pandacss/fixture": "0.0.0-dev-20230212115356"
33
33
  },
34
34
  "scripts": {
35
35
  "prebuild": "tsx scripts/prebuild.ts",