diff --git a/.github/workflows/bundle-size.yml b/.github/workflows/bundle-size.yml index 0a55701..2c21ac0 100644 --- a/.github/workflows/bundle-size.yml +++ b/.github/workflows/bundle-size.yml @@ -20,7 +20,7 @@ on: jobs: check-bundle-size: - name: Verify Bundle Size <5KB + name: Verify Bundle Size <6KB runs-on: ubuntu-latest steps: @@ -63,25 +63,26 @@ jobs: UMD_KB=$(echo "scale=2; $UMD_SIZE / 1024" | bc) CJS_KB=$(echo "scale=2; $CJS_SIZE / 1024" | bc) - TARGET="5.00 KB" + TARGET="6.00 KB" ESM_STATUS="✅" UMD_STATUS="✅" CJS_STATUS="✅" - if (( $(echo "$ESM_KB >= 5.0" | bc -l) )); then ESM_STATUS="❌"; fi - if (( $(echo "$UMD_KB >= 5.0" | bc -l) )); then UMD_STATUS="❌"; fi - if (( $(echo "$CJS_KB >= 5.0" | bc -l) )); then CJS_STATUS="❌"; fi + if (( $(echo "$ESM_KB >= 6.0" | bc -l) )); then ESM_STATUS="❌"; fi + if (( $(echo "$UMD_KB >= 6.0" | bc -l) )); then UMD_STATUS="❌"; fi + if (( $(echo "$CJS_KB >= 6.0" | bc -l) )); then CJS_STATUS="❌"; fi echo "| ESM | ${ESM_KB} KB | < ${TARGET} | ${ESM_STATUS} |" >> $GITHUB_STEP_SUMMARY echo "| UMD | ${UMD_KB} KB | < ${TARGET} | ${UMD_STATUS} |" >> $GITHUB_STEP_SUMMARY echo "| CJS | ${CJS_KB} KB | < ${TARGET} | ${CJS_STATUS} |" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY - echo "**Success Criteria SC-002**: All bundles must be <5KB gzipped" >> $GITHUB_STEP_SUMMARY + echo "**Success Criteria SC-004**: All bundles must be <6KB gzipped (with border support)" >> $GITHUB_STEP_SUMMARY - name: Comment on PR if: github.event_name == 'pull_request' + continue-on-error: true uses: actions/github-script@v7 with: script: | @@ -102,7 +103,7 @@ jobs: const umdSize = getSize('cornerkit.js'); const cjsSize = getSize('cornerkit.cjs'); - const target = 5.0; + const target = 6.0; const allPassed = parseFloat(esmSize) < target && parseFloat(umdSize) < target && parseFloat(cjsSize) < target; @@ -117,7 +118,7 @@ jobs: | UMD | ${umdSize} KB | < ${target} KB | ${parseFloat(umdSize) < target ? '✅' : '❌'} | | CJS | ${cjsSize} KB | < ${target} KB | ${parseFloat(cjsSize) < target ? '✅' : '❌'} | - **Success Criteria SC-002**: ${allPassed ? '✅ All bundles meet the <5KB gzipped target' : '❌ One or more bundles exceed the 5KB gzipped target'}`; + **Success Criteria SC-004**: ${allPassed ? '✅ All bundles meet the <6KB gzipped target (with border support)' : '❌ One or more bundles exceed the 6KB gzipped target'}`; github.rest.issues.createComment({ issue_number: context.issue.number, diff --git a/.gitignore b/.gitignore index 5b96e5f..debef44 100644 --- a/.gitignore +++ b/.gitignore @@ -65,5 +65,7 @@ docs/ specs/ .claude/ CLAUDE.md +**/CLAUDE.md +CLAUDE.md.backup .specify/ .vite/ diff --git a/CHANGELOG.md b/CHANGELOG.md index c7aa374..daf466f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ For detailed changelog information, see the package-specific changelogs: - [v1.0.0](packages/react/CHANGELOG.md#100---2025-11-22) - Initial release with Squircle component and useSquircle hook ### @cornerkit/core +- [v1.2.0](packages/core/CHANGELOG.md#120---2025-12-07) - SVG-based borders with dashed/dotted/gradient support - [v1.1.0](packages/core/CHANGELOG.md#110---2025-11-18) - Border support - [v1.0.2](packages/core/CHANGELOG.md#102---2025-11-16) - Safari clip-path detection fix + Demo website - [v1.0.0](packages/core/CHANGELOG.md#100---2025-11-12) - Initial release diff --git a/README.md b/README.md index 4ff2df1..2bf7608 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ > Bring iOS-style squircle corners to your web applications [![npm version](https://img.shields.io/npm/v/@cornerkit/core)](https://www.npmjs.com/package/@cornerkit/core) -[![Bundle Size](https://img.shields.io/badge/bundle%20size-4.58%20KB-success)](https://bundlephobia.com/package/@cornerkit/core) +[![Bundle Size](https://img.shields.io/badge/bundle%20size-5.50%20KB-success)](https://bundlephobia.com/package/@cornerkit/core) [![Zero Dependencies](https://img.shields.io/badge/dependencies-0-brightgreen)](package.json) [![TypeScript](https://img.shields.io/badge/TypeScript-5.3%2B-blue)](https://www.typescriptlang.org/) [![Security: A+](https://img.shields.io/badge/security-A%2B-success)](SECURITY.md) @@ -12,7 +12,7 @@ **[Live Demo](https://bejarcode.github.io/cornerKit/)** - Interactive playground with 36+ UI examples -CornerKit is a lightweight JavaScript library that brings the smooth, continuous curve corners (squircles) from iOS design to the web. At just **4.58 KB gzipped** with **zero runtime dependencies**, it delivers pixel-perfect rounded corners that look better than standard CSS `border-radius`. +CornerKit is a lightweight JavaScript library that brings the smooth, continuous curve corners (squircles) from iOS design to the web. At just **5.50 KB gzipped** with **zero runtime dependencies**, it delivers pixel-perfect rounded corners that look better than standard CSS `border-radius`. ## Live Demo @@ -45,8 +45,10 @@ const ck = new CornerKit(); ck.apply('.card', { radius: 24, // Corner size in pixels smoothing: 0.6, // iOS standard smoothness (0-1) - borderWidth: 2, // Optional: border width in pixels - borderColor: '#000' // Optional: border color + border: { // Optional: SVG-based border (v1.2.0+) + width: 2, + color: '#000' + } }); ``` @@ -71,7 +73,7 @@ ck.apply('.card', { ## Why CornerKit? ### Exceptionally Tiny -- **4.58 KB gzipped** (ESM) - 8% under 5KB budget +- **5.50 KB gzipped** (ESM) - includes SVG border rendering - **Zero runtime dependencies** - Tree-shakeable ES modules - Smaller than most icon libraries @@ -89,9 +91,9 @@ ck.apply('.card', { - Automatic capability detection ### Production Ready -- **313/313 unit tests passing** (100%) -- **46/47 integration tests passing** (97.9%) -- **97.9% code coverage** +- **412/412 unit tests passing** (100%) +- **66/67 integration tests passing** (98.5%) +- **84.9% code coverage** - Memory leak prevention with WeakMap registry - A+ security rating (zero vulnerabilities) @@ -241,21 +243,44 @@ const info = ck.inspect('#button'); console.log(info.config); // { radius: 32, smoothing: 0.6 } ``` -## Border Support +## Border Support (v1.2.0+) -CornerKit supports squircle borders using a dual pseudo-element rendering technique that creates smooth borders matching the corner curves. +CornerKit v1.2.0 introduces SVG-based border rendering that eliminates anti-aliasing fringe on dark backgrounds and supports **solid**, **dashed**, **dotted**, and **gradient** styles. ### Basic Border Usage ```javascript const ck = new CornerKit(); -// Apply squircle with border +// Solid border ck.apply('.card', { radius: 24, smoothing: 0.6, - borderWidth: 2, // Border width in pixels - borderColor: '#e5e7eb' // Border color (any CSS color) + border: { width: 2, color: '#e5e7eb' } +}); + +// Dashed border +ck.apply('.upload-zone', { + radius: 20, + border: { width: 2, color: '#6b7280', style: 'dashed' } +}); + +// Dotted border +ck.apply('.badge', { + radius: 12, + border: { width: 3, color: '#10b981', style: 'dotted' } +}); + +// Gradient border +ck.apply('.featured', { + radius: 24, + border: { + width: 3, + gradient: [ + { offset: '0%', color: '#3b82f6' }, + { offset: '100%', color: '#8b5cf6' } + ] + } }); ``` @@ -265,70 +290,44 @@ ck.apply('.card', {
- Card with squircle border + Card with dashed squircle border
``` -### Compatible Elements - -Borders work seamlessly on elements with `overflow: visible` (the default for most elements): +### Migration from v1.1 -✅ **Fully compatible:** -- `
` containers -- `