@snacky/ui 0.9.1 → 0.11.0
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/CHANGELOG.md +94 -0
- package/README.md +4 -3
- package/dist/index.cjs +277 -248
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +89 -59
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +36 -8
- package/dist/index.d.ts +36 -8
- package/dist/index.js +242 -214
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,100 @@ How `@snacky/ui` got to its current state. The README documents what the
|
|
|
4
4
|
package *is*; this documents how it got there, including the mistakes, so the
|
|
5
5
|
verification claims in the README can be taken at face value.
|
|
6
6
|
|
|
7
|
+
## PageIndicator, and a semantic role for indicator dots (0.11.0)
|
|
8
|
+
|
|
9
|
+
`PageIndicator` is the dot row under a carousel: 8x8 dots, a 28x8 pill for the
|
|
10
|
+
current page, `gap/cell` apart, so the row stays 8 tall whichever page is
|
|
11
|
+
showing. It reports position rather than changing it, so the dots are
|
|
12
|
+
`aria-hidden` with no click target and the row carries a single label ("Page 2
|
|
13
|
+
of 3" by default). Make the carousel itself operable and let this follow it.
|
|
14
|
+
|
|
15
|
+
The component is small; the reason it exists is the two tokens under it.
|
|
16
|
+
`--bg-indicator-active` and `--bg-indicator-inactive` are new semantic roles,
|
|
17
|
+
referencing `--color-amber-500` and `--color-neutral-200`. Adding a role rather
|
|
18
|
+
than reusing one needs a reason, and there were two. Figma drew the dots as raw
|
|
19
|
+
hex, one of them `#dadada`, a grey in no ramp at all. And `Stepper` was already
|
|
20
|
+
borrowing: its done dot painted `--icon-brand`, an icon token used as a shape
|
|
21
|
+
fill, and its pending dot `--bg-action-disabled`, which says a step the order
|
|
22
|
+
has not reached yet is a control you cannot use. Two components needing
|
|
23
|
+
"reached" versus "not yet", both saying something false, is what a missing role
|
|
24
|
+
looks like. Stepper now uses the pair, and its rendered colours are unchanged
|
|
25
|
+
(`#f8b732` and `#cccccc`, exactly as before).
|
|
26
|
+
|
|
27
|
+
Worth knowing if you theme the system: `--bg-indicator-inactive` and
|
|
28
|
+
`--bg-action-disabled` resolve to the same grey today but are free to diverge,
|
|
29
|
+
which is the point. Override the indicator one to restyle carousels and
|
|
30
|
+
progress dots without touching disabled controls.
|
|
31
|
+
|
|
32
|
+
compose-ui ships the same as `compose-v2.1.0`: `SnackyPageIndicator`, the
|
|
33
|
+
`SnackyColor.bgIndicatorActive`/`bgIndicatorInactive` pair, and the same Stepper
|
|
34
|
+
change. Both are additive, so neither release breaks anything.
|
|
35
|
+
|
|
36
|
+
Two README corrections came along: compose-ui still claimed
|
|
37
|
+
`SnackyPointBalanceBanner` paints the `primary-500` primitive, which stopped
|
|
38
|
+
being true when its binding was fixed against Figma in 0.10.0, and both READMEs
|
|
39
|
+
still counted 11 solid icons rather than 12.
|
|
40
|
+
|
|
41
|
+
## Brand ramp renamed to amber, components re-checked against Figma (0.10.0)
|
|
42
|
+
|
|
43
|
+
**Breaking: the brand primitive ramp is now `amber`.** It was the only
|
|
44
|
+
primitive named by role (`primary`) while its neighbours were named by hue
|
|
45
|
+
(`neutral`, `red`), which made `--bg-action-primary: var(--color-primary-500)`
|
|
46
|
+
read like a tautology. `--color-primary-50` through `--color-primary-900` are
|
|
47
|
+
now `--color-amber-50` through `--color-amber-900`, with no alias left behind.
|
|
48
|
+
Semantic tokens keep their role names (`--bg-action-primary`,
|
|
49
|
+
`--border-input-active`, ...) and resolve to byte-identical values: all 175
|
|
50
|
+
custom properties were compared before and after, 63 of them still through a
|
|
51
|
+
reference. Only code that referenced a `--color-primary-*` variable directly
|
|
52
|
+
needs to change, and a find-and-replace of `--color-primary-` to
|
|
53
|
+
`--color-amber-` is the whole migration.
|
|
54
|
+
|
|
55
|
+
**Components now use the semantic token Figma binds.** The earlier checks
|
|
56
|
+
compared rendered colours, so a component painting the right hex from the
|
|
57
|
+
wrong token passed. This pass read each node's bound variables instead, and
|
|
58
|
+
found 17 places across both packages reaching past the semantic layer to a
|
|
59
|
+
primitive. Most resolve to the same colour, so only the token changed
|
|
60
|
+
(Checkbox, Toggle, Callout, Navbar's active icon, Tab's underline, Chips'
|
|
61
|
+
selected border). Three were real colour bugs, all rendering `#f8b732` where
|
|
62
|
+
Figma binds `border-highlight` (`#fcdea1`): InfoBadge's border when it has no
|
|
63
|
+
icon, and PointBalanceBanner's border and divider. InfoBadge with an icon
|
|
64
|
+
keeps `border-input-active`, selected by the same icon slot Figma uses to tell
|
|
65
|
+
the two variants apart.
|
|
66
|
+
|
|
67
|
+
**BottomSheet's drag handle** follows Figma's `Driver Slider`: 40x4 (was
|
|
68
|
+
36x4), `border-main` rather than the `neutral-200` primitive (same colour),
|
|
69
|
+
`radius-full`, and no bottom margin of its own. The space below the handle is
|
|
70
|
+
now just the sheet's 16px gap, so a sheet with `showHandle` is 8px shorter.
|
|
71
|
+
|
|
72
|
+
**IconButton `size="small"`** is Figma's 24px circle with the icon at the full
|
|
73
|
+
24x24 and no padding. It used to pad by 4 and inset the icon to 16px, about
|
|
74
|
+
60% of Figma's size. The chevron it carries in Figma, `fi-sr-angle-small-right`,
|
|
75
|
+
was not in the icon set at all; it now ships as `SnackyIcons.solid.angleSmallRight`,
|
|
76
|
+
making the solid set 12 icons.
|
|
77
|
+
|
|
78
|
+
**Section's "see more" action** is that shared small IconButton. It used to be
|
|
79
|
+
its own button with a hand-drawn 16px stroked chevron, so the
|
|
80
|
+
`.snacky-section__action` class no longer exists; style the IconButton instead
|
|
81
|
+
if you were targeting it. The header is also 30px tall now, not the title's
|
|
82
|
+
36px line box, because Figma crops the h3 title node to 30 from the top. Every
|
|
83
|
+
Section is 6px shorter as a result.
|
|
84
|
+
|
|
85
|
+
**UploadButton** matches Figma's `Property 1=upload`: `bg-action-secondary`
|
|
86
|
+
fill (was `bg-surface`) and a dashed `border-action-secondary` outline (was
|
|
87
|
+
`border-main`) drawn 1px outside the 72px circle, as Figma draws it. A real
|
|
88
|
+
border sat inside the box and squeezed the icon to 22px. The `icon` prop is
|
|
89
|
+
now optional and defaults to the camera glyph Figma uses.
|
|
90
|
+
|
|
91
|
+
**ProductCard (list)** pins the name box and the rating/cart row at 41px each,
|
|
92
|
+
as Figma does, so the card is 294 tall (it was 292). The docs site's spec
|
|
93
|
+
already said 294; the package was the one that was wrong.
|
|
94
|
+
|
|
95
|
+
compose-ui ships the same changes as `compose-v2.0.0`. The major bump is for
|
|
96
|
+
the ramp rename, which there is `SnackyColorPrimitive.Primary` becoming
|
|
97
|
+
`SnackyColorPrimitive.Amber`; `SnackyColor.*` semantic names are unchanged.
|
|
98
|
+
It also adds `SnackyUploadButton`, which react-ui had and compose-ui did not,
|
|
99
|
+
and `SnackyIcons.Solid.AngleSmallRight`.
|
|
100
|
+
|
|
7
101
|
## SoldOut overlay uses its own token (0.9.1)
|
|
8
102
|
|
|
9
103
|
Auditing the rest of the package after the semantic-token fix turned up two
|
package/README.md
CHANGED
|
@@ -121,19 +121,20 @@ placeholder artwork rather than a real icon prop. Apply your own
|
|
|
121
121
|
|
|
122
122
|
## What's here
|
|
123
123
|
|
|
124
|
-
All
|
|
124
|
+
All 25 documented components, matching the real Figma-sourced spec values
|
|
125
125
|
(padding, colors, radius, states - all sourced directly from the design
|
|
126
126
|
tokens, not eyeballed):
|
|
127
127
|
|
|
128
128
|
Button, IconButton/UploadButton, Input family (TextField, SearchField,
|
|
129
129
|
OtpField, CopyField, ChatInput, AddressResult), Chips (ProductChip/FilterChip),
|
|
130
|
-
RadioOption, Checkbox, Toggle, NavBar, TabRow, Header,
|
|
130
|
+
RadioOption, Checkbox, Toggle, NavBar, TabRow, Header, PageIndicator, Banner
|
|
131
|
+
family, Badge family,
|
|
131
132
|
Callout, List (OrderListItem/NotificationListItem), Accordion, BottomSheet
|
|
132
133
|
(the shared Modal shell), Section (the shared content-block shell), Avatar,
|
|
133
134
|
Illustration, ProductImage, ProductCard.
|
|
134
135
|
|
|
135
136
|
Plus the icon set, as `SnackyIcons.outline.*` and `SnackyIcons.solid.*` (42
|
|
136
|
-
Outline,
|
|
137
|
+
Outline, 12 Solid). Two things to know: they are **filled** shapes rather than
|
|
137
138
|
stroked paths, so there is no `strokeWidth` to set, and the set is **not
|
|
138
139
|
uniform** - each icon is authored at 16, 20 or 24px and defaults to its own
|
|
139
140
|
natural size, so pass `width`/`height` if you need them to match.
|