@stacksjs/stx 0.2.194 → 0.2.196
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/chunk-0ae6chzd.js +4 -0
- package/dist/chunk-0w0mrtme.js +2 -0
- package/dist/chunk-0y46fbkx.js +3 -0
- package/dist/chunk-118a77bs.js +4471 -0
- package/dist/chunk-12nvcvtn.js +3 -0
- package/dist/chunk-14ynv5ah.js +2 -0
- package/dist/chunk-1e25ksp6.js +3 -0
- package/dist/chunk-1mhc4g86.js +43 -0
- package/dist/chunk-1thssz8x.js +2 -0
- package/dist/chunk-1yk07x7b.js +2 -0
- package/dist/chunk-2zkj69dg.js +13 -0
- package/dist/chunk-338316c2.js +2 -0
- package/dist/chunk-3952ykhb.js +1655 -0
- package/dist/chunk-3es366z4.js +3 -0
- package/dist/chunk-3m49eb4v.js +2 -0
- package/dist/chunk-3nmpfsw5.js +2 -0
- package/dist/chunk-3vy1q9da.js +2 -0
- package/dist/chunk-4a4h28pp.js +3022 -0
- package/dist/chunk-4pf61rcb.js +2 -0
- package/dist/chunk-5anpcnde.js +2 -0
- package/dist/chunk-5mkkre22.js +505 -0
- package/dist/chunk-5n0dt838.js +2 -0
- package/dist/chunk-5s2y052b.js +2 -0
- package/dist/chunk-5v64c8tr.js +2 -0
- package/dist/chunk-5xd7vge2.js +2 -0
- package/dist/chunk-6bxcjdp4.js +2 -0
- package/dist/chunk-6msvxnbr.js +2 -0
- package/dist/chunk-7kger0se.js +1280 -0
- package/dist/chunk-7ry55nms.js +3 -0
- package/dist/chunk-7s0wfa4e.js +24 -0
- package/dist/chunk-7w4c5w2b.js +2 -0
- package/dist/chunk-8src5smc.js +15 -0
- package/dist/chunk-937effkz.js +2 -0
- package/dist/chunk-9b82d4g5.js +3 -0
- package/dist/chunk-9xh78snm.js +3 -0
- package/dist/chunk-a2899x2t.js +2 -0
- package/dist/chunk-abpw3b39.js +2 -0
- package/dist/chunk-avwj12at.js +194 -0
- package/dist/chunk-b6jhznkh.js +71 -0
- package/dist/chunk-bpa2jeyw.js +3 -0
- package/dist/chunk-cbc56wpd.js +3 -0
- package/dist/chunk-dhpy0h9y.js +2 -0
- package/dist/chunk-dtmwr674.js +302 -0
- package/dist/chunk-dxfcyj8t.js +2 -0
- package/dist/chunk-e0460y7f.js +29 -0
- package/dist/chunk-ede7zpjf.js +2 -0
- package/dist/chunk-ehfzp7xe.js +2 -0
- package/dist/chunk-fd77g6t6.js +2 -0
- package/dist/chunk-fnkxbnka.js +30 -0
- package/dist/chunk-fvjh7rx0.js +84 -0
- package/dist/chunk-g19skgmw.js +18 -0
- package/dist/chunk-gcnrdgrq.js +3 -0
- package/dist/chunk-h2wpnxrh.js +8 -0
- package/dist/chunk-hb83d0qc.js +2 -0
- package/dist/chunk-hncp9gz6.js +8 -0
- package/dist/chunk-ht51fz7w.js +4 -0
- package/dist/chunk-hyrjade7.js +321 -0
- package/dist/chunk-hyyzp99b.js +2 -0
- package/dist/chunk-jpbk42j7.js +2 -0
- package/dist/chunk-jr5tp4ks.js +2 -0
- package/dist/chunk-k03b9z9e.js +898 -0
- package/dist/chunk-kjr22neh.js +3 -0
- package/dist/chunk-mjt5e2jy.js +2 -0
- package/dist/chunk-mkm91b6w.js +2 -0
- package/dist/chunk-mtr2f82n.js +2 -0
- package/dist/chunk-n8zpm7xb.js +397 -0
- package/dist/chunk-ndnc7k2n.js +22 -0
- package/dist/chunk-nenge2m2.js +2 -0
- package/dist/chunk-nngpktr2.js +2 -0
- package/dist/chunk-nsjyn31z.js +2 -0
- package/dist/chunk-nye9brje.js +147 -0
- package/dist/chunk-p5kp35dy.js +2 -0
- package/dist/chunk-pw0rzgpv.js +3 -0
- package/dist/chunk-q020t182.js +2 -0
- package/dist/chunk-q4gp9egt.js +4 -0
- package/dist/chunk-q8szpd6w.js +3 -0
- package/dist/chunk-q9n5swx7.js +3 -0
- package/dist/chunk-qpcwahse.js +2 -0
- package/dist/chunk-qz75kx6n.js +231 -0
- package/dist/chunk-r41nsgym.js +116 -0
- package/dist/chunk-r4qnvxhv.js +18 -0
- package/dist/chunk-r6p4ws0a.js +3809 -0
- package/dist/chunk-rdf7d42n.js +2 -0
- package/dist/chunk-rs2fa3g1.js +2 -0
- package/dist/chunk-ryjpp51z.js +499 -0
- package/dist/chunk-s018d32j.js +30 -0
- package/dist/chunk-spn8e3b3.js +2 -0
- package/dist/chunk-sry9atvv.js +2 -0
- package/dist/chunk-st5qggks.js +3 -0
- package/dist/chunk-tywvd1zc.js +11 -0
- package/dist/chunk-v3ryxw4v.js +2 -0
- package/dist/chunk-va9k88da.js +2 -0
- package/dist/chunk-vgk5v31k.js +216 -0
- package/dist/chunk-vj320kyr.js +2 -0
- package/dist/chunk-vr3qtsj4.js +2 -0
- package/dist/chunk-w0ng9e1m.js +341 -0
- package/dist/chunk-w29sv5jf.js +2 -0
- package/dist/chunk-whq99ytc.js +7987 -0
- package/dist/chunk-wnaddtv3.js +288 -0
- package/dist/chunk-wtengj6h.js +2 -0
- package/dist/chunk-x0ks1fer.js +1194 -0
- package/dist/chunk-x0zh76yv.js +4 -0
- package/dist/chunk-x13f5bbe.js +358 -0
- package/dist/chunk-xfp10a23.js +2 -0
- package/dist/chunk-xp3fp266.js +11 -0
- package/dist/chunk-xz019t7t.js +2 -0
- package/dist/chunk-y35rktea.js +12 -0
- package/dist/chunk-y4hkqsgw.js +4 -0
- package/dist/chunk-yab6d6kb.js +28 -0
- package/dist/chunk-yckd6ks5.js +3 -0
- package/dist/chunk-ycn1vnv2.js +5 -0
- package/dist/chunk-yf3bmmkk.js +8 -0
- package/dist/chunk-ygr11tgz.js +3 -0
- package/dist/chunk-ymccpdg6.js +351 -0
- package/dist/chunk-yr2wc2pa.js +3 -0
- package/dist/chunk-yv340gxj.js +2 -0
- package/dist/chunk-z2sp0k8d.js +3 -0
- package/dist/chunk-z5cm0bwn.js +11 -0
- package/dist/chunk-zda3hvde.js +14 -0
- package/dist/chunk-zgvga8rc.js +5 -0
- package/dist/chunk-zqbw8zqq.js +3 -0
- package/dist/cli.js +108 -27481
- package/dist/craft-entry.js +9 -5
- package/dist/craft.js +7 -18503
- package/dist/database.js +2 -2
- package/dist/pwa.js +8 -16603
- package/dist/ssg.js +52 -15512
- package/dist/variable-extractor.js +12 -2
- package/dist/visual-testing.js +1 -1
- package/package.json +5 -5
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{fi as a,gi as b,hi as c,ii as d,ji as e,ki as f,li as g}from"./chunk-vgk5v31k.js";import"./chunk-pw0rzgpv.js";export{d as useVirtualList,b as processVirtualListDirectives,f as processVirtualGridDirectives,e as processInfiniteListDirectives,c as generateVirtualListCSS,g as default,a as createVirtualList};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{xg as a}from"./chunk-q4gp9egt.js";import"./chunk-ndnc7k2n.js";import"./chunk-s018d32j.js";import"./chunk-whq99ytc.js";import"./chunk-3es366z4.js";import"./chunk-yckd6ks5.js";import"./chunk-r6p4ws0a.js";import"./chunk-8src5smc.js";import"./chunk-gcnrdgrq.js";import"./chunk-xp3fp266.js";import"./chunk-nye9brje.js";import"./chunk-tywvd1zc.js";import"./chunk-cbc56wpd.js";import"./chunk-x0zh76yv.js";import"./chunk-0ae6chzd.js";import"./chunk-kjr22neh.js";import"./chunk-3952ykhb.js";import"./chunk-dtmwr674.js";import"./chunk-pw0rzgpv.js";export{a as buildForProduction};
|
|
@@ -0,0 +1,505 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{hu as Y}from"./chunk-pw0rzgpv.js";import{mkdir as O,writeFile as q}from"fs/promises";import{join as X}from"path";var T="https://api.iconify.design";async function k(){let E=await fetch(`${T}/collections`);if(!E.ok)throw Error(`Failed to fetch collections: ${E.statusText}`);return await E.json()}async function P(E,z){try{let U=Y.resolve("@iconify/json"),S=`${`${U.substring(0,U.lastIndexOf("/node_modules/@iconify/json/"))}/node_modules/@iconify/json`}/json/${E}.json`,M=Bun.file(S);if(await M.exists()){let V=await M.json();if(z&&z.length>0){let Z={};for(let L of z)if(V.icons[L])Z[L]=V.icons[L];return{...V,icons:Z}}return V}}catch{}let K=z&&z.length>0?`${T}/${E}.json?icons=${z.join(",")}`:`${T}/${E}.json`,Q=await fetch(K);if(!Q.ok)throw Error(`Failed to fetch icons for ${E}: ${Q.statusText}`);return await Q.json()}function j(E,z=24,K=24){return{body:E.body,width:E.width||z,height:E.height||K,viewBox:`0 0 ${E.width||z} ${E.height||K}`}}function F(E,z){let K=B(E);return`import type { IconData } from '@stacksjs/iconify-core'
|
|
3
|
+
|
|
4
|
+
export const ${K}: IconData = ${JSON.stringify(z,null,2)}
|
|
5
|
+
|
|
6
|
+
export default ${K}
|
|
7
|
+
`}function h(E,z){return`<script>
|
|
8
|
+
// Get props with defaults (handle undefined)
|
|
9
|
+
const iconWidth = (typeof width !== 'undefined' ? width : null) || (typeof size !== 'undefined' ? size : null) || ${z.width||24}
|
|
10
|
+
const iconHeight = (typeof height !== 'undefined' ? height : null) || (typeof size !== 'undefined' ? size : null) || ${z.height||24}
|
|
11
|
+
const iconColor = typeof color !== 'undefined' ? color : 'currentColor'
|
|
12
|
+
const viewBox = "${z.viewBox||`0 0 ${z.width||24} ${z.height||24}`}"
|
|
13
|
+
|
|
14
|
+
// Build transform
|
|
15
|
+
const transforms = []
|
|
16
|
+
if (typeof hFlip !== 'undefined' && hFlip) transforms.push('scaleX(-1)')
|
|
17
|
+
if (typeof vFlip !== 'undefined' && vFlip) transforms.push('scaleY(-1)')
|
|
18
|
+
if (typeof rotate !== 'undefined' && rotate) {
|
|
19
|
+
const rotateNum = typeof rotate === 'string' ? parseInt(rotate, 10) : rotate
|
|
20
|
+
const deg = typeof rotateNum === 'number' && rotateNum < 4 ? rotateNum * 90 : rotateNum
|
|
21
|
+
transforms.push(\`rotate(\${deg}deg)\`)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const transform = transforms.length > 0 ? transforms.join(' ') : ''
|
|
25
|
+
const transformStyle = transform ? \`transform: \${transform};\` : ''
|
|
26
|
+
|
|
27
|
+
// Build style
|
|
28
|
+
const styles = []
|
|
29
|
+
if (transformStyle) styles.push(transformStyle)
|
|
30
|
+
if (typeof style !== 'undefined' && style) styles.push(style)
|
|
31
|
+
|
|
32
|
+
const styleAttr = styles.length > 0 ? \` style="\${styles.join(' ')}"\` : ''
|
|
33
|
+
const classAttr = typeof className !== 'undefined' && className ? \` class="\${className}"\` : ''
|
|
34
|
+
|
|
35
|
+
// Icon body
|
|
36
|
+
let body = ${JSON.stringify(z.body)}
|
|
37
|
+
if (iconColor && iconColor !== 'currentColor') {
|
|
38
|
+
body = body.replace(/currentColor/g, iconColor)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Generate SVG
|
|
42
|
+
const svg = \`<svg xmlns="http://www.w3.org/2000/svg" width="\${iconWidth}" height="\${iconHeight}" viewBox="\${viewBox}"\${classAttr}\${styleAttr}>\${body}</svg>\`
|
|
43
|
+
</script>
|
|
44
|
+
|
|
45
|
+
{!! svg !!}
|
|
46
|
+
`}function g(E){let z=new Set;return`// Icon data exports
|
|
47
|
+
${E.map((Q)=>{let G=B(Q);if(z.has(G)){let S=Q.replace(/[^a-zA-Z0-9]/g,"_");if(/^[0-9]/.test(S))S=`_${S}`;G=S;let M=2;while(z.has(G))G=`${S}_${M}`,M++}return z.add(G),`export { default as ${G} } from './${Q}.js'`}).join(`
|
|
48
|
+
`)}
|
|
49
|
+
|
|
50
|
+
export * from './types.js'
|
|
51
|
+
`}function u(E){return`import type { IconData, IconProps } from '@stacksjs/iconify-core'
|
|
52
|
+
|
|
53
|
+
export type { IconData, IconProps }
|
|
54
|
+
|
|
55
|
+
export type ${I(E)}Icon = IconData
|
|
56
|
+
`}function N(E,z,K){let Q={name:`@stacksjs/iconify-${E}`,type:"module",version:"0.0.1",description:`${z.name} icons for stx from Iconify`,author:z.author?.name||"Iconify",license:z.license?.spdx||"MIT",repository:{type:"git",url:"https://github.com/stacksjs/stx.git",directory:`packages/iconify-${E}`},keywords:["iconify","icons","svg",E,z.name,"stx"],sideEffects:!1,exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js"},"./*":"./dist/*"},main:"./dist/index.js",module:"./dist/index.js",types:"./dist/index.d.ts",files:["dist"],scripts:{build:"bun build.ts",prepublishOnly:"bun build.ts"},dependencies:{"@stacksjs/iconify-core":"workspace:*"}};return JSON.stringify(Q,null,2)}function D(E){return`import { existsSync, readdirSync, statSync } from 'node:fs'
|
|
57
|
+
import { dirname, join } from 'node:path'
|
|
58
|
+
import { fileURLToPath } from 'node:url'
|
|
59
|
+
import dts from 'bun-plugin-dtsx'
|
|
60
|
+
|
|
61
|
+
const __dirname = dirname(fileURLToPath(import.meta.url))
|
|
62
|
+
const srcDir = join(__dirname, 'src')
|
|
63
|
+
const distDir = join(__dirname, 'dist')
|
|
64
|
+
const distEntry = join(distDir, 'index.js')
|
|
65
|
+
|
|
66
|
+
// Skip rebuild when dist is already up to date. Makes prepublishOnly a
|
|
67
|
+
// no-op when CI pre-built the package in parallel earlier in the
|
|
68
|
+
// pipeline \u2014 and a no-op for local re-runs that didn't touch src/.
|
|
69
|
+
//
|
|
70
|
+
// Walks src/ recursively so changes inside subdirectories (if we ever
|
|
71
|
+
// add them) properly invalidate the cached dist.
|
|
72
|
+
function isDistFresh() {
|
|
73
|
+
if (!existsSync(distEntry)) return false
|
|
74
|
+
const distMtime = statSync(distEntry).mtimeMs
|
|
75
|
+
function newer(dir) {
|
|
76
|
+
for (const name of readdirSync(dir)) {
|
|
77
|
+
const p = join(dir, name)
|
|
78
|
+
const s = statSync(p)
|
|
79
|
+
if (s.isDirectory()) {
|
|
80
|
+
if (newer(p)) return true
|
|
81
|
+
} else if (s.mtimeMs > distMtime) {
|
|
82
|
+
return true
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return false
|
|
86
|
+
}
|
|
87
|
+
return !newer(srcDir)
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
if (isDistFresh()) {
|
|
91
|
+
console.log('\u2713 @stacksjs/iconify-${E} dist is fresh, skipping rebuild')
|
|
92
|
+
} else {
|
|
93
|
+
await Bun.build({
|
|
94
|
+
entrypoints: [join(srcDir, 'index.ts')],
|
|
95
|
+
outdir: distDir,
|
|
96
|
+
target: 'bun',
|
|
97
|
+
format: 'esm',
|
|
98
|
+
plugins: [dts()],
|
|
99
|
+
minify: false,
|
|
100
|
+
sourcemap: 'external',
|
|
101
|
+
splitting: true,
|
|
102
|
+
})
|
|
103
|
+
console.log('\u2713 Built @stacksjs/iconify-${E}')
|
|
104
|
+
}
|
|
105
|
+
`}function d(E,z,K){return`# @stacksjs/iconify-${E}
|
|
106
|
+
|
|
107
|
+
${z.name} icons for stx from Iconify.
|
|
108
|
+
|
|
109
|
+
## Installation
|
|
110
|
+
|
|
111
|
+
\`\`\`bash
|
|
112
|
+
bun add @stacksjs/iconify-${E}
|
|
113
|
+
\`\`\`
|
|
114
|
+
|
|
115
|
+
## Usage
|
|
116
|
+
|
|
117
|
+
### In stx templates
|
|
118
|
+
|
|
119
|
+
\`\`\`html
|
|
120
|
+
<script>
|
|
121
|
+
import { home } from '@stacksjs/iconify-${E}'
|
|
122
|
+
import { renderIcon } from '@stacksjs/iconify-core'
|
|
123
|
+
|
|
124
|
+
export const homeIcon = renderIcon(home, { size: 24, color: 'currentColor' })
|
|
125
|
+
</script>
|
|
126
|
+
|
|
127
|
+
<div class="icon">
|
|
128
|
+
{!! homeIcon !!}
|
|
129
|
+
</div>
|
|
130
|
+
\`\`\`
|
|
131
|
+
|
|
132
|
+
### In TypeScript/JavaScript
|
|
133
|
+
|
|
134
|
+
\`\`\`typescript
|
|
135
|
+
import { home, account, settings } from '@stacksjs/iconify-${E}'
|
|
136
|
+
import { renderIcon } from '@stacksjs/iconify-core'
|
|
137
|
+
|
|
138
|
+
const svg = renderIcon(home, {
|
|
139
|
+
size: 24,
|
|
140
|
+
color: '#000000',
|
|
141
|
+
})
|
|
142
|
+
\`\`\`
|
|
143
|
+
|
|
144
|
+
## Available Icons
|
|
145
|
+
|
|
146
|
+
This package contains ${K} icons from ${z.name}.
|
|
147
|
+
|
|
148
|
+
## License
|
|
149
|
+
|
|
150
|
+
${z.license?.title||"MIT"}
|
|
151
|
+
|
|
152
|
+
${z.license?.url?`License: ${z.license.url}`:""}
|
|
153
|
+
|
|
154
|
+
## Credits
|
|
155
|
+
|
|
156
|
+
- Icons: ${z.author?.name||"Iconify"}${z.author?.url?` (${z.author.url})`:""}
|
|
157
|
+
- Iconify: https://iconify.design/
|
|
158
|
+
`}function C(E,z,K){let Q=K.length,U=K.slice(0,5).map(B),G=U.map((M)=>`${M.charAt(0).toUpperCase()}${M.slice(1)}Icon`),S=K.map((M)=>{return`- \`${B(M)}\``}).join(`
|
|
159
|
+
`);return`# ${z.name}
|
|
160
|
+
|
|
161
|
+
> ${z.name} icons for stx from Iconify
|
|
162
|
+
|
|
163
|
+
## Overview
|
|
164
|
+
|
|
165
|
+
This package provides access to ${Q} icons from the ${z.name} collection through the stx iconify integration.
|
|
166
|
+
|
|
167
|
+
**Collection ID:** \`${E}\`
|
|
168
|
+
**Total Icons:** ${Q}
|
|
169
|
+
${z.author?.name?`**Author:** ${z.author.name}${z.author.url?` ([Website](${z.author.url}))`:""}`:""}
|
|
170
|
+
${z.license?.title?`**License:** ${z.license.title}${z.license.url?` ([Details](${z.license.url}))`:""}`:""}
|
|
171
|
+
${z.category?`**Category:** ${z.category}`:""}
|
|
172
|
+
${z.palette!==void 0?`**Palette:** ${z.palette?"Yes (color icons)":"No (monotone icons)"}`:""}
|
|
173
|
+
|
|
174
|
+
## Installation
|
|
175
|
+
|
|
176
|
+
\`\`\`bash
|
|
177
|
+
bun add @stacksjs/iconify-${E}
|
|
178
|
+
\`\`\`
|
|
179
|
+
|
|
180
|
+
## Quick Start
|
|
181
|
+
|
|
182
|
+
### Component Usage (Recommended)
|
|
183
|
+
|
|
184
|
+
Icons are available as .stx components that can be used directly in templates:
|
|
185
|
+
|
|
186
|
+
\`\`\`html
|
|
187
|
+
<${G[0]||"Icon"} height="1em" />
|
|
188
|
+
<${G[0]||"Icon"} width="1em" height="1em" />
|
|
189
|
+
<${G[0]||"Icon"} height="24" />
|
|
190
|
+
\`\`\`
|
|
191
|
+
|
|
192
|
+
### With Properties
|
|
193
|
+
|
|
194
|
+
\`\`\`html
|
|
195
|
+
<!-- Using size property -->
|
|
196
|
+
<${G[0]||"Icon"} size="24" />
|
|
197
|
+
<${G[0]||"Icon"} size="1em" />
|
|
198
|
+
|
|
199
|
+
<!-- Using width and height -->
|
|
200
|
+
<${G[0]||"Icon"} width="24" height="32" />
|
|
201
|
+
|
|
202
|
+
<!-- With color -->
|
|
203
|
+
<${G[0]||"Icon"} size="24" color="red" />
|
|
204
|
+
<${G[0]||"Icon"} size="24" color="#4a90e2" />
|
|
205
|
+
|
|
206
|
+
<!-- With CSS class -->
|
|
207
|
+
<${G[0]||"Icon"} size="24" class="icon-primary" />
|
|
208
|
+
|
|
209
|
+
<!-- With all properties -->
|
|
210
|
+
<${G[0]||"Icon"}
|
|
211
|
+
size="32"
|
|
212
|
+
color="#4a90e2"
|
|
213
|
+
class="my-icon"
|
|
214
|
+
style="opacity: 0.8;"
|
|
215
|
+
/>
|
|
216
|
+
\`\`\`
|
|
217
|
+
|
|
218
|
+
### In stx Templates
|
|
219
|
+
|
|
220
|
+
\`\`\`html
|
|
221
|
+
<!DOCTYPE html>
|
|
222
|
+
<html>
|
|
223
|
+
<head>
|
|
224
|
+
<title>Icon Demo</title>
|
|
225
|
+
<style>
|
|
226
|
+
.icon-grid {
|
|
227
|
+
display: flex;
|
|
228
|
+
gap: 1rem;
|
|
229
|
+
align-items: center;
|
|
230
|
+
}
|
|
231
|
+
</style>
|
|
232
|
+
</head>
|
|
233
|
+
<body>
|
|
234
|
+
<div class="icon-grid">
|
|
235
|
+
<${G[0]||"Icon"} size="24" />
|
|
236
|
+
<${G[1]||"Icon"} size="24" color="#4a90e2" />
|
|
237
|
+
<${G[2]||"Icon"} size="32" class="my-icon" />
|
|
238
|
+
</div>
|
|
239
|
+
</body>
|
|
240
|
+
</html>
|
|
241
|
+
\`\`\`
|
|
242
|
+
|
|
243
|
+
### Data-Only Import
|
|
244
|
+
|
|
245
|
+
You can also import icon data and use the \`renderIcon\` function directly:
|
|
246
|
+
|
|
247
|
+
\`\`\`typescript
|
|
248
|
+
import { ${U.slice(0,3).join(", ")} } from '@stacksjs/iconify-${E}'
|
|
249
|
+
import { renderIcon } from '@stacksjs/iconify-core'
|
|
250
|
+
|
|
251
|
+
const svg = renderIcon(${U[0]||"icon"}, { size: 24 })
|
|
252
|
+
\`\`\`
|
|
253
|
+
|
|
254
|
+
## Icon Properties
|
|
255
|
+
|
|
256
|
+
All icon component functions and \`renderIcon\` accept the following properties:
|
|
257
|
+
|
|
258
|
+
| Property | Type | Default | Description |
|
|
259
|
+
|----------|------|---------|-------------|
|
|
260
|
+
| \`size\` | \`string \\| number\` | - | Icon size (sets both width and height) |
|
|
261
|
+
| \`width\` | \`string \\| number\` | - | Icon width (overrides size) |
|
|
262
|
+
| \`height\` | \`string \\| number\` | - | Icon height (overrides size) |
|
|
263
|
+
| \`color\` | \`string\` | \`'currentColor'\` | Icon color (CSS color or hex) |
|
|
264
|
+
| \`hFlip\` | \`boolean\` | \`false\` | Flip horizontally |
|
|
265
|
+
| \`vFlip\` | \`boolean\` | \`false\` | Flip vertically |
|
|
266
|
+
| \`rotate\` | \`0 \\| 90 \\| 180 \\| 270\` | \`0\` | Rotation in degrees |
|
|
267
|
+
| \`class\` | \`string\` | - | Additional CSS classes |
|
|
268
|
+
| \`style\` | \`string\` | - | Inline styles |
|
|
269
|
+
|
|
270
|
+
## Color
|
|
271
|
+
|
|
272
|
+
${z.palette?`### Color Icons
|
|
273
|
+
|
|
274
|
+
This collection contains color icons. While you can still set a color property, it may override the original colors.`:"### Monotone Icons\n\nMonotone icons use `currentColor` by default, allowing you to change icon color via the `color` property or CSS:"}
|
|
275
|
+
|
|
276
|
+
\`\`\`html
|
|
277
|
+
<!-- Via color property -->
|
|
278
|
+
<${G[0]||"Icon"} size="24" color="red" />
|
|
279
|
+
<${G[0]||"Icon"} size="24" color="#4a90e2" />
|
|
280
|
+
|
|
281
|
+
<!-- Via inline style -->
|
|
282
|
+
<${G[0]||"Icon"} size="24" style="color: green;" />
|
|
283
|
+
|
|
284
|
+
<!-- Via CSS class -->
|
|
285
|
+
<${G[0]||"Icon"} size="24" class="text-primary" />
|
|
286
|
+
\`\`\`
|
|
287
|
+
|
|
288
|
+
${!z.palette?`\`\`\`css
|
|
289
|
+
/* In your CSS */
|
|
290
|
+
.text-primary {
|
|
291
|
+
color: #4a90e2;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
.icon:hover {
|
|
295
|
+
color: #357abd;
|
|
296
|
+
}
|
|
297
|
+
\`\`\``:""}
|
|
298
|
+
|
|
299
|
+
## Size
|
|
300
|
+
|
|
301
|
+
Unlike other components, SVG + CSS components do not set icon size by default. This has advantages and disadvantages.
|
|
302
|
+
|
|
303
|
+
**Disadvantages:**
|
|
304
|
+
- You need to set size yourself.
|
|
305
|
+
|
|
306
|
+
**Advantages:**
|
|
307
|
+
- You have full control over icon size.
|
|
308
|
+
|
|
309
|
+
You can change icon size by:
|
|
310
|
+
- Setting \`width\` and \`height\` properties
|
|
311
|
+
- Using CSS
|
|
312
|
+
|
|
313
|
+
### Properties
|
|
314
|
+
|
|
315
|
+
All icon components support \`width\` and \`height\` properties.
|
|
316
|
+
|
|
317
|
+
Value is a string or number.
|
|
318
|
+
|
|
319
|
+
You do not need to set both properties. If you set one property, the other property will automatically be calculated from the icon's width/height ratio.
|
|
320
|
+
|
|
321
|
+
**Examples:**
|
|
322
|
+
|
|
323
|
+
\`\`\`html
|
|
324
|
+
<${G[0]||"DraftsIcon"} height="1em" />
|
|
325
|
+
<${G[0]||"DraftsIcon"} width="1em" height="1em" />
|
|
326
|
+
<${G[0]||"DraftsIcon"} height="24" />
|
|
327
|
+
\`\`\`
|
|
328
|
+
|
|
329
|
+
You can also use the \`size\` property as a shorthand for setting both width and height:
|
|
330
|
+
|
|
331
|
+
\`\`\`html
|
|
332
|
+
<${G[0]||"DraftsIcon"} size="24" />
|
|
333
|
+
<${G[0]||"DraftsIcon"} size="1em" />
|
|
334
|
+
\`\`\`
|
|
335
|
+
|
|
336
|
+
### CSS Sizing
|
|
337
|
+
|
|
338
|
+
You can also control icon size via CSS:
|
|
339
|
+
|
|
340
|
+
\`\`\`css
|
|
341
|
+
.${B(E)}-icon {
|
|
342
|
+
width: 1em;
|
|
343
|
+
height: 1em;
|
|
344
|
+
}
|
|
345
|
+
\`\`\`
|
|
346
|
+
|
|
347
|
+
\`\`\`html
|
|
348
|
+
<${G[0]||"DraftsIcon"} class="${B(E)}-icon" />
|
|
349
|
+
\`\`\`
|
|
350
|
+
|
|
351
|
+
## Available Icons
|
|
352
|
+
|
|
353
|
+
This package contains **${Q}** icons:
|
|
354
|
+
|
|
355
|
+
${S}
|
|
356
|
+
|
|
357
|
+
## Usage Examples
|
|
358
|
+
|
|
359
|
+
### Navigation Menu
|
|
360
|
+
|
|
361
|
+
\`\`\`html
|
|
362
|
+
<nav>
|
|
363
|
+
<a href="/"><${G[0]||"Icon"} size="20" class="nav-icon" /> Home</a>
|
|
364
|
+
<a href="/about"><${G[1]||"Icon"} size="20" class="nav-icon" /> About</a>
|
|
365
|
+
<a href="/contact"><${G[2]||"Icon"} size="20" class="nav-icon" /> Contact</a>
|
|
366
|
+
<a href="/settings"><${G[3]||"Icon"} size="20" class="nav-icon" /> Settings</a>
|
|
367
|
+
</nav>
|
|
368
|
+
|
|
369
|
+
<style>
|
|
370
|
+
nav {
|
|
371
|
+
display: flex;
|
|
372
|
+
gap: 1rem;
|
|
373
|
+
}
|
|
374
|
+
nav a {
|
|
375
|
+
display: flex;
|
|
376
|
+
align-items: center;
|
|
377
|
+
gap: 0.5rem;
|
|
378
|
+
}
|
|
379
|
+
.nav-icon {
|
|
380
|
+
color: currentColor;
|
|
381
|
+
}
|
|
382
|
+
</style>
|
|
383
|
+
\`\`\`
|
|
384
|
+
|
|
385
|
+
### Custom Styling
|
|
386
|
+
|
|
387
|
+
\`\`\`html
|
|
388
|
+
<${G[0]||"Icon"}
|
|
389
|
+
size="24"
|
|
390
|
+
class="icon icon-primary"
|
|
391
|
+
style="opacity: 0.8; transition: opacity 0.2s;"
|
|
392
|
+
/>
|
|
393
|
+
|
|
394
|
+
<style>
|
|
395
|
+
.icon-primary {
|
|
396
|
+
color: #4a90e2;
|
|
397
|
+
}
|
|
398
|
+
.icon-primary:hover {
|
|
399
|
+
opacity: 1;
|
|
400
|
+
}
|
|
401
|
+
</style>
|
|
402
|
+
\`\`\`
|
|
403
|
+
|
|
404
|
+
### Status Indicators
|
|
405
|
+
|
|
406
|
+
\`\`\`html
|
|
407
|
+
<div class="status-grid">
|
|
408
|
+
<div class="status-item">
|
|
409
|
+
<${G[0]||"Icon"} size="16" color="#22c55e" />
|
|
410
|
+
<span>Success</span>
|
|
411
|
+
</div>
|
|
412
|
+
<div class="status-item">
|
|
413
|
+
<${G[1]||"Icon"} size="16" color="#f59e0b" />
|
|
414
|
+
<span>Warning</span>
|
|
415
|
+
</div>
|
|
416
|
+
<div class="status-item">
|
|
417
|
+
<${G[2]||"Icon"} size="16" color="#ef4444" />
|
|
418
|
+
<span>Error</span>
|
|
419
|
+
</div>
|
|
420
|
+
</div>
|
|
421
|
+
\`\`\`
|
|
422
|
+
|
|
423
|
+
## Best Practices
|
|
424
|
+
|
|
425
|
+
1. **Use Components Directly**: Import and use icon components in your templates
|
|
426
|
+
\`\`\`html
|
|
427
|
+
<!-- Recommended -->
|
|
428
|
+
<${G[0]||"Icon"} size="24" />
|
|
429
|
+
<${G[1]||"Icon"} size="24" color="#4a90e2" />
|
|
430
|
+
\`\`\`
|
|
431
|
+
|
|
432
|
+
2. **Use CSS for Theming**: Apply consistent styling through CSS classes
|
|
433
|
+
\`\`\`css
|
|
434
|
+
.icon {
|
|
435
|
+
color: currentColor;
|
|
436
|
+
opacity: 0.8;
|
|
437
|
+
transition: opacity 0.2s;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
.icon:hover {
|
|
441
|
+
opacity: 1;
|
|
442
|
+
}
|
|
443
|
+
\`\`\`
|
|
444
|
+
|
|
445
|
+
\`\`\`html
|
|
446
|
+
<${G[0]||"Icon"} size="24" class="icon" />
|
|
447
|
+
\`\`\`
|
|
448
|
+
|
|
449
|
+
3. **Set Appropriate Sizes**: Use \`1em\` for inline icons, fixed pixel sizes for standalone icons
|
|
450
|
+
\`\`\`html
|
|
451
|
+
<!-- Inline with text -->
|
|
452
|
+
<p>Click the <${G[0]||"Icon"} height="1em" /> icon to continue</p>
|
|
453
|
+
|
|
454
|
+
<!-- Standalone -->
|
|
455
|
+
<${G[0]||"Icon"} size="24" />
|
|
456
|
+
\`\`\`
|
|
457
|
+
|
|
458
|
+
4. **Use Data Import for Advanced Use Cases**: When you need more control
|
|
459
|
+
\`\`\`html
|
|
460
|
+
@js
|
|
461
|
+
import { ${U[0]||"icon"} } from '@stacksjs/iconify-${E}'
|
|
462
|
+
import { renderIcon } from '@stacksjs/iconify-core'
|
|
463
|
+
global.customIcon = renderIcon(${U[0]||"icon"}, { size: 24 })
|
|
464
|
+
@endjs
|
|
465
|
+
|
|
466
|
+
{!! customIcon !!}
|
|
467
|
+
\`\`\`
|
|
468
|
+
|
|
469
|
+
## TypeScript Support
|
|
470
|
+
|
|
471
|
+
This package includes full TypeScript support with type definitions for all icons.
|
|
472
|
+
|
|
473
|
+
\`\`\`typescript
|
|
474
|
+
import type { IconData } from '@stacksjs/iconify-core'
|
|
475
|
+
import { ${U[0]||"icon"} } from '@stacksjs/iconify-${E}'
|
|
476
|
+
|
|
477
|
+
// Icons are typed as IconData
|
|
478
|
+
const myIcon: IconData = ${U[0]||"icon"}
|
|
479
|
+
\`\`\`
|
|
480
|
+
|
|
481
|
+
## Related Packages
|
|
482
|
+
|
|
483
|
+
- [\`@stacksjs/iconify-core\`](../iconify#installation) - Core rendering functions and utilities
|
|
484
|
+
- [Iconify Integration Guide](../iconify) - Complete guide to using Iconify with stx
|
|
485
|
+
- [stx Documentation](../) - Main stx documentation
|
|
486
|
+
|
|
487
|
+
## License
|
|
488
|
+
|
|
489
|
+
${z.license?.title||"MIT"}
|
|
490
|
+
|
|
491
|
+
${z.license?.url?`See [license details](${z.license.url}) for more information.`:""}
|
|
492
|
+
|
|
493
|
+
## Credits
|
|
494
|
+
|
|
495
|
+
- **Icons**: ${z.author?.name||"Iconify"}${z.author?.url?` ([Website](${z.author.url}))`:""}
|
|
496
|
+
- **Iconify**: [https://iconify.design/](https://iconify.design/)
|
|
497
|
+
- **Icon Set**: [View on Iconify](https://icon-sets.iconify.design/${E}/)
|
|
498
|
+
|
|
499
|
+
## Resources
|
|
500
|
+
|
|
501
|
+
- [Browse all icons in this collection](https://icon-sets.iconify.design/${E}/)
|
|
502
|
+
- [Iconify documentation](https://iconify.design/docs/)
|
|
503
|
+
- [stx iconify integration guide](../../docs/iconify.md)
|
|
504
|
+
`}async function s(E,z,K,Q){console.log(`
|
|
505
|
+
\uD83D\uDCE6 Generating package for ${E}...`);let G=(await k())[E];if(!G)throw Error(`Collection ${E} not found`);console.log(` Collection: ${G.name}`),console.log(` Total icons: ${G.total}`);let S=await P(E,K),M=Object.keys(S.icons);console.log(` Generating ${M.length} icons...`);let V=X(z,`iconify-${E}`),Z=X(V,"src");await O(Z,{recursive:!0});let L=S.width||24,b=S.height||24;for(let $ of M){let R=S.icons[$],A=j(R,L,b),_=F($,A);await q(X(Z,`${$}.ts`),_);let w=h($,A);await q(X(Z,`${$}-icon.stx`),w)}let v=g(M);await q(X(Z,"index.ts"),v);let y=u(E);await q(X(Z,"types.ts"),y);let H=N(E,G,M.length);await q(X(V,"package.json"),H);let J=D(E);await q(X(V,"build.ts"),J);let W=d(E,G,M.length);if(await q(X(V,"README.md"),W),Q){let $=X(Q,`iconify-${E}.md`),R=C(E,G,M);await O(Q,{recursive:!0}),await q($,R),console.log(` \u2713 Generated documentation in ${$}`)}console.log(` \u2713 Generated ${M.length} icons in ${V}`)}function B(E){let z=E.replace(/-([a-z0-9])/g,(K)=>K[1].toUpperCase());if(z=z.replace(/[^a-zA-Z0-9_$]/g,"_"),/^[0-9]/.test(z))z=`_${z}`;return z}function I(E){let z=B(E);return z.charAt(0).toUpperCase()+z.slice(1)}export{I as toPascalCase,B as toCamelCase,u as generateTypesFile,d as generateReadme,N as generatePackageJson,s as generatePackage,g as generateIndexFile,F as generateIconData,h as generateIconComponent,C as generateDocumentation,D as generateBuildFile,k as fetchCollections,P as fetchCollectionIcons,j as convertIconData};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{lh as a,mh as b,nh as c,oh as d,ph as e,qh as f,rh as g,sh as h,th as i}from"./chunk-mkm91b6w.js";import"./chunk-q8szpd6w.js";import"./chunk-pw0rzgpv.js";export{c as setCachedImageResult,e as processImage,f as optimizeImage,b as getCachedImageResult,i as generateSrcset,h as generateResponsiveVariants,d as clearImageCache,g as applyTransformations,a as ImageProcessorCache};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Bi as a,Ci as b,Di as c,Ei as d,Fi as e,Gi as f,Hi as g,Ii as h}from"./chunk-y4hkqsgw.js";import"./chunk-3es366z4.js";import"./chunk-pw0rzgpv.js";export{d as v,a as useForm,g as processHasErrorsDirective,h as processFormValidationDirectives,f as processErrorsDirective,e as processErrorDirective,b as defineForm,c as Validator};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{rf as a}from"./chunk-yr2wc2pa.js";import"./chunk-s018d32j.js";import"./chunk-r6p4ws0a.js";import"./chunk-8src5smc.js";import"./chunk-gcnrdgrq.js";import"./chunk-xp3fp266.js";import"./chunk-nye9brje.js";import"./chunk-tywvd1zc.js";import"./chunk-cbc56wpd.js";import"./chunk-x0zh76yv.js";import"./chunk-0ae6chzd.js";import"./chunk-kjr22neh.js";import"./chunk-3952ykhb.js";import"./chunk-dtmwr674.js";import"./chunk-pw0rzgpv.js";export{a as startProductionServer};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Ji as a,Ki as b,Li as c,Mi as d,Ni as e,Oi as f,Pi as g,Qi as h,Ri as i,Si as j,Ti as k}from"./chunk-bpa2jeyw.js";import"./chunk-r6p4ws0a.js";import"./chunk-8src5smc.js";import"./chunk-gcnrdgrq.js";import"./chunk-xp3fp266.js";import"./chunk-nye9brje.js";import"./chunk-tywvd1zc.js";import"./chunk-cbc56wpd.js";import"./chunk-x0zh76yv.js";import"./chunk-0ae6chzd.js";import"./chunk-kjr22neh.js";import"./chunk-3952ykhb.js";import"./chunk-dtmwr674.js";import"./chunk-pw0rzgpv.js";export{a as templateCache,b as readFileCached,d as invalidateFileCacheByDir,c as invalidateFileCache,k as hashFilePath,f as getCachedSignalsRuntime,g as getCachedRouterScript,h as clearDevCaches,i as checkCache,j as cacheTemplate,e as __setSignalsGeneratorsForTest};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{So as a,To as b}from"./chunk-r6p4ws0a.js";import"./chunk-8src5smc.js";import"./chunk-gcnrdgrq.js";import"./chunk-xp3fp266.js";import"./chunk-nye9brje.js";import"./chunk-tywvd1zc.js";import"./chunk-cbc56wpd.js";import"./chunk-x0zh76yv.js";import"./chunk-0ae6chzd.js";import"./chunk-kjr22neh.js";import"./chunk-3952ykhb.js";import"./chunk-dtmwr674.js";import"./chunk-pw0rzgpv.js";export{b as processLoops,a as parseLoopBinding};
|