@nookly/pebble-icons 0.2.2 → 0.3.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/README.md +72 -58
- package/frame.d.ts +2 -0
- package/icon.d.ts +1 -0
- package/icon.js +6 -3
- package/icons/brands.d.ts +3 -0
- package/icons/brands.js +56 -0
- package/icons.d.ts +1 -0
- package/icons.js +1 -0
- package/motion.css +89 -53
- package/package.json +1 -1
- package/parts.d.ts +6 -1
- package/parts.js +21 -6
package/README.md
CHANGED
|
@@ -21,14 +21,29 @@ import { HomeIcon, SearchIcon } from "@nookly/pebble-icons";
|
|
|
21
21
|
|
|
22
22
|
## Props
|
|
23
23
|
|
|
24
|
-
| Prop | Default
|
|
25
|
-
| ------- |
|
|
26
|
-
| `size` | `24`
|
|
27
|
-
| `color` |
|
|
28
|
-
| `
|
|
24
|
+
| Prop | Default | What it does |
|
|
25
|
+
| ------- | --------- | --------------------------------------------------------------------- |
|
|
26
|
+
| `size` | `24` | Width and height. |
|
|
27
|
+
| `color` | | Any CSS colour. Without it the icon takes the text colour around it. |
|
|
28
|
+
| `tone` | `"mono"` | `"brand"` paints the logos in their brand colours, see below. |
|
|
29
|
+
| `theme` | `"light"` | The surface a `brand` icon sits on, `"light"` or `"dark"`. |
|
|
30
|
+
| `title` | | Names the icon for screen readers. Without it the icon is decoration. |
|
|
29
31
|
|
|
30
32
|
Every other SVG attribute is passed to the `<svg>`.
|
|
31
33
|
|
|
34
|
+
### Logos
|
|
35
|
+
|
|
36
|
+
`WindowsIcon`, `LinuxIcon` and `AppleLogoIcon` are the logos of the three systems an app runs on.
|
|
37
|
+
With `tone="brand"` they are painted in the colours of their brand: Windows in its four colours,
|
|
38
|
+
Linux in black, white and yellow. Tux is black, which vanishes on a dark surface, so say
|
|
39
|
+
`theme="dark"` there and he is charcoal. Apple's mark has no colour of its own, so it stays the
|
|
40
|
+
colour of the text. Every other icon ignores `tone`.
|
|
41
|
+
|
|
42
|
+
```tsx
|
|
43
|
+
<WindowsIcon size={32} tone="brand" />
|
|
44
|
+
<LinuxIcon size={32} tone="brand" theme="dark" />
|
|
45
|
+
```
|
|
46
|
+
|
|
32
47
|
## The style
|
|
33
48
|
|
|
34
49
|
Pebble icons are solid, smooth and soft, like stones worn by water. They are flat: no gradient,
|
|
@@ -97,19 +112,19 @@ moves without a pointer that can hover, or for someone who asked their system fo
|
|
|
97
112
|
|
|
98
113
|
## Icons
|
|
99
114
|
|
|
100
|
-
|
|
101
|
-
by family from `@nookly/pebble-icons/icons/<family>` (`arrows`, `
|
|
102
|
-
`documents`, `editor`, `interface`, `symbols` and `world`), so a bundler that does not
|
|
103
|
-
can take only a family.
|
|
104
|
-
|
|
105
|
-
`AlarmClockIcon`, `AppleIcon`, `
|
|
106
|
-
`ArrowBackUpIcon`, `ArrowBarToLeftIcon`, `ArrowBarToRightIcon`,
|
|
107
|
-
`ArrowLeftIcon`, `ArrowLineDownIcon`, `ArrowLineLeftIcon`,
|
|
108
|
-
`ArrowLineUpIcon`, `ArrowRightIcon`, `ArrowsDiffIcon`, `ArrowsMaximizeIcon`,
|
|
109
|
-
`ArrowUpRightIcon`, `AtIcon`, `BackpackIcon`, `BanIcon`, `BeerIcon`,
|
|
110
|
-
`BinaryTreeIcon`, `BoldIcon`, `BoltIcon`, `BookIcon`, `BookmarkIcon`,
|
|
111
|
-
`BoxIcon`, `BreadIcon`, `BriefcaseIcon`, `BulbIcon`, `CakeIcon`,
|
|
112
|
-
`CalendarCheckIcon`, `CalendarClockIcon`, `CalendarDotIcon`, `CalendarDueIcon`,
|
|
115
|
+
312 icons, from `AlarmClockIcon` to `ZoomOutIcon`. They are exported from the package, and
|
|
116
|
+
by family from `@nookly/pebble-icons/icons/<family>` (`arrows`, `brands`, `calendar`, `core`,
|
|
117
|
+
`devices`, `documents`, `editor`, `interface`, `symbols` and `world`), so a bundler that does not
|
|
118
|
+
shake trees can take only a family.
|
|
119
|
+
|
|
120
|
+
`AlarmClockIcon`, `AppleIcon`, `AppleLogoIcon`, `AppWindowIcon`, `ArchiveIcon`,
|
|
121
|
+
`ArrowAutofitWidthIcon`, `ArrowBackUpIcon`, `ArrowBarToLeftIcon`, `ArrowBarToRightIcon`,
|
|
122
|
+
`ArrowForwardUpIcon`, `ArrowLeftIcon`, `ArrowLineDownIcon`, `ArrowLineLeftIcon`,
|
|
123
|
+
`ArrowLineRightIcon`, `ArrowLineUpIcon`, `ArrowRightIcon`, `ArrowsDiffIcon`, `ArrowsMaximizeIcon`,
|
|
124
|
+
`ArrowsMinimizeIcon`, `ArrowUpRightIcon`, `AtIcon`, `BackpackIcon`, `BanIcon`, `BeerIcon`,
|
|
125
|
+
`BellIcon`, `BikeIcon`, `BinaryTreeIcon`, `BoldIcon`, `BoltIcon`, `BookIcon`, `BookmarkIcon`,
|
|
126
|
+
`BookmarkPlusIcon`, `BoxIcon`, `BreadIcon`, `BriefcaseIcon`, `BulbIcon`, `CakeIcon`,
|
|
127
|
+
`CalendarBlankIcon`, `CalendarCheckIcon`, `CalendarClockIcon`, `CalendarDotIcon`, `CalendarDueIcon`,
|
|
113
128
|
`CalendarGridIcon`, `CalendarIcon`, `CalendarMonthIcon`, `CalendarOffIcon`, `CalendarPlusIcon`,
|
|
114
129
|
`CalendarStatsIcon`, `CalendarUserIcon`, `CalendarWeekIcon`, `CalendarXIcon`, `CameraIcon`,
|
|
115
130
|
`CardsIcon`, `CaretDownIcon`, `CaretRightIcon`, `CategoryIcon`, `ChartIcon`, `CheckIcon`,
|
|
@@ -117,43 +132,42 @@ can take only a family.
|
|
|
117
132
|
`ChevronUpIcon`, `ChipIcon`, `CircleAlertIcon`, `CircleCheckIcon`, `CircleDashedIcon`,
|
|
118
133
|
`CircleDotIcon`, `CircleInfoIcon`, `CircleOffIcon`, `CircleXIcon`, `ClipboardCheckIcon`,
|
|
119
134
|
`ClipboardIcon`, `ClipboardListIcon`, `ClockEditIcon`, `ClockIcon`, `ClockPlusIcon`, `CloseIcon`,
|
|
120
|
-
`CloudCheckIcon`, `CloudDownloadIcon`, `CloudIcon`, `CloudOffIcon`, `CloudStormIcon`,
|
|
121
|
-
`
|
|
122
|
-
`
|
|
123
|
-
`
|
|
124
|
-
`
|
|
125
|
-
`
|
|
126
|
-
`
|
|
127
|
-
`
|
|
128
|
-
`
|
|
129
|
-
`
|
|
130
|
-
`
|
|
131
|
-
`
|
|
132
|
-
`
|
|
133
|
-
`
|
|
134
|
-
`
|
|
135
|
-
`
|
|
136
|
-
`
|
|
137
|
-
`
|
|
138
|
-
`
|
|
139
|
-
`
|
|
140
|
-
`
|
|
141
|
-
`
|
|
142
|
-
`
|
|
143
|
-
`
|
|
144
|
-
`
|
|
145
|
-
`
|
|
146
|
-
`
|
|
147
|
-
`
|
|
148
|
-
`
|
|
149
|
-
`
|
|
150
|
-
`
|
|
151
|
-
`
|
|
152
|
-
`
|
|
153
|
-
`
|
|
154
|
-
`
|
|
155
|
-
`
|
|
156
|
-
`
|
|
157
|
-
`
|
|
158
|
-
`
|
|
159
|
-
`ZoomOutIcon`
|
|
135
|
+
`CloudCheckIcon`, `CloudDownloadIcon`, `CloudIcon`, `CloudOffIcon`, `CloudStormIcon`, `CloudUpIcon`,
|
|
136
|
+
`CloudXIcon`, `CodeIcon`, `CoffeeIcon`, `ColumnInsertLeftIcon`, `ColumnInsertRightIcon`,
|
|
137
|
+
`ColumnRemoveIcon`, `ColumnsIcon`, `CommandIcon`, `ConfettiIcon`, `CopyIcon`, `CopyPlusIcon`,
|
|
138
|
+
`DashboardIcon`, `DatabaseIcon`, `DesktopAlertIcon`, `DesktopIcon`, `DevicesIcon`, `DotIcon`,
|
|
139
|
+
`DotsIcon`, `DotsVerticalIcon`, `DownloadIcon`, `DrumstickIcon`, `EraserIcon`, `ExternalLinkIcon`,
|
|
140
|
+
`EyeIcon`, `EyeOffIcon`, `FeatherIcon`, `FileCodeIcon`, `FileDocxIcon`, `FileDownloadIcon`,
|
|
141
|
+
`FileExportIcon`, `FileIcon`, `FileImportIcon`, `FileOffIcon`, `FilePdfIcon`, `FilePlusIcon`,
|
|
142
|
+
`FileSearchIcon`, `FileSpreadsheetIcon`, `FileTextIcon`, `FileTimeIcon`, `FileUploadIcon`,
|
|
143
|
+
`FileZipIcon`, `FilterIcon`, `FilterOffIcon`, `FingerprintIcon`, `FishIcon`, `FlagIcon`,
|
|
144
|
+
`FlameIcon`, `FloppyIcon`, `FlowerIcon`, `FolderIcon`, `FolderOpenIcon`, `FolderPlusIcon`,
|
|
145
|
+
`FolderSearchIcon`, `FolderShareIcon`, `FootballIcon`, `FriedEggIcon`, `FunctionIcon`, `GearIcon`,
|
|
146
|
+
`GitCompareIcon`, `GraduationCapIcon`, `GridIcon`, `GridPlusIcon`, `GripHorizontalIcon`,
|
|
147
|
+
`GripVerticalIcon`, `Heading1Icon`, `Heading2Icon`, `Heading3Icon`, `Heading4Icon`, `Heading5Icon`,
|
|
148
|
+
`Heading6Icon`, `HeadingIcon`, `HeartIcon`, `HierarchyIcon`, `HighlighterIcon`, `HistoryIcon`,
|
|
149
|
+
`HomeIcon`, `HourglassIcon`, `InboxIcon`, `ItalicIcon`, `KanbanIcon`, `KeyboardIcon`, `KeyIcon`,
|
|
150
|
+
`LaptopIcon`, `LaptopOffIcon`, `LeafIcon`, `LetterCaseIcon`, `LineChartIcon`, `LinkIcon`,
|
|
151
|
+
`LinkPlusIcon`, `LinuxIcon`, `ListChecksIcon`, `ListDetailsIcon`, `ListIcon`, `ListNumbersIcon`,
|
|
152
|
+
`LoaderIcon`, `LockIcon`, `LockOpenIcon`, `LogoutIcon`, `MailAlertIcon`, `MailIcon`, `MapPinIcon`,
|
|
153
|
+
`MarkdownIcon`, `MathFractionIcon`, `MathSymbolsIcon`, `MaximizeIcon`, `MegaphoneIcon`, `MenuIcon`,
|
|
154
|
+
`MessagesIcon`, `MinusIcon`, `MobileIcon`, `MoonIcon`, `MovieIcon`, `MusicIcon`, `NotebookIcon`,
|
|
155
|
+
`NoteIcon`, `NumberIcon`, `OctagonAlertIcon`, `PaletteIcon`, `PaperclipIcon`, `PaperPlaneIcon`,
|
|
156
|
+
`PapersIcon`, `PauseIcon`, `PawIcon`, `PencilIcon`, `PencilPlusIcon`, `PencilRulerIcon`,
|
|
157
|
+
`PepperIcon`, `PhotoIcon`, `PigIcon`, `PinIcon`, `PinOffIcon`, `PinOutlineIcon`, `PlaneIcon`,
|
|
158
|
+
`PlantIcon`, `PlayIcon`, `PlugIcon`, `PlusIcon`, `PotIcon`, `PresentationIcon`, `ProgressIcon`,
|
|
159
|
+
`PuzzleIcon`, `QuoteIcon`, `RectangleIcon`, `RectangleTallIcon`, `RefreshIcon`, `RegexIcon`,
|
|
160
|
+
`RepeatIcon`, `RepeatOffIcon`, `ReplaceIcon`, `RestoreIcon`, `RobotIcon`, `RocketIcon`, `RouteIcon`,
|
|
161
|
+
`RowInsertBottomIcon`, `RowInsertTopIcon`, `RowRemoveIcon`, `RowsIcon`, `SaladIcon`, `ScaleIcon`,
|
|
162
|
+
`SchemaIcon`, `ScissorsIcon`, `ScreenIcon`, `SearchIcon`, `SeedlingIcon`, `SelectAllIcon`,
|
|
163
|
+
`SelectorIcon`, `SeparatorIcon`, `ServerIcon`, `ShareIcon`, `SheetStackIcon`, `ShieldCheckIcon`,
|
|
164
|
+
`ShieldLockIcon`, `SidebarLeftCollapseIcon`, `SidebarLeftExpandIcon`, `SidebarLeftIcon`,
|
|
165
|
+
`SidebarRightCollapseIcon`, `SidebarRightExpandIcon`, `SidebarRightIcon`, `SlidersIcon`,
|
|
166
|
+
`SmileIcon`, `SnowflakeIcon`, `SoupIcon`, `SparklesIcon`, `SpellcheckIcon`, `SquareCheckIcon`,
|
|
167
|
+
`StackIcon`, `StarFilledIcon`, `StarIcon`, `StarOffIcon`, `SteakIcon`, `StickyNoteIcon`,
|
|
168
|
+
`StrikethroughIcon`, `SubtaskIcon`, `SumIcon`, `SunIcon`, `SwatchIcon`, `TableIcon`, `TableOffIcon`,
|
|
169
|
+
`TableRowIcon`, `TabletIcon`, `TagIcon`, `TagOffIcon`, `TargetArrowIcon`, `TargetIcon`,
|
|
170
|
+
`TerminalIcon`, `TextSizeIcon`, `TimelineIcon`, `TopologyIcon`, `TransformIcon`, `TrashIcon`,
|
|
171
|
+
`TrashXIcon`, `TrophyIcon`, `UnlinkIcon`, `UploadIcon`, `UserCircleIcon`, `UserIcon`,
|
|
172
|
+
`UserMinusIcon`, `UsersIcon`, `WandIcon`, `WarningIcon`, `WifiIcon`, `WifiOffIcon`, `WindowsIcon`,
|
|
173
|
+
`WorldIcon`, `WritingIcon`, `ZoomInIcon`, `ZoomOutIcon`
|
package/frame.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ import type { ComponentPropsWithoutRef, FunctionComponent, ReactNode } from "rea
|
|
|
2
2
|
export interface PebbleIconProps extends Omit<ComponentPropsWithoutRef<"svg">, "children"> {
|
|
3
3
|
size?: number | string;
|
|
4
4
|
title?: string;
|
|
5
|
+
tone?: "mono" | "brand";
|
|
6
|
+
theme?: "light" | "dark";
|
|
5
7
|
}
|
|
6
8
|
export type PebbleIcon = FunctionComponent<PebbleIconProps>;
|
|
7
9
|
export declare function IconFrame({ name, size, title, children, ...svg }: Omit<PebbleIconProps, "children"> & {
|
package/icon.d.ts
CHANGED
package/icon.js
CHANGED
|
@@ -18,7 +18,9 @@ const by = (id, used) => (used ? `url(#${id})` : undefined);
|
|
|
18
18
|
function Picture({ drawing, ...props }) {
|
|
19
19
|
// React's ids carry punctuation that `url(#…)` can't hold.
|
|
20
20
|
const id = `pebble-${useId().replace(/[^\w-]/g, "")}`;
|
|
21
|
-
const { back = [], front, hole = [], mark = [], over, overWidth = 1.9, overMove, badge } = drawing;
|
|
21
|
+
const { back = [], front, hole = [], mark = [], inlay = [], over, overWidth = 1.9, overMove, badge, } = drawing;
|
|
22
|
+
const { tone, theme, ...rest } = props;
|
|
23
|
+
const brand = tone === "brand" ? (theme ?? "light") : undefined;
|
|
22
24
|
const icon = drawing.name;
|
|
23
25
|
const holes = `${id}-hole`;
|
|
24
26
|
const marks = `${id}-mark`;
|
|
@@ -34,8 +36,8 @@ function Picture({ drawing, ...props }) {
|
|
|
34
36
|
// oxlint-disable-next-line react/no-array-index-key
|
|
35
37
|
_jsx(Cut, { icon: icon, id: `${id}-behind-${at}`, parts: parts, around: GAP * 2 }, at))), hole.length > 0 && _jsx(Cut, { icon: icon, id: holes, parts: hole }), mark.length > 0 && _jsx(Cut, { icon: icon, id: marks, parts: mark })] }), _jsxs("g", { mask: by(marks, mark.length > 0), children: [sheets.map((sheet, at) => (
|
|
36
38
|
// oxlint-disable-next-line react/no-array-index-key
|
|
37
|
-
_jsx("g", { mask: by(`${id}-behind-${at}`, true), children: _jsx(Parts, { icon: icon, parts: sheet, paint: INK }) }, at))), _jsx("g", { mask: by(holes, hole.length > 0), children: _jsx(Parts, { icon: icon, parts: front, paint: INK }) })] }), over && (_jsx(Movable, { icon: icon, move: overMove, children: _jsx("path", { d: over, fill: "none", stroke: "currentColor", strokeWidth: overWidth, strokeLinecap: "round", strokeLinejoin: "round" }) }))] }));
|
|
38
|
-
const { size, title, ...svg } =
|
|
39
|
+
_jsx("g", { mask: by(`${id}-behind-${at}`, true), children: _jsx(Parts, { icon: icon, parts: sheet, paint: INK, brand: brand }) }, at))), _jsx("g", { mask: by(holes, hole.length > 0), children: _jsx(Parts, { icon: icon, parts: front, paint: INK, brand: brand }) })] }), brand && inlay.length > 0 && _jsx(Parts, { icon: icon, parts: inlay, paint: INK, brand: brand }), over && (_jsx(Movable, { icon: icon, move: overMove, children: _jsx("path", { d: over, fill: "none", stroke: "currentColor", strokeWidth: overWidth, strokeLinecap: "round", strokeLinejoin: "round" }) }))] }));
|
|
40
|
+
const { size, title, ...svg } = rest;
|
|
39
41
|
return (_jsx(IconFrame, { ...svg, size: size, title: title, name: drawing.name, children: badge ? (_jsxs(_Fragment, { children: [_jsxs("mask", { id: clear, maskUnits: "userSpaceOnUse", ...AREA, children: [_jsx("rect", { ...AREA, fill: "#fff" }), _jsx("circle", { cx: BADGE.cx, cy: BADGE.cy, r: BADGE.clear, fill: "#000" })] }), _jsxs("mask", { id: sign, maskUnits: "userSpaceOnUse", ...AREA, children: [_jsx("rect", { ...AREA, fill: "#fff" }), _jsx("path", { d: badge.sign, fill: "#000", stroke: "#000", strokeWidth: badge.width ?? 2.5, strokeLinecap: "round", strokeLinejoin: "round" })] }), _jsx("g", { mask: by(clear, true), children: picture }), _jsx(Movable, { icon: icon, move: "badge", children: _jsx("g", { mask: by(sign, true), children: _jsx("circle", { cx: BADGE.cx, cy: BADGE.cy, r: BADGE.r, fill: "currentColor" }) }) })] })) : (picture) }));
|
|
40
42
|
}
|
|
41
43
|
/// The drawing with every part named. What is cut out of the front lies on the front.
|
|
@@ -46,6 +48,7 @@ function movable(drawing) {
|
|
|
46
48
|
front: layered("front", drawing.front),
|
|
47
49
|
hole: drawing.hole && layered("front", drawing.hole),
|
|
48
50
|
mark: drawing.mark && layered("mark", drawing.mark),
|
|
51
|
+
inlay: drawing.inlay && layered("mark", drawing.inlay),
|
|
49
52
|
overMove: drawing.over && (drawing.overMove ?? "over"),
|
|
50
53
|
};
|
|
51
54
|
}
|
package/icons/brands.js
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/// The systems an app runs on. Drawn like the real logos, with only the corners softened. In
|
|
2
|
+
/// the brand tone Windows has its four colours and Linux its black, white and yellow; Apple's
|
|
3
|
+
/// mark has no colour of its own, so it stays the colour of the text.
|
|
4
|
+
import { createPebbleIcon } from "../icon.js";
|
|
5
|
+
import { branded, circle, moving, path, rect } from "../parts.js";
|
|
6
|
+
const RED = "#F25022";
|
|
7
|
+
const GREEN = "#7FBA00";
|
|
8
|
+
const BLUE = "#00A4EF";
|
|
9
|
+
const YELLOW = "#FFB900";
|
|
10
|
+
const BEAK = "#F5B400";
|
|
11
|
+
const WHITE = "#FFFFFF";
|
|
12
|
+
/// Tux is black, which would vanish on a dark surface, so there he is charcoal.
|
|
13
|
+
const TUX = ["#16161B", "#4B4B57"];
|
|
14
|
+
const pane = (n, x, y, colour) => branded(colour, moving(`pane-${n}`, [rect(x, y, 9.3, 9.3, 0.9)]));
|
|
15
|
+
export const WindowsIcon = /* @__PURE__ */ createPebbleIcon({
|
|
16
|
+
name: "windows",
|
|
17
|
+
front: [
|
|
18
|
+
...pane(1, 2, 2, RED),
|
|
19
|
+
...pane(2, 12.7, 2, GREEN),
|
|
20
|
+
...pane(3, 2, 12.7, BLUE),
|
|
21
|
+
...pane(4, 12.7, 12.7, YELLOW),
|
|
22
|
+
],
|
|
23
|
+
});
|
|
24
|
+
export const AppleLogoIcon = /* @__PURE__ */ createPebbleIcon({
|
|
25
|
+
name: "apple-logo",
|
|
26
|
+
back: moving("leaf", [
|
|
27
|
+
path("M15.53 3.83c.843-1.012 1.4-2.427 1.245-3.83-1.207.052-2.662.805-3.532 1.818-.78.896-1.454 2.338-1.273 3.714 1.338.104 2.715-.688 3.559-1.701Z"),
|
|
28
|
+
]),
|
|
29
|
+
front: moving("body", [
|
|
30
|
+
path("M12.152 6.896c-.948 0-2.415-1.078-3.96-1.04-2.04.027-3.91 1.183-4.961 3.014-2.117 3.675-.546 9.103 1.519 12.09 1.013 1.454 2.208 3.09 3.792 3.039 1.52-.065 2.09-.987 3.935-.987 1.831 0 2.35.987 3.96.948 1.637-.026 2.676-1.48 3.676-2.948 1.156-1.688 1.636-3.325 1.662-3.415-.039-.013-3.182-1.221-3.22-4.857-.026-3.04 2.48-4.494 2.597-4.559-1.429-2.09-3.623-2.324-4.39-2.376-2-.156-3.675 1.09-4.61 1.09Z"),
|
|
31
|
+
]),
|
|
32
|
+
});
|
|
33
|
+
const TUX_BELLY = "M12 8.4C14.4 9.2 15.9 12 15.9 15C15.9 17.6 14.3 19.2 12 19.2C9.7 19.2 8.1 17.6 8.1 15C8.1 12 9.6 9.2 12 8.4Z";
|
|
34
|
+
const TUX_BEAK = "M10 6.5Q12 5.5 14 6.5Q12 8.3 10 6.5Z";
|
|
35
|
+
const TUX_EYES = [circle(10.5, 4.4, 0.85), circle(13.5, 4.4, 0.85)];
|
|
36
|
+
export const LinuxIcon = /* @__PURE__ */ createPebbleIcon({
|
|
37
|
+
name: "linux",
|
|
38
|
+
back: branded(BEAK, [
|
|
39
|
+
...moving("foot-l", [
|
|
40
|
+
path("M2.6 22.6C2.6 21 4.6 20.2 7.4 20.4L10.6 21.2C11.4 22.2 10.8 23.2 9.6 23.2H4C3.2 23.2 2.6 23 2.6 22.6Z"),
|
|
41
|
+
]),
|
|
42
|
+
...moving("foot-r", [
|
|
43
|
+
path("M21.4 22.6C21.4 21 19.4 20.2 16.6 20.4L13.4 21.2C12.6 22.2 13.2 23.2 14.4 23.2H20C20.8 23.2 21.4 23 21.4 22.6Z"),
|
|
44
|
+
]),
|
|
45
|
+
]),
|
|
46
|
+
front: branded(TUX, moving("body", [
|
|
47
|
+
path("M12 1.4C14.5 1.4 15.4 3.5 15.4 5.7C15.4 7.5 16.6 8.9 17.6 11.3C18.8 14.1 19.4 16.9 18.4 19.2C17.8 20.2 16.4 20.4 15.4 20.4H8.6C7.6 20.4 6.2 20.2 5.6 19.2C4.6 16.9 5.2 14.1 6.4 11.3C7.4 8.9 8.6 7.5 8.6 5.7C8.6 3.5 9.5 1.4 12 1.4Z"),
|
|
48
|
+
])),
|
|
49
|
+
hole: moving("belly", [path(TUX_BELLY)]),
|
|
50
|
+
mark: [...moving("beak", [path(TUX_BEAK)]), ...moving("eyes", TUX_EYES)],
|
|
51
|
+
inlay: [
|
|
52
|
+
...branded(WHITE, moving("belly", [path(TUX_BELLY)])),
|
|
53
|
+
...branded(BEAK, moving("beak", [path(TUX_BEAK)])),
|
|
54
|
+
...branded(WHITE, moving("eyes", TUX_EYES)),
|
|
55
|
+
],
|
|
56
|
+
});
|
package/icons.d.ts
CHANGED
package/icons.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// Every drawing of the set, by family. A name says what the picture shows, not what an app
|
|
2
2
|
/// uses it for.
|
|
3
3
|
export * from "./icons/arrows.js";
|
|
4
|
+
export * from "./icons/brands.js";
|
|
4
5
|
export * from "./icons/calendar.js";
|
|
5
6
|
export * from "./icons/core.js";
|
|
6
7
|
export * from "./icons/devices.js";
|
package/motion.css
CHANGED
|
@@ -749,6 +749,56 @@
|
|
|
749
749
|
--pebble-play: pebble-jelly 0.6s ease-in-out 0.12s;
|
|
750
750
|
}
|
|
751
751
|
|
|
752
|
+
.pebble-windows__pane-1 {
|
|
753
|
+
transform-origin: 6.65px 6.65px;
|
|
754
|
+
--pebble-play: pebble-boing 0.5s ease-in-out;
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
.pebble-windows__pane-2 {
|
|
758
|
+
transform-origin: 17.35px 6.65px;
|
|
759
|
+
--pebble-play: pebble-boing 0.5s ease-in-out 0.07s;
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
.pebble-windows__pane-4 {
|
|
763
|
+
transform-origin: 17.35px 17.35px;
|
|
764
|
+
--pebble-play: pebble-boing 0.5s ease-in-out 0.14s;
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
.pebble-windows__pane-3 {
|
|
768
|
+
transform-origin: 6.65px 17.35px;
|
|
769
|
+
--pebble-play: pebble-boing 0.5s ease-in-out 0.21s;
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
.pebble-linux__body,
|
|
773
|
+
.pebble-linux__belly,
|
|
774
|
+
.pebble-linux__beak,
|
|
775
|
+
.pebble-linux__eyes {
|
|
776
|
+
transform-origin: 12px 21px;
|
|
777
|
+
--pebble-play: pebble-jelly 0.6s ease-in-out;
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
.pebble-linux__foot-l,
|
|
781
|
+
.pebble-linux__foot-r,
|
|
782
|
+
.pebble-paw__pad {
|
|
783
|
+
transform-origin: 12px 22px;
|
|
784
|
+
--pebble-play: pebble-thud 0.55s ease-in-out;
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
.pebble-apple-logo__body,
|
|
788
|
+
.pebble-folder-plus__flap,
|
|
789
|
+
.pebble-folder-search__flap,
|
|
790
|
+
.pebble-folder-share__flap,
|
|
791
|
+
.pebble-home__front,
|
|
792
|
+
.pebble-fried-egg__front {
|
|
793
|
+
transform-origin: 12px 22px;
|
|
794
|
+
--pebble-play: pebble-jelly 0.6s ease-in-out;
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
.pebble-apple-logo__leaf {
|
|
798
|
+
transform-origin: 12.4px 5.2px;
|
|
799
|
+
--pebble-play: pebble-swell 0.55s ease-in-out;
|
|
800
|
+
}
|
|
801
|
+
|
|
752
802
|
.pebble-calendar-blank__mark {
|
|
753
803
|
transform-origin: 12px 13.6px;
|
|
754
804
|
--pebble-play: pebble-boing 0.5s ease-in-out;
|
|
@@ -1192,15 +1242,6 @@
|
|
|
1192
1242
|
--pebble-play: pebble-shake 0.6s ease-in-out;
|
|
1193
1243
|
}
|
|
1194
1244
|
|
|
1195
|
-
.pebble-folder-plus__flap,
|
|
1196
|
-
.pebble-folder-search__flap,
|
|
1197
|
-
.pebble-folder-share__flap,
|
|
1198
|
-
.pebble-home__front,
|
|
1199
|
-
.pebble-fried-egg__front {
|
|
1200
|
-
transform-origin: 12px 22px;
|
|
1201
|
-
--pebble-play: pebble-jelly 0.6s ease-in-out;
|
|
1202
|
-
}
|
|
1203
|
-
|
|
1204
1245
|
.pebble-folder-plus__mark {
|
|
1205
1246
|
transform-origin: 12px 15.3px;
|
|
1206
1247
|
--pebble-play: pebble-spin 0.55s ease-in-out;
|
|
@@ -2680,11 +2721,6 @@
|
|
|
2680
2721
|
--pebble-play: pebble-puff 0.65s ease-in-out;
|
|
2681
2722
|
}
|
|
2682
2723
|
|
|
2683
|
-
.pebble-paw__pad {
|
|
2684
|
-
transform-origin: 12px 22px;
|
|
2685
|
-
--pebble-play: pebble-thud 0.55s ease-in-out;
|
|
2686
|
-
}
|
|
2687
|
-
|
|
2688
2724
|
.pebble-paw__toe-1 {
|
|
2689
2725
|
transform-origin: 4.2px 10.4px;
|
|
2690
2726
|
--pebble-play: pebble-pop 0.5s ease-in-out 0.12s;
|
|
@@ -3113,6 +3149,45 @@
|
|
|
3113
3149
|
}
|
|
3114
3150
|
}
|
|
3115
3151
|
|
|
3152
|
+
@keyframes pebble-boing {
|
|
3153
|
+
0% {
|
|
3154
|
+
transform: scale(1, 1);
|
|
3155
|
+
}
|
|
3156
|
+
35% {
|
|
3157
|
+
transform: scale(calc(1 + var(--pebble-spring) * 0.28), calc(1 + var(--pebble-spring) * -0.1));
|
|
3158
|
+
}
|
|
3159
|
+
65% {
|
|
3160
|
+
transform: scale(calc(1 + var(--pebble-spring) * -0.07), calc(1 + var(--pebble-spring) * 0.1));
|
|
3161
|
+
}
|
|
3162
|
+
100% {
|
|
3163
|
+
transform: scale(1, 1);
|
|
3164
|
+
}
|
|
3165
|
+
}
|
|
3166
|
+
|
|
3167
|
+
@keyframes pebble-swell {
|
|
3168
|
+
0% {
|
|
3169
|
+
transform: scale(1, 1);
|
|
3170
|
+
}
|
|
3171
|
+
25% {
|
|
3172
|
+
transform: scale(
|
|
3173
|
+
calc(1 + var(--pebble-spring) * -0.16),
|
|
3174
|
+
calc(1 + var(--pebble-spring) * -0.16)
|
|
3175
|
+
);
|
|
3176
|
+
}
|
|
3177
|
+
58% {
|
|
3178
|
+
transform: scale(calc(1 + var(--pebble-spring) * 0.14), calc(1 + var(--pebble-spring) * 0.14));
|
|
3179
|
+
}
|
|
3180
|
+
80% {
|
|
3181
|
+
transform: scale(
|
|
3182
|
+
calc(1 + var(--pebble-spring) * -0.04),
|
|
3183
|
+
calc(1 + var(--pebble-spring) * -0.04)
|
|
3184
|
+
);
|
|
3185
|
+
}
|
|
3186
|
+
100% {
|
|
3187
|
+
transform: scale(1, 1);
|
|
3188
|
+
}
|
|
3189
|
+
}
|
|
3190
|
+
|
|
3116
3191
|
@keyframes pebble-tile-a {
|
|
3117
3192
|
0% {
|
|
3118
3193
|
y: 2px;
|
|
@@ -3868,30 +3943,6 @@
|
|
|
3868
3943
|
}
|
|
3869
3944
|
}
|
|
3870
3945
|
|
|
3871
|
-
@keyframes pebble-swell {
|
|
3872
|
-
0% {
|
|
3873
|
-
transform: scale(1, 1);
|
|
3874
|
-
}
|
|
3875
|
-
25% {
|
|
3876
|
-
transform: scale(
|
|
3877
|
-
calc(1 + var(--pebble-spring) * -0.16),
|
|
3878
|
-
calc(1 + var(--pebble-spring) * -0.16)
|
|
3879
|
-
);
|
|
3880
|
-
}
|
|
3881
|
-
58% {
|
|
3882
|
-
transform: scale(calc(1 + var(--pebble-spring) * 0.14), calc(1 + var(--pebble-spring) * 0.14));
|
|
3883
|
-
}
|
|
3884
|
-
80% {
|
|
3885
|
-
transform: scale(
|
|
3886
|
-
calc(1 + var(--pebble-spring) * -0.04),
|
|
3887
|
-
calc(1 + var(--pebble-spring) * -0.04)
|
|
3888
|
-
);
|
|
3889
|
-
}
|
|
3890
|
-
100% {
|
|
3891
|
-
transform: scale(1, 1);
|
|
3892
|
-
}
|
|
3893
|
-
}
|
|
3894
|
-
|
|
3895
3946
|
@keyframes pebble-scan {
|
|
3896
3947
|
0% {
|
|
3897
3948
|
transform: translate(0, 0) rotate(0) scale(1, 1);
|
|
@@ -4022,21 +4073,6 @@
|
|
|
4022
4073
|
}
|
|
4023
4074
|
}
|
|
4024
4075
|
|
|
4025
|
-
@keyframes pebble-boing {
|
|
4026
|
-
0% {
|
|
4027
|
-
transform: scale(1, 1);
|
|
4028
|
-
}
|
|
4029
|
-
35% {
|
|
4030
|
-
transform: scale(calc(1 + var(--pebble-spring) * 0.28), calc(1 + var(--pebble-spring) * -0.1));
|
|
4031
|
-
}
|
|
4032
|
-
65% {
|
|
4033
|
-
transform: scale(calc(1 + var(--pebble-spring) * -0.07), calc(1 + var(--pebble-spring) * 0.1));
|
|
4034
|
-
}
|
|
4035
|
-
100% {
|
|
4036
|
-
transform: scale(1, 1);
|
|
4037
|
-
}
|
|
4038
|
-
}
|
|
4039
|
-
|
|
4040
4076
|
@keyframes pebble-hop {
|
|
4041
4077
|
0% {
|
|
4042
4078
|
transform: translateY(0) scale(1, 1);
|
package/package.json
CHANGED
package/parts.d.ts
CHANGED
|
@@ -5,6 +5,8 @@ export declare const AREA: {
|
|
|
5
5
|
width: number;
|
|
6
6
|
height: number;
|
|
7
7
|
};
|
|
8
|
+
export type Colour = string | readonly [light: string, dark: string];
|
|
9
|
+
export type Surface = "light" | "dark";
|
|
8
10
|
export type Part = ({
|
|
9
11
|
kind: "rect";
|
|
10
12
|
x: number;
|
|
@@ -31,12 +33,14 @@ export type Part = ({
|
|
|
31
33
|
}) & {
|
|
32
34
|
opacity?: number;
|
|
33
35
|
move?: string;
|
|
36
|
+
brand?: Colour;
|
|
34
37
|
};
|
|
35
38
|
export declare const rect: (x: number, y: number, width: number, height: number, radius: number, transform?: string) => Part;
|
|
36
39
|
export declare const circle: (cx: number, cy: number, r: number, transform?: string) => Part;
|
|
37
40
|
export declare const path: (d: string, transform?: string) => Part;
|
|
38
41
|
export declare const line: (d: string, width: number, transform?: string) => Part;
|
|
39
42
|
export declare const sheer: (opacity: number, part: Part) => Part;
|
|
43
|
+
export declare const branded: (colour: Colour, parts: Part[]) => Part[];
|
|
40
44
|
export declare const moving: (move: string, parts: Part[]) => Part[];
|
|
41
45
|
export declare const Movable: ({ icon, move, children, }: {
|
|
42
46
|
icon: string;
|
|
@@ -50,9 +54,10 @@ export interface Paint {
|
|
|
50
54
|
stroke?: string;
|
|
51
55
|
strokeWidth?: number;
|
|
52
56
|
}
|
|
53
|
-
export declare function Parts({ icon, parts, paint, grow, }: {
|
|
57
|
+
export declare function Parts({ icon, parts, paint, grow, brand, }: {
|
|
54
58
|
icon: string;
|
|
55
59
|
parts: readonly Part[];
|
|
56
60
|
paint: Paint;
|
|
57
61
|
grow?: number;
|
|
62
|
+
brand?: Surface;
|
|
58
63
|
}): import("react").JSX.Element[];
|
package/parts.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
/// The area masks work on, wide enough for shapes that reach past the grid.
|
|
3
3
|
export const AREA = { x: -5, y: -5, width: 34, height: 34 };
|
|
4
|
+
const colourOn = (colour, surface) => typeof colour === "string" ? colour : colour[surface === "dark" ? 1 : 0];
|
|
4
5
|
export const rect = (x, y, width, height, radius, transform) => ({ kind: "rect", x, y, width, height, radius, transform });
|
|
5
6
|
export const circle = (cx, cy, r, transform) => ({
|
|
6
7
|
kind: "circle",
|
|
@@ -18,6 +19,8 @@ export const line = (d, width, transform) => ({
|
|
|
18
19
|
});
|
|
19
20
|
/// The same part as a sheet of its own.
|
|
20
21
|
export const sheer = (opacity, part) => ({ ...part, opacity });
|
|
22
|
+
/// The same shapes in the colour they have in the brand tone.
|
|
23
|
+
export const branded = (colour, parts) => parts.map((part) => ({ ...part, brand: colour }));
|
|
21
24
|
/// The same shapes as one part that can move, named for `motion.css`.
|
|
22
25
|
export const moving = (move, parts) => parts.map((part) => ({ ...part, move }));
|
|
23
26
|
/// A group around a part that moves. Every copy of the part gets one, in the masks too, so
|
|
@@ -41,10 +44,21 @@ function together(parts) {
|
|
|
41
44
|
}
|
|
42
45
|
return runs;
|
|
43
46
|
}
|
|
44
|
-
function Drawn({ part, paint, grow }) {
|
|
45
|
-
|
|
47
|
+
function Drawn({ part, paint, grow, brand, }) {
|
|
48
|
+
// Only what is painted in the icon's own colour takes the brand colour: masks stay as they are.
|
|
49
|
+
const own = brand && part.brand ? colourOn(part.brand, brand) : undefined;
|
|
50
|
+
const fill = own && paint.fill === "currentColor" ? own : paint.fill;
|
|
51
|
+
const { fillOpacity, strokeWidth } = paint;
|
|
52
|
+
const stroke = own && paint.stroke === "currentColor" ? own : paint.stroke;
|
|
46
53
|
const { transform } = part;
|
|
47
|
-
const shape = {
|
|
54
|
+
const shape = {
|
|
55
|
+
fill,
|
|
56
|
+
fillOpacity,
|
|
57
|
+
stroke,
|
|
58
|
+
strokeWidth,
|
|
59
|
+
strokeLinejoin: "round",
|
|
60
|
+
transform,
|
|
61
|
+
};
|
|
48
62
|
switch (part.kind) {
|
|
49
63
|
case "rect":
|
|
50
64
|
return (_jsx("rect", { x: part.x, y: part.y, width: part.width, height: part.height, rx: part.radius, ...shape }));
|
|
@@ -60,12 +74,13 @@ function Drawn({ part, paint, grow }) {
|
|
|
60
74
|
}
|
|
61
75
|
/// Parts in one paint. A line is a stroke in the paint's `stroke`, or else its `fill`; `grow`
|
|
62
76
|
/// makes it that much wider, for a mask that has to reach past an outline. A part that can
|
|
63
|
-
/// move sits in a group of its own.
|
|
64
|
-
|
|
77
|
+
/// move sits in a group of its own. With a `brand` surface, parts that have a brand colour
|
|
78
|
+
/// are painted in it.
|
|
79
|
+
export function Parts({ icon, parts, paint, grow = 0, brand, }) {
|
|
65
80
|
return together(parts).map((run, index) => (
|
|
66
81
|
// A drawing never changes, so a shape's place in it is its identity.
|
|
67
82
|
// oxlint-disable-next-line react/no-array-index-key
|
|
68
83
|
_jsx(Movable, { icon: icon, move: run[0].move, children: run.map((part, at) => (
|
|
69
84
|
// oxlint-disable-next-line react/no-array-index-key
|
|
70
|
-
_jsx(Drawn, { part: part, paint: paint, grow: grow }, at))) }, index)));
|
|
85
|
+
_jsx(Drawn, { part: part, paint: paint, grow: grow, brand: brand }, at))) }, index)));
|
|
71
86
|
}
|