also looking at this
chore(deps): update dependency react-dom to 19.2.7
#2138
222 files
+16350
-1825
Review threads live on the whole diff, not on one commit, so none are shown here - a thread's line means something in the branch's final form, and painting it into an intermediate step would put it on code it is not about.
| @@ -0,0 +1,126 @@ | ||
| 1 | # EAN-5 | |
| 2 | ||
| 3 | EAN-5 is a supplemental barcode that adds 5 additional digits to EAN-13 or UPC barcodes. It's commonly used for encoding the price of books and periodicals. | |
| 4 | ||
| 5 | ## Basic Usage | |
| 6 | ||
| 7 | ```ts | |
| 8 | import { barcode } from '@stacksjs/qrx' | |
| 9 | ||
| 10 | barcode('#barcode', '54495', { format: 'EAN5' }) | |
| 11 | ``` | |
| 12 | ||
| 13 | [!NOTE] Image needed: Basic EAN-5 barcode example | |
| 14 | ||
| 15 | ## Structure | |
| 16 | ||
| 17 | An EAN-5 barcode consists of: | |
| 18 | ||
| 19 | - 5 digits total | |
| 20 | - No check digit | |
| 21 | - Must be used as a supplement to EAN-13 or UPC | |
| 22 | ||
| 23 | ## Common Usage with EAN-13 | |
| 24 | ||
| 25 | ```ts | |
| 26 | import { barcode } from '@stacksjs/qrx' | |
| 27 | ||
| 28 | barcode('#barcode') | |
| 29 | .EAN13('9781234567897') | |
| 30 | .blank(20) | |
| 31 | .EAN5('54495', { | |
| 32 | height: 85, | |
| 33 | textPosition: 'top', | |
| 34 | fontSize: 16 | |
| 35 | }) | |
| 36 | .render() | |
| 37 | ``` | |
| 38 | ||
| 39 | [!NOTE] Image needed: EAN-13 with EAN-5 supplement example | |
| 40 | ||
| 41 | ## Customization Options | |
| 42 | ||
| 43 | ```ts | |
| 44 | import { barcode } from '@stacksjs/qrx' | |
| 45 | ||
| 46 | barcode('#barcode', '54495', { | |
| 47 | format: 'EAN5', | |
| 48 | width: 2, | |
| 49 | height: 85, | |
| 50 | displayValue: true, | |
| 51 | font: 'OCRB', | |
| 52 | fontSize: 16, | |
| 53 | textMargin: 0, | |
| 54 | textPosition: 'top' | |
| 55 | }) | |
| 56 | ``` | |
| 57 | ||
| 58 | ## Common Applications | |
| 59 | ||
| 60 | 1. **Book Pricing** | |
| 61 | - Currency indicator (0-7: GBP, 8: USD, 9: AUD) | |
| 62 | - Price value | |
| 63 | 2. **Magazine Pricing** | |
| 64 | - Issue number | |
| 65 | - Price information | |
| 66 | 3. **Currency Encoding** Example codes: | |
| 67 | - ```ts | |
| 68 | // £5.99 in GBP | |
| 69 | barcode('#barcode', '05991', { format: 'EAN5' }) | |
| 70 | ||
| 71 | // $15.95 in USD | |
| 72 | barcode('#barcode', '81595', { format: 'EAN5' }) | |
| 73 | ``` | |
| 74 | ||
| 75 | [!NOTE] Image needed: Currency encoding examples | |
| 76 | ||
| 77 | ## Positioning Guidelines | |
| 78 | ||
| 79 | 1. **Placement** | |
| 80 | - Right-aligned with main barcode | |
| 81 | - Standard gap between main barcode | |
| 82 | - Same baseline alignment | |
| 83 | 2. **Height Options** | |
| 84 | - ```ts | |
| 85 | // Taller than main barcode | |
| 86 | barcode('#barcode', '54495', { | |
| 87 | format: 'EAN5', | |
| 88 | height: 85 // Compared to standard 70 | |
| 89 | }) | |
| 90 | ``` | |
| 91 | ||
| 92 | [!NOTE] Image needed: Positioning visualization | |
| 93 | ||
| 94 | ## Error Handling | |
| 95 | ||
| 96 | ```ts | |
| 97 | import { barcode } from '@stacksjs/qrx' | |
| 98 | ||
| 99 | barcode('#barcode', '54495', { | |
| 100 | format: 'EAN5', | |
| 101 | valid: (valid) => { | |
| 102 | if (!valid) { | |
| 103 | console.error('Invalid EAN-5') | |
| 104 | // Handle invalid input | |
| 105 | } | |
| 106 | } | |
| 107 | }) | |
| 108 | ``` | |
| 109 | ||
| 110 | ## Best Practices | |
| 111 | ||
| 112 | 1. Always use with main barcode | |
| 113 | 2. Maintain proper spacing | |
| 114 | 3. Consider height differential | |
| 115 | 4. Validate 5-digit input | |
| 116 | 5. Use standard encoding for currency | |
| 117 | ||
| 118 | ## Technical Notes | |
| 119 | ||
| 120 | 1. No check digit used | |
| 121 | 2. Must be 5 digits exactly | |
| 122 | 3. Cannot be used standalone | |
| 123 | 4. Scanner must support add-ons | |
| 124 | 5. Standard right-alignment required | |
| 125 | ||
| 126 | [!NOTE] Image needed: Technical specifications diagram | |