@newtonedev/components 0.1.6 → 0.1.7
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/dist/index.cjs +243 -23
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +243 -24
- package/dist/index.js.map +1 -1
- package/dist/primitives/Icon/Icon.d.ts +1 -1
- package/dist/primitives/Icon/Icon.d.ts.map +1 -1
- package/dist/primitives/Icon/Icon.types.d.ts +7 -12
- package/dist/primitives/Icon/Icon.types.d.ts.map +1 -1
- package/dist/registry/icons.d.ts +7 -0
- package/dist/registry/icons.d.ts.map +1 -0
- package/dist/registry/index.d.ts +2 -0
- package/dist/registry/index.d.ts.map +1 -1
- package/dist/registry/registry.d.ts.map +1 -1
- package/dist/registry/types.d.ts +1 -1
- package/dist/registry/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +2 -0
- package/src/primitives/Icon/Icon.tsx +4 -6
- package/src/primitives/Icon/Icon.types.ts +7 -14
- package/src/registry/icons.ts +111 -0
- package/src/registry/index.ts +3 -0
- package/src/registry/registry.ts +12 -17
- package/src/registry/types.ts +1 -1
package/dist/index.cjs
CHANGED
|
@@ -780,9 +780,7 @@ function Icon({
|
|
|
780
780
|
opticalSize,
|
|
781
781
|
fill = 0,
|
|
782
782
|
color,
|
|
783
|
-
elevation = 1,
|
|
784
783
|
style,
|
|
785
|
-
onPress,
|
|
786
784
|
// Accessibility
|
|
787
785
|
accessibilityLabel,
|
|
788
786
|
// Testing & platform
|
|
@@ -790,7 +788,7 @@ function Icon({
|
|
|
790
788
|
nativeID,
|
|
791
789
|
ref
|
|
792
790
|
}) {
|
|
793
|
-
const tokens = useTokens(
|
|
791
|
+
const tokens = useTokens();
|
|
794
792
|
const iconStyle = React13.useMemo(() => {
|
|
795
793
|
const fontSize = size ?? tokens.typography.size.base;
|
|
796
794
|
const getOpticalSize = (size2) => {
|
|
@@ -802,7 +800,8 @@ function Icon({
|
|
|
802
800
|
const opsz = opticalSize ?? getOpticalSize(fontSize);
|
|
803
801
|
const iconColor = color ?? newtone.srgbToHex(tokens.textPrimary.srgb);
|
|
804
802
|
const fontFamily = `Material Symbols ${tokens.icons.variant.charAt(0).toUpperCase() + tokens.icons.variant.slice(1)}`;
|
|
805
|
-
const
|
|
803
|
+
const fillValue = typeof fill === "boolean" ? fill ? 1 : 0 : fill;
|
|
804
|
+
const fontVariationSettings = `'FILL' ${fillValue}, 'wght' ${tokens.icons.weight}, 'GRAD' ${tokens.icons.grade}, 'opsz' ${opsz}`;
|
|
806
805
|
return {
|
|
807
806
|
fontFamily,
|
|
808
807
|
fontSize,
|
|
@@ -828,8 +827,7 @@ function Icon({
|
|
|
828
827
|
nativeID,
|
|
829
828
|
accessibilityLabel,
|
|
830
829
|
importantForAccessibility: accessibilityLabel ? "yes" : "no-hide-descendants",
|
|
831
|
-
style: iconStyle
|
|
832
|
-
onPress
|
|
830
|
+
style: iconStyle
|
|
833
831
|
},
|
|
834
832
|
name
|
|
835
833
|
);
|
|
@@ -3298,40 +3296,35 @@ var COMPONENTS = [
|
|
|
3298
3296
|
name: "Icon",
|
|
3299
3297
|
importName: "Icon",
|
|
3300
3298
|
categoryId: "primitives",
|
|
3301
|
-
description: "Material Symbols icon with size
|
|
3299
|
+
description: "Material Symbols icon with size and fill",
|
|
3302
3300
|
hasChildren: false,
|
|
3303
3301
|
variants: [
|
|
3304
|
-
{ id: "
|
|
3305
|
-
{ id: "settings", label: "Settings", props: { name: "settings" } },
|
|
3306
|
-
{ id: "check", label: "Check", props: { name: "check" } },
|
|
3307
|
-
{ id: "add", label: "Add", props: { name: "add" } },
|
|
3308
|
-
{ id: "delete", label: "Delete", props: { name: "delete" } },
|
|
3309
|
-
{ id: "search", label: "Search", props: { name: "search" } },
|
|
3310
|
-
{ id: "filled", label: "Filled Icon", props: { name: "favorite", fill: 1 } },
|
|
3311
|
-
{ id: "large", label: "Large Icon", props: { name: "star", size: 32 } }
|
|
3302
|
+
{ id: "default", label: "Default", props: { name: "add" } }
|
|
3312
3303
|
],
|
|
3313
3304
|
editableProps: [
|
|
3314
3305
|
{
|
|
3315
3306
|
name: "name",
|
|
3316
3307
|
label: "Icon Name",
|
|
3317
3308
|
control: "text",
|
|
3318
|
-
defaultValue: "
|
|
3309
|
+
defaultValue: "add"
|
|
3319
3310
|
},
|
|
3320
3311
|
{
|
|
3321
3312
|
name: "size",
|
|
3322
3313
|
label: "Size",
|
|
3323
|
-
control: "
|
|
3314
|
+
control: "discrete-slider",
|
|
3315
|
+
options: [
|
|
3316
|
+
{ label: "20", value: 20 },
|
|
3317
|
+
{ label: "24", value: 24 },
|
|
3318
|
+
{ label: "40", value: 40 },
|
|
3319
|
+
{ label: "48", value: 48 }
|
|
3320
|
+
],
|
|
3324
3321
|
defaultValue: 24
|
|
3325
3322
|
},
|
|
3326
3323
|
{
|
|
3327
3324
|
name: "fill",
|
|
3328
3325
|
label: "Fill",
|
|
3329
|
-
control: "
|
|
3330
|
-
|
|
3331
|
-
{ label: "Outlined", value: 0 },
|
|
3332
|
-
{ label: "Filled", value: 1 }
|
|
3333
|
-
],
|
|
3334
|
-
defaultValue: 0
|
|
3326
|
+
control: "toggle",
|
|
3327
|
+
defaultValue: false
|
|
3335
3328
|
}
|
|
3336
3329
|
]
|
|
3337
3330
|
},
|
|
@@ -3535,6 +3528,232 @@ function formatProp(name, value) {
|
|
|
3535
3528
|
return `${name}={${JSON.stringify(value)}}`;
|
|
3536
3529
|
}
|
|
3537
3530
|
|
|
3531
|
+
// src/registry/icons.ts
|
|
3532
|
+
var ICON_CATALOG = [
|
|
3533
|
+
{
|
|
3534
|
+
id: "navigation",
|
|
3535
|
+
label: "Navigation",
|
|
3536
|
+
icons: [
|
|
3537
|
+
"home",
|
|
3538
|
+
"menu",
|
|
3539
|
+
"close",
|
|
3540
|
+
"arrow_back",
|
|
3541
|
+
"arrow_forward",
|
|
3542
|
+
"arrow_upward",
|
|
3543
|
+
"arrow_downward",
|
|
3544
|
+
"chevron_left",
|
|
3545
|
+
"chevron_right",
|
|
3546
|
+
"expand_more",
|
|
3547
|
+
"expand_less",
|
|
3548
|
+
"first_page",
|
|
3549
|
+
"last_page",
|
|
3550
|
+
"more_vert",
|
|
3551
|
+
"more_horiz",
|
|
3552
|
+
"unfold_more",
|
|
3553
|
+
"unfold_less",
|
|
3554
|
+
"subdirectory_arrow_right"
|
|
3555
|
+
]
|
|
3556
|
+
},
|
|
3557
|
+
{
|
|
3558
|
+
id: "actions",
|
|
3559
|
+
label: "Actions",
|
|
3560
|
+
icons: [
|
|
3561
|
+
"search",
|
|
3562
|
+
"settings",
|
|
3563
|
+
"done",
|
|
3564
|
+
"add",
|
|
3565
|
+
"remove",
|
|
3566
|
+
"delete",
|
|
3567
|
+
"edit",
|
|
3568
|
+
"save",
|
|
3569
|
+
"refresh",
|
|
3570
|
+
"undo",
|
|
3571
|
+
"redo",
|
|
3572
|
+
"download",
|
|
3573
|
+
"upload",
|
|
3574
|
+
"share",
|
|
3575
|
+
"print",
|
|
3576
|
+
"content_copy",
|
|
3577
|
+
"content_paste",
|
|
3578
|
+
"open_in_new",
|
|
3579
|
+
"launch",
|
|
3580
|
+
"drag_indicator",
|
|
3581
|
+
"tune",
|
|
3582
|
+
"sort",
|
|
3583
|
+
"filter_list"
|
|
3584
|
+
]
|
|
3585
|
+
},
|
|
3586
|
+
{
|
|
3587
|
+
id: "communication",
|
|
3588
|
+
label: "Communication",
|
|
3589
|
+
icons: [
|
|
3590
|
+
"mail",
|
|
3591
|
+
"chat",
|
|
3592
|
+
"call",
|
|
3593
|
+
"notifications",
|
|
3594
|
+
"forum",
|
|
3595
|
+
"send",
|
|
3596
|
+
"inbox",
|
|
3597
|
+
"drafts",
|
|
3598
|
+
"mark_email_read",
|
|
3599
|
+
"contact_mail",
|
|
3600
|
+
"alternate_email",
|
|
3601
|
+
"comment",
|
|
3602
|
+
"chat_bubble",
|
|
3603
|
+
"sms",
|
|
3604
|
+
"voicemail"
|
|
3605
|
+
]
|
|
3606
|
+
},
|
|
3607
|
+
{
|
|
3608
|
+
id: "content",
|
|
3609
|
+
label: "Content",
|
|
3610
|
+
icons: [
|
|
3611
|
+
"add_circle",
|
|
3612
|
+
"remove_circle",
|
|
3613
|
+
"check_circle",
|
|
3614
|
+
"cancel",
|
|
3615
|
+
"flag",
|
|
3616
|
+
"bookmark",
|
|
3617
|
+
"star",
|
|
3618
|
+
"favorite",
|
|
3619
|
+
"thumb_up",
|
|
3620
|
+
"thumb_down",
|
|
3621
|
+
"push_pin",
|
|
3622
|
+
"link",
|
|
3623
|
+
"link_off",
|
|
3624
|
+
"bolt",
|
|
3625
|
+
"label",
|
|
3626
|
+
"inventory_2",
|
|
3627
|
+
"visibility",
|
|
3628
|
+
"visibility_off"
|
|
3629
|
+
]
|
|
3630
|
+
},
|
|
3631
|
+
{
|
|
3632
|
+
id: "media",
|
|
3633
|
+
label: "Media",
|
|
3634
|
+
icons: [
|
|
3635
|
+
"play_arrow",
|
|
3636
|
+
"pause",
|
|
3637
|
+
"stop",
|
|
3638
|
+
"skip_next",
|
|
3639
|
+
"skip_previous",
|
|
3640
|
+
"fast_forward",
|
|
3641
|
+
"fast_rewind",
|
|
3642
|
+
"replay",
|
|
3643
|
+
"shuffle",
|
|
3644
|
+
"repeat",
|
|
3645
|
+
"volume_up",
|
|
3646
|
+
"volume_off",
|
|
3647
|
+
"music_note",
|
|
3648
|
+
"image",
|
|
3649
|
+
"photo_camera",
|
|
3650
|
+
"videocam",
|
|
3651
|
+
"mic"
|
|
3652
|
+
]
|
|
3653
|
+
},
|
|
3654
|
+
{
|
|
3655
|
+
id: "file",
|
|
3656
|
+
label: "File & Folder",
|
|
3657
|
+
icons: [
|
|
3658
|
+
"folder",
|
|
3659
|
+
"folder_open",
|
|
3660
|
+
"create_new_folder",
|
|
3661
|
+
"description",
|
|
3662
|
+
"file_copy",
|
|
3663
|
+
"attach_file",
|
|
3664
|
+
"cloud",
|
|
3665
|
+
"cloud_upload",
|
|
3666
|
+
"cloud_download",
|
|
3667
|
+
"cloud_off",
|
|
3668
|
+
"storage",
|
|
3669
|
+
"snippet_folder"
|
|
3670
|
+
]
|
|
3671
|
+
},
|
|
3672
|
+
{
|
|
3673
|
+
id: "social",
|
|
3674
|
+
label: "Social & People",
|
|
3675
|
+
icons: [
|
|
3676
|
+
"person",
|
|
3677
|
+
"group",
|
|
3678
|
+
"person_add",
|
|
3679
|
+
"person_remove",
|
|
3680
|
+
"people",
|
|
3681
|
+
"face",
|
|
3682
|
+
"sentiment_satisfied",
|
|
3683
|
+
"sentiment_dissatisfied",
|
|
3684
|
+
"public",
|
|
3685
|
+
"workspace_premium",
|
|
3686
|
+
"emoji_events",
|
|
3687
|
+
"military_tech"
|
|
3688
|
+
]
|
|
3689
|
+
},
|
|
3690
|
+
{
|
|
3691
|
+
id: "alerts",
|
|
3692
|
+
label: "Alerts & Status",
|
|
3693
|
+
icons: [
|
|
3694
|
+
"error",
|
|
3695
|
+
"warning",
|
|
3696
|
+
"info",
|
|
3697
|
+
"help",
|
|
3698
|
+
"check_circle",
|
|
3699
|
+
"report",
|
|
3700
|
+
"new_releases",
|
|
3701
|
+
"notification_important",
|
|
3702
|
+
"priority_high",
|
|
3703
|
+
"verified",
|
|
3704
|
+
"shield",
|
|
3705
|
+
"security",
|
|
3706
|
+
"lock",
|
|
3707
|
+
"lock_open"
|
|
3708
|
+
]
|
|
3709
|
+
},
|
|
3710
|
+
{
|
|
3711
|
+
id: "device",
|
|
3712
|
+
label: "Device & Hardware",
|
|
3713
|
+
icons: [
|
|
3714
|
+
"phone_android",
|
|
3715
|
+
"computer",
|
|
3716
|
+
"tablet_mac",
|
|
3717
|
+
"watch",
|
|
3718
|
+
"keyboard",
|
|
3719
|
+
"mouse",
|
|
3720
|
+
"headphones",
|
|
3721
|
+
"speaker",
|
|
3722
|
+
"monitor",
|
|
3723
|
+
"devices",
|
|
3724
|
+
"memory",
|
|
3725
|
+
"battery_full",
|
|
3726
|
+
"wifi",
|
|
3727
|
+
"bluetooth",
|
|
3728
|
+
"usb",
|
|
3729
|
+
"dark_mode",
|
|
3730
|
+
"light_mode"
|
|
3731
|
+
]
|
|
3732
|
+
},
|
|
3733
|
+
{
|
|
3734
|
+
id: "editor",
|
|
3735
|
+
label: "Editor & Formatting",
|
|
3736
|
+
icons: [
|
|
3737
|
+
"format_bold",
|
|
3738
|
+
"format_italic",
|
|
3739
|
+
"format_underlined",
|
|
3740
|
+
"format_list_bulleted",
|
|
3741
|
+
"format_list_numbered",
|
|
3742
|
+
"format_quote",
|
|
3743
|
+
"format_align_left",
|
|
3744
|
+
"format_align_center",
|
|
3745
|
+
"format_align_right",
|
|
3746
|
+
"title",
|
|
3747
|
+
"text_fields",
|
|
3748
|
+
"code",
|
|
3749
|
+
"palette",
|
|
3750
|
+
"color_lens",
|
|
3751
|
+
"brush",
|
|
3752
|
+
"auto_fix_high"
|
|
3753
|
+
]
|
|
3754
|
+
}
|
|
3755
|
+
];
|
|
3756
|
+
|
|
3538
3757
|
// src/fonts/googleFonts.ts
|
|
3539
3758
|
var GOOGLE_FONTS = [
|
|
3540
3759
|
// Sans-serif
|
|
@@ -3613,6 +3832,7 @@ exports.ERROR_DEFAULTS = ERROR_DEFAULTS;
|
|
|
3613
3832
|
exports.Frame = Frame;
|
|
3614
3833
|
exports.GOOGLE_FONTS = GOOGLE_FONTS;
|
|
3615
3834
|
exports.HueSlider = HueSlider;
|
|
3835
|
+
exports.ICON_CATALOG = ICON_CATALOG;
|
|
3616
3836
|
exports.Icon = Icon;
|
|
3617
3837
|
exports.NEUTRAL_DEFAULTS = NEUTRAL_DEFAULTS;
|
|
3618
3838
|
exports.Navbar = Navbar;
|