node $(bun ./pnpm-where.ts panda)node --cpu-prof $(bun ./pnpm-where.ts panda) | const path = require("path"); | |
| function fromEntries(iterable) { | |
| return [...iterable].reduce((obj, [key, val]) => { | |
| obj[key] = val; | |
| return obj; | |
| }, {}); | |
| } | |
| /** |
| import React, { useState } from "react"; | |
| import AnimateHeight from "react-animate-height"; | |
| export const Collapse = ({ children, minHeight = 0 }) => { | |
| const [height, setHeight] = useState<any>(minHeight); | |
| const isClosed = height === minHeight; | |
| const toggle = () => setHeight(isClosed ? "auto" : minHeight); | |
| return ( | |
| <div> |
| const getLineStart = (content, fromWord) => | |
| content.substring( | |
| content.lastIndexOf('\n', content.indexOf(fromWord)), | |
| content.indexOf(fromWord) | |
| ) |
| const wait = (duration, callback) => new Promise((resolve) => setTimeout(() => resolve(callback?.()), duration)) |
| const PascalCase = /from "(\.\/)*([A-Z])+([A-Za-z0-9]*)+";/; | |
| /* | |
| Find these, starting at "from" ending at ";" | |
| export * from "./Reader"; | |
| export * from "./AliasHandler"; | |
| export * from "./EntityGroupsMetadata"; | |
| export * from "./SuchNameShouldNotExist"; | |
| */ |
| import { NonUndefined } from 'pastable'; | |
| import { defineProperties } from '@vanilla-extract/sprinkles'; | |
| import tb from 'ts-toolbelt'; | |
| import { vtmnPreset } from './vtmn-preset'; | |
| const colors = mapTailwindColorsToTheme(vtmnPreset.theme.colors); | |
| export const colorStyles = defineProperties({ | |
| conditions: { | |
| lightMode: {}, |
node $(bun ./pnpm-where.ts panda)node --cpu-prof $(bun ./pnpm-where.ts panda) | import { PandaContext, loadConfigAndCreateContext } from '@pandacss/node' | |
| import { createCss } from '@pandacss/shared' | |
| import { isAbsolute, resolve } from 'path' | |
| import { PluginOption, ResolvedConfig, createFilter } from 'vite' | |
| import MagicString from 'magic-string' | |
| const ensureAbsolute = (path: string, root: string) => (path ? (isAbsolute(path) ? path : resolve(root, path)) : root) | |
| const pandaVite = (): PluginOption => { | |
| let config: ResolvedConfig | |
| let root: string |
| /** | |
| https://github.com/chakra-ui/chakra-ui/blob/768aea0f0eb55af9d2e13d7568d92b0b995a0699/packages/components/src/css-reset/css-reset.tsx | |
| */ | |
| const css = String.raw; | |
| const vhPolyfill = css` | |
| :root, | |
| :host { | |
| --chakra-vh: 100vh; |
| // port of https://github.com/chakra-ui/panda/blob/f58f6df22d7cfc0163296bc86a811da64e74977a/sandbox/vite-ts/remove-unused-css-vars.ts | |
| // with lightningcss | |
| // doesn't seem much faster, probably because of the `Stylesheet` visitor | |
| // `transform` is lightningcss fn | |
| /* | |
| // using this lightningcss plugin | |
| ❯ pnpm panda cssgen --lightningcss -o oui.css | |
| traverse: 3.357ms | |
| transform: 18.327ms |