@snacky/ui 0.3.3 → 0.3.5

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.
Files changed (3) hide show
  1. package/CHANGELOG.md +83 -0
  2. package/README.md +26 -46
  3. package/package.json +3 -2
package/CHANGELOG.md ADDED
@@ -0,0 +1,83 @@
1
+ # Changelog
2
+
3
+ How `@snacky/ui` got to its current state. The README documents what the
4
+ package *is*; this documents how it got there, including the mistakes, so the
5
+ verification claims in the README can be taken at face value.
6
+
7
+ ## Icon set replaced with the real Figma artwork (0.3.0)
8
+
9
+ The package originally shipped a hand-drawn "starter" icon set: roughly 30
10
+ generic 24x24 glyphs with a 1.5px stroke, written from memory and explicitly
11
+ documented as not pixel-faithful to Figma.
12
+
13
+ That was replaced by all 42 Outline + 10 Solid icons exported from Figma's own
14
+ `Icon-outline` (node `55:2062`) and `Icon-solid` (`8772:5851`) component sets.
15
+ Two structural surprises came out of it:
16
+
17
+ - The icons are **filled outline shapes**, not stroked paths. The weight is
18
+ baked into each shape, so there is no `strokeWidth` to set.
19
+ - The set is **not uniform**. Icons are authored at 16, 20 or 24 units
20
+ depending on where they are used, so each carries its own viewBox instead of
21
+ being scaled from a single size.
22
+
23
+ Three icons are named for what they actually draw rather than their Figma
24
+ property value, confirmed by rendering the exported geometry: Figma's `cod` is
25
+ a delivery truck (`truck`), `list` is a right chevron (`chevronRight`), and the
26
+ two `password` states are a crossed-out and an open eye (`eyeOff` / `eye`).
27
+
28
+ `src/icons/outline.tsx` and `solid.tsx` are now generated from
29
+ `assets/icons/icons.json` by `scripts/generate-icons.js`, the same source that
30
+ generates the Compose package's `SnackyIcons.kt`, so the two platforms cannot
31
+ drift apart. Parity was verified by diffing every path, viewBox and fill-rule
32
+ in both generated outputs against the source: 52/52 exact on each side.
33
+
34
+ ### Attribution gap (0.3.0 and 0.3.1, both unpublished)
35
+
36
+ Those two versions shipped the Flaticon artwork with no attribution at all,
37
+ inside an MIT package. CC BY 4.0 permits the redistribution but requires the
38
+ credit to travel with the work. Both versions were unpublished from npm and
39
+ 0.3.2 shipped the attribution embedded in the generated icon sources (using
40
+ `/*!` so minifiers keep it), verified to survive the bundler into
41
+ `dist/index.js`, plus a `NOTICE` file in the published tarball.
42
+
43
+ ## Component verification pass
44
+
45
+ The first pass of every component was built from `components.json`'s spec
46
+ values and `code.tsx` samples alone. Those are real token values, but
47
+ `code.tsx` is an *illustrative* usage sample, not the site's actual rendered
48
+ implementation - and that first pass was never checked against how the site
49
+ really renders each component.
50
+
51
+ Real mismatches slipped through as a result: Button's icon slot, Toggle's true
52
+ dimensions, Checkbox's checkmark color, Radio's dot size, Tab's gap,
53
+ ProductCard's cart-button size, and List's status colors, among others.
54
+
55
+ Every component was then diffed against `index.html`'s own `PG[id].impl`
56
+ strings - the React-createElement code that powers the site's Live Preview
57
+ panels - field by field: padding, colors, font, line-height, and
58
+ hover/pressed/disabled states. That implementation is treated as authoritative
59
+ where `components.json`'s prose spec disagrees with it.
60
+
61
+ `List` and `Header` were additionally cross-checked directly against their
62
+ Figma component sets, and both agreed with the verified implementation.
63
+
64
+ `BottomSheet` and `Section` were checked later, while porting them to the
65
+ Compose package, and both turned up real bugs: `BottomSheet` defaulted to
66
+ showing a drag handle that none of the nine documented Figma variants actually
67
+ have (the prop was inverted to `showHandle`, defaulting to `false`), and
68
+ `Section`'s "see more" chevron was using the wrong color. That check also
69
+ established that their spacing is variant-dependent by design rather than
70
+ unverified - see the README's Verification status.
71
+
72
+ ## Other fixes worth recording
73
+
74
+ - **ProductImage sizing (0.3.1).** The component builds its class name as
75
+ `--${usage}`, but the stylesheet spelled the first two rules `--card` and
76
+ `--details` instead of `--product-card` and `--product-details`. Those two
77
+ usages - the 128px card image and the 200px detail image, the two most common
78
+ ones - matched no rule at all and rendered completely unsized.
79
+ - **Unstyled-components trap (0.3.3).** The README's usage snippet said
80
+ `import '@snacky/ui'` would pull in the stylesheet "as a side effect". It does
81
+ not: tsup extracts the CSS to a standalone `dist/index.css` and never
82
+ re-injects it into the JS entry, so anyone following the snippet verbatim got
83
+ unstyled components. The correct import is `@snacky/ui/styles.css`.
package/README.md CHANGED
@@ -59,49 +59,30 @@ Illustration, ProductImage, ProductCard.
59
59
 
60
60
  ## Verification status
61
61
 
