@propellerads/icon 8.1.0 → 10.0.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 +35 -1
- package/dist/index.css +1 -0
- package/dist/index.d.ts +31 -7
- package/dist/index.js +510 -508
- package/dist/index.js.map +1 -1
- package/package.json +14 -8
package/README.md
CHANGED
|
@@ -10,7 +10,41 @@
|
|
|
10
10
|
|
|
11
11
|
- `bun add @propellerads/icon` or `npm install @propellerads/icon -S`
|
|
12
12
|
|
|
13
|
+
The colours of `Color` come from [@propellerads/tokens](../Tokens/README.md), so the app needs its stylesheets:
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import '@propellerads/tokens/common.css';
|
|
17
|
+
import '@propellerads/tokens/propellerads.css'; // or monetag / propush / zeydoo
|
|
18
|
+
```
|
|
19
|
+
|
|
13
20
|
### How to use
|
|
14
21
|
|
|
15
22
|
- `import {AmericanExpress, Size, Color} from '@propellerads/icon';`
|
|
16
|
-
- And render `<AmericanExpress size={Size.Medium} color={Color.
|
|
23
|
+
- And render `<AmericanExpress size={Size.Medium} color={Color.Quiet}/>`
|
|
24
|
+
|
|
25
|
+
### Colours
|
|
26
|
+
|
|
27
|
+
Each `Color` is named after its token:
|
|
28
|
+
|
|
29
|
+
| `Color` | Token | Light theme | Dark theme | Old name |
|
|
30
|
+
|---|---|---|---|---|
|
|
31
|
+
| `DarkInversion` (default) | `--color-dark-inversion` | #000000 | #F2F2F2 | `Black` |
|
|
32
|
+
| `Quiet` | `--color-quiet` | #B3B3B3 | #737373 | `Gray` |
|
|
33
|
+
| `QuietText` | `--color-quiet-text` | #808080 | #999999 | `GrayDark` |
|
|
34
|
+
| `Light` | `--color-light` | #FFFFFF | #E6E6E6 | `White` |
|
|
35
|
+
| `Action` | `--color-action` | the brand's action colour | the same | `Blue` |
|
|
36
|
+
| `Success` | `--color-success` | #00B359 | the same | — |
|
|
37
|
+
| `Warning` | `--color-warning` | #FFAA00 | the same | — |
|
|
38
|
+
| `Danger` | `--color-danger` | #EE2B2B | the same | `Error` |
|
|
39
|
+
|
|
40
|
+
The old names still work and give the same colour; they are deprecated and go in the next major.
|
|
41
|
+
They turn over with the theme. `Action` is the brand's action colour from its stylesheet: to give a product
|
|
42
|
+
another one, set `--color-action` on `:root`. Any other string — a hex, `currentColor` — is used as is.
|
|
43
|
+
|
|
44
|
+
### Styles
|
|
45
|
+
|
|
46
|
+
The icon ships a small stylesheet and imports it itself: nothing to add next to the component, and no
|
|
47
|
+
styled-components. Its sizes are in pixels and work without the tokens; only the colours of `Color` need them.
|
|
48
|
+
|
|
49
|
+
The rules stay at the specificity of one class, so a product overrides the fill as it did before:
|
|
50
|
+
`.SomeBlock svg {fill: …}` wins, and so does `color="currentColor"` with the colour set on the parent.
|
package/dist/index.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:where(svg).icon{--icon-size:24px;width:var(--icon-size);height:var(--icon-size);fill:var(--icon-color);display:inline-flex}:where(svg).icon:hover{fill:var(--icon-hover-color,var(--icon-color))}:where(svg).icon--extra-small{--icon-size:12px}:where(svg).icon--small{--icon-size:16px}:where(svg).icon--medium-small{--icon-size:20px}:where(svg).icon--medium{--icon-size:24px}:where(svg).icon--large{--icon-size:32px}:where(svg).icon--extra-large{--icon-size:64px}
|
package/dist/index.d.ts
CHANGED
|
@@ -10,13 +10,33 @@ declare const Size: {
|
|
|
10
10
|
};
|
|
11
11
|
type Size = (typeof Size)[keyof typeof Size];
|
|
12
12
|
declare const Color: {
|
|
13
|
+
/** `--color-dark-inversion`: black in the light theme, near white in the dark. The default. */
|
|
14
|
+
readonly DarkInversion: "dark-inversion";
|
|
15
|
+
/** `--color-quiet`: icons and anything drawn like one. */
|
|
16
|
+
readonly Quiet: "quiet";
|
|
17
|
+
/** `--color-quiet-text`: the grey of supporting text. */
|
|
18
|
+
readonly QuietText: "quiet-text";
|
|
19
|
+
/** `--color-light`: on a coloured fill. */
|
|
20
|
+
readonly Light: "light";
|
|
21
|
+
/** `--color-action`: the brand's action colour. */
|
|
22
|
+
readonly Action: "action";
|
|
23
|
+
/** `--color-success`. */
|
|
24
|
+
readonly Success: "success";
|
|
25
|
+
/** `--color-warning`. */
|
|
26
|
+
readonly Warning: "warning";
|
|
27
|
+
/** `--color-danger`. */
|
|
28
|
+
readonly Danger: "danger";
|
|
29
|
+
/** @deprecated The same as `DarkInversion`: it is not black in the dark theme. */
|
|
13
30
|
readonly Black: "black";
|
|
31
|
+
/** @deprecated The same as `Light`. */
|
|
14
32
|
readonly White: "white";
|
|
33
|
+
/** @deprecated The same as `Action`. */
|
|
15
34
|
readonly Blue: "blue";
|
|
35
|
+
/** @deprecated The same as `Quiet`. */
|
|
16
36
|
readonly Gray: "gray";
|
|
37
|
+
/** @deprecated The same as `QuietText`. */
|
|
17
38
|
readonly GrayDark: "gray-dark";
|
|
18
|
-
|
|
19
|
-
readonly Warning: "warning";
|
|
39
|
+
/** @deprecated The same as `Danger`. */
|
|
20
40
|
readonly Error: "error";
|
|
21
41
|
};
|
|
22
42
|
type Color = (typeof Color)[keyof typeof Color];
|
|
@@ -113,10 +133,10 @@ declare const Chrome: FC<IconProps>;
|
|
|
113
133
|
|
|
114
134
|
declare const ChromeColored: FC<IconProps>;
|
|
115
135
|
|
|
116
|
-
declare const Claude: FC<IconProps>;
|
|
117
|
-
|
|
118
136
|
declare const CircleNotification: FC<IconProps>;
|
|
119
137
|
|
|
138
|
+
declare const Claude: FC<IconProps>;
|
|
139
|
+
|
|
120
140
|
declare const Close: FC<IconProps>;
|
|
121
141
|
|
|
122
142
|
declare const Code: FC<IconProps>;
|
|
@@ -127,10 +147,10 @@ declare const Comment: FC<IconProps>;
|
|
|
127
147
|
|
|
128
148
|
declare const Connector: FC<IconProps>;
|
|
129
149
|
|
|
130
|
-
declare const ContactSupport: FC<IconProps>;
|
|
131
|
-
|
|
132
150
|
declare const Constructor: FC<IconProps>;
|
|
133
151
|
|
|
152
|
+
declare const ContactSupport: FC<IconProps>;
|
|
153
|
+
|
|
134
154
|
declare const Copy: FC<IconProps>;
|
|
135
155
|
|
|
136
156
|
declare const Crop: FC<IconProps>;
|
|
@@ -141,6 +161,8 @@ declare const Cup: FC<IconProps>;
|
|
|
141
161
|
|
|
142
162
|
declare const Cursor: FC<IconProps>;
|
|
143
163
|
|
|
164
|
+
declare const DarkMode: FC<IconProps>;
|
|
165
|
+
|
|
144
166
|
declare const Date: FC<IconProps>;
|
|
145
167
|
|
|
146
168
|
declare const Delete: FC<IconProps>;
|
|
@@ -217,6 +239,8 @@ declare const Language: FC<IconProps>;
|
|
|
217
239
|
|
|
218
240
|
declare const LaughingSmile: FC<IconProps>;
|
|
219
241
|
|
|
242
|
+
declare const LightMode: FC<IconProps>;
|
|
243
|
+
|
|
220
244
|
declare const LineChart: FC<IconProps>;
|
|
221
245
|
|
|
222
246
|
declare const Link: FC<IconProps>;
|
|
@@ -397,5 +421,5 @@ declare const YandexMoney: FC<IconProps>;
|
|
|
397
421
|
|
|
398
422
|
declare const YouTube: FC<IconProps>;
|
|
399
423
|
|
|
400
|
-
export { Add, AddCircle, AddCircleBracket, AddFiled, AddImage, AirlineStops, AmericanExpress, Android, Announcement, Apps, Archive, ArrowDown, ArrowDownFull, ArrowLeft, ArrowLeftFull, ArrowPageFirst, ArrowPageLast, ArrowRight, ArrowRightFull, ArrowUp, ArrowUpFull, Assistance, AutoRenew, Bank, Bell, BellActive, BellCrossed, BellEmpty, Block, BlockedImage, Blocks, BorderAll, Build, Burger, Cancel, Card, Case, ChatGPT, Check, CheckCircle, CheckCircleOutline, Chrome, ChromeColored, CircleNotification, Claude, Close, Code, Color, Columns, Comment, Connector, Constructor, ContactSupport, Copy, Crop, Crown, Cup, Cursor, Date, Delete, DeleteForever, Desktop, Diamond, Download, DragIndicator, Draggable, Ebanx, Edit, Epayments, Error, Eye, Facebook, Favorite, File, Filter, FilterList, Fingerprint, Fire, FlightUp, Folder, Forth, Funnel, Gamepad, Geo, GiftBox, HourGlass, Http, InfinityIcon, Info, InfoOutline, Insert, Instagram, InterstitialTemplate, Lamp, Language, LaughingSmile, LineChart, Link, Linkedin, LocalAtm, Lock, LockOpen, LogOut, LpViews, MagicWand, Mail, MailFilled, ManageHistory, MissedCall, Monetization, Money, MoreHorizontal, MoreVertical, NoMoney, Offer, OfferFilled, OnlinePrediction, OpenInNew, Pause, Paypal, Pdf, People, Phone, PhotoCamera, Pie, PieOutline, Play, PlayCircleFilled, Pop, Postback, Present, PrivacyTip, Propeller, Push, Qiwi, QrCode, Question, QuestionMark, Receipt, Refresh, SaveAs, Search, Segment, Sent, Settings, Shield, ShoppingBag, ShoppingCart, Site, Size, Skrill, Skype, Smile, SnowFlake, Source, SpeedFast, Star, Stat, Stop, Support, SurveyOffer, SwipeDown, Tablet, Target, Telegram, Tell, ThumbUp, Time, Touch, Twitter, Unarchive, Update, Upload, User, UserAdd, UserCircle, Users, Verified, Vk, Wallet, Warning, WarningOutline, Webmoney, WhatsApp, Wordpress, YandexMoney, YouTube };
|
|
424
|
+
export { Add, AddCircle, AddCircleBracket, AddFiled, AddImage, AirlineStops, AmericanExpress, Android, Announcement, Apps, Archive, ArrowDown, ArrowDownFull, ArrowLeft, ArrowLeftFull, ArrowPageFirst, ArrowPageLast, ArrowRight, ArrowRightFull, ArrowUp, ArrowUpFull, Assistance, AutoRenew, Bank, Bell, BellActive, BellCrossed, BellEmpty, Block, BlockedImage, Blocks, BorderAll, Build, Burger, Cancel, Card, Case, ChatGPT, Check, CheckCircle, CheckCircleOutline, Chrome, ChromeColored, CircleNotification, Claude, Close, Code, Color, Columns, Comment, Connector, Constructor, ContactSupport, Copy, Crop, Crown, Cup, Cursor, DarkMode, Date, Delete, DeleteForever, Desktop, Diamond, Download, DragIndicator, Draggable, Ebanx, Edit, Epayments, Error, Eye, Facebook, Favorite, File, Filter, FilterList, Fingerprint, Fire, FlightUp, Folder, Forth, Funnel, Gamepad, Geo, GiftBox, HourGlass, Http, InfinityIcon, Info, InfoOutline, Insert, Instagram, InterstitialTemplate, Lamp, Language, LaughingSmile, LightMode, LineChart, Link, Linkedin, LocalAtm, Lock, LockOpen, LogOut, LpViews, MagicWand, Mail, MailFilled, ManageHistory, MissedCall, Monetization, Money, MoreHorizontal, MoreVertical, NoMoney, Offer, OfferFilled, OnlinePrediction, OpenInNew, Pause, Paypal, Pdf, People, Phone, PhotoCamera, Pie, PieOutline, Play, PlayCircleFilled, Pop, Postback, Present, PrivacyTip, Propeller, Push, Qiwi, QrCode, Question, QuestionMark, Receipt, Refresh, SaveAs, Search, Segment, Sent, Settings, Shield, ShoppingBag, ShoppingCart, Site, Size, Skrill, Skype, Smile, SnowFlake, Source, SpeedFast, Star, Stat, Stop, Support, SurveyOffer, SwipeDown, Tablet, Target, Telegram, Tell, ThumbUp, Time, Touch, Twitter, Unarchive, Update, Upload, User, UserAdd, UserCircle, Users, Verified, Vk, Wallet, Warning, WarningOutline, Webmoney, WhatsApp, Wordpress, YandexMoney, YouTube };
|
|
401
425
|
export type { IconProps };
|