@yahoo/uds-mobile 2.23.2 → 2.24.0-beta.1
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 +4 -12
- package/dist/bin/automated-config/dist/generated/generatedConfigs.mjs +92 -46
- package/dist/components/Button/buttonTheme.cjs +63 -23
- package/dist/components/Button/buttonTheme.d.cts +29 -12
- package/dist/components/Button/buttonTheme.d.cts.map +1 -1
- package/dist/components/Button/buttonTheme.d.ts +29 -12
- package/dist/components/Button/buttonTheme.d.ts.map +1 -1
- package/dist/components/Button/buttonTheme.js +62 -23
- package/dist/components/Button/buttonTheme.js.map +1 -1
- package/dist/components/Button.cjs +34 -13
- package/dist/components/Button.d.cts +7 -0
- package/dist/components/Button.d.cts.map +1 -1
- package/dist/components/Button.d.ts +7 -0
- package/dist/components/Button.d.ts.map +1 -1
- package/dist/components/Button.js +34 -13
- package/dist/components/Button.js.map +1 -1
- package/dist/components/Checkbox.cjs +30 -7
- package/dist/components/Checkbox.d.cts +7 -0
- package/dist/components/Checkbox.d.cts.map +1 -1
- package/dist/components/Checkbox.d.ts +7 -0
- package/dist/components/Checkbox.d.ts.map +1 -1
- package/dist/components/Checkbox.js +30 -7
- package/dist/components/Checkbox.js.map +1 -1
- package/dist/components/Chip/ChipBase.cjs +23 -9
- package/dist/components/Chip/ChipBase.d.cts.map +1 -1
- package/dist/components/Chip/ChipBase.d.ts.map +1 -1
- package/dist/components/Chip/ChipBase.js +23 -9
- package/dist/components/Chip/ChipBase.js.map +1 -1
- package/dist/components/Chip/ChipDismissible.cjs +3 -1
- package/dist/components/Chip/ChipDismissible.js +3 -1
- package/dist/components/Chip/ChipDismissible.js.map +1 -1
- package/dist/components/Chip/types.d.cts +7 -0
- package/dist/components/Chip/types.d.cts.map +1 -1
- package/dist/components/Chip/types.d.ts +7 -0
- package/dist/components/Chip/types.d.ts.map +1 -1
- package/dist/components/Icon.cjs +7 -3
- package/dist/components/Icon.d.cts +9 -1
- package/dist/components/Icon.d.cts.map +1 -1
- package/dist/components/Icon.d.ts +9 -1
- package/dist/components/Icon.d.ts.map +1 -1
- package/dist/components/Icon.js +7 -3
- package/dist/components/Icon.js.map +1 -1
- package/dist/components/IconButton.cjs +18 -8
- package/dist/components/IconButton.js +18 -8
- package/dist/components/IconButton.js.map +1 -1
- package/dist/components/Radio/Radio.cjs +29 -11
- package/dist/components/Radio/Radio.d.cts +7 -0
- package/dist/components/Radio/Radio.d.cts.map +1 -1
- package/dist/components/Radio/Radio.d.ts +7 -0
- package/dist/components/Radio/Radio.d.ts.map +1 -1
- package/dist/components/Radio/Radio.js +29 -11
- package/dist/components/Radio/Radio.js.map +1 -1
- package/dist/components/Switch.cjs +25 -2
- package/dist/components/Switch.d.cts +7 -0
- package/dist/components/Switch.d.cts.map +1 -1
- package/dist/components/Switch.d.ts +7 -0
- package/dist/components/Switch.d.ts.map +1 -1
- package/dist/components/Switch.js +25 -2
- package/dist/components/Switch.js.map +1 -1
- package/dist/components/Tabs/Tab.cjs +12 -2
- package/dist/components/Tabs/Tab.d.cts.map +1 -1
- package/dist/components/Tabs/Tab.d.ts.map +1 -1
- package/dist/components/Tabs/Tab.js +12 -2
- package/dist/components/Tabs/Tab.js.map +1 -1
- package/dist/components/Tabs/Tabs.cjs +8 -3
- package/dist/components/Tabs/Tabs.d.cts +9 -1
- package/dist/components/Tabs/Tabs.d.cts.map +1 -1
- package/dist/components/Tabs/Tabs.d.ts +9 -1
- package/dist/components/Tabs/Tabs.d.ts.map +1 -1
- package/dist/components/Tabs/Tabs.js +8 -3
- package/dist/components/Tabs/Tabs.js.map +1 -1
- package/dist/components/Tabs/tabsContexts.d.cts +2 -0
- package/dist/components/Tabs/tabsContexts.d.cts.map +1 -1
- package/dist/components/Tabs/tabsContexts.d.ts +2 -0
- package/dist/components/Tabs/tabsContexts.d.ts.map +1 -1
- package/dist/components/Tabs/tabsContexts.js.map +1 -1
- package/dist/components/Text.cjs +4 -1
- package/dist/components/Text.d.cts +10 -2
- package/dist/components/Text.d.cts.map +1 -1
- package/dist/components/Text.d.ts +10 -2
- package/dist/components/Text.d.ts.map +1 -1
- package/dist/components/Text.js +4 -1
- package/dist/components/Text.js.map +1 -1
- package/dist/components/UDSProvider.cjs +6 -2
- package/dist/components/UDSProvider.d.cts +8 -0
- package/dist/components/UDSProvider.d.cts.map +1 -1
- package/dist/components/UDSProvider.d.ts +8 -0
- package/dist/components/UDSProvider.d.ts.map +1 -1
- package/dist/components/UDSProvider.js +6 -2
- package/dist/components/UDSProvider.js.map +1 -1
- package/dist/fontScaling/FontScalingContext.cjs +35 -0
- package/dist/fontScaling/FontScalingContext.d.cts +38 -0
- package/dist/fontScaling/FontScalingContext.d.cts.map +1 -0
- package/dist/fontScaling/FontScalingContext.d.ts +38 -0
- package/dist/fontScaling/FontScalingContext.d.ts.map +1 -0
- package/dist/fontScaling/FontScalingContext.js +34 -0
- package/dist/fontScaling/FontScalingContext.js.map +1 -0
- package/dist/fontScaling/constants.cjs +72 -0
- package/dist/fontScaling/constants.d.cts +49 -0
- package/dist/fontScaling/constants.d.cts.map +1 -0
- package/dist/fontScaling/constants.d.ts +49 -0
- package/dist/fontScaling/constants.d.ts.map +1 -0
- package/dist/fontScaling/constants.js +70 -0
- package/dist/fontScaling/constants.js.map +1 -0
- package/dist/fontScaling/index.cjs +13 -0
- package/dist/fontScaling/index.d.cts +8 -0
- package/dist/fontScaling/index.d.ts +8 -0
- package/dist/fontScaling/index.js +6 -0
- package/dist/fontScaling/resolveMaxFontSizeMultiplier.cjs +38 -0
- package/dist/fontScaling/resolveMaxFontSizeMultiplier.d.cts +36 -0
- package/dist/fontScaling/resolveMaxFontSizeMultiplier.d.cts.map +1 -0
- package/dist/fontScaling/resolveMaxFontSizeMultiplier.d.ts +36 -0
- package/dist/fontScaling/resolveMaxFontSizeMultiplier.d.ts.map +1 -0
- package/dist/fontScaling/resolveMaxFontSizeMultiplier.js +39 -0
- package/dist/fontScaling/resolveMaxFontSizeMultiplier.js.map +1 -0
- package/dist/fontScaling/types.cjs +1 -0
- package/dist/fontScaling/types.d.cts +51 -0
- package/dist/fontScaling/types.d.cts.map +1 -0
- package/dist/fontScaling/types.d.ts +51 -0
- package/dist/fontScaling/types.d.ts.map +1 -0
- package/dist/fontScaling/types.js +1 -0
- package/dist/fontScaling/useFontScale.cjs +32 -0
- package/dist/fontScaling/useFontScale.d.cts +18 -0
- package/dist/fontScaling/useFontScale.d.cts.map +1 -0
- package/dist/fontScaling/useFontScale.d.ts +18 -0
- package/dist/fontScaling/useFontScale.d.ts.map +1 -0
- package/dist/fontScaling/useFontScale.js +32 -0
- package/dist/fontScaling/useFontScale.js.map +1 -0
- package/dist/fontScaling/useMaxFontSizeMultiplier.cjs +24 -0
- package/dist/fontScaling/useMaxFontSizeMultiplier.d.cts +16 -0
- package/dist/fontScaling/useMaxFontSizeMultiplier.d.cts.map +1 -0
- package/dist/fontScaling/useMaxFontSizeMultiplier.d.ts +16 -0
- package/dist/fontScaling/useMaxFontSizeMultiplier.d.ts.map +1 -0
- package/dist/fontScaling/useMaxFontSizeMultiplier.js +24 -0
- package/dist/fontScaling/useMaxFontSizeMultiplier.js.map +1 -0
- package/dist/jest/mocks/react-native.cjs +19 -4
- package/dist/jest/mocks/react-native.d.cts +8 -5
- package/dist/jest/mocks/react-native.d.cts.map +1 -1
- package/dist/jest/mocks/react-native.d.ts +8 -5
- package/dist/jest/mocks/react-native.d.ts.map +1 -1
- package/dist/jest/mocks/react-native.js +18 -5
- package/dist/jest/mocks/react-native.js.map +1 -1
- package/dist/jest/mocks/styles.cjs +14 -0
- package/dist/jest/mocks/styles.d.cts.map +1 -1
- package/dist/jest/mocks/styles.d.ts.map +1 -1
- package/dist/jest/mocks/styles.js +14 -0
- package/dist/jest/mocks/styles.js.map +1 -1
- package/dist/jest/setup.cjs +4 -0
- package/dist/jest/setup.d.cts.map +1 -1
- package/dist/jest/setup.d.ts.map +1 -1
- package/dist/jest/setup.js +4 -0
- package/dist/jest/setup.js.map +1 -1
- package/dist/mobile/generated/fontMetrics.cjs +1166 -0
- package/dist/mobile/generated/fontMetrics.js +1168 -0
- package/dist/mobile/generated/fontMetrics.js.map +1 -0
- package/dist/portal.d.cts.map +1 -1
- package/dist/portal.d.ts.map +1 -1
- package/dist/portal.js.map +1 -1
- package/dist/types/dist/index.d.cts.map +1 -1
- package/dist/types/dist/index.d.ts.map +1 -1
- package/fonts/uds-icons.ttf +0 -0
- package/generated/fontMetrics.ts +1173 -0
- package/generated/styles.d.ts +5 -28
- package/generated/unistyles.d.ts +0 -27
- package/package.json +11 -1
package/README.md
CHANGED
|
@@ -546,17 +546,11 @@ The CLI generates a TypeScript file containing:
|
|
|
546
546
|
```typescript
|
|
547
547
|
// AUTO-GENERATED FILE. DO NOT EDIT.
|
|
548
548
|
export const themes = {
|
|
549
|
-
light: {
|
|
550
|
-
|
|
551
|
-
},
|
|
552
|
-
dark: {
|
|
553
|
-
/* ... */
|
|
554
|
-
},
|
|
549
|
+
light: {/* ... */},
|
|
550
|
+
dark: {/* ... */},
|
|
555
551
|
};
|
|
556
552
|
|
|
557
|
-
export const breakpoints = {
|
|
558
|
-
/* ... */
|
|
559
|
-
};
|
|
553
|
+
export const breakpoints = {/* ... */};
|
|
560
554
|
```
|
|
561
555
|
|
|
562
556
|
## Testing
|
|
@@ -642,9 +636,7 @@ import { mocks } from '@yahoo/uds-mobile/jest';
|
|
|
642
636
|
jest.mock('react-native-unistyles', () => ({
|
|
643
637
|
...mocks.unistyles,
|
|
644
638
|
useUnistyles: () => ({
|
|
645
|
-
theme: {
|
|
646
|
-
/* custom theme */
|
|
647
|
-
},
|
|
639
|
+
theme: {/* custom theme */},
|
|
648
640
|
rt: { themeName: 'dark' },
|
|
649
641
|
}),
|
|
650
642
|
}));
|
|
@@ -2694,7 +2694,8 @@ const AvatarConfig = {
|
|
|
2694
2694
|
"md",
|
|
2695
2695
|
"lg"
|
|
2696
2696
|
]]
|
|
2697
|
-
} }
|
|
2697
|
+
} },
|
|
2698
|
+
userOverridableProperties: ["iconSize"]
|
|
2698
2699
|
},
|
|
2699
2700
|
root: {
|
|
2700
2701
|
label: "root",
|
|
@@ -2931,7 +2932,8 @@ const BadgeConfig = {
|
|
|
2931
2932
|
"md",
|
|
2932
2933
|
"lg"
|
|
2933
2934
|
]]
|
|
2934
|
-
} }
|
|
2935
|
+
} },
|
|
2936
|
+
userOverridableProperties: ["iconSize"]
|
|
2935
2937
|
},
|
|
2936
2938
|
root: {
|
|
2937
2939
|
label: "root",
|
|
@@ -3532,7 +3534,8 @@ const BadgeConfig = {
|
|
|
3532
3534
|
"always/accent"
|
|
3533
3535
|
]
|
|
3534
3536
|
]
|
|
3535
|
-
} }
|
|
3537
|
+
} },
|
|
3538
|
+
userOverridableProperties: ["color"]
|
|
3536
3539
|
},
|
|
3537
3540
|
root: {
|
|
3538
3541
|
label: "root",
|
|
@@ -4881,7 +4884,8 @@ const BannerConfig = {
|
|
|
4881
4884
|
"md",
|
|
4882
4885
|
"lg"
|
|
4883
4886
|
]]
|
|
4884
|
-
} }
|
|
4887
|
+
} },
|
|
4888
|
+
userOverridableProperties: ["iconSize"]
|
|
4885
4889
|
},
|
|
4886
4890
|
root: {
|
|
4887
4891
|
label: "root",
|
|
@@ -5887,7 +5891,8 @@ const BannerConfig = {
|
|
|
5887
5891
|
"always/accent"
|
|
5888
5892
|
]
|
|
5889
5893
|
]
|
|
5890
|
-
} }
|
|
5894
|
+
} },
|
|
5895
|
+
userOverridableProperties: ["color"]
|
|
5891
5896
|
},
|
|
5892
5897
|
root: {
|
|
5893
5898
|
label: "root",
|
|
@@ -8841,7 +8846,8 @@ const ButtonConfig = {
|
|
|
8841
8846
|
"md",
|
|
8842
8847
|
"lg"
|
|
8843
8848
|
]]
|
|
8844
|
-
} }
|
|
8849
|
+
} },
|
|
8850
|
+
userOverridableProperties: ["iconSize"]
|
|
8845
8851
|
},
|
|
8846
8852
|
root: {
|
|
8847
8853
|
label: "root",
|
|
@@ -9456,7 +9462,8 @@ const ButtonConfig = {
|
|
|
9456
9462
|
"always/accent"
|
|
9457
9463
|
]
|
|
9458
9464
|
]
|
|
9459
|
-
} }
|
|
9465
|
+
} },
|
|
9466
|
+
userOverridableProperties: ["color"]
|
|
9460
9467
|
},
|
|
9461
9468
|
root: {
|
|
9462
9469
|
label: "root",
|
|
@@ -13187,7 +13194,8 @@ const ChipConfig = {
|
|
|
13187
13194
|
"always/accent"
|
|
13188
13195
|
]
|
|
13189
13196
|
]
|
|
13190
|
-
} }
|
|
13197
|
+
} },
|
|
13198
|
+
userOverridableProperties: ["color"]
|
|
13191
13199
|
},
|
|
13192
13200
|
root: {
|
|
13193
13201
|
label: "root",
|
|
@@ -14740,7 +14748,8 @@ const ChipConfig = {
|
|
|
14740
14748
|
"always/accent"
|
|
14741
14749
|
]
|
|
14742
14750
|
]
|
|
14743
|
-
} }
|
|
14751
|
+
} },
|
|
14752
|
+
userOverridableProperties: ["color"]
|
|
14744
14753
|
},
|
|
14745
14754
|
root: {
|
|
14746
14755
|
label: "root",
|
|
@@ -16292,7 +16301,8 @@ const ChipConfig = {
|
|
|
16292
16301
|
"always/accent"
|
|
16293
16302
|
]
|
|
16294
16303
|
]
|
|
16295
|
-
} }
|
|
16304
|
+
} },
|
|
16305
|
+
userOverridableProperties: ["color"]
|
|
16296
16306
|
},
|
|
16297
16307
|
root: {
|
|
16298
16308
|
label: "root",
|
|
@@ -17497,7 +17507,8 @@ const ChipConfig = {
|
|
|
17497
17507
|
"md",
|
|
17498
17508
|
"lg"
|
|
17499
17509
|
]]
|
|
17500
|
-
} }
|
|
17510
|
+
} },
|
|
17511
|
+
userOverridableProperties: ["iconSize"]
|
|
17501
17512
|
},
|
|
17502
17513
|
root: {
|
|
17503
17514
|
label: "root",
|
|
@@ -18635,7 +18646,8 @@ const IconButtonConfig = {
|
|
|
18635
18646
|
"md",
|
|
18636
18647
|
"lg"
|
|
18637
18648
|
]]
|
|
18638
|
-
} }
|
|
18649
|
+
} },
|
|
18650
|
+
userOverridableProperties: ["iconSize"]
|
|
18639
18651
|
},
|
|
18640
18652
|
root: {
|
|
18641
18653
|
label: "root",
|
|
@@ -18771,7 +18783,8 @@ const InputConfig = {
|
|
|
18771
18783
|
"md",
|
|
18772
18784
|
"lg"
|
|
18773
18785
|
]]
|
|
18774
|
-
} }
|
|
18786
|
+
} },
|
|
18787
|
+
userOverridableProperties: ["iconSize"]
|
|
18775
18788
|
},
|
|
18776
18789
|
helperIcon: {
|
|
18777
18790
|
label: "helperIcon",
|
|
@@ -18789,7 +18802,8 @@ const InputConfig = {
|
|
|
18789
18802
|
"md",
|
|
18790
18803
|
"lg"
|
|
18791
18804
|
]]
|
|
18792
|
-
} }
|
|
18805
|
+
} },
|
|
18806
|
+
userOverridableProperties: ["iconSize"]
|
|
18793
18807
|
},
|
|
18794
18808
|
helperText: {
|
|
18795
18809
|
label: "helperText",
|
|
@@ -19227,7 +19241,8 @@ const InputConfig = {
|
|
|
19227
19241
|
"md",
|
|
19228
19242
|
"lg"
|
|
19229
19243
|
]]
|
|
19230
|
-
} }
|
|
19244
|
+
} },
|
|
19245
|
+
userOverridableProperties: ["iconSize"]
|
|
19231
19246
|
}
|
|
19232
19247
|
},
|
|
19233
19248
|
options: ["md", "lg"]
|
|
@@ -19609,7 +19624,8 @@ const InputConfig = {
|
|
|
19609
19624
|
"always/accent"
|
|
19610
19625
|
]
|
|
19611
19626
|
]
|
|
19612
|
-
} }
|
|
19627
|
+
} },
|
|
19628
|
+
userOverridableProperties: ["color"]
|
|
19613
19629
|
},
|
|
19614
19630
|
helperIcon: {
|
|
19615
19631
|
atomicStates: [
|
|
@@ -19979,7 +19995,8 @@ const InputConfig = {
|
|
|
19979
19995
|
"always/accent"
|
|
19980
19996
|
]
|
|
19981
19997
|
]
|
|
19982
|
-
} }
|
|
19998
|
+
} },
|
|
19999
|
+
userOverridableProperties: ["color"]
|
|
19983
20000
|
},
|
|
19984
20001
|
helperText: {
|
|
19985
20002
|
atomicStates: [
|
|
@@ -22932,7 +22949,8 @@ const InputConfig = {
|
|
|
22932
22949
|
"always/accent"
|
|
22933
22950
|
]
|
|
22934
22951
|
]
|
|
22935
|
-
} }
|
|
22952
|
+
} },
|
|
22953
|
+
userOverridableProperties: ["color"]
|
|
22936
22954
|
}
|
|
22937
22955
|
},
|
|
22938
22956
|
options: ["default"]
|
|
@@ -22984,7 +23002,8 @@ const LinkConfig = {
|
|
|
22984
23002
|
"md",
|
|
22985
23003
|
"lg"
|
|
22986
23004
|
]]
|
|
22987
|
-
} }
|
|
23005
|
+
} },
|
|
23006
|
+
userOverridableProperties: ["iconSize"]
|
|
22988
23007
|
},
|
|
22989
23008
|
root: {
|
|
22990
23009
|
label: "root",
|
|
@@ -23455,7 +23474,8 @@ const LinkConfig = {
|
|
|
23455
23474
|
"always/accent"
|
|
23456
23475
|
]
|
|
23457
23476
|
]
|
|
23458
|
-
} }
|
|
23477
|
+
} },
|
|
23478
|
+
userOverridableProperties: ["color"]
|
|
23459
23479
|
},
|
|
23460
23480
|
iconStart: {
|
|
23461
23481
|
label: "iconStart",
|
|
@@ -23824,7 +23844,8 @@ const LinkConfig = {
|
|
|
23824
23844
|
"always/accent"
|
|
23825
23845
|
]
|
|
23826
23846
|
]
|
|
23827
|
-
} }
|
|
23847
|
+
} },
|
|
23848
|
+
userOverridableProperties: ["color"]
|
|
23828
23849
|
},
|
|
23829
23850
|
root: {
|
|
23830
23851
|
label: "root",
|
|
@@ -26023,7 +26044,8 @@ const MenuItemConfig = {
|
|
|
26023
26044
|
"always/accent"
|
|
26024
26045
|
]
|
|
26025
26046
|
]
|
|
26026
|
-
} }
|
|
26047
|
+
} },
|
|
26048
|
+
userOverridableProperties: ["color"]
|
|
26027
26049
|
},
|
|
26028
26050
|
root: {
|
|
26029
26051
|
label: "root",
|
|
@@ -27128,7 +27150,8 @@ const MenuItemConfig = {
|
|
|
27128
27150
|
"always/accent"
|
|
27129
27151
|
]
|
|
27130
27152
|
]
|
|
27131
|
-
} }
|
|
27153
|
+
} },
|
|
27154
|
+
userOverridableProperties: ["color"]
|
|
27132
27155
|
},
|
|
27133
27156
|
root: {
|
|
27134
27157
|
label: "root",
|
|
@@ -27853,7 +27876,8 @@ const MenuItemConfig = {
|
|
|
27853
27876
|
"always/accent"
|
|
27854
27877
|
]
|
|
27855
27878
|
]
|
|
27856
|
-
} }
|
|
27879
|
+
} },
|
|
27880
|
+
userOverridableProperties: ["color"]
|
|
27857
27881
|
},
|
|
27858
27882
|
text: {
|
|
27859
27883
|
label: "text",
|
|
@@ -28302,7 +28326,8 @@ const MenuItemConfig = {
|
|
|
28302
28326
|
"md",
|
|
28303
28327
|
"lg"
|
|
28304
28328
|
]]
|
|
28305
|
-
} }
|
|
28329
|
+
} },
|
|
28330
|
+
userOverridableProperties: ["iconSize"]
|
|
28306
28331
|
},
|
|
28307
28332
|
root: {
|
|
28308
28333
|
label: "root",
|
|
@@ -28321,7 +28346,8 @@ const MenuItemConfig = {
|
|
|
28321
28346
|
"md",
|
|
28322
28347
|
"lg"
|
|
28323
28348
|
]]
|
|
28324
|
-
} }
|
|
28349
|
+
} },
|
|
28350
|
+
userOverridableProperties: ["iconSize"]
|
|
28325
28351
|
},
|
|
28326
28352
|
text: {
|
|
28327
28353
|
label: "text",
|
|
@@ -28499,7 +28525,8 @@ const ModalConfig = {
|
|
|
28499
28525
|
"md",
|
|
28500
28526
|
"lg"
|
|
28501
28527
|
]]
|
|
28502
|
-
} }
|
|
28528
|
+
} },
|
|
28529
|
+
userOverridableProperties: ["iconSize"]
|
|
28503
28530
|
},
|
|
28504
28531
|
closeIconContainer: {
|
|
28505
28532
|
label: "closeIconContainer",
|
|
@@ -29327,7 +29354,8 @@ const ModalConfig = {
|
|
|
29327
29354
|
"always/accent"
|
|
29328
29355
|
]
|
|
29329
29356
|
]
|
|
29330
|
-
} }
|
|
29357
|
+
} },
|
|
29358
|
+
userOverridableProperties: ["color"]
|
|
29331
29359
|
},
|
|
29332
29360
|
description: {
|
|
29333
29361
|
label: "description",
|
|
@@ -31204,7 +31232,8 @@ const PaddleNavConfig = {
|
|
|
31204
31232
|
"md",
|
|
31205
31233
|
"lg"
|
|
31206
31234
|
]]
|
|
31207
|
-
} }
|
|
31235
|
+
} },
|
|
31236
|
+
userOverridableProperties: ["iconSize"]
|
|
31208
31237
|
},
|
|
31209
31238
|
root: {
|
|
31210
31239
|
label: "root",
|
|
@@ -32215,7 +32244,8 @@ const PaddleNavConfig = {
|
|
|
32215
32244
|
"always/accent"
|
|
32216
32245
|
]
|
|
32217
32246
|
]
|
|
32218
|
-
} }
|
|
32247
|
+
} },
|
|
32248
|
+
userOverridableProperties: ["color"]
|
|
32219
32249
|
},
|
|
32220
32250
|
root: {
|
|
32221
32251
|
label: "root",
|
|
@@ -32657,7 +32687,8 @@ const PaginationConfig = {
|
|
|
32657
32687
|
"md",
|
|
32658
32688
|
"lg"
|
|
32659
32689
|
]]
|
|
32660
|
-
} }
|
|
32690
|
+
} },
|
|
32691
|
+
userOverridableProperties: ["iconSize"]
|
|
32661
32692
|
},
|
|
32662
32693
|
item: {
|
|
32663
32694
|
label: "item",
|
|
@@ -34031,7 +34062,8 @@ const PopoverConfig = {
|
|
|
34031
34062
|
"md",
|
|
34032
34063
|
"lg"
|
|
34033
34064
|
]]
|
|
34034
|
-
} }
|
|
34065
|
+
} },
|
|
34066
|
+
userOverridableProperties: ["iconSize"]
|
|
34035
34067
|
},
|
|
34036
34068
|
closeIconContainer: {
|
|
34037
34069
|
label: "closeIconContainer",
|
|
@@ -34670,7 +34702,8 @@ const PopoverConfig = {
|
|
|
34670
34702
|
"always/accent"
|
|
34671
34703
|
]
|
|
34672
34704
|
]
|
|
34673
|
-
} }
|
|
34705
|
+
} },
|
|
34706
|
+
userOverridableProperties: ["color"]
|
|
34674
34707
|
},
|
|
34675
34708
|
root: {
|
|
34676
34709
|
label: "root",
|
|
@@ -39992,7 +40025,8 @@ const SelectItemConfig = {
|
|
|
39992
40025
|
"always/accent"
|
|
39993
40026
|
]
|
|
39994
40027
|
]
|
|
39995
|
-
} }
|
|
40028
|
+
} },
|
|
40029
|
+
userOverridableProperties: ["color"]
|
|
39996
40030
|
},
|
|
39997
40031
|
root: {
|
|
39998
40032
|
label: "root",
|
|
@@ -40755,7 +40789,8 @@ const SelectItemConfig = {
|
|
|
40755
40789
|
"md",
|
|
40756
40790
|
"lg"
|
|
40757
40791
|
]]
|
|
40758
|
-
} }
|
|
40792
|
+
} },
|
|
40793
|
+
userOverridableProperties: ["iconSize"]
|
|
40759
40794
|
},
|
|
40760
40795
|
root: {
|
|
40761
40796
|
label: "root",
|
|
@@ -40774,7 +40809,8 @@ const SelectItemConfig = {
|
|
|
40774
40809
|
"md",
|
|
40775
40810
|
"lg"
|
|
40776
40811
|
]]
|
|
40777
|
-
} }
|
|
40812
|
+
} },
|
|
40813
|
+
userOverridableProperties: ["iconSize"]
|
|
40778
40814
|
},
|
|
40779
40815
|
text: {
|
|
40780
40816
|
label: "text",
|
|
@@ -40961,7 +40997,8 @@ const SwitchConfig = {
|
|
|
40961
40997
|
"md",
|
|
40962
40998
|
"lg"
|
|
40963
40999
|
]]
|
|
40964
|
-
} }
|
|
41000
|
+
} },
|
|
41001
|
+
userOverridableProperties: ["iconSize"]
|
|
40965
41002
|
},
|
|
40966
41003
|
root: {
|
|
40967
41004
|
label: "root",
|
|
@@ -42092,7 +42129,8 @@ const SwitchConfig = {
|
|
|
42092
42129
|
"muted",
|
|
42093
42130
|
"on-color"
|
|
42094
42131
|
]]
|
|
42095
|
-
} }
|
|
42132
|
+
} },
|
|
42133
|
+
userOverridableProperties: ["color"]
|
|
42096
42134
|
},
|
|
42097
42135
|
root: {
|
|
42098
42136
|
label: "root",
|
|
@@ -43253,7 +43291,8 @@ const TabConfig = {
|
|
|
43253
43291
|
"md",
|
|
43254
43292
|
"lg"
|
|
43255
43293
|
]]
|
|
43256
|
-
} }
|
|
43294
|
+
} },
|
|
43295
|
+
userOverridableProperties: ["iconSize"]
|
|
43257
43296
|
},
|
|
43258
43297
|
root: {
|
|
43259
43298
|
label: "root",
|
|
@@ -43819,7 +43858,8 @@ const TabConfig = {
|
|
|
43819
43858
|
"always/accent"
|
|
43820
43859
|
]
|
|
43821
43860
|
]
|
|
43822
|
-
} }
|
|
43861
|
+
} },
|
|
43862
|
+
userOverridableProperties: ["color"]
|
|
43823
43863
|
},
|
|
43824
43864
|
root: {
|
|
43825
43865
|
label: "root",
|
|
@@ -46447,7 +46487,8 @@ const ToastConfig = {
|
|
|
46447
46487
|
"md",
|
|
46448
46488
|
"lg"
|
|
46449
46489
|
]]
|
|
46450
|
-
} }
|
|
46490
|
+
} },
|
|
46491
|
+
userOverridableProperties: ["iconSize"]
|
|
46451
46492
|
},
|
|
46452
46493
|
icon: {
|
|
46453
46494
|
label: "icon",
|
|
@@ -46462,7 +46503,8 @@ const ToastConfig = {
|
|
|
46462
46503
|
"md",
|
|
46463
46504
|
"lg"
|
|
46464
46505
|
]]
|
|
46465
|
-
} }
|
|
46506
|
+
} },
|
|
46507
|
+
userOverridableProperties: ["iconSize"]
|
|
46466
46508
|
},
|
|
46467
46509
|
label: {
|
|
46468
46510
|
label: "label",
|
|
@@ -47129,7 +47171,8 @@ const ToastConfig = {
|
|
|
47129
47171
|
"always/accent"
|
|
47130
47172
|
]
|
|
47131
47173
|
]
|
|
47132
|
-
} }
|
|
47174
|
+
} },
|
|
47175
|
+
userOverridableProperties: ["color"]
|
|
47133
47176
|
},
|
|
47134
47177
|
icon: {
|
|
47135
47178
|
label: "icon",
|
|
@@ -47517,7 +47560,8 @@ const ToastConfig = {
|
|
|
47517
47560
|
"multicolor"
|
|
47518
47561
|
]]
|
|
47519
47562
|
}
|
|
47520
|
-
}
|
|
47563
|
+
},
|
|
47564
|
+
userOverridableProperties: ["color"]
|
|
47521
47565
|
},
|
|
47522
47566
|
root: {
|
|
47523
47567
|
label: "root",
|
|
@@ -48450,7 +48494,8 @@ const TooltipConfig = {
|
|
|
48450
48494
|
"md",
|
|
48451
48495
|
"lg"
|
|
48452
48496
|
]]
|
|
48453
|
-
} }
|
|
48497
|
+
} },
|
|
48498
|
+
userOverridableProperties: ["iconSize"]
|
|
48454
48499
|
},
|
|
48455
48500
|
root: {
|
|
48456
48501
|
label: "root",
|
|
@@ -49085,7 +49130,8 @@ const TooltipConfig = {
|
|
|
49085
49130
|
"always/accent"
|
|
49086
49131
|
]
|
|
49087
49132
|
]
|
|
49088
|
-
} }
|
|
49133
|
+
} },
|
|
49134
|
+
userOverridableProperties: ["color"]
|
|
49089
49135
|
},
|
|
49090
49136
|
root: {
|
|
49091
49137
|
label: "root",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/*! © 2026 Yahoo, Inc. UDS Mobile v0.0.0-development */
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const require_fontMetrics = require("../../mobile/generated/fontMetrics.cjs");
|
|
3
4
|
//#region src/components/Button/buttonTheme.ts
|
|
4
5
|
const SHARED_BUTTON_ICONBUTTON_SIZES = new Set([
|
|
5
6
|
"xs",
|
|
@@ -7,6 +8,7 @@ const SHARED_BUTTON_ICONBUTTON_SIZES = new Set([
|
|
|
7
8
|
"md",
|
|
8
9
|
"lg"
|
|
9
10
|
]);
|
|
11
|
+
const UNKNOWN_FONT_LINE_HEIGHT_RATIO = 1.3;
|
|
10
12
|
function buttonSizePath(size, layer) {
|
|
11
13
|
return `button/size/${size}/${layer}/rest`;
|
|
12
14
|
}
|
|
@@ -23,47 +25,85 @@ function getIconSize(iconStyle) {
|
|
|
23
25
|
function getVerticalPadding(rootStyle) {
|
|
24
26
|
return (typeof rootStyle.paddingVertical === "number" ? rootStyle.paddingVertical : void 0) ?? (typeof rootStyle.padding === "number" ? rootStyle.padding : void 0) ?? 0;
|
|
25
27
|
}
|
|
26
|
-
function
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
function getMetricHeight(value, unitsPerEm, fontSize) {
|
|
29
|
+
return Math.ceil(Math.max(0, value) / unitsPerEm * fontSize);
|
|
30
|
+
}
|
|
31
|
+
function getSafeLabelLineHeight(textStyle, fallbackFontSize) {
|
|
32
|
+
const fontSize = typeof textStyle.fontSize === "number" ? textStyle.fontSize : fallbackFontSize;
|
|
33
|
+
const tokenLineHeight = typeof textStyle.lineHeight === "number" ? textStyle.lineHeight : fontSize;
|
|
34
|
+
const metrics = typeof textStyle.fontFamily === "string" ? require_fontMetrics.fontMetrics[textStyle.fontFamily] : void 0;
|
|
35
|
+
if (!metrics || metrics.unitsPerEm <= 0) return Math.max(tokenLineHeight, Math.ceil(fontSize * UNKNOWN_FONT_LINE_HEIGHT_RATIO));
|
|
36
|
+
const metricsLineHeight = getMetricHeight(metrics.ascent, metrics.unitsPerEm, fontSize) + getMetricHeight(-metrics.descent, metrics.unitsPerEm, fontSize) + getMetricHeight(metrics.lineGap, metrics.unitsPerEm, fontSize);
|
|
37
|
+
return Math.max(tokenLineHeight, metricsLineHeight);
|
|
30
38
|
}
|
|
31
|
-
/**
|
|
32
|
-
function
|
|
39
|
+
/** Safe line box for the icon font's em square plus any bbox overflow. */
|
|
40
|
+
function getSafeIconCell(fontSize) {
|
|
41
|
+
const metrics = require_fontMetrics.fontMetrics["uds-icons"];
|
|
42
|
+
if (!metrics || metrics.unitsPerEm <= 0) return Math.ceil(fontSize * UNKNOWN_FONT_LINE_HEIGHT_RATIO);
|
|
43
|
+
const overflowAboveEm = Math.max(0, metrics.bbox.maxY - metrics.unitsPerEm);
|
|
44
|
+
const overflowBelowEm = Math.max(0, -metrics.bbox.minY);
|
|
45
|
+
return Math.ceil(fontSize) + getMetricHeight(overflowAboveEm, metrics.unitsPerEm, fontSize) + getMetricHeight(overflowBelowEm, metrics.unitsPerEm, fontSize);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Safe native content metrics while retaining the token-derived target control height.
|
|
49
|
+
*
|
|
50
|
+
* `fontScaleFactor` (the capped OS font scale, >= 1) pre-scales container
|
|
51
|
+
* metrics only. The returned `labelLineHeight`/`iconCellHeight` stay unscaled
|
|
52
|
+
* because they go into Text/Icon styles, which native multiplies by the same
|
|
53
|
+
* capped factor — container math must mirror that, not double-apply it.
|
|
54
|
+
*/
|
|
55
|
+
function getButtonControlMetrics(theme, size, fontScaleFactor = 1) {
|
|
33
56
|
const rootStyle = getLayerStyle(theme, buttonSizePath(size, "root"));
|
|
34
57
|
const iconStyle = getLayerStyle(theme, buttonSizePath(size, "icon"));
|
|
35
58
|
const textStyle = getLayerStyle(theme, buttonSizePath(size, "rootText"));
|
|
36
59
|
const paddingVertical = getVerticalPadding(rootStyle);
|
|
37
60
|
const iconSize = getIconSize(iconStyle);
|
|
38
|
-
const
|
|
61
|
+
const fontSize = typeof textStyle.fontSize === "number" ? textStyle.fontSize : iconSize;
|
|
62
|
+
const tokenLineHeight = typeof textStyle.lineHeight === "number" ? textStyle.lineHeight : fontSize;
|
|
63
|
+
const targetContentHeight = Math.max(iconSize, tokenLineHeight) * fontScaleFactor;
|
|
64
|
+
const minHeight = Math.ceil(paddingVertical * 2 + targetContentHeight);
|
|
65
|
+
const labelLineHeight = getSafeLabelLineHeight(textStyle, iconSize);
|
|
66
|
+
const iconCellHeight = getSafeIconCell(iconSize);
|
|
67
|
+
const safeContentHeight = Math.max(labelLineHeight, iconCellHeight) * fontScaleFactor;
|
|
39
68
|
return {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
69
|
+
minHeight,
|
|
70
|
+
labelLineHeight,
|
|
71
|
+
iconCellHeight,
|
|
72
|
+
paddingVertical: Math.max(0, (minHeight - safeContentHeight) / 2)
|
|
43
73
|
};
|
|
44
74
|
}
|
|
45
|
-
/**
|
|
46
|
-
|
|
75
|
+
/**
|
|
76
|
+
* Safe icon cell within the token-derived control size; explicit token height (match-button-height opt-in) wins as the target.
|
|
77
|
+
*
|
|
78
|
+
* `fontScaleFactor` behaves as in {@link getButtonControlMetrics}; an explicit
|
|
79
|
+
* token height stays fixed, with padding absorbing the scaled content.
|
|
80
|
+
*/
|
|
81
|
+
function getIconButtonControlMetrics(theme, size, fontScaleFactor = 1) {
|
|
47
82
|
const rootStyle = getLayerStyle(theme, iconButtonSizePath(size, "root"));
|
|
48
|
-
const
|
|
83
|
+
const iconStyle = getLayerStyle(theme, iconButtonSizePath(size, "icon"));
|
|
84
|
+
const iconSize = getIconSize(iconStyle);
|
|
85
|
+
const tokenLineHeight = typeof iconStyle.lineHeight === "number" ? iconStyle.lineHeight : iconSize;
|
|
86
|
+
const paddingVertical = getVerticalPadding(rootStyle);
|
|
49
87
|
const explicitHeight = typeof rootStyle.height === "number" ? rootStyle.height : void 0;
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
};
|
|
88
|
+
const hasExplicitHeight = SHARED_BUTTON_ICONBUTTON_SIZES.has(size) && explicitHeight !== void 0;
|
|
89
|
+
const minHeight = hasExplicitHeight ? explicitHeight : Math.ceil(paddingVertical * 2 + Math.max(iconSize, tokenLineHeight) * fontScaleFactor);
|
|
90
|
+
const iconCellHeight = getSafeIconCell(iconSize);
|
|
54
91
|
return {
|
|
55
|
-
|
|
56
|
-
|
|
92
|
+
minHeight,
|
|
93
|
+
iconCellHeight,
|
|
94
|
+
paddingVertical: Math.max(0, (minHeight - Math.max(iconSize, iconCellHeight) * fontScaleFactor) / 2),
|
|
95
|
+
hasExplicitHeight
|
|
57
96
|
};
|
|
58
97
|
}
|
|
59
|
-
/**
|
|
60
|
-
function
|
|
98
|
+
/** Apply the metric-safe line height after the token typography styles. */
|
|
99
|
+
function getButtonTextStyle(textStyle, labelLineHeight) {
|
|
61
100
|
return {
|
|
62
101
|
...textStyle,
|
|
63
|
-
lineHeight:
|
|
102
|
+
lineHeight: labelLineHeight
|
|
64
103
|
};
|
|
65
104
|
}
|
|
66
105
|
//#endregion
|
|
67
106
|
exports.getButtonControlMetrics = getButtonControlMetrics;
|
|
68
|
-
exports.
|
|
107
|
+
exports.getButtonTextStyle = getButtonTextStyle;
|
|
69
108
|
exports.getIconButtonControlMetrics = getIconButtonControlMetrics;
|
|
109
|
+
exports.getSafeIconCell = getSafeIconCell;
|
|
@@ -6,19 +6,36 @@ import { TextStyle } from "react-native";
|
|
|
6
6
|
type ButtonTheme = {
|
|
7
7
|
components: Record<string, any>;
|
|
8
8
|
};
|
|
9
|
-
/**
|
|
10
|
-
declare function
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
/** Safe line box for the icon font's em square plus any bbox overflow. */
|
|
10
|
+
declare function getSafeIconCell(fontSize: number): number;
|
|
11
|
+
/**
|
|
12
|
+
* Safe native content metrics while retaining the token-derived target control height.
|
|
13
|
+
*
|
|
14
|
+
* `fontScaleFactor` (the capped OS font scale, >= 1) pre-scales container
|
|
15
|
+
* metrics only. The returned `labelLineHeight`/`iconCellHeight` stay unscaled
|
|
16
|
+
* because they go into Text/Icon styles, which native multiplies by the same
|
|
17
|
+
* capped factor — container math must mirror that, not double-apply it.
|
|
18
|
+
*/
|
|
19
|
+
declare function getButtonControlMetrics(theme: ButtonTheme, size: ButtonSize, fontScaleFactor?: number): {
|
|
20
|
+
minHeight: number;
|
|
21
|
+
labelLineHeight: number;
|
|
22
|
+
iconCellHeight: number;
|
|
23
|
+
paddingVertical: number;
|
|
14
24
|
};
|
|
15
|
-
/**
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
25
|
+
/**
|
|
26
|
+
* Safe icon cell within the token-derived control size; explicit token height (match-button-height opt-in) wins as the target.
|
|
27
|
+
*
|
|
28
|
+
* `fontScaleFactor` behaves as in {@link getButtonControlMetrics}; an explicit
|
|
29
|
+
* token height stays fixed, with padding absorbing the scaled content.
|
|
30
|
+
*/
|
|
31
|
+
declare function getIconButtonControlMetrics(theme: ButtonTheme, size: IconButtonSize, fontScaleFactor?: number): {
|
|
32
|
+
minHeight: number;
|
|
33
|
+
iconCellHeight: number;
|
|
34
|
+
paddingVertical: number;
|
|
35
|
+
hasExplicitHeight: boolean;
|
|
19
36
|
};
|
|
20
|
-
/**
|
|
21
|
-
declare function
|
|
37
|
+
/** Apply the metric-safe line height after the token typography styles. */
|
|
38
|
+
declare function getButtonTextStyle(textStyle: TextStyle, labelLineHeight: number): TextStyle;
|
|
22
39
|
//#endregion
|
|
23
|
-
export { getButtonControlMetrics,
|
|
40
|
+
export { getButtonControlMetrics, getButtonTextStyle, getIconButtonControlMetrics, getSafeIconCell };
|
|
24
41
|
//# sourceMappingURL=buttonTheme.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buttonTheme.d.cts","names":[],"sources":["../../../src/components/Button/buttonTheme.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"buttonTheme.d.cts","names":[],"sources":["../../../src/components/Button/buttonTheme.ts"],"mappings":";;;;;KAKK,WAAA;EAEH,UAAA,EAAY,MAAA;AAAA;;iBA4DE,eAAA,CAAgB,QAAA;;;AAAhC;;;;;AAwBA;iBAAgB,uBAAA,CACd,KAAA,EAAO,WAAA,EACP,IAAA,EAAM,UAAA,EACN,eAAA;EAEA,SAAA;EACA,eAAA;EACA,cAAA;EACA,eAAA;AAAA;;;;;;;iBA8Bc,2BAAA,CACd,KAAA,EAAO,WAAA,EACP,IAAA,EAAM,cAAA,EACN,eAAA;EAEA,SAAA;EACA,cAAA;EACA,eAAA;EACA,iBAAA;AAAA;;iBA4Bc,kBAAA,CAAmB,SAAA,EAAW,SAAA,EAAW,eAAA,WAA0B,SAAA"}
|