62
- The first pass of every component was built from `components.json`'s `s`
63
- (spec) values and `code.tsx` samples alone - those are real token values, but
64
- `code.tsx` is an *illustrative* usage sample, not the site's actual rendered
65
- implementation. That first pass was **not** checked against how the site
66
- itself actually renders each component, and several real mismatches slipped
67
- through as a result (Button's icon slot, Toggle's true dimensions, Checkbox's
68
- checkmark color, Radio's dot size, Tab's gap, ProductCard's cart-button size,
69
- List's status colors, and more).
70
-
71
- Every component has since been diffed against `index.html`'s own `PG[id].impl`
72
- strings - the actual React-createElement code that powers the site's "Live
73
- Preview" panels, extracted and compared field-by-field (padding, colors,
74
- font, line-height, hover/pressed/disabled states) - and corrected to match.
75
- This is the authoritative source in this repo; `components.json`'s prose spec
76
- text occasionally disagrees with it (e.g. Checkbox's checkmark is documented
77
- as "white" but the verified implementation uses `#333333`) and the verified
78
- implementation wins in every such case.
79
-
80
- `List`'s `OrderListItem`/`NotificationListItem` were additionally cross-checked
81
- directly against their Figma component set (page "List", component `List`,
82
- `Property 1=order|notification` x `Property 2=<status>`) - the node tree
83
- (fills, strokes, padding, gap, type styles) matches the verified `PG.list.impl`
84
- implementation exactly, so both sources agree: 56x56 thumbnail frame (`#f4f4f5`
85
- background, not a token - a literal value distinct from any generated surface
86
- color), a per-status summary card (`itemsSummary` + bold `total`, a bordered
87
- COD chip on `processCod`, a `paymentDeadline` banner on `waiting`, a right-
88
- aligned primary Button - "Track Shipment" / "Buy Again" - on
89
- shipped/received/cancelled), and a title+message notification row with a
90
- `1px solid var(--border-main)` border on every state, not just unread.
91
-
92
- `Header` was added later, directly from Figma rather than retrofitted from
93
- an existing implementation: inspected the `Header` component set (page
94
- "Header", variants `Icon=Back|Close|None` x `Right Action=True|False`) node
95
- tree for exact spec values (16px/8px padding, 40x40px circular icon buttons,
96
- Poppins Bold 16px/36px title), verified against a live smoke-test render for
97
- all 4 variants (structure, computed styles, click handlers), and confirmed
98
- the `PG.header.impl` string added to the site itself matches the same spec.
99
-
100
- **One deliberate deviation, not an oversight:** `NavBar` items use `flex:1`
101
- to fill the container width, where the site's own demo hardcodes `72x72`
102
- per item - because that demo is only ever shown at a fixed 360px frame. A
103
- production nav bar needs to fill whatever width the real device is, so the
104
- flexible layout was kept on purpose.
62
+ Every component is diffed against `index.html`'s own Live Preview
63
+ implementation - the code that actually renders the documentation site - not
64
+ just the spec values in `components.json`. Where the two disagree, the
65
+ verified implementation wins. `List`, `Header`, `BottomSheet` and `Section`
66
+ were additionally checked against their Figma component sets directly.
67
+
68
+ Three things worth knowing before you rely on them:
69
+
70
+ - **`NavBar` items use `flex: 1`** to fill the container, where the site's own
71
+ demo hardcodes `72x72` per item. That demo only ever renders at a fixed
72
+ 360px frame; a real nav bar has to fill the actual device width, so this is
73
+ a deliberate deviation rather than a mismatch.
74
+ - **`List`'s 56x56 thumbnail frame uses a literal `#f4f4f5`**, not a token -
75
+ it is a distinct value with no equivalent in the generated surface colors.
76
+ - **`BottomSheet` and `Section` spacing is variant-dependent by design.** Both
77
+ shells have since been checked against Figma, and the finding was that no
78
+ single shell default reproduces every variant: BottomSheet's block gap is
79
+ 32px on Welcome, 24px on Calendar and 16px elsewhere, and Section's "Variant"
80
+ layout has no horizontal shell padding at all, with its header owning the
81
+ 24px instead. The shells ship sensible defaults and expect `children` to
82
+ override the spacing where a specific composition needs to.
83
+
84
+ See [CHANGELOG.md](https://github.com/rezatresnas/snacky-design-system/blob/main/packages/react-ui/CHANGELOG.md)
85
+ for how the package got here, including the mistakes.
105
86
 
106
87
  ## Artwork credit and licensing
107
88
 
@@ -163,9 +144,8 @@ what is already in the bundle.
163
144
  Section "variants", but each is really the *same* shell component
164
145
  (`BottomSheet` / `Section`) with different `children` - so that's what's
165
146
  exported, matching every `code.tsx` sample exactly, rather than 22 near-
166
- duplicate components. These two shells have not yet been diffed field-by-
167
- field against `PG.modal`/`PG.section` the way the rest of the package has -
168
- treat their exact padding/gap values as reasonable-but-unverified.
147
+ duplicate components. (See Verification status above on why their spacing is
148
+ variant-dependent.)
169
149
 
170
150
  ## Keeping this in sync
171
151
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@snacky/ui",
3
- "version": "0.3.3",
3
+ "version": "0.3.5",
4
4
  "description": "Snacky App design system - React component library. Generated from the source-of-truth design system at ../../index.html (tokens.json / components.json), pixel-accurate to Figma.",
5
5
  "license": "MIT",
6
6
  "author": "rezatresnas",
@@ -34,7 +34,8 @@
34
34
  },
35
35
  "files": [
36
36
  "dist",
37
- "NOTICE"
37
+ "NOTICE",
38
+ "CHANGELOG.md"
38
39
  ],
39
40
  "sideEffects": [
40
41
  "**/*.css"