@fluxus-ui/icons 0.2.0 → 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 +9 -1
- package/bin/icons-png.mjs +51 -0
- package/dist/index.cjs +304 -8
- package/dist/index.d.cts +96 -1
- package/dist/index.d.ts +96 -1
- package/dist/index.js +277 -7
- package/dist/react.cjs +7 -3
- package/dist/react.js +7 -3
- package/package.json +12 -3
package/dist/index.d.cts
CHANGED
|
@@ -46,7 +46,37 @@ interface IconDef {
|
|
|
46
46
|
/** Pushes by what sets them off: 'hover', 'press' or the name of a state it enters. */
|
|
47
47
|
kicks?: Readonly<Record<string, readonly Kick[]>>;
|
|
48
48
|
}
|
|
49
|
+
/** A pose with nothing left out. */
|
|
50
|
+
interface Full {
|
|
51
|
+
d: string;
|
|
52
|
+
x: number;
|
|
53
|
+
y: number;
|
|
54
|
+
r: number;
|
|
55
|
+
s: number;
|
|
56
|
+
draw: number;
|
|
57
|
+
o: number;
|
|
58
|
+
}
|
|
49
59
|
declare const REST = "rest";
|
|
60
|
+
/** The springs of the engine, the same on every platform: a change of state, a push, and a whole turn. */
|
|
61
|
+
declare const ICON_SPRINGS: {
|
|
62
|
+
readonly state: {
|
|
63
|
+
readonly stiffness: 320;
|
|
64
|
+
readonly damping: 26;
|
|
65
|
+
};
|
|
66
|
+
readonly push: {
|
|
67
|
+
readonly stiffness: 180;
|
|
68
|
+
readonly damping: 12;
|
|
69
|
+
};
|
|
70
|
+
readonly turn: {
|
|
71
|
+
readonly stiffness: 120;
|
|
72
|
+
readonly damping: 20;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
declare const poseOf: (part: IconPart, state: string | undefined, progress: number) => Full;
|
|
76
|
+
/** Whether its stroke is ever less than whole: it needs `pathLength`. */
|
|
77
|
+
declare const draws: (part: IconPart) => boolean;
|
|
78
|
+
/** The attributes of a part in a pose; null is «not there». The engine and the markup write the same ones. */
|
|
79
|
+
declare const attrsOf: (part: IconPart, pose: Full) => Record<"d" | "transform" | "stroke-dasharray" | "visibility" | "opacity", string | null>;
|
|
50
80
|
interface MarkupOptions {
|
|
51
81
|
state?: string;
|
|
52
82
|
/** 0–1, for the parts that follow it. */
|
|
@@ -59,6 +89,8 @@ interface MarkupOptions {
|
|
|
59
89
|
declare const partsMarkup: (def: IconDef, state?: string, progress?: number) => string;
|
|
60
90
|
/** An icon as an `<svg>`, in a state: what a server sends, and what the engine leaves at rest. */
|
|
61
91
|
declare const iconMarkup: (def: IconDef, { state, progress, label, className }?: MarkupOptions) => string;
|
|
92
|
+
/** An outline split into its commands and its numbers. */
|
|
93
|
+
declare const parse: (d: string) => Array<string | number>;
|
|
62
94
|
/** What is wrong with an icon; nothing when it follows the rules. */
|
|
63
95
|
declare function validateIcon(def: IconDef): string[];
|
|
64
96
|
|
|
@@ -91,27 +123,63 @@ declare const arrowUp: IconDef;
|
|
|
91
123
|
/** A bell that rings with the pointer. `on`: something is new, a dot says so and it rings. */
|
|
92
124
|
declare const bell: IconDef;
|
|
93
125
|
|
|
126
|
+
/** An open book. `on`: being read, the lines are written on its pages. */
|
|
127
|
+
declare const book: IconDef;
|
|
128
|
+
|
|
94
129
|
declare const calendar: IconDef;
|
|
95
130
|
|
|
131
|
+
/** A bank card; pressed, it slides as when it is swiped. */
|
|
132
|
+
declare const card: IconDef;
|
|
133
|
+
|
|
134
|
+
/** A speech bubble. `typing`: three dots appear inside it; pressed, it gives a little. */
|
|
135
|
+
declare const chat: IconDef;
|
|
136
|
+
|
|
96
137
|
/** A tick in a circle. From `off` the circle is drawn and then the tick is written. */
|
|
97
138
|
declare const check: IconDef;
|
|
98
139
|
|
|
140
|
+
/** Two ticks: seen. `single`: only the first, sent; going back to rest writes the second. */
|
|
141
|
+
declare const checkDouble: IconDef;
|
|
142
|
+
|
|
99
143
|
/** It points down; `on`: up. */
|
|
100
144
|
declare const chevron: IconDef;
|
|
101
145
|
|
|
146
|
+
/** A clock. `busy`: something is on its way, the minute hand goes round once and the hour hand moves on. */
|
|
147
|
+
declare const clock: IconDef;
|
|
148
|
+
|
|
102
149
|
/** A cross that turns a little with the pointer and shrinks when pressed. */
|
|
103
150
|
declare const close: IconDef;
|
|
104
151
|
|
|
105
152
|
/** Two sheets; `done`: the one behind goes and a tick is written on the one in front. */
|
|
106
153
|
declare const copy: IconDef;
|
|
107
154
|
|
|
155
|
+
/** An arrow into a tray. `busy`: the tray fills with the progress of the icon. `done`: the arrow gives way to a tick. */
|
|
156
|
+
declare const download: IconDef;
|
|
157
|
+
|
|
108
158
|
/** An exclamation in a circle. From `off` it is drawn, and it shakes once. */
|
|
109
159
|
declare const error: IconDef;
|
|
110
160
|
|
|
161
|
+
/** A test on a clipboard. `done`: its boxes are ticked. */
|
|
162
|
+
declare const exam: IconDef;
|
|
163
|
+
|
|
164
|
+
/** An arrow out of a box: it opens elsewhere. Pressed, the arrow goes out a little. */
|
|
165
|
+
declare const external: IconDef;
|
|
166
|
+
|
|
167
|
+
/** An eye. `off`: hidden, as a password is, the lid comes down and a stroke crosses it. */
|
|
168
|
+
declare const eye: IconDef;
|
|
169
|
+
|
|
170
|
+
/** A funnel. `on`: a filter is applied, a dot says so; pressed, it drips. */
|
|
171
|
+
declare const filter: IconDef;
|
|
172
|
+
|
|
173
|
+
/** A question in a circle; pressed, it tilts its head. */
|
|
174
|
+
declare const help: IconDef;
|
|
175
|
+
|
|
111
176
|
declare const image: IconDef;
|
|
112
177
|
|
|
113
178
|
declare const inbox: IconDef;
|
|
114
179
|
|
|
180
|
+
/** An i in a circle; pressed, the dot hops. */
|
|
181
|
+
declare const info: IconDef;
|
|
182
|
+
|
|
115
183
|
declare const list: IconDef;
|
|
116
184
|
|
|
117
185
|
/** A padlock. `open`: the shackle lifts and lets go on one side; with the pointer it lifts a little and drops. */
|
|
@@ -122,6 +190,12 @@ declare const login: IconDef;
|
|
|
122
190
|
|
|
123
191
|
declare const logout: IconDef;
|
|
124
192
|
|
|
193
|
+
/** A folded map. `on`: a route is drawn across it. */
|
|
194
|
+
declare const map: IconDef;
|
|
195
|
+
|
|
196
|
+
/** A first-place medal on its ribbon; pressed, it swings. */
|
|
197
|
+
declare const medal: IconDef;
|
|
198
|
+
|
|
125
199
|
/** Three lines that cross into a close mark. `on`: open. */
|
|
126
200
|
declare const menu: IconDef;
|
|
127
201
|
|
|
@@ -131,6 +205,9 @@ declare const mic: IconDef;
|
|
|
131
205
|
/** It wobbles from its tip, as if about to write. */
|
|
132
206
|
declare const pencil: IconDef;
|
|
133
207
|
|
|
208
|
+
/** A handset; pressed, it rings. */
|
|
209
|
+
declare const phone: IconDef;
|
|
210
|
+
|
|
134
211
|
/** A play triangle whose two halves part into the bars of pause. `on`: playing. */
|
|
135
212
|
declare const play: IconDef;
|
|
136
213
|
|
|
@@ -140,6 +217,18 @@ declare const plus: IconDef;
|
|
|
140
217
|
/** An arrow round a circle: a nudge with the pointer, a whole turn when pressed. */
|
|
141
218
|
declare const refresh: IconDef;
|
|
142
219
|
|
|
220
|
+
/** An arrow round a circle, the other way from `refresh`: pressed, a whole turn back. */
|
|
221
|
+
declare const retry: IconDef;
|
|
222
|
+
|
|
223
|
+
/** A lens; pressed, it gives a little and comes back. */
|
|
224
|
+
declare const search: IconDef;
|
|
225
|
+
|
|
226
|
+
/** A paper plane; pressed, it flies out and comes back. */
|
|
227
|
+
declare const send: IconDef;
|
|
228
|
+
|
|
229
|
+
/** Three sliders; pressed, their knobs move and come back. */
|
|
230
|
+
declare const settings: IconDef;
|
|
231
|
+
|
|
143
232
|
/** A shield with a tick; it beats with the pointer. */
|
|
144
233
|
declare const shield: IconDef;
|
|
145
234
|
|
|
@@ -159,7 +248,13 @@ declare const upload: IconDef;
|
|
|
159
248
|
|
|
160
249
|
declare const user: IconDef;
|
|
161
250
|
|
|
251
|
+
/** Two people; pressed, one hops and then the other. */
|
|
252
|
+
declare const users: IconDef;
|
|
253
|
+
|
|
162
254
|
/** A wand and its sparks, which flare one after another. */
|
|
163
255
|
declare const wand: IconDef;
|
|
164
256
|
|
|
165
|
-
|
|
257
|
+
/** The signal. `off`: no connection, the arcs fade and a stroke crosses them. */
|
|
258
|
+
declare const wifi: IconDef;
|
|
259
|
+
|
|
260
|
+
export { type Full, ICON_SPRINGS, type IconDef, type IconHandle, type IconOptions, type IconPart, type Kick, type MarkupOptions, type Pose, REST, arrowDown, arrowLeft, arrowRight, arrowUp, attachIcon, attrsOf, bell, book, calendar, card, chat, check, checkDouble, chevron, clock, close, copy, download, draws, error, exam, external, eye, filter, help, iconMarkup, image, inbox, info, list, lock, login, logout, map, medal, menu, mic, parse, partsMarkup, pencil, phone, play, plus, poseOf, refresh, retry, search, send, settings, shield, sidebar, stack, tick, trash, upload, user, users, validateIcon, wand, wifi };
|
package/dist/index.d.ts
CHANGED
|
@@ -46,7 +46,37 @@ interface IconDef {
|
|
|
46
46
|
/** Pushes by what sets them off: 'hover', 'press' or the name of a state it enters. */
|
|
47
47
|
kicks?: Readonly<Record<string, readonly Kick[]>>;
|
|
48
48
|
}
|
|
49
|
+
/** A pose with nothing left out. */
|
|
50
|
+
interface Full {
|
|
51
|
+
d: string;
|
|
52
|
+
x: number;
|
|
53
|
+
y: number;
|
|
54
|
+
r: number;
|
|
55
|
+
s: number;
|
|
56
|
+
draw: number;
|
|
57
|
+
o: number;
|
|
58
|
+
}
|
|
49
59
|
declare const REST = "rest";
|
|
60
|
+
/** The springs of the engine, the same on every platform: a change of state, a push, and a whole turn. */
|
|
61
|
+
declare const ICON_SPRINGS: {
|
|
62
|
+
readonly state: {
|
|
63
|
+
readonly stiffness: 320;
|
|
64
|
+
readonly damping: 26;
|
|
65
|
+
};
|
|
66
|
+
readonly push: {
|
|
67
|
+
readonly stiffness: 180;
|
|
68
|
+
readonly damping: 12;
|
|
69
|
+
};
|
|
70
|
+
readonly turn: {
|
|
71
|
+
readonly stiffness: 120;
|
|
72
|
+
readonly damping: 20;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
declare const poseOf: (part: IconPart, state: string | undefined, progress: number) => Full;
|
|
76
|
+
/** Whether its stroke is ever less than whole: it needs `pathLength`. */
|
|
77
|
+
declare const draws: (part: IconPart) => boolean;
|
|
78
|
+
/** The attributes of a part in a pose; null is «not there». The engine and the markup write the same ones. */
|
|
79
|
+
declare const attrsOf: (part: IconPart, pose: Full) => Record<"d" | "transform" | "stroke-dasharray" | "visibility" | "opacity", string | null>;
|
|
50
80
|
interface MarkupOptions {
|
|
51
81
|
state?: string;
|
|
52
82
|
/** 0–1, for the parts that follow it. */
|
|
@@ -59,6 +89,8 @@ interface MarkupOptions {
|
|
|
59
89
|
declare const partsMarkup: (def: IconDef, state?: string, progress?: number) => string;
|
|
60
90
|
/** An icon as an `<svg>`, in a state: what a server sends, and what the engine leaves at rest. */
|
|
61
91
|
declare const iconMarkup: (def: IconDef, { state, progress, label, className }?: MarkupOptions) => string;
|
|
92
|
+
/** An outline split into its commands and its numbers. */
|
|
93
|
+
declare const parse: (d: string) => Array<string | number>;
|
|
62
94
|
/** What is wrong with an icon; nothing when it follows the rules. */
|
|
63
95
|
declare function validateIcon(def: IconDef): string[];
|
|
64
96
|
|
|
@@ -91,27 +123,63 @@ declare const arrowUp: IconDef;
|
|
|
91
123
|
/** A bell that rings with the pointer. `on`: something is new, a dot says so and it rings. */
|
|
92
124
|
declare const bell: IconDef;
|
|
93
125
|
|
|
126
|
+
/** An open book. `on`: being read, the lines are written on its pages. */
|
|
127
|
+
declare const book: IconDef;
|
|
128
|
+
|
|
94
129
|
declare const calendar: IconDef;
|
|
95
130
|
|
|
131
|
+
/** A bank card; pressed, it slides as when it is swiped. */
|
|
132
|
+
declare const card: IconDef;
|
|
133
|
+
|
|
134
|
+
/** A speech bubble. `typing`: three dots appear inside it; pressed, it gives a little. */
|
|
135
|
+
declare const chat: IconDef;
|
|
136
|
+
|
|
96
137
|
/** A tick in a circle. From `off` the circle is drawn and then the tick is written. */
|
|
97
138
|
declare const check: IconDef;
|
|
98
139
|
|
|
140
|
+
/** Two ticks: seen. `single`: only the first, sent; going back to rest writes the second. */
|
|
141
|
+
declare const checkDouble: IconDef;
|
|
142
|
+
|
|
99
143
|
/** It points down; `on`: up. */
|
|
100
144
|
declare const chevron: IconDef;
|
|
101
145
|
|
|
146
|
+
/** A clock. `busy`: something is on its way, the minute hand goes round once and the hour hand moves on. */
|
|
147
|
+
declare const clock: IconDef;
|
|
148
|
+
|
|
102
149
|
/** A cross that turns a little with the pointer and shrinks when pressed. */
|
|
103
150
|
declare const close: IconDef;
|
|
104
151
|
|
|
105
152
|
/** Two sheets; `done`: the one behind goes and a tick is written on the one in front. */
|
|
106
153
|
declare const copy: IconDef;
|
|
107
154
|
|
|
155
|
+
/** An arrow into a tray. `busy`: the tray fills with the progress of the icon. `done`: the arrow gives way to a tick. */
|
|
156
|
+
declare const download: IconDef;
|
|
157
|
+
|
|
108
158
|
/** An exclamation in a circle. From `off` it is drawn, and it shakes once. */
|
|
109
159
|
declare const error: IconDef;
|
|
110
160
|
|
|
161
|
+
/** A test on a clipboard. `done`: its boxes are ticked. */
|
|
162
|
+
declare const exam: IconDef;
|
|
163
|
+
|
|
164
|
+
/** An arrow out of a box: it opens elsewhere. Pressed, the arrow goes out a little. */
|
|
165
|
+
declare const external: IconDef;
|
|
166
|
+
|
|
167
|
+
/** An eye. `off`: hidden, as a password is, the lid comes down and a stroke crosses it. */
|
|
168
|
+
declare const eye: IconDef;
|
|
169
|
+
|
|
170
|
+
/** A funnel. `on`: a filter is applied, a dot says so; pressed, it drips. */
|
|
171
|
+
declare const filter: IconDef;
|
|
172
|
+
|
|
173
|
+
/** A question in a circle; pressed, it tilts its head. */
|
|
174
|
+
declare const help: IconDef;
|
|
175
|
+
|
|
111
176
|
declare const image: IconDef;
|
|
112
177
|
|
|
113
178
|
declare const inbox: IconDef;
|
|
114
179
|
|
|
180
|
+
/** An i in a circle; pressed, the dot hops. */
|
|
181
|
+
declare const info: IconDef;
|
|
182
|
+
|
|
115
183
|
declare const list: IconDef;
|
|
116
184
|
|
|
117
185
|
/** A padlock. `open`: the shackle lifts and lets go on one side; with the pointer it lifts a little and drops. */
|
|
@@ -122,6 +190,12 @@ declare const login: IconDef;
|
|
|
122
190
|
|
|
123
191
|
declare const logout: IconDef;
|
|
124
192
|
|
|
193
|
+
/** A folded map. `on`: a route is drawn across it. */
|
|
194
|
+
declare const map: IconDef;
|
|
195
|
+
|
|
196
|
+
/** A first-place medal on its ribbon; pressed, it swings. */
|
|
197
|
+
declare const medal: IconDef;
|
|
198
|
+
|
|
125
199
|
/** Three lines that cross into a close mark. `on`: open. */
|
|
126
200
|
declare const menu: IconDef;
|
|
127
201
|
|
|
@@ -131,6 +205,9 @@ declare const mic: IconDef;
|
|
|
131
205
|
/** It wobbles from its tip, as if about to write. */
|
|
132
206
|
declare const pencil: IconDef;
|
|
133
207
|
|
|
208
|
+
/** A handset; pressed, it rings. */
|
|
209
|
+
declare const phone: IconDef;
|
|
210
|
+
|
|
134
211
|
/** A play triangle whose two halves part into the bars of pause. `on`: playing. */
|
|
135
212
|
declare const play: IconDef;
|
|
136
213
|
|
|
@@ -140,6 +217,18 @@ declare const plus: IconDef;
|
|
|
140
217
|
/** An arrow round a circle: a nudge with the pointer, a whole turn when pressed. */
|
|
141
218
|
declare const refresh: IconDef;
|
|
142
219
|
|
|
220
|
+
/** An arrow round a circle, the other way from `refresh`: pressed, a whole turn back. */
|
|
221
|
+
declare const retry: IconDef;
|
|
222
|
+
|
|
223
|
+
/** A lens; pressed, it gives a little and comes back. */
|
|
224
|
+
declare const search: IconDef;
|
|
225
|
+
|
|
226
|
+
/** A paper plane; pressed, it flies out and comes back. */
|
|
227
|
+
declare const send: IconDef;
|
|
228
|
+
|
|
229
|
+
/** Three sliders; pressed, their knobs move and come back. */
|
|
230
|
+
declare const settings: IconDef;
|
|
231
|
+
|
|
143
232
|
/** A shield with a tick; it beats with the pointer. */
|
|
144
233
|
declare const shield: IconDef;
|
|
145
234
|
|
|
@@ -159,7 +248,13 @@ declare const upload: IconDef;
|
|
|
159
248
|
|
|
160
249
|
declare const user: IconDef;
|
|
161
250
|
|
|
251
|
+
/** Two people; pressed, one hops and then the other. */
|
|
252
|
+
declare const users: IconDef;
|
|
253
|
+
|
|
162
254
|
/** A wand and its sparks, which flare one after another. */
|
|
163
255
|
declare const wand: IconDef;
|
|
164
256
|
|
|
165
|
-
|
|
257
|
+
/** The signal. `off`: no connection, the arcs fade and a stroke crosses them. */
|
|
258
|
+
declare const wifi: IconDef;
|
|
259
|
+
|
|
260
|
+
export { type Full, ICON_SPRINGS, type IconDef, type IconHandle, type IconOptions, type IconPart, type Kick, type MarkupOptions, type Pose, REST, arrowDown, arrowLeft, arrowRight, arrowUp, attachIcon, attrsOf, bell, book, calendar, card, chat, check, checkDouble, chevron, clock, close, copy, download, draws, error, exam, external, eye, filter, help, iconMarkup, image, inbox, info, list, lock, login, logout, map, medal, menu, mic, parse, partsMarkup, pencil, phone, play, plus, poseOf, refresh, retry, search, send, settings, shield, sidebar, stack, tick, trash, upload, user, users, validateIcon, wand, wifi };
|